10#define _PS2KEYBOARD_H_
44#define KEYBOARD_CONSOLE_IN_DEV_SIGNATURE SIGNATURE_32 ('k', 'k', 'e', 'y')
45#define KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('k', 'c', 'e', 'n')
54#define KEYBOARD_SCAN_CODE_MAX_COUNT 32
56 UINT8 Buffer[KEYBOARD_SCAN_CODE_MAX_COUNT];
61#define KEYBOARD_EFI_KEY_MAX_COUNT 256
77 UINT32 DataRegisterAddress;
78 UINT32 StatusRegisterAddress;
79 UINT32 CommandRegisterAddress;
96 BOOLEAN IsSupportPartialKey;
119#define KEYBOARD_CONSOLE_IN_DEV_FROM_THIS(a) CR (a, KEYBOARD_CONSOLE_IN_DEV, ConIn, KEYBOARD_CONSOLE_IN_DEV_SIGNATURE)
120#define TEXT_INPUT_EX_KEYBOARD_CONSOLE_IN_DEV_FROM_THIS(a) \
122 KEYBOARD_CONSOLE_IN_DEV, \
124 KEYBOARD_CONSOLE_IN_DEV_SIGNATURE \
150#define KEYBOARD_8042_DATA_REGISTER 0x60
151#define KEYBOARD_8042_STATUS_REGISTER 0x64
152#define KEYBOARD_8042_COMMAND_REGISTER 0x64
154#define KEYBOARD_KBEN 0xF4
155#define KEYBOARD_CMDECHO_ACK 0xFA
157#define KEYBOARD_MAX_TRY 256
158#define KEYBOARD_TIMEOUT 65536
159#define KEYBOARD_WAITFORVALUE_TIMEOUT 1000000
160#define KEYBOARD_BAT_TIMEOUT 4000000
161#define KEYBOARD_TIMER_INTERVAL 200000
162#define SCANCODE_EXTENDED0 0xE0
163#define SCANCODE_EXTENDED1 0xE1
164#define SCANCODE_CTRL_MAKE 0x1D
165#define SCANCODE_CTRL_BREAK 0x9D
166#define SCANCODE_ALT_MAKE 0x38
167#define SCANCODE_ALT_BREAK 0xB8
168#define SCANCODE_LEFT_SHIFT_MAKE 0x2A
169#define SCANCODE_LEFT_SHIFT_BREAK 0xAA
170#define SCANCODE_RIGHT_SHIFT_MAKE 0x36
171#define SCANCODE_RIGHT_SHIFT_BREAK 0xB6
172#define SCANCODE_CAPS_LOCK_MAKE 0x3A
173#define SCANCODE_NUM_LOCK_MAKE 0x45
174#define SCANCODE_SCROLL_LOCK_MAKE 0x46
175#define SCANCODE_DELETE_MAKE 0x53
176#define SCANCODE_LEFT_LOGO_MAKE 0x5B
177#define SCANCODE_LEFT_LOGO_BREAK 0xDB
178#define SCANCODE_RIGHT_LOGO_MAKE 0x5C
179#define SCANCODE_RIGHT_LOGO_BREAK 0xDC
180#define SCANCODE_MENU_MAKE 0x5D
181#define SCANCODE_MENU_BREAK 0xDD
182#define SCANCODE_SYS_REQ_MAKE 0x37
183#define SCANCODE_SYS_REQ_BREAK 0xB7
184#define SCANCODE_SYS_REQ_MAKE_WITH_ALT 0x54
185#define SCANCODE_SYS_REQ_BREAK_WITH_ALT 0xD4
187#define SCANCODE_MAX_MAKE 0x60
189#define KEYBOARD_STATUS_REGISTER_HAS_OUTPUT_DATA BIT0
190#define KEYBOARD_STATUS_REGISTER_HAS_INPUT_DATA BIT1
191#define KEYBOARD_STATUS_REGISTER_SYSTEM_FLAG BIT2
192#define KEYBOARD_STATUS_REGISTER_INPUT_DATA_TYPE BIT3
193#define KEYBOARD_STATUS_REGISTER_ENABLE_FLAG BIT4
194#define KEYBOARD_STATUS_REGISTER_TRANSMIT_TIMEOUT BIT5
195#define KEYBOARD_STATUS_REGISTER_RECEIVE_TIMEOUT BIT6
196#define KEYBOARD_STATUS_REGISTER_PARITY BIT7
198#define KEYBOARD_8042_COMMAND_READ 0x20
199#define KEYBOARD_8042_COMMAND_WRITE 0x60
200#define KEYBOARD_8042_COMMAND_DISABLE_MOUSE_INTERFACE 0xA7
201#define KEYBOARD_8042_COMMAND_ENABLE_MOUSE_INTERFACE 0xA8
202#define KEYBOARD_8042_COMMAND_CONTROLLER_SELF_TEST 0xAA
203#define KEYBOARD_8042_COMMAND_KEYBOARD_INTERFACE_SELF_TEST 0xAB
204#define KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE 0xAD
206#define KEYBOARD_8048_COMMAND_CLEAR_OUTPUT_DATA 0xF4
207#define KEYBOARD_8048_COMMAND_RESET 0xFF
208#define KEYBOARD_8048_COMMAND_SELECT_SCAN_CODE_SET 0xF0
210#define KEYBOARD_8048_RETURN_8042_BAT_SUCCESS 0xAA
211#define KEYBOARD_8048_RETURN_8042_BAT_ERROR 0xFC
212#define KEYBOARD_8048_RETURN_8042_ACK 0xFA
294 IN BOOLEAN ExtendedVerification
330 IN BOOLEAN ExtendedVerification
428 IN BOOLEAN ExtendedVerification
501 OUT VOID **NotifyHandle
520 IN VOID *NotificationHandle
EFI_STATUS EFIAPI KeyboardReadKeyStrokeEx(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, OUT EFI_KEY_DATA *KeyData)
VOID EFIAPI KeyNotifyProcessHandler(IN EFI_EVENT Event, IN VOID *Context)
BOOLEAN EFIAPI CheckKeyboardConnect(IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn)
VOID InitializeKeyState(IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn, OUT EFI_KEY_STATE *KeyState)
UINT8 KeyReadStatusRegister(IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn)
VOID EFIAPI KeyboardTimerHandler(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI KeyboardEfiResetEx(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS KeyboardRead(IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn, OUT UINT8 *Data)
EFI_STATUS EFIAPI KeyboardSetState(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_TOGGLE_STATE *KeyToggleState)
EFI_STATUS EFIAPI KeyboardEfiReset(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS UpdateStatusLights(IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn)
EFI_STATUS EFIAPI KeyboardReadKeyStroke(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, OUT EFI_INPUT_KEY *Key)
VOID PushEfikeyBufTail(IN EFI_KEY_QUEUE *Queue, IN EFI_KEY_DATA *KeyData)
EFI_STATUS EFIAPI InstallPs2KeyboardDriver(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS InitKeyboard(IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn, IN BOOLEAN ExtendedVerification)
VOID EFIAPI KeyboardWaitForKeyEx(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI KeyboardUnregisterKeyNotify(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle)
VOID KeyGetchar(IN OUT KEYBOARD_CONSOLE_IN_DEV *ConsoleIn)
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)
BOOLEAN IsKeyRegistered(IN EFI_KEY_DATA *RegsiteredData, IN EFI_KEY_DATA *InputData)
VOID EFIAPI KeyboardWaitForKey(IN EFI_EVENT Event, IN VOID *Context)
UINT8 EFI_KEY_TOGGLE_STATE
EFI_STATUS(EFIAPI * EFI_KEY_NOTIFY_FUNCTION)(IN EFI_KEY_DATA *KeyData)