/** @file\r
PS/2 keyboard driver header file\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#ifndef _PS2KEYBOARD_H_\r
#define _PS2KEYBOARD_H_\r
\r
-#include <FrameworkDxe.h>\r
+#include <Uefi.h>\r
\r
#include <Protocol/SimpleTextIn.h>\r
#include <Protocol/SimpleTextInEx.h>\r
\r
typedef struct _KEYBOARD_CONSOLE_IN_EX_NOTIFY {\r
UINTN Signature;\r
- EFI_HANDLE NotifyHandle;\r
EFI_KEY_DATA KeyData;\r
EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;\r
LIST_ENTRY NotifyEntry;\r
BOOLEAN LeftAlt;\r
BOOLEAN RightAlt;\r
BOOLEAN LeftShift;\r
- BOOLEAN RightShift; \r
+ BOOLEAN RightShift;\r
BOOLEAN LeftLogo;\r
BOOLEAN RightLogo;\r
BOOLEAN Menu;\r
BOOLEAN NumLock;\r
BOOLEAN ScrollLock;\r
\r
+ BOOLEAN IsSupportPartialKey;\r
//\r
// Queue storing key scancodes\r
//\r
SCAN_CODE_QUEUE ScancodeQueue;\r
EFI_KEY_QUEUE EfiKeyQueue;\r
+ EFI_KEY_QUEUE EfiKeyQueueForNotify;\r
\r
//\r
// Error state\r
// Notification Function List\r
//\r
LIST_ENTRY NotifyList;\r
+ EFI_EVENT KeyNotifyProcessEvent;\r
} KEYBOARD_CONSOLE_IN_DEV;\r
\r
#define KEYBOARD_CONSOLE_IN_DEV_FROM_THIS(a) CR (a, KEYBOARD_CONSOLE_IN_DEV, ConIn, KEYBOARD_CONSOLE_IN_DEV_SIGNATURE)\r
/**\r
The user Entry Point for module Ps2Keyboard. The user code starts with this function.\r
\r
- @param[in] ImageHandle The firmware allocated handle for the EFI image. \r
+ @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
@param[in] SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The entry point is executed successfully.\r
@retval other Some error occurs when executing this entry point.\r
\r
#define SCANCODE_LEFT_LOGO_BREAK 0xDB\r
#define SCANCODE_RIGHT_LOGO_MAKE 0x5C\r
#define SCANCODE_RIGHT_LOGO_BREAK 0xDC\r
-#define SCANCODE_MENU_MAKE 0x5D //APPS key defined in Keyboard scan code \r
+#define SCANCODE_MENU_MAKE 0x5D //APPS key defined in Keyboard scan code\r
#define SCANCODE_MENU_BREAK 0xDD\r
#define SCANCODE_SYS_REQ_MAKE 0x37\r
#define SCANCODE_SYS_REQ_BREAK 0xB7\r
indicators in ConsoleIn.\r
\r
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r
- \r
+\r
@return status\r
\r
**/\r
IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r
);\r
\r
+/**\r
+ Process key notify.\r
+\r
+ @param Event Indicates the event that invoke this function.\r
+ @param Context Indicates the calling context.\r
+**/\r
+VOID\r
+EFIAPI\r
+KeyNotifyProcessHandler (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ );\r
+\r
/**\r
Perform 8042 controller and keyboard Initialization.\r
If ExtendedVerification is TRUE, do additional test for\r
Perform 8042 controller and keyboard initialization\r
\r
@param This Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r
- @param ExtendedVerification Indicate that the driver may perform a more \r
- exhaustive verification operation of the device during \r
- reset, now this par is ignored in this driver \r
+ @param ExtendedVerification Indicate that the driver may perform a more\r
+ exhaustive verification operation of the device during\r
+ reset, now this par is ignored in this driver\r
\r
**/\r
EFI_STATUS\r
Retrieve key values for driver user.\r
\r
@param This Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r
- @param Key The output buffer for key value \r
+ @param Key The output buffer for key value\r
\r
@retval EFI_SUCCESS success to read key stroke\r
**/\r
KeyboardWaitForKeyEx (\r
IN EFI_EVENT Event,\r
IN VOID *Context\r
- ); \r
+ );\r
\r
//\r
// Simple Text Input Ex protocol function prototypes\r
@param ExtendedVerification - Driver may perform diagnostics on reset.\r
\r
@retval EFI_SUCCESS - The device was reset.\r
- @retval EFI_DEVICE_ERROR - The device is not functioning properly and could \r
+ @retval EFI_DEVICE_ERROR - The device is not functioning properly and could\r
not be reset.\r
\r
**/\r
);\r
\r
/**\r
- Reads the next keystroke from the input device. The WaitForKey Event can \r
+ Reads the next keystroke from the input device. The WaitForKey Event can\r
be used to test for existance of a keystroke via WaitForEvent () call.\r
\r
\r
@param This - Protocol instance pointer.\r
- @param KeyData - A pointer to a buffer that is filled in with the keystroke \r
+ @param KeyData - A pointer to a buffer that is filled in with the keystroke\r
state data for the key that was pressed.\r
\r
@retval EFI_SUCCESS - The keystroke information was returned.\r
@retval EFI_NOT_READY - There was no keystroke data availiable.\r
- @retval EFI_DEVICE_ERROR - The keystroke information was not returned due to \r
+ @retval EFI_DEVICE_ERROR - The keystroke information was not returned due to\r
hardware errors.\r
- @retval EFI_INVALID_PARAMETER - KeyData is NULL. \r
+ @retval EFI_INVALID_PARAMETER - KeyData is NULL.\r
\r
**/\r
EFI_STATUS\r
Set certain state for the input device.\r
\r
@param This - Protocol instance pointer.\r
- @param KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the \r
+ @param KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the\r
state for the input device.\r
\r
@retval EFI_SUCCESS - The device state was set successfully.\r
- @retval EFI_DEVICE_ERROR - The device is not functioning correctly and could \r
+ @retval EFI_DEVICE_ERROR - The device is not functioning correctly and could\r
not have the setting adjusted.\r
@retval EFI_UNSUPPORTED - The device does not have the ability to set its state.\r
- @retval EFI_INVALID_PARAMETER - KeyToggleState is NULL. \r
+ @retval EFI_INVALID_PARAMETER - KeyToggleState is NULL.\r
\r
**/\r
EFI_STATUS\r
Register a notification function for a particular keystroke for the input device.\r
\r
@param This - Protocol instance pointer.\r
- @param KeyData - A pointer to a buffer that is filled in with the keystroke \r
+ @param KeyData - A pointer to a buffer that is filled in with the keystroke\r
information data for the key that was pressed.\r
- @param KeyNotificationFunction - Points to the function to be called when the key \r
- sequence is typed specified by KeyData. \r
- @param NotifyHandle - Points to the unique handle assigned to the registered notification. \r
+ @param KeyNotificationFunction - Points to the function to be called when the key\r
+ sequence is typed specified by KeyData.\r
+ @param NotifyHandle - Points to the unique handle assigned to the registered notification.\r
\r
@retval EFI_SUCCESS - The notification function was registered successfully.\r
@retval EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.\r
- @retval EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL. \r
- \r
-**/ \r
+ @retval EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
KeyboardRegisterKeyNotify (\r
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
IN EFI_KEY_DATA *KeyData,\r
IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,\r
- OUT EFI_HANDLE *NotifyHandle\r
+ OUT VOID **NotifyHandle\r
);\r
\r
/**\r
Remove a registered notification function from a particular keystroke.\r
\r
- @param This - Protocol instance pointer. \r
+ @param This - Protocol instance pointer.\r
@param NotificationHandle - The handle of the notification function being unregistered.\r
\r
- \r
+\r
@retval EFI_SUCCESS - The notification function was unregistered successfully.\r
@retval EFI_INVALID_PARAMETER - The NotificationHandle is invalid.\r
- @retval EFI_NOT_FOUND - Can not find the matching entry in database. \r
- \r
-**/ \r
+ @retval EFI_NOT_FOUND - Can not find the matching entry in database.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
KeyboardUnregisterKeyNotify (\r
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
- IN EFI_HANDLE NotificationHandle\r
+ IN VOID *NotificationHandle\r
);\r
\r
/**\r
/**\r
Judge whether is a registed key\r
\r
- @param RegsiteredData A pointer to a buffer that is filled in with the keystroke \r
+ @param RegsiteredData A pointer to a buffer that is filled in with the keystroke\r
state data for the key that was registered.\r
- @param InputData A pointer to a buffer that is filled in with the keystroke \r
+ @param InputData A pointer to a buffer that is filled in with the keystroke\r
state data for the key that was pressed.\r
\r
@retval TRUE Key be pressed matches a registered key.\r
- @retval FLASE Match failed. \r
- \r
+ @retval FLASE Match failed.\r
+\r
**/\r
BOOLEAN\r
IsKeyRegistered (\r
IN EFI_KEY_DATA *RegsiteredData,\r
IN EFI_KEY_DATA *InputData\r
);\r
+\r
#endif\r