summaryrefslogtreecommitdiff
path: root/sys/dev/hpc
diff options
context:
space:
mode:
authoruwe <uwe@NetBSD.org>2006-03-14 22:59:32 +0000
committeruwe <uwe@NetBSD.org>2006-03-14 22:59:32 +0000
commit50e028653dd8247a3d013bdb5d54f4e6df04bdaa (patch)
tree23fac55fbfcbf3be8267b497899d23d16ebdd667 /sys/dev/hpc
parent766d042b2215b6687f393f3f4a653413966bba61 (diff)
Support WSDISPLAY_COMPAT_RAWKBD so that this keyboard is usable under X.
Diffstat (limited to 'sys/dev/hpc')
-rw-r--r--sys/dev/hpc/hpf1275a_tty.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/sys/dev/hpc/hpf1275a_tty.c b/sys/dev/hpc/hpf1275a_tty.c
index 93460f1d302..1b7404e6147 100644
--- a/sys/dev/hpc/hpf1275a_tty.c
+++ b/sys/dev/hpc/hpf1275a_tty.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hpf1275a_tty.c,v 1.4 2005/12/18 23:57:07 uwe Exp $ */
+/* $NetBSD: hpf1275a_tty.c,v 1.5 2006/03/14 22:59:32 uwe Exp $ */
/*
* Copyright (c) 2004 Valeriy E. Ushakov
@@ -28,7 +28,9 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.4 2005/12/18 23:57:07 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.5 2006/03/14 22:59:32 uwe Exp $");
+
+#include "opt_wsdisplay_compat.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -61,7 +63,9 @@ struct hpf1275a_softc {
struct tty *sc_tp; /* back reference to the tty */
struct device *sc_wskbd; /* wskbd child */
int sc_enabled;
-
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+ int sc_rawkbd;
+#endif
};
@@ -262,6 +266,9 @@ hpf1275a_attach(struct device *parent, struct device *self, void *aux)
wska.accesscookie = sc;
sc->sc_enabled = 0;
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+ sc->sc_rawkbd = 0;
+#endif
sc->sc_wskbd = config_found(self, &wska, wskbddevprint);
}
@@ -373,7 +380,17 @@ hpf1275a_input(int c, struct tty *tp)
}
KASSERT(sc->sc_wskbd != NULL);
- wskbd_input(sc->sc_wskbd, type, xtscan);
+
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+ if (sc->sc_rawkbd) {
+ u_char data[16];
+ int n;
+
+ n = pckbd_encode(type, xtscan, data);
+ wskbd_rawinput(sc->sc_wskbd, data, n);
+ } else
+#endif
+ wskbd_input(sc->sc_wskbd, type, xtscan);
return (0);
}
@@ -403,7 +420,9 @@ static int
hpf1275a_wskbd_ioctl(void *self, u_long cmd, caddr_t data, int flag,
struct lwp *l)
{
- /* struct hpf1275a_softc *sc = (struct hpf1275a_softc *)self; */
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+ struct hpf1275a_softc *sc = (struct hpf1275a_softc *)self;
+#endif
switch (cmd) {
case WSKBDIO_GTYPE:
@@ -414,6 +433,12 @@ hpf1275a_wskbd_ioctl(void *self, u_long cmd, caddr_t data, int flag,
*(int *)data = 0; /* this keyboard has no leds */
return (0);
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+ case WSKBDIO_SETMODE:
+ sc->sc_rawkbd = (*(int *)data == WSKBD_RAW);
+ return (0);
+#endif
+
default:
return (EPASSTHROUGH);
}