/** @file\r
Header file for USB Keyboard Driver's Data Structures.\r
\r
-Copyright (c) 2004 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2004 - 2011, 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
http://opensource.org/licenses/bsd-license.php\r
#include <Protocol/DevicePath.h>\r
\r
#include <Guid/HiiKeyBoardLayout.h>\r
+#include <Guid/UsbKeyBoardLayout.h>\r
\r
#include <Library/DebugLib.h>\r
#include <Library/ReportStatusCodeLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/PcdLib.h>\r
#include <Library/UefiUsbLib.h>\r
+#include <Library/HiiLib.h>\r
\r
#include <IndustryStandard/Usb.h>\r
\r
+#define KEYBOARD_TIMER_INTERVAL 200000 // 0.02s\r
+\r
#define MAX_KEY_ALLOWED 32\r
\r
#define HZ 1000 * 1000 * 10\r
} USB_KEY;\r
\r
typedef struct {\r
- USB_KEY Buffer[MAX_KEY_ALLOWED + 1];\r
- UINT8 BufferHead;\r
- UINT8 BufferTail;\r
-} USB_KB_BUFFER;\r
+ VOID *Buffer[MAX_KEY_ALLOWED + 1];\r
+ UINTN Head;\r
+ UINTN Tail;\r
+ UINTN ItemSize;\r
+} USB_SIMPLE_QUEUE;\r
\r
#define USB_KB_DEV_SIGNATURE SIGNATURE_32 ('u', 'k', 'b', 'd')\r
#define USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('u', 'k', 'b', 'x')\r
///\r
typedef struct {\r
UINTN Signature;\r
+ EFI_HANDLE ControllerHandle;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
EFI_EVENT DelayedRecoveryEvent;\r
EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleInput;\r
EFI_USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;\r
EFI_USB_ENDPOINT_DESCRIPTOR IntEndpointDescriptor;\r
\r
- USB_KB_BUFFER KeyboardBuffer;\r
+ USB_SIMPLE_QUEUE UsbKeyQueue;\r
+ USB_SIMPLE_QUEUE EfiKeyQueue;\r
BOOLEAN CtrlOn;\r
BOOLEAN AltOn;\r
BOOLEAN ShiftOn;\r
UINT8 LastKeyCodeArray[8];\r
UINT8 CurKeyCode;\r
\r
+ EFI_EVENT TimerEvent;\r
+\r
UINT8 RepeatKey;\r
EFI_EVENT RepeatTimer;\r
\r
EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
- \r
+\r
BOOLEAN LeftCtrlOn;\r
BOOLEAN LeftAltOn;\r
BOOLEAN LeftShiftOn;\r
BOOLEAN RightCtrlOn;\r
BOOLEAN RightAltOn;\r
BOOLEAN RightShiftOn;\r
- BOOLEAN RightLogoOn; \r
+ BOOLEAN RightLogoOn;\r
BOOLEAN MenuKeyOn;\r
BOOLEAN SysReqOn;\r
BOOLEAN AltGrOn;\r
\r
+ BOOLEAN IsSupportPartialKey;\r
+\r
EFI_KEY_STATE KeyState;\r
//\r
// Notification function list\r
languages specified in SupportedLanguages. The\r
number of languages supported by a driver is up\r
to the driver writer. Language is specified\r
- in RFC 3066 or ISO 639-2 language code format.\r
+ in RFC 4646 or ISO 639-2 language code format.\r
@param DriverName A pointer to the Unicode string to return.\r
This Unicode string is the name of the\r
driver specified by This in the language\r
languages specified in SupportedLanguages. The\r
number of languages supported by a driver is up\r
to the driver writer. Language is specified in\r
- RFC 3066 or ISO 639-2 language code format.\r
+ RFC 4646 or ISO 639-2 language code format.\r
@param ControllerName A pointer to the Unicode string to return.\r
This Unicode string is the name of the\r
controller specified by ControllerHandle and\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
KbdFreeNotifyList (\r
IN OUT LIST_ENTRY *NotifyList\r
);\r
\r
-/**\r
- Check whether there is key pending in the keyboard buffer.\r
-\r
- @param UsbKeyboardDevice The USB_KB_DEV instance.\r
-\r
- @retval EFI_SUCCESS There is pending key to read.\r
- @retval EFI_NOT_READY No pending key to read.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-USBKeyboardCheckForKey (\r
- IN OUT USB_KB_DEV *UsbKeyboardDevice\r
- );\r
-\r
/**\r
Check whether the pressed key matches a registered key or not.\r
\r
\r
**/\r
BOOLEAN\r
-EFIAPI\r
IsKeyRegistered (\r
IN EFI_KEY_DATA *RegsiteredData,\r
IN EFI_KEY_DATA *InputData\r
);\r
\r
+/**\r
+ Timer handler to convert the key from USB.\r
+\r
+ @param Event Indicates the event that invoke this function.\r
+ @param Context Indicates the calling context.\r
+**/\r
+VOID\r
+EFIAPI\r
+USBKeyboardTimerHandler (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ );\r
+\r
#endif\r
\r