summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2001-10-25 14:36:12 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2001-10-25 14:36:12 +0000
commit5ca5ce3da23e324b45cae187fdc9cd3e818ffd20 (patch)
tree8020aa68928ca73898ee81afc9e4ba2616a1b7a1 /sys/dev
parent7b870919d0d7c9cb70e9d439338e25230062faa2 (diff)
If a usb keyboard is detached, check if the intrpipe is still active.
Console keyboard will still be active and must be shut down for successful detach. This change and previous change to wskbd.c both from NetBSD. Tested by miod@ and myself. Hot plug/unplug on USB console keyboard now works on macppc. (this and wskbd.c may be errata candidates).
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ukbd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 3e70d8673de..8eb4cad48fc 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ukbd.c,v 1.7 2001/07/25 04:54:37 mickey Exp $ */
+/* $OpenBSD: ukbd.c,v 1.8 2001/10/25 14:36:11 drahn Exp $ */
/* $NetBSD: ukbd.c,v 1.66 2001/04/06 22:54:15 augustss Exp $ */
/*
@@ -453,6 +453,7 @@ ukbd_enable(void *v, int on)
/* Disable interrupts. */
usbd_abort_pipe(sc->sc_intrpipe);
usbd_close_pipe(sc->sc_intrpipe);
+ sc->sc_intrpipe = NULL;
}
sc->sc_enabled = on;
@@ -514,6 +515,13 @@ USB_DETACH(ukbd)
if (sc->sc_wskbddev != NULL)
rv = config_detach(sc->sc_wskbddev, flags);
+ /* The console keyboard does not get a disable call, so check pipe. */
+ if (sc->sc_intrpipe != NULL) {
+ usbd_abort_pipe(sc->sc_intrpipe);
+ usbd_close_pipe(sc->sc_intrpipe);
+ sc->sc_intrpipe = NULL;
+ }
+
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
USBDEV(sc->sc_dev));