/* Show keyboard status lights according to indicators in ConsoleIn. */
EFI_STATUS UpdateStatusLights(IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn)
/* Show keyboard status lights according to indicators in ConsoleIn. */
EFI_STATUS UpdateStatusLights(IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn)
{
  EFI_STATUS  Status;
  UINT8       Command;
  Status = KeyboardWrite (ConsoleIn, 0xed);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  KeyboardWaitForValue (ConsoleIn, 0xfa);
  Command = 0;
  if (ConsoleIn->CapsLock) {
    Command |= 4;
  }
  if (ConsoleIn->NumLock) {
    Command |= 2;
  }
  if (ConsoleIn->ScrollLock) {
    Command |= 1;
  }
  Status = KeyboardWrite (ConsoleIn, Command);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  KeyboardWaitForValue (ConsoleIn, 0xfa);
  return Status;
}