summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2010-01-12 20:31:23 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2010-01-12 20:31:23 +0000
commitc82c7b04a526e1f7decc298ec4cf291832dbb4dd (patch)
tree1889077a9b7ead10962751ccfc941c84e8c7fff4 /sys/dev
parent5a818b8db6873464ff11bf8be0150dbe560e8d4c (diff)
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@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/pckbc.c12
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;