summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>2001-09-28 23:57:21 +0000
committeraugustss <augustss@NetBSD.org>2001-09-28 23:57:21 +0000
commit37583aadfc501118d0d08faae683bf48c7a9e0d2 (patch)
tree95b1107b378c9d8af7288c261659bb2b9ebceba9 /sys/dev
parentc5a4cc1291214c522f9909fcb6be0bca32842530 (diff)
Reenable RHSC interrupt after one second so hot plugging works.
(From OpenBSD.)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ohci.c17
-rw-r--r--sys/dev/usb/ohcivar.h4
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 25ab5b54805..af9845546e2 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci.c,v 1.103 2001/09/11 07:00:19 augustss Exp $ */
+/* $NetBSD: ohci.c,v 1.104 2001/09/28 23:57:21 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
/*
@@ -204,6 +204,7 @@ Static int ohci_str(usb_string_descriptor_t *, int, char *);
Static void ohci_timeout(void *);
Static void ohci_rhsc_able(ohci_softc_t *, int);
+Static void ohci_rhsc_enable(void *);
Static void ohci_close_pipe(usbd_pipe_handle, ohci_soft_ed_t *);
Static void ohci_abort_xfer(usbd_xfer_handle, usbd_status);
@@ -370,6 +371,8 @@ ohci_detach(struct ohci_softc *sc, int flags)
if (rv != 0)
return (rv);
+ usb_uncallout(sc->sc_tmo_rhsc, ohci_rhsc_enable, sc);
+
#if defined(__NetBSD__) || defined(__OpenBSD__)
powerhook_disestablish(sc->sc_powerhook);
shutdownhook_disestablish(sc->sc_shutdownhook);
@@ -861,6 +864,8 @@ ohci_init(ohci_softc_t *sc)
sc->sc_shutdownhook = shutdownhook_establish(ohci_shutdown, sc);
#endif
+ usb_callout_init(sc->sc_tmo_rhsc);
+
return (USBD_NORMAL_COMPLETION);
bad5:
@@ -1134,6 +1139,8 @@ ohci_intr1(ohci_softc_t *sc)
* on until the port has been reset.
*/
ohci_rhsc_able(sc, 0);
+ /* Do not allow RHSC interrupts > 1 per second */
+ usb_callout(sc->sc_tmo_rhsc, hz, ohci_rhsc_enable, sc);
}
sc->sc_bus.intr_context--;
@@ -1158,6 +1165,14 @@ ohci_rhsc_able(ohci_softc_t *sc, int on)
}
}
+void
+ohci_rhsc_enable(void *v_sc)
+{
+ ohci_softc_t *sc = v_sc;
+
+ ohci_rhsc_able(sc, 1);
+}
+
#ifdef OHCI_DEBUG
char *ohci_cc_strs[] = {
"NO_ERROR",
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h
index 65ed87a7b83..8570aa49ba7 100644
--- a/sys/dev/usb/ohcivar.h
+++ b/sys/dev/usb/ohcivar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ohcivar.h,v 1.27 2001/02/21 10:19:30 minoura Exp $ */
+/* $NetBSD: ohcivar.h,v 1.28 2001/09/28 23:57:21 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $ */
/*
@@ -130,6 +130,8 @@ typedef struct ohci_softc {
u_int sc_overrun_cnt;
struct timeval sc_overrun_ntc;
+ usb_callout_t sc_tmo_rhsc;
+
device_ptr_t sc_child;
char sc_dying;