TianoCore EDK2 master
Loading...
Searching...
No Matches
EfiKey.h File Reference

Go to the source code of this file.

Data Structures

struct  USB_KEY
 
struct  USB_SIMPLE_QUEUE
 
struct  _KEYBOARD_CONSOLE_IN_EX_NOTIFY
 
struct  USB_NS_KEY
 
struct  USB_KB_DEV
 
struct  LED_MAP
 

Macros

#define KEYBOARD_TIMER_INTERVAL   200000
 
#define MAX_KEY_ALLOWED   32
 
#define HZ   1000 * 1000 * 10
 
#define USBKBD_REPEAT_DELAY   ((HZ) / 2)
 
#define USBKBD_REPEAT_RATE   ((HZ) / 50)
 
#define CLASS_HID   3
 
#define SUBCLASS_BOOT   1
 
#define PROTOCOL_KEYBOARD   1
 
#define BOOT_PROTOCOL   0
 
#define REPORT_PROTOCOL   1
 
#define USB_KB_DEV_SIGNATURE   SIGNATURE_32 ('u', 'k', 'b', 'd')
 
#define USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE   SIGNATURE_32 ('u', 'k', 'b', 'x')
 
#define USB_NS_KEY_SIGNATURE   SIGNATURE_32 ('u', 'n', 's', 'k')
 
#define USB_NS_KEY_FORM_FROM_LINK(a)   CR (a, USB_NS_KEY, Link, USB_NS_KEY_SIGNATURE)
 
#define USB_KB_DEV_FROM_THIS(a)    CR(a, USB_KB_DEV, SimpleInput, USB_KB_DEV_SIGNATURE)
 
#define TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS(a)    CR(a, USB_KB_DEV, SimpleInputEx, USB_KB_DEV_SIGNATURE)
 
#define NUMBER_OF_VALID_NON_MODIFIER_USB_KEYCODE   0x62
 
#define NUMBER_OF_VALID_USB_KEYCODE   0x6A
 
#define USBKBD_VALID_KEYCODE(Key)   ((UINT8) (Key) > 3)
 

Typedefs

typedef struct _KEYBOARD_CONSOLE_IN_EX_NOTIFY KEYBOARD_CONSOLE_IN_EX_NOTIFY
 

Functions

EFI_STATUS EFIAPI USBKeyboardDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI USBKeyboardDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI USBKeyboardDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
EFI_STATUS EFIAPI UsbKeyboardComponentNameGetDriverName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
 
EFI_STATUS EFIAPI UsbKeyboardComponentNameGetControllerName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
 
EFI_STATUS EFIAPI USBKeyboardReset (IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
EFI_STATUS EFIAPI USBKeyboardReadKeyStroke (IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, OUT EFI_INPUT_KEY *Key)
 
EFI_STATUS EFIAPI USBKeyboardResetEx (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
EFI_STATUS EFIAPI USBKeyboardReadKeyStrokeEx (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, OUT EFI_KEY_DATA *KeyData)
 
EFI_STATUS EFIAPI USBKeyboardSetState (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_TOGGLE_STATE *KeyToggleState)
 
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)
 
EFI_STATUS EFIAPI USBKeyboardUnregisterKeyNotify (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle)
 
VOID EFIAPI USBKeyboardWaitForKey (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS KbdFreeNotifyList (IN OUT LIST_ENTRY *NotifyList)
 
BOOLEAN IsKeyRegistered (IN EFI_KEY_DATA *RegsiteredData, IN EFI_KEY_DATA *InputData)
 
VOID EFIAPI USBKeyboardTimerHandler (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EFIAPI KeyNotifyProcessHandler (IN EFI_EVENT Event, IN VOID *Context)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gUsbKeyboardDriverBinding
 
EFI_COMPONENT_NAME_PROTOCOL gUsbKeyboardComponentName
 
EFI_COMPONENT_NAME2_PROTOCOL gUsbKeyboardComponentName2
 

Detailed Description

Header file for USB Keyboard Driver's Data Structures.

Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file EfiKey.h.

Macro Definition Documentation

◆ BOOT_PROTOCOL

#define BOOT_PROTOCOL   0

Definition at line 49 of file EfiKey.h.

◆ CLASS_HID

#define CLASS_HID   3

Definition at line 45 of file EfiKey.h.

◆ HZ

#define HZ   1000 * 1000 * 10

Definition at line 41 of file EfiKey.h.

◆ KEYBOARD_TIMER_INTERVAL

#define KEYBOARD_TIMER_INTERVAL   200000

Definition at line 37 of file EfiKey.h.

◆ MAX_KEY_ALLOWED

#define MAX_KEY_ALLOWED   32

Definition at line 39 of file EfiKey.h.

◆ NUMBER_OF_VALID_NON_MODIFIER_USB_KEYCODE

#define NUMBER_OF_VALID_NON_MODIFIER_USB_KEYCODE   0x62

Definition at line 178 of file EfiKey.h.

◆ NUMBER_OF_VALID_USB_KEYCODE

#define NUMBER_OF_VALID_USB_KEYCODE   0x6A

Definition at line 179 of file EfiKey.h.

◆ PROTOCOL_KEYBOARD

#define PROTOCOL_KEYBOARD   1

Definition at line 47 of file EfiKey.h.

◆ REPORT_PROTOCOL

#define REPORT_PROTOCOL   1

Definition at line 50 of file EfiKey.h.

◆ SUBCLASS_BOOT

#define SUBCLASS_BOOT   1

Definition at line 46 of file EfiKey.h.

◆ TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS

#define TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (   a)     CR(a, USB_KB_DEV, SimpleInputEx, USB_KB_DEV_SIGNATURE)

Definition at line 167 of file EfiKey.h.

◆ USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE

#define USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE   SIGNATURE_32 ('u', 'k', 'b', 'x')

Definition at line 65 of file EfiKey.h.

◆ USB_KB_DEV_FROM_THIS

#define USB_KB_DEV_FROM_THIS (   a)     CR(a, USB_KB_DEV, SimpleInput, USB_KB_DEV_SIGNATURE)

Definition at line 165 of file EfiKey.h.

◆ USB_KB_DEV_SIGNATURE

#define USB_KB_DEV_SIGNATURE   SIGNATURE_32 ('u', 'k', 'b', 'd')

Definition at line 64 of file EfiKey.h.

◆ USB_NS_KEY_FORM_FROM_LINK

#define USB_NS_KEY_FORM_FROM_LINK (   a)    CR (a, USB_NS_KEY, Link, USB_NS_KEY_SIGNATURE)

Definition at line 92 of file EfiKey.h.

◆ USB_NS_KEY_SIGNATURE

#define USB_NS_KEY_SIGNATURE   SIGNATURE_32 ('u', 'n', 's', 'k')

Definition at line 74 of file EfiKey.h.

◆ USBKBD_REPEAT_DELAY

#define USBKBD_REPEAT_DELAY   ((HZ) / 2)

Definition at line 42 of file EfiKey.h.

◆ USBKBD_REPEAT_RATE

#define USBKBD_REPEAT_RATE   ((HZ) / 50)

Definition at line 43 of file EfiKey.h.

◆ USBKBD_VALID_KEYCODE

#define USBKBD_VALID_KEYCODE (   Key)    ((UINT8) (Key) > 3)

Definition at line 183 of file EfiKey.h.

Function Documentation

◆ IsKeyRegistered()

BOOLEAN IsKeyRegistered ( IN EFI_KEY_DATA RegsiteredData,
IN EFI_KEY_DATA InputData 
)

Check whether the pressed key matches a registered key or not.

Parameters
RegsiteredDataA pointer to keystroke data for the key that was registered.
InputDataA pointer to keystroke data for the key that was pressed.
Return values
TRUEKey pressed matches a registered key.
FALSEKey pressed does not match a registered key.

Judge whether is a registed key

Parameters
RegsiteredDataA pointer to a buffer that is filled in with the keystroke state data for the key that was registered.
InputDataA pointer to a buffer that is filled in with the keystroke state data for the key that was pressed.
Return values
TRUEKey be pressed matches a registered key.
FALSEMatch failed.

Judge whether is a registered key

Parameters
RegsiteredDataA pointer to a buffer that is filled in with the keystroke state data for the key that was registered.
InputDataA pointer to a buffer that is filled in with the keystroke state data for the key that was pressed.
Return values
TRUEKey be pressed matches a registered key.
FALSEMatch failed.

Check whether the pressed key matches a registered key or not.

Parameters
RegsiteredDataA pointer to keystroke data for the key that was registered.
InputDataA pointer to keystroke data for the key that was pressed.
Return values
TRUEKey pressed matches a registered key.
FALSEKey pressed does not matches a registered key.

Test if the key has been registered on input device.

Parameters
RegsiteredDataA pointer to a buffer that is filled in with the keystroke state data for the key that was registered.
InputDataA pointer to a buffer that is filled in with the keystroke state data for the key that was pressed.
Return values
TRUEKey be pressed matches a registered key.
FALSEMatch failed.

Check if the key already has been registered.

If both RegsiteredData and InputData is NULL, then ASSERT().

Parameters
RegsiteredDataA pointer to a buffer that is filled in with the keystroke state data for the key that was registered.
InputDataA pointer to a buffer that is filled in with the keystroke state data for the key that was pressed.
Return values
TRUEKey be pressed matches a registered key.
FALSEMatch failed.

Definition at line 448 of file VirtualKeyboard.c.

◆ KbdFreeNotifyList()

EFI_STATUS KbdFreeNotifyList ( IN OUT LIST_ENTRY NotifyList)

Free keyboard notify list.

Parameters
NotifyListThe keyboard notify list to free.
Return values
EFI_SUCCESSFree the notify list successfully.
EFI_INVALID_PARAMETERNotifyList is NULL.

Free the waiting key notify list.

Parameters
ListHeadPointer to list head
Return values
EFI_INVALID_PARAMETERListHead is NULL
EFI_SUCCESSSuccess to free NotifyList

Definition at line 618 of file Ps2Keyboard.c.

◆ KeyNotifyProcessHandler()

VOID EFIAPI KeyNotifyProcessHandler ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Process key notify.

Parameters
EventIndicates the event that invoke this function.
ContextIndicates the calling context.

Definition at line 1080 of file VirtualKeyboard.c.

◆ UsbKeyboardComponentNameGetControllerName()

EFI_STATUS EFIAPI UsbKeyboardComponentNameGetControllerName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_HANDLE ChildHandle  OPTIONAL,
IN CHAR8 *  Language,
OUT CHAR16 **  ControllerName 
)

Retrieves a Unicode string that is the user readable name of the controller that is being managed by a driver.

This function retrieves the user readable name of the controller specified by ControllerHandle and ChildHandle in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the controller name is returned in ControllerName, and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.

Parameters
ThisA pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance.
ControllerHandleThe handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned.
ChildHandleThe handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to retrieve the name of the bus controller. It will not be NULL for a bus driver that wishes to retrieve the name of a child controller.
LanguageA pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format.
ControllerNameA pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by Language from the point of view of the driver specified by This.
Return values
EFI_SUCCESSThe Unicode string for the user readable name in the language specified by Language for the driver specified by This was returned in DriverName.
EFI_INVALID_PARAMETERControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERChildHandle is not NULL and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERLanguage is NULL.
EFI_INVALID_PARAMETERControllerName is NULL.
EFI_UNSUPPORTEDThe driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle.
EFI_UNSUPPORTEDThe driver specified by This does not support the language specified by Language.

Retrieves a Unicode string that is the user readable name of the controller that is being managed by a driver.

This function retrieves the user readable name of the controller specified by ControllerHandle and ChildHandle in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the controller name is returned in ControllerName, and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.

Parameters
ThisA pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance.
ControllerHandleThe handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned.
ChildHandleThe handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to retrieve the name of the bus controller. It will not be NULL for a bus driver that wishes to retrieve the name of a child controller.
LanguageA pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format.
ControllerNameA pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by Language from the point of view of the driver specified by This.
Return values
EFI_SUCCESSThe Unicode string for the user readable name in the language specified by Language for the driver specified by This was returned in DriverName.
EFI_INVALID_PARAMETERControllerHandle is NULL.
EFI_INVALID_PARAMETERChildHandle is not NULL and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERLanguage is NULL.
EFI_INVALID_PARAMETERControllerName is NULL.
EFI_UNSUPPORTEDThe driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle.
EFI_UNSUPPORTEDThe driver specified by This does not support the language specified by Language.

Definition at line 145 of file ComponentName.c.

◆ UsbKeyboardComponentNameGetDriverName()

EFI_STATUS EFIAPI UsbKeyboardComponentNameGetDriverName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN CHAR8 *  Language,
OUT CHAR16 **  DriverName 
)

Retrieves a Unicode string that is the user readable name of the driver.

This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.

Parameters
ThisA pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance.
LanguageA pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format.
DriverNameA pointer to the Unicode string to return. This Unicode string is the name of the driver specified by This in the language specified by Language.
Return values
EFI_SUCCESSThe Unicode string for the Driver specified by This and the language specified by Language was returned in DriverName.
EFI_INVALID_PARAMETERLanguage is NULL.
EFI_INVALID_PARAMETERDriverName is NULL.
EFI_UNSUPPORTEDThe driver specified by This does not support the language specified by Language.

Definition at line 70 of file ComponentName.c.

◆ USBKeyboardDriverBindingStart()

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.

Parameters
ThisThe USB keyboard driver binding instance.
ControllerHandle of device to bind driver to.
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThe controller is controlled by the usb keyboard driver.
EFI_UNSUPPORTEDNo interrupt endpoint can be found.
OtherThis controller cannot be started.

Definition at line 135 of file EfiKey.c.

◆ USBKeyboardDriverBindingStop()

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.

Parameters
ThisThe USB keyboard driver binding protocol.
ControllerThe controller to release.
NumberOfChildrenThe number of handles in ChildHandleBuffer.
ChildHandleBufferThe array of child handle.
Return values
EFI_SUCCESSThe device was stopped.
EFI_UNSUPPORTEDSimple Text In Protocol or Simple Text In Ex Protocol is not installed on Controller.
EFI_DEVICE_ERRORThe device could not be stopped due to a device error.
OthersFail to uninstall protocols attached on the device.

Definition at line 483 of file EfiKey.c.

◆ USBKeyboardDriverBindingSupported()

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.

Parameters
ThisThe USB keyboard driver binding protocol.
ControllerThe controller handle to check.
RemainingDevicePathThe remaining device path.
Return values
EFI_SUCCESSThe driver supports this controller.
otherThis device isn't supported.

Definition at line 72 of file EfiKey.c.

◆ USBKeyboardReadKeyStroke()

EFI_STATUS EFIAPI USBKeyboardReadKeyStroke ( IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL This,
OUT EFI_INPUT_KEY Key 
)

Reads the next keystroke from the input device.

Parameters
ThisThe EFI_SIMPLE_TEXT_INPUT_PROTOCOL instance.
KeyA pointer to a buffer that is filled in with the keystroke information for the key that was pressed.
Return values
EFI_SUCCESSThe keystroke information was returned.
EFI_NOT_READYThere was no keystroke data available.
EFI_DEVICE_ERRORThe keystroke information was not returned due to hardware errors.
EFI_UNSUPPORTEDThe device does not support the ability to read keystroke data.

Definition at line 700 of file EfiKey.c.

◆ USBKeyboardReadKeyStrokeEx()

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.

Parameters
ThisProtocol instance pointer.
KeyDataA pointer to a buffer that is filled in with the keystroke state data for the key that was pressed.
Return values
EFI_SUCCESSThe keystroke information was returned.
EFI_NOT_READYThere was no keystroke data available.
EFI_DEVICE_ERRORThe keystroke information was not returned due to hardware errors.
EFI_INVALID_PARAMETERKeyData is NULL.
EFI_UNSUPPORTEDThe device does not support the ability to read keystroke data.

Definition at line 984 of file EfiKey.c.

◆ USBKeyboardRegisterKeyNotify()

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.

Parameters
ThisProtocol instance pointer.
KeyDataA 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.
KeyNotificationFunctionPoints to the function to be called when the key sequence is typed specified by KeyData. This notification function should be called at <=TPL_CALLBACK.
NotifyHandlePoints to the unique handle assigned to the registered notification.
Return values
EFI_SUCCESSThe notification function was registered successfully.
EFI_OUT_OF_RESOURCESUnable to allocate resources for necessary data structures.
EFI_INVALID_PARAMETERKeyData or NotifyHandle or KeyNotificationFunction is NULL.

Definition at line 1088 of file EfiKey.c.

◆ USBKeyboardReset()

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.

Parameters
ThisProtocol instance pointer.
ExtendedVerificationDriver may perform diagnostics on reset.
Return values
EFI_SUCCESSThe device was reset.
EFI_DEVICE_ERRORThe device is not functioning properly and could not be reset.

Definition at line 637 of file EfiKey.c.

◆ USBKeyboardResetEx()

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.

Parameters
ThisA pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
ExtendedVerificationIndicates that the driver may perform a more exhaustive verification operation of the device during reset.
Return values
EFI_SUCCESSThe device was reset.
EFI_DEVICE_ERRORThe device is not functioning correctly and could not be reset.

Definition at line 946 of file EfiKey.c.

◆ USBKeyboardSetState()

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.

Parameters
ThisProtocol instance pointer.
KeyToggleStateA pointer to the EFI_KEY_TOGGLE_STATE to set the state for the input device.
Return values
EFI_SUCCESSThe device state was set appropriately.
EFI_DEVICE_ERRORThe device is not functioning correctly and could not have the setting adjusted.
EFI_UNSUPPORTEDThe device does not support the ability to have its state set.
EFI_INVALID_PARAMETERKeyToggleState is NULL.

Definition at line 1016 of file EfiKey.c.

◆ USBKeyboardTimerHandler()

VOID EFIAPI USBKeyboardTimerHandler ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Timer handler to convert the key from USB.

Parameters
EventIndicates the event that invoke this function.
ContextIndicates the calling context.

Definition at line 810 of file EfiKey.c.

◆ USBKeyboardUnregisterKeyNotify()

EFI_STATUS EFIAPI USBKeyboardUnregisterKeyNotify ( IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL This,
IN VOID *  NotificationHandle 
)

Remove a registered notification function from a particular keystroke.

Parameters
ThisProtocol instance pointer.
NotificationHandleThe handle of the notification function being unregistered.
Return values
EFI_SUCCESSThe notification function was unregistered successfully.
EFI_INVALID_PARAMETERThe NotificationHandle is invalid
EFI_NOT_FOUNDCannot find the matching entry in database.

Remove a registered notification function from a particular keystroke.

Parameters
ThisProtocol instance pointer.
NotificationHandleThe handle of the notification function being unregistered.
Return values
EFI_SUCCESSThe notification function was unregistered successfully.
EFI_INVALID_PARAMETERThe NotificationHandle is invalid

Definition at line 1160 of file EfiKey.c.

◆ USBKeyboardWaitForKey()

VOID EFIAPI USBKeyboardWaitForKey ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Event notification function registered for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx and EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey.

Parameters
EventEvent to be signaled when a key is pressed.
ContextPoints to USB_KB_DEV instance.

Definition at line 756 of file EfiKey.c.

Variable Documentation

◆ gUsbKeyboardComponentName

EFI_COMPONENT_NAME_PROTOCOL gUsbKeyboardComponentName
extern

Definition at line 14 of file ComponentName.c.

◆ gUsbKeyboardComponentName2

EFI_COMPONENT_NAME2_PROTOCOL gUsbKeyboardComponentName2
extern

Definition at line 23 of file ComponentName.c.

◆ gUsbKeyboardDriverBinding

EFI_DRIVER_BINDING_PROTOCOL gUsbKeyboardDriverBinding
extern

Definition at line 16 of file EfiKey.c.