]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.h
Minor refinement for USB modules.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbKbDxe / EfiKey.h
... / ...
CommitLineData
1/** @file\r
2 Header file for USB Keyboard Driver's Data Structures.\r
3\r
4Copyright (c) 2004 - 2008, Intel Corporation\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14#ifndef _EFI_USB_KB_H_\r
15#define _EFI_USB_KB_H_\r
16\r
17\r
18#include <Uefi.h>\r
19\r
20#include <Protocol/SimpleTextIn.h>\r
21#include <Protocol/SimpleTextInEx.h>\r
22#include <Protocol/HiiDatabase.h>\r
23#include <Protocol/UsbIo.h>\r
24#include <Protocol/DevicePath.h>\r
25#include <Guid/HiiKeyBoardLayout.h>\r
26#include <Guid/HotPlugDevice.h>\r
27\r
28#include <Library/DebugLib.h>\r
29#include <Library/ReportStatusCodeLib.h>\r
30#include <Library/BaseMemoryLib.h>\r
31#include <Library/UefiRuntimeServicesTableLib.h>\r
32#include <Library/UefiDriverEntryPoint.h>\r
33#include <Library/UefiBootServicesTableLib.h>\r
34#include <Library/UefiLib.h>\r
35#include <Library/MemoryAllocationLib.h>\r
36#include <Library/PcdLib.h>\r
37#include <Library/UefiUsbLib.h>\r
38#include <Library/BaseLib.h>\r
39#include <Library/UefiUsbLib.h>\r
40\r
41#include <IndustryStandard/Usb.h>\r
42\r
43#define MAX_KEY_ALLOWED 32\r
44\r
45#define HZ 1000 * 1000 * 10\r
46#define USBKBD_REPEAT_DELAY ((HZ) / 2)\r
47#define USBKBD_REPEAT_RATE ((HZ) / 50)\r
48\r
49#define CLASS_HID 3\r
50#define SUBCLASS_BOOT 1\r
51#define PROTOCOL_KEYBOARD 1\r
52\r
53#define BOOT_PROTOCOL 0\r
54#define REPORT_PROTOCOL 1\r
55\r
56typedef struct {\r
57 BOOLEAN Down;\r
58 UINT8 KeyCode;\r
59} USB_KEY;\r
60\r
61typedef struct {\r
62 USB_KEY Buffer[MAX_KEY_ALLOWED + 1];\r
63 UINT8 BufferHead;\r
64 UINT8 BufferTail;\r
65} USB_KB_BUFFER;\r
66\r
67#define USB_KB_DEV_SIGNATURE SIGNATURE_32 ('u', 'k', 'b', 'd')\r
68#define USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('u', 'k', 'b', 'x')\r
69\r
70typedef struct _KEYBOARD_CONSOLE_IN_EX_NOTIFY {\r
71 UINTN Signature;\r
72 EFI_HANDLE NotifyHandle;\r
73 EFI_KEY_DATA KeyData;\r
74 EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;\r
75 LIST_ENTRY NotifyEntry;\r
76} KEYBOARD_CONSOLE_IN_EX_NOTIFY;\r
77\r
78#define USB_NS_KEY_SIGNATURE SIGNATURE_32 ('u', 'n', 's', 'k')\r
79\r
80typedef struct {\r
81 UINTN Signature;\r
82 LIST_ENTRY Link;\r
83\r
84 //\r
85 // The number of EFI_NS_KEY_MODIFIER children definitions\r
86 //\r
87 UINTN KeyCount;\r
88\r
89 //\r
90 // NsKey[0] : Non-spacing key\r
91 // NsKey[1] ~ NsKey[KeyCount] : Physical keys\r
92 //\r
93 EFI_KEY_DESCRIPTOR *NsKey;\r
94} USB_NS_KEY;\r
95\r
96#define USB_NS_KEY_FORM_FROM_LINK(a) CR (a, USB_NS_KEY, Link, USB_NS_KEY_SIGNATURE)\r
97\r
98///\r
99/// Structure to describe USB keyboard device\r
100///\r
101typedef struct {\r
102 UINTN Signature;\r
103 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
104 EFI_EVENT DelayedRecoveryEvent;\r
105 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleInput;\r
106 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleInputEx;\r
107 EFI_USB_IO_PROTOCOL *UsbIo;\r
108\r
109 EFI_USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;\r
110 EFI_USB_ENDPOINT_DESCRIPTOR IntEndpointDescriptor;\r
111\r
112 USB_KB_BUFFER KeyboardBuffer;\r
113 BOOLEAN CtrlOn;\r
114 BOOLEAN AltOn;\r
115 BOOLEAN ShiftOn;\r
116 BOOLEAN NumLockOn;\r
117 BOOLEAN CapsOn;\r
118 BOOLEAN ScrollOn;\r
119 UINT8 LastKeyCodeArray[8];\r
120 UINT8 CurKeyCode;\r
121\r
122 UINT8 RepeatKey;\r
123 EFI_EVENT RepeatTimer;\r
124\r
125 EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
126 \r
127 BOOLEAN LeftCtrlOn;\r
128 BOOLEAN LeftAltOn;\r
129 BOOLEAN LeftShiftOn;\r
130 BOOLEAN LeftLogoOn;\r
131 BOOLEAN RightCtrlOn;\r
132 BOOLEAN RightAltOn;\r
133 BOOLEAN RightShiftOn;\r
134 BOOLEAN RightLogoOn; \r
135 BOOLEAN MenuKeyOn;\r
136 BOOLEAN SysReqOn;\r
137 BOOLEAN AltGrOn;\r
138\r
139 EFI_KEY_STATE KeyState;\r
140 //\r
141 // Notification function list\r
142 //\r
143 LIST_ENTRY NotifyList;\r
144\r
145 //\r
146 // Non-spacing key list\r
147 //\r
148 LIST_ENTRY NsKeyList;\r
149 USB_NS_KEY *CurrentNsKey;\r
150 EFI_KEY_DESCRIPTOR *KeyConvertionTable;\r
151 EFI_EVENT KeyboardLayoutEvent;\r
152} USB_KB_DEV;\r
153\r
154//\r
155// Global Variables\r
156//\r
157extern EFI_DRIVER_BINDING_PROTOCOL gUsbKeyboardDriverBinding;\r
158extern EFI_COMPONENT_NAME_PROTOCOL gUsbKeyboardComponentName;\r
159extern EFI_COMPONENT_NAME2_PROTOCOL gUsbKeyboardComponentName2;\r
160extern EFI_GUID gSimpleTextInExNotifyGuid;\r
161\r
162#define USB_KB_DEV_FROM_THIS(a) \\r
163 CR(a, USB_KB_DEV, SimpleInput, USB_KB_DEV_SIGNATURE)\r
164#define TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS(a) \\r
165 CR(a, USB_KB_DEV, SimpleInputEx, USB_KB_DEV_SIGNATURE)\r
166\r
167//\r
168// According to Universal Serial Bus HID Usage Tables document ver 1.12,\r
169// a Boot Keyboard should support the keycode range from 0x0 to 0x65 and 0xE0 to 0xE7.\r
170// 0xE0 to 0xE7 are for modifier keys, and 0x0 to 0x3 are reserved for typical\r
171// keyboard status or keyboard errors.\r
172// So the number of valid non-modifier USB keycodes is 0x62, and the number of\r
173// valid keycodes is 0x6A.\r
174//\r
175#define NUMBER_OF_VALID_NON_MODIFIER_USB_KEYCODE 0x62\r
176#define NUMBER_OF_VALID_USB_KEYCODE 0x6A\r
177//\r
178// 0x0 to 0x3 are reserved for typical keyboard status or keyboard errors.\r
179//\r
180#define USBKBD_VALID_KEYCODE(Key) ((UINT8) (Key) > 3)\r
181\r
182typedef struct {\r
183 UINT8 NumLock : 1;\r
184 UINT8 CapsLock : 1;\r
185 UINT8 ScrollLock : 1;\r
186 UINT8 Resrvd : 5;\r
187} LED_MAP;\r
188\r
189//\r
190// Functions of Driver Binding Protocol\r
191//\r
192/**\r
193 Check whether USB keyboard driver supports this device.\r
194\r
195 @param This The USB keyboard driver binding protocol.\r
196 @param Controller The controller handle to check.\r
197 @param RemainingDevicePath The remaining device path.\r
198\r
199 @retval EFI_SUCCESS The driver supports this controller.\r
200 @retval other This device isn't supported.\r
201\r
202**/\r
203EFI_STATUS\r
204EFIAPI\r
205USBKeyboardDriverBindingSupported (\r
206 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
207 IN EFI_HANDLE Controller,\r
208 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
209 );\r
210\r
211/**\r
212 Starts the keyboard device with this driver.\r
213\r
214 This function produces Simple Text Input Protocol and Simple Text Input Ex Protocol,\r
215 initializes the keyboard device, and submit Asynchronous Interrupt Transfer to manage\r
216 this keyboard device.\r
217\r
218 @param This The USB keyboard driver binding instance.\r
219 @param Controller Handle of device to bind driver to.\r
220 @param RemainingDevicePath Optional parameter use to pick a specific child\r
221 device to start.\r
222\r
223 @retval EFI_SUCCESS The controller is controlled by the usb keyboard driver.\r
224 @retval EFI_UNSUPPORTED No interrupt endpoint can be found.\r
225 @retval Other This controller cannot be started.\r
226\r
227**/\r
228EFI_STATUS\r
229EFIAPI\r
230USBKeyboardDriverBindingStart (\r
231 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
232 IN EFI_HANDLE Controller,\r
233 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
234 );\r
235\r
236/**\r
237 Stop the USB keyboard device handled by this driver.\r
238\r
239 @param This The USB keyboard driver binding protocol.\r
240 @param Controller The controller to release.\r
241 @param NumberOfChildren The number of handles in ChildHandleBuffer.\r
242 @param ChildHandleBuffer The array of child handle.\r
243\r
244 @retval EFI_SUCCESS The device was stopped.\r
245 @retval EFI_UNSUPPORTED Simple Text In Protocol or Simple Text In Ex Protocol\r
246 is not installed on Controller.\r
247 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
248 @retval Others Fail to uninstall protocols attached on the device.\r
249\r
250**/\r
251EFI_STATUS\r
252EFIAPI\r
253USBKeyboardDriverBindingStop (\r
254 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
255 IN EFI_HANDLE Controller,\r
256 IN UINTN NumberOfChildren,\r
257 IN EFI_HANDLE *ChildHandleBuffer\r
258 );\r
259\r
260//\r
261// EFI Component Name Functions\r
262//\r
263/**\r
264 Retrieves a Unicode string that is the user readable name of the driver.\r
265\r
266 This function retrieves the user readable name of a driver in the form of a\r
267 Unicode string. If the driver specified by This has a user readable name in\r
268 the language specified by Language, then a pointer to the driver name is\r
269 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
270 by This does not support the language specified by Language,\r
271 then EFI_UNSUPPORTED is returned.\r
272\r
273 @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
274 EFI_COMPONENT_NAME_PROTOCOL instance.\r
275 @param Language A pointer to a Null-terminated ASCII string\r
276 array indicating the language. This is the\r
277 language of the driver name that the caller is\r
278 requesting, and it must match one of the\r
279 languages specified in SupportedLanguages. The\r
280 number of languages supported by a driver is up\r
281 to the driver writer. Language is specified\r
282 in RFC 3066 or ISO 639-2 language code format.\r
283 @param DriverName A pointer to the Unicode string to return.\r
284 This Unicode string is the name of the\r
285 driver specified by This in the language\r
286 specified by Language.\r
287\r
288 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
289 This and the language specified by Language was\r
290 returned in DriverName.\r
291 @retval EFI_INVALID_PARAMETER Language is NULL.\r
292 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
293 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
294 the language specified by Language.\r
295\r
296**/\r
297EFI_STATUS\r
298EFIAPI\r
299UsbKeyboardComponentNameGetDriverName (\r
300 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
301 IN CHAR8 *Language,\r
302 OUT CHAR16 **DriverName\r
303 );\r
304\r
305/**\r
306 Retrieves a Unicode string that is the user readable name of the controller\r
307 that is being managed by a driver.\r
308\r
309 This function retrieves the user readable name of the controller specified by\r
310 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
311 driver specified by This has a user readable name in the language specified by\r
312 Language, then a pointer to the controller name is returned in ControllerName,\r
313 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
314 managing the controller specified by ControllerHandle and ChildHandle,\r
315 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
316 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
317\r
318 @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
319 EFI_COMPONENT_NAME_PROTOCOL instance.\r
320 @param ControllerHandle The handle of a controller that the driver\r
321 specified by This is managing. This handle\r
322 specifies the controller whose name is to be\r
323 returned.\r
324 @param ChildHandle The handle of the child controller to retrieve\r
325 the name of. This is an optional parameter that\r
326 may be NULL. It will be NULL for device\r
327 drivers. It will also be NULL for a bus drivers\r
328 that wish to retrieve the name of the bus\r
329 controller. It will not be NULL for a bus\r
330 driver that wishes to retrieve the name of a\r
331 child controller.\r
332 @param Language A pointer to a Null-terminated ASCII string\r
333 array indicating the language. This is the\r
334 language of the driver name that the caller is\r
335 requesting, and it must match one of the\r
336 languages specified in SupportedLanguages. The\r
337 number of languages supported by a driver is up\r
338 to the driver writer. Language is specified in\r
339 RFC 3066 or ISO 639-2 language code format.\r
340 @param ControllerName A pointer to the Unicode string to return.\r
341 This Unicode string is the name of the\r
342 controller specified by ControllerHandle and\r
343 ChildHandle in the language specified by\r
344 Language from the point of view of the driver\r
345 specified by This.\r
346\r
347 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
348 the language specified by Language for the\r
349 driver specified by This was returned in\r
350 DriverName.\r
351 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
352 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
353 EFI_HANDLE.\r
354 @retval EFI_INVALID_PARAMETER Language is NULL.\r
355 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
356 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
357 managing the controller specified by\r
358 ControllerHandle and ChildHandle.\r
359 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
360 the language specified by Language.\r
361\r
362**/\r
363EFI_STATUS\r
364EFIAPI\r
365UsbKeyboardComponentNameGetControllerName (\r
366 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
367 IN EFI_HANDLE ControllerHandle,\r
368 IN EFI_HANDLE ChildHandle OPTIONAL,\r
369 IN CHAR8 *Language,\r
370 OUT CHAR16 **ControllerName\r
371 );\r
372\r
373//\r
374// Functions of Simple Text Input Protocol\r
375//\r
376/**\r
377 Reset the input device and optionaly run diagnostics\r
378\r
379 There are 2 types of reset for USB keyboard.\r
380 For non-exhaustive reset, only keyboard buffer is cleared.\r
381 For exhaustive reset, in addition to clearance of keyboard buffer, the hardware status\r
382 is also re-initialized.\r
383\r
384 @param This Protocol instance pointer.\r
385 @param ExtendedVerification Driver may perform diagnostics on reset.\r
386\r
387 @retval EFI_SUCCESS The device was reset.\r
388 @retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset.\r
389\r
390**/\r
391EFI_STATUS\r
392EFIAPI\r
393USBKeyboardReset (\r
394 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r
395 IN BOOLEAN ExtendedVerification\r
396 );\r
397\r
398/**\r
399 Reads the next keystroke from the input device.\r
400\r
401 @param This The EFI_SIMPLE_TEXT_INPUT_PROTOCOL instance.\r
402 @param Key A pointer to a buffer that is filled in with the keystroke\r
403 information for the key that was pressed.\r
404\r
405 @retval EFI_SUCCESS The keystroke information was returned.\r
406 @retval EFI_NOT_READY There was no keystroke data availiable.\r
407 @retval EFI_DEVICE_ERROR The keydtroke information was not returned due to\r
408 hardware errors.\r
409\r
410**/\r
411EFI_STATUS\r
412EFIAPI\r
413USBKeyboardReadKeyStroke (\r
414 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r
415 OUT EFI_INPUT_KEY *Key\r
416 );\r
417\r
418//\r
419// Simple Text Input Ex protocol functions\r
420//\r
421/**\r
422 Resets the input device hardware.\r
423\r
424 The Reset() function resets the input device hardware. As part\r
425 of initialization process, the firmware/device will make a quick\r
426 but reasonable attempt to verify that the device is functioning.\r
427 If the ExtendedVerification flag is TRUE the firmware may take\r
428 an extended amount of time to verify the device is operating on\r
429 reset. Otherwise the reset operation is to occur as quickly as\r
430 possible. The hardware verification process is not defined by\r
431 this specification and is left up to the platform firmware or\r
432 driver to implement.\r
433\r
434 @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.\r
435\r
436 @param ExtendedVerification Indicates that the driver may perform a more exhaustive\r
437 verification operation of the device during reset.\r
438\r
439 @retval EFI_SUCCESS The device was reset.\r
440 @retval EFI_DEVICE_ERROR The device is not functioning correctly and could not be reset.\r
441\r
442**/\r
443EFI_STATUS\r
444EFIAPI\r
445USBKeyboardResetEx (\r
446 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
447 IN BOOLEAN ExtendedVerification\r
448 );\r
449\r
450/**\r
451 Reads the next keystroke from the input device.\r
452\r
453 @param This Protocol instance pointer.\r
454 @param KeyData A pointer to a buffer that is filled in with the keystroke\r
455 state data for the key that was pressed.\r
456\r
457 @retval EFI_SUCCESS The keystroke information was returned.\r
458 @retval EFI_NOT_READY There was no keystroke data available.\r
459 @retval EFI_DEVICE_ERROR The keystroke information was not returned due to\r
460 hardware errors.\r
461 @retval EFI_INVALID_PARAMETER KeyData is NULL.\r
462\r
463**/\r
464EFI_STATUS\r
465EFIAPI\r
466USBKeyboardReadKeyStrokeEx (\r
467 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
468 OUT EFI_KEY_DATA *KeyData\r
469 );\r
470\r
471/**\r
472 Set certain state for the input device.\r
473\r
474 @param This Protocol instance pointer.\r
475 @param KeyToggleState A pointer to the EFI_KEY_TOGGLE_STATE to set the\r
476 state for the input device.\r
477\r
478 @retval EFI_SUCCESS The device state was set appropriately.\r
479 @retval EFI_DEVICE_ERROR The device is not functioning correctly and could\r
480 not have the setting adjusted.\r
481 @retval EFI_UNSUPPORTED The device does not support the ability to have its state set.\r
482 @retval EFI_INVALID_PARAMETER KeyToggleState is NULL.\r
483\r
484**/\r
485EFI_STATUS\r
486EFIAPI\r
487USBKeyboardSetState (\r
488 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
489 IN EFI_KEY_TOGGLE_STATE *KeyToggleState\r
490 );\r
491\r
492/**\r
493 Register a notification function for a particular keystroke for the input device.\r
494\r
495 @param This Protocol instance pointer.\r
496 @param KeyData A pointer to a buffer that is filled in with the keystroke\r
497 information data for the key that was pressed.\r
498 @param KeyNotificationFunction Points to the function to be called when the key\r
499 sequence is typed specified by KeyData.\r
500 @param NotifyHandle Points to the unique handle assigned to the registered notification.\r
501\r
502 @retval EFI_SUCCESS The notification function was registered successfully.\r
503 @retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data structures.\r
504 @retval EFI_INVALID_PARAMETER KeyData or NotifyHandle or KeyNotificationFunction is NULL.\r
505\r
506**/\r
507EFI_STATUS\r
508EFIAPI\r
509USBKeyboardRegisterKeyNotify (\r
510 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
511 IN EFI_KEY_DATA *KeyData,\r
512 IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,\r
513 OUT EFI_HANDLE *NotifyHandle\r
514 );\r
515\r
516/**\r
517 Remove a registered notification function from a particular keystroke.\r
518\r
519 @param This Protocol instance pointer.\r
520 @param NotificationHandle The handle of the notification function being unregistered.\r
521\r
522 @retval EFI_SUCCESS The notification function was unregistered successfully.\r
523 @retval EFI_INVALID_PARAMETER The NotificationHandle is invalid\r
524 @retval EFI_NOT_FOUND Cannot find the matching entry in database.\r
525\r
526**/\r
527EFI_STATUS\r
528EFIAPI\r
529USBKeyboardUnregisterKeyNotify (\r
530 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
531 IN EFI_HANDLE NotificationHandle\r
532 );\r
533\r
534/**\r
535 Event notification function registered for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx\r
536 and EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey.\r
537\r
538 @param Event Event to be signaled when a key is pressed.\r
539 @param Context Points to USB_KB_DEV instance.\r
540\r
541**/\r
542VOID\r
543EFIAPI\r
544USBKeyboardWaitForKey (\r
545 IN EFI_EVENT Event,\r
546 IN VOID *Context\r
547 );\r
548\r
549/**\r
550 Free keyboard notify list.\r
551\r
552 @param NotifyList The keyboard notify list to free.\r
553\r
554 @retval EFI_SUCCESS Free the notify list successfully.\r
555 @retval EFI_INVALID_PARAMETER NotifyList is NULL.\r
556\r
557**/\r
558EFI_STATUS\r
559EFIAPI\r
560KbdFreeNotifyList (\r
561 IN OUT LIST_ENTRY *NotifyList\r
562 );\r
563\r
564/**\r
565 Check whether there is key pending in the keyboard buffer.\r
566\r
567 @param UsbKeyboardDevice The USB_KB_DEV instance.\r
568\r
569 @retval EFI_SUCCESS There is pending key to read.\r
570 @retval EFI_NOT_READY No pending key to read.\r
571\r
572**/\r
573EFI_STATUS\r
574EFIAPI\r
575USBKeyboardCheckForKey (\r
576 IN OUT USB_KB_DEV *UsbKeyboardDevice\r
577 );\r
578\r
579/**\r
580 Check whether the pressed key matches a registered key or not.\r
581\r
582 @param RegsiteredData A pointer to keystroke data for the key that was registered.\r
583 @param InputData A pointer to keystroke data for the key that was pressed.\r
584\r
585 @retval TRUE Key pressed matches a registered key.\r
586 @retval FLASE Key pressed does not matche a registered key.\r
587\r
588**/\r
589BOOLEAN\r
590EFIAPI\r
591IsKeyRegistered (\r
592 IN EFI_KEY_DATA *RegsiteredData,\r
593 IN EFI_KEY_DATA *InputData\r
594 );\r
595\r
596#endif\r
597\r