diff options
author | sam <sam@FreeBSD.org> | 2002-11-14 23:54:55 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2002-11-14 23:54:55 +0000 |
commit | 14c32b5f40c5ee3bd5649c3737f359f7e65e6944 (patch) | |
tree | 84eb7252cc6a518796c6bf88903ed6e2d12e7b91 /sys/dev/awi/awi.c | |
parent | 10eb947d277840d02ef35d6c6303b64329d53806 (diff) | |
download | FreeBSD-src-14c32b5f40c5ee3bd5649c3737f359f7e65e6944.zip FreeBSD-src-14c32b5f40c5ee3bd5649c3737f359f7e65e6944.tar.gz |
network interface driver changes:
o don't strip the Ethernet header from inbound packets; pass packets
up the stack intact (required significant changes to some drivers)
o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN)
o track ether_ifattach/ether_ifdetach API changes
o track bpf changes (use BPF_TAP and BPF_MTAP)
o track vlan changes (ifnet capabilities, revised processing scheme, etc.)
o use if_input to pass packets "up"
o call ether_ioctl for default handling of ioctls
Reviewed by: many
Approved by: re
Diffstat (limited to 'sys/dev/awi/awi.c')
-rw-r--r-- | sys/dev/awi/awi.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/dev/awi/awi.c b/sys/dev/awi/awi.c index ca4de35..3718198 100644 --- a/sys/dev/awi/awi.c +++ b/sys/dev/awi/awi.c @@ -217,8 +217,8 @@ int awi_dump_len = 28; #define AWI_BPF_RAW 1 #ifdef __FreeBSD__ #define AWI_BPF_MTAP(sc, m, raw) do { \ - if ((sc)->sc_ifp->if_bpf && (sc)->sc_rawbpf == (raw)) \ - bpf_mtap((sc)->sc_ifp, (m)); \ + if ((sc)->sc_rawbpf == (raw)) \ + BPF_MTAP((sc)->sc_ifp, (m)); \ } while (0); #else #define AWI_BPF_MTAP(sc, m, raw) do { \ @@ -239,6 +239,7 @@ int awi_dump_len = 28; devclass_t awi_devclass; #endif +#if __FreeBSD_version < 500043 /* NetBSD compatible functions */ static char * ether_sprintf(u_int8_t *); @@ -252,6 +253,7 @@ ether_sprintf(enaddr) return strbuf; } #endif +#endif int awi_attach(sc) @@ -317,7 +319,7 @@ awi_attach(sc) printf("%s: address %s\n", sc->sc_dev.dv_xname, ether_sprintf(sc->sc_mib_addr.aMAC_Address)); #ifdef __FreeBSD__ - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + ether_ifattach(ifp, sc->sc_mib_addr.aMAC_Address); #else if_attach(ifp); ether_ifattach(ifp, sc->sc_mib_addr.aMAC_Address); @@ -1370,9 +1372,6 @@ awi_input(sc, m, rxts, rssi) { struct ifnet *ifp = sc->sc_ifp; struct ieee80211_frame *wh; -#ifndef __NetBSD__ - struct ether_header *eh; -#endif /* trim CRC here for WEP can find its own CRC at the end of packet. */ m_adj(m, -ETHER_CRC_LEN); @@ -1430,13 +1429,7 @@ awi_input(sc, m, rxts, rssi) #if !(defined(__FreeBSD__) && __FreeBSD_version >= 400000) AWI_BPF_MTAP(sc, m, AWI_BPF_NORM); #endif -#ifdef __NetBSD__ (*ifp->if_input)(ifp, m); -#else - eh = mtod(m, struct ether_header *); - m_adj(m, sizeof(*eh)); - ether_input(ifp, eh, m); -#endif break; case IEEE80211_FC0_TYPE_MGT: if ((wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) != |