]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | PS/2 keyboard driver header file\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r | |
5 | 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 | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _PS2KEYBOARD_H_\r | |
16 | #define _PS2KEYBOARD_H_\r | |
17 | \r | |
18 | #include <FrameworkDxe.h>\r | |
19 | \r | |
20 | #include <Protocol/SimpleTextIn.h>\r | |
21 | #include <Protocol/SimpleTextInEx.h>\r | |
22 | #include <Protocol/IsaIo.h>\r | |
23 | #include <Protocol/DevicePath.h>\r | |
24 | #include <Protocol/Ps2Policy.h>\r | |
25 | \r | |
26 | #include <Library/UefiDriverEntryPoint.h>\r | |
27 | #include <Library/UefiLib.h>\r | |
28 | #include <Library/UefiBootServicesTableLib.h>\r | |
29 | #include <Library/ReportStatusCodeLib.h>\r | |
30 | #include <Library/DebugLib.h>\r | |
31 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
32 | #include <Library/MemoryAllocationLib.h>\r | |
33 | #include <Library/BaseLib.h>\r | |
34 | #include <Library/BaseMemoryLib.h>\r | |
35 | #include <Library/TimerLib.h>\r | |
36 | \r | |
37 | //\r | |
38 | // Global Variables\r | |
39 | //\r | |
40 | extern EFI_DRIVER_BINDING_PROTOCOL gKeyboardControllerDriver;\r | |
41 | extern EFI_COMPONENT_NAME_PROTOCOL gPs2KeyboardComponentName;\r | |
42 | extern EFI_COMPONENT_NAME2_PROTOCOL gPs2KeyboardComponentName2;\r | |
43 | \r | |
44 | //\r | |
45 | // Driver Private Data\r | |
46 | //\r | |
47 | #define KEYBOARD_CONSOLE_IN_DEV_SIGNATURE SIGNATURE_32 ('k', 'k', 'e', 'y')\r | |
48 | #define KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('k', 'c', 'e', 'n')\r | |
49 | \r | |
50 | typedef struct _KEYBOARD_CONSOLE_IN_EX_NOTIFY {\r | |
51 | UINTN Signature;\r | |
52 | EFI_HANDLE NotifyHandle;\r | |
53 | EFI_KEY_DATA KeyData;\r | |
54 | EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;\r | |
55 | LIST_ENTRY NotifyEntry;\r | |
56 | } KEYBOARD_CONSOLE_IN_EX_NOTIFY;\r | |
57 | \r | |
58 | #define KEYBOARD_SCAN_CODE_MAX_COUNT 32\r | |
59 | typedef struct {\r | |
60 | UINT8 Buffer[KEYBOARD_SCAN_CODE_MAX_COUNT];\r | |
61 | UINTN Head;\r | |
62 | UINTN Tail;\r | |
63 | } SCAN_CODE_QUEUE;\r | |
64 | \r | |
65 | #define KEYBOARD_EFI_KEY_MAX_COUNT 256\r | |
66 | typedef struct {\r | |
67 | EFI_KEY_DATA Buffer[KEYBOARD_EFI_KEY_MAX_COUNT];\r | |
68 | UINTN Head;\r | |
69 | UINTN Tail;\r | |
70 | } EFI_KEY_QUEUE;\r | |
71 | \r | |
72 | typedef struct {\r | |
73 | UINTN Signature;\r | |
74 | \r | |
75 | EFI_HANDLE Handle;\r | |
76 | EFI_SIMPLE_TEXT_INPUT_PROTOCOL ConIn;\r | |
77 | EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL ConInEx;\r | |
78 | EFI_ISA_IO_PROTOCOL *IsaIo;\r | |
79 | \r | |
80 | EFI_EVENT TimerEvent;\r | |
81 | \r | |
82 | UINT32 DataRegisterAddress;\r | |
83 | UINT32 StatusRegisterAddress;\r | |
84 | UINT32 CommandRegisterAddress;\r | |
85 | \r | |
86 | BOOLEAN LeftShift;\r | |
87 | BOOLEAN RightShift; \r | |
88 | BOOLEAN LeftLogo;\r | |
89 | BOOLEAN RightLogo;\r | |
90 | BOOLEAN Menu;\r | |
91 | BOOLEAN SysReq;\r | |
92 | \r | |
93 | BOOLEAN Ctrl;\r | |
94 | BOOLEAN Alt;\r | |
95 | BOOLEAN Shift;\r | |
96 | BOOLEAN CapsLock;\r | |
97 | BOOLEAN NumLock;\r | |
98 | BOOLEAN ScrollLock;\r | |
99 | \r | |
100 | //\r | |
101 | // Queue storing key scancodes\r | |
102 | //\r | |
103 | SCAN_CODE_QUEUE ScancodeQueue;\r | |
104 | EFI_KEY_QUEUE EfiKeyQueue;\r | |
105 | \r | |
106 | //\r | |
107 | // Error state\r | |
108 | //\r | |
109 | BOOLEAN KeyboardErr;\r | |
110 | \r | |
111 | EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r | |
112 | \r | |
113 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
114 | //\r | |
115 | // Notification Function List\r | |
116 | //\r | |
117 | LIST_ENTRY NotifyList;\r | |
118 | } KEYBOARD_CONSOLE_IN_DEV;\r | |
119 | \r | |
120 | #define KEYBOARD_CONSOLE_IN_DEV_FROM_THIS(a) CR (a, KEYBOARD_CONSOLE_IN_DEV, ConIn, KEYBOARD_CONSOLE_IN_DEV_SIGNATURE)\r | |
121 | #define TEXT_INPUT_EX_KEYBOARD_CONSOLE_IN_DEV_FROM_THIS(a) \\r | |
122 | CR (a, \\r | |
123 | KEYBOARD_CONSOLE_IN_DEV, \\r | |
124 | ConInEx, \\r | |
125 | KEYBOARD_CONSOLE_IN_DEV_SIGNATURE \\r | |
126 | )\r | |
127 | \r | |
128 | #define TABLE_END 0x0\r | |
129 | \r | |
130 | //\r | |
131 | // Driver entry point\r | |
132 | //\r | |
133 | /**\r | |
134 | The user Entry Point for module Ps2Keyboard. The user code starts with this function.\r | |
135 | \r | |
136 | @param[in] ImageHandle The firmware allocated handle for the EFI image. \r | |
137 | @param[in] SystemTable A pointer to the EFI System Table.\r | |
138 | \r | |
139 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
140 | @retval other Some error occurs when executing this entry point.\r | |
141 | \r | |
142 | **/\r | |
143 | EFI_STATUS\r | |
144 | EFIAPI\r | |
145 | InstallPs2KeyboardDriver (\r | |
146 | IN EFI_HANDLE ImageHandle,\r | |
147 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
148 | );\r | |
149 | \r | |
150 | #define KEYBOARD_8042_DATA_REGISTER 0x60\r | |
151 | #define KEYBOARD_8042_STATUS_REGISTER 0x64\r | |
152 | #define KEYBOARD_8042_COMMAND_REGISTER 0x64\r | |
153 | \r | |
154 | #define KEYBOARD_KBEN 0xF4\r | |
155 | #define KEYBOARD_CMDECHO_ACK 0xFA\r | |
156 | \r | |
157 | #define KEYBOARD_MAX_TRY 256 // 256\r | |
158 | #define KEYBOARD_TIMEOUT 65536 // 0.07s\r | |
159 | #define KEYBOARD_WAITFORVALUE_TIMEOUT 1000000 // 1s\r | |
160 | #define KEYBOARD_BAT_TIMEOUT 4000000 // 4s\r | |
161 | #define KEYBOARD_TIMER_INTERVAL 200000 // 0.02s\r | |
162 | #define SCANCODE_EXTENDED 0xE0\r | |
163 | #define SCANCODE_EXTENDED1 0xE1\r | |
164 | #define SCANCODE_CTRL_MAKE 0x1D\r | |
165 | #define SCANCODE_CTRL_BREAK 0x9D\r | |
166 | #define SCANCODE_ALT_MAKE 0x38\r | |
167 | #define SCANCODE_ALT_BREAK 0xB8\r | |
168 | #define SCANCODE_LEFT_SHIFT_MAKE 0x2A\r | |
169 | #define SCANCODE_LEFT_SHIFT_BREAK 0xAA\r | |
170 | #define SCANCODE_RIGHT_SHIFT_MAKE 0x36\r | |
171 | #define SCANCODE_RIGHT_SHIFT_BREAK 0xB6\r | |
172 | #define SCANCODE_CAPS_LOCK_MAKE 0x3A\r | |
173 | #define SCANCODE_NUM_LOCK_MAKE 0x45\r | |
174 | #define SCANCODE_SCROLL_LOCK_MAKE 0x46\r | |
175 | #define SCANCODE_DELETE_MAKE 0x53\r | |
176 | #define SCANCODE_LEFT_LOGO_MAKE 0x5B //GUI key defined in Keyboard scan code\r | |
177 | #define SCANCODE_LEFT_LOGO_BREAK 0xDB\r | |
178 | #define SCANCODE_RIGHT_LOGO_MAKE 0x5C\r | |
179 | #define SCANCODE_RIGHT_LOGO_BREAK 0xDC\r | |
180 | #define SCANCODE_MENU_MAKE 0x5D //APPS key defined in Keyboard scan code \r | |
181 | #define SCANCODE_MENU_BREAK 0xDD\r | |
182 | #define SCANCODE_SYS_REQ_MAKE 0x37\r | |
183 | #define SCANCODE_MAX_MAKE 0x60\r | |
184 | \r | |
185 | #define KEYBOARD_STATUS_REGISTER_HAS_OUTPUT_DATA BIT0 ///< 0 - Output register has no data; 1 - Output register has data\r | |
186 | #define KEYBOARD_STATUS_REGISTER_HAS_INPUT_DATA BIT1 ///< 0 - Input register has no data; 1 - Input register has data\r | |
187 | #define KEYBOARD_STATUS_REGISTER_SYSTEM_FLAG BIT2 ///< Set to 0 after power on reset\r | |
188 | #define KEYBOARD_STATUS_REGISTER_INPUT_DATA_TYPE BIT3 ///< 0 - Data in input register is data; 1 - Data in input register is command\r | |
189 | #define KEYBOARD_STATUS_REGISTER_ENABLE_FLAG BIT4 ///< 0 - Keyboard is disable; 1 - Keyboard is enable\r | |
190 | #define KEYBOARD_STATUS_REGISTER_TRANSMIT_TIMEOUT BIT5 ///< 0 - Transmit is complete without timeout; 1 - Transmit is timeout without complete\r | |
191 | #define KEYBOARD_STATUS_REGISTER_RECEIVE_TIMEOUT BIT6 ///< 0 - Receive is complete without timeout; 1 - Receive is timeout without complete\r | |
192 | #define KEYBOARD_STATUS_REGISTER_PARITY BIT7 ///< 0 - Odd parity; 1 - Even parity\r | |
193 | \r | |
194 | #define KEYBOARD_8042_COMMAND_READ 0x20\r | |
195 | #define KEYBOARD_8042_COMMAND_WRITE 0x60\r | |
196 | #define KEYBOARD_8042_COMMAND_DISABLE_MOUSE_INTERFACE 0xA7\r | |
197 | #define KEYBOARD_8042_COMMAND_ENABLE_MOUSE_INTERFACE 0xA8\r | |
198 | #define KEYBOARD_8042_COMMAND_CONTROLLER_SELF_TEST 0xAA\r | |
199 | #define KEYBOARD_8042_COMMAND_KEYBOARD_INTERFACE_SELF_TEST 0xAB\r | |
200 | #define KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE 0xAD\r | |
201 | \r | |
202 | #define KEYBOARD_8048_COMMAND_CLEAR_OUTPUT_DATA 0xF4\r | |
203 | #define KEYBOARD_8048_COMMAND_RESET 0xFF\r | |
204 | #define KEYBOARD_8048_COMMAND_SELECT_SCAN_CODE_SET 0xF0\r | |
205 | \r | |
206 | #define KEYBOARD_8048_RETURN_8042_BAT_SUCCESS 0xAA\r | |
207 | #define KEYBOARD_8048_RETURN_8042_BAT_ERROR 0xFC\r | |
208 | #define KEYBOARD_8048_RETURN_8042_ACK 0xFA\r | |
209 | \r | |
210 | \r | |
211 | //\r | |
212 | // Keyboard Controller Status\r | |
213 | //\r | |
214 | #define KBC_PARE 0x80 // Parity Error\r | |
215 | #define KBC_TIM 0x40 // General Time Out\r | |
216 | \r | |
217 | //\r | |
218 | // Other functions that are used among .c files\r | |
219 | //\r | |
220 | /**\r | |
221 | Show keyboard status lights according to\r | |
222 | indicators in ConsoleIn.\r | |
223 | \r | |
224 | @param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r | |
225 | \r | |
226 | @return status\r | |
227 | \r | |
228 | **/\r | |
229 | EFI_STATUS\r | |
230 | UpdateStatusLights (\r | |
231 | IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r | |
232 | );\r | |
233 | \r | |
234 | /**\r | |
235 | write key to keyboard.\r | |
236 | \r | |
237 | @param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r | |
238 | @param Data value wanted to be written\r | |
239 | \r | |
240 | @retval EFI_TIMEOUT - GC_TODO: Add description for return value\r | |
241 | @retval EFI_SUCCESS - GC_TODO: Add description for return value\r | |
242 | \r | |
243 | **/\r | |
244 | EFI_STATUS\r | |
245 | KeyboardRead (\r | |
246 | IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,\r | |
247 | OUT UINT8 *Data\r | |
248 | );\r | |
249 | \r | |
250 | /**\r | |
251 | Get scancode from scancode buffer and translate into EFI-scancode and unicode defined by EFI spec.\r | |
252 | \r | |
253 | The function is always called in TPL_NOTIFY.\r | |
254 | \r | |
255 | @param ConsoleIn KEYBOARD_CONSOLE_IN_DEV instance pointer\r | |
256 | \r | |
257 | **/\r | |
258 | VOID\r | |
259 | KeyGetchar (\r | |
260 | IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r | |
261 | );\r | |
262 | \r | |
263 | /**\r | |
264 | Perform 8042 controller and keyboard Initialization.\r | |
265 | If ExtendedVerification is TRUE, do additional test for\r | |
266 | the keyboard interface\r | |
267 | \r | |
268 | @param ConsoleIn - KEYBOARD_CONSOLE_IN_DEV instance pointer\r | |
269 | @param ExtendedVerification - indicates a thorough initialization\r | |
270 | \r | |
271 | @retval EFI_DEVICE_ERROR Fail to init keyboard\r | |
272 | @retval EFI_SUCCESS Success to init keyboard\r | |
273 | **/\r | |
274 | EFI_STATUS\r | |
275 | InitKeyboard (\r | |
276 | IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,\r | |
277 | IN BOOLEAN ExtendedVerification\r | |
278 | );\r | |
279 | \r | |
280 | /**\r | |
281 | Disable the keyboard interface of the 8042 controller.\r | |
282 | \r | |
283 | @param ConsoleIn - the device instance\r | |
284 | \r | |
285 | @return status of issuing disable command\r | |
286 | \r | |
287 | **/\r | |
288 | EFI_STATUS\r | |
289 | DisableKeyboard (\r | |
290 | IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r | |
291 | );\r | |
292 | \r | |
293 | /**\r | |
294 | Timer event handler: read a series of scancodes from 8042\r | |
295 | and put them into memory scancode buffer.\r | |
296 | it read as much scancodes to either fill\r | |
297 | the memory buffer or empty the keyboard buffer.\r | |
298 | It is registered as running under TPL_NOTIFY\r | |
299 | \r | |
300 | @param Event - The timer event\r | |
301 | @param Context - A KEYBOARD_CONSOLE_IN_DEV pointer\r | |
302 | \r | |
303 | **/\r | |
304 | VOID\r | |
305 | EFIAPI\r | |
306 | KeyboardTimerHandler (\r | |
307 | IN EFI_EVENT Event,\r | |
308 | IN VOID *Context\r | |
309 | );\r | |
310 | \r | |
311 | /**\r | |
312 | logic reset keyboard\r | |
313 | Implement SIMPLE_TEXT_IN.Reset()\r | |
314 | Perform 8042 controller and keyboard initialization\r | |
315 | \r | |
316 | @param This Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r | |
317 | @param ExtendedVerification Indicate that the driver may perform a more \r | |
318 | exhaustive verification operation of the device during \r | |
319 | reset, now this par is ignored in this driver \r | |
320 | \r | |
321 | **/\r | |
322 | EFI_STATUS\r | |
323 | EFIAPI\r | |
324 | KeyboardEfiReset (\r | |
325 | IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r | |
326 | IN BOOLEAN ExtendedVerification\r | |
327 | );\r | |
328 | \r | |
329 | /**\r | |
330 | Implement SIMPLE_TEXT_IN.ReadKeyStroke().\r | |
331 | Retrieve key values for driver user.\r | |
332 | \r | |
333 | @param This Pointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r | |
334 | @param Key The output buffer for key value \r | |
335 | \r | |
336 | @retval EFI_SUCCESS success to read key stroke\r | |
337 | **/\r | |
338 | EFI_STATUS\r | |
339 | EFIAPI\r | |
340 | KeyboardReadKeyStroke (\r | |
341 | IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r | |
342 | OUT EFI_INPUT_KEY *Key\r | |
343 | );\r | |
344 | \r | |
345 | /**\r | |
346 | Event notification function for SIMPLE_TEXT_IN.WaitForKey event\r | |
347 | Signal the event if there is key available\r | |
348 | \r | |
349 | @param Event the event object\r | |
350 | @param Context waitting context\r | |
351 | \r | |
352 | **/\r | |
353 | VOID\r | |
354 | EFIAPI\r | |
355 | KeyboardWaitForKey (\r | |
356 | IN EFI_EVENT Event,\r | |
357 | IN VOID *Context\r | |
358 | );\r | |
359 | \r | |
360 | /**\r | |
361 | Read status register.\r | |
362 | \r | |
363 | @param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r | |
364 | \r | |
365 | @return value in status register\r | |
366 | \r | |
367 | **/\r | |
368 | UINT8\r | |
369 | KeyReadStatusRegister (\r | |
370 | IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r | |
371 | );\r | |
372 | \r | |
373 | /**\r | |
374 | Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard Command\r | |
375 | If Keyboard receives 0xF4, it will respond with 'ACK'. If it doesn't respond, the device\r | |
376 | should not be in system.\r | |
377 | \r | |
378 | @param[in] ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r | |
379 | \r | |
380 | @retval TRUE Keyboard in System.\r | |
381 | @retval FALSE Keyboard not in System.\r | |
382 | **/\r | |
383 | BOOLEAN\r | |
384 | EFIAPI\r | |
385 | CheckKeyboardConnect (\r | |
386 | IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn\r | |
387 | );\r | |
388 | \r | |
389 | /**\r | |
390 | Event notification function for SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event\r | |
391 | Signal the event if there is key available\r | |
392 | \r | |
393 | @param Event event object\r | |
394 | @param Context waiting context\r | |
395 | \r | |
396 | **/\r | |
397 | VOID\r | |
398 | EFIAPI\r | |
399 | KeyboardWaitForKeyEx (\r | |
400 | IN EFI_EVENT Event,\r | |
401 | IN VOID *Context\r | |
402 | ); \r | |
403 | \r | |
404 | //\r | |
405 | // Simple Text Input Ex protocol function prototypes\r | |
406 | //\r | |
407 | \r | |
408 | /**\r | |
409 | Reset the input device and optionaly run diagnostics\r | |
410 | \r | |
411 | @param This - Protocol instance pointer.\r | |
412 | @param ExtendedVerification - Driver may perform diagnostics on reset.\r | |
413 | \r | |
414 | @retval EFI_SUCCESS - The device was reset.\r | |
415 | @retval EFI_DEVICE_ERROR - The device is not functioning properly and could \r | |
416 | not be reset.\r | |
417 | \r | |
418 | **/\r | |
419 | EFI_STATUS\r | |
420 | EFIAPI\r | |
421 | KeyboardEfiResetEx (\r | |
422 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
423 | IN BOOLEAN ExtendedVerification\r | |
424 | );\r | |
425 | \r | |
426 | /**\r | |
427 | Reads the next keystroke from the input device. The WaitForKey Event can \r | |
428 | be used to test for existance of a keystroke via WaitForEvent () call.\r | |
429 | \r | |
430 | \r | |
431 | @param This - Protocol instance pointer.\r | |
432 | @param KeyData - A pointer to a buffer that is filled in with the keystroke \r | |
433 | state data for the key that was pressed.\r | |
434 | \r | |
435 | @retval EFI_SUCCESS - The keystroke information was returned.\r | |
436 | @retval EFI_NOT_READY - There was no keystroke data availiable.\r | |
437 | @retval EFI_DEVICE_ERROR - The keystroke information was not returned due to \r | |
438 | hardware errors.\r | |
439 | @retval EFI_INVALID_PARAMETER - KeyData is NULL. \r | |
440 | \r | |
441 | **/\r | |
442 | EFI_STATUS\r | |
443 | EFIAPI\r | |
444 | KeyboardReadKeyStrokeEx (\r | |
445 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
446 | OUT EFI_KEY_DATA *KeyData\r | |
447 | );\r | |
448 | \r | |
449 | /**\r | |
450 | Set certain state for the input device.\r | |
451 | \r | |
452 | @param This - Protocol instance pointer.\r | |
453 | @param KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the \r | |
454 | state for the input device.\r | |
455 | \r | |
456 | @retval EFI_SUCCESS - The device state was set successfully.\r | |
457 | @retval EFI_DEVICE_ERROR - The device is not functioning correctly and could \r | |
458 | not have the setting adjusted.\r | |
459 | @retval EFI_UNSUPPORTED - The device does not have the ability to set its state.\r | |
460 | @retval EFI_INVALID_PARAMETER - KeyToggleState is NULL. \r | |
461 | \r | |
462 | **/\r | |
463 | EFI_STATUS\r | |
464 | EFIAPI\r | |
465 | KeyboardSetState (\r | |
466 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
467 | IN EFI_KEY_TOGGLE_STATE *KeyToggleState\r | |
468 | );\r | |
469 | \r | |
470 | /**\r | |
471 | Register a notification function for a particular keystroke for the input device.\r | |
472 | \r | |
473 | @param This - Protocol instance pointer.\r | |
474 | @param KeyData - A pointer to a buffer that is filled in with the keystroke \r | |
475 | information data for the key that was pressed.\r | |
476 | @param KeyNotificationFunction - Points to the function to be called when the key \r | |
477 | sequence is typed specified by KeyData. \r | |
478 | @param NotifyHandle - Points to the unique handle assigned to the registered notification. \r | |
479 | \r | |
480 | @retval EFI_SUCCESS - The notification function was registered successfully.\r | |
481 | @retval EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.\r | |
482 | @retval EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL. \r | |
483 | \r | |
484 | **/ \r | |
485 | EFI_STATUS\r | |
486 | EFIAPI\r | |
487 | KeyboardRegisterKeyNotify (\r | |
488 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
489 | IN EFI_KEY_DATA *KeyData,\r | |
490 | IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,\r | |
491 | OUT EFI_HANDLE *NotifyHandle\r | |
492 | );\r | |
493 | \r | |
494 | /**\r | |
495 | Remove a registered notification function from a particular keystroke.\r | |
496 | \r | |
497 | @param This - Protocol instance pointer. \r | |
498 | @param NotificationHandle - The handle of the notification function being unregistered.\r | |
499 | \r | |
500 | \r | |
501 | @retval EFI_SUCCESS - The notification function was unregistered successfully.\r | |
502 | @retval EFI_INVALID_PARAMETER - The NotificationHandle is invalid.\r | |
503 | @retval EFI_NOT_FOUND - Can not find the matching entry in database. \r | |
504 | \r | |
505 | **/ \r | |
506 | EFI_STATUS\r | |
507 | EFIAPI\r | |
508 | KeyboardUnregisterKeyNotify (\r | |
509 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
510 | IN EFI_HANDLE NotificationHandle\r | |
511 | );\r | |
512 | \r | |
513 | /**\r | |
514 | Push one key data to the EFI key buffer.\r | |
515 | \r | |
516 | @param Queue Pointer to instance of EFI_KEY_QUEUE.\r | |
517 | @param KeyData The key data to push.\r | |
518 | **/\r | |
519 | VOID\r | |
520 | PushEfikeyBufTail (\r | |
521 | IN EFI_KEY_QUEUE *Queue,\r | |
522 | IN EFI_KEY_DATA *KeyData\r | |
523 | );\r | |
524 | \r | |
525 | /**\r | |
526 | Judge whether is a registed key\r | |
527 | \r | |
528 | @param RegsiteredData A pointer to a buffer that is filled in with the keystroke \r | |
529 | state data for the key that was registered.\r | |
530 | @param InputData A pointer to a buffer that is filled in with the keystroke \r | |
531 | state data for the key that was pressed.\r | |
532 | \r | |
533 | @retval TRUE Key be pressed matches a registered key.\r | |
534 | @retval FLASE Match failed. \r | |
535 | \r | |
536 | **/\r | |
537 | BOOLEAN\r | |
538 | IsKeyRegistered (\r | |
539 | IN EFI_KEY_DATA *RegsiteredData,\r | |
540 | IN EFI_KEY_DATA *InputData\r | |
541 | );\r | |
542 | #endif\r |