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