summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-05-13 14:54:45 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-05-13 14:54:45 +0000
commit9c45654ec54ef38ba5a6ba6e877c6eee5d310eca (patch)
treeb3fe7afa9883477e54249803dac34df8767e99e9 /sys
parenta22028cc5e999a5bc0c77f0bd9df404006700224 (diff)
Separate button boxens from keyboards in the HIL device list.
hilkbd will still match both, but will neither do the auto-layout dance nor attach as console for button boxens.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/hil/devlist2h.awk4
-rw-r--r--sys/dev/hil/hildevs12
-rw-r--r--sys/dev/hil/hildevs.h3
-rw-r--r--sys/dev/hil/hilkbd.c34
4 files changed, 31 insertions, 22 deletions
diff --git a/sys/dev/hil/devlist2h.awk b/sys/dev/hil/devlist2h.awk
index 8c702ac02e8..4663efae4b9 100644
--- a/sys/dev/hil/devlist2h.awk
+++ b/sys/dev/hil/devlist2h.awk
@@ -1,5 +1,5 @@
#! /usr/bin/awk -f
-# $OpenBSD: devlist2h.awk,v 1.2 2005/05/07 22:39:43 miod Exp $
+# $OpenBSD: devlist2h.awk,v 1.3 2005/05/13 14:54:44 miod Exp $
#
# Copyright (c) 2003, Miodrag Vallat.
# All rights reserved.
@@ -41,7 +41,7 @@ NR == 1 {
next
}
-$1 == "keyboard" || $1 == "mouse" || $1 == "idmodule" {
+$1 == "keyboard" || $1 == "mouse" || $1 == "idmodule" || $1 == "buttonbox" {
if (header == 0) {
printf("const struct hildevice hildevs[] = {\n")
diff --git a/sys/dev/hil/hildevs b/sys/dev/hil/hildevs
index 2a6a2a2efa8..169ac8eb53f 100644
--- a/sys/dev/hil/hildevs
+++ b/sys/dev/hil/hildevs
@@ -1,4 +1,4 @@
-$OpenBSD: hildevs,v 1.1 2003/02/11 19:39:30 miod Exp $
+$OpenBSD: hildevs,v 1.2 2005/05/13 14:54:44 miod Exp $
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -26,12 +26,12 @@ $OpenBSD: hildevs,v 1.1 2003/02/11 19:39:30 miod Exp $
*
*/
-keyboard 00 1f Keypad
-keyboard 2f 2f LPFK Button box
-keyboard 30 33 Button box # 31-33 rumored not to exist
+buttonbox 00 1f Keypad
+buttonbox 2f 2f LPFK Button box
+buttonbox 30 33 Button box # 31-33 rumored not to exist
idmodule 34 34 ID module
-keyboard 35 3f Button box
-keyboard 5c 5f Barcode reader
+buttonbox 35 3f Button box
+buttonbox 5c 5f Barcode reader
mouse 60 60 Single knob
mouse 61 61 Nine knob
mouse 62 67 Quadrature
diff --git a/sys/dev/hil/hildevs.h b/sys/dev/hil/hildevs.h
index c4c93e1c30c..1a371d64c94 100644
--- a/sys/dev/hil/hildevs.h
+++ b/sys/dev/hil/hildevs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hildevs.h,v 1.3 2003/02/26 20:22:04 miod Exp $ */
+/* $OpenBSD: hildevs.h,v 1.4 2005/05/13 14:54:44 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -50,6 +50,7 @@ struct hil_attach_args {
#define HIL_DEVICE_KEYBOARD 1
#define HIL_DEVICE_IDMODULE 2
#define HIL_DEVICE_MOUSE 3
+#define HIL_DEVICE_BUTTONBOX 4
/* Common softc part for hil devices */
struct hildev_softc {
diff --git a/sys/dev/hil/hilkbd.c b/sys/dev/hil/hilkbd.c
index c487cb842d0..31697455608 100644
--- a/sys/dev/hil/hilkbd.c
+++ b/sys/dev/hil/hilkbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hilkbd.c,v 1.11 2005/05/07 22:42:30 miod Exp $ */
+/* $OpenBSD: hilkbd.c,v 1.12 2005/05/13 14:54:44 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -134,7 +134,8 @@ hilkbdprobe(struct device *parent, void *match, void *aux)
{
struct hil_attach_args *ha = aux;
- if (ha->ha_type != HIL_DEVICE_KEYBOARD)
+ if (ha->ha_type != HIL_DEVICE_KEYBOARD &&
+ ha->ha_type != HIL_DEVICE_BUTTONBOX)
return (0);
return (1);
@@ -155,19 +156,22 @@ hilkbdattach(struct device *parent, struct device *self, void *aux)
bcopy(ha->ha_info, sc->hd_info, ha->ha_infolen);
sc->hd_fn = hilkbd_callback;
- /*
- * Determine the keyboard language configuration, but don't
- * override a user-specified setting.
- */
- layoutcode = ha->ha_id & (MAXHILKBDLAYOUT - 1);
+ if (ha->ha_type == HIL_DEVICE_KEYBOARD) {
+ /*
+ * Determine the keyboard language configuration, but don't
+ * override a user-specified setting.
+ */
+ layoutcode = ha->ha_id & (MAXHILKBDLAYOUT - 1);
#ifndef HILKBD_LAYOUT
- if (layoutcode < MAXHILKBDLAYOUT &&
- hilkbd_layouts[layoutcode] != -1)
- hilkbd_keymapdata.layout =
- hilkbd_keymapdata_ps2.layout = hilkbd_layouts[layoutcode];
+ if (layoutcode < MAXHILKBDLAYOUT &&
+ hilkbd_layouts[layoutcode] != -1)
+ hilkbd_keymapdata.layout =
+ hilkbd_keymapdata_ps2.layout =
+ hilkbd_layouts[layoutcode];
#endif
- printf(", layout %x", layoutcode);
+ printf(", layout %x", layoutcode);
+ }
/*
* Interpret the identification bytes, if any
@@ -195,7 +199,11 @@ hilkbdattach(struct device *parent, struct device *self, void *aux)
timeout_set(&sc->sc_rawrepeat_ch, hilkbd_rawrepeat, sc);
#endif
- a.console = hilkbd_is_console(ha->ha_console);
+ /* Do not consider button boxes as console devices. */
+ if (ha->ha_type == HIL_DEVICE_BUTTONBOX)
+ a.console = 0;
+ else
+ a.console = hilkbd_is_console(ha->ha_console);
a.keymap = ps2 ? &hilkbd_keymapdata_ps2 : &hilkbd_keymapdata;
a.accessops = &hilkbd_accessops;
a.accesscookie = sc;