summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-11-04 19:14:11 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-11-04 19:14:11 +0000
commit977663b99170667667569e24c3cc3c783721c5d2 (patch)
tree074971fd3c83c1872e970f2ad03edf724c909540 /sys/dev/usb
parent6c3b6a695dfbbd617cb55229859fc54028fa1dc0 (diff)
Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.
ok jsing@, miod@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/ehci.c12
-rw-r--r--sys/dev/usb/ohci.c8
-rw-r--r--sys/dev/usb/ohcivar.h4
-rw-r--r--sys/dev/usb/uhci.c8
-rw-r--r--sys/dev/usb/uhcivar.h4
-rw-r--r--sys/dev/usb/usb.c11
-rw-r--r--sys/dev/usb/usb_port.h8
-rw-r--r--sys/dev/usb/usbdi.h11
-rw-r--r--sys/dev/usb/usbdivar.h5
-rw-r--r--sys/dev/usb/usbf_subr.c10
-rw-r--r--sys/dev/usb/usbfvar.h4
11 files changed, 14 insertions, 71 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index 890ef32b821..3b2274ca27d 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci.c,v 1.103 2009/10/13 19:33:17 pirofti Exp $ */
+/* $OpenBSD: ehci.c,v 1.104 2009/11/04 19:14:10 kettenis Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
@@ -672,12 +672,10 @@ ehci_softintr(void *v)
timeout_add_sec(&sc->sc_tmo_intrlist, 1);
}
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
if (sc->sc_softwake) {
sc->sc_softwake = 0;
wakeup(&sc->sc_softwake);
}
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
sc->sc_bus.intr_context--;
}
@@ -2795,13 +2793,9 @@ ehci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
* has run.
*/
s = splusb();
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
sc->sc_softwake = 1;
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
usb_schedsoftintr(&sc->sc_bus);
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
tsleep(&sc->sc_softwake, PZERO, "ehciab", 0);
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
/*
* Step 5: Remove any vestiges of the xfer from the hardware.
@@ -2957,13 +2951,9 @@ ehci_abort_isoc_xfer(usbd_xfer_handle xfer, usbd_status status)
splx(s);
s = splusb();
-#ifdef USB_USE_SOFTINTR
sc->sc_softwake = 1;
-#endif /* USB_USE_SOFTINTR */
usb_schedsoftintr(&sc->sc_bus);
-#ifdef USB_USE_SOFTINTR
tsleep(&sc->sc_softwake, PZERO, "ehciab", 0);
-#endif /* USB_USE_SOFTINTR */
splx(s);
#ifdef DIAGNOSTIC
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index e402cf7c9fa..5a58262dcc1 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.92 2009/10/13 19:33:17 pirofti Exp $ */
+/* $OpenBSD: ohci.c,v 1.93 2009/11/04 19:14:10 kettenis 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 $ */
@@ -1470,12 +1470,10 @@ ohci_softintr(void *v)
}
}
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
if (sc->sc_softwake) {
sc->sc_softwake = 0;
wakeup(&sc->sc_softwake);
}
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
sc->sc_bus.intr_context--;
DPRINTFN(10,("ohci_softintr: done:\n"));
@@ -2213,13 +2211,9 @@ 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 __HAVE_GENERIC_SOFT_INTERRUPTS
sc->sc_softwake = 1;
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
usb_schedsoftintr(&sc->sc_bus);
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
tsleep(&sc->sc_softwake, PZERO, "ohciab", 0);
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
splx(s);
/*
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h
index f17fdf820fe..27b2a6fb596 100644
--- a/sys/dev/usb/ohcivar.h
+++ b/sys/dev/usb/ohcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohcivar.h,v 1.27 2009/10/13 19:33:17 pirofti Exp $ */
+/* $OpenBSD: ohcivar.h,v 1.28 2009/11/04 19:14:10 kettenis 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 $ */
@@ -100,9 +100,7 @@ typedef struct ohci_softc {
u_int8_t sc_addr; /* device address */
u_int8_t sc_conf; /* device configuration */
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
char sc_softwake;
-#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 8afa70119bf..58c24368ad3 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.72 2009/10/13 19:33:17 pirofti Exp $ */
+/* $OpenBSD: uhci.c,v 1.73 2009/11/04 19:14:10 kettenis 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 $ */
@@ -1251,12 +1251,10 @@ uhci_softintr(void *v)
uhci_check_intr(sc, ii);
}
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
if (sc->sc_softwake) {
sc->sc_softwake = 0;
wakeup(&sc->sc_softwake);
}
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
sc->sc_bus.intr_context--;
}
@@ -1923,14 +1921,10 @@ 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 __HAVE_GENERIC_SOFT_INTERRUPTS
sc->sc_softwake = 1;
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
usb_schedsoftintr(&sc->sc_bus);
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
DPRINTFN(1,("uhci_abort_xfer: tsleep\n"));
tsleep(&sc->sc_softwake, PZERO, "uhciab", 0);
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
splx(s);
/*
diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h
index 86d29d34ce4..c7ea2d0059d 100644
--- a/sys/dev/usb/uhcivar.h
+++ b/sys/dev/usb/uhcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhcivar.h,v 1.21 2009/10/13 19:33:19 pirofti Exp $ */
+/* $OpenBSD: uhcivar.h,v 1.22 2009/11/04 19:14:10 kettenis 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 $ */
@@ -155,9 +155,7 @@ typedef struct uhci_softc {
u_int8_t sc_saved_sof;
u_int16_t sc_saved_frnum;
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
char sc_softwake;
-#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 222aa200cd5..63b17a494f4 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.c,v 1.60 2009/10/31 06:40:17 deraadt Exp $ */
+/* $OpenBSD: usb.c,v 1.61 2009/11/04 19:14:10 kettenis Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
@@ -192,7 +192,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 __HAVE_GENERIC_SOFT_INTERRUPTS
/* XXX we should have our own level */
sc->sc_bus->soft = softintr_establish(IPL_SOFTNET,
sc->sc_bus->methods->soft_intr, sc->sc_bus);
@@ -201,7 +200,6 @@ usb_attach(struct device *parent, struct device *self, void *aux)
sc->sc_dying = 1;
return;
}
-#endif
err = usbd_new_device(&sc->sc_dev, sc->sc_bus, 0, speed, 0,
&sc->sc_port);
@@ -780,15 +778,12 @@ void
usb_schedsoftintr(usbd_bus_handle bus)
{
DPRINTFN(10,("usb_schedsoftintr: polling=%d\n", bus->use_polling));
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+
if (bus->use_polling) {
bus->methods->soft_intr(bus);
} else {
softintr_schedule(bus->soft);
}
-#else
- bus->methods->soft_intr(bus);
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
}
int
@@ -839,12 +834,10 @@ usb_detach(struct device *self, int flags)
usbd_finish();
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
if (sc->sc_bus->soft != NULL) {
softintr_disestablish(sc->sc_bus->soft);
sc->sc_bus->soft = NULL;
}
-#endif
ue.u.ue_ctrlr.ue_bus = sc->sc_dev.dv_unit;
usb_add_event(USB_EVENT_CTRLR_DETACH, &ue);
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index c57dfe5e0b5..a18fb4623a4 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.98 2009/10/13 19:33:19 pirofti Exp $ */
+/* $OpenBSD: usb_port.h,v 1.99 2009/11/04 19:14:10 kettenis 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 $ */
@@ -40,12 +40,6 @@
* NetBSD or FreeBSD.
*/
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
-#define USB_USE_SOFTINTR
-#else
-#undef USB_USE_SOFTINTR
-#endif
-
#define Static
#define UMASS_ATAPISTR "atapiscsi"
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 1fcc956c560..3b6010250d8 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.h,v 1.32 2009/09/23 19:59:08 miod Exp $ */
+/* $OpenBSD: usbdi.h,v 1.33 2009/11/04 19:14:10 kettenis 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 $ */
@@ -240,20 +240,11 @@ struct usb_attach_arg {
#define UMATCH_NONE 0
/* XXX Perhaps USB should have its own levels? */
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
#define splusb splsoftnet
#if 0
#define SPLUSBCHECK splsoftassert(IPL_SOFTNET)
#else
#define SPLUSBCHECK do { /* nothing */ } while (0)
#endif
-#else
-#define splusb splbio
-#if 0
-#define SPLUSBCHECK splassert(IPL_BIO)
-#else
-#define SPLUSBCHECK do { /* nothing */ } while (0)
-#endif
-#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 9d44ae0191a..5addcde90e1 100644
--- a/sys/dev/usb/usbdivar.h
+++ b/sys/dev/usb/usbdivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdivar.h,v 1.35 2009/08/30 19:15:40 miod Exp $ */
+/* $OpenBSD: usbdivar.h,v 1.36 2009/11/04 19:14:10 kettenis 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 $ */
@@ -116,10 +116,7 @@ struct usbd_bus {
#define USBREV_1_1 3
#define USBREV_2_0 4
#define USBREV_STR { "unknown", "pre 1.0", "1.0", "1.1", "2.0" }
-
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
void *soft; /* soft interrupt cookie */
-#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 61ee9013d87..4a0b29ed476 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.14 2008/12/01 16:58:48 deraadt Exp $ */
+/* $OpenBSD: usbf_subr.c,v 1.15 2009/11/04 19:14:10 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -1066,23 +1066,19 @@ usbf_transfer_complete(usbf_xfer_handle xfer)
usbf_status
usbf_softintr_establish(struct usbf_bus *bus)
{
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
KASSERT(bus->soft == NULL);
+
/* XXX we should have our own level */
bus->soft = softintr_establish(IPL_SOFTNET,
bus->methods->soft_intr, bus);
if (bus->soft == NULL)
return USBF_INVAL;
-#endif
+
return USBF_NORMAL_COMPLETION;
}
void
usbf_schedsoftintr(struct usbf_bus *bus)
{
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
softintr_schedule(bus->soft);
-#else
- bus->methods->soft_intr(bus);
-#endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
}
diff --git a/sys/dev/usb/usbfvar.h b/sys/dev/usb/usbfvar.h
index e8dfe5cb18c..f742181a2a9 100644
--- a/sys/dev/usb/usbfvar.h
+++ b/sys/dev/usb/usbfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbfvar.h,v 1.6 2007/06/15 11:41:48 mbalmer Exp $ */
+/* $OpenBSD: usbfvar.h,v 1.7 2009/11/04 19:14:10 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -101,9 +101,7 @@ struct usbf_bus {
/* Filled by usbf driver */
struct usbf_softc *usbfctl;
int intr_context;
-#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
void *soft; /* soft interrupt cookie */
-#endif
bus_dma_tag_t dmatag; /* DMA tag */
};