Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sun Fix WSDISPLAY_COMPAT_RAWKBD. Also return keyboar...



details:   https://anonhg.NetBSD.org/src/rev/1d937d74bb66
branches:  trunk
changeset: 580941:1d937d74bb66
user:      martin <martin%NetBSD.org@localhost>
date:      Mon May 16 16:23:57 2005 +0000

description:
Fix WSDISPLAY_COMPAT_RAWKBD. Also return keyboard types < 4 as SUN instead
of SUN5.

diffstat:

 sys/dev/sun/kbd.c    |  30 ++++++++++++++++++++----------
 sys/dev/sun/kbdvar.h |   3 ++-
 2 files changed, 22 insertions(+), 11 deletions(-)

diffs (91 lines):

diff -r 96317d8a610b -r 1d937d74bb66 sys/dev/sun/kbd.c
--- a/sys/dev/sun/kbd.c Mon May 16 16:03:58 2005 +0000
+++ b/sys/dev/sun/kbd.c Mon May 16 16:23:57 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kbd.c,v 1.45 2005/04/29 10:49:26 martin Exp $  */
+/*     $NetBSD: kbd.c,v 1.46 2005/05/16 16:23:57 martin Exp $  */
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.45 2005/04/29 10:49:26 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.46 2005/05/16 16:23:57 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,6 +74,10 @@
 #include <dev/sun/kbd_xlate.h>
 #include <dev/sun/kbdvar.h>
 
+#if NWSKBD > 0
+#include "opt_wsdisplay_compat.h"
+#endif
+
 #include "locators.h"
 
 extern struct cfdriver kbd_cd;
@@ -949,10 +953,16 @@
 kbd_input_wskbd(struct kbd_softc *k, int code)
 {
        int type, key;
+       u_char buf;
 
-       type = KEY_UP(code) ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
-       key = KEY_CODE(code);
-       wskbd_input(k->k_wskbd, type, key);
+       if (k->k_wsraw) {
+               buf = code;
+               wskbd_rawinput(k->k_wskbd, &buf, 1);
+       } else {
+               type = KEY_UP(code) ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
+               key = KEY_CODE(code);
+               wskbd_input(k->k_wskbd, type, key);
+       }
 }
 
 int
@@ -1011,7 +1021,9 @@
        
        switch (cmd) {
                case WSKBDIO_GTYPE:
-                       *(int *)data = WSKBD_TYPE_SUN5;
+                       /* we can't tell  4 from  5 or 6 */
+                       *(int *)data = k->k_state.kbd_id < KB_SUN4 ?
+                           WSKBD_TYPE_SUN : WSKBD_TYPE_SUN5;
                        return (0);
                case WSKBDIO_SETLEDS:
                        wssunkbd_set_leds(v, *(int *)data);
@@ -1019,11 +1031,9 @@
                case WSKBDIO_GETLEDS:
                        *(int *)data = k->k_leds;
                        return (0);
-#ifdef WSDISPLAY_COMPAT_RAWKBD___
+#ifdef WSDISPLAY_COMPAT_RAWKBD
        case WSKBDIO_SETMODE:
-               DPRINTF(("wssunkbd_ioctl: set raw = %d\n", *(int *)data));
-               sc->sc_rawkbd = *(int *)data == WSKBD_RAW;
-               usb_uncallout(sc->sc_rawrepeat_ch, ukbd_rawrepeat, sc);
+               k->k_wsraw = *(int *)data == WSKBD_RAW;
                return (0);
 #endif
        }
diff -r 96317d8a610b -r 1d937d74bb66 sys/dev/sun/kbdvar.h
--- a/sys/dev/sun/kbdvar.h      Mon May 16 16:03:58 2005 +0000
+++ b/sys/dev/sun/kbdvar.h      Mon May 16 16:23:57 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kbdvar.h,v 1.15 2005/04/28 15:03:49 martin Exp $       */
+/*     $NetBSD: kbdvar.h,v 1.16 2005/05/16 16:23:57 martin Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -57,6 +57,7 @@
 #if NWSKBD > 0
        struct device * k_wskbd;/* handle for wskbd, if it is attached */
        int k_wsenabled;        /* set if we are using wskbd */
+       int k_wsraw;            /* send raw events to wscons */
        struct callout k_wsbell;/* to shut the bell off */
 #endif
 



Home | Main Index | Thread Index | Old Index