summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/ohci_pci.c6
-rw-r--r--sys/dev/usb/ohci.c13
-rw-r--r--sys/dev/usb/ohcivar.h6
3 files changed, 22 insertions, 3 deletions
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c
index 07ddacc581f..77aed422458 100644
--- a/sys/dev/pci/ohci_pci.c
+++ b/sys/dev/pci/ohci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci_pci.c,v 1.13 2001/08/25 10:13:30 art Exp $ */
+/* $OpenBSD: ohci_pci.c,v 1.14 2001/09/15 20:57:33 drahn Exp $ */
/* $NetBSD: ohci_pci.c,v 1.9 1999/05/20 09:52:35 augustss Exp $ */
/*
@@ -138,6 +138,10 @@ ohci_pci_attach(parent, self, aux)
return;
}
+#if defined(__OpenBSD__)
+ timeout_set(&sc->sc.sc_tmo_rhsc, ohci_rhsc_enable, sc);
+#endif
+
intrstr = pci_intr_string(pc, ih);
sc->sc_ih = pci_intr_establish(pc, ih, IPL_USB, ohci_intr, sc,
sc->sc.sc_bus.bdev.dv_xname);
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index f367b7a3430..23d05571eba 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.22 2001/06/13 07:43:36 deraadt Exp $ */
+/* $OpenBSD: ohci.c,v 1.23 2001/09/15 20:57:33 drahn Exp $ */
/* $NetBSD: ohci.c,v 1.102 2001/04/01 15:00:29 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -1135,6 +1135,10 @@ ohci_intr1(ohci_softc_t *sc)
* on until the port has been reset.
*/
ohci_rhsc_able(sc, 0);
+#if defined (__OpenBSD__)
+ /* Do not allow RHSC interrupts > 1 per second */
+ timeout_add(&sc->sc_tmo_rhsc, hz);
+#endif
}
sc->sc_bus.intr_context--;
@@ -1147,6 +1151,13 @@ ohci_intr1(ohci_softc_t *sc)
}
void
+ohci_rhsc_enable(void *v_sc)
+{
+ ohci_softc_t *sc = v_sc;
+ ohci_rhsc_able(sc, 1);
+}
+
+void
ohci_rhsc_able(ohci_softc_t *sc, int on)
{
DPRINTFN(4, ("ohci_rhsc_able: on=%d\n", on));
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h
index 7c94ff33186..a8795edbd24 100644
--- a/sys/dev/usb/ohcivar.h
+++ b/sys/dev/usb/ohcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohcivar.h,v 1.12 2001/05/03 02:20:32 aaron Exp $ */
+/* $OpenBSD: ohcivar.h,v 1.13 2001/09/15 20:57:33 drahn Exp $ */
/* $NetBSD: ohcivar.h,v 1.27 2001/02/21 10:19:30 minoura Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -133,6 +133,9 @@ typedef struct ohci_softc {
device_ptr_t sc_child;
+#if defined(__OpenBSD__)
+ struct timeout sc_tmo_rhsc;
+#endif
char sc_dying;
} ohci_softc_t;
@@ -142,5 +145,6 @@ int ohci_intr(void *);
int ohci_detach(ohci_softc_t *, int);
int ohci_activate(device_ptr_t, enum devact);
#endif
+Static void ohci_rhsc_enable(void *sc);
#define MS_TO_TICKS(ms) ((ms) * hz / 1000)