summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/ohci.c
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-04-07 10:09:23 +0000
committerjoe <joe@FreeBSD.org>2002-04-07 10:09:23 +0000
commit6a645c6e2601ba6e07c40248e79953c62682ebdf (patch)
tree1afa1d0254759e9356d9d54f33cf359f34ae6d0d /sys/dev/usb/ohci.c
parentef34de0ca4ec054f667bd3a4cc93d59af0fb3723 (diff)
downloadFreeBSD-src-6a645c6e2601ba6e07c40248e79953c62682ebdf.zip
FreeBSD-src-6a645c6e2601ba6e07c40248e79953c62682ebdf.tar.gz
MFNetBSD: ohci.c (1.104), ohcireg.h (1.28)
date: 2001/09/28 23:57:21; author: augustss; Reenable RHSC interrupt after one second so hot plugging works. (From OpenBSD.)
Diffstat (limited to 'sys/dev/usb/ohci.c')
-rw-r--r--sys/dev/usb/ohci.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 58cdf0a..bb3e2ae 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -191,6 +191,7 @@ Static int ohci_str(usb_string_descriptor_t *, int, const 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);
@@ -357,6 +358,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:
@@ -1101,6 +1106,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--;
@@ -1125,6 +1132,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",
OpenPOWER on IntegriCloud