aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorChristian Brueffer <brueffer@FreeBSD.org>2007-05-12 05:53:53 +0000
committerChristian Brueffer <brueffer@FreeBSD.org>2007-05-12 05:53:53 +0000
commit224aecbcdf8667cf5bd8f6da540b68fb4cb7d5d3 (patch)
tree2ca1667191e5e475195c22112829ac1c8e875fba /sys
parentac474f954532b7c6570bd4018f91922e5bd52f88 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_cue.c25
-rw-r--r--sys/dev/usb/if_cuereg.h2
-rw-r--r--sys/dev/usb/if_kue.c23
-rw-r--r--sys/dev/usb/if_kuereg.h2
-rw-r--r--sys/dev/usb/if_rue.c21
-rw-r--r--sys/dev/usb/if_ruereg.h2
-rw-r--r--sys/dev/usb/if_udav.c9
-rw-r--r--sys/dev/usb/uhid.c6
-rw-r--r--sys/dev/usb/ukbd.c8
-rw-r--r--sys/dev/usb/ums.c8
-rw-r--r--sys/dev/usb/usb.c10
-rw-r--r--sys/dev/usb/usb_mem.c7
12 files changed, 3 insertions, 120 deletions
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index 7eb18646d1836..9274ea7044937 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -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_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_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);
}
diff --git a/sys/dev/usb/if_cuereg.h b/sys/dev/usb/if_cuereg.h
index f20aeed586c97..26e061d977ea6 100644
--- a/sys/dev/usb/if_cuereg.h
+++ b/sys/dev/usb/if_cuereg.h
@@ -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;
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c
index 15c39b2b0df88..b4fa8d496ec46 100644
--- a/sys/dev/usb/if_kue.c
+++ b/sys/dev/usb/if_kue.c
@@ -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_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_t dev)
free(sc->kue_mcfilters, M_USBDEV);
KUE_UNLOCK(sc);
-#if __FreeBSD_version >= 500000
mtx_destroy(&sc->kue_mtx);
-#endif
return(0);
}
diff --git a/sys/dev/usb/if_kuereg.h b/sys/dev/usb/if_kuereg.h
index 904ef12112b4c..0019b01d5cd7a 100644
--- a/sys/dev/usb/if_kuereg.h
+++ b/sys/dev/usb/if_kuereg.h
@@ -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;
diff --git a/sys/dev/usb/if_rue.c b/sys/dev/usb/if_rue.c
index 80e68157ec674..38a6907ccb116 100644
--- a/sys/dev/usb/if_rue.c
+++ b/sys/dev/usb/if_rue.c
@@ -86,9 +86,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>
@@ -502,11 +499,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;
@@ -651,10 +644,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 */
@@ -695,11 +686,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;
@@ -712,9 +699,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;
@@ -732,12 +717,8 @@ rue_detach(device_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]);
@@ -749,9 +730,7 @@ rue_detach(device_t dev)
#endif
RUE_UNLOCK(sc);
-#if __FreeBSD_version >= 500000
mtx_destroy(&sc->rue_mtx);
-#endif
return (0);
}
diff --git a/sys/dev/usb/if_ruereg.h b/sys/dev/usb/if_ruereg.h
index 5a1b5f7754b89..d77b4e0b460f2 100644
--- a/sys/dev/usb/if_ruereg.h
+++ b/sys/dev/usb/if_ruereg.h
@@ -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;
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c
index dbc5ab9f11882..98c136fbb9fc6 100644
--- a/sys/dev/usb/if_udav.c
+++ b/sys/dev/usb/if_udav.c
@@ -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;
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index e31a531abd6bf..78ab1e2b40546 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -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__)
@@ -659,11 +657,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;
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 4b458331abc9b..e605a3c9b8a9b 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -56,16 +56,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>
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
index e77d306659f3e..f65f1c7dd250e 100644
--- a/sys/dev/usb/ums.c
+++ b/sys/dev/usb/ums.c
@@ -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
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 0267b63bfbd84..53a9935383bb6 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -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__)
@@ -424,7 +422,7 @@ usb_event_thread(void *arg)
static int newthread_wchan;
struct usb_softc *sc = arg;
-#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
+#if defined(__FreeBSD__)
mtx_lock(&Giant);
#endif
@@ -483,7 +481,7 @@ usb_task_thread(void *arg)
struct usb_taskq *taskq;
int s;
-#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
+#if defined(__FreeBSD__)
mtx_lock(&Giant);
#endif
@@ -610,11 +608,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);
diff --git a/sys/dev/usb/usb_mem.c b/sys/dev/usb/usb_mem.c
index ceed363a9e140..31ee8c424d114 100644
--- a/sys/dev/usb/usb_mem.c
+++ b/sys/dev/usb/usb_mem.c
@@ -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,
0, 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,
- 0, &p->tag) == ENOMEM)
-#endif
{
goto free;
}