summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrsm <rsm@FreeBSD.org>2004-12-08 22:02:58 +0000
committerrsm <rsm@FreeBSD.org>2004-12-08 22:02:58 +0000
commitf85e5b20307bb5377ef122a6392725fa13576de6 (patch)
tree89d9edd16bf407ddaa945d641c017b581e6d1405 /sys
parent68cd8761a723205e9d0dbd54067af7db9f163492 (diff)
downloadFreeBSD-src-f85e5b20307bb5377ef122a6392725fa13576de6.zip
FreeBSD-src-f85e5b20307bb5377ef122a6392725fa13576de6.tar.gz
Diff-reduction before merging if_axe to RELENG_4.
Approved by: imp (mentor) MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/FILES2
-rw-r--r--sys/dev/usb/if_axe.c24
-rw-r--r--sys/dev/usb/if_axereg.h2
3 files changed, 27 insertions, 1 deletions
diff --git a/sys/dev/usb/FILES b/sys/dev/usb/FILES
index 09db78c..5bccdb7 100644
--- a/sys/dev/usb/FILES
+++ b/sys/dev/usb/FILES
@@ -16,6 +16,8 @@ hid.c subroutines to parse and access HID data
hid.h API for hid.c
if_aue.c USB Pegasus Ethernet driver
if_auereg.h and definitions for it
+if_axe.c USB ASIX Electronics Ethernet driver
+if_axereg.h and definitions for it
if_cue.c USB CATC Ethernet driver
if_cuereg.h and definitions for it
if_kue.c USB Kawasaki Ethernet driver
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index 3cf7670..ef477d8 100644
--- a/sys/dev/usb/if_axe.c
+++ b/sys/dev/usb/if_axe.c
@@ -86,6 +86,9 @@ __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>
@@ -336,7 +339,12 @@ axe_setmulti(struct axe_softc *sc)
} else
rxmode &= ~AXE_RXCMD_ALLMULTI;
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+#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;
h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
@@ -450,8 +458,10 @@ 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);
/*
@@ -493,7 +503,9 @@ USB_ATTACH(axe)
axe_ifmedia_upd, axe_ifmedia_sts)) {
printf("axe%d: MII without any PHY!\n", sc->axe_unit);
AXE_UNLOCK(sc);
+#if __FreeBSD_version >= 500000
mtx_destroy(&sc->axe_mtx);
+#endif
USB_ATTACH_ERROR_RETURN;
}
@@ -501,7 +513,11 @@ 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();
@@ -524,7 +540,11 @@ 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);
+#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]);
@@ -534,7 +554,9 @@ 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);
}
diff --git a/sys/dev/usb/if_axereg.h b/sys/dev/usb/if_axereg.h
index a9938f4..04fa92d 100644
--- a/sys/dev/usb/if_axereg.h
+++ b/sys/dev/usb/if_axereg.h
@@ -162,7 +162,9 @@ struct axe_softc {
int axe_if_flags;
struct axe_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];
OpenPOWER on IntegriCloud