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/fe | |
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/fe')
-rw-r--r-- | sys/dev/fe/if_fe.c | 26 | ||||
-rw-r--r-- | sys/dev/fe/if_fe_pccard.c | 2 |
2 files changed, 8 insertions, 20 deletions
diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index 1cbce78..b6ad14c 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -816,7 +816,7 @@ fe_attach (device_t dev) #endif /* Attach and stop the interface. */ - ether_ifattach(&sc->sc_if, ETHER_BPF_SUPPORTED); + ether_ifattach(&sc->sc_if, sc->arpcom.ac_enaddr); fe_stop(sc); /* Print additional info when attached. */ @@ -1281,9 +1281,8 @@ fe_start (struct ifnet *ifp) * and only if it is in "receive everything" * mode.) */ - if (sc->sc_if.if_bpf && - !(sc->sc_if.if_flags & IFF_PROMISC)) - bpf_mtap(&sc->sc_if, m); + if (!(sc->sc_if.if_flags & IFF_PROMISC)) + BPF_MTAP(&sc->sc_if, m); m_freem(m); } @@ -1757,13 +1756,6 @@ fe_ioctl (struct ifnet * ifp, u_long command, caddr_t data) switch (command) { - case SIOCSIFADDR: - case SIOCGIFADDR: - case SIOCSIFMTU: - /* Just an ordinary action. */ - error = ether_ioctl(ifp, command, data); - break; - case SIOCSIFFLAGS: /* * Switch interface state between "running" and @@ -1803,7 +1795,7 @@ fe_ioctl (struct ifnet * ifp, u_long command, caddr_t data) break; default: - error = EINVAL; + error = ether_ioctl(ifp, command, data); break; } @@ -1819,6 +1811,7 @@ fe_ioctl (struct ifnet * ifp, u_long command, caddr_t data) static int fe_get_packet (struct fe_softc * sc, u_short len) { + struct ifnet *ifp = &sc->sc_if; struct ether_header *eh; struct mbuf *m; @@ -1868,7 +1861,7 @@ fe_get_packet (struct fe_softc * sc, u_short len) } /* Initialize packet header info. */ - m->m_pkthdr.rcvif = &sc->sc_if; + m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = len; /* Set the length of this packet. */ @@ -1890,13 +1883,8 @@ fe_get_packet (struct fe_softc * sc, u_short len) fe_insw(sc, FE_BMPR8, (u_int16_t *)eh, (len + 1) >> 1); } - /* Strip off the Ethernet header. */ - m->m_pkthdr.len -= sizeof (struct ether_header); - m->m_len -= sizeof (struct ether_header); - m->m_data += sizeof (struct ether_header); - /* Feed the packet to upper layer. */ - ether_input(&sc->sc_if, eh, m); + (*ifp->if_input)(ifp, m); return 0; } diff --git a/sys/dev/fe/if_fe_pccard.c b/sys/dev/fe/if_fe_pccard.c index 0fc1f8d..f4f1ada 100644 --- a/sys/dev/fe/if_fe_pccard.c +++ b/sys/dev/fe/if_fe_pccard.c @@ -174,7 +174,7 @@ fe_pccard_detach(device_t dev) struct ifnet *ifp = &sc->arpcom.ac_if; fe_stop(sc); - ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); + ether_ifdetach(ifp); bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); fe_release_resource(dev); |