Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Try the kbc_auxtest if the random write/read to t...
details: https://anonhg.NetBSD.org/src/rev/160b2b51b127
branches: trunk
changeset: 509939:160b2b51b127
user: christos <christos%NetBSD.org@localhost>
date: Tue May 15 22:01:07 2001 +0000
description:
Try the kbc_auxtest if the random write/read to the aux port fails (it returns
0xfe on my gateway 2000 circa 1993). That should not affect broken controllers
that choke on the kbc_auxtest, because for those the write/read test succeeds.
diffstat:
sys/dev/ic/pckbc.c | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)
diffs (51 lines):
diff -r 36e2cbf85eff -r 160b2b51b127 sys/dev/ic/pckbc.c
--- a/sys/dev/ic/pckbc.c Tue May 15 21:48:50 2001 +0000
+++ b/sys/dev/ic/pckbc.c Tue May 15 22:01:07 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc.c,v 1.6 2001/04/09 15:45:50 drochner Exp $ */
+/* $NetBSD: pckbc.c,v 1.7 2001/05/15 22:01:07 christos Exp $ */
/*
* Copyright (c) 1998
@@ -373,13 +373,37 @@
res = pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_AUX_SLOT, 1);
if (res == 0x5a) {
t->t_haveaux = 1;
+ } else {
+ /*
+ * Some old controllers (Gateway 2000 circa 1993)
+ * return 0xfe here. So we have no choice and we try
+ * the auxtest. Hopefully this will not affect the
+ * old controllers where auxtest fails, since they
+ * will be handled in the case above.
+ */
+#ifdef PCKBCDEBUG
+ printf("kbc: aux echo: %x\n", res);
+#endif
+ /*
+ * check aux port ok
+ */
+ if (!pckbc_send_cmd(iot, ioh_c, KBC_AUXTEST))
+ return;
+ res = pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_KBD_SLOT, 0);
+
+ if (res == 0 || res == 0xfa || res == 0x01) {
+#ifdef PCKBCDEBUG
+ if (res != 0)
+ printf("kbc: returned %x on aux slot test\n",
+ res);
+#endif
+ t->t_haveaux = 1;
+ }
+ }
+ if (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);
-#endif
nomouse:
/* enable needed interrupts */
Home |
Main Index |
Thread Index |
Old Index