//\r
Status = BiosKeyboardPrivate->SimpleTextInputEx.Reset (\r
&BiosKeyboardPrivate->SimpleTextInputEx,\r
- FALSE\r
+ FeaturePcdGet (PcdPs2KbdExtendedVerification)\r
);\r
-\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "[KBD]Reset Failed. Status - %r\n", Status)); \r
StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED;\r
goto Done;\r
}\r
}\r
}\r
}\r
+ DEBUG ((EFI_D_INFO, "[KBD]Extended keystrokes supported by CSM16 - %02x\n", (UINTN)BiosKeyboardPrivate->ExtendedKeyboard));\r
//\r
// Install protocol interfaces for the keyboard device.\r
//\r
KBC_INPBUF_VIA60_KBEN\r
);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Keyboard enable failed!\n"));\r
+ REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+ EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+ EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR,\r
+ BiosKeyboardPrivate->DevicePath\r
+ );\r
return FALSE;\r
}\r
\r
);\r
\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Timeout!\n"));\r
+ REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+ EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+ EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR,\r
+ BiosKeyboardPrivate->DevicePath\r
+ );\r
return FALSE;\r
}\r
\r
\r
KeyData.Key.ScanCode = (UINT16) Regs.H.AH;\r
KeyData.Key.UnicodeChar = (UINT16) Regs.H.AL;\r
+ DEBUG ((\r
+ EFI_D_INFO,\r
+ "[KBD]INT16 returns EFI_INPUT_KEY.ScanCode - %x, EFI_INPUT_KEY.UnicodeChar - %x\n",\r
+ KeyData.Key.ScanCode,\r
+ KeyData.Key.UnicodeChar\r
+ ));\r
+ \r
KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID;\r
KeyData.KeyState.KeyToggleState = EFI_TOGGLE_STATE_VALID;\r
//\r
KbFlag1 = *((UINT8 *) (UINTN) 0x417); // read the STATUS FLAGS 1\r
KbFlag2 = *((UINT8 *) (UINTN) 0x418); // read STATUS FLAGS 2\r
\r
+ DEBUG_CODE (\r
+ {\r
+ if ((KbFlag1 & KB_CAPS_LOCK_BIT) == KB_CAPS_LOCK_BIT) {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Caps Lock Key is pressed.\n"));\r
+ }\r
+ if ((KbFlag1 & KB_NUM_LOCK_BIT) == KB_NUM_LOCK_BIT) {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Num Lock Key is pressed.\n"));\r
+ }\r
+ if ((KbFlag1 & KB_SCROLL_LOCK_BIT) == KB_SCROLL_LOCK_BIT) {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Scroll Lock Key is pressed.\n"));\r
+ } \r
+ if ((KbFlag1 & KB_ALT_PRESSED) == KB_ALT_PRESSED) {\r
+ if ((KbFlag2 & KB_LEFT_ALT_PRESSED) == KB_LEFT_ALT_PRESSED) {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Left Alt Key is pressed.\n"));\r
+ } else {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Right Alt Key is pressed.\n"));\r
+ }\r
+ } \r
+ if ((KbFlag1 & KB_CTRL_PRESSED) == KB_CTRL_PRESSED) {\r
+ if ((KbFlag2 & KB_LEFT_CTRL_PRESSED) == KB_LEFT_CTRL_PRESSED) {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Left Ctrl Key is pressed.\n"));\r
+ } else {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Right Ctrl Key is pressed.\n"));\r
+ }\r
+ } \r
+ if ((KbFlag1 & KB_LEFT_SHIFT_PRESSED) == KB_LEFT_SHIFT_PRESSED) {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Left Shift Key is pressed.\n"));\r
+ }\r
+ if ((KbFlag1 & KB_RIGHT_SHIFT_PRESSED) == KB_RIGHT_SHIFT_PRESSED) {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Right Shift Key is pressed.\n"));\r
+ }\r
+ }\r
+ );\r
+\r
//\r
// Record toggle state\r
//\r
}\r
}\r
\r
+ DEBUG ((\r
+ EFI_D_INFO,\r
+ "[KBD]Convert to EFI Scan Code, EFI_INPUT_KEY.ScanCode - %x, EFI_INPUT_KEY.UnicodeChar - %x\n",\r
+ KeyData.Key.ScanCode,\r
+ KeyData.Key.UnicodeChar\r
+ ));\r
+\r
//\r
// Need not return associated shift state if a class of printable characters that\r
// are normally adjusted by shift modifiers.\r
if ((KeyData.Key.UnicodeChar >= L'A' && KeyData.Key.UnicodeChar <= L'Z') ||\r
(KeyData.Key.UnicodeChar >= L'a' && KeyData.Key.UnicodeChar <= L'z')\r
) {\r
+ DEBUG ((EFI_D_INFO, "[KBD]Shift key with a~z are pressed, remove shift state in EFI_KEY_STATE.\n"));\r
KeyData.KeyState.KeyShiftState &= ~(EFI_LEFT_SHIFT_PRESSED | EFI_RIGHT_SHIFT_PRESSED);\r
}\r
\r