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