diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sun/sunkbd.c | 22 | ||||
-rw-r--r-- | sys/dev/sun/sunkbdvar.h | 4 |
2 files changed, 24 insertions, 2 deletions
diff --git a/sys/dev/sun/sunkbd.c b/sys/dev/sun/sunkbd.c index 572db74e998..4ad9e80bc9e 100644 --- a/sys/dev/sun/sunkbd.c +++ b/sys/dev/sun/sunkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunkbd.c,v 1.21 2005/11/11 16:44:51 miod Exp $ */ +/* $OpenBSD: sunkbd.c,v 1.22 2009/01/11 15:53:58 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -57,6 +57,7 @@ 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_rawrepeat(void *); void sunkbd_setleds(void *, int); struct wskbd_accessops sunkbd_accessops = { @@ -66,6 +67,13 @@ struct wskbd_accessops sunkbd_accessops = { }; void +sunkbd_attach(struct sunkbd_softc *sc, struct wskbddev_attach_args *waa) +{ + sc->sc_wskbddev = config_found((struct device *)sc, waa, + wskbddevprint); +} + +void sunkbd_bell(struct sunkbd_softc *sc, u_int period, u_int pitch, u_int volume) { int ticks, s; @@ -142,6 +150,18 @@ sunkbd_getleds(struct sunkbd_softc *sc) return (sc->sc_leds); } +void +sunkbd_input(struct sunkbd_softc *sc, u_int8_t *buf, u_int buflen) +{ + u_int type; + int value; + + while (buflen-- != 0) { + sunkbd_decode(*buf++, &type, &value); + wskbd_input(sc->sc_wskbddev, type, value); + } +} + int sunkbd_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) { diff --git a/sys/dev/sun/sunkbdvar.h b/sys/dev/sun/sunkbdvar.h index e904f7a1707..912d276ac40 100644 --- a/sys/dev/sun/sunkbdvar.h +++ b/sys/dev/sun/sunkbdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sunkbdvar.h,v 1.10 2005/11/11 16:44:51 miod Exp $ */ +/* $OpenBSD: sunkbdvar.h,v 1.11 2009/01/11 15:53:58 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -50,8 +50,10 @@ struct sunkbd_softc { extern struct wskbd_accessops sunkbd_accessops; +void sunkbd_attach(struct sunkbd_softc *, struct wskbddev_attach_args *); void sunkbd_bellstop(void *); void sunkbd_decode(u_int8_t, u_int *, int *); +void sunkbd_input(struct sunkbd_softc *, u_int8_t *, u_int); void sunkbd_raw(struct sunkbd_softc *, u_int8_t); int sunkbd_setclick(struct sunkbd_softc *, int); |