summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/sparc/dev/z8530kbd.c339
-rw-r--r--sys/arch/sparc64/dev/comkbd_ebus.c286
-rw-r--r--sys/arch/sparc64/dev/z8530kbd.c272
-rw-r--r--sys/dev/sun/files.sun3
-rw-r--r--sys/dev/sun/sunkbd.c1170
-rw-r--r--sys/dev/sun/sunkbdmap.c1036
-rw-r--r--sys/dev/sun/sunkbdvar.h25
7 files changed, 1385 insertions, 1746 deletions
diff --git a/sys/arch/sparc/dev/z8530kbd.c b/sys/arch/sparc/dev/z8530kbd.c
index 7ce16c28a66..8fae7e15eaf 100644
--- a/sys/arch/sparc/dev/z8530kbd.c
+++ b/sys/arch/sparc/dev/z8530kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530kbd.c,v 1.6 2005/03/29 12:55:55 miod Exp $ */
+/* $OpenBSD: z8530kbd.c,v 1.7 2005/05/14 15:25:17 miod Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -113,8 +113,6 @@
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wskbdvar.h>
-#include <dev/wscons/wsksymdef.h>
-#include <dev/wscons/wsksymvar.h>
#include <dev/sun/sunkbdreg.h>
#include <dev/sun/sunkbdvar.h>
@@ -124,11 +122,6 @@
#include <dev/cons.h>
-#include "tctrl.h"
-#if NTCTRL > 0
-#include <sparc/dev/tctrlvar.h>
-#endif
-
/*
* How many input characters we can buffer.
* The port-specific var.h may override this.
@@ -153,10 +146,11 @@ u_int zskbd_rbuf_hiwat = (ZSKBD_RING_SIZE * 1) / 4;
u_int zskbd_rbuf_lowat = (ZSKBD_RING_SIZE * 3) / 4;
struct zskbd_softc {
- struct device zst_dev; /* required first: base device */
+ struct sunkbd_softc zst_base;
+
struct zs_chanstate *zst_cs;
- struct timeout zst_diag_ch, zst_bellto;
+ struct timeout zst_diag_ch;
u_int zst_overflows,
zst_floods,
@@ -203,14 +197,6 @@ struct zskbd_softc {
u_char zst_ppsmask; /* pps signal mask */
u_char zst_ppsassert; /* pps leading edge */
u_char zst_ppsclear; /* pps trailing edge */
-
- struct device *zst_wskbddev;
- int zst_leds; /* LED status */
- u_int8_t zst_kbdstate; /* keyboard state */
- int zst_click; /* keyclick state */
- int zst_id; /* keyboard type */
- int zst_layout; /* current layout */
- int zst_bellactive, zst_belltimeout;
};
/* Definition of the driver for autoconfig. */
@@ -224,7 +210,7 @@ struct cfattach zskbd_ca = {
struct zsops zsops_kbd;
static void zs_modem(struct zskbd_softc *, int);
-static void zs_hwiflow(struct zskbd_softc *);
+static void zs_hwiflow(struct zskbd_softc *);
static void zs_maskintr(struct zskbd_softc *);
struct zskbd_softc *zskbd_device_lookup(struct cfdriver *, int);
@@ -239,26 +225,13 @@ static void zskbd_diag(void *);
int zskbd_init(struct zskbd_softc *);
void zskbd_putc(struct zskbd_softc *, u_int8_t);
void zskbd_raw(struct zskbd_softc *, u_int8_t);
-void zskbd_reset(struct zskbd_softc *);
/* wskbd glue */
-int zskbd_enable(void *, int);
-void zskbd_set_leds(void *, int);
-int zskbd_get_leds(struct zskbd_softc *);
-int zskbd_ioctl(void *, u_long, caddr_t, int, struct proc *);
void zskbd_cngetc(void *, u_int *, int *);
void zskbd_cnpollc(void *, int);
void zsstart_tx(struct zskbd_softc *);
-int zsenqueue_tx(struct zskbd_softc *, u_char *, int);
-void zskbd_bell(struct zskbd_softc *, u_int, u_int, u_int);
-void zskbd_bellstop(void *);
-
-struct wskbd_accessops zskbd_accessops = {
- zskbd_enable,
- zskbd_set_leds,
- zskbd_ioctl
-};
+int zsenqueue_tx(void *, u_int8_t *, u_int);
struct wskbd_consops zskbd_consops = {
zskbd_cngetc,
@@ -311,8 +284,9 @@ zskbd_attach(parent, self, aux)
void *aux;
{
- struct zsc_softc *zsc = (void *) parent;
- struct zskbd_softc *zst = (void *) self;
+ struct zsc_softc *zsc = (void *)parent;
+ struct zskbd_softc *zst = (void *)self;
+ struct sunkbd_softc *ss = (void *)self;
struct cfdata *cf = self->dv_cfdata;
struct zsc_attach_args *args = aux;
struct wskbddev_attach_args a;
@@ -320,13 +294,15 @@ zskbd_attach(parent, self, aux)
int channel, s, tty_unit, console = 0;
dev_t dev;
+ ss->sc_sendcmd = zsenqueue_tx;
+ timeout_set(&ss->sc_bellto, sunkbd_bellstop, zst);
+
timeout_set(&zst->zst_diag_ch, zskbd_diag, zst);
- timeout_set(&zst->zst_bellto, zskbd_bellstop, zst);
zst->zst_tbp = zst->zst_tba = zst->zst_tbeg = zst->zst_tbuf;
zst->zst_tend = zst->zst_tbeg + ZSKBD_RING_SIZE;
- tty_unit = zst->zst_dev.dv_unit;
+ tty_unit = ss->sc_dev.dv_unit;
channel = args->channel;
cs = &zsc->zsc_cs[channel];
cs->cs_private = zst;
@@ -413,39 +389,39 @@ zskbd_attach(parent, self, aux)
/*
* XXX should provide a method to change keyclick setting
*/
- zst->zst_click = 0;
+ ss->sc_click = 0;
#if defined(SUN4C) || defined(SUN4M)
if (!CPU_ISSUN4) {
char *cp = getpropstring(optionsnode, "keyboard-click?");
if (cp != NULL && strcmp(cp, "true") == 0)
- zst->zst_click = 1;
+ ss->sc_click = 1;
}
#endif
a.console = console;
- if (ISTYPE5(zst->zst_layout)) {
- printf(": keyboard, type 5, layout 0x%x", zst->zst_layout);
+ if (ISTYPE5(ss->sc_layout)) {
+ printf(": keyboard, type 5, layout 0x%x", ss->sc_layout);
a.keymap = &sunkbd5_keymapdata;
#ifndef SUNKBD5_LAYOUT
- if (zst->zst_layout < MAXSUNLAYOUT &&
- sunkbd_layouts[zst->zst_layout] != -1)
+ if (ss->sc_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[ss->sc_layout] != -1)
sunkbd5_keymapdata.layout =
- sunkbd_layouts[zst->zst_layout];
+ sunkbd_layouts[ss->sc_layout];
#endif
} else {
- printf(": keyboard, type %d", zst->zst_id);
- if (zst->zst_id >= KB_SUN4)
- printf(", layout 0x%x", zst->zst_layout);
+ printf(": keyboard, type %d", ss->sc_id);
+ if (ss->sc_id >= KB_SUN4)
+ printf(", layout 0x%x", ss->sc_layout);
a.keymap = &sunkbd_keymapdata;
#ifndef SUNKBD_LAYOUT
- if (zst->zst_layout < MAXSUNLAYOUT &&
- sunkbd_layouts[zst->zst_layout] != -1)
+ if (ss->sc_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[ss->sc_layout] != -1)
sunkbd_keymapdata.layout =
- sunkbd_layouts[zst->zst_layout];
+ sunkbd_layouts[ss->sc_layout];
#endif
}
- a.accessops = &zskbd_accessops;
+ a.accessops = &sunkbd_accessops;
a.accesscookie = zst;
printf("\n");
@@ -453,13 +429,14 @@ zskbd_attach(parent, self, aux)
if (console)
wskbd_cnattach(&zskbd_consops, zst, a.keymap);
- zst->zst_wskbddev = config_found(self, &a, wskbddevprint);
+ ss->sc_wskbddev = config_found(self, &a, wskbddevprint);
}
int
zskbd_init(zst)
struct zskbd_softc *zst;
{
+ struct sunkbd_softc *ss = (void *)zst;
struct zs_chanstate *cs = zst->zst_cs;
int s, tries;
u_int8_t v3, v4, v5, rr0;
@@ -544,8 +521,8 @@ zskbd_init(zst)
for (tries = 5; tries != 0; tries--) {
int ltries;
- zst->zst_leds = 0;
- zst->zst_layout = -1;
+ ss->sc_leds = 0;
+ ss->sc_layout = -1;
/* Send reset request */
zskbd_putc(zst, SKBD_CMD_RESET);
@@ -554,8 +531,8 @@ zskbd_init(zst)
while (--ltries > 0) {
rr0 = *cs->cs_reg_csr;
if (rr0 & ZSRR0_RX_READY) {
- zskbd_raw(zst, *cs->cs_reg_data);
- if (zst->zst_kbdstate == SKBD_STATE_RESET)
+ sunkbd_raw(ss, *cs->cs_reg_data);
+ if (ss->sc_kbdstate == SKBD_STATE_RESET)
break;
}
DELAY(1000);
@@ -568,8 +545,8 @@ zskbd_init(zst)
while (--ltries > 0) {
rr0 = *cs->cs_reg_csr;
if (rr0 & ZSRR0_RX_READY) {
- zskbd_raw(zst, *cs->cs_reg_data);
- if (zst->zst_kbdstate == SKBD_STATE_GETKEY)
+ sunkbd_raw(ss, *cs->cs_reg_data);
+ if (ss->sc_kbdstate == SKBD_STATE_GETKEY)
break;
}
DELAY(1000);
@@ -579,15 +556,15 @@ zskbd_init(zst)
/* Send layout request */
- if (zst->zst_id == KB_SUN4) {
+ if (ss->sc_id == KB_SUN4) {
zskbd_putc(zst, SKBD_CMD_LAYOUT);
ltries = 1000;
while (--ltries > 0) {
rr0 = *cs->cs_reg_csr;
if (rr0 & ZSRR0_RX_READY) {
- zskbd_raw(zst, *cs->cs_reg_data);
- if (zst->zst_layout != -1)
+ sunkbd_raw(ss, *cs->cs_reg_data);
+ if (ss->sc_layout != -1)
break;
}
DELAY(1000);
@@ -596,7 +573,7 @@ zskbd_init(zst)
continue;
break;
} else {
- zst->zst_layout = 0;
+ ss->sc_layout = 0;
break;
}
}
@@ -608,51 +585,6 @@ zskbd_init(zst)
}
void
-zskbd_raw(zst, c)
- struct zskbd_softc *zst;
- u_int8_t c;
-{
- int claimed = 0;
-
- if (zst->zst_kbdstate == SKBD_STATE_LAYOUT) {
- zst->zst_kbdstate = SKBD_STATE_GETKEY;
- zst->zst_layout = c;
- return;
- }
-
- switch (c) {
- case SKBD_RSP_RESET:
- zst->zst_kbdstate = SKBD_STATE_RESET;
- claimed = 1;
- break;
- case SKBD_RSP_LAYOUT:
- zst->zst_kbdstate = SKBD_STATE_LAYOUT;
- claimed = 1;
- break;
- case SKBD_RSP_IDLE:
- zst->zst_kbdstate = SKBD_STATE_GETKEY;
- claimed = 1;
- break;
- }
-
- if (claimed != 0)
- return;
-
- switch (zst->zst_kbdstate) {
- case SKBD_STATE_RESET:
- zst->zst_kbdstate = SKBD_STATE_GETKEY;
- if (c < KB_SUN2 || c > KB_SUN4)
- printf("%s: reset: invalid keyboard type %x\n",
- zst->zst_dev.dv_xname, c);
- else
- zst->zst_id = c;
- break;
- case SKBD_STATE_GETKEY:
- break;
- }
-}
-
-void
zskbd_putc(zst, c)
struct zskbd_softc *zst;
u_int8_t c;
@@ -670,12 +602,14 @@ zskbd_putc(zst, c)
}
int
-zsenqueue_tx(zst, str, len)
- struct zskbd_softc *zst;
- u_char *str;
- int len;
+zsenqueue_tx(v, str, len)
+ void *v;
+ u_int8_t *str;
+ u_int len;
{
- int s, i;
+ struct zskbd_softc *zst = v;
+ int s;
+ u_int i;
s = splzs();
if (zst->zst_tbc + len > ZSKBD_RING_SIZE)
@@ -980,6 +914,7 @@ zskbd_diag(arg)
void *arg;
{
struct zskbd_softc *zst = arg;
+ struct sunkbd_softc *ss = arg;
int overflows, floods;
int s;
@@ -992,7 +927,7 @@ zskbd_diag(arg)
splx(s);
log(LOG_WARNING, "%s: %d silo overflow%s, %d ibuf flood%s\n",
- zst->zst_dev.dv_xname,
+ ss->sc_dev.dv_xname,
overflows, overflows == 1 ? "" : "s",
floods, floods == 1 ? "" : "s");
}
@@ -1001,6 +936,7 @@ integrate void
zskbd_rxsoft(zst)
struct zskbd_softc *zst;
{
+ struct sunkbd_softc *ss = (void *)zst;
struct zs_chanstate *cs = zst->zst_cs;
u_char *get, *end;
u_int cc, scc, type;
@@ -1033,18 +969,8 @@ zskbd_rxsoft(zst)
SET(code, TTY_PE);
}
- switch (code) {
- case SKBD_RSP_IDLE:
- type = WSCONS_EVENT_ALL_KEYS_UP;
- value = 0;
- break;
- default:
- type = (code & 0x80) ?
- WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
- value = code & 0x7f;
- break;
- }
- wskbd_input(zst->zst_wskbddev, type, value);
+ sunkbd_decode(code, &type, &value);
+ wskbd_input(ss->sc_wskbddev, type, value);
get += 2;
if (get >= end)
@@ -1148,132 +1074,6 @@ struct zsops zsops_kbd = {
zskbd_softint, /* process software interrupt */
};
-int
-zskbd_enable(v, on)
- void *v;
- int on;
-{
- return (0);
-}
-
-void
-zskbd_set_leds(v, wled)
- void *v;
- int wled;
-{
- struct zskbd_softc *zst = v;
- u_int8_t sled = 0;
- u_int8_t cmd[2];
-
- zst->zst_leds = wled;
-
- if (wled & WSKBD_LED_CAPS)
- sled |= SKBD_LED_CAPSLOCK;
- if (wled & WSKBD_LED_NUM)
- sled |= SKBD_LED_NUMLOCK;
- if (wled & WSKBD_LED_SCROLL)
- sled |= SKBD_LED_SCROLLLOCK;
- if (wled & WSKBD_LED_COMPOSE)
- sled |= SKBD_LED_COMPOSE;
-
- cmd[0] = SKBD_CMD_SETLED;
- cmd[1] = sled;
- zsenqueue_tx(zst, cmd, sizeof(cmd));
-}
-
-int
-zskbd_get_leds(zst)
- struct zskbd_softc *zst;
-{
- return (zst->zst_leds);
-}
-
-int
-zskbd_ioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- struct zskbd_softc *zst = v;
- int *d_int = (int *)data;
- struct wskbd_bell_data *d_bell = (struct wskbd_bell_data *)data;
-
- switch (cmd) {
- case WSKBDIO_GTYPE:
- if (ISTYPE5(zst->zst_layout)) {
- *d_int = WSKBD_TYPE_SUN5;
- } else {
- *d_int = WSKBD_TYPE_SUN;
- }
- return (0);
- case WSKBDIO_SETLEDS:
- zskbd_set_leds(zst, *d_int);
- return (0);
- case WSKBDIO_GETLEDS:
- *d_int = zskbd_get_leds(zst);
- return (0);
- case WSKBDIO_COMPLEXBELL:
- zskbd_bell(zst, d_bell->period,
- d_bell->pitch, d_bell->volume);
- return (0);
- }
- return (-1);
-}
-
-void
-zskbd_bell(zst, period, pitch, volume)
- struct zskbd_softc *zst;
- u_int period, pitch, volume;
-{
- int ticks, s;
- u_int8_t c = SKBD_CMD_BELLON;
-
- ticks = (period * hz)/1000;
- if (ticks <= 0)
- ticks = 1;
-
-#if NTCTRL > 0
- if (tadpole_bell(period / 10, pitch, volume) != 0)
- return;
-#endif
-
- s = splzs();
- if (zst->zst_bellactive) {
- if (zst->zst_belltimeout == 0)
- timeout_del(&zst->zst_bellto);
- }
- if (pitch == 0 || period == 0) {
- zskbd_bellstop(zst);
- splx(s);
- return;
- }
- if (!zst->zst_bellactive) {
- zst->zst_bellactive = 1;
- zst->zst_belltimeout = 1;
- zsenqueue_tx(zst, &c, 1);
- timeout_add(&zst->zst_bellto, ticks);
- }
- splx(s);
-}
-
-void
-zskbd_bellstop(v)
- void *v;
-{
- struct zskbd_softc *zst = v;
- int s;
- u_int8_t c;
-
- s = splzs();
- zst->zst_belltimeout = 0;
- c = SKBD_CMD_BELLOFF;
- zsenqueue_tx(zst, &c, 1);
- zst->zst_bellactive = 0;
- splx(s);
-}
-
void
zskbd_cnpollc(v, on)
void *v;
@@ -1317,40 +1117,3 @@ zskbd_cngetc(v, type, data)
break;
}
}
-
-void
-zskbd_reset(zst)
- struct zskbd_softc *zst;
-{
- int s;
- u_int8_t c;
-
- c = 0;
-
- /*
- * Restore keyclick, if necessary
- */
-
- switch (zst->zst_id) {
- case KB_SUN2:
- /* Type 2 keyboards do not support keyclick */
- break;
- case KB_SUN3:
- /* Type 3 keyboards come up with keyclick on */
- if (zst->zst_click == 0)
- c = SKBD_CMD_CLICKOFF;
- break;
- case KB_SUN4:
- /* Type 4 keyboards come up with keyclick off */
- if (zst->zst_click != 0)
- c = SKBD_CMD_CLICKON;
- break;
- }
-
- /* send click command whenever necessary */
- if (c != 0) {
- s = splzs();
- zsenqueue_tx(zst, &c, 1);
- splx(s);
- }
-}
diff --git a/sys/arch/sparc64/dev/comkbd_ebus.c b/sys/arch/sparc64/dev/comkbd_ebus.c
index 8cd489799e6..277ede26ab0 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.16 2005/04/05 14:11:16 miod Exp $ */
+/* $OpenBSD: comkbd_ebus.c,v 1.17 2005/05/14 15:25:20 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -53,8 +53,6 @@
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wskbdvar.h>
-#include <dev/wscons/wsksymdef.h>
-#include <dev/wscons/wsksymvar.h>
#include <dev/sun/sunkbdreg.h>
#include <dev/sun/sunkbdvar.h>
@@ -69,7 +67,8 @@
#define COMK_TX_RING 64
struct comkbd_softc {
- struct device sc_dv; /* us, as a device */
+ struct sunkbd_softc sc_base;
+
bus_space_tag_t sc_iot; /* bus tag */
bus_space_handle_t sc_ioh; /* bus handle */
void *sc_ih, *sc_si; /* interrupt vectors */
@@ -83,13 +82,6 @@ struct comkbd_softc {
u_int8_t *sc_txbeg, *sc_txend, *sc_txget, *sc_txput;
u_int8_t sc_ier;
-
- struct device *sc_wskbddev; /* child wskbd */
- int sc_leds;
- u_int8_t sc_kbdstate;
- int sc_layout;
- int sc_bellactive, sc_belltimeout;
- struct timeout sc_bellto;
};
#define COM_WRITE(sc,r,v) \
@@ -104,20 +96,13 @@ int comkbd_iskbd(int);
/* wskbd glue */
void comkbd_cnpollc(void *, int);
void comkbd_cngetc(void *, u_int *, int *);
-int comkbd_enable(void *, int);
-void comkbd_setleds(void *, int);
-int comkbd_getleds(struct comkbd_softc *);
-int comkbd_ioctl(void *, u_long, caddr_t, int, struct proc *);
/* internals */
-void comkbd_enqueue(struct comkbd_softc *, u_int8_t *, u_int);
-void comkbd_raw(struct comkbd_softc *, u_int8_t);
+int comkbd_enqueue(void *, u_int8_t *, u_int);
int comkbd_init(struct comkbd_softc *);
void comkbd_putc(struct comkbd_softc *, u_int8_t);
int comkbd_intr(void *);
void comkbd_soft(void *);
-void comkbd_bellstop(void *);
-void comkbd_bell(struct comkbd_softc *, u_int, u_int, u_int);
struct cfattach comkbd_ca = {
sizeof(struct comkbd_softc), comkbd_match, comkbd_attach
@@ -127,18 +112,12 @@ struct cfdriver comkbd_cd = {
NULL, "comkbd", DV_DULL
};
-char *comkbd_names[] = {
+const char *comkbd_names[] = {
"su",
"su_pnp",
NULL
};
-struct wskbd_accessops comkbd_accessops = {
- comkbd_enable,
- comkbd_setleds,
- comkbd_ioctl
-};
-
struct wskbd_consops comkbd_consops = {
comkbd_cngetc,
comkbd_cnpollc
@@ -186,11 +165,13 @@ comkbd_attach(parent, self, aux)
void *aux;
{
struct comkbd_softc *sc = (void *)self;
+ struct sunkbd_softc *ss = (void *)sc;
struct ebus_attach_args *ea = aux;
struct wskbddev_attach_args a;
int console;
- timeout_set(&sc->sc_bellto, comkbd_bellstop, sc);
+ ss->sc_sendcmd = comkbd_enqueue;
+ timeout_set(&ss->sc_bellto, sunkbd_bellstop, sc);
sc->sc_iot = ea->ea_memtag;
@@ -239,44 +220,38 @@ comkbd_attach(parent, self, aux)
}
a.console = console;
- if (ISTYPE5(sc->sc_layout)) {
+ if (ISTYPE5(ss->sc_layout)) {
a.keymap = &sunkbd5_keymapdata;
#ifndef SUNKBD5_LAYOUT
- if (sc->sc_layout < MAXSUNLAYOUT &&
- sunkbd_layouts[sc->sc_layout] != -1)
+ if (ss->sc_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[ss->sc_layout] != -1)
sunkbd5_keymapdata.layout =
- sunkbd_layouts[sc->sc_layout];
+ sunkbd_layouts[ss->sc_layout];
#endif
} else {
a.keymap = &sunkbd_keymapdata;
#ifndef SUNKBD_LAYOUT
- if (sc->sc_layout < MAXSUNLAYOUT &&
- sunkbd_layouts[sc->sc_layout] != -1)
+ if (ss->sc_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[ss->sc_layout] != -1)
sunkbd_keymapdata.layout =
- sunkbd_layouts[sc->sc_layout];
+ sunkbd_layouts[ss->sc_layout];
#endif
}
- a.accessops = &comkbd_accessops;
+ a.accessops = &sunkbd_accessops;
a.accesscookie = sc;
if (console) {
- cn_tab->cn_dev = makedev(77, sc->sc_dv.dv_unit); /* XXX */
+ cn_tab->cn_dev = makedev(77, ss->sc_dev.dv_unit); /* XXX */
cn_tab->cn_pollc = wskbd_cnpollc;
cn_tab->cn_getc = wskbd_cngetc;
- if (ISTYPE5(sc->sc_layout)) {
- wskbd_cnattach(&comkbd_consops, sc,
- &sunkbd5_keymapdata);
- } else {
- wskbd_cnattach(&comkbd_consops, sc,
- &sunkbd_keymapdata);
- }
+ wskbd_cnattach(&comkbd_consops, sc, a.keymap);
sc->sc_ier = IER_ETXRDY | IER_ERXRDY;
COM_WRITE(sc, com_ier, sc->sc_ier);
COM_READ(sc, com_iir);
COM_WRITE(sc, com_mcr, MCR_IENABLE | MCR_DTR | MCR_RTS);
}
- sc->sc_wskbddev = config_found(self, &a, wskbddevprint);
+ ss->sc_wskbddev = config_found(self, &a, wskbddevprint);
}
void
@@ -305,91 +280,7 @@ comkbd_cngetc(v, type, data)
COM_READ(sc, com_iir);
splx(s);
- switch (c) {
- case SKBD_RSP_IDLE:
- *type = WSCONS_EVENT_ALL_KEYS_UP;
- *data = 0;
- break;
- default:
- *type = (c & 0x80) ?
- WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
- *data = c & 0x7f;
- break;
- }
-}
-
-int
-comkbd_ioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- struct comkbd_softc *sc = v;
- int *d_int = (int *)data;
- struct wskbd_bell_data *d_bell = (struct wskbd_bell_data *)data;
-
- switch (cmd) {
- case WSKBDIO_GTYPE:
- if (ISTYPE5(sc->sc_layout)) {
- *d_int = WSKBD_TYPE_SUN5;
- } else {
- *d_int = WSKBD_TYPE_SUN;
- }
- return (0);
- case WSKBDIO_SETLEDS:
- comkbd_setleds(v, *d_int);
- return (0);
- case WSKBDIO_GETLEDS:
- *d_int = comkbd_getleds(sc);
- return (0);
- case WSKBDIO_COMPLEXBELL:
- comkbd_bell(sc, d_bell->period,
- d_bell->pitch, d_bell->volume);
- return (0);
- }
- return (-1);
-}
-
-int
-comkbd_enable(vsc, on)
- void *vsc;
- int on;
-{
- return (0);
-}
-
-int
-comkbd_getleds(sc)
- struct comkbd_softc *sc;
-{
- return (sc->sc_leds);
-}
-
-void
-comkbd_setleds(v, wled)
- void *v;
- int wled;
-{
- struct comkbd_softc *sc = v;
- u_int8_t sled = 0;
- u_int8_t cmd[2];
-
- sc->sc_leds = wled;
-
- if (wled & WSKBD_LED_CAPS)
- sled |= SKBD_LED_CAPSLOCK;
- if (wled & WSKBD_LED_NUM)
- sled |= SKBD_LED_NUMLOCK;
- if (wled & WSKBD_LED_SCROLL)
- sled |= SKBD_LED_SCROLLLOCK;
- if (wled & WSKBD_LED_COMPOSE)
- sled |= SKBD_LED_COMPOSE;
-
- cmd[0] = SKBD_CMD_SETLED;
- cmd[1] = sled;
- comkbd_enqueue(sc, cmd, sizeof(cmd));
+ sunkbd_decode(c, type, data);
}
void
@@ -420,20 +311,23 @@ comkbd_putc(sc, c)
splx(s);
}
-void
-comkbd_enqueue(sc, buf, buflen)
- struct comkbd_softc *sc;
+int
+comkbd_enqueue(v, buf, buflen)
+ void *v;
u_int8_t *buf;
u_int buflen;
{
+ struct comkbd_softc *sc = v;
int s;
u_int i;
s = spltty();
/* See if there is room... */
- if ((sc->sc_txcnt + buflen) > COMK_TX_RING)
- return;
+ if ((sc->sc_txcnt + buflen) > COMK_TX_RING) {
+ splx(s);
+ return (-1);
+ }
for (i = 0; i < buflen; i++) {
*sc->sc_txget = *buf;
@@ -447,6 +341,7 @@ comkbd_enqueue(sc, buf, buflen)
comkbd_soft(sc);
splx(s);
+ return (0);
}
void
@@ -454,6 +349,7 @@ comkbd_soft(vsc)
void *vsc;
{
struct comkbd_softc *sc = vsc;
+ struct sunkbd_softc *ss = (void *)sc;
u_int type;
int value;
u_int8_t c;
@@ -463,18 +359,8 @@ comkbd_soft(vsc)
if (++sc->sc_rxget == sc->sc_rxend)
sc->sc_rxget = sc->sc_rxbeg;
sc->sc_rxcnt--;
- switch (c) {
- case SKBD_RSP_IDLE:
- type = WSCONS_EVENT_ALL_KEYS_UP;
- value = 0;
- break;
- default:
- type = (c & 0x80) ?
- WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
- value = c & 0x7f;
- break;
- }
- wskbd_input(sc->sc_wskbddev, type, value);
+ sunkbd_decode(c, &type, &value);
+ wskbd_input(ss->sc_wskbddev, type, value);
}
if (sc->sc_txcnt) {
@@ -546,14 +432,15 @@ int
comkbd_init(sc)
struct comkbd_softc *sc;
{
+ struct sunkbd_softc *ss = (void *)sc;
u_int8_t stat, c;
int tries;
for (tries = 5; tries != 0; tries--) {
int ltries;
- sc->sc_leds = 0;
- sc->sc_layout = -1;
+ ss->sc_leds = 0;
+ ss->sc_layout = -1;
/* Send reset request */
comkbd_putc(sc, SKBD_CMD_RESET);
@@ -564,8 +451,8 @@ comkbd_init(sc)
if (stat & LSR_RXRDY) {
c = COM_READ(sc, com_data);
- comkbd_raw(sc, c);
- if (sc->sc_kbdstate == SKBD_STATE_RESET)
+ sunkbd_raw(ss, c);
+ if (ss->sc_kbdstate == SKBD_STATE_RESET)
break;
}
DELAY(1000);
@@ -579,8 +466,8 @@ comkbd_init(sc)
stat = COM_READ(sc, com_lsr);
if (stat & LSR_RXRDY) {
c = COM_READ(sc, com_data);
- comkbd_raw(sc, c);
- if (sc->sc_kbdstate == SKBD_STATE_GETKEY)
+ sunkbd_raw(ss, c);
+ if (ss->sc_kbdstate == SKBD_STATE_GETKEY)
break;
}
DELAY(1000);
@@ -597,8 +484,8 @@ comkbd_init(sc)
stat = COM_READ(sc, com_lsr);
if (stat & LSR_RXRDY) {
c = COM_READ(sc, com_data);
- comkbd_raw(sc, c);
- if (sc->sc_layout != -1)
+ sunkbd_raw(ss, c);
+ if (ss->sc_layout != -1)
break;
}
DELAY(1000);
@@ -609,96 +496,7 @@ comkbd_init(sc)
if (tries == 0)
printf(": no keyboard\n");
else
- printf(": layout %d\n", sc->sc_layout);
+ printf(": layout %d\n", ss->sc_layout);
return tries;
}
-
-void
-comkbd_raw(sc, c)
- struct comkbd_softc *sc;
- u_int8_t c;
-{
- int claimed = 0;
-
- if (sc->sc_kbdstate == SKBD_STATE_LAYOUT) {
- sc->sc_kbdstate = SKBD_STATE_GETKEY;
- sc->sc_layout = c;
- return;
- }
-
- switch (c) {
- case SKBD_RSP_RESET:
- sc->sc_kbdstate = SKBD_STATE_RESET;
- claimed = 1;
- break;
- case SKBD_RSP_LAYOUT:
- sc->sc_kbdstate = SKBD_STATE_LAYOUT;
- claimed = 1;
- break;
- case SKBD_RSP_IDLE:
- sc->sc_kbdstate = SKBD_STATE_GETKEY;
- claimed = 1;
- }
-
- if (claimed)
- return;
-
- switch (sc->sc_kbdstate) {
- case SKBD_STATE_RESET:
- sc->sc_kbdstate = SKBD_STATE_GETKEY;
- if (c != SKBD_RSP_RESET_OK)
- printf("%s: reset1 invalid code 0x%02x\n",
- sc->sc_dv.dv_xname, c);
- break;
- case SKBD_STATE_GETKEY:
- break;
- }
-}
-
-void
-comkbd_bell(sc, period, pitch, volume)
- struct comkbd_softc *sc;
- u_int period, pitch, volume;
-{
- int ticks, s;
- u_int8_t c = SKBD_CMD_BELLON;
-
- ticks = (period * hz)/1000;
- if (ticks <= 0)
- ticks = 1;
-
- s = spltty();
- if (sc->sc_bellactive) {
- if (sc->sc_belltimeout == 0)
- timeout_del(&sc->sc_bellto);
- }
- if (pitch == 0 || period == 0) {
- comkbd_bellstop(sc);
- splx(s);
- return;
- }
- if (!sc->sc_bellactive) {
- sc->sc_bellactive = 1;
- sc->sc_belltimeout = 1;
- comkbd_enqueue(sc, &c, 1);
- timeout_add(&sc->sc_bellto, ticks);
- }
- splx(s);
-}
-
-void
-comkbd_bellstop(v)
- void *v;
-{
- struct comkbd_softc *sc = v;
- int s;
- u_int8_t c;
-
- s = spltty();
- sc->sc_belltimeout = 0;
- c = SKBD_CMD_BELLOFF;
- comkbd_enqueue(sc, &c, 1);
- sc->sc_bellactive = 0;
- splx(s);
-}
diff --git a/sys/arch/sparc64/dev/z8530kbd.c b/sys/arch/sparc64/dev/z8530kbd.c
index 2fce127f176..3f28d1b0cd5 100644
--- a/sys/arch/sparc64/dev/z8530kbd.c
+++ b/sys/arch/sparc64/dev/z8530kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530kbd.c,v 1.16 2005/03/06 23:23:10 miod Exp $ */
+/* $OpenBSD: z8530kbd.c,v 1.17 2005/05/14 15:25:20 miod Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -110,8 +110,6 @@
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wskbdvar.h>
-#include <dev/wscons/wsksymdef.h>
-#include <dev/wscons/wsksymvar.h>
#include <dev/sun/sunkbdreg.h>
#include <dev/sun/sunkbdvar.h>
@@ -145,10 +143,11 @@ u_int zskbd_rbuf_hiwat = (ZSKBD_RING_SIZE * 1) / 4;
u_int zskbd_rbuf_lowat = (ZSKBD_RING_SIZE * 3) / 4;
struct zskbd_softc {
- struct device zst_dev; /* required first: base device */
+ struct sunkbd_softc sc_base;
+
struct zs_chanstate *zst_cs;
- struct timeout zst_diag_ch, zst_bellto;
+ struct timeout zst_diag_ch;
u_int zst_overflows,
zst_floods,
@@ -195,12 +194,6 @@ struct zskbd_softc {
u_char zst_ppsmask; /* pps signal mask */
u_char zst_ppsassert; /* pps leading edge */
u_char zst_ppsclear; /* pps trailing edge */
-
- struct device *zst_wskbddev;
- int zst_leds; /* LED status */
- u_int8_t zst_kbdstate; /* keyboard state */
- int zst_layout; /* current layout */
- int zst_bellactive, zst_belltimeout;
};
/* Definition of the driver for autoconfig. */
@@ -214,7 +207,7 @@ struct cfattach zskbd_ca = {
struct zsops zsops_kbd;
static void zs_modem(struct zskbd_softc *, int);
-static void zs_hwiflow(struct zskbd_softc *);
+static void zs_hwiflow(struct zskbd_softc *);
static void zs_maskintr(struct zskbd_softc *);
struct zskbd_softc *zskbd_device_lookup(struct cfdriver *, int);
@@ -231,23 +224,11 @@ void zskbd_putc(struct zskbd_softc *, u_int8_t);
void zskbd_raw(struct zskbd_softc *, u_int8_t);
/* wskbd glue */
-int zskbd_enable(void *, int);
-void zskbd_set_leds(void *, int);
-int zskbd_get_leds(struct zskbd_softc *);
-int zskbd_ioctl(void *, u_long, caddr_t, int, struct proc *);
void zskbd_cngetc(void *, u_int *, int *);
void zskbd_cnpollc(void *, int);
void zsstart_tx(struct zskbd_softc *);
-int zsenqueue_tx(struct zskbd_softc *, u_char *, int);
-void zskbd_bell(struct zskbd_softc *, u_int, u_int, u_int);
-void zskbd_bellstop(void *);
-
-struct wskbd_accessops zskbd_accessops = {
- zskbd_enable,
- zskbd_set_leds,
- zskbd_ioctl
-};
+int zsenqueue_tx(void *, u_int8_t *, u_int);
struct wskbd_consops zskbd_consops = {
zskbd_cngetc,
@@ -300,8 +281,9 @@ zskbd_attach(parent, self, aux)
void *aux;
{
- struct zsc_softc *zsc = (void *) parent;
- struct zskbd_softc *zst = (void *) self;
+ struct zsc_softc *zsc = (void *)parent;
+ struct zskbd_softc *zst = (void *)self;
+ struct sunkbd_softc *ss = (void *)self;
struct cfdata *cf = self->dv_cfdata;
struct zsc_attach_args *args = aux;
struct wskbddev_attach_args a;
@@ -309,13 +291,15 @@ zskbd_attach(parent, self, aux)
int channel, s, tty_unit, console = 0;
dev_t dev;
+ ss->sc_sendcmd = zsenqueue_tx;
+ timeout_set(&ss->sc_bellto, sunkbd_bellstop, zst);
+
timeout_set(&zst->zst_diag_ch, zskbd_diag, zst);
- timeout_set(&zst->zst_bellto, zskbd_bellstop, zst);
zst->zst_tbp = zst->zst_tba = zst->zst_tbeg = zst->zst_tbuf;
zst->zst_tend = zst->zst_tbeg + ZSKBD_RING_SIZE;
- tty_unit = zst->zst_dev.dv_unit;
+ tty_unit = ss->sc_dev.dv_unit;
channel = args->channel;
cs = zsc->zsc_cs[channel];
cs->cs_private = zst;
@@ -400,36 +384,37 @@ zskbd_attach(parent, self, aux)
}
a.console = console;
- if (ISTYPE5(zst->zst_layout)) {
+ if (ISTYPE5(ss->sc_layout)) {
a.keymap = &sunkbd5_keymapdata;
#ifndef SUNKBD5_LAYOUT
- if (zst->zst_layout < MAXSUNLAYOUT &&
- sunkbd_layouts[zst->zst_layout] != -1)
+ if (ss->sc_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[ss->sc_layout] != -1)
sunkbd5_keymapdata.layout =
- sunkbd_layouts[zst->zst_layout];
+ sunkbd_layouts[ss->sc_layout];
#endif
} else {
a.keymap = &sunkbd_keymapdata;
#ifndef SUNKBD_LAYOUT
- if (zst->zst_layout < MAXSUNLAYOUT &&
- sunkbd_layouts[zst->zst_layout] != -1)
+ if (ss->sc_layout < MAXSUNLAYOUT &&
+ sunkbd_layouts[ss->sc_layout] != -1)
sunkbd_keymapdata.layout =
- sunkbd_layouts[zst->zst_layout];
+ sunkbd_layouts[ss->sc_layout];
#endif
}
- a.accessops = &zskbd_accessops;
+ a.accessops = &sunkbd_accessops;
a.accesscookie = zst;
if (console)
wskbd_cnattach(&zskbd_consops, zst, a.keymap);
- zst->zst_wskbddev = config_found(self, &a, wskbddevprint);
+ ss->sc_wskbddev = config_found(self, &a, wskbddevprint);
}
int
zskbd_init(zst)
struct zskbd_softc *zst;
{
+ struct sunkbd_softc *ss = (void *)zst;
struct zs_chanstate *cs = zst->zst_cs;
int s, tries;
u_int8_t v3, v4, v5, rr0;
@@ -514,8 +499,8 @@ zskbd_init(zst)
for (tries = 5; tries != 0; tries--) {
int ltries;
- zst->zst_leds = 0;
- zst->zst_layout = -1;
+ ss->sc_leds = 0;
+ ss->sc_layout = -1;
/* Send reset request */
zskbd_putc(zst, SKBD_CMD_RESET);
@@ -524,8 +509,8 @@ zskbd_init(zst)
while (--ltries > 0) {
rr0 = *cs->cs_reg_csr;
if (rr0 & ZSRR0_RX_READY) {
- zskbd_raw(zst, *cs->cs_reg_data);
- if (zst->zst_kbdstate == SKBD_STATE_RESET)
+ sunkbd_raw(ss, *cs->cs_reg_data);
+ if (ss->sc_kbdstate == SKBD_STATE_RESET)
break;
}
DELAY(1000);
@@ -538,8 +523,8 @@ zskbd_init(zst)
while (--ltries > 0) {
rr0 = *cs->cs_reg_csr;
if (rr0 & ZSRR0_RX_READY) {
- zskbd_raw(zst, *cs->cs_reg_data);
- if (zst->zst_kbdstate == SKBD_STATE_GETKEY)
+ sunkbd_raw(ss, *cs->cs_reg_data);
+ if (ss->sc_kbdstate == SKBD_STATE_GETKEY)
break;
}
DELAY(1000);
@@ -555,8 +540,8 @@ zskbd_init(zst)
while (--ltries > 0) {
rr0 = *cs->cs_reg_csr;
if (rr0 & ZSRR0_RX_READY) {
- zskbd_raw(zst, *cs->cs_reg_data);
- if (zst->zst_layout != -1)
+ sunkbd_raw(ss, *cs->cs_reg_data);
+ if (ss->sc_layout != -1)
break;
}
DELAY(1000);
@@ -568,55 +553,13 @@ zskbd_init(zst)
if (tries == 0)
printf(": no keyboard\n");
else
- printf(": layout %d\n", zst->zst_layout);
+ printf(": layout %d\n", ss->sc_layout);
splx(s);
return tries;
}
void
-zskbd_raw(zst, c)
- struct zskbd_softc *zst;
- u_int8_t c;
-{
- int claimed = 0;
-
- if (zst->zst_kbdstate == SKBD_STATE_LAYOUT) {
- zst->zst_kbdstate = SKBD_STATE_GETKEY;
- zst->zst_layout = c;
- return;
- }
-
- switch (c) {
- case SKBD_RSP_RESET:
- zst->zst_kbdstate = SKBD_STATE_RESET;
- claimed = 1;
- break;
- case SKBD_RSP_LAYOUT:
- zst->zst_kbdstate = SKBD_STATE_LAYOUT;
- claimed = 1;
- break;
- case SKBD_RSP_IDLE:
- zst->zst_kbdstate = SKBD_STATE_GETKEY;
- claimed = 1;
- }
-
- if (claimed)
- return;
-
- switch (zst->zst_kbdstate) {
- case SKBD_STATE_RESET:
- zst->zst_kbdstate = SKBD_STATE_GETKEY;
- if (c != SKBD_RSP_RESET_OK)
- printf("%s: reset1 invalid code 0x%02x\n",
- zst->zst_dev.dv_xname, c);
- break;
- case SKBD_STATE_GETKEY:
- break;
- }
-}
-
-void
zskbd_putc(zst, c)
struct zskbd_softc *zst;
u_int8_t c;
@@ -634,12 +577,14 @@ zskbd_putc(zst, c)
}
int
-zsenqueue_tx(zst, str, len)
- struct zskbd_softc *zst;
- u_char *str;
- int len;
+zsenqueue_tx(v, str, len)
+ void *v;
+ u_int8_t *str;
+ u_int len;
{
- int s, i;
+ struct zskbd_softc *zst = v;
+ int s;
+ u_int i;
s = splzs();
if (zst->zst_tbc + len > ZSKBD_RING_SIZE)
@@ -944,6 +889,7 @@ zskbd_diag(arg)
void *arg;
{
struct zskbd_softc *zst = arg;
+ struct sunkbd_softc *ss = arg;
int overflows, floods;
int s;
@@ -956,7 +902,7 @@ zskbd_diag(arg)
splx(s);
log(LOG_WARNING, "%s: %d silo overflow%s, %d ibuf flood%s\n",
- zst->zst_dev.dv_xname,
+ ss->sc_dev.dv_xname,
overflows, overflows == 1 ? "" : "s",
floods, floods == 1 ? "" : "s");
}
@@ -965,6 +911,7 @@ integrate void
zskbd_rxsoft(zst)
struct zskbd_softc *zst;
{
+ struct sunkbd_softc *ss = (void *)zst;
struct zs_chanstate *cs = zst->zst_cs;
u_char *get, *end;
u_int cc, scc, type;
@@ -997,18 +944,8 @@ zskbd_rxsoft(zst)
SET(code, TTY_PE);
}
- switch (code) {
- case SKBD_RSP_IDLE:
- type = WSCONS_EVENT_ALL_KEYS_UP;
- value = 0;
- break;
- default:
- type = (code & 0x80) ?
- WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
- value = code & 0x7f;
- break;
- }
- wskbd_input(zst->zst_wskbddev, type, value);
+ sunkbd_decode(code, &type, &value);
+ wskbd_input(ss->sc_wskbddev, type, value);
get += 2;
if (get >= end)
@@ -1112,127 +1049,6 @@ struct zsops zsops_kbd = {
zskbd_softint, /* process software interrupt */
};
-int
-zskbd_enable(v, on)
- void *v;
- int on;
-{
- return (0);
-}
-
-void
-zskbd_set_leds(v, wled)
- void *v;
- int wled;
-{
- struct zskbd_softc *zst = v;
- u_int8_t sled = 0;
- u_int8_t cmd[2];
-
- zst->zst_leds = wled;
-
- if (wled & WSKBD_LED_CAPS)
- sled |= SKBD_LED_CAPSLOCK;
- if (wled & WSKBD_LED_NUM)
- sled |= SKBD_LED_NUMLOCK;
- if (wled & WSKBD_LED_SCROLL)
- sled |= SKBD_LED_SCROLLLOCK;
- if (wled & WSKBD_LED_COMPOSE)
- sled |= SKBD_LED_COMPOSE;
-
- cmd[0] = SKBD_CMD_SETLED;
- cmd[1] = sled;
- zsenqueue_tx(zst, cmd, sizeof(cmd));
-}
-
-int
-zskbd_get_leds(zst)
- struct zskbd_softc *zst;
-{
- return (zst->zst_leds);
-}
-
-int
-zskbd_ioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- struct zskbd_softc *zst = v;
- int *d_int = (int *)data;
- struct wskbd_bell_data *d_bell = (struct wskbd_bell_data *)data;
-
- switch (cmd) {
- case WSKBDIO_GTYPE:
- if (ISTYPE5(zst->zst_layout)) {
- *d_int = WSKBD_TYPE_SUN5;
- } else {
- *d_int = WSKBD_TYPE_SUN;
- }
- return (0);
- case WSKBDIO_SETLEDS:
- zskbd_set_leds(zst, *d_int);
- return (0);
- case WSKBDIO_GETLEDS:
- *d_int = zskbd_get_leds(zst);
- return (0);
- case WSKBDIO_COMPLEXBELL:
- zskbd_bell(zst, d_bell->period,
- d_bell->pitch, d_bell->volume);
- return (0);
- }
- return (-1);
-}
-
-void
-zskbd_bell(zst, period, pitch, volume)
- struct zskbd_softc *zst;
- u_int period, pitch, volume;
-{
- int ticks, s;
- u_int8_t c = SKBD_CMD_BELLON;
-
- ticks = (period * hz)/1000;
- if (ticks <= 0)
- ticks = 1;
-
- s = splzs();
- if (zst->zst_bellactive) {
- if (zst->zst_belltimeout == 0)
- timeout_del(&zst->zst_bellto);
- }
- if (pitch == 0 || period == 0) {
- zskbd_bellstop(zst);
- splx(s);
- return;
- }
- if (!zst->zst_bellactive) {
- zst->zst_bellactive = 1;
- zst->zst_belltimeout = 1;
- zsenqueue_tx(zst, &c, 1);
- timeout_add(&zst->zst_bellto, ticks);
- }
- splx(s);
-}
-
-void
-zskbd_bellstop(v)
- void *v;
-{
- struct zskbd_softc *zst = v;
- int s;
- u_int8_t c;
-
- s = splzs();
- zst->zst_belltimeout = 0;
- c = SKBD_CMD_BELLOFF;
- zsenqueue_tx(zst, &c, 1);
- zst->zst_bellactive = 0;
- splx(s);
-}
-
void
zskbd_cnpollc(v, on)
void *v;
diff --git a/sys/dev/sun/files.sun b/sys/dev/sun/files.sun
index ae0d3c37137..6cf5f83f36f 100644
--- a/sys/dev/sun/files.sun
+++ b/sys/dev/sun/files.sun
@@ -1,7 +1,8 @@
-# $OpenBSD: files.sun,v 1.2 2003/01/14 19:56:32 jason Exp $
+# $OpenBSD: files.sun,v 1.3 2005/05/14 15:25:20 miod Exp $
# $NetBSD: files.sun,v 1.1 1996/05/29 21:54:34 pk Exp $
#
# Configuration file for devices found on Sun machines.
#
define sunkbd
file dev/sun/sunkbd.c sunkbd
+file dev/sun/sunkbdmap.c sunkbd
diff --git a/sys/dev/sun/sunkbd.c b/sys/dev/sun/sunkbd.c
index 51b6e1daf83..2c750f061ed 100644
--- a/sys/dev/sun/sunkbd.c
+++ b/sys/dev/sun/sunkbd.c
@@ -1,7 +1,6 @@
-/* $OpenBSD: sunkbd.c,v 1.19 2005/02/28 20:32:34 miod Exp $ */
+/* $OpenBSD: sunkbd.c,v 1.20 2005/05/14 15:25:20 miod Exp $ */
/*
- * Copyright (c) 2002, 2003 Miodrag Vallat.
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
* All rights reserved.
*
@@ -36,1000 +35,203 @@
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/kernel.h>
+#include <sys/timeout.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wskbdvar.h>
-#include <dev/wscons/wsksymdef.h>
-#include <dev/wscons/wsksymvar.h>
#include <dev/sun/sunkbdreg.h>
#include <dev/sun/sunkbdvar.h>
-#define KC(n) KS_KEYCODE(n)
-
-/* 000/021/022 US English type 4/5 keyboard */
-const keysym_t sunkbd_keydesc_us[] = {
- KC(0x01), KS_Cmd,
- KC(0x02), KS_Cmd_BrightnessDown,
- KC(0x03), KS_Again,
- KC(0x04), KS_Cmd_BrightnessUp,
- KC(0x05), KS_f1,
- KC(0x06), KS_f2,
- KC(0x07), KS_f10,
- KC(0x08), KS_f3,
- KC(0x09), KS_f11,
- KC(0x0a), KS_f4,
- KC(0x0b), KS_f12,
- KC(0x0c), KS_f5,
- KC(0x0d), KS_Alt_R,
- KC(0x0e), KS_f6,
- KC(0x10), KS_f7,
- KC(0x11), KS_f8,
- KC(0x12), KS_f9,
- KC(0x13), KS_Alt_L,
- KC(0x14), KS_Up,
- KC(0x15), KS_Pause,
- KC(0x16), KS_Print_Screen,
- KC(0x17), KS_Hold_Screen,
- KC(0x18), KS_Left,
- KC(0x19), KS_Props,
- KC(0x1a), KS_Undo,
- KC(0x1b), KS_Down,
- KC(0x1c), KS_Right,
- KC(0x1d), KS_Escape,
- KC(0x1e), KS_1, KS_exclam,
- KC(0x1f), KS_2, KS_at,
- KC(0x20), KS_3, KS_numbersign,
- KC(0x21), KS_4, KS_dollar,
- KC(0x22), KS_5, KS_percent,
- KC(0x23), KS_6, KS_asciicircum,
- KC(0x24), KS_7, KS_ampersand,
- KC(0x25), KS_8, KS_asterisk,
- KC(0x26), KS_9, KS_parenleft,
- KC(0x27), KS_0, KS_parenright,
- KC(0x28), KS_minus, KS_underscore,
- KC(0x29), KS_equal, KS_plus,
- KC(0x2a), KS_grave, KS_asciitilde,
- KC(0x2b), KS_Delete,
- KC(0x2c), KS_Insert,
- KC(0x2d), KS_KP_Equal,
- KC(0x2e), KS_KP_Divide,
- KC(0x2f), KS_KP_Multiply,
- KC(0x31), KS_Front,
- KC(0x32), KS_KP_Delete, KS_KP_Decimal,
- KC(0x33), KS_Copy,
- KC(0x34), KS_Home,
- KC(0x35), KS_Tab,
- KC(0x36), KS_q,
- KC(0x37), KS_w,
- KC(0x38), KS_e,
- KC(0x39), KS_r,
- KC(0x3a), KS_t,
- KC(0x3b), KS_y,
- KC(0x3c), KS_u,
- KC(0x3d), KS_i,
- KC(0x3e), KS_o,
- KC(0x3f), KS_p,
- KC(0x40), KS_bracketleft, KS_braceleft,
- KC(0x41), KS_bracketright,KS_braceright,
- KC(0x42), KS_Delete,
- KC(0x43), KS_Multi_key,
- KC(0x44), KS_KP_Home, KS_KP_7,
- KC(0x45), KS_KP_Up, KS_KP_8,
- KC(0x46), KS_KP_Prior, KS_KP_9,
- KC(0x47), KS_KP_Subtract,
- KC(0x48), KS_Open,
- KC(0x49), KS_Paste,
- KC(0x4a), KS_End,
- KC(0x4c), KS_Control_L,
- KC(0x4d), KS_Cmd_Debugger, KS_a,
- KC(0x4e), KS_s,
- KC(0x4f), KS_d,
- KC(0x50), KS_f,
- KC(0x51), KS_g,
- KC(0x52), KS_h,
- KC(0x53), KS_j,
- KC(0x54), KS_k,
- KC(0x55), KS_l,
- KC(0x56), KS_semicolon, KS_colon,
- KC(0x57), KS_apostrophe, KS_quotedbl,
- KC(0x58), KS_backslash, KS_bar,
- KC(0x59), KS_Return,
- KC(0x5a), KS_KP_Enter,
- KC(0x5b), KS_KP_Left, KS_KP_4,
- KC(0x5c), KS_KP_Begin, KS_KP_5,
- KC(0x5d), KS_KP_Right, KS_KP_6,
- KC(0x5e), KS_KP_Insert, KS_KP_0,
- KC(0x5f), KS_Find,
- KC(0x60), KS_Prior,
- KC(0x61), KS_Cut,
- KC(0x62), KS_Num_Lock,
- KC(0x63), KS_Shift_L,
- KC(0x64), KS_z,
- KC(0x65), KS_x,
- KC(0x66), KS_c,
- KC(0x67), KS_v,
- KC(0x68), KS_b,
- KC(0x69), KS_n,
- KC(0x6a), KS_m,
- KC(0x6b), KS_comma, KS_less,
- KC(0x6c), KS_period, KS_greater,
- KC(0x6d), KS_slash, KS_question,
- KC(0x6e), KS_Shift_R,
- KC(0x6f), KS_Linefeed,
- KC(0x70), KS_KP_End, KS_KP_1,
- KC(0x71), KS_KP_Down, KS_KP_2,
- KC(0x72), KS_KP_Next, KS_KP_3,
- KC(0x76), KS_Help,
- KC(0x77), KS_Caps_Lock,
- KC(0x78), KS_Meta_L,
- KC(0x79), KS_space,
- KC(0x7a), KS_Meta_R,
- KC(0x7b), KS_Next,
- KC(0x7d), KS_KP_Add,
-};
-
-/* 002 French/Belgian type 4 keyboard */
-const keysym_t sunkbd_keydesc_befr[] = {
- KC(0x0d), KS_Caps_Lock,
- KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
- KC(0x1e), KS_ampersand, KS_1,
- KC(0x1f), KS_eacute, KS_2, KS_twosuperior,
- KC(0x20), KS_quotedbl, KS_3, KS_threesuperior,
- KC(0x21), KS_apostrophe, KS_4,
- KC(0x22), KS_parenleft, KS_5,
- KC(0x23), KS_section, KS_6,
- KC(0x24), KS_egrave, KS_7,
- KC(0x25), KS_exclam, KS_8, KS_sterling,
- KC(0x26), KS_ccedilla, KS_9, KS_backslash,
- KC(0x27), KS_agrave, KS_0,
- KC(0x28), KS_parenright, KS_degree, KS_asciitilde,
- KC(0x29), KS_minus, KS_underscore, KS_numbersign,
- KC(0x2a), KS_asterisk, KS_bar, KS_currency,
- KC(0x36), KS_a,
- KC(0x37), KS_z,
- KC(0x40), KS_dead_circumflex,KS_dead_diaeresis,
- KC(0x41), KS_grave, KS_dollar, KS_at,
- KC(0x4d), KS_Cmd_Debugger, KS_q,
- KC(0x56), KS_m, KS_M, KS_mu,
- KC(0x57), KS_ugrave, KS_percent,
- KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
- KC(0x64), KS_w,
- KC(0x6a), KS_comma, KS_question,
- KC(0x6b), KS_semicolon, KS_period,
- KC(0x6c), KS_colon, KS_slash,
- KC(0x6d), KS_equal, KS_plus,
- KC(0x77), KS_Mode_switch,
- KC(0x7c), KS_less, KS_greater,
-};
-
-/* 023 French type 5 keyboard */
-const keysym_t sunkbd5_keydesc_fr[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1e), KS_ampersand, KS_1,
- KC(0x1f), KS_eacute, KS_2, KS_asciitilde,
- KC(0x20), KS_quotedbl, KS_3, KS_numbersign,
- KC(0x21), KS_apostrophe, KS_4, KS_braceleft,
- KC(0x22), KS_parenleft, KS_5, KS_bracketleft,
- KC(0x23), KS_minus, KS_6, KS_bar,
- KC(0x24), KS_egrave, KS_7, KS_grave,
- KC(0x25), KS_underscore, KS_8, KS_backslash,
- KC(0x26), KS_ccedilla, KS_9, KS_asciicircum,
- KC(0x27), KS_agrave, KS_0, KS_at,
- KC(0x28), KS_parenright, KS_degree, KS_bracketright,
- KC(0x29), KS_equal, KS_plus, KS_braceright,
- KC(0x2a), KS_twosuperior,
- KC(0x36), KS_a,
- KC(0x37), KS_z,
- KC(0x40), KS_dead_circumflex,KS_dead_diaeresis,
- KC(0x41), KS_dollar, KS_sterling, KS_currency,
- KC(0x4d), KS_Cmd_Debugger, KS_q,
- KC(0x56), KS_m,
- KC(0x57), KS_ugrave, KS_percent,
- KC(0x58), KS_asterisk, KS_mu,
- KC(0x64), KS_w,
- KC(0x6a), KS_comma, KS_question,
- KC(0x6b), KS_semicolon, KS_period,
- KC(0x6c), KS_colon, KS_slash,
- KC(0x6d), KS_exclam, KS_section,
- KC(0x7c), KS_less, KS_greater,
-};
-
-/* 004 Danish type 4 keyboard */
-const keysym_t sunkbd_keydesc_dk[] = {
- KC(0x0d), KS_Multi_key,
- KC(0x0f), KS_asciitilde, KS_asciicircum,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_numbersign, KS_sterling,
- KC(0x21), KS_4, KS_currency, KS_dollar,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_slash, KS_braceleft,
- KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
- KC(0x26), KS_9, KS_parenright, KS_bracketright,
- KC(0x27), KS_0, KS_equal, KS_braceright,
- KC(0x28), KS_plus, KS_question,
- KC(0x29), KS_dead_acute, KS_dead_grave, KS_bar,
- KC(0x2a), KS_apostrophe, KS_asterisk, KS_grave,
- KC(0x40), KS_aring,
- KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
- KC(0x43), KS_Mode_switch,
- KC(0x4c), KS_Caps_Lock,
- KC(0x56), KS_ae,
- KC(0x57), KS_oslash,
- KC(0x58), KS_onehalf, KS_section,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Control_L,
- KC(0x7c), KS_less, KS_greater, KS_backslash,
-};
-
-/* 024 Danish type 5 keyboard */
-const keysym_t sunkbd5_keydesc_dk[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_numbersign, KS_sterling,
- KC(0x21), KS_4, KS_currency, KS_dollar,
- KC(0x22), KS_5, KS_percent, KS_asciitilde,
- KC(0x23), KS_6, KS_ampersand, KS_asciicircum,
- KC(0x24), KS_7, KS_slash, KS_braceleft,
- KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
- KC(0x26), KS_9, KS_parenright, KS_bracketright,
- KC(0x27), KS_0, KS_equal, KS_braceright,
- KC(0x28), KS_plus, KS_question,
- KC(0x29), KS_dead_acute, KS_dead_grave, KS_bar,
- KC(0x2a), KS_onehalf, KS_asterisk, KS_grave,
- KC(0x40), KS_aring,
- KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
- KC(0x56), KS_ae,
- KC(0x57), KS_oslash,
- KC(0x58), KS_backslash, KS_asterisk, KS_grave,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x7c), KS_less, KS_greater, KS_backslash,
-};
-
-/* 005 German type 4 keyboard */
-const keysym_t sunkbd_keydesc_de[] = {
- KC(0x0d), KS_Alt_L,
- KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
- KC(0x13), KS_Mode_switch,
- KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
- KC(0x20), KS_3, KS_section, KS_threesuperior,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_slash, KS_degree,
- KC(0x25), KS_8, KS_parenleft, KS_grave,
- KC(0x26), KS_9, KS_parenright, KS_apostrophe,
- KC(0x27), KS_0, KS_equal, KS_bar,
- KC(0x28), KS_ssharp, KS_question, KS_backslash,
- KC(0x29), KS_dead_acute, KS_dead_grave,
- KC(0x2a), KS_numbersign, KS_asciicircum, KS_at,
- KC(0x3b), KS_z,
- KC(0x40), KS_udiaeresis,
- KC(0x41), KS_plus, KS_multiply, KS_asciitilde,
- KC(0x4c), KS_Caps_Lock,
- KC(0x56), KS_odiaeresis,
- KC(0x57), KS_adiaeresis,
- KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
- KC(0x64), KS_y,
- KC(0x6a), KS_m, KS_M, KS_mu,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Control_L,
- KC(0x7c), KS_less, KS_greater,
-};
-
-/* 025 German type 5 keyboard */
-const keysym_t sunkbd5_keydesc_de[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
- KC(0x20), KS_3, KS_section, KS_threesuperior,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_slash, KS_braceleft,
- KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
- KC(0x26), KS_9, KS_parenright, KS_bracketright,
- KC(0x27), KS_0, KS_equal, KS_braceright,
- KC(0x28), KS_ssharp, KS_question, KS_backslash,
- KC(0x29), KS_dead_acute, KS_dead_grave,
- KC(0x2a), KS_asciicircum, KS_degree,
- KC(0x36), KS_q, KS_Q, KS_at,
- KC(0x3b), KS_z,
- KC(0x40), KS_udiaeresis,
- KC(0x41), KS_plus, KS_multiply, KS_asciitilde,
- KC(0x56), KS_odiaeresis,
- KC(0x57), KS_adiaeresis,
- KC(0x58), KS_numbersign, KS_apostrophe, KS_grave,
- KC(0x64), KS_y,
- KC(0x6a), KS_m, KS_M, KS_mu,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x7c), KS_less, KS_greater, KS_bar,
-};
-
-/* 006 Italian type 4 keyboard */
-const keysym_t sunkbd_keydesc_it[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
- KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
- KC(0x20), KS_3, KS_sterling, KS_threesuperior,
- KC(0x23), KS_6, KS_ampersand, KS_notsign,
- KC(0x24), KS_7, KS_slash,
- KC(0x25), KS_8, KS_parenleft,
- KC(0x26), KS_9, KS_parenright, KS_backslash,
- KC(0x27), KS_0, KS_equal, KS_bar,
- KC(0x28), KS_apostrophe, KS_question, KS_grave,
- KC(0x29), KS_igrave, KS_asciicircum,
- KC(0x2a), KS_ugrave, KS_section,
- KC(0x40), KS_egrave, KS_eacute,
- KC(0x41), KS_plus, KS_asterisk, KS_asciitilde,
- KC(0x4c), KS_Caps_Lock,
- KC(0x56), KS_ograve, KS_ccedilla, KS_at,
- KC(0x57), KS_agrave, KS_degree, KS_numbersign,
- KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Control_L,
- KC(0x7c), KS_less, KS_greater,
-};
-
-/* 026 Italian type 5 keyboard */
-const keysym_t sunkbd5_keydesc_it[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1f), KS_2, KS_quotedbl,
- KC(0x20), KS_3, KS_sterling,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_slash,
- KC(0x25), KS_8, KS_parenleft, KS_braceleft,
- KC(0x26), KS_9, KS_parenright, KS_braceright,
- KC(0x27), KS_0, KS_equal,
- KC(0x28), KS_apostrophe, KS_question, KS_grave,
- KC(0x29), KS_igrave, KS_asciicircum,
- KC(0x2a), KS_backslash, KS_bar,
- KC(0x40), KS_egrave, KS_eacute, KS_bracketleft,
- KC(0x41), KS_plus, KS_asterisk, KS_bracketright,
- KC(0x56), KS_ograve, KS_ccedilla, KS_at,
- KC(0x57), KS_agrave, KS_degree, KS_numbersign,
- KC(0x58), KS_ugrave, KS_section, KS_asciitilde,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x7c), KS_less, KS_greater,
-};
-
-/* 007 Dutch type 4 keyboard */
-const keysym_t sunkbd_keydesc_nl[] = {
- KC(0x0d), KS_Caps_Lock,
- KC(0x0f), KS_backslash, KS_bar,
- KC(0x1e), KS_1, KS_exclam, KS_onesuperior,
- KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
- KC(0x20), KS_3, KS_numbersign, KS_threesuperior,
- KC(0x21), KS_4, KS_dollar, KS_onequarter,
- KC(0x22), KS_5, KS_percent, KS_onehalf,
- KC(0x23), KS_6, KS_ampersand, KS_threequarters,
- KC(0x24), KS_7, KS_underscore, KS_sterling,
- KC(0x25), KS_8, KS_parenleft, KS_braceleft,
- KC(0x26), KS_9, KS_parenright, KS_braceright,
- KC(0x27), KS_0, KS_apostrophe, KS_grave,
- KC(0x28), KS_slash, KS_question,
- KC(0x29), KS_degree, KS_dead_tilde, KS_dead_abovering,
- KC(0x2a), KS_less, KS_greater,
- KC(0x40), KS_dead_diaeresis,KS_dead_circumflex,
- KC(0x41), KS_asterisk, KS_brokenbar, KS_asciitilde,
- KC(0x4e), KS_s, KS_S, KS_ssharp,
- KC(0x56), KS_plus, KS_plusminus,
- KC(0x57), KS_dead_acute, KS_dead_grave,
- KC(0x58), KS_at, KS_section, KS_notsign,
- KC(0x64), KS_z, KS_Z, KS_guillemotleft,
- KC(0x65), KS_x, KS_X, KS_guillemotright,
- KC(0x66), KS_c, KS_C, KS_cent,
- KC(0x6a), KS_m, KS_M, KS_mu,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_equal,
- KC(0x77), KS_Mode_switch,
- KC(0x7d), KS_bracketright,KS_bracketleft,
-};
-
-/* 027 Dutch type 5 keyboard */
-const keysym_t sunkbd5_keydesc_nl[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1e), KS_1, KS_exclam, KS_onesuperior,
- KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
- KC(0x20), KS_3, KS_numbersign, KS_threesuperior,
- KC(0x21), KS_4, KS_dollar, KS_onequarter,
- KC(0x22), KS_5, KS_percent, KS_onehalf,
- KC(0x23), KS_6, KS_ampersand, KS_threequarters,
- KC(0x24), KS_7, KS_underscore, KS_sterling,
- KC(0x25), KS_8, KS_parenleft, KS_braceleft,
- KC(0x26), KS_9, KS_parenright, KS_braceright,
- KC(0x27), KS_0, KS_apostrophe, KS_grave,
- KC(0x28), KS_slash, KS_question, KS_backslash,
- KC(0x29), KS_degree, KS_dead_tilde, KS_dead_abovering,
- KC(0x2a), KS_at, KS_section, KS_notsign,
- KC(0x40), KS_dead_diaeresis,KS_dead_circumflex,
- KC(0x41), KS_asterisk, KS_bar, KS_asciitilde,
- KC(0x4e), KS_s, KS_S, KS_ssharp,
- KC(0x56), KS_plus, KS_plusminus,
- KC(0x57), KS_dead_acute, KS_dead_grave,
- KC(0x58), KS_less, KS_greater, KS_asciicircum,
- KC(0x64), KS_z, KS_Z, KS_guillemotleft,
- KC(0x65), KS_x, KS_X, KS_guillemotright,
- KC(0x66), KS_c, KS_C, KS_cent,
- KC(0x6a), KS_m, KS_M, KS_mu,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon, KS_hyphen,
- KC(0x6d), KS_minus, KS_equal,
- KC(0x7d), KS_bracketright,KS_bracketleft, KS_brokenbar,
-};
-
-/* 008 Norwegian type 4 keyboard */
-const keysym_t sunkbd_keydesc_no[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x0f), KS_asciitilde, KS_asciicircum,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_numbersign, KS_sterling,
- KC(0x21), KS_4, KS_currency, KS_dollar,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_slash, KS_braceleft,
- KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
- KC(0x26), KS_9, KS_parenright, KS_bracketright,
- KC(0x27), KS_0, KS_equal, KS_braceright,
- KC(0x28), KS_plus, KS_question,
- KC(0x29), KS_backslash, KS_dead_grave, KS_dead_acute,
- KC(0x2a), KS_apostrophe, KS_asterisk, KS_grave,
- KC(0x40), KS_aring,
- KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
- KC(0x4c), KS_Caps_Lock,
- KC(0x56), KS_oslash,
- KC(0x57), KS_ae,
- KC(0x58), KS_bar, KS_section,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Control_L,
- KC(0x7d), KS_less, KS_greater,
-};
-
-/* 028 Norwegian type 5 keyboard */
-const keysym_t sunkbd5_keydesc_no[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_numbersign, KS_sterling,
- KC(0x21), KS_4, KS_currency, KS_dollar,
- KC(0x22), KS_5, KS_percent, KS_asciitilde,
- KC(0x23), KS_6, KS_ampersand, KS_asciicircum,
- KC(0x24), KS_7, KS_slash, KS_braceleft,
- KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
- KC(0x26), KS_9, KS_parenright, KS_bracketright,
- KC(0x27), KS_0, KS_equal, KS_braceright,
- KC(0x28), KS_plus, KS_question,
- KC(0x29), KS_backslash, KS_dead_grave, KS_dead_acute,
- KC(0x2a), KS_bar, KS_section,
- KC(0x40), KS_aring,
- KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
- KC(0x56), KS_oslash,
- KC(0x57), KS_ae,
- KC(0x58), KS_apostrophe, KS_asterisk, KS_grave,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x7d), KS_less, KS_greater,
-};
-
-/* 009 Portuguese type 4 keyboard */
-const keysym_t sunkbd_keydesc_pt[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_numbersign, KS_sterling,
- KC(0x21), KS_4, KS_dollar, KS_section,
- KC(0x23), KS_6, KS_ampersand, KS_notsign,
- KC(0x24), KS_7, KS_slash,
- KC(0x25), KS_8, KS_parenleft,
- KC(0x26), KS_9, KS_parenright, KS_backslash,
- KC(0x27), KS_0, KS_equal, KS_bar,
- KC(0x28), KS_apostrophe, KS_question, KS_grave,
- KC(0x29), KS_exclamdown, KS_questiondown,
- KC(0x2a), KS_dead_tilde, KS_dead_circumflex,KS_asciicircum,
- KC(0x40), KS_dead_diaeresis,KS_asterisk, KS_plus,
- KC(0x41), KS_dead_acute, KS_dead_grave, KS_asciitilde,
- KC(0x4c), KS_Caps_Lock,
- KC(0x56), KS_ccedilla,
- KC(0x57), KS_masculine, KS_ordfeminine,
- KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Control_L,
- KC(0x7d), KS_less, KS_greater,
-};
-
-/* 029 Portuguese type 4 keyboard */
-const keysym_t sunkbd5_keydesc_pt[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_numbersign, KS_sterling,
- KC(0x21), KS_4, KS_dollar, KS_section,
- KC(0x22), KS_5, KS_percent, KS_asciitilde,
- KC(0x23), KS_6, KS_ampersand, KS_asciicircum,
- KC(0x24), KS_7, KS_slash, KS_braceleft,
- KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
- KC(0x26), KS_9, KS_parenright, KS_bracketright,
- KC(0x27), KS_0, KS_equal, KS_braceright,
- KC(0x28), KS_apostrophe, KS_question, KS_grave,
- KC(0x29), KS_guillemotleft,KS_guillemotright,
- KC(0x2a), KS_backslash, KS_bar,
- KC(0x40), KS_plus, KS_asterisk, KS_dead_diaeresis,
- KC(0x41), KS_dead_acute, KS_dead_grave,
- KC(0x56), KS_ccedilla,
- KC(0x57), KS_masculine, KS_ordfeminine,
- KC(0x58), KS_dead_tilde, KS_dead_circumflex,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x7d), KS_less, KS_greater,
-};
-
-/* 00a Spanish type 4 keyboard */
-const keysym_t sunkbd_keydesc_es[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_hyphen, KS_numbersign,
- KC(0x22), KS_5, KS_percent, KS_degree,
- KC(0x23), KS_6, KS_ampersand, KS_notsign,
- KC(0x24), KS_7, KS_slash,
- KC(0x25), KS_8, KS_parenleft,
- KC(0x26), KS_9, KS_parenright, KS_backslash,
- KC(0x27), KS_0, KS_equal, KS_bar,
- KC(0x28), KS_apostrophe, KS_question, KS_grave,
- KC(0x29), KS_exclamdown, KS_questiondown,
- KC(0x2a), KS_ccedilla,
- KC(0x3e), KS_o, KS_O, KS_masculine,
- KC(0x40), KS_dead_grave, KS_dead_circumflex,KS_asciicircum,
- KC(0x41), KS_plus, KS_asterisk, KS_asciitilde,
- KC(0x4c), KS_Caps_Lock,
- KC(0x4d), KS_a, KS_A, KS_ordfeminine,
- KC(0x56), KS_ntilde,
- KC(0x57), KS_dead_acute, KS_dead_diaeresis,
- KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Control_L,
- KC(0x7d), KS_less, KS_greater,
-};
-
-/* 02a Spanish type 5 keyboard */
-const keysym_t sunkbd5_keydesc_es[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1e), KS_1, KS_exclam, KS_bar,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_hyphen, KS_numbersign,
- KC(0x21), KS_4, KS_dollar, KS_asciicircum,
- KC(0x22), KS_5, KS_percent, KS_asciitilde,
- KC(0x23), KS_6, KS_ampersand, KS_notsign,
- KC(0x24), KS_7, KS_slash,
- KC(0x25), KS_8, KS_parenleft,
- KC(0x26), KS_9, KS_parenright,
- KC(0x27), KS_0, KS_equal,
- KC(0x28), KS_apostrophe, KS_question, KS_grave,
- KC(0x29), KS_exclamdown, KS_questiondown,
- KC(0x2a), KS_masculine, KS_ordfeminine, KS_backslash,
- KC(0x40), KS_dead_grave, KS_dead_circumflex,KS_bracketleft,
- KC(0x41), KS_plus, KS_asterisk, KS_bracketright,
- KC(0x56), KS_ntilde,
- KC(0x57), KS_dead_acute, KS_dead_diaeresis,KS_braceleft,
- KC(0x58), KS_ccedilla, KS_Ccedilla, KS_braceright,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x7d), KS_less, KS_greater,
-};
-
-/* 00b Swedish/Finnish type 4 keyboard */
-const keysym_t sunkbd_keydesc_sv[] = {
- KC(0x0d), KS_Multi_key,
- KC(0x0f), KS_asciitilde, KS_asciicircum,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_numbersign, KS_sterling,
- KC(0x21), KS_4, KS_currency, KS_dollar,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_slash, KS_braceleft,
- KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
- KC(0x26), KS_9, KS_parenright, KS_bracketright,
- KC(0x27), KS_0, KS_equal, KS_braceright,
- KC(0x28), KS_plus, KS_question, KS_backslash,
- KC(0x29), KS_dead_acute, KS_dead_grave,
- KC(0x2a), KS_apostrophe, KS_asterisk, KS_grave,
- KC(0x40), KS_aring,
- KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
- KC(0x43), KS_Mode_switch,
- KC(0x4c), KS_Caps_Lock,
- KC(0x56), KS_odiaeresis,
- KC(0x57), KS_adiaeresis,
- KC(0x58), KS_section, KS_onehalf,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Control_L,
- KC(0x7c), KS_less, KS_greater, KS_bar,
-};
-
-const keysym_t sunkbd_keydesc_sv_nodead[] = {
- KC(0x29), KS_apostrophe, KS_grave,
- KC(0x41), KS_diaeresis, KS_asciicircum, KS_asciitilde,
-};
-
-/* 02b Swedish type 5 keyboard */
-const keysym_t sunkbd5_keydesc_sv[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x0f), KS_asciitilde, KS_asciicircum,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_numbersign, KS_sterling,
- KC(0x21), KS_4, KS_currency, KS_dollar,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_slash, KS_braceleft,
- KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
- KC(0x26), KS_9, KS_parenright, KS_bracketright,
- KC(0x27), KS_0, KS_equal, KS_braceright,
- KC(0x28), KS_plus, KS_question, KS_backslash,
- KC(0x29), KS_dead_acute, KS_dead_grave,
- KC(0x2a), KS_section, KS_onehalf,
- KC(0x40), KS_aring,
- KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
- KC(0x43), KS_Multi_key,
- KC(0x4c), KS_Control_L,
- KC(0x56), KS_odiaeresis,
- KC(0x57), KS_adiaeresis,
- KC(0x58), KS_apostrophe, KS_asterisk, KS_grave,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Caps_Lock,
- KC(0x7c), KS_less, KS_greater, KS_bar,
-};
-
-/* 00c Swiss-French type 4 keyboard */
-const keysym_t sunkbd_keydesc_sf[] = {
- KC(0x0d), KS_Multi_key,
- KC(0x0f), KS_greater, KS_braceright,
- KC(0x1e), KS_1, KS_plus, KS_exclam,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_asterisk, KS_numbersign,
- KC(0x21), KS_4, KS_ccedilla, KS_cent,
- KC(0x22), KS_5, KS_percent, KS_asciitilde,
- KC(0x23), KS_6, KS_ampersand, KS_section,
- KC(0x24), KS_7, KS_slash, KS_bar,
- KC(0x25), KS_8, KS_parenleft, KS_degree,
- KC(0x26), KS_9, KS_parenright, KS_backslash,
- KC(0x27), KS_0, KS_equal, KS_asciicircum,
- KC(0x28), KS_apostrophe, KS_question, KS_grave,
- KC(0x29), KS_dead_circumflex,KS_dead_grave,
- KC(0x2a), KS_dollar, KS_dead_tilde, KS_sterling,
- KC(0x3b), KS_z,
- KC(0x40), KS_egrave, KS_udiaeresis,
- KC(0x41), KS_dead_diaeresis,KS_dead_acute,
- KC(0x43), KS_Mode_switch,
- KC(0x4c), KS_Caps_Lock,
- KC(0x56), KS_eacute, KS_odiaeresis,
- KC(0x57), KS_agrave, KS_adiaeresis,
- KC(0x58), KS_less, KS_braceleft,
- KC(0x64), KS_y,
- KC(0x6a), KS_m, KS_M, KS_mu,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Control_L,
- KC(0x7c), KS_bracketright,KS_bracketleft, KS_backslash,
-};
-
-/* 02c Swiss-French type 5 keyboard */
-const keysym_t sunkbd5_keydesc_sf[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1e), KS_1, KS_plus, KS_bar,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_asterisk, KS_numbersign,
- KC(0x21), KS_4, KS_ccedilla, KS_asciicircum,
- KC(0x22), KS_5, KS_percent, KS_asciitilde,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_slash,
- KC(0x25), KS_8, KS_parenleft,
- KC(0x26), KS_9, KS_parenright,
- KC(0x27), KS_0, KS_equal, KS_grave,
- KC(0x28), KS_apostrophe, KS_question, KS_dead_acute,
- KC(0x29), KS_dead_circumflex,KS_dead_grave,KS_dead_tilde,
- KC(0x2a), KS_dollar, KS_degree,
- KC(0x3b), KS_z,
- KC(0x40), KS_egrave, KS_udiaeresis, KS_bracketleft,
- KC(0x41), KS_dead_diaeresis,KS_exclam, KS_bracketright,
- KC(0x56), KS_eacute, KS_odiaeresis,
- KC(0x57), KS_agrave, KS_adiaeresis, KS_braceleft,
- KC(0x58), KS_dollar, KS_sterling, KS_braceright,
- KC(0x64), KS_y,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x7c), KS_less, KS_greater, KS_backslash,
-};
-
-/* 00d Swiss-German type 4 keyboard */
-const keysym_t sunkbd_keydesc_sg[] = {
- KC(0x0d), KS_Multi_key,
- KC(0x0f), KS_greater, KS_braceright,
- KC(0x1e), KS_1, KS_plus, KS_exclam,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_asterisk, KS_numbersign,
- KC(0x21), KS_4, KS_ccedilla, KS_cent,
- KC(0x22), KS_5, KS_percent, KS_asciitilde,
- KC(0x23), KS_6, KS_ampersand, KS_section,
- KC(0x24), KS_7, KS_slash, KS_bar,
- KC(0x25), KS_8, KS_parenleft, KS_degree,
- KC(0x26), KS_9, KS_parenright, KS_backslash,
- KC(0x27), KS_0, KS_equal, KS_asciicircum,
- KC(0x28), KS_apostrophe, KS_question, KS_grave,
- KC(0x29), KS_dead_circumflex,KS_dead_grave,
- KC(0x2a), KS_dollar, KS_dead_tilde, KS_sterling,
- KC(0x3b), KS_z,
- KC(0x40), KS_udiaeresis, KS_egrave,
- KC(0x41), KS_dead_diaeresis,KS_dead_acute,
- KC(0x43), KS_Mode_switch,
- KC(0x4c), KS_Caps_Lock,
- KC(0x56), KS_odiaeresis, KS_eacute,
- KC(0x57), KS_adiaeresis, KS_agrave,
- KC(0x58), KS_less, KS_braceleft,
- KC(0x64), KS_y,
- KC(0x6a), KS_m, KS_M, KS_mu,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x77), KS_Control_L,
- KC(0x7c), KS_bracketright,KS_bracketleft, KS_backslash,
-};
-
-/* 02d Swiss-German type 5 keyboard */
-const keysym_t sunkbd5_keydesc_sg[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1e), KS_1, KS_plus, KS_bar,
- KC(0x1f), KS_2, KS_quotedbl, KS_at,
- KC(0x20), KS_3, KS_asterisk, KS_numbersign,
- KC(0x21), KS_4, KS_ccedilla, KS_asciicircum,
- KC(0x22), KS_5, KS_percent, KS_asciitilde,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_slash,
- KC(0x25), KS_8, KS_parenleft,
- KC(0x26), KS_9, KS_parenright,
- KC(0x27), KS_0, KS_equal, KS_grave,
- KC(0x28), KS_apostrophe, KS_question, KS_dead_acute,
- KC(0x29), KS_dead_circumflex,KS_dead_grave,KS_dead_tilde,
- KC(0x2a), KS_dollar, KS_degree,
- KC(0x3b), KS_z,
- KC(0x40), KS_udiaeresis, KS_egrave, KS_bracketleft,
- KC(0x41), KS_dead_diaeresis,KS_exclam, KS_bracketright,
- KC(0x56), KS_odiaeresis, KS_eacute,
- KC(0x57), KS_adiaeresis, KS_agrave, KS_braceleft,
- KC(0x58), KS_dollar, KS_sterling, KS_braceright,
- KC(0x64), KS_y,
- KC(0x6b), KS_comma, KS_semicolon,
- KC(0x6c), KS_period, KS_colon,
- KC(0x6d), KS_minus, KS_underscore,
- KC(0x7c), KS_less, KS_greater, KS_backslash,
-};
-
-/* 00e UK English type 4 keyboard */
-const keysym_t sunkbd_keydesc_uk[] = {
- KC(0x1e), KS_1, KS_exclam, KS_bar,
- KC(0x21), KS_3, KS_sterling, KS_numbersign,
- KC(0x28), KS_minus, KS_underscore, KS_notsign,
- KC(0x43), KS_Mode_switch,
-};
-
-/* 02e UK English type 5 keyboard */
-const keysym_t sunkbd5_keydesc_uk[] = {
- KC(0x0d), KS_Mode_switch,
- KC(0x1f), KS_2, KS_quotedbl,
- KC(0x20), KS_3, KS_sterling,
- KC(0x2a), KS_grave, KS_notsign, KS_brokenbar,
- KC(0x57), KS_apostrophe, KS_at,
- KC(0x58), KS_numbersign, KS_asciitilde,
- KC(0x7c), KS_backslash, KS_bar,
-};
+#ifdef __sparc64__
+#define NTCTRL 0
+#else
+#include "tctrl.h"
+#endif
-/* 031 Japan type 5 keyboard */
-const keysym_t sunkbd5_keydesc_jp[] = {
- KC(0x1f), KS_2, KS_quotedbl,
- KC(0x23), KS_6, KS_ampersand,
- KC(0x24), KS_7, KS_apostrophe,
- KC(0x25), KS_8, KS_parenleft,
- KC(0x26), KS_9, KS_parenright,
- KC(0x27), KS_0,
- KC(0x28), KS_minus, KS_equal,
- KC(0x29), KS_asciicircum, KS_asciitilde,
- KC(0x2a), KS_yen, KS_bar,
- KC(0x40), KS_at, KS_grave,
- KC(0x41), KS_bracketleft, KS_braceleft,
- KC(0x56), KS_semicolon, KS_plus,
- KC(0x57), KS_colon, KS_asterisk,
- KC(0x58), KS_bracketright,KS_braceright,
- KC(0x7c), KS_backslash, KS_underscore,
-};
+#if NTCTRL > 0
+#include <sparc/dev/tctrlvar.h> /* XXX for tadpole_bell() */
+#endif
-#define KBD_MAP(name, base, map) \
- { name, base, sizeof(map)/sizeof(keysym_t), map }
+void sunkbd_bell(struct sunkbd_softc *, u_int, u_int, u_int);
+int sunkbd_enable(void *, int);
+int sunkbd_getleds(struct sunkbd_softc *);
+int sunkbd_ioctl(void *, u_long, caddr_t, int, struct proc *);
+void sunkbd_setleds(void *, int);
-/* Supported type 4 keyboard layouts */
-const struct wscons_keydesc sunkbd_keydesctab[] = {
- KBD_MAP(KB_US, 0, sunkbd_keydesc_us),
- KBD_MAP(KB_BE, KB_US, sunkbd_keydesc_befr),
- KBD_MAP(KB_DE, KB_US, sunkbd_keydesc_de),
- KBD_MAP(KB_DK, KB_US, sunkbd_keydesc_dk),
- KBD_MAP(KB_ES, KB_US, sunkbd_keydesc_es),
- KBD_MAP(KB_FR, KB_US, sunkbd_keydesc_befr),
- KBD_MAP(KB_IT, KB_US, sunkbd_keydesc_it),
- KBD_MAP(KB_NL, KB_US, sunkbd_keydesc_nl),
- KBD_MAP(KB_NO, KB_US, sunkbd_keydesc_no),
- KBD_MAP(KB_PT, KB_US, sunkbd_keydesc_pt),
- KBD_MAP(KB_SF, KB_US, sunkbd_keydesc_sf),
- KBD_MAP(KB_SG, KB_US, sunkbd_keydesc_sg),
- KBD_MAP(KB_SV, KB_US, sunkbd_keydesc_sv),
- KBD_MAP(KB_SV | KB_NODEAD, KB_SV, sunkbd_keydesc_sv_nodead),
- KBD_MAP(KB_UK, KB_US, sunkbd_keydesc_uk),
- {0, 0, 0, 0},
+struct wskbd_accessops sunkbd_accessops = {
+ sunkbd_enable,
+ sunkbd_setleds,
+ sunkbd_ioctl
};
-/* Supported type 5 keyboard layouts */
-const struct wscons_keydesc sunkbd5_keydesctab[] = {
- KBD_MAP(KB_US, 0, sunkbd_keydesc_us),
- KBD_MAP(KB_DE, KB_US, sunkbd5_keydesc_de),
- KBD_MAP(KB_DK, KB_US, sunkbd5_keydesc_dk),
- KBD_MAP(KB_ES, KB_US, sunkbd5_keydesc_es),
- KBD_MAP(KB_FR, KB_US, sunkbd5_keydesc_fr),
- KBD_MAP(KB_IT, KB_US, sunkbd5_keydesc_it),
- KBD_MAP(KB_JP, KB_US, sunkbd5_keydesc_jp),
- KBD_MAP(KB_NL, KB_US, sunkbd5_keydesc_nl),
- KBD_MAP(KB_NO, KB_US, sunkbd5_keydesc_no),
- KBD_MAP(KB_PT, KB_US, sunkbd5_keydesc_pt),
- KBD_MAP(KB_SF, KB_US, sunkbd5_keydesc_sf),
- KBD_MAP(KB_SG, KB_US, sunkbd5_keydesc_sg),
- KBD_MAP(KB_SV, KB_US, sunkbd5_keydesc_sv),
- KBD_MAP(KB_SV | KB_NODEAD, KB_SV, sunkbd_keydesc_sv_nodead),
- KBD_MAP(KB_UK, KB_US, sunkbd5_keydesc_uk),
- {0, 0, 0, 0},
-};
-
-/*
- * Keyboard layout to ID table
- * References:
- * Sun Type 5 Keyboard Supplement Installation Guide, May 1992
- * http://docs.sun.com/db/doc/806-6642/6jfipqu57?a=view
- * http://jp.sunsolve.sun.com/handbook_pub/Systems/SSVygr/INPUT_Compact1_Keyboard.html
- */
-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 */
- KB_JP, /* 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 */
+void
+sunkbd_bell(struct sunkbd_softc *sc, u_int period, u_int pitch, u_int volume)
+{
+ int ticks, s;
+ u_int8_t c = SKBD_CMD_BELLON;
- /* Not affected range */
- -1, /* 040 */
- -1, /* 041 */
- -1, /* 042 */
- -1, /* 043 */
- -1, /* 044 */
- -1, /* 045 */
- -1, /* 046 */
- -1, /* 047 */
- -1, /* 048 */
- -1, /* 049 */
- -1, /* 04a */
- -1, /* 04b */
- -1, /* 04c */
- -1, /* 04d */
- -1, /* 04e */
- -1, /* 04f */
-
- /* ``Compact-1'' layouts */
- KB_US, /* 050 USA */
- KB_US, /* 051 UNIX */
- KB_FR, /* 052 France */
- KB_DK, /* 053 Denmark */
- KB_DE, /* 054 Germany */
- KB_IT, /* 055 Italy */
- KB_NL, /* 056 The Netherlands */
- KB_NO, /* 057 Norway */
- KB_PT, /* 058 Portugal */
- KB_ES, /* 059 Spain */
- KB_SV, /* 05a Sweden */
- KB_SF, /* 05b Switzerland/French */
- KB_SG, /* 05c Switzerland/German */
- KB_UK, /* 05d Great Britain */
- -1, /* 05e Korea */
- -1, /* 05f Taiwan */
- KB_JP, /* 060 Japan */
- -1, /* 061 Canada/French */
-};
-
-struct wskbd_mapdata sunkbd_keymapdata = {
- sunkbd_keydesctab,
-#ifdef SUNKBD_LAYOUT
- SUNKBD_LAYOUT,
-#else
- KB_US,
+#if NTCTRL > 0
+ if (tadpole_bell(period / 10, pitch, volume) != 0)
+ return;
#endif
-};
-struct wskbd_mapdata sunkbd5_keymapdata = {
- sunkbd5_keydesctab,
-#ifdef SUNKBD5_LAYOUT
- SUNKBD5_LAYOUT,
-#else
- KB_US,
-#endif
-};
+ s = spltty();
+ if (sc->sc_bellactive) {
+ if (sc->sc_belltimeout == 0)
+ timeout_del(&sc->sc_bellto);
+ }
+ if (pitch == 0 || period == 0) {
+ sunkbd_bellstop(sc);
+ splx(s);
+ return;
+ }
+ if (sc->sc_bellactive == 0) {
+ ticks = (period * hz) / 1000;
+ if (ticks <= 0)
+ ticks = 1;
+
+ sc->sc_bellactive = 1;
+ sc->sc_belltimeout = 1;
+ (*sc->sc_sendcmd)(sc, &c, 1);
+ timeout_add(&sc->sc_bellto, ticks);
+ }
+ splx(s);
+}
+
+void
+sunkbd_bellstop(void *v)
+{
+ struct sunkbd_softc *sc = v;
+ int s;
+ u_int8_t c;
+
+ s = spltty();
+ sc->sc_belltimeout = 0;
+ c = SKBD_CMD_BELLOFF;
+ (*sc->sc_sendcmd)(v, &c, 1);
+ sc->sc_bellactive = 0;
+ splx(s);
+}
+
+void
+sunkbd_decode(u_int8_t c, u_int *type, int *value)
+{
+ switch (c) {
+ case SKBD_RSP_IDLE:
+ *type = WSCONS_EVENT_ALL_KEYS_UP;
+ *value = 0;
+ break;
+ default:
+ *type = (c & 0x80) ?
+ WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
+ *value = c & 0x7f;
+ break;
+ }
+}
+
+int
+sunkbd_enable(void *v, int on)
+{
+ return (0);
+}
+
+int
+sunkbd_getleds(struct sunkbd_softc *sc)
+{
+ return (sc->sc_leds);
+}
+
+int
+sunkbd_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
+{
+ struct sunkbd_softc *sc = v;
+ int *d_int = (int *)data;
+ struct wskbd_bell_data *d_bell = (struct wskbd_bell_data *)data;
+
+ switch (cmd) {
+ case WSKBDIO_GTYPE:
+ if (ISTYPE5(sc->sc_layout)) {
+ *d_int = WSKBD_TYPE_SUN5;
+ } else {
+ *d_int = WSKBD_TYPE_SUN;
+ }
+ return (0);
+ case WSKBDIO_SETLEDS:
+ sunkbd_setleds(sc, *d_int);
+ return (0);
+ case WSKBDIO_GETLEDS:
+ *d_int = sunkbd_getleds(sc);
+ return (0);
+ case WSKBDIO_COMPLEXBELL:
+ sunkbd_bell(sc, d_bell->period, d_bell->pitch, d_bell->volume);
+ return (0);
+ }
+
+ return (-1);
+}
+
+void
+sunkbd_raw(struct sunkbd_softc *sc, u_int8_t c)
+{
+ int claimed = 0;
+
+ if (sc->sc_kbdstate == SKBD_STATE_LAYOUT) {
+ sc->sc_kbdstate = SKBD_STATE_GETKEY;
+ sc->sc_layout = c;
+ return;
+ }
+
+ switch (c) {
+ case SKBD_RSP_RESET:
+ sc->sc_kbdstate = SKBD_STATE_RESET;
+ claimed = 1;
+ break;
+ case SKBD_RSP_LAYOUT:
+ sc->sc_kbdstate = SKBD_STATE_LAYOUT;
+ claimed = 1;
+ break;
+ case SKBD_RSP_IDLE:
+ sc->sc_kbdstate = SKBD_STATE_GETKEY;
+ claimed = 1;
+ }
+
+ if (claimed)
+ return;
+
+ switch (sc->sc_kbdstate) {
+ case SKBD_STATE_RESET:
+ sc->sc_kbdstate = SKBD_STATE_GETKEY;
+ if (c < KB_SUN2 || c > KB_SUN4)
+ printf("%s: reset: invalid keyboard type 0x%02x\n",
+ sc->sc_dev.dv_xname, c);
+ else
+ sc->sc_id = c;
+ break;
+ case SKBD_STATE_GETKEY:
+ break;
+ }
+}
+
+void
+sunkbd_setleds(void *v, int wled)
+{
+ struct sunkbd_softc *sc = v;
+ u_int8_t sled = 0;
+ u_int8_t cmd[2];
+
+ sc->sc_leds = wled;
+
+ if (wled & WSKBD_LED_CAPS)
+ sled |= SKBD_LED_CAPSLOCK;
+ if (wled & WSKBD_LED_NUM)
+ sled |= SKBD_LED_NUMLOCK;
+ if (wled & WSKBD_LED_SCROLL)
+ sled |= SKBD_LED_SCROLLLOCK;
+ if (wled & WSKBD_LED_COMPOSE)
+ sled |= SKBD_LED_COMPOSE;
+
+ cmd[0] = SKBD_CMD_SETLED;
+ cmd[1] = sled;
+ (*sc->sc_sendcmd)(sc, cmd, sizeof(cmd));
+}
diff --git a/sys/dev/sun/sunkbdmap.c b/sys/dev/sun/sunkbdmap.c
new file mode 100644
index 00000000000..e4c3cc75f17
--- /dev/null
+++ b/sys/dev/sun/sunkbdmap.c
@@ -0,0 +1,1036 @@
+/* $OpenBSD: sunkbdmap.c,v 1.1 2005/05/14 15:25:20 miod Exp $ */
+
+/*
+ * Copyright (c) 2002, 2003 Miodrag Vallat.
+ * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Effort sponsored in part by the Defense Advanced Research Projects
+ * Agency (DARPA) and Air Force Research Laboratory, Air Force
+ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
+ *
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/kernel.h>
+#include <sys/timeout.h>
+
+#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wskbdvar.h>
+#include <dev/wscons/wsksymdef.h>
+#include <dev/wscons/wsksymvar.h>
+
+#include <dev/sun/sunkbdreg.h>
+#include <dev/sun/sunkbdvar.h>
+
+#define KC(n) KS_KEYCODE(n)
+
+/* 000/021/022 US English type 4/5 keyboard */
+const keysym_t sunkbd_keydesc_us[] = {
+ KC(0x01), KS_Cmd,
+ KC(0x02), KS_Cmd_BrightnessDown,
+ KC(0x03), KS_Again,
+ KC(0x04), KS_Cmd_BrightnessUp,
+ KC(0x05), KS_f1,
+ KC(0x06), KS_f2,
+ KC(0x07), KS_f10,
+ KC(0x08), KS_f3,
+ KC(0x09), KS_f11,
+ KC(0x0a), KS_f4,
+ KC(0x0b), KS_f12,
+ KC(0x0c), KS_f5,
+ KC(0x0d), KS_Alt_R,
+ KC(0x0e), KS_f6,
+ KC(0x10), KS_f7,
+ KC(0x11), KS_f8,
+ KC(0x12), KS_f9,
+ KC(0x13), KS_Alt_L,
+ KC(0x14), KS_Up,
+ KC(0x15), KS_Pause,
+ KC(0x16), KS_Print_Screen,
+ KC(0x17), KS_Hold_Screen,
+ KC(0x18), KS_Left,
+ KC(0x19), KS_Props,
+ KC(0x1a), KS_Undo,
+ KC(0x1b), KS_Down,
+ KC(0x1c), KS_Right,
+ KC(0x1d), KS_Escape,
+ KC(0x1e), KS_1, KS_exclam,
+ KC(0x1f), KS_2, KS_at,
+ KC(0x20), KS_3, KS_numbersign,
+ KC(0x21), KS_4, KS_dollar,
+ KC(0x22), KS_5, KS_percent,
+ KC(0x23), KS_6, KS_asciicircum,
+ KC(0x24), KS_7, KS_ampersand,
+ KC(0x25), KS_8, KS_asterisk,
+ KC(0x26), KS_9, KS_parenleft,
+ KC(0x27), KS_0, KS_parenright,
+ KC(0x28), KS_minus, KS_underscore,
+ KC(0x29), KS_equal, KS_plus,
+ KC(0x2a), KS_grave, KS_asciitilde,
+ KC(0x2b), KS_Delete,
+ KC(0x2c), KS_Insert,
+ KC(0x2d), KS_KP_Equal,
+ KC(0x2e), KS_KP_Divide,
+ KC(0x2f), KS_KP_Multiply,
+ KC(0x31), KS_Front,
+ KC(0x32), KS_KP_Delete, KS_KP_Decimal,
+ KC(0x33), KS_Copy,
+ KC(0x34), KS_Home,
+ KC(0x35), KS_Tab,
+ KC(0x36), KS_q,
+ KC(0x37), KS_w,
+ KC(0x38), KS_e,
+ KC(0x39), KS_r,
+ KC(0x3a), KS_t,
+ KC(0x3b), KS_y,
+ KC(0x3c), KS_u,
+ KC(0x3d), KS_i,
+ KC(0x3e), KS_o,
+ KC(0x3f), KS_p,
+ KC(0x40), KS_bracketleft, KS_braceleft,
+ KC(0x41), KS_bracketright,KS_braceright,
+ KC(0x42), KS_Delete,
+ KC(0x43), KS_Multi_key,
+ KC(0x44), KS_KP_Home, KS_KP_7,
+ KC(0x45), KS_KP_Up, KS_KP_8,
+ KC(0x46), KS_KP_Prior, KS_KP_9,
+ KC(0x47), KS_KP_Subtract,
+ KC(0x48), KS_Open,
+ KC(0x49), KS_Paste,
+ KC(0x4a), KS_End,
+ KC(0x4c), KS_Control_L,
+ KC(0x4d), KS_Cmd_Debugger, KS_a,
+ KC(0x4e), KS_s,
+ KC(0x4f), KS_d,
+ KC(0x50), KS_f,
+ KC(0x51), KS_g,
+ KC(0x52), KS_h,
+ KC(0x53), KS_j,
+ KC(0x54), KS_k,
+ KC(0x55), KS_l,
+ KC(0x56), KS_semicolon, KS_colon,
+ KC(0x57), KS_apostrophe, KS_quotedbl,
+ KC(0x58), KS_backslash, KS_bar,
+ KC(0x59), KS_Return,
+ KC(0x5a), KS_KP_Enter,
+ KC(0x5b), KS_KP_Left, KS_KP_4,
+ KC(0x5c), KS_KP_Begin, KS_KP_5,
+ KC(0x5d), KS_KP_Right, KS_KP_6,
+ KC(0x5e), KS_KP_Insert, KS_KP_0,
+ KC(0x5f), KS_Find,
+ KC(0x60), KS_Prior,
+ KC(0x61), KS_Cut,
+ KC(0x62), KS_Num_Lock,
+ KC(0x63), KS_Shift_L,
+ KC(0x64), KS_z,
+ KC(0x65), KS_x,
+ KC(0x66), KS_c,
+ KC(0x67), KS_v,
+ KC(0x68), KS_b,
+ KC(0x69), KS_n,
+ KC(0x6a), KS_m,
+ KC(0x6b), KS_comma, KS_less,
+ KC(0x6c), KS_period, KS_greater,
+ KC(0x6d), KS_slash, KS_question,
+ KC(0x6e), KS_Shift_R,
+ KC(0x6f), KS_Linefeed,
+ KC(0x70), KS_KP_End, KS_KP_1,
+ KC(0x71), KS_KP_Down, KS_KP_2,
+ KC(0x72), KS_KP_Next, KS_KP_3,
+ KC(0x76), KS_Help,
+ KC(0x77), KS_Caps_Lock,
+ KC(0x78), KS_Meta_L,
+ KC(0x79), KS_space,
+ KC(0x7a), KS_Meta_R,
+ KC(0x7b), KS_Next,
+ KC(0x7d), KS_KP_Add,
+};
+
+/* 002 French/Belgian type 4 keyboard */
+const keysym_t sunkbd_keydesc_befr[] = {
+ KC(0x0d), KS_Caps_Lock,
+ KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
+ KC(0x1e), KS_ampersand, KS_1,
+ KC(0x1f), KS_eacute, KS_2, KS_twosuperior,
+ KC(0x20), KS_quotedbl, KS_3, KS_threesuperior,
+ KC(0x21), KS_apostrophe, KS_4,
+ KC(0x22), KS_parenleft, KS_5,
+ KC(0x23), KS_section, KS_6,
+ KC(0x24), KS_egrave, KS_7,
+ KC(0x25), KS_exclam, KS_8, KS_sterling,
+ KC(0x26), KS_ccedilla, KS_9, KS_backslash,
+ KC(0x27), KS_agrave, KS_0,
+ KC(0x28), KS_parenright, KS_degree, KS_asciitilde,
+ KC(0x29), KS_minus, KS_underscore, KS_numbersign,
+ KC(0x2a), KS_asterisk, KS_bar, KS_currency,
+ KC(0x36), KS_a,
+ KC(0x37), KS_z,
+ KC(0x40), KS_dead_circumflex,KS_dead_diaeresis,
+ KC(0x41), KS_grave, KS_dollar, KS_at,
+ KC(0x4d), KS_Cmd_Debugger, KS_q,
+ KC(0x56), KS_m, KS_M, KS_mu,
+ KC(0x57), KS_ugrave, KS_percent,
+ KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
+ KC(0x64), KS_w,
+ KC(0x6a), KS_comma, KS_question,
+ KC(0x6b), KS_semicolon, KS_period,
+ KC(0x6c), KS_colon, KS_slash,
+ KC(0x6d), KS_equal, KS_plus,
+ KC(0x77), KS_Mode_switch,
+ KC(0x7c), KS_less, KS_greater,
+};
+
+/* 023 French type 5 keyboard */
+const keysym_t sunkbd5_keydesc_fr[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1e), KS_ampersand, KS_1,
+ KC(0x1f), KS_eacute, KS_2, KS_asciitilde,
+ KC(0x20), KS_quotedbl, KS_3, KS_numbersign,
+ KC(0x21), KS_apostrophe, KS_4, KS_braceleft,
+ KC(0x22), KS_parenleft, KS_5, KS_bracketleft,
+ KC(0x23), KS_minus, KS_6, KS_bar,
+ KC(0x24), KS_egrave, KS_7, KS_grave,
+ KC(0x25), KS_underscore, KS_8, KS_backslash,
+ KC(0x26), KS_ccedilla, KS_9, KS_asciicircum,
+ KC(0x27), KS_agrave, KS_0, KS_at,
+ KC(0x28), KS_parenright, KS_degree, KS_bracketright,
+ KC(0x29), KS_equal, KS_plus, KS_braceright,
+ KC(0x2a), KS_twosuperior,
+ KC(0x36), KS_a,
+ KC(0x37), KS_z,
+ KC(0x40), KS_dead_circumflex,KS_dead_diaeresis,
+ KC(0x41), KS_dollar, KS_sterling, KS_currency,
+ KC(0x4d), KS_Cmd_Debugger, KS_q,
+ KC(0x56), KS_m,
+ KC(0x57), KS_ugrave, KS_percent,
+ KC(0x58), KS_asterisk, KS_mu,
+ KC(0x64), KS_w,
+ KC(0x6a), KS_comma, KS_question,
+ KC(0x6b), KS_semicolon, KS_period,
+ KC(0x6c), KS_colon, KS_slash,
+ KC(0x6d), KS_exclam, KS_section,
+ KC(0x7c), KS_less, KS_greater,
+};
+
+/* 004 Danish type 4 keyboard */
+const keysym_t sunkbd_keydesc_dk[] = {
+ KC(0x0d), KS_Multi_key,
+ KC(0x0f), KS_asciitilde, KS_asciicircum,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_numbersign, KS_sterling,
+ KC(0x21), KS_4, KS_currency, KS_dollar,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_slash, KS_braceleft,
+ KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
+ KC(0x26), KS_9, KS_parenright, KS_bracketright,
+ KC(0x27), KS_0, KS_equal, KS_braceright,
+ KC(0x28), KS_plus, KS_question,
+ KC(0x29), KS_dead_acute, KS_dead_grave, KS_bar,
+ KC(0x2a), KS_apostrophe, KS_asterisk, KS_grave,
+ KC(0x40), KS_aring,
+ KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
+ KC(0x43), KS_Mode_switch,
+ KC(0x4c), KS_Caps_Lock,
+ KC(0x56), KS_ae,
+ KC(0x57), KS_oslash,
+ KC(0x58), KS_onehalf, KS_section,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Control_L,
+ KC(0x7c), KS_less, KS_greater, KS_backslash,
+};
+
+/* 024 Danish type 5 keyboard */
+const keysym_t sunkbd5_keydesc_dk[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_numbersign, KS_sterling,
+ KC(0x21), KS_4, KS_currency, KS_dollar,
+ KC(0x22), KS_5, KS_percent, KS_asciitilde,
+ KC(0x23), KS_6, KS_ampersand, KS_asciicircum,
+ KC(0x24), KS_7, KS_slash, KS_braceleft,
+ KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
+ KC(0x26), KS_9, KS_parenright, KS_bracketright,
+ KC(0x27), KS_0, KS_equal, KS_braceright,
+ KC(0x28), KS_plus, KS_question,
+ KC(0x29), KS_dead_acute, KS_dead_grave, KS_bar,
+ KC(0x2a), KS_onehalf, KS_asterisk, KS_grave,
+ KC(0x40), KS_aring,
+ KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
+ KC(0x56), KS_ae,
+ KC(0x57), KS_oslash,
+ KC(0x58), KS_backslash, KS_asterisk, KS_grave,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x7c), KS_less, KS_greater, KS_backslash,
+};
+
+/* 005 German type 4 keyboard */
+const keysym_t sunkbd_keydesc_de[] = {
+ KC(0x0d), KS_Alt_L,
+ KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
+ KC(0x13), KS_Mode_switch,
+ KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
+ KC(0x20), KS_3, KS_section, KS_threesuperior,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_slash, KS_degree,
+ KC(0x25), KS_8, KS_parenleft, KS_grave,
+ KC(0x26), KS_9, KS_parenright, KS_apostrophe,
+ KC(0x27), KS_0, KS_equal, KS_bar,
+ KC(0x28), KS_ssharp, KS_question, KS_backslash,
+ KC(0x29), KS_dead_acute, KS_dead_grave,
+ KC(0x2a), KS_numbersign, KS_asciicircum, KS_at,
+ KC(0x3b), KS_z,
+ KC(0x40), KS_udiaeresis,
+ KC(0x41), KS_plus, KS_multiply, KS_asciitilde,
+ KC(0x4c), KS_Caps_Lock,
+ KC(0x56), KS_odiaeresis,
+ KC(0x57), KS_adiaeresis,
+ KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
+ KC(0x64), KS_y,
+ KC(0x6a), KS_m, KS_M, KS_mu,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Control_L,
+ KC(0x7c), KS_less, KS_greater,
+};
+
+/* 025 German type 5 keyboard */
+const keysym_t sunkbd5_keydesc_de[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
+ KC(0x20), KS_3, KS_section, KS_threesuperior,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_slash, KS_braceleft,
+ KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
+ KC(0x26), KS_9, KS_parenright, KS_bracketright,
+ KC(0x27), KS_0, KS_equal, KS_braceright,
+ KC(0x28), KS_ssharp, KS_question, KS_backslash,
+ KC(0x29), KS_dead_acute, KS_dead_grave,
+ KC(0x2a), KS_asciicircum, KS_degree,
+ KC(0x36), KS_q, KS_Q, KS_at,
+ KC(0x3b), KS_z,
+ KC(0x40), KS_udiaeresis,
+ KC(0x41), KS_plus, KS_multiply, KS_asciitilde,
+ KC(0x56), KS_odiaeresis,
+ KC(0x57), KS_adiaeresis,
+ KC(0x58), KS_numbersign, KS_apostrophe, KS_grave,
+ KC(0x64), KS_y,
+ KC(0x6a), KS_m, KS_M, KS_mu,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x7c), KS_less, KS_greater, KS_bar,
+};
+
+/* 006 Italian type 4 keyboard */
+const keysym_t sunkbd_keydesc_it[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
+ KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
+ KC(0x20), KS_3, KS_sterling, KS_threesuperior,
+ KC(0x23), KS_6, KS_ampersand, KS_notsign,
+ KC(0x24), KS_7, KS_slash,
+ KC(0x25), KS_8, KS_parenleft,
+ KC(0x26), KS_9, KS_parenright, KS_backslash,
+ KC(0x27), KS_0, KS_equal, KS_bar,
+ KC(0x28), KS_apostrophe, KS_question, KS_grave,
+ KC(0x29), KS_igrave, KS_asciicircum,
+ KC(0x2a), KS_ugrave, KS_section,
+ KC(0x40), KS_egrave, KS_eacute,
+ KC(0x41), KS_plus, KS_asterisk, KS_asciitilde,
+ KC(0x4c), KS_Caps_Lock,
+ KC(0x56), KS_ograve, KS_ccedilla, KS_at,
+ KC(0x57), KS_agrave, KS_degree, KS_numbersign,
+ KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Control_L,
+ KC(0x7c), KS_less, KS_greater,
+};
+
+/* 026 Italian type 5 keyboard */
+const keysym_t sunkbd5_keydesc_it[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1f), KS_2, KS_quotedbl,
+ KC(0x20), KS_3, KS_sterling,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_slash,
+ KC(0x25), KS_8, KS_parenleft, KS_braceleft,
+ KC(0x26), KS_9, KS_parenright, KS_braceright,
+ KC(0x27), KS_0, KS_equal,
+ KC(0x28), KS_apostrophe, KS_question, KS_grave,
+ KC(0x29), KS_igrave, KS_asciicircum,
+ KC(0x2a), KS_backslash, KS_bar,
+ KC(0x40), KS_egrave, KS_eacute, KS_bracketleft,
+ KC(0x41), KS_plus, KS_asterisk, KS_bracketright,
+ KC(0x56), KS_ograve, KS_ccedilla, KS_at,
+ KC(0x57), KS_agrave, KS_degree, KS_numbersign,
+ KC(0x58), KS_ugrave, KS_section, KS_asciitilde,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x7c), KS_less, KS_greater,
+};
+
+/* 007 Dutch type 4 keyboard */
+const keysym_t sunkbd_keydesc_nl[] = {
+ KC(0x0d), KS_Caps_Lock,
+ KC(0x0f), KS_backslash, KS_bar,
+ KC(0x1e), KS_1, KS_exclam, KS_onesuperior,
+ KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
+ KC(0x20), KS_3, KS_numbersign, KS_threesuperior,
+ KC(0x21), KS_4, KS_dollar, KS_onequarter,
+ KC(0x22), KS_5, KS_percent, KS_onehalf,
+ KC(0x23), KS_6, KS_ampersand, KS_threequarters,
+ KC(0x24), KS_7, KS_underscore, KS_sterling,
+ KC(0x25), KS_8, KS_parenleft, KS_braceleft,
+ KC(0x26), KS_9, KS_parenright, KS_braceright,
+ KC(0x27), KS_0, KS_apostrophe, KS_grave,
+ KC(0x28), KS_slash, KS_question,
+ KC(0x29), KS_degree, KS_dead_tilde, KS_dead_abovering,
+ KC(0x2a), KS_less, KS_greater,
+ KC(0x40), KS_dead_diaeresis,KS_dead_circumflex,
+ KC(0x41), KS_asterisk, KS_brokenbar, KS_asciitilde,
+ KC(0x4e), KS_s, KS_S, KS_ssharp,
+ KC(0x56), KS_plus, KS_plusminus,
+ KC(0x57), KS_dead_acute, KS_dead_grave,
+ KC(0x58), KS_at, KS_section, KS_notsign,
+ KC(0x64), KS_z, KS_Z, KS_guillemotleft,
+ KC(0x65), KS_x, KS_X, KS_guillemotright,
+ KC(0x66), KS_c, KS_C, KS_cent,
+ KC(0x6a), KS_m, KS_M, KS_mu,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_equal,
+ KC(0x77), KS_Mode_switch,
+ KC(0x7d), KS_bracketright,KS_bracketleft,
+};
+
+/* 027 Dutch type 5 keyboard */
+const keysym_t sunkbd5_keydesc_nl[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1e), KS_1, KS_exclam, KS_onesuperior,
+ KC(0x1f), KS_2, KS_quotedbl, KS_twosuperior,
+ KC(0x20), KS_3, KS_numbersign, KS_threesuperior,
+ KC(0x21), KS_4, KS_dollar, KS_onequarter,
+ KC(0x22), KS_5, KS_percent, KS_onehalf,
+ KC(0x23), KS_6, KS_ampersand, KS_threequarters,
+ KC(0x24), KS_7, KS_underscore, KS_sterling,
+ KC(0x25), KS_8, KS_parenleft, KS_braceleft,
+ KC(0x26), KS_9, KS_parenright, KS_braceright,
+ KC(0x27), KS_0, KS_apostrophe, KS_grave,
+ KC(0x28), KS_slash, KS_question, KS_backslash,
+ KC(0x29), KS_degree, KS_dead_tilde, KS_dead_abovering,
+ KC(0x2a), KS_at, KS_section, KS_notsign,
+ KC(0x40), KS_dead_diaeresis,KS_dead_circumflex,
+ KC(0x41), KS_asterisk, KS_bar, KS_asciitilde,
+ KC(0x4e), KS_s, KS_S, KS_ssharp,
+ KC(0x56), KS_plus, KS_plusminus,
+ KC(0x57), KS_dead_acute, KS_dead_grave,
+ KC(0x58), KS_less, KS_greater, KS_asciicircum,
+ KC(0x64), KS_z, KS_Z, KS_guillemotleft,
+ KC(0x65), KS_x, KS_X, KS_guillemotright,
+ KC(0x66), KS_c, KS_C, KS_cent,
+ KC(0x6a), KS_m, KS_M, KS_mu,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon, KS_hyphen,
+ KC(0x6d), KS_minus, KS_equal,
+ KC(0x7d), KS_bracketright,KS_bracketleft, KS_brokenbar,
+};
+
+/* 008 Norwegian type 4 keyboard */
+const keysym_t sunkbd_keydesc_no[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x0f), KS_asciitilde, KS_asciicircum,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_numbersign, KS_sterling,
+ KC(0x21), KS_4, KS_currency, KS_dollar,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_slash, KS_braceleft,
+ KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
+ KC(0x26), KS_9, KS_parenright, KS_bracketright,
+ KC(0x27), KS_0, KS_equal, KS_braceright,
+ KC(0x28), KS_plus, KS_question,
+ KC(0x29), KS_backslash, KS_dead_grave, KS_dead_acute,
+ KC(0x2a), KS_apostrophe, KS_asterisk, KS_grave,
+ KC(0x40), KS_aring,
+ KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
+ KC(0x4c), KS_Caps_Lock,
+ KC(0x56), KS_oslash,
+ KC(0x57), KS_ae,
+ KC(0x58), KS_bar, KS_section,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Control_L,
+ KC(0x7d), KS_less, KS_greater,
+};
+
+/* 028 Norwegian type 5 keyboard */
+const keysym_t sunkbd5_keydesc_no[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_numbersign, KS_sterling,
+ KC(0x21), KS_4, KS_currency, KS_dollar,
+ KC(0x22), KS_5, KS_percent, KS_asciitilde,
+ KC(0x23), KS_6, KS_ampersand, KS_asciicircum,
+ KC(0x24), KS_7, KS_slash, KS_braceleft,
+ KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
+ KC(0x26), KS_9, KS_parenright, KS_bracketright,
+ KC(0x27), KS_0, KS_equal, KS_braceright,
+ KC(0x28), KS_plus, KS_question,
+ KC(0x29), KS_backslash, KS_dead_grave, KS_dead_acute,
+ KC(0x2a), KS_bar, KS_section,
+ KC(0x40), KS_aring,
+ KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
+ KC(0x56), KS_oslash,
+ KC(0x57), KS_ae,
+ KC(0x58), KS_apostrophe, KS_asterisk, KS_grave,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x7d), KS_less, KS_greater,
+};
+
+/* 009 Portuguese type 4 keyboard */
+const keysym_t sunkbd_keydesc_pt[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_numbersign, KS_sterling,
+ KC(0x21), KS_4, KS_dollar, KS_section,
+ KC(0x23), KS_6, KS_ampersand, KS_notsign,
+ KC(0x24), KS_7, KS_slash,
+ KC(0x25), KS_8, KS_parenleft,
+ KC(0x26), KS_9, KS_parenright, KS_backslash,
+ KC(0x27), KS_0, KS_equal, KS_bar,
+ KC(0x28), KS_apostrophe, KS_question, KS_grave,
+ KC(0x29), KS_exclamdown, KS_questiondown,
+ KC(0x2a), KS_dead_tilde, KS_dead_circumflex,KS_asciicircum,
+ KC(0x40), KS_dead_diaeresis,KS_asterisk, KS_plus,
+ KC(0x41), KS_dead_acute, KS_dead_grave, KS_asciitilde,
+ KC(0x4c), KS_Caps_Lock,
+ KC(0x56), KS_ccedilla,
+ KC(0x57), KS_masculine, KS_ordfeminine,
+ KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Control_L,
+ KC(0x7d), KS_less, KS_greater,
+};
+
+/* 029 Portuguese type 4 keyboard */
+const keysym_t sunkbd5_keydesc_pt[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_numbersign, KS_sterling,
+ KC(0x21), KS_4, KS_dollar, KS_section,
+ KC(0x22), KS_5, KS_percent, KS_asciitilde,
+ KC(0x23), KS_6, KS_ampersand, KS_asciicircum,
+ KC(0x24), KS_7, KS_slash, KS_braceleft,
+ KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
+ KC(0x26), KS_9, KS_parenright, KS_bracketright,
+ KC(0x27), KS_0, KS_equal, KS_braceright,
+ KC(0x28), KS_apostrophe, KS_question, KS_grave,
+ KC(0x29), KS_guillemotleft,KS_guillemotright,
+ KC(0x2a), KS_backslash, KS_bar,
+ KC(0x40), KS_plus, KS_asterisk, KS_dead_diaeresis,
+ KC(0x41), KS_dead_acute, KS_dead_grave,
+ KC(0x56), KS_ccedilla,
+ KC(0x57), KS_masculine, KS_ordfeminine,
+ KC(0x58), KS_dead_tilde, KS_dead_circumflex,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x7d), KS_less, KS_greater,
+};
+
+/* 00a Spanish type 4 keyboard */
+const keysym_t sunkbd_keydesc_es[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x0f), KS_bracketright,KS_braceright, KS_guillemotright,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_hyphen, KS_numbersign,
+ KC(0x22), KS_5, KS_percent, KS_degree,
+ KC(0x23), KS_6, KS_ampersand, KS_notsign,
+ KC(0x24), KS_7, KS_slash,
+ KC(0x25), KS_8, KS_parenleft,
+ KC(0x26), KS_9, KS_parenright, KS_backslash,
+ KC(0x27), KS_0, KS_equal, KS_bar,
+ KC(0x28), KS_apostrophe, KS_question, KS_grave,
+ KC(0x29), KS_exclamdown, KS_questiondown,
+ KC(0x2a), KS_ccedilla,
+ KC(0x3e), KS_o, KS_O, KS_masculine,
+ KC(0x40), KS_dead_grave, KS_dead_circumflex,KS_asciicircum,
+ KC(0x41), KS_plus, KS_asterisk, KS_asciitilde,
+ KC(0x4c), KS_Caps_Lock,
+ KC(0x4d), KS_a, KS_A, KS_ordfeminine,
+ KC(0x56), KS_ntilde,
+ KC(0x57), KS_dead_acute, KS_dead_diaeresis,
+ KC(0x58), KS_bracketleft, KS_braceleft, KS_guillemotleft,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Control_L,
+ KC(0x7d), KS_less, KS_greater,
+};
+
+/* 02a Spanish type 5 keyboard */
+const keysym_t sunkbd5_keydesc_es[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1e), KS_1, KS_exclam, KS_bar,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_hyphen, KS_numbersign,
+ KC(0x21), KS_4, KS_dollar, KS_asciicircum,
+ KC(0x22), KS_5, KS_percent, KS_asciitilde,
+ KC(0x23), KS_6, KS_ampersand, KS_notsign,
+ KC(0x24), KS_7, KS_slash,
+ KC(0x25), KS_8, KS_parenleft,
+ KC(0x26), KS_9, KS_parenright,
+ KC(0x27), KS_0, KS_equal,
+ KC(0x28), KS_apostrophe, KS_question, KS_grave,
+ KC(0x29), KS_exclamdown, KS_questiondown,
+ KC(0x2a), KS_masculine, KS_ordfeminine, KS_backslash,
+ KC(0x40), KS_dead_grave, KS_dead_circumflex,KS_bracketleft,
+ KC(0x41), KS_plus, KS_asterisk, KS_bracketright,
+ KC(0x56), KS_ntilde,
+ KC(0x57), KS_dead_acute, KS_dead_diaeresis,KS_braceleft,
+ KC(0x58), KS_ccedilla, KS_Ccedilla, KS_braceright,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x7d), KS_less, KS_greater,
+};
+
+/* 00b Swedish/Finnish type 4 keyboard */
+const keysym_t sunkbd_keydesc_sv[] = {
+ KC(0x0d), KS_Multi_key,
+ KC(0x0f), KS_asciitilde, KS_asciicircum,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_numbersign, KS_sterling,
+ KC(0x21), KS_4, KS_currency, KS_dollar,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_slash, KS_braceleft,
+ KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
+ KC(0x26), KS_9, KS_parenright, KS_bracketright,
+ KC(0x27), KS_0, KS_equal, KS_braceright,
+ KC(0x28), KS_plus, KS_question, KS_backslash,
+ KC(0x29), KS_dead_acute, KS_dead_grave,
+ KC(0x2a), KS_apostrophe, KS_asterisk, KS_grave,
+ KC(0x40), KS_aring,
+ KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
+ KC(0x43), KS_Mode_switch,
+ KC(0x4c), KS_Caps_Lock,
+ KC(0x56), KS_odiaeresis,
+ KC(0x57), KS_adiaeresis,
+ KC(0x58), KS_section, KS_onehalf,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Control_L,
+ KC(0x7c), KS_less, KS_greater, KS_bar,
+};
+
+const keysym_t sunkbd_keydesc_sv_nodead[] = {
+ KC(0x29), KS_apostrophe, KS_grave,
+ KC(0x41), KS_diaeresis, KS_asciicircum, KS_asciitilde,
+};
+
+/* 02b Swedish type 5 keyboard */
+const keysym_t sunkbd5_keydesc_sv[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x0f), KS_asciitilde, KS_asciicircum,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_numbersign, KS_sterling,
+ KC(0x21), KS_4, KS_currency, KS_dollar,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_slash, KS_braceleft,
+ KC(0x25), KS_8, KS_parenleft, KS_bracketleft,
+ KC(0x26), KS_9, KS_parenright, KS_bracketright,
+ KC(0x27), KS_0, KS_equal, KS_braceright,
+ KC(0x28), KS_plus, KS_question, KS_backslash,
+ KC(0x29), KS_dead_acute, KS_dead_grave,
+ KC(0x2a), KS_section, KS_onehalf,
+ KC(0x40), KS_aring,
+ KC(0x41), KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
+ KC(0x43), KS_Multi_key,
+ KC(0x4c), KS_Control_L,
+ KC(0x56), KS_odiaeresis,
+ KC(0x57), KS_adiaeresis,
+ KC(0x58), KS_apostrophe, KS_asterisk, KS_grave,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Caps_Lock,
+ KC(0x7c), KS_less, KS_greater, KS_bar,
+};
+
+/* 00c Swiss-French type 4 keyboard */
+const keysym_t sunkbd_keydesc_sf[] = {
+ KC(0x0d), KS_Multi_key,
+ KC(0x0f), KS_greater, KS_braceright,
+ KC(0x1e), KS_1, KS_plus, KS_exclam,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_asterisk, KS_numbersign,
+ KC(0x21), KS_4, KS_ccedilla, KS_cent,
+ KC(0x22), KS_5, KS_percent, KS_asciitilde,
+ KC(0x23), KS_6, KS_ampersand, KS_section,
+ KC(0x24), KS_7, KS_slash, KS_bar,
+ KC(0x25), KS_8, KS_parenleft, KS_degree,
+ KC(0x26), KS_9, KS_parenright, KS_backslash,
+ KC(0x27), KS_0, KS_equal, KS_asciicircum,
+ KC(0x28), KS_apostrophe, KS_question, KS_grave,
+ KC(0x29), KS_dead_circumflex,KS_dead_grave,
+ KC(0x2a), KS_dollar, KS_dead_tilde, KS_sterling,
+ KC(0x3b), KS_z,
+ KC(0x40), KS_egrave, KS_udiaeresis,
+ KC(0x41), KS_dead_diaeresis,KS_dead_acute,
+ KC(0x43), KS_Mode_switch,
+ KC(0x4c), KS_Caps_Lock,
+ KC(0x56), KS_eacute, KS_odiaeresis,
+ KC(0x57), KS_agrave, KS_adiaeresis,
+ KC(0x58), KS_less, KS_braceleft,
+ KC(0x64), KS_y,
+ KC(0x6a), KS_m, KS_M, KS_mu,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Control_L,
+ KC(0x7c), KS_bracketright,KS_bracketleft, KS_backslash,
+};
+
+/* 02c Swiss-French type 5 keyboard */
+const keysym_t sunkbd5_keydesc_sf[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1e), KS_1, KS_plus, KS_bar,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_asterisk, KS_numbersign,
+ KC(0x21), KS_4, KS_ccedilla, KS_asciicircum,
+ KC(0x22), KS_5, KS_percent, KS_asciitilde,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_slash,
+ KC(0x25), KS_8, KS_parenleft,
+ KC(0x26), KS_9, KS_parenright,
+ KC(0x27), KS_0, KS_equal, KS_grave,
+ KC(0x28), KS_apostrophe, KS_question, KS_dead_acute,
+ KC(0x29), KS_dead_circumflex,KS_dead_grave,KS_dead_tilde,
+ KC(0x2a), KS_dollar, KS_degree,
+ KC(0x3b), KS_z,
+ KC(0x40), KS_egrave, KS_udiaeresis, KS_bracketleft,
+ KC(0x41), KS_dead_diaeresis,KS_exclam, KS_bracketright,
+ KC(0x56), KS_eacute, KS_odiaeresis,
+ KC(0x57), KS_agrave, KS_adiaeresis, KS_braceleft,
+ KC(0x58), KS_dollar, KS_sterling, KS_braceright,
+ KC(0x64), KS_y,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x7c), KS_less, KS_greater, KS_backslash,
+};
+
+/* 00d Swiss-German type 4 keyboard */
+const keysym_t sunkbd_keydesc_sg[] = {
+ KC(0x0d), KS_Multi_key,
+ KC(0x0f), KS_greater, KS_braceright,
+ KC(0x1e), KS_1, KS_plus, KS_exclam,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_asterisk, KS_numbersign,
+ KC(0x21), KS_4, KS_ccedilla, KS_cent,
+ KC(0x22), KS_5, KS_percent, KS_asciitilde,
+ KC(0x23), KS_6, KS_ampersand, KS_section,
+ KC(0x24), KS_7, KS_slash, KS_bar,
+ KC(0x25), KS_8, KS_parenleft, KS_degree,
+ KC(0x26), KS_9, KS_parenright, KS_backslash,
+ KC(0x27), KS_0, KS_equal, KS_asciicircum,
+ KC(0x28), KS_apostrophe, KS_question, KS_grave,
+ KC(0x29), KS_dead_circumflex,KS_dead_grave,
+ KC(0x2a), KS_dollar, KS_dead_tilde, KS_sterling,
+ KC(0x3b), KS_z,
+ KC(0x40), KS_udiaeresis, KS_egrave,
+ KC(0x41), KS_dead_diaeresis,KS_dead_acute,
+ KC(0x43), KS_Mode_switch,
+ KC(0x4c), KS_Caps_Lock,
+ KC(0x56), KS_odiaeresis, KS_eacute,
+ KC(0x57), KS_adiaeresis, KS_agrave,
+ KC(0x58), KS_less, KS_braceleft,
+ KC(0x64), KS_y,
+ KC(0x6a), KS_m, KS_M, KS_mu,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x77), KS_Control_L,
+ KC(0x7c), KS_bracketright,KS_bracketleft, KS_backslash,
+};
+
+/* 02d Swiss-German type 5 keyboard */
+const keysym_t sunkbd5_keydesc_sg[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1e), KS_1, KS_plus, KS_bar,
+ KC(0x1f), KS_2, KS_quotedbl, KS_at,
+ KC(0x20), KS_3, KS_asterisk, KS_numbersign,
+ KC(0x21), KS_4, KS_ccedilla, KS_asciicircum,
+ KC(0x22), KS_5, KS_percent, KS_asciitilde,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_slash,
+ KC(0x25), KS_8, KS_parenleft,
+ KC(0x26), KS_9, KS_parenright,
+ KC(0x27), KS_0, KS_equal, KS_grave,
+ KC(0x28), KS_apostrophe, KS_question, KS_dead_acute,
+ KC(0x29), KS_dead_circumflex,KS_dead_grave,KS_dead_tilde,
+ KC(0x2a), KS_dollar, KS_degree,
+ KC(0x3b), KS_z,
+ KC(0x40), KS_udiaeresis, KS_egrave, KS_bracketleft,
+ KC(0x41), KS_dead_diaeresis,KS_exclam, KS_bracketright,
+ KC(0x56), KS_odiaeresis, KS_eacute,
+ KC(0x57), KS_adiaeresis, KS_agrave, KS_braceleft,
+ KC(0x58), KS_dollar, KS_sterling, KS_braceright,
+ KC(0x64), KS_y,
+ KC(0x6b), KS_comma, KS_semicolon,
+ KC(0x6c), KS_period, KS_colon,
+ KC(0x6d), KS_minus, KS_underscore,
+ KC(0x7c), KS_less, KS_greater, KS_backslash,
+};
+
+/* 00e UK English type 4 keyboard */
+const keysym_t sunkbd_keydesc_uk[] = {
+ KC(0x1e), KS_1, KS_exclam, KS_bar,
+ KC(0x21), KS_3, KS_sterling, KS_numbersign,
+ KC(0x28), KS_minus, KS_underscore, KS_notsign,
+ KC(0x43), KS_Mode_switch,
+};
+
+/* 02e UK English type 5 keyboard */
+const keysym_t sunkbd5_keydesc_uk[] = {
+ KC(0x0d), KS_Mode_switch,
+ KC(0x1f), KS_2, KS_quotedbl,
+ KC(0x20), KS_3, KS_sterling,
+ KC(0x2a), KS_grave, KS_notsign, KS_brokenbar,
+ KC(0x57), KS_apostrophe, KS_at,
+ KC(0x58), KS_numbersign, KS_asciitilde,
+ KC(0x7c), KS_backslash, KS_bar,
+};
+
+/* 031 Japan type 5 keyboard */
+const keysym_t sunkbd5_keydesc_jp[] = {
+ KC(0x1f), KS_2, KS_quotedbl,
+ KC(0x23), KS_6, KS_ampersand,
+ KC(0x24), KS_7, KS_apostrophe,
+ KC(0x25), KS_8, KS_parenleft,
+ KC(0x26), KS_9, KS_parenright,
+ KC(0x27), KS_0,
+ KC(0x28), KS_minus, KS_equal,
+ KC(0x29), KS_asciicircum, KS_asciitilde,
+ KC(0x2a), KS_yen, KS_bar,
+ KC(0x40), KS_at, KS_grave,
+ KC(0x41), KS_bracketleft, KS_braceleft,
+ KC(0x56), KS_semicolon, KS_plus,
+ KC(0x57), KS_colon, KS_asterisk,
+ KC(0x58), KS_bracketright,KS_braceright,
+ KC(0x7c), KS_backslash, KS_underscore,
+};
+
+#define KBD_MAP(name, base, map) \
+ { name, base, sizeof(map)/sizeof(keysym_t), map }
+
+/* Supported type 4 keyboard layouts */
+const struct wscons_keydesc sunkbd_keydesctab[] = {
+ KBD_MAP(KB_US, 0, sunkbd_keydesc_us),
+ KBD_MAP(KB_BE, KB_US, sunkbd_keydesc_befr),
+ KBD_MAP(KB_DE, KB_US, sunkbd_keydesc_de),
+ KBD_MAP(KB_DK, KB_US, sunkbd_keydesc_dk),
+ KBD_MAP(KB_ES, KB_US, sunkbd_keydesc_es),
+ KBD_MAP(KB_FR, KB_US, sunkbd_keydesc_befr),
+ KBD_MAP(KB_IT, KB_US, sunkbd_keydesc_it),
+ KBD_MAP(KB_NL, KB_US, sunkbd_keydesc_nl),
+ KBD_MAP(KB_NO, KB_US, sunkbd_keydesc_no),
+ KBD_MAP(KB_PT, KB_US, sunkbd_keydesc_pt),
+ KBD_MAP(KB_SF, KB_US, sunkbd_keydesc_sf),
+ KBD_MAP(KB_SG, KB_US, sunkbd_keydesc_sg),
+ KBD_MAP(KB_SV, KB_US, sunkbd_keydesc_sv),
+ KBD_MAP(KB_SV | KB_NODEAD, KB_SV, sunkbd_keydesc_sv_nodead),
+ KBD_MAP(KB_UK, KB_US, sunkbd_keydesc_uk),
+ {0, 0, 0, 0},
+};
+
+/* Supported type 5 keyboard layouts */
+const struct wscons_keydesc sunkbd5_keydesctab[] = {
+ KBD_MAP(KB_US, 0, sunkbd_keydesc_us),
+ KBD_MAP(KB_DE, KB_US, sunkbd5_keydesc_de),
+ KBD_MAP(KB_DK, KB_US, sunkbd5_keydesc_dk),
+ KBD_MAP(KB_ES, KB_US, sunkbd5_keydesc_es),
+ KBD_MAP(KB_FR, KB_US, sunkbd5_keydesc_fr),
+ KBD_MAP(KB_IT, KB_US, sunkbd5_keydesc_it),
+ KBD_MAP(KB_JP, KB_US, sunkbd5_keydesc_jp),
+ KBD_MAP(KB_NL, KB_US, sunkbd5_keydesc_nl),
+ KBD_MAP(KB_NO, KB_US, sunkbd5_keydesc_no),
+ KBD_MAP(KB_PT, KB_US, sunkbd5_keydesc_pt),
+ KBD_MAP(KB_SF, KB_US, sunkbd5_keydesc_sf),
+ KBD_MAP(KB_SG, KB_US, sunkbd5_keydesc_sg),
+ KBD_MAP(KB_SV, KB_US, sunkbd5_keydesc_sv),
+ KBD_MAP(KB_SV | KB_NODEAD, KB_SV, sunkbd_keydesc_sv_nodead),
+ KBD_MAP(KB_UK, KB_US, sunkbd5_keydesc_uk),
+ {0, 0, 0, 0},
+};
+
+/*
+ * Keyboard layout to ID table
+ * References:
+ * Sun Type 5 Keyboard Supplement Installation Guide, May 1992
+ * http://docs.sun.com/db/doc/806-6642/6jfipqu57?a=view
+ * http://jp.sunsolve.sun.com/handbook_pub/Systems/SSVygr/INPUT_Compact1_Keyboard.html
+ */
+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 */
+ KB_JP, /* 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 */
+
+ /* Not affected range */
+ -1, /* 040 */
+ -1, /* 041 */
+ -1, /* 042 */
+ -1, /* 043 */
+ -1, /* 044 */
+ -1, /* 045 */
+ -1, /* 046 */
+ -1, /* 047 */
+ -1, /* 048 */
+ -1, /* 049 */
+ -1, /* 04a */
+ -1, /* 04b */
+ -1, /* 04c */
+ -1, /* 04d */
+ -1, /* 04e */
+ -1, /* 04f */
+
+ /* ``Compact-1'' layouts */
+ KB_US, /* 050 USA */
+ KB_US, /* 051 UNIX */
+ KB_FR, /* 052 France */
+ KB_DK, /* 053 Denmark */
+ KB_DE, /* 054 Germany */
+ KB_IT, /* 055 Italy */
+ KB_NL, /* 056 The Netherlands */
+ KB_NO, /* 057 Norway */
+ KB_PT, /* 058 Portugal */
+ KB_ES, /* 059 Spain */
+ KB_SV, /* 05a Sweden */
+ KB_SF, /* 05b Switzerland/French */
+ KB_SG, /* 05c Switzerland/German */
+ KB_UK, /* 05d Great Britain */
+ -1, /* 05e Korea */
+ -1, /* 05f Taiwan */
+ KB_JP, /* 060 Japan */
+ -1, /* 061 Canada/French */
+};
+
+struct wskbd_mapdata sunkbd_keymapdata = {
+ sunkbd_keydesctab,
+#ifdef SUNKBD_LAYOUT
+ SUNKBD_LAYOUT,
+#else
+ KB_US,
+#endif
+};
+
+struct wskbd_mapdata sunkbd5_keymapdata = {
+ sunkbd5_keydesctab,
+#ifdef SUNKBD5_LAYOUT
+ SUNKBD5_LAYOUT,
+#else
+ KB_US,
+#endif
+};
diff --git a/sys/dev/sun/sunkbdvar.h b/sys/dev/sun/sunkbdvar.h
index 8b960a64632..8349fdf6598 100644
--- a/sys/dev/sun/sunkbdvar.h
+++ b/sys/dev/sun/sunkbdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunkbdvar.h,v 1.8 2003/06/02 19:08:58 jason Exp $ */
+/* $OpenBSD: sunkbdvar.h,v 1.9 2005/05/14 15:25:20 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -31,6 +31,29 @@
*
*/
+struct sunkbd_softc {
+ struct device sc_dev;
+
+ int (*sc_sendcmd)(void *, u_int8_t *, u_int);
+
+ int sc_leds; /* LED status */
+ int sc_id; /* keyboard type */
+ u_int8_t sc_kbdstate; /* keyboard state */
+ int sc_click; /* click state */
+ int sc_layout; /* current layout */
+
+ int sc_bellactive, sc_belltimeout;
+ struct timeout sc_bellto;
+
+ struct device *sc_wskbddev;
+};
+
+extern struct wskbd_accessops sunkbd_accessops;
+
+void sunkbd_bellstop(void *);
+void sunkbd_decode(u_int8_t, u_int *, int *);
+void sunkbd_raw(struct sunkbd_softc *, u_int8_t);
+
extern const struct wscons_keydesc sunkbd_keydesctab[];
extern struct wskbd_mapdata sunkbd_keymapdata;
extern const struct wscons_keydesc sunkbd5_keydesctab[];