/* Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard Command If Keyboard receives 0xF4, it will respond with 'ACK'. If it doesn't respond, the device should not be in system. */
BOOLEAN EFIAPI CheckKeyboardConnect(IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn)
/* Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard Command If Keyboard receives 0xF4, it will respond with 'ACK'. If it doesn't respond, the device should not be in system. */
BOOLEAN EFIAPI CheckKeyboardConnect(IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn)
{
  EFI_STATUS  Status;
  UINTN       WaitForValueTimeOutBcakup;
  if (!PcdGetBool (PcdFastPS2Detection)) {
    Status = KeyboardWrite (
               ConsoleIn,
               KEYBOARD_KBEN
               );
    if (EFI_ERROR (Status)) {
      return FALSE;
    }
    WaitForValueTimeOutBcakup = mWaitForValueTimeOut;
    mWaitForValueTimeOut      = KEYBOARD_WAITFORVALUE_TIMEOUT;
    Status                    = KeyboardWaitForValue (
                                  ConsoleIn,
                                  KEYBOARD_CMDECHO_ACK
                                  );
    mWaitForValueTimeOut = WaitForValueTimeOutBcakup;
    if (EFI_ERROR (Status)) {
      return FALSE;
    }
    return TRUE;
  } else {
    return TRUE;
  }
}