summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2002-04-30 20:56:15 +0000
committermiod <miod@openbsd.org>2002-04-30 20:56:15 +0000
commit3e8741a766fe57a2aae61cdca392c4a497a4a3f5 (patch)
tree4c9fa0114b9af3fb8916d4c5aed1f1e8d54e3899
parenttypo, from Denis Afonin. (diff)
downloadwireguard-openbsd-3e8741a766fe57a2aae61cdca392c4a497a4a3f5.tar.xz
wireguard-openbsd-3e8741a766fe57a2aae61cdca392c4a497a4a3f5.zip
Correctly handle old controllers with a relaxed aux port behaviour.
This allows the mouse port to become available on AlphaStation machines, as well as on some older x86 machines. From NetBSD. Tested by various people on alpha and i386, no regression discovered.
-rw-r--r--sys/dev/ic/pckbc.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c
index 38e59f87450..b67e61a8362 100644
--- a/sys/dev/ic/pckbc.c
+++ b/sys/dev/ic/pckbc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pckbc.c,v 1.3 2002/03/14 01:26:55 millert Exp $ */
+/* $OpenBSD: pckbc.c,v 1.4 2002/04/30 20:56:15 miod Exp $ */
/* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */
/*
@@ -360,14 +360,24 @@ pckbc_attach(sc)
}
bus_space_write_1(iot, ioh_d, 0, 0x5a); /* a random value */
res = pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_AUX_SLOT, 1);
- if (res == 0x5a) {
+ if (res != -1) {
+ /*
+ * In most cases, the 0x5a gets echoed.
+ * Some old controllers (Gateway 2000 circa 1993)
+ * return 0xfe here.
+ * We are satisfied if there is anything in the
+ * aux output buffer.
+ */
+#ifdef PCKBCDEBUG
+ printf("kbc: aux echo: %x\n", res);
+#endif
t->t_haveaux = 1;
if (pckbc_attach_slot(sc, PCKBC_AUX_SLOT))
cmdbits |= KC8_MENABLE;
}
#ifdef PCKBCDEBUG
- else
- printf("kbc: aux echo: %x\n", res);
+ else
+ printf("kbc: aux echo test failed\n");
#endif
nomouse: