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/snc | |
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/snc')
-rw-r--r-- | sys/dev/snc/dp83932.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c index fc6a9d6..991bb99 100644 --- a/sys/dev/snc/dp83932.c +++ b/sys/dev/snc/dp83932.c @@ -197,7 +197,7 @@ sncconfig(sc, media, nmedia, defmedia, myea) ifmedia_set(&sc->sc_media, IFM_ETHER|IFM_MANUAL); } - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + ether_ifattach(ifp, myea); #if NRND > 0 rnd_attach_source(&sc->rnd_source, device_get_nameunit(sc->sc_dev), @@ -261,12 +261,6 @@ sncioctl(ifp, cmd, data) switch (cmd) { - case SIOCSIFADDR: - case SIOCGIFADDR: - case SIOCSIFMTU: - err = ether_ioctl(ifp, cmd, data); - break; - case SIOCSIFFLAGS: if ((ifp->if_flags & IFF_UP) == 0 && (ifp->if_flags & IFF_RUNNING) != 0) { @@ -315,7 +309,8 @@ sncioctl(ifp, cmd, data) err = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd); break; default: - err = EINVAL; + err = ether_ioctl(ifp, cmd, data); + break; } splx(s); return (err); @@ -358,8 +353,7 @@ outloop: * If bpf is listening on this interface, let it * see the packet before we commit it to the wire. */ - if (ifp->if_bpf) - bpf_mtap(ifp, m); + BPF_MTAP(ifp, m); /* * If there is nothing in the o/p queue, and there is room in @@ -1105,9 +1099,8 @@ sonic_read(sc, pkt, len) } #endif /* SNCDEBUG */ - /* Pass the packet up, with the ether header sort-of removed. */ - m_adj(m, sizeof(struct ether_header)); - ether_input(ifp, et, m); + /* Pass the packet up. */ + (*ifp->if_input)(ifp, m); return (1); } |