summaryrefslogtreecommitdiffstats
path: root/sys/dev/sn/if_sn.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2002-11-14 23:54:55 +0000
committersam <sam@FreeBSD.org>2002-11-14 23:54:55 +0000
commit14c32b5f40c5ee3bd5649c3737f359f7e65e6944 (patch)
tree84eb7252cc6a518796c6bf88903ed6e2d12e7b91 /sys/dev/sn/if_sn.c
parent10eb947d277840d02ef35d6c6303b64329d53806 (diff)
downloadFreeBSD-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/sn/if_sn.c')
-rw-r--r--sys/dev/sn/if_sn.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c
index 9058bfd..46011cb 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);
OpenPOWER on IntegriCloud