Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Revert previous change; this breaks for the old c...



details:   https://anonhg.NetBSD.org/src/rev/9ddff7f308df
branches:  trunk
changeset: 510018:9ddff7f308df
user:      drochner <drochner%NetBSD.org@localhost>
date:      Thu May 17 10:48:39 2001 +0000

description:
Revert previous change; this breaks for the old controllers which 1.6
should help for. Instead, weaken the "echo" test: don't insist in
getting the same value back which was written.

diffstat:

 sys/dev/ic/pckbc.c |  41 ++++++++++++-----------------------------
 1 files changed, 12 insertions(+), 29 deletions(-)

diffs (60 lines):

diff -r 795db8d0c451 -r 9ddff7f308df sys/dev/ic/pckbc.c
--- a/sys/dev/ic/pckbc.c        Thu May 17 10:35:30 2001 +0000
+++ b/sys/dev/ic/pckbc.c        Thu May 17 10:48:39 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc.c,v 1.7 2001/05/15 22:01:07 christos Exp $ */
+/* $NetBSD: pckbc.c,v 1.8 2001/05/17 10:48:39 drochner Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -371,39 +371,22 @@
        }
        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) {
-               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
+       if (res != -1) {
                /*
-                * check aux port ok
+                * In most cases, the 0x5a gets echoed.
+                * Some older controllers (Gateway 2000 circa 1993)
+                * return 0xfe here.
+                * We are satisfied if there is anything in the
+                * aux output buffer.
                 */
-               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) {
+               t->t_haveaux = 1;
                if (pckbc_attach_slot(sc, PCKBC_AUX_SLOT))
                        cmdbits |= KC8_MENABLE;
        }
+#ifdef PCKBCDEBUG
+         else
+               printf("kbc: aux echo test failed\n");
+#endif
 
 nomouse:
        /* enable needed interrupts */



Home | Main Index | Thread Index | Old Index