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/cs/if_cs.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/cs/if_cs.c')
-rw-r--r-- | sys/dev/cs/if_cs.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index b1508e5..bffccf9 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -657,7 +657,7 @@ cs_attach(struct cs_softc *sc, int unit, int flags) ifmedia_set(&sc->media, media); cs_mediaset(sc, media); - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + ether_ifattach(ifp, sc->arpcom.ac_enaddr); } if (bootverbose) @@ -750,8 +750,7 @@ cs_init(void *xsc) } /* - * Get the packet from the board and send it to the upper layer - * via ether_input(). + * Get the packet from the board and send it to the upper layer. */ static int cs_get_packet(struct cs_softc *sc) @@ -811,12 +810,8 @@ cs_get_packet(struct cs_softc *sc) if (status & (RX_IA | RX_BROADCAST) || (ifp->if_flags & IFF_MULTICAST && status & RX_HASHED)) { - 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 the upper layer */ - ether_input(ifp, eh, m); + (*ifp->if_input)(ifp, m); ifp->if_ipackets++; @@ -961,9 +956,7 @@ cs_start(struct ifnet *ifp) cs_write_mbufs(sc, m); - if (ifp->if_bpf) { - bpf_mtap(ifp, m); - } + BPF_MTAP(ifp, m); m_freem(m); } @@ -1085,12 +1078,6 @@ cs_ioctl(register struct ifnet *ifp, u_long command, caddr_t data) s=splimp(); switch (command) { - case SIOCSIFADDR: - case SIOCGIFADDR: - case SIOCSIFMTU: - ether_ioctl(ifp, command, data); - break; - case SIOCSIFFLAGS: /* * Switch interface state between "running" and @@ -1132,7 +1119,8 @@ cs_ioctl(register struct ifnet *ifp, u_long command, caddr_t data) break; default: - error = EINVAL; + ether_ioctl(ifp, command, data); + break; } (void) splx(s); |