TianoCore EDK2 master
Loading...
Searching...
No Matches
Ps2KbdTextIn.c File Reference
#include "Ps2Keyboard.h"

Go to the source code of this file.

Functions

BOOLEAN IsEfikeyBufEmpty (IN EFI_KEY_QUEUE *Queue)
 
EFI_STATUS PopEfikeyBufHead (IN EFI_KEY_QUEUE *Queue, OUT EFI_KEY_DATA *KeyData OPTIONAL)
 
VOID PushEfikeyBufTail (IN EFI_KEY_QUEUE *Queue, IN EFI_KEY_DATA *KeyData)
 
BOOLEAN IsKeyRegistered (IN EFI_KEY_DATA *RegsiteredData, IN EFI_KEY_DATA *InputData)
 
EFI_STATUS KeyboardReadKeyStrokeWorker (IN KEYBOARD_CONSOLE_IN_DEV *ConsoleInDev, OUT EFI_KEY_DATA *KeyData)
 
EFI_STATUS EFIAPI KeyboardEfiReset (IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
EFI_STATUS EFIAPI KeyboardReadKeyStroke (IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, OUT EFI_INPUT_KEY *Key)
 
VOID EFIAPI KeyboardWaitForKey (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EFIAPI KeyboardWaitForKeyEx (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI KeyboardEfiResetEx (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
EFI_STATUS EFIAPI KeyboardReadKeyStrokeEx (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, OUT EFI_KEY_DATA *KeyData)
 
EFI_STATUS EFIAPI KeyboardSetState (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_TOGGLE_STATE *KeyToggleState)
 
EFI_STATUS EFIAPI KeyboardRegisterKeyNotify (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 KeyboardUnregisterKeyNotify (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle)
 
VOID EFIAPI KeyNotifyProcessHandler (IN EFI_EVENT Event, IN VOID *Context)
 

Detailed Description

Routines implements SIMPLE_TEXT_IN protocol's interfaces based on 8042 interfaces provided by Ps2KbdCtrller.c.

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

Definition in file Ps2KbdTextIn.c.

Function Documentation

◆ IsEfikeyBufEmpty()

BOOLEAN IsEfikeyBufEmpty ( IN EFI_KEY_QUEUE Queue)

Check whether the EFI key buffer is empty.

Parameters
QueuePointer to instance of EFI_KEY_QUEUE.
Return values
TRUEThe EFI key buffer is empty.
FALSEThe EFI key buffer isn't empty.

Definition at line 21 of file Ps2KbdTextIn.c.

◆ IsKeyRegistered()

BOOLEAN IsKeyRegistered ( IN EFI_KEY_DATA RegsiteredData,
IN EFI_KEY_DATA InputData 
)

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.

Definition at line 94 of file Ps2KbdTextIn.c.

◆ KeyboardEfiReset()

EFI_STATUS EFIAPI KeyboardEfiReset ( IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL This,
IN BOOLEAN  ExtendedVerification 
)

Perform 8042 controller and keyboard initialization which implement SIMPLE_TEXT_IN.Reset()

Parameters
ThisPointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL
ExtendedVerificationIndicate that the driver may perform a more exhaustive verification operation of the device during reset, now this par is ignored in this driver

Definition at line 188 of file Ps2KbdTextIn.c.

◆ KeyboardEfiResetEx()

EFI_STATUS EFIAPI KeyboardEfiResetEx ( IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL This,
IN BOOLEAN  ExtendedVerification 
)

Reset the input device and optionally run diagnostics

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 407 of file Ps2KbdTextIn.c.

◆ KeyboardReadKeyStroke()

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

Retrieve key values for driver user which implement SIMPLE_TEXT_IN.ReadKeyStroke().

Parameters
ThisPointer to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL
KeyThe output buffer for key value
Return values
EFI_SUCCESSsuccess to read key stroke
EFI_UNSUPPORTEDThe device does not support the ability to read keystroke data.

Definition at line 266 of file Ps2KbdTextIn.c.

◆ KeyboardReadKeyStrokeEx()

EFI_STATUS EFIAPI KeyboardReadKeyStrokeEx ( IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL This,
OUT EFI_KEY_DATA KeyData 
)

Reads the next keystroke from the input device. The WaitForKey Event can be used to test for existence of a keystroke via WaitForEvent () call.

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 442 of file Ps2KbdTextIn.c.

◆ KeyboardReadKeyStrokeWorker()

EFI_STATUS KeyboardReadKeyStrokeWorker ( IN KEYBOARD_CONSOLE_IN_DEV ConsoleInDev,
OUT EFI_KEY_DATA KeyData 
)

Reads the next keystroke from the input device. The WaitForKey Event can be used to test for existence of a keystroke via WaitForEvent () call.

Parameters
ConsoleInDevPs2 Keyboard private structure
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.

Definition at line 143 of file Ps2KbdTextIn.c.

◆ KeyboardRegisterKeyNotify()

EFI_STATUS EFIAPI KeyboardRegisterKeyNotify ( 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 data 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 563 of file Ps2KbdTextIn.c.

◆ KeyboardSetState()

EFI_STATUS EFIAPI KeyboardSetState ( 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 successfully.
EFI_DEVICE_ERRORThe device is not functioning correctly and could not have the setting adjusted.
EFI_UNSUPPORTEDThe device does not have the ability to set its state.
EFI_INVALID_PARAMETERKeyToggleState is NULL.

Definition at line 474 of file Ps2KbdTextIn.c.

◆ KeyboardUnregisterKeyNotify()

EFI_STATUS EFIAPI KeyboardUnregisterKeyNotify ( 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.

Definition at line 645 of file Ps2KbdTextIn.c.

◆ KeyboardWaitForKey()

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

Event notification function for SIMPLE_TEXT_IN.WaitForKey event Signal the event if there is key available

Parameters
Eventthe event object
Contextwaiting context

Definition at line 325 of file Ps2KbdTextIn.c.

◆ KeyboardWaitForKeyEx()

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

Event notification function for SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event Signal the event if there is key available

Parameters
Eventevent object
Contextwaiting context

Definition at line 385 of file Ps2KbdTextIn.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 706 of file Ps2KbdTextIn.c.

◆ PopEfikeyBufHead()

EFI_STATUS PopEfikeyBufHead ( IN EFI_KEY_QUEUE Queue,
OUT EFI_KEY_DATA *KeyData  OPTIONAL 
)

Read & remove one key data from the EFI key buffer.

Parameters
QueuePointer to instance of EFI_KEY_QUEUE.
KeyDataReceive the key data.
Return values
EFI_SUCCESSThe key data is popped successfully.
EFI_NOT_READYThere is no key data available.

Definition at line 38 of file Ps2KbdTextIn.c.

◆ PushEfikeyBufTail()

VOID PushEfikeyBufTail ( IN EFI_KEY_QUEUE Queue,
IN EFI_KEY_DATA KeyData 
)

Push one key data to the EFI key buffer.

Parameters
QueuePointer to instance of EFI_KEY_QUEUE.
KeyDataThe key data to push.

Definition at line 65 of file Ps2KbdTextIn.c.