diff options
author | 2010-01-12 20:31:22 +0000 | |
---|---|---|
committer | 2010-01-12 20:31:22 +0000 | |
commit | cb110601639b7561704cf7074191746f8d2e69ab (patch) | |
tree | 8fdea3b5c238a03dbc7d1ed372aa3530be7bf86a | |
parent | allow 'update-only' installs (diff) | |
download | wireguard-openbsd-cb110601639b7561704cf7074191746f8d2e69ab.tar.xz wireguard-openbsd-cb110601639b7561704cf7074191746f8d2e69ab.zip |
Fix for a legacy free PC, where the keyboard controller doesn't behave.
Clues on how to fix it from miod. ok miod@, Sure deraadt@
-rw-r--r-- | sys/dev/ic/pckbc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index 6171b156fc6..fe9bebca7e1 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbc.c,v 1.20 2009/08/27 16:45:20 jsg Exp $ */ +/* $OpenBSD: pckbc.c,v 1.21 2010/01/12 20:31:22 drahn Exp $ */ /* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */ /* @@ -102,6 +102,7 @@ const char *pckbc_slot_names[] = { "kbd", "aux" }; #define KBC_DEVCMD_ACK 0xfa #define KBC_DEVCMD_RESEND 0xfe +#define KBC_DEVCMD_BAT 0xaa #define KBD_DELAY DELAY(8) @@ -620,9 +621,14 @@ pckbc_poll_cmd1(t, slot, cmd) cmd->cmdidx++; continue; } - if (c == KBC_DEVCMD_RESEND) { + /* + * Some legacy free PCs keep returning Basic Assurance Test + * (BAT) instead of something usable, so fail gracefully. + */ + if (c == KBC_DEVCMD_RESEND || c == KBC_DEVCMD_BAT) { #ifdef PCKBCDEBUG - printf("pckbc_cmd: RESEND\n"); + printf("pckbc_cmd: %s\n", + c == KBC_DEVCMD_RESEND ? "RESEND": "BAT"); #endif if (cmd->retries++ < 5) continue; |