TianoCore EDK2 master
|
Go to the source code of this file.
Variables | |
EFI_DRIVER_BINDING_PROTOCOL | gUsbKeyboardDriverBinding |
USB Keyboard Driver that manages USB keyboard and produces Simple Text Input Protocol and Simple Text Input Ex Protocol.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EfiKey.c.
BOOLEAN IsKeyRegistered | ( | IN EFI_KEY_DATA * | RegsiteredData, |
IN EFI_KEY_DATA * | InputData | ||
) |
Check whether the pressed key matches a registered key or not.
RegsiteredData | A pointer to keystroke data for the key that was registered. |
InputData | A pointer to keystroke data for the key that was pressed. |
TRUE | Key pressed matches a registered key. |
FALSE | Key pressed does not matches a registered key. |
EFI_STATUS KbdFreeNotifyList | ( | IN OUT LIST_ENTRY * | NotifyList | ) |
EFI_STATUS EFIAPI USBKeyboardDriverBindingEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Entrypoint of USB Keyboard Driver.
This function is the entrypoint of USB Keyboard Driver. It installs Driver Binding Protocols together with Component Name Protocols.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
EFI_STATUS EFIAPI USBKeyboardDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Starts the keyboard device with this driver.
This function produces Simple Text Input Protocol and Simple Text Input Ex Protocol, initializes the keyboard device, and submit Asynchronous Interrupt Transfer to manage this keyboard device.
This | The USB keyboard driver binding instance. |
Controller | Handle of device to bind driver to. |
RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | The controller is controlled by the usb keyboard driver. |
EFI_UNSUPPORTED | No interrupt endpoint can be found. |
Other | This controller cannot be started. |
EFI_STATUS EFIAPI USBKeyboardDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop the USB keyboard device handled by this driver.
This | The USB keyboard driver binding protocol. |
Controller | The controller to release. |
NumberOfChildren | The number of handles in ChildHandleBuffer. |
ChildHandleBuffer | The array of child handle. |
EFI_SUCCESS | The device was stopped. |
EFI_UNSUPPORTED | Simple Text In Protocol or Simple Text In Ex Protocol is not installed on Controller. |
EFI_DEVICE_ERROR | The device could not be stopped due to a device error. |
Others | Fail to uninstall protocols attached on the device. |
EFI_STATUS EFIAPI USBKeyboardDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Check whether USB keyboard driver supports this device.
This | The USB keyboard driver binding protocol. |
Controller | The controller handle to check. |
RemainingDevicePath | The remaining device path. |
EFI_SUCCESS | The driver supports this controller. |
other | This device isn't supported. |
EFI_STATUS EFIAPI USBKeyboardReadKeyStroke | ( | IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL * | This, |
OUT EFI_INPUT_KEY * | Key | ||
) |
Reads the next keystroke from the input device.
This | The EFI_SIMPLE_TEXT_INPUT_PROTOCOL instance. |
Key | A pointer to a buffer that is filled in with the keystroke information for the key that was pressed. |
EFI_SUCCESS | The keystroke information was returned. |
EFI_NOT_READY | There was no keystroke data available. |
EFI_DEVICE_ERROR | The keystroke information was not returned due to hardware errors. |
EFI_UNSUPPORTED | The device does not support the ability to read keystroke data. |
EFI_STATUS EFIAPI USBKeyboardReadKeyStrokeEx | ( | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL * | This, |
OUT EFI_KEY_DATA * | KeyData | ||
) |
Reads the next keystroke from the input device.
This | Protocol instance pointer. |
KeyData | A pointer to a buffer that is filled in with the keystroke state data for the key that was pressed. |
EFI_SUCCESS | The keystroke information was returned. |
EFI_NOT_READY | There was no keystroke data available. |
EFI_DEVICE_ERROR | The keystroke information was not returned due to hardware errors. |
EFI_INVALID_PARAMETER | KeyData is NULL. |
EFI_UNSUPPORTED | The device does not support the ability to read keystroke data. |
EFI_STATUS USBKeyboardReadKeyStrokeWorker | ( | IN OUT USB_KB_DEV * | UsbKeyboardDevice, |
OUT EFI_KEY_DATA * | KeyData | ||
) |
Internal function to read the next keystroke from the keyboard buffer.
UsbKeyboardDevice | USB keyboard's private structure. |
KeyData | A pointer to buffer to hold the keystroke data for the key that was pressed. |
EFI_SUCCESS | The keystroke information was returned. |
EFI_NOT_READY | There was no keystroke data available. |
EFI_DEVICE_ERROR | The keystroke information was not returned due to hardware errors. |
EFI_INVALID_PARAMETER | KeyData is NULL. |
Others | Fail to translate keycode into EFI_INPUT_KEY |
EFI_STATUS EFIAPI USBKeyboardRegisterKeyNotify | ( | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL * | This, |
IN EFI_KEY_DATA * | KeyData, | ||
IN EFI_KEY_NOTIFY_FUNCTION | KeyNotificationFunction, | ||
OUT VOID ** | NotifyHandle | ||
) |
Register a notification function for a particular keystroke for the input device.
This | Protocol instance pointer. |
KeyData | A pointer to a buffer that is filled in with the keystroke information for the key that was pressed. If KeyData.Key, KeyData.KeyState.KeyToggleState and KeyData.KeyState.KeyShiftState are 0, then any incomplete keystroke will trigger a notification of the KeyNotificationFunction. |
KeyNotificationFunction | Points to the function to be called when the key sequence is typed specified by KeyData. This notification function should be called at <=TPL_CALLBACK. |
NotifyHandle | Points to the unique handle assigned to the registered notification. |
EFI_SUCCESS | The notification function was registered successfully. |
EFI_OUT_OF_RESOURCES | Unable to allocate resources for necessary data structures. |
EFI_INVALID_PARAMETER | KeyData or NotifyHandle or KeyNotificationFunction is NULL. |
EFI_STATUS EFIAPI USBKeyboardReset | ( | IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL * | This, |
IN BOOLEAN | ExtendedVerification | ||
) |
Reset the input device and optionally run diagnostics
There are 2 types of reset for USB keyboard. For non-exhaustive reset, only keyboard buffer is cleared. For exhaustive reset, in addition to clearance of keyboard buffer, the hardware status is also re-initialized.
This | Protocol instance pointer. |
ExtendedVerification | Driver may perform diagnostics on reset. |
EFI_SUCCESS | The device was reset. |
EFI_DEVICE_ERROR | The device is not functioning properly and could not be reset. |
EFI_STATUS EFIAPI USBKeyboardResetEx | ( | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL * | This, |
IN BOOLEAN | ExtendedVerification | ||
) |
Resets the input device hardware.
The Reset() function resets the input device hardware. As part of initialization process, the firmware/device will make a quick but reasonable attempt to verify that the device is functioning. If the ExtendedVerification flag is TRUE the firmware may take an extended amount of time to verify the device is operating on reset. Otherwise the reset operation is to occur as quickly as possible. The hardware verification process is not defined by this specification and is left up to the platform firmware or driver to implement.
This | A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. |
ExtendedVerification | Indicates that the driver may perform a more exhaustive verification operation of the device during reset. |
EFI_SUCCESS | The device was reset. |
EFI_DEVICE_ERROR | The device is not functioning correctly and could not be reset. |
EFI_STATUS EFIAPI USBKeyboardSetState | ( | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL * | This, |
IN EFI_KEY_TOGGLE_STATE * | KeyToggleState | ||
) |
Set certain state for the input device.
This | Protocol instance pointer. |
KeyToggleState | A pointer to the EFI_KEY_TOGGLE_STATE to set the state for the input device. |
EFI_SUCCESS | The device state was set appropriately. |
EFI_DEVICE_ERROR | The device is not functioning correctly and could not have the setting adjusted. |
EFI_UNSUPPORTED | The device does not support the ability to have its state set. |
EFI_INVALID_PARAMETER | KeyToggleState is NULL. |
EFI_STATUS EFIAPI USBKeyboardUnregisterKeyNotify | ( | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL * | This, |
IN VOID * | NotificationHandle | ||
) |
Remove a registered notification function from a particular keystroke.
This | Protocol instance pointer. |
NotificationHandle | The handle of the notification function being unregistered. |
EFI_SUCCESS | The notification function was unregistered successfully. |
EFI_INVALID_PARAMETER | The NotificationHandle is invalid |
Event notification function registered for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx and EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey.
Event | Event to be signaled when a key is pressed. |
Context | Points to USB_KB_DEV instance. |
EFI_DRIVER_BINDING_PROTOCOL gUsbKeyboardDriverBinding |