Remove compat ifdefs for FreeBSD versions < 500014.

Approved by:	rwatson (mentor)
This commit is contained in:
brueffer 2007-05-21 18:10:48 +00:00
parent 7c303725a6
commit c37821fefc
14 changed files with 3 additions and 145 deletions

View File

@ -87,9 +87,6 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <machine/bus.h>
#if __FreeBSD_version < 500000
#include <machine/clock.h>
#endif
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@ -339,11 +336,7 @@ axe_setmulti(struct axe_softc *sc)
rxmode &= ~AXE_RXCMD_ALLMULTI;
IF_ADDR_LOCK(ifp);
#if __FreeBSD_version >= 500000
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
#else
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
#endif
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@ -459,10 +452,8 @@ USB_ATTACH(axe)
}
}
#if __FreeBSD_version >= 500000
mtx_init(&sc->axe_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE);
#endif
AXE_LOCK(sc);
/*
@ -486,9 +477,7 @@ USB_ATTACH(axe)
if (ifp == NULL) {
printf("axe%d: can not if_alloc()\n", sc->axe_unit);
AXE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->axe_mtx);
#endif
USB_ATTACH_ERROR_RETURN;
}
ifp->if_softc = sc;
@ -510,9 +499,7 @@ USB_ATTACH(axe)
printf("axe%d: MII without any PHY!\n", sc->axe_unit);
if_free(ifp);
AXE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->axe_mtx);
#endif
USB_ATTACH_ERROR_RETURN;
}
@ -520,11 +507,7 @@ USB_ATTACH(axe)
* Call MI attach routine.
*/
#if __FreeBSD_version >= 500000
ether_ifattach(ifp, eaddr);
#else
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
#endif
callout_handle_init(&sc->axe_stat_ch);
usb_register_netisr();
@ -547,12 +530,8 @@ axe_detach(device_ptr_t dev)
sc->axe_dying = 1;
untimeout(axe_tick, sc, sc->axe_stat_ch);
#if __FreeBSD_version >= 500000
ether_ifdetach(ifp);
if_free(ifp);
#else
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
#endif
if (sc->axe_ep[AXE_ENDPT_TX] != NULL)
usbd_abort_pipe(sc->axe_ep[AXE_ENDPT_TX]);
@ -562,9 +541,7 @@ axe_detach(device_ptr_t dev)
usbd_abort_pipe(sc->axe_ep[AXE_ENDPT_INTR]);
AXE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->axe_mtx);
#endif
return(0);
}

View File

@ -138,9 +138,7 @@ struct axe_softc {
int axe_if_flags;
struct ue_cdata axe_cdata;
struct callout_handle axe_stat_ch;
#if __FreeBSD_version >= 500000
struct mtx axe_mtx;
#endif
char axe_dying;
int axe_link;
unsigned char axe_ipgs[3];

View File

@ -70,9 +70,6 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <machine/bus.h>
#if __FreeBSD_version < 500000
#include <machine/clock.h>
#endif
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@ -357,11 +354,7 @@ cue_setmulti(struct cue_softc *sc)
/* now program new ones */
IF_ADDR_LOCK(ifp);
#if __FreeBSD_version >= 500000
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
#else
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
#endif
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@ -375,11 +368,7 @@ cue_setmulti(struct cue_softc *sc)
* so we can receive broadcast frames.
*/
if (ifp->if_flags & IFF_BROADCAST) {
#if __FreeBSD_version >= 500000
h = cue_mchash(ifp->if_broadcastaddr);
#else
h = cue_mchash(etherbroadcastaddr);
#endif
sc->cue_mctab[h >> 3] |= 1 << (h & 0x7);
}
@ -487,10 +476,8 @@ USB_ATTACH(cue)
}
}
#if __FreeBSD_version >= 500000
mtx_init(&sc->cue_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE);
#endif
CUE_LOCK(sc);
#ifdef notdef
@ -506,9 +493,7 @@ USB_ATTACH(cue)
if (ifp == NULL) {
printf("cue%d: can not if_alloc()\n", sc->cue_unit);
CUE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->cue_mtx);
#endif
USB_ATTACH_ERROR_RETURN;
}
ifp->if_softc = sc;
@ -529,11 +514,7 @@ USB_ATTACH(cue)
/*
* Call MI attach routine.
*/
#if __FreeBSD_version >= 500000
ether_ifattach(ifp, eaddr);
#else
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
#endif
callout_handle_init(&sc->cue_stat_ch);
usb_register_netisr();
sc->cue_dying = 0;
@ -554,12 +535,8 @@ cue_detach(device_ptr_t dev)
sc->cue_dying = 1;
untimeout(cue_tick, sc, sc->cue_stat_ch);
#if __FreeBSD_version >= 500000
ether_ifdetach(ifp);
if_free(ifp);
#else
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
#endif
if (sc->cue_ep[CUE_ENDPT_TX] != NULL)
usbd_abort_pipe(sc->cue_ep[CUE_ENDPT_TX]);
@ -569,9 +546,7 @@ cue_detach(device_ptr_t dev)
usbd_abort_pipe(sc->cue_ep[CUE_ENDPT_INTR]);
CUE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->cue_mtx);
#endif
return(0);
}

View File

@ -154,9 +154,7 @@ struct cue_softc {
u_int16_t cue_rxfilt;
struct ue_cdata cue_cdata;
struct callout_handle cue_stat_ch;
#if __FreeBSD_version >= 500000
struct mtx cue_mtx;
#endif
char cue_dying;
struct timeval cue_rx_notice;
struct usb_qdat cue_qdat;

View File

@ -85,9 +85,6 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <machine/bus.h>
#if __FreeBSD_version < 500000
#include <machine/clock.h>
#endif
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@ -329,11 +326,7 @@ kue_setmulti(struct kue_softc *sc)
sc->kue_rxfilt &= ~KUE_RXFILT_ALLMULTI;
IF_ADDR_LOCK(ifp);
#if __FreeBSD_version >= 500000
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
#else
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
#endif
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@ -451,18 +444,14 @@ USB_ATTACH(kue)
}
}
#if __FreeBSD_version >= 500000
mtx_init(&sc->kue_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE);
#endif
KUE_LOCK(sc);
/* Load the firmware into the NIC. */
if (kue_load_fw(sc)) {
KUE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->kue_mtx);
#endif
USB_ATTACH_ERROR_RETURN;
}
@ -480,9 +469,7 @@ USB_ATTACH(kue)
if (ifp == NULL) {
printf("kue%d: can not if_alloc()\n", sc->kue_unit);
KUE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->kue_mtx);
#endif
USB_ATTACH_ERROR_RETURN;
}
ifp->if_softc = sc;
@ -503,11 +490,7 @@ USB_ATTACH(kue)
/*
* Call MI attach routine.
*/
#if __FreeBSD_version >= 500000
ether_ifattach(ifp, sc->kue_desc.kue_macaddr);
#else
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
#endif
usb_register_netisr();
sc->kue_dying = 0;
@ -529,12 +512,8 @@ kue_detach(device_ptr_t dev)
sc->kue_dying = 1;
if (ifp != NULL)
#if __FreeBSD_version >= 500000
ether_ifdetach(ifp);
if_free(ifp);
#else
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
#endif
if (sc->kue_ep[KUE_ENDPT_TX] != NULL)
usbd_abort_pipe(sc->kue_ep[KUE_ENDPT_TX]);
@ -547,9 +526,7 @@ kue_detach(device_ptr_t dev)
free(sc->kue_mcfilters, M_USBDEV);
KUE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->kue_mtx);
#endif
return(0);
}

View File

@ -147,9 +147,7 @@ struct kue_softc {
u_int16_t kue_rxfilt;
u_int8_t *kue_mcfilters;
struct ue_cdata kue_cdata;
#if __FreeBSD_version >= 500000
struct mtx kue_mtx;
#endif
char kue_dying;
struct timeval kue_rx_notice;
struct usb_qdat kue_qdat;

View File

@ -85,9 +85,6 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <machine/bus.h>
#if __FreeBSD_version < 500000
#include <machine/clock.h>
#endif
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@ -501,11 +498,7 @@ rue_setmulti(struct rue_softc *sc)
/* now program new ones */
IF_ADDR_LOCK(ifp);
#if __FreeBSD_version >= 500000
TAILQ_FOREACH (ifma, &ifp->if_multiaddrs, ifma_link)
#else
LIST_FOREACH (ifma, &ifp->if_multiaddrs, ifma_link)
#endif
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@ -650,10 +643,8 @@ USB_ATTACH(rue)
}
}
#if __FreeBSD_version >= 500000
mtx_init(&sc->rue_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE);
#endif
RUE_LOCK(sc);
/* Reset the adapter */
@ -694,11 +685,7 @@ USB_ATTACH(rue)
sc->rue_qdat.if_rxstart = rue_rxstart;
/* Call MI attach routine */
#if __FreeBSD_version >= 500000
ether_ifattach(ifp, eaddr);
#else
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
#endif
callout_handle_init(&sc->rue_stat_ch);
usb_register_netisr();
sc->rue_dying = 0;
@ -711,9 +698,7 @@ USB_ATTACH(rue)
if_free(ifp);
error1:
RUE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->rue_mtx);
#endif
error:
free(devinfo, M_USBDEV);
USB_ATTACH_ERROR_RETURN;
@ -731,12 +716,8 @@ rue_detach(device_ptr_t dev)
sc->rue_dying = 1;
untimeout(rue_tick, sc, sc->rue_stat_ch);
#if __FreeBSD_version >= 500000
ether_ifdetach(ifp);
if_free(ifp);
#else
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
#endif
if (sc->rue_ep[RUE_ENDPT_TX] != NULL)
usbd_abort_pipe(sc->rue_ep[RUE_ENDPT_TX]);
@ -748,9 +729,7 @@ rue_detach(device_ptr_t dev)
#endif
RUE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->rue_mtx);
#endif
return (0);
}

View File

@ -200,9 +200,7 @@ struct rue_softc {
int rue_if_flags;
struct ue_cdata rue_cdata;
struct callout_handle rue_stat_ch;
#if __FreeBSD_version >= 500000
struct mtx rue_mtx;
#endif
char rue_dying;
struct timeval rue_rx_notice;
struct usb_qdat rue_qdat;

View File

@ -122,9 +122,6 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <machine/bus.h>
#if __FreeBSD_version < 500000
#include <machine/clock.h>
#endif
#include <dev/mii/mii.h>
#include <dev/mii/miivar.h>
@ -357,7 +354,7 @@ USB_ATTACH(udav)
goto bad;
}
#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
#if defined(__FreeBSD__)
mtx_init(&sc->sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE);
#endif
@ -1056,11 +1053,7 @@ udav_setmulti(struct udav_softc *sc)
}
#elif defined(__FreeBSD__)
IF_ADDR_LOCK(ifp);
#if __FreeBSD_version >= 500000
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
#else
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
#endif
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;

View File

@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#if __FreeBSD_version >= 500000
#include <sys/mutex.h>
#endif
#include <sys/signalvar.h>
#include <sys/fcntl.h>
#if defined(__NetBSD__) || defined(__OpenBSD__)
@ -653,11 +651,7 @@ uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr, int flag,
if (*(int *)addr) {
if (sc->sc_async != NULL)
return (EBUSY);
#if __FreeBSD_version >= 500000
sc->sc_async = p->td_proc;
#else
sc->sc_async = p;
#endif
DPRINTF(("uhid_do_ioctl: FIOASYNC %p\n", sc->sc_async));
} else
sc->sc_async = NULL;

View File

@ -55,16 +55,8 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/file.h>
#if __FreeBSD_version >= 500000
#include <sys/limits.h>
#else
#include <machine/limits.h>
#endif
#if __FreeBSD_version >= 500014
#include <sys/selinfo.h>
#else
#include <sys/select.h>
#endif
#include <sys/sysctl.h>
#include <sys/uio.h>

View File

@ -53,11 +53,7 @@ __FBSDID("$FreeBSD$");
#include <sys/fcntl.h>
#include <sys/tty.h>
#include <sys/file.h>
#if __FreeBSD_version >= 500014
#include <sys/selinfo.h>
#else
#include <sys/select.h>
#endif
#include <sys/poll.h>
#include <sys/sysctl.h>
#include <sys/uio.h>
@ -71,11 +67,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/usb_quirks.h>
#include <dev/usb/hid.h>
#if __FreeBSD_version >= 500000
#include <sys/mouse.h>
#else
#include <machine/mouse.h>
#endif
#ifdef USB_DEBUG
#define DPRINTF(x) if (umsdebug) logprintf x

View File

@ -58,9 +58,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#if __FreeBSD_version >= 500000
#include <sys/mutex.h>
#endif
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#elif defined(__FreeBSD__)
@ -405,7 +403,7 @@ usb_event_thread(void *arg)
{
struct usb_softc *sc = arg;
#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
#if defined(__FreeBSD__)
mtx_lock(&Giant);
#endif
@ -455,7 +453,7 @@ usb_task_thread(void *arg)
struct usb_task *task;
int s;
#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
#if defined(__FreeBSD__)
mtx_lock(&Giant);
#endif
@ -581,11 +579,7 @@ usbioctl(struct cdev *devt, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
case FIOASYNC:
if (*(int *)data)
#if __FreeBSD_version >= 500000
usb_async_proc = p->td_proc;
#else
usb_async_proc = p;
#endif
else
usb_async_proc = 0;
return (0);

View File

@ -167,17 +167,10 @@ usb_block_allocmem(bus_dma_tag_t tag, size_t size, size_t align,
if (p == NULL)
return (USBD_NOMEM);
#if __FreeBSD_version >= 500000
if (bus_dma_tag_create(tag, align, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
size, sizeof(p->segs) / sizeof(p->segs[0]), size,
BUS_DMA_ALLOCNOW, NULL, NULL, &p->tag) == ENOMEM)
#else
if (bus_dma_tag_create(tag, align, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
size, sizeof(p->segs) / sizeof(p->segs[0]), size,
BUS_DMA_ALLOCNOW, &p->tag) == ENOMEM)
#endif
{
goto free;
}