/** @file\r
Function prototype for USB Keyboard Driver.\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
\r
#include "EfiKey.h"\r
\r
-#define USB_KEYBOARD_LAYOUT_PACKAGE_GUID \\r
- { \\r
- 0xc0f3b43, 0x44de, 0x4907, { 0xb4, 0x78, 0x22, 0x5f, 0x6f, 0x62, 0x89, 0xdc } \\r
- }\r
-\r
-#define USB_KEYBOARD_LAYOUT_KEY_GUID \\r
- { \\r
- 0x3a4d7a7c, 0x18a, 0x4b42, { 0x81, 0xb3, 0xdc, 0x10, 0xe3, 0xb5, 0x91, 0xbd } \\r
- }\r
-\r
#define USB_KEYBOARD_KEY_COUNT 104\r
\r
#define USB_KEYBOARD_LANGUAGE_STR_LEN 5 // RFC4646 Language Code: "en-US"\r
\r
**/\r
BOOLEAN\r
-EFIAPI\r
IsUSBKeyboard (\r
IN EFI_USB_IO_PROTOCOL *UsbIo\r
);\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
InitUSBKeyboard (\r
IN OUT USB_KB_DEV *UsbKeyboardDevice\r
);\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
InitKeyboardLayout (\r
OUT USB_KB_DEV *UsbKeyboardDevice\r
);\r
\r
**/\r
VOID\r
-EFIAPI\r
ReleaseKeyboardLayoutResources (\r
IN OUT USB_KB_DEV *UsbKeyboardDevice\r
);\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
USBParseKey (\r
IN OUT USB_KB_DEV *UsbKeyboardDevice,\r
OUT UINT8 *KeyCode\r
\r
@param UsbKeyboardDevice The USB_KB_DEV instance.\r
@param KeyCode Indicates the key code that will be interpreted.\r
- @param Key A pointer to a buffer that is filled in with\r
+ @param KeyData A pointer to a buffer that is filled in with\r
the keystroke information for the key that\r
was pressed.\r
\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
UsbKeyCodeToEfiInputKey (\r
IN USB_KB_DEV *UsbKeyboardDevice,\r
IN UINT8 KeyCode,\r
- OUT EFI_INPUT_KEY *Key\r
+ OUT EFI_KEY_DATA *KeyData\r
);\r
\r
+\r
/**\r
- Resets USB keyboard buffer.\r
+ Create the queue.\r
\r
- @param KeyboardBuffer Points to the USB keyboard buffer.\r
+ @param Queue Points to the queue.\r
+ @param ItemSize Size of the single item.\r
\r
**/\r
VOID\r
-EFIAPI\r
-InitUSBKeyBuffer (\r
- OUT USB_KB_BUFFER *KeyboardBuffer\r
+InitQueue (\r
+ IN OUT USB_SIMPLE_QUEUE *Queue,\r
+ IN UINTN ItemSize\r
+ );\r
+\r
+/**\r
+ Destroy the queue\r
+\r
+ @param Queue Points to the queue.\r
+**/\r
+VOID\r
+DestroyQueue (\r
+ IN OUT USB_SIMPLE_QUEUE *Queue\r
);\r
\r
+\r
/**\r
- Check whether USB keyboard buffer is empty.\r
+ Check whether the queue is empty.\r
\r
- @param KeyboardBuffer USB keyboard buffer\r
+ @param Queue Points to the queue.\r
\r
- @retval TRUE Keyboard buffer is empty.\r
- @retval FALSE Keyboard buffer is not empty.\r
+ @retval TRUE Queue is empty.\r
+ @retval FALSE Queue is not empty.\r
\r
**/\r
BOOLEAN\r
-EFIAPI\r
-IsUSBKeyboardBufferEmpty (\r
- IN USB_KB_BUFFER *KeyboardBuffer\r
+IsQueueEmpty (\r
+ IN USB_SIMPLE_QUEUE *Queue\r
);\r
\r
+\r
/**\r
- Check whether USB keyboard buffer is full.\r
+ Check whether the queue is full.\r
\r
- @param KeyboardBuffer USB keyboard buffer\r
+ @param Queue Points to the queue.\r
\r
- @retval TRUE Keyboard buffer is full.\r
- @retval FALSE Keyboard buffer is not full.\r
+ @retval TRUE Queue is full.\r
+ @retval FALSE Queue is not full.\r
\r
**/\r
BOOLEAN\r
-EFIAPI\r
-IsUSBKeyboardBufferFull (\r
- IN USB_KB_BUFFER *KeyboardBuffer\r
+IsQueueFull (\r
+ IN USB_SIMPLE_QUEUE *Queue\r
);\r
\r
-/**\r
- Inserts a keycode into keyboard buffer.\r
\r
- @param KeyboardBuffer Points to the USB keyboard buffer.\r
- @param Key Keycode to insert.\r
- @param Down TRUE means key is pressed.\r
- FALSE means key is released.\r
+/**\r
+ Enqueue the item to the queue.\r
\r
+ @param Queue Points to the queue.\r
+ @param Item Points to the item to be enqueued.\r
+ @param ItemSize Size of the item.\r
**/\r
VOID\r
-EFIAPI\r
-InsertKeyCode (\r
- IN OUT USB_KB_BUFFER *KeyboardBuffer,\r
- IN UINT8 Key,\r
- IN BOOLEAN Down\r
+Enqueue (\r
+ IN OUT USB_SIMPLE_QUEUE *Queue,\r
+ IN VOID *Item,\r
+ IN UINTN ItemSize\r
);\r
\r
+\r
/**\r
- Remove a keycode from keyboard buffer and return it.\r
+ Dequeue a item from the queue.\r
\r
- @param KeyboardBuffer Points to the USB keyboard buffer.\r
- @param UsbKey Points to the buffer that contains keycode for output.\r
+ @param Queue Points to the queue.\r
+ @param Item Receives the item.\r
+ @param ItemSize Size of the item.\r
\r
- @retval EFI_SUCCESS Keycode successfully removed from keyboard buffer.\r
- @retval EFI_DEVICE_ERROR Keyboard buffer is empty.\r
+ @retval EFI_SUCCESS Item was successfully dequeued.\r
+ @retval EFI_DEVICE_ERROR The queue is empty.\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
-RemoveKeyCode (\r
- IN OUT USB_KB_BUFFER *KeyboardBuffer,\r
- OUT USB_KEY *UsbKey\r
+Dequeue (\r
+ IN OUT USB_SIMPLE_QUEUE *Queue,\r
+ OUT VOID *Item,\r
+ IN UINTN ItemSize\r
);\r
\r
/**\r
\r
**/\r
VOID\r
-EFIAPI\r
SetKeyLED (\r
IN USB_KB_DEV *UsbKeyboardDevice\r
);\r