diff options
author | Sam Leffler <sam@FreeBSD.org> | 2002-11-14 23:54:55 +0000 |
---|---|---|
committer | Sam Leffler <sam@FreeBSD.org> | 2002-11-14 23:54:55 +0000 |
commit | 673d91916d8748ecccff3635f1b15cc602a3898e (patch) | |
tree | 84eb7252cc6a518796c6bf88903ed6e2d12e7b91 /sys/dev/sn | |
parent | 9ef8b52020603fd01bf683a44d1c1ec25cd4ce09 (diff) | |
download | src-673d91916d8748ecccff3635f1b15cc602a3898e.tar.gz src-673d91916d8748ecccff3635f1b15cc602a3898e.zip |
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
Notes
Notes:
svn path=/head/; revision=106937
Diffstat (limited to 'sys/dev/sn')
-rw-r--r-- | sys/dev/sn/if_sn.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 9058bfdc4492..46011cb18393 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -220,7 +220,7 @@ sn_attach(device_t dev) ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; ifp->if_timer = 0; - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + ether_ifattach(ifp, sc->arpcom.ac_enaddr); /* * Fill the hardware address into ifa_addr if we find an AF_LINK @@ -250,7 +250,7 @@ sn_detach(device_t dev) struct sn_softc *sc = device_get_softc(dev); sc->arpcom.ac_if.if_flags &= ~IFF_RUNNING; - ether_ifdetach(&sc->arpcom.ac_if, ETHER_BPF_SUPPORTED); + ether_ifdetach(&sc->arpcom.ac_if); sn_deactivate(dev); return 0; } @@ -553,9 +553,7 @@ startagain: sc->arpcom.ac_if.if_flags |= IFF_OACTIVE; sc->arpcom.ac_if.if_timer = 1; - if (ifp->if_bpf) { - bpf_mtap(ifp, top); - } + BPF_MTAP(ifp, top); sc->arpcom.ac_if.if_opackets++; m_freem(top); @@ -750,9 +748,7 @@ snresume(struct ifnet *ifp) sc->intr_mask = mask; outw(BASE + MMU_CMD_REG_W, MMUCR_ENQUEUE); - if (ifp->if_bpf) { - bpf_mtap(ifp, top); - } + BPF_MTAP(ifp, top); sc->arpcom.ac_if.if_opackets++; m_freem(top); @@ -1099,10 +1095,9 @@ read_another: /* * Remove link layer addresses and whatnot. */ - m->m_pkthdr.len = m->m_len = packet_length - sizeof(struct ether_header); - m->m_data += sizeof(struct ether_header); + m->m_pkthdr.len = m->m_len = packet_length; - ether_input(&sc->arpcom.ac_if, eh, m); + (*ifp->if_input)(ifp, m); out: @@ -1140,12 +1135,6 @@ snioctl(register struct ifnet *ifp, u_long cmd, caddr_t data) s = splimp(); switch (cmd) { - case SIOCSIFADDR: - case SIOCGIFADDR: - case SIOCSIFMTU: - error = ether_ioctl(ifp, cmd, data); - break; - case SIOCSIFFLAGS: if ((ifp->if_flags & IFF_UP) == 0 && ifp->if_flags & IFF_RUNNING) { ifp->if_flags &= ~IFF_RUNNING; @@ -1177,6 +1166,8 @@ snioctl(register struct ifnet *ifp, u_long cmd, caddr_t data) break; default: error = EINVAL; + error = ether_ioctl(ifp, cmd, data); + break; } splx(s); |