3 Copyright (c) 2006 - 2017, 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
;
225 // Buffer storing EFI_KEY_DATA
228 SIMPLE_QUEUE QueueForNotify
;
231 // Notification Function List
233 LIST_ENTRY NotifyList
;
234 EFI_EVENT KeyNotifyProcessEvent
;
235 EFI_EVENT TimerEvent
;
239 #define BIOS_KEYBOARD_DEV_FROM_THIS(a) CR (a, BIOS_KEYBOARD_DEV, SimpleTextIn, BIOS_KEYBOARD_DEV_SIGNATURE)
240 #define TEXT_INPUT_EX_BIOS_KEYBOARD_DEV_FROM_THIS(a) \
244 BIOS_KEYBOARD_DEV_SIGNATURE \
250 extern EFI_DRIVER_BINDING_PROTOCOL gBiosKeyboardDriverBinding
;
253 // Driver Binding Protocol functions
257 Check whether the driver supports this device.
259 @param This The Udriver binding protocol.
260 @param Controller The controller handle to check.
261 @param RemainingDevicePath The remaining device path.
263 @retval EFI_SUCCESS The driver supports this controller.
264 @retval other This device isn't supported.
269 BiosKeyboardDriverBindingSupported (
270 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
271 IN EFI_HANDLE Controller
,
272 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
276 Starts the device with this driver.
278 @param This The driver binding instance.
279 @param Controller Handle of device to bind driver to.
280 @param RemainingDevicePath Optional parameter use to pick a specific child
283 @retval EFI_SUCCESS The controller is controlled by the driver.
284 @retval Other This controller cannot be started.
289 BiosKeyboardDriverBindingStart (
290 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
291 IN EFI_HANDLE Controller
,
292 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
296 Stop the device handled by this driver.
298 @param This The driver binding protocol.
299 @param Controller The controller to release.
300 @param NumberOfChildren The number of handles in ChildHandleBuffer.
301 @param ChildHandleBuffer The array of child handle.
303 @retval EFI_SUCCESS The device was stopped.
304 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
305 @retval Others Fail to uninstall protocols attached on the device.
310 BiosKeyboardDriverBindingStop (
311 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
312 IN EFI_HANDLE Controller
,
313 IN UINTN NumberOfChildren
,
314 IN EFI_HANDLE
*ChildHandleBuffer
318 Retrieves a Unicode string that is the user readable name of the driver.
320 This function retrieves the user readable name of a driver in the form of a
321 Unicode string. If the driver specified by This has a user readable name in
322 the language specified by Language, then a pointer to the driver name is
323 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
324 by This does not support the language specified by Language,
325 then EFI_UNSUPPORTED is returned.
327 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
328 EFI_COMPONENT_NAME_PROTOCOL instance.
330 @param Language[in] A pointer to a Null-terminated ASCII string
331 array indicating the language. This is the
332 language of the driver name that the caller is
333 requesting, and it must match one of the
334 languages specified in SupportedLanguages. The
335 number of languages supported by a driver is up
336 to the driver writer. Language is specified
337 in RFC 4646 or ISO 639-2 language code format.
339 @param DriverName[out] A pointer to the Unicode string to return.
340 This Unicode string is the name of the
341 driver specified by This in the language
342 specified by Language.
344 @retval EFI_SUCCESS The Unicode string for the Driver specified by
345 This and the language specified by Language was
346 returned in DriverName.
348 @retval EFI_INVALID_PARAMETER Language is NULL.
350 @retval EFI_INVALID_PARAMETER DriverName is NULL.
352 @retval EFI_UNSUPPORTED The driver specified by This does not support
353 the language specified by Language.
358 BiosKeyboardComponentNameGetDriverName (
359 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
361 OUT CHAR16
**DriverName
366 Retrieves a Unicode string that is the user readable name of the controller
367 that is being managed by a driver.
369 This function retrieves the user readable name of the controller specified by
370 ControllerHandle and ChildHandle in the form of a Unicode string. If the
371 driver specified by This has a user readable name in the language specified by
372 Language, then a pointer to the controller name is returned in ControllerName,
373 and EFI_SUCCESS is returned. If the driver specified by This is not currently
374 managing the controller specified by ControllerHandle and ChildHandle,
375 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
376 support the language specified by Language, then EFI_UNSUPPORTED is returned.
378 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
379 EFI_COMPONENT_NAME_PROTOCOL instance.
381 @param ControllerHandle[in] The handle of a controller that the driver
382 specified by This is managing. This handle
383 specifies the controller whose name is to be
386 @param ChildHandle[in] The handle of the child controller to retrieve
387 the name of. This is an optional parameter that
388 may be NULL. It will be NULL for device
389 drivers. It will also be NULL for a bus drivers
390 that wish to retrieve the name of the bus
391 controller. It will not be NULL for a bus
392 driver that wishes to retrieve the name of a
395 @param Language[in] A pointer to a Null-terminated ASCII string
396 array indicating the language. This is the
397 language of the driver name that the caller is
398 requesting, and it must match one of the
399 languages specified in SupportedLanguages. The
400 number of languages supported by a driver is up
401 to the driver writer. Language is specified in
402 RFC 4646 or ISO 639-2 language code format.
404 @param ControllerName[out] A pointer to the Unicode string to return.
405 This Unicode string is the name of the
406 controller specified by ControllerHandle and
407 ChildHandle in the language specified by
408 Language from the point of view of the driver
411 @retval EFI_SUCCESS The Unicode string for the user readable name in
412 the language specified by Language for the
413 driver specified by This was returned in
416 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
418 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
421 @retval EFI_INVALID_PARAMETER Language is NULL.
423 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
425 @retval EFI_UNSUPPORTED The driver specified by This is not currently
426 managing the controller specified by
427 ControllerHandle and ChildHandle.
429 @retval EFI_UNSUPPORTED The driver specified by This does not support
430 the language specified by Language.
435 BiosKeyboardComponentNameGetControllerName (
436 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
437 IN EFI_HANDLE ControllerHandle
,
438 IN EFI_HANDLE ChildHandle OPTIONAL
,
440 OUT CHAR16
**ControllerName
445 // Simple Text Input Protocol functions
448 Reset the Keyboard and do BAT test for it, if (ExtendedVerification == TRUE) then do some extra keyboard validations.
450 @param This Pointer of simple text Protocol.
451 @param ExtendedVerification Whether perform the extra validation of keyboard. True: perform; FALSE: skip.
453 @retval EFI_SUCCESS The command byte is written successfully.
454 @retval EFI_DEVICE_ERROR Errors occurred during resetting keyboard.
460 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
461 IN BOOLEAN ExtendedVerification
465 Read out the scan code of the key that has just been stroked.
467 @param This Pointer of simple text Protocol.
468 @param Key Pointer for store the key that read out.
470 @retval EFI_SUCCESS The key is read out successfully.
471 @retval other The key reading failed.
476 BiosKeyboardReadKeyStroke (
477 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
478 OUT EFI_INPUT_KEY
*Key
482 // Private worker functions
485 Waiting on the keyboard event, if there's any key pressed by the user, signal the event
487 @param Event The event that be siganlled when any key has been stroked.
488 @param Context Pointer of the protocol EFI_SIMPLE_TEXT_INPUT_PROTOCOL.
493 BiosKeyboardWaitForKey (
499 Check key buffer to get the key stroke status.
501 @param This Pointer of the protocol EFI_SIMPLE_TEXT_IN_PROTOCOL.
503 @retval EFI_SUCCESS A key is being pressed now.
504 @retval Other No key is now pressed.
509 BiosKeyboardCheckForKey (
510 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
514 Convert unicode combined with scan code of key to the counterpart of EFIScancode of it.
516 @param KeyChar Unicode of key.
517 @param ScanCode Scan code of key.
519 @return The value of EFI Scancode for the key.
520 @retval SCAN_NULL No corresponding value in the EFI convert table is found for the key.
524 ConvertToEFIScanCode (
530 Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard Command
531 If Keyboard receives 0xF4, it will respond with 'ACK'. If it doesn't respond, the device
532 should not be in system.
534 @param BiosKeyboardPrivate Keyboard Private Data Struture
536 @retval TRUE Keyboard in System.
537 @retval FALSE Keyboard not in System.
541 CheckKeyboardConnect (
542 IN BIOS_KEYBOARD_DEV
*BiosKeyboardPrivate
546 Timer event handler: read a series of key stroke from 8042
547 and put them into memory key buffer.
548 It is registered as running under TPL_NOTIFY
550 @param Event The timer event
551 @param Context A BIOS_KEYBOARD_DEV pointer
556 BiosKeyboardTimerHandler (
564 @param Event Indicates the event that invoke this function.
565 @param Context Indicates the calling context.
569 KeyNotifyProcessHandler (
575 Reset the input device and optionaly run diagnostics
577 @param This Protocol instance pointer.
578 @param ExtendedVerification Driver may perform diagnostics on reset.
580 @retval EFI_SUCCESS The device was reset.
581 @retval EFI_DEVICE_ERROR The device is not functioning properly and could
587 BiosKeyboardResetEx (
588 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
589 IN BOOLEAN ExtendedVerification
593 Reads the next keystroke from the input device. The WaitForKey Event can
594 be used to test for existance of a keystroke via WaitForEvent () call.
596 @param This Protocol instance pointer.
597 @param KeyData A pointer to a buffer that is filled in with the keystroke
598 state data for the key that was pressed.
600 @retval EFI_SUCCESS The keystroke information was returned.
601 @retval EFI_NOT_READY There was no keystroke data availiable.
602 @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
604 @retval EFI_INVALID_PARAMETER KeyData is NULL.
609 BiosKeyboardReadKeyStrokeEx (
610 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
611 OUT EFI_KEY_DATA
*KeyData
615 Set certain state for the input device.
617 @param This Protocol instance pointer.
618 @param KeyToggleState A pointer to the EFI_KEY_TOGGLE_STATE to set the
619 state for the input device.
621 @retval EFI_SUCCESS The device state was set successfully.
622 @retval EFI_DEVICE_ERROR The device is not functioning correctly and could
623 not have the setting adjusted.
624 @retval EFI_UNSUPPORTED The device does not have the ability to set its state.
625 @retval EFI_INVALID_PARAMETER KeyToggleState is NULL.
630 BiosKeyboardSetState (
631 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
632 IN EFI_KEY_TOGGLE_STATE
*KeyToggleState
636 Register a notification function for a particular keystroke for the input device.
638 @param This Protocol instance pointer.
639 @param KeyData A pointer to a buffer that is filled in with the keystroke
640 information data for the key that was pressed. If KeyData.Key,
641 KeyData.KeyState.KeyToggleState and KeyData.KeyState.KeyShiftState
642 are 0, then any incomplete keystroke will trigger a notification of
643 the KeyNotificationFunction.
644 @param KeyNotificationFunction Points to the function to be called when the key
645 sequence is typed specified by KeyData. This notification function
646 should be called at <=TPL_CALLBACK.
647 @param NotifyHandle Points to the unique handle assigned to the registered notification.
650 @retval EFI_SUCCESS The notification function was registered successfully.
651 @retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data structures.
652 @retval EFI_INVALID_PARAMETER KeyData or NotifyHandle is NULL.
657 BiosKeyboardRegisterKeyNotify (
658 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
659 IN EFI_KEY_DATA
*KeyData
,
660 IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction
,
661 OUT VOID
**NotifyHandle
665 Remove a registered notification function from a particular keystroke.
667 @param This Protocol instance pointer.
668 @param NotificationHandle The handle of the notification function being unregistered.
670 @retval EFI_SUCCESS The notification function was unregistered successfully.
671 @retval EFI_INVALID_PARAMETER The NotificationHandle is invalid.
676 BiosKeyboardUnregisterKeyNotify (
677 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL
*This
,
678 IN VOID
*NotificationHandle
682 Wait for a specific value to be presented in
683 Data register of Keyboard Controller by keyboard and then read it,
684 used in keyboard commands ack
686 @param BiosKeyboardPrivate Keyboard instance pointer.
687 @param Value The value to be waited for
688 @param WaitForValueTimeOut The limit of microseconds for timeout
690 @retval EFI_SUCCESS The command byte is written successfully.
691 @retval EFI_TIMEOUT Timeout occurred during writing.
695 KeyboardWaitForValue (
696 IN BIOS_KEYBOARD_DEV
*BiosKeyboardPrivate
,
698 IN UINTN WaitForValueTimeOut
702 Write data byte to input buffer or input/output ports of Keyboard Controller with delay and waiting for buffer-empty state.
704 @param BiosKeyboardPrivate Keyboard instance pointer.
705 @param Data Data byte to write.
707 @retval EFI_SUCCESS The data byte is written successfully.
708 @retval EFI_TIMEOUT Timeout occurred during writing.
713 IN BIOS_KEYBOARD_DEV
*BiosKeyboardPrivate
,
718 Free keyboard notify list.
720 @param ListHead The list head
722 @retval EFI_SUCCESS Free the notify list successfully
723 @retval EFI_INVALID_PARAMETER ListHead is invalid.
727 BiosKeyboardFreeNotifyList (
728 IN OUT LIST_ENTRY
*ListHead
732 Check if key is registered.
734 @param RegsiteredData A pointer to a buffer that is filled in with the keystroke
735 state data for the key that was registered.
736 @param InputData A pointer to a buffer that is filled in with the keystroke
737 state data for the key that was pressed.
739 @retval TRUE Key be pressed matches a registered key.
740 @retval FLASE Match failed.
745 IN EFI_KEY_DATA
*RegsiteredData
,
746 IN EFI_KEY_DATA
*InputData
750 Waiting on the keyboard event, if there's any key pressed by the user, signal the event
752 @param Event The event that be siganlled when any key has been stroked.
753 @param Context Pointer of the protocol EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
758 BiosKeyboardWaitForKeyEx (