summaryrefslogtreecommitdiff
path: root/sys/arch/vax/dec
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-07-31 18:50:14 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-07-31 18:50:14 +0000
commit8b2e0425b19407b023cce5d3a4ef0a7588eaf0a5 (patch)
tree4097906021002086b88d57df0bd07c5f629adc73 /sys/arch/vax/dec
parente5ff3e0208f82066c5f4f8618886f55faaf68ac9 (diff)
Move the relevant mouse defines from lk201.h to dzms.c and get rid of it;
it is too confusing to keep lk201.h and lk201reg.h.
Diffstat (limited to 'sys/arch/vax/dec')
-rw-r--r--sys/arch/vax/dec/dzms.c97
-rw-r--r--sys/arch/vax/dec/lk201.h141
2 files changed, 57 insertions, 181 deletions
diff --git a/sys/arch/vax/dec/dzms.c b/sys/arch/vax/dec/dzms.c
index b0c77532867..d6992456fbb 100644
--- a/sys/arch/vax/dec/dzms.c
+++ b/sys/arch/vax/dec/dzms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dzms.c,v 1.5 2006/07/29 17:06:25 miod Exp $ */
+/* $OpenBSD: dzms.c,v 1.6 2006/07/31 18:50:13 miod Exp $ */
/* $NetBSD: dzms.c,v 1.1 2000/12/02 17:03:55 ragge Exp $ */
/*
@@ -60,11 +60,36 @@
#include <vax/qbus/dzvar.h>
#include <vax/dec/dzkbdvar.h>
-#include <vax/dec/lk201.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsmousevar.h>
+/*
+ * Command characters for the mouse.
+ */
+#define MOUSE_SELF_TEST 'T'
+#define MOUSE_INCREMENTAL 'R'
+
+/*
+ * Mouse output bits.
+ *
+ * MOUSE_START_FRAME Start of report frame bit.
+ * MOUSE_X_SIGN Sign bit for X.
+ * MOUSE_Y_SIGN Sign bit for Y.
+ * MOUSE_X_OFFSET X offset to start cursor at.
+ * MOUSE_Y_OFFSET Y offset to start cursor at.
+ */
+#define MOUSE_START_FRAME 0x80
+#define MOUSE_X_SIGN 0x10
+#define MOUSE_Y_SIGN 0x08
+
+/*
+ * Definitions for mouse buttons
+ */
+#define RIGHT_BUTTON 0x01
+#define MIDDLE_BUTTON 0x02
+#define LEFT_BUTTON 0x04
+
struct dzms_softc { /* driver status information */
struct device dzms_dev; /* required first: base device */
struct dz_linestate *dzms_ls;
@@ -79,9 +104,8 @@ struct dzms_softc { /* driver status information */
struct device *sc_wsmousedev;
};
-static int dzms_match(struct device *, struct cfdata *, void *);
-static void dzms_attach(struct device *, struct device *, void *);
-static int dzms_input(void *, int);
+int dzms_match(struct device *, struct cfdata *, void *);
+void dzms_attach(struct device *, struct device *, void *);
struct cfattach dzms_ca = {
sizeof(struct dzms_softc), (cfmatch_t)dzms_match, dzms_attach,
@@ -91,9 +115,9 @@ struct cfdriver lkms_cd = {
NULL, "lkms", DV_DULL
};
-static int dzms_enable(void *);
-static int dzms_ioctl(void *, u_long, caddr_t, int, struct proc *);
-static void dzms_disable(void *);
+int dzms_enable(void *);
+int dzms_ioctl(void *, u_long, caddr_t, int, struct proc *);
+void dzms_disable(void *);
const struct wsmouse_accessops dzms_accessops = {
dzms_enable,
@@ -101,16 +125,15 @@ const struct wsmouse_accessops dzms_accessops = {
dzms_disable,
};
-static int
-dzms_match(parent, cf, aux)
- struct device *parent;
- struct cfdata *cf;
- void *aux;
+int dzms_input(void *, int);
+
+int
+dzms_match(struct device *parent, struct cfdata *cf, void *aux)
{
struct dzkm_attach_args *daa = aux;
#define DZCF_LINE 0
-#define DZCF_LINE_DEFAULT 0
+#define DZCF_LINE_DEFAULT 1
/* Exact match is better than wildcard. */
if (cf->cf_loc[DZCF_LINE] == daa->daa_line)
@@ -123,10 +146,8 @@ dzms_match(parent, cf, aux)
return 0;
}
-static void
-dzms_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
+void
+dzms_attach(struct device *parent, struct device *self, void *aux)
{
struct dz_softc *dz = (void *)parent;
struct dzms_softc *dzms = (void *)self;
@@ -149,9 +170,8 @@ dzms_attach(parent, self, aux)
dzms->sc_wsmousedev = config_found(self, &a, wsmousedevprint);
}
-static int
-dzms_enable(v)
- void *v;
+int
+dzms_enable(void *v)
{
struct dzms_softc *sc = v;
@@ -172,34 +192,32 @@ dzms_enable(v)
return 0;
}
-static void
-dzms_disable(v)
- void *v;
+void
+dzms_disable(void *v)
{
struct dzms_softc *sc = v;
sc->sc_enabled = 0;
}
-static int
-dzms_ioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
+int
+dzms_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
{
- if (cmd == WSMOUSEIO_GTYPE) {
- *(u_int *)data = WSMOUSE_TYPE_VSXXX;
+#if 0
+ struct dzms_softc *sc = v;
+#endif
+
+ switch (cmd) {
+ case WSMOUSEIO_GTYPE:
+ *(int *)data = WSMOUSE_TYPE_VSXXX;
return 0;
}
+
return -1;
}
-static int
-dzms_input(vsc, data)
- void *vsc;
- int data;
+int
+dzms_input(void *vsc, int data)
{
struct dzms_softc *sc = vsc;
@@ -209,7 +227,7 @@ dzms_input(vsc, data)
if (sc->sc_selftest == 0)
wakeup(dzms_enable);
}
- return(1);
+ return (1);
}
#define WSMS_BUTTON1 0x01
@@ -247,6 +265,5 @@ dzms_input(vsc, data)
sc->dx, sc->dy, 0, WSMOUSE_INPUT_DELTA);
}
- return(1);
+ return (1);
}
-
diff --git a/sys/arch/vax/dec/lk201.h b/sys/arch/vax/dec/lk201.h
deleted file mode 100644
index d457ab5c954..00000000000
--- a/sys/arch/vax/dec/lk201.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/* $OpenBSD: lk201.h,v 1.4 2006/07/29 17:06:25 miod Exp $ */
-/* $NetBSD: lk201.h,v 1.7 1999/03/19 18:34:01 ad Exp $ */
-
-
-/*
- * Ascii values of command keys.
- */
-#define KBD_TAB '\t'
-#define KBD_DEL 127
-#define KBD_RET '\r'
-
-/*
- * Define "hardware-independent" codes for the control, shift, meta and
- * function keys. Codes start after the last 7-bit ASCII code (127)
- * and are assigned in an arbitrary order.
- */
-#define KBD_NOKEY 128
-
-#define KBD_F1 201
-#define KBD_F2 202
-#define KBD_F3 203
-#define KBD_F4 204
-#define KBD_F5 205
-#define KBD_F6 206
-#define KBD_F7 207
-#define KBD_F8 208
-#define KBD_F9 209
-#define KBD_F10 210
-#define KBD_F11 211
-#define KBD_F12 212
-#define KBD_F13 213
-#define KBD_F14 214
-#define KBD_HELP 215
-#define KBD_DO 216
-#define KBD_F17 217
-#define KBD_F18 218
-#define KBD_F19 219
-#define KBD_F20 220
-
-#define KBD_FIND 221
-#define KBD_INSERT 222
-#define KBD_REMOVE 223
-#define KBD_SELECT 224
-#define KBD_PREVIOUS 225
-#define KBD_NEXT 226
-
-#define KBD_KP_ENTER 227
-#define KBD_KP_F1 228
-#define KBD_KP_F2 229
-#define KBD_KP_F3 230
-#define KBD_KP_F4 231
-#define KBD_LEFT 232
-#define KBD_RIGHT 233
-#define KBD_DOWN 234
-#define KBD_UP 235
-
-#define KBD_CONTROL 236
-#define KBD_SHIFT 237
-#define KBD_CAPSLOCK 238
-#define KBD_ALTERNATE 239
-
-
-
-/*
- * Definitions for the Keyboard and mouse.
- */
-/*
- * Special key values.
- */
-#define KEY_R_SHIFT 0xab
-#define KEY_SHIFT 0xae
-#define KEY_CONTROL 0xaf
-#define KEY_CAPSLOCK 0xb0
-#define KEY_R_ALT 0xb2
-#define KEY_UP 0xb3
-#define KEY_REPEAT 0xb4
-#define KEY_F1 0x56
-#define KEY_COMMAND KEY_F1
-
-/*
- * Lk201/301 keyboard
- */
-#define LK_UPDOWN 0x86 /* bits for setting lk201 modes */
-#define LK_AUTODOWN 0x82
-#define LK_DOWN 0x80
-#define LK_DEFAULTS 0xd3 /* reset mode settings */
-#define LK_AR_ENABLE 0xe3 /* global auto repeat enable */
-#define LK_CL_ENABLE 0x1b /* keyclick enable */
-#define LK_KBD_ENABLE 0x8b /* keyboard enable */
-#define LK_BELL_ENABLE 0x23 /* the bell */
-#define LK_LED_ENABLE 0x13 /* light led */
-#define LK_LED_DISABLE 0x11 /* turn off led */
-#define LK_RING_BELL 0xa7 /* ring keyboard bell */
-#define LED_1 0x81 /* led bits */
-#define LED_2 0x82
-#define LED_3 0x84
-#define LED_4 0x88
-#define LED_ALL 0x8f
-#define LK_HELP 0x7c /* help key */
-#define LK_DO 0x7d /* do key */
-#define LK_KDOWN_ERROR 0x3d /* key down on powerup error */
-#define LK_POWER_ERROR 0x3e /* keyboard failure on pwrup tst*/
-#define LK_OUTPUT_ERROR 0xb5 /* keystrokes lost during inhbt */
-#define LK_INPUT_ERROR 0xb6 /* garbage command to keyboard */
-#define LK_LOWEST 0x56 /* lowest significant keycode */
-
-/* max volume is 0, lowest is 0x7 */
-#define LK_PARAM_VOLUME(v) (0x80|((v)&0x7))
-
-/* mode command details */
-#define LK_CMD_MODE(m,div) ((m)|((div)<<3))
-
-
-/*
- * Command characters for the mouse.
- */
-#define MOUSE_SELF_TEST 'T'
-#define MOUSE_INCREMENTAL 'R'
-
-/*
- * Mouse output bits.
- *
- * MOUSE_START_FRAME Start of report frame bit.
- * MOUSE_X_SIGN Sign bit for X.
- * MOUSE_Y_SIGN Sign bit for Y.
- * MOUSE_X_OFFSET X offset to start cursor at.
- * MOUSE_Y_OFFSET Y offset to start cursor at.
- */
-#define MOUSE_START_FRAME 0x80
-#define MOUSE_X_SIGN 0x10
-#define MOUSE_Y_SIGN 0x08
-
-/*
- * Definitions for mouse buttons
- */
-#define EVENT_LEFT_BUTTON 0x01
-#define EVENT_MIDDLE_BUTTON 0x02
-#define EVENT_RIGHT_BUTTON 0x03
-#define RIGHT_BUTTON 0x01
-#define MIDDLE_BUTTON 0x02
-#define LEFT_BUTTON 0x04