3 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions
7 of the BSD License which accompanies this distribution. The
8 full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef _BIOS_KEYBOARD_H_
17 #define _BIOS_KEYBOARD_H_
20 #include <FrameworkDxe.h>
21 #include <Pi/PiDxeCis.h>
23 #include <Guid/StatusCodeDataTypeId.h>
24 #include <Protocol/SimpleTextIn.h>
25 #include <Protocol/SimpleTextInEx.h>
26 #include <Protocol/LegacyBios.h>
27 #include <Protocol/IsaIo.h>
28 #include <Protocol/DevicePath.h>
29 #include <Protocol/Ps2Policy.h>
31 #include <Library/DebugLib.h>
32 #include <Library/UefiLib.h>
33 #include <Library/BaseMemoryLib.h>
34 #include <Library/ReportStatusCodeLib.h>
35 #include <Library/UefiDriverEntryPoint.h>
36 #include <Library/UefiBootServicesTableLib.h>
37 #include <Library/DxeServicesTableLib.h>
38 #include <Library/MemoryAllocationLib.h>
39 #include <Library/BaseLib.h>
40 #include <Library/PcdLib.h>
43 // Driver Binding Externs
45 extern EFI_DRIVER_BINDING_PROTOCOL gBiosKeyboardDriverBinding
;
46 extern EFI_COMPONENT_NAME_PROTOCOL gBiosKeyboardComponentName
;
47 extern EFI_COMPONENT_NAME2_PROTOCOL gBiosKeyboardComponentName2
;
50 #include <IndustryStandard/Pci.h>
53 // BISO Keyboard Defines
55 #define CHAR_SCANCODE 0xe0
58 #define KEYBOARD_8042_DATA_REGISTER 0x60
59 #define KEYBOARD_8042_STATUS_REGISTER 0x64
60 #define KEYBOARD_8042_COMMAND_REGISTER 0x64
62 #define KEYBOARD_TIMEOUT 65536 // 0.07s
63 #define KEYBOARD_WAITFORVALUE_TIMEOUT 1000000 // 1s
64 #define KEYBOARD_BAT_TIMEOUT 4000000 // 4s
65 #define KEYBOARD_TIMER_INTERVAL 200000 // 0.02s
66 // KEYBOARD COMMAND BYTE -- read by writing command KBC_CMDREG_VIA64_CMDBYTE_R to 64H, then read from 60H
67 // write by wrting command KBC_CMDREG_VIA64_CMDBYTE_W to 64H, then write to 60H
69 // 6: PC/XT translation mode convert
70 // 5: Disable Auxiliary device interface
71 // 4: Disable keyboard interface
73 // 2: System Flag: selftest successful
74 // 1: Enable Auxiliary device interrupt
75 // 0: Enable Keyboard interrupt )
77 #define KB_CMMBYTE_KSCAN2UNI_COV (0x1 << 6)
78 #define KB_CMMBYTE_DISABLE_AUX (0x1 << 5)
79 #define KB_CMMBYTE_DISABLE_KB (0x1 << 4)
80 #define KB_CMMBYTE_SLFTEST_SUCC (0x1 << 2)
81 #define KB_CMMBYTE_ENABLE_AUXINT (0x1 << 1)
82 #define KB_CMMBYTE_ENABLE_KBINT (0x1 << 0)
85 // KEYBOARD CONTROLLER STATUS REGISTER - read from 64h
87 // 6: General time out
88 // 5: Output buffer holds data for AUX
89 // 4: Keyboard is not locked
90 // 3: Command written via 64h / Data written via 60h
91 // 2: KBC self-test successful / Power-on reset
92 // 1: Input buffer holds CPU data / empty
93 // 0: Output buffer holds keyboard data / empty
95 #define KBC_STSREG_VIA64_PARE (0x1 << 7)
96 #define KBC_STSREG_VIA64_TIM (0x1 << 6)
97 #define KBC_STSREG_VIA64_AUXB (0x1 << 5)
98 #define KBC_STSREG_VIA64_KEYL (0x1 << 4)
99 #define KBC_STSREG_VIA64_C_D (0x1 << 3)
100 #define KBC_STSREG_VIA64_SYSF (0x1 << 2)
101 #define KBC_STSREG_VIA64_INPB (0x1 << 1)
102 #define KBC_STSREG_VIA64_OUTB (0x1 << 0)
105 // COMMANDs of KEYBOARD CONTROLLER COMMAND REGISTER - write to 64h
107 #define KBC_CMDREG_VIA64_CMDBYTE_R 0x20
108 #define KBC_CMDREG_VIA64_CMDBYTE_W 0x60
109 #define KBC_CMDREG_VIA64_AUX_DISABLE 0xA7
110 #define KBC_CMDREG_VIA64_AUX_ENABLE 0xA8
111 #define KBC_CMDREG_VIA64_KBC_SLFTEST 0xAA
112 #define KBC_CMDREG_VIA64_KB_CKECK 0xAB
113 #define KBC_CMDREG_VIA64_KB_DISABLE 0xAD
114 #define KBC_CMDREG_VIA64_KB_ENABLE 0xAE
115 #define KBC_CMDREG_VIA64_INTP_LOW_R 0xC0
116 #define KBC_CMDREG_VIA64_INTP_HIGH_R 0xC2
117 #define KBC_CMDREG_VIA64_OUTP_R 0xD0
118 #define KBC_CMDREG_VIA64_OUTP_W 0xD1
119 #define KBC_CMDREG_VIA64_OUTB_KB_W 0xD2
120 #define KBC_CMDREG_VIA64_OUTB_AUX_W 0xD3
121 #define KBC_CMDREG_VIA64_AUX_W 0xD4
124 // echos of KEYBOARD CONTROLLER COMMAND - read from 60h
126 #define KBC_CMDECHO_KBCSLFTEST_OK 0x55
127 #define KBC_CMDECHO_KBCHECK_OK 0x00
128 #define KBC_CMDECHO_ACK 0xFA
129 #define KBC_CMDECHO_BATTEST_OK 0xAA
130 #define KBC_CMDECHO_BATTEST_FAILE 0xFC
133 // OUTPUT PORT COMMANDs - write port by writing KBC_CMDREG_VIA64_OUTP_W via 64H, then write the command to 60H
134 // drive data and clock of KB to high for at least 500us for BAT needs
136 #define KBC_OUTPORT_DCHIGH_BAT 0xC0
138 // scan code set type
140 #define KBC_INPBUF_VIA60_SCODESET1 0x01
141 #define KBC_INPBUF_VIA60_SCODESET2 0x02
142 #define KBC_INPBUF_VIA60_SCODESET3 0x03
145 // COMMANDs written to INPUT BUFFER - write to 60h
147 #define KBC_INPBUF_VIA60_KBECHO 0xEE
148 #define KBC_INPBUF_VIA60_KBSCODE 0xF0
149 #define KBC_INPBUF_VIA60_KBTYPE 0xF2
150 #define KBC_INPBUF_VIA60_KBDELAY 0xF3
151 #define KBC_INPBUF_VIA60_KBEN 0xF4
152 #define KBC_INPBUF_VIA60_KBSTDDIS 0xF5
153 #define KBC_INPBUF_VIA60_KBSTDEN 0xF6
154 #define KBC_INPBUF_VIA60_KBRESEND 0xFE
155 #define KBC_INPBUF_VIA60_KBRESET 0xFF
158 // 0040h:0017h - KEYBOARD - STATUS FLAGS 1
160 // 6 Caps Lock active
162 // 4 Scroll Lock active
163 // 3 either Alt pressed
164 // 2 either Ctrl pressed
165 // 1 Left Shift pressed
166 // 0 Right Shift pressed
168 // 0040h:0018h - KEYBOARD - STATUS FLAGS 2
169 // 7: insert key is depressed
170 // 6: caps-lock key is depressed (does not work well)
171 // 5: num-lock key is depressed (does not work well)
172 // 4: scroll lock key is depressed (does not work well)
173 // 3: suspend key has been toggled (does not work well)
174 // 2: system key is pressed and held (does not work well)
175 // 1: left ALT key is pressed
176 // 0: left CTRL key is pressed
178 #define KB_INSERT_BIT (0x1 << 7)
179 #define KB_CAPS_LOCK_BIT (0x1 << 6)
180 #define KB_NUM_LOCK_BIT (0x1 << 5)
181 #define KB_SCROLL_LOCK_BIT (0x1 << 4)
182 #define KB_ALT_PRESSED (0x1 << 3)
183 #define KB_CTRL_PRESSED (0x1 << 2)
184 #define KB_LEFT_SHIFT_PRESSED (0x1 << 1)
185 #define KB_RIGHT_SHIFT_PRESSED (0x1 << 0)
187 #define KB_SUSPEND_PRESSED (0x1 << 3)
188 #define KB_SYSREQ_PRESSED (0x1 << 2)
189 #define KB_LEFT_ALT_PRESSED (0x1 << 1)
190 #define KB_LEFT_CTRL_PRESSED (0x1 << 0)
193 // BIOS Keyboard Device Structure
195 #define BIOS_KEYBOARD_DEV_SIGNATURE SIGNATURE_32 ('B', 'K', 'B', 'D')
196 #define BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('c', 'b', 'k', 'h')
198 typedef struct _BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY
{
200 EFI_KEY_DATA KeyData
;
201 EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn
;
202 LIST_ENTRY NotifyEntry
;
203 } BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY
;
205 #define QUEUE_MAX_COUNT 32
209 EFI_KEY_DATA Buffer
[QUEUE_MAX_COUNT
];
215 EFI_LEGACY_BIOS_PROTOCOL
*LegacyBios
;
216 EFI_ISA_IO_PROTOCOL
*IsaIo
;
217 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn
;
218 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleTextInputEx
;
219 UINT16 DataRegisterAddress
;
220 UINT16 StatusRegisterAddress
;
221 UINT16 CommandRegisterAddress
;
222 BOOLEAN ExtendedKeyboard
;
224 EFI_KEY_STATE KeyState
;
226 // Buffer storing EFI_KEY_DATA
229 SIMPLE_QUEUE QueueForNotify
;
232 // Notification Function List
234 LIST_ENTRY NotifyList
;
235 EFI_EVENT KeyNotifyProcessEvent
;
236 EFI_EVENT TimerEvent
;
240 #define BIOS_KEYBOARD_DEV_FROM_THIS(a) CR (a, BIOS_KEYBOARD_DEV, SimpleTextIn, BIOS_KEYBOARD_DEV_SIGNATURE)
241 #define TEXT_INPUT_EX_BIOS_KEYBOARD_DEV_FROM_THIS(a) \
245 BIOS_KEYBOARD_DEV_SIGNATURE \
251 extern EFI_DRIVER_BINDING_PROTOCOL gBiosKeyboardDriverBinding
;
254 // Driver Binding Protocol functions
258 Check whether the driver supports this device.
260 @param This The Udriver binding protocol.
261 @param Controller The controller handle to check.
262 @param RemainingDevicePath The remaining device path.
264 @retval EFI_SUCCESS The driver supports this controller.
265 @retval other This device isn't supported.
270 BiosKeyboardDriverBindingSupported (
271 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
272 IN EFI_HANDLE Controller
,
273 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
277 Starts the device with this driver.
279 @param This The driver binding instance.
280 @param Controller Handle of device to bind driver to.
281 @param RemainingDevicePath Optional parameter use to pick a specific child
284 @retval EFI_SUCCESS The controller is controlled by the driver.
285 @retval Other This controller cannot be started.
290 BiosKeyboardDriverBindingStart (
291 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
292 IN EFI_HANDLE Controller
,
293 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
297 Stop the device handled by this driver.
299 @param This The driver binding protocol.
300 @param Controller The controller to release.
301 @param NumberOfChildren The number of handles in ChildHandleBuffer.
302 @param ChildHandleBuffer The array of child handle.
304 @retval EFI_SUCCESS The device was stopped.
305 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
306 @retval Others Fail to uninstall protocols attached on the device.
311 BiosKeyboardDriverBindingStop (
312 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
313 IN EFI_HANDLE Controller
,
314 IN UINTN NumberOfChildren
,
315 IN EFI_HANDLE
*ChildHandleBuffer
319 Retrieves a Unicode string that is the user readable name of the driver.
321 This function retrieves the user readable name of a driver in the form of a
322 Unicode string. If the driver specified by This has a user readable name in
323 the language specified by Language, then a pointer to the driver name is
324 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
325 by This does not support the language specified by Language,
326 then EFI_UNSUPPORTED is returned.
328 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
329 EFI_COMPONENT_NAME_PROTOCOL instance.
331 @param Language[in] A pointer to a Null-terminated ASCII string
332 array indicating the language. This is the
333 language of the driver name that the caller is
334 requesting, and it must match one of the
335 languages specified in SupportedLanguages. The
336 number of languages supported by a driver is up
337 to the driver writer. Language is specified
338 in RFC 4646 or ISO 639-2 language code format.
340 @param DriverName[out] A pointer to the Unicode string to return.
341 This Unicode string is the name of the
342 driver specified by This in the language
343 specified by Language.
345 @retval EFI_SUCCESS The Unicode string for the Driver specified by
346 This and the language specified by Language was
347 returned in DriverName.
349 @retval EFI_INVALID_PARAMETER Language is NULL.
351 @retval EFI_INVALID_PARAMETER DriverName is NULL.
353 @retval EFI_UNSUPPORTED The driver specified by This does not support
354 the language specified by Language.
359 BiosKeyboardComponentNameGetDriverName (
360 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
362 OUT CHAR16
**DriverName
367 Retrieves a Unicode string that is the user readable name of the controller
368 that is being managed by a driver.
370 This function retrieves the user readable name of the controller specified by
371 ControllerHandle and ChildHandle in the form of a Unicode string. If the
372 driver specified by This has a user readable name in the language specified by
373 Language, then a pointer to the controller name is returned in ControllerName,
374 and EFI_SUCCESS is returned. If the driver specified by This is not currently
375 managing the controller specified by ControllerHandle and ChildHandle,
376 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
377 support the language specified by Language, then EFI_UNSUPPORTED is returned.
379 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
380 EFI_COMPONENT_NAME_PROTOCOL instance.
382 @param ControllerHandle[in] The handle of a controller that the driver
383 specified by This is managing. This handle
384 specifies the controller whose name is to be
387 @param ChildHandle[in] The handle of the child controller to retrieve
388 the name of. This is an optional parameter that
389 may be NULL. It will be NULL for device
390 drivers. It will also be NULL for a bus drivers
391 that wish to retrieve the name of the bus
392 controller. It will not be NULL for a bus
393 driver that wishes to retrieve the name of a
396 @param Language[in] A pointer to a Null-terminated ASCII string
397 array indicating the language. This is the
398 language of the driver name that the caller is
399 requesting, and it must match one of the
400 languages specified in SupportedLanguages. The
401 number of languages supported by a driver is up
402 to the driver writer. Language is specified in
403 RFC 4646 or ISO 639-2 language code format.
405 @param ControllerName[out] A pointer to the Unicode string to return.
406 This Unicode string is the name of the
407 controller specified by ControllerHandle and
408 ChildHandle in the language specified by
409 Language from the point of view of the driver
412 @retval EFI_SUCCESS The Unicode string for the user readable name in
413 the language specified by Language for the
414 driver specified by This was returned in
417 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
419 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
422 @retval EFI_INVALID_PARAMETER Language is NULL.
424 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
426 @retval EFI_UNSUPPORTED The driver specified by This is not currently
427 managing the controller specified by
428 ControllerHandle and ChildHandle.
430 @retval EFI_UNSUPPORTED The driver specified by This does not support
431 the language specified by Language.
436 BiosKeyboardComponentNameGetControllerName (
437 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
438 IN EFI_HANDLE ControllerHandle
,
439 IN EFI_HANDLE ChildHandle OPTIONAL
,
441 OUT CHAR16
**ControllerName
446 // Simple Text Input Protocol functions
449 Reset the Keyboard and do BAT test for it, if (ExtendedVerification == TRUE) then do some extra keyboard validations.
451 @param This Pointer of simple text Protocol.
452 @param ExtendedVerification Whether perform the extra validation of keyboard. True: perform; FALSE: skip.
454 @retval EFI_SUCCESS The command byte is written successfully.
455 @retval EFI_DEVICE_ERROR Errors occurred during resetting keyboard.
461 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
462 IN BOOLEAN ExtendedVerification
466 Read out the scan code of the key that has just been stroked.
468 @param This Pointer of simple text Protocol.
469 @param Key Pointer for store the key that read out.
471 @retval EFI_SUCCESS The key is read out successfully.
472 @retval other The key reading failed.
477 BiosKeyboardReadKeyStroke (
478 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
479 OUT EFI_INPUT_KEY
*Key
483 // Private worker functions
486 Waiting on the keyboard event, if there's any key pressed by the user, signal the event
488 @param Event The event that be siganlled when any key has been stroked.
489 @param Context Pointer of the protocol EFI_SIMPLE_TEXT_INPUT_PROTOCOL.
494 BiosKeyboardWaitForKey (
500 Check key buffer to get the key stroke status.
502 @param This Pointer of the protocol EFI_SIMPLE_TEXT_IN_PROTOCOL.
504 @retval EFI_SUCCESS A key is being pressed now.
505 @retval Other No key is now pressed.
510 BiosKeyboardCheckForKey (
511 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
515 Convert unicode combined with scan code of key to the counterpart of EFIScancode of it.
517 @param KeyChar Unicode of key.
518 @param ScanCode Scan code of key.
520 @return The value of EFI Scancode for the key.
521 @retval SCAN_NULL No corresponding value in the EFI convert table is found for the key.
525 ConvertToEFIScanCode (
531 Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard Command
532 If Keyboard receives 0xF4, it will respond with 'ACK'. If it doesn't respond, the device
533 should not be in system.
535 @param BiosKeyboardPrivate Keyboard Private Data Struture
537 @retval TRUE Keyboard in System.
538 @retval FALSE Keyboard not in System.
542 CheckKeyboardConnect (
543 IN BIOS_KEYBOARD_DEV
*BiosKeyboardPrivate
547 Timer event handler: read a series of key stroke from 8042
548 and put them into memory key buffer.
549 It is registered as running under TPL_NOTIFY
551 @param Event The timer event
552 @param Context A BIOS_KEYBOARD_DEV pointer
557 BiosKeyboardTimerHandler (
565 @param Event Indicates the event that invoke this function.
566 @param Context Indicates the calling context.
570 KeyNotifyProcessHandler (
576 Reset the input device and optionaly run diagnostics
578 @param This Protocol instance pointer.
579 @param ExtendedVerification Driver may perform diagnostics on reset.
581 @retval EFI_SUCCESS The device was reset.
582 @retval EFI_DEVICE_ERROR The device is not functioning properly and could
588 BiosKeyboardResetEx (
589 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
590 IN BOOLEAN ExtendedVerification
594 Reads the next keystroke from the input device. The WaitForKey Event can
595 be used to test for existance of a keystroke via WaitForEvent () call.
597 @param This Protocol instance pointer.
598 @param KeyData A pointer to a buffer that is filled in with the keystroke
599 state data for the key that was pressed.
601 @retval EFI_SUCCESS The keystroke information was returned.
602 @retval EFI_NOT_READY There was no keystroke data availiable.
603 @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
605 @retval EFI_INVALID_PARAMETER KeyData is NULL.
610 BiosKeyboardReadKeyStrokeEx (
611 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
612 OUT EFI_KEY_DATA
*KeyData
616 Set certain state for the input device.
618 @param This Protocol instance pointer.
619 @param KeyToggleState A pointer to the EFI_KEY_TOGGLE_STATE to set the
620 state for the input device.
622 @retval EFI_SUCCESS The device state was set successfully.
623 @retval EFI_DEVICE_ERROR The device is not functioning correctly and could
624 not have the setting adjusted.
625 @retval EFI_UNSUPPORTED The device does not have the ability to set its state.
626 @retval EFI_INVALID_PARAMETER KeyToggleState is NULL.
631 BiosKeyboardSetState (
632 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
633 IN EFI_KEY_TOGGLE_STATE
*KeyToggleState
637 Register a notification function for a particular keystroke for the input device.
639 @param This Protocol instance pointer.
640 @param KeyData A pointer to a buffer that is filled in with the keystroke
641 information data for the key that was pressed. If KeyData.Key,
642 KeyData.KeyState.KeyToggleState and KeyData.KeyState.KeyShiftState
643 are 0, then any incomplete keystroke will trigger a notification of
644 the KeyNotificationFunction.
645 @param KeyNotificationFunction Points to the function to be called when the key
646 sequence is typed specified by KeyData. This notification function
647 should be called at <=TPL_CALLBACK.
648 @param NotifyHandle Points to the unique handle assigned to the registered notification.
651 @retval EFI_SUCCESS The notification function was registered successfully.
652 @retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data structures.
653 @retval EFI_INVALID_PARAMETER KeyData or NotifyHandle is NULL.
658 BiosKeyboardRegisterKeyNotify (
659 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
660 IN EFI_KEY_DATA
*KeyData
,
661 IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction
,
662 OUT VOID
**NotifyHandle
666 Remove a registered notification function from a particular keystroke.
668 @param This Protocol instance pointer.
669 @param NotificationHandle The handle of the notification function being unregistered.
671 @retval EFI_SUCCESS The notification function was unregistered successfully.
672 @retval EFI_INVALID_PARAMETER The NotificationHandle is invalid.
677 BiosKeyboardUnregisterKeyNotify (
678 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
679 IN VOID
*NotificationHandle
683 Wait for a specific value to be presented in
684 Data register of Keyboard Controller by keyboard and then read it,
685 used in keyboard commands ack
687 @param BiosKeyboardPrivate Keyboard instance pointer.
688 @param Value The value to be waited for
689 @param WaitForValueTimeOut The limit of microseconds for timeout
691 @retval EFI_SUCCESS The command byte is written successfully.
692 @retval EFI_TIMEOUT Timeout occurred during writing.
696 KeyboardWaitForValue (
697 IN BIOS_KEYBOARD_DEV
*BiosKeyboardPrivate
,
699 IN UINTN WaitForValueTimeOut
703 Write data byte to input buffer or input/output ports of Keyboard Controller with delay and waiting for buffer-empty state.
705 @param BiosKeyboardPrivate Keyboard instance pointer.
706 @param Data Data byte to write.
708 @retval EFI_SUCCESS The data byte is written successfully.
709 @retval EFI_TIMEOUT Timeout occurred during writing.
714 IN BIOS_KEYBOARD_DEV
*BiosKeyboardPrivate
,
719 Free keyboard notify list.
721 @param ListHead The list head
723 @retval EFI_SUCCESS Free the notify list successfully
724 @retval EFI_INVALID_PARAMETER ListHead is invalid.
728 BiosKeyboardFreeNotifyList (
729 IN OUT LIST_ENTRY
*ListHead
733 Check if key is registered.
735 @param RegsiteredData A pointer to a buffer that is filled in with the keystroke
736 state data for the key that was registered.
737 @param InputData A pointer to a buffer that is filled in with the keystroke
738 state data for the key that was pressed.
740 @retval TRUE Key be pressed matches a registered key.
741 @retval FLASE Match failed.
746 IN EFI_KEY_DATA
*RegsiteredData
,
747 IN EFI_KEY_DATA
*InputData
751 Waiting on the keyboard event, if there's any key pressed by the user, signal the event
753 @param Event The event that be siganlled when any key has been stroked.
754 @param Context Pointer of the protocol EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
759 BiosKeyboardWaitForKeyEx (