]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.h
Clean up the private GUID definition in module Level.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbKbDxe / EfiKey.h
index ec240457b54c2d7c0e2b9b4f0ef95804d96a5b84..2066c38e7e9a654b8caf0b5ffad66b87efa8e251 100644 (file)
@@ -1,8 +1,8 @@
 /** @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
@@ -24,6 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #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
@@ -35,9 +36,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #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
@@ -57,10 +61,11 @@ typedef struct {
 } 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
@@ -98,6 +103,7 @@ typedef struct {
 ///\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
@@ -107,7 +113,8 @@ typedef struct {
   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
@@ -117,6 +124,8 @@ typedef struct {
   UINT8                             LastKeyCodeArray[8];\r
   UINT8                             CurKeyCode;\r
 \r
+  EFI_EVENT                         TimerEvent;\r
+\r
   UINT8                             RepeatKey;\r
   EFI_EVENT                         RepeatTimer;\r
 \r
@@ -133,8 +142,6 @@ typedef struct {
   BOOLEAN                           MenuKeyOn;\r
   BOOLEAN                           SysReqOn;\r
   BOOLEAN                           AltGrOn;\r
-\r
-  EFI_KEY_STATE                     KeyState;\r
   //\r
   // Notification function list\r
   //\r
@@ -276,7 +283,7 @@ USBKeyboardDriverBindingStop (
                                 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
@@ -333,7 +340,7 @@ UsbKeyboardComponentNameGetDriverName (
                                 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
@@ -553,26 +560,10 @@ USBKeyboardWaitForKey (
 \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
@@ -584,11 +575,23 @@ USBKeyboardCheckForKey (
 \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