usb: purge EOL release compatibility

Remove conditionsals for FreeBSD 6, 7, 8 and 9 compatibility.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560
This commit is contained in:
Elliott Mitchell 2022-06-22 17:53:47 -07:00 committed by Warner Losh
parent aa41036eb7
commit 336fbb23de
7 changed files with 0 additions and 49 deletions

View file

@ -424,13 +424,8 @@ ehci_pci_attach(device_t self)
sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self));
}
#if (__FreeBSD_version >= 700031)
err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
#else
err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
(driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
#endif
if (err) {
device_printf(self, "Could not setup irq, %d\n", err);
sc->sc_intr_hdl = NULL;

View file

@ -296,13 +296,8 @@ ohci_pci_attach(device_t self)
/* sc->sc_bus.usbrev; set by ohci_init() */
#if (__FreeBSD_version >= 700031)
err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
#else
err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
(driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
#endif
if (err) {
device_printf(self, "Could not setup irq, %d\n", err);
sc->sc_intr_hdl = NULL;

View file

@ -363,13 +363,8 @@ uhci_pci_attach(device_t self)
break;
}
#if (__FreeBSD_version >= 700031)
err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
NULL, (driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl);
#else
err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
(driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl);
#endif
if (err) {
device_printf(self, "Could not setup irq, %d\n", err);

View file

@ -40,11 +40,7 @@
#define USB_PAGE_SIZE PAGE_SIZE /* use system PAGE_SIZE */
#if (__FreeBSD_version >= 700020)
#define USB_GET_DMA_TAG(dev) bus_get_dma_tag(dev)
#else
#define USB_GET_DMA_TAG(dev) NULL /* XXX */
#endif
/* structure prototypes */

View file

@ -96,12 +96,7 @@ SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RWTUN,
&usb_fifo_debug, 0, "Debug Level");
#endif
#if ((__FreeBSD_version >= 700001) || (__FreeBSD_version == 0) || \
((__FreeBSD_version >= 600034) && (__FreeBSD_version < 700000)))
#define USB_UCRED struct ucred *ucred,
#else
#define USB_UCRED
#endif
/* prototypes */

View file

@ -62,31 +62,14 @@
#include <sys/sched.h>
#endif /* USB_GLOBAL_INCLUDE_FILE */
#if (__FreeBSD_version < 700000)
#define thread_lock(td) mtx_lock_spin(&sched_lock)
#define thread_unlock(td) mtx_unlock_spin(&sched_lock)
#endif
#if (__FreeBSD_version >= 800000)
static struct proc *usbproc;
static int usb_pcount;
#define USB_THREAD_CREATE(f, s, p, ...) \
kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \
0, "usb", __VA_ARGS__)
#if (__FreeBSD_version >= 900000)
#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check()
#else
#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curthread)
#endif
#define USB_THREAD_SUSPEND(p) kthread_suspend(p,0)
#define USB_THREAD_EXIT(err) kthread_exit()
#else
#define USB_THREAD_CREATE(f, s, p, ...) \
kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__)
#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curproc)
#define USB_THREAD_SUSPEND(p) kthread_suspend(p,0)
#define USB_THREAD_EXIT(err) kthread_exit(err)
#endif
#ifdef USB_DEBUG
static int usb_proc_debug;
@ -198,11 +181,9 @@ usb_process(void *arg)
up->up_ptr = NULL;
cv_signal(&up->up_cv);
USB_MTX_UNLOCK(up->up_mtx);
#if (__FreeBSD_version >= 800000)
/* Clear the proc pointer if this is the last thread. */
if (--usb_pcount == 0)
usbproc = NULL;
#endif
USB_THREAD_EXIT(0);
}
@ -238,9 +219,7 @@ usb_proc_create(struct usb_process *up, struct mtx *p_mtx,
up->up_ptr = NULL;
goto error;
}
#if (__FreeBSD_version >= 800000)
usb_pcount++;
#endif
return (0);
error:

View file

@ -57,11 +57,7 @@ struct usb_process {
struct cv up_cv;
struct cv up_drain;
#if (__FreeBSD_version >= 800000)
struct thread *up_ptr;
#else
struct proc *up_ptr;
#endif
struct thread *up_curtd;
struct mtx *up_mtx;