summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-15 11:41:49 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-15 11:41:49 +0000
commitd5374dd01d2f6af90f30df7bb1c09645b012fa87 (patch)
treef4aff9e964677bbed37e0f27ce4b5660ddfefc53 /sys/dev
parent35246e47ec18c704be9c8cc1633d3fd0cf84269c (diff)
Replace the USB_USE_SOFTINTR macro with __HAVE_GENERIC_SOFT_INTTERUPTS
(which was used to define USB_USE_SOFTINTR). No binary changes. ok dlg, mk.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ehci.c14
-rw-r--r--sys/dev/usb/ohci.c14
-rw-r--r--sys/dev/usb/ohcivar.h6
-rw-r--r--sys/dev/usb/uhci.c14
-rw-r--r--sys/dev/usb/uhcivar.h6
-rw-r--r--sys/dev/usb/usb.c22
-rw-r--r--sys/dev/usb/usb_port.h8
-rw-r--r--sys/dev/usb/usbdi.h8
-rw-r--r--sys/dev/usb/usbdivar.h6
-rw-r--r--sys/dev/usb/usbf_subr.c16
-rw-r--r--sys/dev/usb/usbfvar.h6
11 files changed, 37 insertions, 83 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index 19ed8f70ec8..9ab378fb69f 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci.c,v 1.76 2007/06/14 12:58:09 mbalmer Exp $ */
+/* $OpenBSD: ehci.c,v 1.77 2007/06/15 11:41:47 mbalmer Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
@@ -684,12 +684,12 @@ ehci_softintr(void *v)
timeout_add(&sc->sc_tmo_intrlist, hz);
}
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
if (sc->sc_softwake) {
sc->sc_softwake = 0;
wakeup(&sc->sc_softwake);
}
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
sc->sc_bus.intr_context--;
}
@@ -2501,13 +2501,13 @@ ehci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
* has run.
*/
s = splusb();
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
sc->sc_softwake = 1;
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
usb_schedsoftintr(&sc->sc_bus);
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
tsleep(&sc->sc_softwake, PZERO, "ehciab", 0);
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
/*
* Step 5: Remove any vestiges of the xfer from the hardware.
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 1e30d54c019..f9da679893f 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.83 2007/06/14 12:58:09 mbalmer Exp $ */
+/* $OpenBSD: ohci.c,v 1.84 2007/06/15 11:41:48 mbalmer Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -1474,12 +1474,12 @@ ohci_softintr(void *v)
}
}
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
if (sc->sc_softwake) {
sc->sc_softwake = 0;
wakeup(&sc->sc_softwake);
}
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
sc->sc_bus.intr_context--;
DPRINTFN(10,("ohci_softintr: done:\n"));
@@ -2220,13 +2220,13 @@ ohci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
*/
usb_delay_ms(opipe->pipe.device->bus, 20); /* Hardware finishes in 1ms */
s = splusb();
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
sc->sc_softwake = 1;
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
usb_schedsoftintr(&sc->sc_bus);
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
tsleep(&sc->sc_softwake, PZERO, "ohciab", 0);
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
splx(s);
/*
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h
index 1ab29845a3e..5a6aba59b65 100644
--- a/sys/dev/usb/ohcivar.h
+++ b/sys/dev/usb/ohcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohcivar.h,v 1.24 2007/06/12 16:26:36 mbalmer Exp $ */
+/* $OpenBSD: ohcivar.h,v 1.25 2007/06/15 11:41:48 mbalmer Exp $ */
/* $NetBSD: ohcivar.h,v 1.32 2003/02/22 05:24:17 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -107,9 +107,9 @@ typedef struct ohci_softc {
u_int8_t sc_addr; /* device address */
u_int8_t sc_conf; /* device configuration */
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
char sc_softwake;
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
ohci_soft_ed_t *sc_freeeds;
ohci_soft_td_t *sc_freetds;
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index afb00e99c6e..3a69c6c43ec 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.59 2007/06/14 12:58:09 mbalmer Exp $ */
+/* $OpenBSD: uhci.c,v 1.60 2007/06/15 11:41:48 mbalmer Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -1255,12 +1255,12 @@ uhci_softintr(void *v)
uhci_check_intr(sc, ii);
}
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
if (sc->sc_softwake) {
sc->sc_softwake = 0;
wakeup(&sc->sc_softwake);
}
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
sc->sc_bus.intr_context--;
}
@@ -1926,14 +1926,14 @@ uhci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
*/
usb_delay_ms(upipe->pipe.device->bus, 2); /* Hardware finishes in 1ms */
s = splusb();
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
sc->sc_softwake = 1;
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
usb_schedsoftintr(&sc->sc_bus);
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
DPRINTFN(1,("uhci_abort_xfer: tsleep\n"));
tsleep(&sc->sc_softwake, PZERO, "uhciab", 0);
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
splx(s);
/*
diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h
index 072883cd3d1..13a0592c409 100644
--- a/sys/dev/usb/uhcivar.h
+++ b/sys/dev/usb/uhcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhcivar.h,v 1.18 2007/06/12 16:26:36 mbalmer Exp $ */
+/* $OpenBSD: uhcivar.h,v 1.19 2007/06/15 11:41:48 mbalmer Exp $ */
/* $NetBSD: uhcivar.h,v 1.36 2002/12/31 00:39:11 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.14 1999/11/17 22:33:42 n_hibma Exp $ */
@@ -162,9 +162,9 @@ typedef struct uhci_softc {
u_int8_t sc_saved_sof;
u_int16_t sc_saved_frnum;
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
char sc_softwake;
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
char sc_isreset;
char sc_suspend;
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 432511573ab..3b1a55a61af 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.c,v 1.55 2007/06/14 10:11:16 mbalmer Exp $ */
+/* $OpenBSD: usb.c,v 1.56 2007/06/15 11:41:48 mbalmer Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
@@ -195,7 +195,6 @@ usb_attach(struct device *parent, struct device *self, void *aux)
ue.u.ue_ctrlr.ue_bus = sc->sc_dev.dv_unit;
usb_add_event(USB_EVENT_CTRLR_ATTACH, &ue);
-#ifdef USB_USE_SOFTINTR
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
/* XXX we should have our own level */
sc->sc_bus->soft = softintr_establish(IPL_SOFTNET,
@@ -205,9 +204,6 @@ usb_attach(struct device *parent, struct device *self, void *aux)
sc->sc_dying = 1;
return;
}
-#else
- timeout_set(&sc->sc_bus->softi, NULL, NULL);
-#endif
#endif
err = usbd_new_device(&sc->sc_dev, sc->sc_bus, 0, speed, 0,
@@ -778,23 +774,15 @@ void
usb_schedsoftintr(usbd_bus_handle bus)
{
DPRINTFN(10,("usb_schedsoftintr: polling=%d\n", bus->use_polling));
-#ifdef USB_USE_SOFTINTR
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
if (bus->use_polling) {
bus->methods->soft_intr(bus);
} else {
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
softintr_schedule(bus->soft);
-#else
- if (!timeout_pending(&bus->softi)) {
- timeout_del(&bus->softi);
- timeout_set(&bus->softi, bus->methods->soft_intr, bus);
- timeout_add(&bus->softi, 0);
- }
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
}
#else
bus->methods->soft_intr(bus);
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
}
int
@@ -845,15 +833,11 @@ usb_detach(struct device *self, int flags)
usbd_finish();
-#ifdef USB_USE_SOFTINTR
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
if (sc->sc_bus->soft != NULL) {
softintr_disestablish(sc->sc_bus->soft);
sc->sc_bus->soft = NULL;
}
-#else
- timeout_del(&sc->sc_bus->softi);
-#endif
#endif
ue.u.ue_ctrlr.ue_bus = sc->sc_dev.dv_unit;
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index 550e8007b05..32d28bff049 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_port.h,v 1.94 2007/06/14 12:58:09 mbalmer Exp $ */
+/* $OpenBSD: usb_port.h,v 1.95 2007/06/15 11:41:48 mbalmer Exp $ */
/* $NetBSD: usb_port.h,v 1.62 2003/02/15 18:33:30 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -46,10 +46,4 @@
* Macro's to cope with the differences between operating systems.
*/
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
-#define USB_USE_SOFTINTR
-#else
-#undef USB_USE_SOFTINTR
-#endif
-
#endif /* _USB_PORT_H */
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index e2fdc47e53b..ba995871b1b 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.h,v 1.27 2007/06/12 16:26:37 mbalmer Exp $ */
+/* $OpenBSD: usbdi.h,v 1.28 2007/06/15 11:41:48 mbalmer Exp $ */
/* $NetBSD: usbdi.h,v 1.62 2002/07/11 21:14:35 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */
@@ -253,14 +253,10 @@ struct usb_attach_arg {
#define UMATCH_NONE 0
/* XXX Perhaps USB should have its own levels? */
-#ifdef USB_USE_SOFTINTR
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
#define splusb splsoftnet
#else
-#define splusb splsoftclock
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
-#else
#define splusb splbio
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
#define splhardusb splbio
#define IPL_USB IPL_BIO
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
index 1c65a5bb8ed..82fc1035e91 100644
--- a/sys/dev/usb/usbdivar.h
+++ b/sys/dev/usb/usbdivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdivar.h,v 1.31 2007/06/13 11:31:33 mbalmer Exp $ */
+/* $OpenBSD: usbdivar.h,v 1.32 2007/06/15 11:41:48 mbalmer Exp $ */
/* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */
@@ -124,12 +124,8 @@ struct usbd_bus {
#define USBREV_2_0 4
#define USBREV_STR { "unknown", "pre 1.0", "1.0", "1.1", "2.0" }
-#ifdef USB_USE_SOFTINTR
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
void *soft; /* soft interrupt cookie */
-#else
- struct timeout softi;
-#endif
#endif
bus_dma_tag_t dmatag; /* DMA tag */
};
diff --git a/sys/dev/usb/usbf_subr.c b/sys/dev/usb/usbf_subr.c
index e0fdb4ba71c..6971f1d8582 100644
--- a/sys/dev/usb/usbf_subr.c
+++ b/sys/dev/usb/usbf_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbf_subr.c,v 1.8 2007/06/14 19:18:49 deraadt Exp $ */
+/* $OpenBSD: usbf_subr.c,v 1.9 2007/06/15 11:41:48 mbalmer Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -1066,7 +1066,6 @@ usbf_transfer_complete(usbf_xfer_handle xfer)
usbf_status
usbf_softintr_establish(struct usbf_bus *bus)
{
-#ifdef USB_USE_SOFTINTR
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
KASSERT(bus->soft == NULL);
/* XXX we should have our own level */
@@ -1074,9 +1073,6 @@ usbf_softintr_establish(struct usbf_bus *bus)
bus->methods->soft_intr, bus);
if (bus->soft == NULL)
return USBF_INVAL;
-#else
- timeout_set(&bus->softi, NULLL, NULL);
-#endif
#endif
return USBF_NORMAL_COMPLETION;
}
@@ -1084,17 +1080,9 @@ usbf_softintr_establish(struct usbf_bus *bus)
void
usbf_schedsoftintr(struct usbf_bus *bus)
{
-#ifdef USB_USE_SOFTINTR
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
softintr_schedule(bus->soft);
#else
- if (!timeout_pending(&bus->softi)) {
- timeout_del(&bus->softi);
- timeout_set(&bus->softi, bus->methods->soft_intr, bus);
- timeout_add(&bus->softi, 0);
- }
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
-#else
bus->methods->soft_intr(bus);
-#endif /* USB_USE_SOFTINTR */
+#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
}
diff --git a/sys/dev/usb/usbfvar.h b/sys/dev/usb/usbfvar.h
index 9a4e9dc3418..e8dfe5cb18c 100644
--- a/sys/dev/usb/usbfvar.h
+++ b/sys/dev/usb/usbfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbfvar.h,v 1.5 2007/06/13 06:25:03 mbalmer Exp $ */
+/* $OpenBSD: usbfvar.h,v 1.6 2007/06/15 11:41:48 mbalmer Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -101,12 +101,8 @@ struct usbf_bus {
/* Filled by usbf driver */
struct usbf_softc *usbfctl;
int intr_context;
-#ifdef USB_USE_SOFTINTR
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
void *soft; /* soft interrupt cookie */
-#else
- struct timeout softi; /* timeout handle */
-#endif
#endif
bus_dma_tag_t dmatag; /* DMA tag */
};