Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/wscons Remember what keyboard layout is set in the m...



details:   https://anonhg.NetBSD.org/src/rev/887a3c001fd5
branches:  trunk
changeset: 580581:887a3c001fd5
user:      augustss <augustss%NetBSD.org@localhost>
date:      Sat Apr 30 03:47:12 2005 +0000

description:
Remember what keyboard layout is set in the mux, that way new keyboards
can be given the same layout.  Fixes kern/19153.

diffstat:

 sys/dev/wscons/wsksymdef.h |   3 ++-
 sys/dev/wscons/wsmux.c     |  21 ++++++++++++++++-----
 sys/dev/wscons/wsmuxvar.h  |   3 ++-
 3 files changed, 20 insertions(+), 7 deletions(-)

diffs (102 lines):

diff -r 00e8a93d7907 -r 887a3c001fd5 sys/dev/wscons/wsksymdef.h
--- a/sys/dev/wscons/wsksymdef.h        Sat Apr 30 02:18:43 2005 +0000
+++ b/sys/dev/wscons/wsksymdef.h        Sat Apr 30 03:47:12 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wsksymdef.h,v 1.52 2005/04/04 09:08:54 martti Exp $ */
+/*     $NetBSD: wsksymdef.h,v 1.53 2005/04/30 03:47:12 augustss Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -521,6 +521,7 @@
 action(KB_SF,  0,      0x1000, "sf",   ,       "Swiss French") \
 action(KB_SG,  0,      0x0f00, "sg",   ,       "Swiss German") \
 action(KB_UA,  0,      0x1200, "ua",   ,       "Ukrainian")
+#define KB_NONE 0x0000
 
 /* Define all the KB_xx numeric values using above table */
 #define KBF_ENUM(tag, tagf, value, cc, ccf, country) tag=value,
diff -r 00e8a93d7907 -r 887a3c001fd5 sys/dev/wscons/wsmux.c
--- a/sys/dev/wscons/wsmux.c    Sat Apr 30 02:18:43 2005 +0000
+++ b/sys/dev/wscons/wsmux.c    Sat Apr 30 03:47:12 2005 +0000
@@ -1,10 +1,10 @@
-/*     $NetBSD: wsmux.c,v 1.36 2005/02/27 00:27:52 perry Exp $ */
+/*     $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $      */
 
 /*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2005 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
- * Author: Lennart Augustsson <augustss%carlstedt.se@localhost>
+ * Author: Lennart Augustsson <lennart%augustsson.net@localhost>
  *         Carlstedt Research & Technology
  *
  * Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsmux.c,v 1.36 2005/02/27 00:27:52 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $");
 
 #include "wsdisplay.h"
 #include "wsmux.h"
@@ -68,6 +68,7 @@
 #include "opt_wsdisplay_compat.h"
 
 #include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wsksymdef.h>
 #include <dev/wscons/wseventvar.h>
 #include <dev/wscons/wscons_callbacks.h>
 #include <dev/wscons/wsmuxvar.h>
@@ -554,8 +555,13 @@
                if (!error)
                        ok = 1;
        }
-       if (ok)
+       if (ok) {
                error = 0;
+               if (cmd == WSKBDIO_SETENCODING) {
+                       sc->sc_kbd_layout = *((kbd_t *)data);
+               }
+
+       }
 
        return (error);
 }
@@ -650,6 +656,7 @@
                 "%s%d", name, unit);
        sc->sc_base.me_dv.dv_unit = unit;
        sc->sc_base.me_ops = &wsmux_srcops;
+       sc->sc_kbd_layout = KB_NONE;
        return (sc);
 }
 
@@ -692,6 +699,10 @@
                                (void)wsevsrc_ioctl(me, WSKBDIO_SETMODE,
                                                    &sc->sc_rawkbd, 0, 0);
 #endif
+                               if (sc->sc_kbd_layout != KB_NONE)
+                                       (void)wsevsrc_ioctl(me,
+                                           WSKBDIO_SETENCODING,
+                                           &sc->sc_kbd_layout, FWRITE, 0);
                        }
                }
        }
diff -r 00e8a93d7907 -r 887a3c001fd5 sys/dev/wscons/wsmuxvar.h
--- a/sys/dev/wscons/wsmuxvar.h Sat Apr 30 02:18:43 2005 +0000
+++ b/sys/dev/wscons/wsmuxvar.h Sat Apr 30 03:47:12 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wsmuxvar.h,v 1.9 2003/06/29 22:31:06 fvdl Exp $        */
+/*     $NetBSD: wsmuxvar.h,v 1.10 2005/04/30 03:47:12 augustss Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -82,6 +82,7 @@
        struct wsevsrc sc_base;
        struct proc *sc_p;              /* open proc */
        CIRCLEQ_HEAD(, wsevsrc) sc_cld; /* list of children */
+       u_int32_t sc_kbd_layout;        /* current layout of keyboard */
 #ifdef WSDISPLAY_COMPAT_RAWKBD
        int sc_rawkbd;                  /* A hack to remember the kbd mode */
 #endif



Home | Main Index | Thread Index | Old Index