summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/ukbd.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 7869b7aca1c..e2d292b4130 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ukbd.c,v 1.18 2003/05/19 04:17:53 nate Exp $ */
-/* $NetBSD: ukbd.c,v 1.82 2002/07/11 21:14:30 augustss Exp $ */
+/* $OpenBSD: ukbd.c,v 1.19 2003/07/05 16:56:45 nate Exp $ */
+/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -188,6 +188,7 @@ struct ukbd_softc {
char sc_rep[MAXKEYS];
#endif /* defined(WSDISPLAY_COMPAT_RAWKBD) */
+ int sc_spl;
int sc_polling;
int sc_npollchar;
u_int16_t sc_pollchars[MAXKEYS];
@@ -384,7 +385,6 @@ ukbd_activate(device_ptr_t self, enum devact act)
switch (act) {
case DVACT_ACTIVATE:
return (EOPNOTSUPP);
- break;
case DVACT_DEACTIVATE:
if (sc->sc_wskbddev != NULL)
@@ -710,7 +710,6 @@ void
ukbd_cngetc(void *v, u_int *type, int *data)
{
struct ukbd_softc *sc = v;
- int s;
int c;
int broken;
@@ -727,7 +726,6 @@ ukbd_cngetc(void *v, u_int *type, int *data)
broken = 0;
DPRINTFN(0,("ukbd_cngetc: enter\n"));
- s = splusb();
sc->sc_polling = 1;
while(sc->sc_npollchar <= 0)
usbd_dopoll(sc->sc_hdev.sc_parent->sc_iface);
@@ -738,7 +736,6 @@ ukbd_cngetc(void *v, u_int *type, int *data)
sc->sc_npollchar * sizeof(u_int16_t));
*type = c & RELEASE ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
*data = c & CODEMASK;
- splx(s);
DPRINTFN(0,("ukbd_cngetc: return 0x%02x\n", c));
if (broken)
ukbd_cnpollc(v, 0);
@@ -753,7 +750,13 @@ ukbd_cnpollc(void *v, int on)
DPRINTFN(2,("ukbd_cnpollc: sc=%p on=%d\n", v, on));
usbd_interface2device_handle(sc->sc_hdev.sc_parent->sc_iface, &dev);
- if (on) pollenter++; else pollenter--;
+ if (on) {
+ sc->sc_spl = splusb();
+ pollenter++;
+ } else {
+ splx(sc->sc_spl);
+ pollenter--;
+ }
usbd_set_polling(dev, on);
}