Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pckbc In a PC keyboard doesn't accept a "set to scan...



details:   https://anonhg.NetBSD.org/src/rev/3cb4fd2c20ca
branches:  trunk
changeset: 467609:3cb4fd2c20ca
user:      drochner <drochner%NetBSD.org@localhost>
date:      Fri Mar 26 12:39:13 1999 +0000

description:
In a PC keyboard doesn't accept a "set to scanset 2" command, reset it
and ignore the error. Scanset 2 should be the default after reset, so
this allows some broken keyboards to work. (Reset is needed because at
least 1 keyboard locks up if the "set scanset" is attempted.)

diffstat:

 sys/dev/pckbc/pckbd.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 020513a25d09 -r 3cb4fd2c20ca sys/dev/pckbc/pckbd.c
--- a/sys/dev/pckbc/pckbd.c     Fri Mar 26 09:24:27 1999 +0000
+++ b/sys/dev/pckbc/pckbd.c     Fri Mar 26 12:39:13 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbd.c,v 1.16 1999/01/26 11:07:25 drochner Exp $ */
+/* $NetBSD: pckbd.c,v 1.17 1999/03/26 12:39:13 drochner Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -206,10 +206,22 @@
                cmd[0] = KBC_SETTABLE;
                cmd[1] = 2;
                res = pckbc_poll_cmd(kbctag, kbcslot, cmd, 2, 0, 0, 0);
+               if (res) {
+                       u_char cmd[1];
 #ifdef DEBUG
-               if (res)
                        printf("pckbd: error setting scanset 2\n");
 #endif
+                       /*
+                        * XXX at least one keyboard is reported to lock up
+                        * if a "set table" is attempted, thus the "reset".
+                        * XXX ignore errors, scanset 2 should be
+                        * default anyway.
+                        */
+                       cmd[0] = KBC_RESET;
+                       (void)pckbc_poll_cmd(kbctag, kbcslot, cmd, 1, 1, 0, 1);
+                       pckbc_flush(kbctag, kbcslot);
+                       res = 0;
+               }
        } else {
                /* Stupid 8042; set keyboard to XT codes. */
                cmd[0] = KBC_SETTABLE;



Home | Main Index | Thread Index | Old Index