summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/dev/z8530kbd.c14
-rw-r--r--sys/arch/sparc64/dev/comkbd_ebus.c35
-rw-r--r--sys/arch/sparc64/dev/z8530kbd.c14
-rw-r--r--sys/dev/sun/sunkbd.c77
-rw-r--r--sys/dev/sun/sunkbdvar.h5
5 files changed, 129 insertions, 16 deletions
diff --git a/sys/arch/sparc/dev/z8530kbd.c b/sys/arch/sparc/dev/z8530kbd.c
index 82ddc738c63..4131cfb1ed5 100644
--- a/sys/arch/sparc/dev/z8530kbd.c
+++ b/sys/arch/sparc/dev/z8530kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530kbd.c,v 1.1 2002/08/12 10:44:04 miod Exp $ */
+/* $OpenBSD: z8530kbd.c,v 1.2 2002/11/29 01:00:46 miod Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -425,11 +425,23 @@ zskbd_attach(parent, self, aux)
if (ISTYPE5(zst->zst_layout)) {
printf(": keyboard, type 5, layout 0x%x", zst->zst_layout);
a.keymap = &sunkbd5_keymapdata;
+#ifndef SUNKBD5_LAYOUT
+ if (zst->zst_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[zst->zst_layout] != -1)
+ sunkbd5_keymapdata.layout =
+ sunkbd_layouts[zst->zst_layout];
+#endif
} else {
printf(": keyboard, type %d", zst->zst_id);
if (zst->zst_id >= KB_SUN4)
printf(", layout 0x%x", zst->zst_layout);
a.keymap = &sunkbd_keymapdata;
+#ifndef SUNKBD_LAYOUT
+ if (zst->zst_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[zst->zst_layout] != -1)
+ sunkbd_keymapdata.layout =
+ sunkbd_layouts[zst->zst_layout];
+#endif
}
a.accessops = &zskbd_accessops;
a.accesscookie = zst;
diff --git a/sys/arch/sparc64/dev/comkbd_ebus.c b/sys/arch/sparc64/dev/comkbd_ebus.c
index ec8b943a337..c201ef04436 100644
--- a/sys/arch/sparc64/dev/comkbd_ebus.c
+++ b/sys/arch/sparc64/dev/comkbd_ebus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comkbd_ebus.c,v 1.7 2002/05/29 20:43:43 maja Exp $ */
+/* $OpenBSD: comkbd_ebus.c,v 1.8 2002/11/29 01:00:49 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -232,7 +232,28 @@ comkbd_attach(parent, self, aux)
0, &sc->sc_ioh) != 0) {
printf(": can't map register space\n");
return;
+ } else
+ printf("\n");
+
+ if (ISTYPE5(sc->sc_layout)) {
+ a.keymap = &sunkbd5_keymapdata;
+#ifndef SUNKBD5_LAYOUT
+ if (sc->sc_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[sc->sc_layout] != -1)
+ sunkbd5_keymapdata.layout =
+ sunkbd_layouts[sc->sc_layout];
+#endif
+ } else {
+ a.keymap = &sunkbd_keymapdata;
+#ifndef SUNKBD_LAYOUT
+ if (sc->sc_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[sc->sc_layout] != -1)
+ sunkbd_keymapdata.layout =
+ sunkbd_layouts[sc->sc_layout];
+#endif
}
+ a.accessops = &comkbd_accessops;
+ a.accesscookie = sc;
if (console) {
comkbd_init(sc);
@@ -248,18 +269,8 @@ comkbd_attach(parent, self, aux)
COM_WRITE(sc, com_ier, sc->sc_ier);
COM_READ(sc, com_iir);
COM_WRITE(sc, com_mcr, MCR_IENABLE | MCR_DTR | MCR_RTS);
- } else
- printf("\n");
-
-
- a.console = console;
- if (ISTYPE5(sc->sc_layout)) {
- a.keymap = &sunkbd5_keymapdata;
- } else {
- a.keymap = &sunkbd_keymapdata;
}
- a.accessops = &comkbd_accessops;
- a.accesscookie = sc;
+
sc->sc_wskbddev = config_found(self, &a, wskbddevprint);
}
diff --git a/sys/arch/sparc64/dev/z8530kbd.c b/sys/arch/sparc64/dev/z8530kbd.c
index 4a12fbc0c97..2b2a67d8255 100644
--- a/sys/arch/sparc64/dev/z8530kbd.c
+++ b/sys/arch/sparc64/dev/z8530kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530kbd.c,v 1.12 2002/05/29 20:43:43 maja Exp $ */
+/* $OpenBSD: z8530kbd.c,v 1.13 2002/11/29 01:00:49 miod Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -407,8 +407,20 @@ zskbd_attach(parent, self, aux)
a.console = console;
if (ISTYPE5(zst->zst_layout)) {
a.keymap = &sunkbd5_keymapdata;
+#ifndef SUNKBD5_LAYOUT
+ if (zst->zst_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[zst->zst_layout] != -1)
+ sunkbd5_keymapdata.layout =
+ sunkbd_layouts[zst->zst_layout];
+#endif
} else {
a.keymap = &sunkbd_keymapdata;
+#ifndef SUNKBD_LAYOUT
+ if (zst->zst_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[zst->zst_layout] != -1)
+ sunkbd_keymapdata.layout =
+ sunkbd_layouts[zst->zst_layout];
+#endif
}
a.accessops = &zskbd_accessops;
a.accesscookie = zst;
diff --git a/sys/dev/sun/sunkbd.c b/sys/dev/sun/sunkbd.c
index d987ca6d810..7cf5e4c28a0 100644
--- a/sys/dev/sun/sunkbd.c
+++ b/sys/dev/sun/sunkbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunkbd.c,v 1.11 2002/11/23 23:49:13 miod Exp $ */
+/* $OpenBSD: sunkbd.c,v 1.12 2002/11/29 01:00:51 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -885,6 +885,81 @@ const struct wscons_keydesc sunkbd5_keydesctab[] = {
{0, 0, 0, 0},
};
+/*
+ * Keyboard layout to ID table
+ * References: Sun Type 5 Keyboard Supplement Installation Guide, May 1992
+ * and http://docs.sun.com/db/doc/806-6642/6jfipqu57?a=view
+ */
+const int sunkbd_layouts[MAXSUNLAYOUT] = {
+ /* Type 4 layouts */
+ KB_US, /* 000 USA */
+ KB_US, /* 001 same as 000 */
+ KB_BE, /* 002 Belgium/French */
+ -1, /* 003 Canada */
+ KB_DK, /* 004 Denmark */
+ KB_DE, /* 005 Germany */
+ KB_IT, /* 006 Italy */
+ KB_NL, /* 007 The Netherlands */
+ KB_NO, /* 008 Norway */
+ KB_PT, /* 009 Portugal */
+ KB_ES, /* 00a Latin America/Spanish */
+ KB_SV, /* 00b Sweden */
+ KB_SF, /* 00c Switzerland/French */
+ KB_SG, /* 00d Switzerland/German */
+ KB_UK, /* 00e Great Britain */
+ -1, /* 00f unaffected */
+ -1, /* 010 Korea */
+ -1, /* 011 Taiwan */
+ -1, /* 012 unaffected */
+ -1, /* 013 unaffected */
+ -1, /* 014 VT220 */
+ -1, /* 015 VT220 Switzerland/French */
+ -1, /* 016 VT220 Switzerland/German */
+ -1, /* 017 VT220 Switzerland/Italian */
+ -1, /* 018 unaffected */
+ -1, /* 019 Belgium */
+ -1, /* 01a unaffected */
+ -1, /* 01b unaffected */
+ -1, /* 01c unaffected */
+ -1, /* 01d unaffected */
+ -1, /* 01e unaffected */
+ -1, /* 01f unaffected */
+ -1, /* 020 Japan */
+
+ /* Type 5 layouts */
+ KB_US, /* 021 USA */
+ KB_US, /* 022 UNIX */
+ KB_FR, /* 023 France */
+ KB_DK, /* 024 Denmark */
+ KB_DE, /* 025 Germany */
+ KB_IT, /* 026 Italy */
+ KB_NL, /* 027 The Netherlands */
+ KB_NO, /* 028 Norway */
+ KB_PT, /* 029 Portugal */
+ KB_ES, /* 02a Spain */
+ KB_SV, /* 02b Sweden */
+ KB_SF, /* 02c Switzerland/French */
+ KB_SG, /* 02d Switzerland/German */
+ KB_UK, /* 02e Great Britain */
+ -1, /* 02f Korea */
+ -1, /* 030 Taiwan */
+ -1, /* 031 Japan */
+ -1, /* 032 Canada/French */
+ -1, /* 033 Hungary */
+ -1, /* 034 Poland */
+ -1, /* 035 Czech */
+ -1, /* 036 Russia */
+ -1, /* 037 Latvia */
+ -1, /* 038 Turkey-Q5 */
+ -1, /* 039 Greece */
+ -1 /* 03a Arabic */
+ -1, /* 03b Lithuania */
+ -1, /* 03c Belgium */
+ -1, /* 03d unaffected */
+ -1, /* 03e Turkey-F5 */
+ -1, /* 03f Canada/French */
+};
+
struct wskbd_mapdata sunkbd_keymapdata = {
sunkbd_keydesctab,
#ifdef SUNKBD_LAYOUT
diff --git a/sys/dev/sun/sunkbdvar.h b/sys/dev/sun/sunkbdvar.h
index 6c0bc7219d9..aa599bdc55f 100644
--- a/sys/dev/sun/sunkbdvar.h
+++ b/sys/dev/sun/sunkbdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunkbdvar.h,v 1.4 2002/08/12 10:43:56 miod Exp $ */
+/* $OpenBSD: sunkbdvar.h,v 1.5 2002/11/29 01:00:51 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -47,3 +47,6 @@ extern struct wskbd_mapdata sunkbd5_keymapdata;
* here's a way to distinct types 5 and 6 from type 4.
*/
#define ISTYPE5(layout) ((layout) > 0x20)
+
+#define MAXSUNLAYOUT 0x040
+extern const int sunkbd_layouts[MAXSUNLAYOUT];