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