3 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _BIOS_KEYBOARD_H_
10 #define _BIOS_KEYBOARD_H_
13 #include <FrameworkDxe.h>
14 #include <Pi/PiDxeCis.h>
16 #include <Guid/StatusCodeDataTypeId.h>
17 #include <Protocol/SimpleTextIn.h>
18 #include <Protocol/SimpleTextInEx.h>
19 #include <Protocol/LegacyBios.h>
20 #include <Protocol/IsaIo.h>
21 #include <Protocol/DevicePath.h>
22 #include <Protocol/Ps2Policy.h>
24 #include <Library/DebugLib.h>
25 #include <Library/UefiLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/ReportStatusCodeLib.h>
28 #include <Library/UefiDriverEntryPoint.h>
29 #include <Library/UefiBootServicesTableLib.h>
30 #include <Library/DxeServicesTableLib.h>
31 #include <Library/MemoryAllocationLib.h>
32 #include <Library/BaseLib.h>
33 #include <Library/PcdLib.h>
36 // Driver Binding Externs
38 extern EFI_DRIVER_BINDING_PROTOCOL gBiosKeyboardDriverBinding
;
39 extern EFI_COMPONENT_NAME_PROTOCOL gBiosKeyboardComponentName
;
40 extern EFI_COMPONENT_NAME2_PROTOCOL gBiosKeyboardComponentName2
;
43 #include <IndustryStandard/Pci.h>
46 // BISO Keyboard Defines
48 #define CHAR_SCANCODE 0xe0
51 #define KEYBOARD_8042_DATA_REGISTER 0x60
52 #define KEYBOARD_8042_STATUS_REGISTER 0x64
53 #define KEYBOARD_8042_COMMAND_REGISTER 0x64
55 #define KEYBOARD_TIMEOUT 65536 // 0.07s
56 #define KEYBOARD_WAITFORVALUE_TIMEOUT 1000000 // 1s
57 #define KEYBOARD_BAT_TIMEOUT 4000000 // 4s
58 #define KEYBOARD_TIMER_INTERVAL 200000 // 0.02s
59 // KEYBOARD COMMAND BYTE -- read by writing command KBC_CMDREG_VIA64_CMDBYTE_R to 64H, then read from 60H
60 // write by wrting command KBC_CMDREG_VIA64_CMDBYTE_W to 64H, then write to 60H
62 // 6: PC/XT translation mode convert
63 // 5: Disable Auxiliary device interface
64 // 4: Disable keyboard interface
66 // 2: System Flag: selftest successful
67 // 1: Enable Auxiliary device interrupt
68 // 0: Enable Keyboard interrupt )
70 #define KB_CMMBYTE_KSCAN2UNI_COV (0x1 << 6)
71 #define KB_CMMBYTE_DISABLE_AUX (0x1 << 5)
72 #define KB_CMMBYTE_DISABLE_KB (0x1 << 4)
73 #define KB_CMMBYTE_SLFTEST_SUCC (0x1 << 2)
74 #define KB_CMMBYTE_ENABLE_AUXINT (0x1 << 1)
75 #define KB_CMMBYTE_ENABLE_KBINT (0x1 << 0)
78 // KEYBOARD CONTROLLER STATUS REGISTER - read from 64h
80 // 6: General time out
81 // 5: Output buffer holds data for AUX
82 // 4: Keyboard is not locked
83 // 3: Command written via 64h / Data written via 60h
84 // 2: KBC self-test successful / Power-on reset
85 // 1: Input buffer holds CPU data / empty
86 // 0: Output buffer holds keyboard data / empty
88 #define KBC_STSREG_VIA64_PARE (0x1 << 7)
89 #define KBC_STSREG_VIA64_TIM (0x1 << 6)
90 #define KBC_STSREG_VIA64_AUXB (0x1 << 5)
91 #define KBC_STSREG_VIA64_KEYL (0x1 << 4)
92 #define KBC_STSREG_VIA64_C_D (0x1 << 3)
93 #define KBC_STSREG_VIA64_SYSF (0x1 << 2)
94 #define KBC_STSREG_VIA64_INPB (0x1 << 1)
95 #define KBC_STSREG_VIA64_OUTB (0x1 << 0)
98 // COMMANDs of KEYBOARD CONTROLLER COMMAND REGISTER - write to 64h
100 #define KBC_CMDREG_VIA64_CMDBYTE_R 0x20
101 #define KBC_CMDREG_VIA64_CMDBYTE_W 0x60
102 #define KBC_CMDREG_VIA64_AUX_DISABLE 0xA7
103 #define KBC_CMDREG_VIA64_AUX_ENABLE 0xA8
104 #define KBC_CMDREG_VIA64_KBC_SLFTEST 0xAA
105 #define KBC_CMDREG_VIA64_KB_CKECK 0xAB
106 #define KBC_CMDREG_VIA64_KB_DISABLE 0xAD
107 #define KBC_CMDREG_VIA64_KB_ENABLE 0xAE
108 #define KBC_CMDREG_VIA64_INTP_LOW_R 0xC0
109 #define KBC_CMDREG_VIA64_INTP_HIGH_R 0xC2
110 #define KBC_CMDREG_VIA64_OUTP_R 0xD0
111 #define KBC_CMDREG_VIA64_OUTP_W 0xD1
112 #define KBC_CMDREG_VIA64_OUTB_KB_W 0xD2
113 #define KBC_CMDREG_VIA64_OUTB_AUX_W 0xD3
114 #define KBC_CMDREG_VIA64_AUX_W 0xD4
117 // echos of KEYBOARD CONTROLLER COMMAND - read from 60h
119 #define KBC_CMDECHO_KBCSLFTEST_OK 0x55
120 #define KBC_CMDECHO_KBCHECK_OK 0x00
121 #define KBC_CMDECHO_ACK 0xFA
122 #define KBC_CMDECHO_BATTEST_OK 0xAA
123 #define KBC_CMDECHO_BATTEST_FAILE 0xFC
126 // OUTPUT PORT COMMANDs - write port by writing KBC_CMDREG_VIA64_OUTP_W via 64H, then write the command to 60H
127 // drive data and clock of KB to high for at least 500us for BAT needs
129 #define KBC_OUTPORT_DCHIGH_BAT 0xC0
131 // scan code set type
133 #define KBC_INPBUF_VIA60_SCODESET1 0x01
134 #define KBC_INPBUF_VIA60_SCODESET2 0x02
135 #define KBC_INPBUF_VIA60_SCODESET3 0x03
138 // COMMANDs written to INPUT BUFFER - write to 60h
140 #define KBC_INPBUF_VIA60_KBECHO 0xEE
141 #define KBC_INPBUF_VIA60_KBSCODE 0xF0
142 #define KBC_INPBUF_VIA60_KBTYPE 0xF2
143 #define KBC_INPBUF_VIA60_KBDELAY 0xF3
144 #define KBC_INPBUF_VIA60_KBEN 0xF4
145 #define KBC_INPBUF_VIA60_KBSTDDIS 0xF5
146 #define KBC_INPBUF_VIA60_KBSTDEN 0xF6
147 #define KBC_INPBUF_VIA60_KBRESEND 0xFE
148 #define KBC_INPBUF_VIA60_KBRESET 0xFF
151 // 0040h:0017h - KEYBOARD - STATUS FLAGS 1
153 // 6 Caps Lock active
155 // 4 Scroll Lock active
156 // 3 either Alt pressed
157 // 2 either Ctrl pressed
158 // 1 Left Shift pressed
159 // 0 Right Shift pressed
161 // 0040h:0018h - KEYBOARD - STATUS FLAGS 2
162 // 7: insert key is depressed
163 // 6: caps-lock key is depressed (does not work well)
164 // 5: num-lock key is depressed (does not work well)
165 // 4: scroll lock key is depressed (does not work well)
166 // 3: suspend key has been toggled (does not work well)
167 // 2: system key is pressed and held (does not work well)
168 // 1: left ALT key is pressed
169 // 0: left CTRL key is pressed
171 #define KB_INSERT_BIT (0x1 << 7)
172 #define KB_CAPS_LOCK_BIT (0x1 << 6)
173 #define KB_NUM_LOCK_BIT (0x1 << 5)
174 #define KB_SCROLL_LOCK_BIT (0x1 << 4)
175 #define KB_ALT_PRESSED (0x1 << 3)
176 #define KB_CTRL_PRESSED (0x1 << 2)
177 #define KB_LEFT_SHIFT_PRESSED (0x1 << 1)
178 #define KB_RIGHT_SHIFT_PRESSED (0x1 << 0)
180 #define KB_SUSPEND_PRESSED (0x1 << 3)
181 #define KB_SYSREQ_PRESSED (0x1 << 2)
182 #define KB_LEFT_ALT_PRESSED (0x1 << 1)
183 #define KB_LEFT_CTRL_PRESSED (0x1 << 0)
186 // BIOS Keyboard Device Structure
188 #define BIOS_KEYBOARD_DEV_SIGNATURE SIGNATURE_32 ('B', 'K', 'B', 'D')
189 #define BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('c', 'b', 'k', 'h')
191 typedef struct _BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY
{
193 EFI_KEY_DATA KeyData
;
194 EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn
;
195 LIST_ENTRY NotifyEntry
;
196 } BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY
;
198 #define QUEUE_MAX_COUNT 32
202 EFI_KEY_DATA Buffer
[QUEUE_MAX_COUNT
];
208 EFI_LEGACY_BIOS_PROTOCOL
*LegacyBios
;
209 EFI_ISA_IO_PROTOCOL
*IsaIo
;
210 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn
;
211 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleTextInputEx
;
212 UINT16 DataRegisterAddress
;
213 UINT16 StatusRegisterAddress
;
214 UINT16 CommandRegisterAddress
;
215 BOOLEAN ExtendedKeyboard
;
217 EFI_KEY_STATE KeyState
;
219 // Buffer storing EFI_KEY_DATA
222 SIMPLE_QUEUE QueueForNotify
;
225 // Notification Function List
227 LIST_ENTRY NotifyList
;
228 EFI_EVENT KeyNotifyProcessEvent
;
229 EFI_EVENT TimerEvent
;
233 #define BIOS_KEYBOARD_DEV_FROM_THIS(a) CR (a, BIOS_KEYBOARD_DEV, SimpleTextIn, BIOS_KEYBOARD_DEV_SIGNATURE)
234 #define TEXT_INPUT_EX_BIOS_KEYBOARD_DEV_FROM_THIS(a) \
238 BIOS_KEYBOARD_DEV_SIGNATURE \
244 extern EFI_DRIVER_BINDING_PROTOCOL gBiosKeyboardDriverBinding
;
247 // Driver Binding Protocol functions
251 Check whether the driver supports this device.
253 @param This The Udriver binding protocol.
254 @param Controller The controller handle to check.
255 @param RemainingDevicePath The remaining device path.
257 @retval EFI_SUCCESS The driver supports this controller.
258 @retval other This device isn't supported.
263 BiosKeyboardDriverBindingSupported (
264 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
265 IN EFI_HANDLE Controller
,
266 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
270 Starts the device with this driver.
272 @param This The driver binding instance.
273 @param Controller Handle of device to bind driver to.
274 @param RemainingDevicePath Optional parameter use to pick a specific child
277 @retval EFI_SUCCESS The controller is controlled by the driver.
278 @retval Other This controller cannot be started.
283 BiosKeyboardDriverBindingStart (
284 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
285 IN EFI_HANDLE Controller
,
286 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
290 Stop the device handled by this driver.
292 @param This The driver binding protocol.
293 @param Controller The controller to release.
294 @param NumberOfChildren The number of handles in ChildHandleBuffer.
295 @param ChildHandleBuffer The array of child handle.
297 @retval EFI_SUCCESS The device was stopped.
298 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
299 @retval Others Fail to uninstall protocols attached on the device.
304 BiosKeyboardDriverBindingStop (
305 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
306 IN EFI_HANDLE Controller
,
307 IN UINTN NumberOfChildren
,
308 IN EFI_HANDLE
*ChildHandleBuffer
312 Retrieves a Unicode string that is the user readable name of the driver.
314 This function retrieves the user readable name of a driver in the form of a
315 Unicode string. If the driver specified by This has a user readable name in
316 the language specified by Language, then a pointer to the driver name is
317 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
318 by This does not support the language specified by Language,
319 then EFI_UNSUPPORTED is returned.
321 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
322 EFI_COMPONENT_NAME_PROTOCOL instance.
324 @param Language[in] A pointer to a Null-terminated ASCII string
325 array indicating the language. This is the
326 language of the driver name that the caller is
327 requesting, and it must match one of the
328 languages specified in SupportedLanguages. The
329 number of languages supported by a driver is up
330 to the driver writer. Language is specified
331 in RFC 4646 or ISO 639-2 language code format.
333 @param DriverName[out] A pointer to the Unicode string to return.
334 This Unicode string is the name of the
335 driver specified by This in the language
336 specified by Language.
338 @retval EFI_SUCCESS The Unicode string for the Driver specified by
339 This and the language specified by Language was
340 returned in DriverName.
342 @retval EFI_INVALID_PARAMETER Language is NULL.
344 @retval EFI_INVALID_PARAMETER DriverName is NULL.
346 @retval EFI_UNSUPPORTED The driver specified by This does not support
347 the language specified by Language.
352 BiosKeyboardComponentNameGetDriverName (
353 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
355 OUT CHAR16
**DriverName
360 Retrieves a Unicode string that is the user readable name of the controller
361 that is being managed by a driver.
363 This function retrieves the user readable name of the controller specified by
364 ControllerHandle and ChildHandle in the form of a Unicode string. If the
365 driver specified by This has a user readable name in the language specified by
366 Language, then a pointer to the controller name is returned in ControllerName,
367 and EFI_SUCCESS is returned. If the driver specified by This is not currently
368 managing the controller specified by ControllerHandle and ChildHandle,
369 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
370 support the language specified by Language, then EFI_UNSUPPORTED is returned.
372 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
373 EFI_COMPONENT_NAME_PROTOCOL instance.
375 @param ControllerHandle[in] The handle of a controller that the driver
376 specified by This is managing. This handle
377 specifies the controller whose name is to be
380 @param ChildHandle[in] The handle of the child controller to retrieve
381 the name of. This is an optional parameter that
382 may be NULL. It will be NULL for device
383 drivers. It will also be NULL for a bus drivers
384 that wish to retrieve the name of the bus
385 controller. It will not be NULL for a bus
386 driver that wishes to retrieve the name of a
389 @param Language[in] A pointer to a Null-terminated ASCII string
390 array indicating the language. This is the
391 language of the driver name that the caller is
392 requesting, and it must match one of the
393 languages specified in SupportedLanguages. The
394 number of languages supported by a driver is up
395 to the driver writer. Language is specified in
396 RFC 4646 or ISO 639-2 language code format.
398 @param ControllerName[out] A pointer to the Unicode string to return.
399 This Unicode string is the name of the
400 controller specified by ControllerHandle and
401 ChildHandle in the language specified by
402 Language from the point of view of the driver
405 @retval EFI_SUCCESS The Unicode string for the user readable name in
406 the language specified by Language for the
407 driver specified by This was returned in
410 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
412 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
415 @retval EFI_INVALID_PARAMETER Language is NULL.
417 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
419 @retval EFI_UNSUPPORTED The driver specified by This is not currently
420 managing the controller specified by
421 ControllerHandle and ChildHandle.
423 @retval EFI_UNSUPPORTED The driver specified by This does not support
424 the language specified by Language.
429 BiosKeyboardComponentNameGetControllerName (
430 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
431 IN EFI_HANDLE ControllerHandle
,
432 IN EFI_HANDLE ChildHandle OPTIONAL
,
434 OUT CHAR16
**ControllerName
439 // Simple Text Input Protocol functions
442 Reset the Keyboard and do BAT test for it, if (ExtendedVerification == TRUE) then do some extra keyboard validations.
444 @param This Pointer of simple text Protocol.
445 @param ExtendedVerification Whether perform the extra validation of keyboard. True: perform; FALSE: skip.
447 @retval EFI_SUCCESS The command byte is written successfully.
448 @retval EFI_DEVICE_ERROR Errors occurred during resetting keyboard.
454 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
455 IN BOOLEAN ExtendedVerification
459 Read out the scan code of the key that has just been stroked.
461 @param This Pointer of simple text Protocol.
462 @param Key Pointer for store the key that read out.
464 @retval EFI_SUCCESS The key is read out successfully.
465 @retval other The key reading failed.
470 BiosKeyboardReadKeyStroke (
471 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
472 OUT EFI_INPUT_KEY
*Key
476 // Private worker functions
479 Waiting on the keyboard event, if there's any key pressed by the user, signal the event
481 @param Event The event that be siganlled when any key has been stroked.
482 @param Context Pointer of the protocol EFI_SIMPLE_TEXT_INPUT_PROTOCOL.
487 BiosKeyboardWaitForKey (
493 Check key buffer to get the key stroke status.
495 @param This Pointer of the protocol EFI_SIMPLE_TEXT_IN_PROTOCOL.
497 @retval EFI_SUCCESS A key is being pressed now.
498 @retval Other No key is now pressed.
503 BiosKeyboardCheckForKey (
504 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
508 Convert unicode combined with scan code of key to the counterpart of EFIScancode of it.
510 @param KeyChar Unicode of key.
511 @param ScanCode Scan code of key.
513 @return The value of EFI Scancode for the key.
514 @retval SCAN_NULL No corresponding value in the EFI convert table is found for the key.
518 ConvertToEFIScanCode (
524 Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard Command
525 If Keyboard receives 0xF4, it will respond with 'ACK'. If it doesn't respond, the device
526 should not be in system.
528 @param BiosKeyboardPrivate Keyboard Private Data Struture
530 @retval TRUE Keyboard in System.
531 @retval FALSE Keyboard not in System.
535 CheckKeyboardConnect (
536 IN BIOS_KEYBOARD_DEV
*BiosKeyboardPrivate
540 Timer event handler: read a series of key stroke from 8042
541 and put them into memory key buffer.
542 It is registered as running under TPL_NOTIFY
544 @param Event The timer event
545 @param Context A BIOS_KEYBOARD_DEV pointer
550 BiosKeyboardTimerHandler (
558 @param Event Indicates the event that invoke this function.
559 @param Context Indicates the calling context.
563 KeyNotifyProcessHandler (
569 Reset the input device and optionaly run diagnostics
571 @param This Protocol instance pointer.
572 @param ExtendedVerification Driver may perform diagnostics on reset.
574 @retval EFI_SUCCESS The device was reset.
575 @retval EFI_DEVICE_ERROR The device is not functioning properly and could
581 BiosKeyboardResetEx (
582 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
583 IN BOOLEAN ExtendedVerification
587 Reads the next keystroke from the input device. The WaitForKey Event can
588 be used to test for existance of a keystroke via WaitForEvent () call.
590 @param This Protocol instance pointer.
591 @param KeyData A pointer to a buffer that is filled in with the keystroke
592 state data for the key that was pressed.
594 @retval EFI_SUCCESS The keystroke information was returned.
595 @retval EFI_NOT_READY There was no keystroke data availiable.
596 @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
598 @retval EFI_INVALID_PARAMETER KeyData is NULL.
603 BiosKeyboardReadKeyStrokeEx (
604 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
605 OUT EFI_KEY_DATA
*KeyData
609 Set certain state for the input device.
611 @param This Protocol instance pointer.
612 @param KeyToggleState A pointer to the EFI_KEY_TOGGLE_STATE to set the
613 state for the input device.
615 @retval EFI_SUCCESS The device state was set successfully.
616 @retval EFI_DEVICE_ERROR The device is not functioning correctly and could
617 not have the setting adjusted.
618 @retval EFI_UNSUPPORTED The device does not have the ability to set its state.
619 @retval EFI_INVALID_PARAMETER KeyToggleState is NULL.
624 BiosKeyboardSetState (
625 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
626 IN EFI_KEY_TOGGLE_STATE
*KeyToggleState
630 Register a notification function for a particular keystroke for the input device.
632 @param This Protocol instance pointer.
633 @param KeyData A pointer to a buffer that is filled in with the keystroke
634 information data for the key that was pressed. If KeyData.Key,
635 KeyData.KeyState.KeyToggleState and KeyData.KeyState.KeyShiftState
636 are 0, then any incomplete keystroke will trigger a notification of
637 the KeyNotificationFunction.
638 @param KeyNotificationFunction Points to the function to be called when the key
639 sequence is typed specified by KeyData. This notification function
640 should be called at <=TPL_CALLBACK.
641 @param NotifyHandle Points to the unique handle assigned to the registered notification.
644 @retval EFI_SUCCESS The notification function was registered successfully.
645 @retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data structures.
646 @retval EFI_INVALID_PARAMETER KeyData or NotifyHandle is NULL.
651 BiosKeyboardRegisterKeyNotify (
652 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
653 IN EFI_KEY_DATA
*KeyData
,
654 IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction
,
655 OUT VOID
**NotifyHandle
659 Remove a registered notification function from a particular keystroke.
661 @param This Protocol instance pointer.
662 @param NotificationHandle The handle of the notification function being unregistered.
664 @retval EFI_SUCCESS The notification function was unregistered successfully.
665 @retval EFI_INVALID_PARAMETER The NotificationHandle is invalid.
670 BiosKeyboardUnregisterKeyNotify (
671 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
672 IN VOID
*NotificationHandle
676 Wait for a specific value to be presented in
677 Data register of Keyboard Controller by keyboard and then read it,
678 used in keyboard commands ack
680 @param BiosKeyboardPrivate Keyboard instance pointer.
681 @param Value The value to be waited for
682 @param WaitForValueTimeOut The limit of microseconds for timeout
684 @retval EFI_SUCCESS The command byte is written successfully.
685 @retval EFI_TIMEOUT Timeout occurred during writing.
689 KeyboardWaitForValue (
690 IN BIOS_KEYBOARD_DEV
*BiosKeyboardPrivate
,
692 IN UINTN WaitForValueTimeOut
696 Write data byte to input buffer or input/output ports of Keyboard Controller with delay and waiting for buffer-empty state.
698 @param BiosKeyboardPrivate Keyboard instance pointer.
699 @param Data Data byte to write.
701 @retval EFI_SUCCESS The data byte is written successfully.
702 @retval EFI_TIMEOUT Timeout occurred during writing.
707 IN BIOS_KEYBOARD_DEV
*BiosKeyboardPrivate
,
712 Free keyboard notify list.
714 @param ListHead The list head
716 @retval EFI_SUCCESS Free the notify list successfully
717 @retval EFI_INVALID_PARAMETER ListHead is invalid.
721 BiosKeyboardFreeNotifyList (
722 IN OUT LIST_ENTRY
*ListHead
726 Check if key is registered.
728 @param RegsiteredData A pointer to a buffer that is filled in with the keystroke
729 state data for the key that was registered.
730 @param InputData A pointer to a buffer that is filled in with the keystroke
731 state data for the key that was pressed.
733 @retval TRUE Key be pressed matches a registered key.
734 @retval FLASE Match failed.
739 IN EFI_KEY_DATA
*RegsiteredData
,
740 IN EFI_KEY_DATA
*InputData
744 Waiting on the keyboard event, if there's any key pressed by the user, signal the event
746 @param Event The event that be siganlled when any key has been stroked.
747 @param Context Pointer of the protocol EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
752 BiosKeyboardWaitForKeyEx (