Diff-reduction before merging if_axe to RELENG_4.

Approved by:	imp (mentor)
MFC after:	1 week
This commit is contained in:
Scott Mitchell 2004-12-08 22:02:58 +00:00
parent 5faf8dcb55
commit d49a36b1d5
3 changed files with 27 additions and 1 deletions

View File

@ -16,6 +16,8 @@ hid.c subroutines to parse and access HID data
hid.h API for hid.c hid.h API for hid.c
if_aue.c USB Pegasus Ethernet driver if_aue.c USB Pegasus Ethernet driver
if_auereg.h and definitions for it 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_cue.c USB CATC Ethernet driver
if_cuereg.h and definitions for it if_cuereg.h and definitions for it
if_kue.c USB Kawasaki Ethernet driver if_kue.c USB Kawasaki Ethernet driver

View File

@ -86,6 +86,9 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h> #include <sys/bus.h>
#include <machine/bus.h> #include <machine/bus.h>
#if __FreeBSD_version < 500000
#include <machine/clock.h>
#endif
#include <dev/usb/usb.h> #include <dev/usb/usb.h>
#include <dev/usb/usbdi.h> #include <dev/usb/usbdi.h>
@ -336,7 +339,12 @@ axe_setmulti(struct axe_softc *sc)
} else } else
rxmode &= ~AXE_RXCMD_ALLMULTI; 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) if (ifma->ifma_addr->sa_family != AF_LINK)
continue; continue;
h = ether_crc32_be(LLADDR((struct sockaddr_dl *) 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_init(&sc->axe_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK,
MTX_DEF | MTX_RECURSE); MTX_DEF | MTX_RECURSE);
#endif
AXE_LOCK(sc); AXE_LOCK(sc);
/* /*
@ -493,7 +503,9 @@ USB_ATTACH(axe)
axe_ifmedia_upd, axe_ifmedia_sts)) { axe_ifmedia_upd, axe_ifmedia_sts)) {
printf("axe%d: MII without any PHY!\n", sc->axe_unit); printf("axe%d: MII without any PHY!\n", sc->axe_unit);
AXE_UNLOCK(sc); AXE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->axe_mtx); mtx_destroy(&sc->axe_mtx);
#endif
USB_ATTACH_ERROR_RETURN; USB_ATTACH_ERROR_RETURN;
} }
@ -501,7 +513,11 @@ USB_ATTACH(axe)
* Call MI attach routine. * Call MI attach routine.
*/ */
#if __FreeBSD_version >= 500000
ether_ifattach(ifp, eaddr); ether_ifattach(ifp, eaddr);
#else
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
#endif
callout_handle_init(&sc->axe_stat_ch); callout_handle_init(&sc->axe_stat_ch);
usb_register_netisr(); usb_register_netisr();
@ -524,7 +540,11 @@ axe_detach(device_ptr_t dev)
sc->axe_dying = 1; sc->axe_dying = 1;
untimeout(axe_tick, sc, sc->axe_stat_ch); untimeout(axe_tick, sc, sc->axe_stat_ch);
#if __FreeBSD_version >= 500000
ether_ifdetach(ifp); ether_ifdetach(ifp);
#else
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
#endif
if (sc->axe_ep[AXE_ENDPT_TX] != NULL) if (sc->axe_ep[AXE_ENDPT_TX] != NULL)
usbd_abort_pipe(sc->axe_ep[AXE_ENDPT_TX]); 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]); usbd_abort_pipe(sc->axe_ep[AXE_ENDPT_INTR]);
AXE_UNLOCK(sc); AXE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->axe_mtx); mtx_destroy(&sc->axe_mtx);
#endif
return(0); return(0);
} }

View File

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