summaryrefslogtreecommitdiffstats
path: root/sys/dev/hme
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/hme
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/hme')
-rw-r--r--sys/dev/hme/if_hme.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/sys/dev/hme/if_hme.c b/sys/dev/hme/if_hme.c
index e495795..11b7878 100644
--- a/sys/dev/hme/if_hme.c
+++ b/sys/dev/hme/if_hme.c
@@ -314,7 +314,7 @@ hme_config(struct hme_softc *sc)
}
/* Attach the interface. */
- ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifattach(ifp, sc->sc_arpcom.ac_enaddr);
callout_init(&sc->sc_tick_ch, 0);
return (0);
@@ -987,7 +987,6 @@ static void
hme_read(struct hme_softc *sc, int ix, int len)
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
- struct ether_header *eh;
struct mbuf *m;
int offs;
@@ -1026,10 +1025,8 @@ hme_read(struct hme_softc *sc, int ix, int len)
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = len + offs;
m_adj(m, offs);
- eh = mtod(m, struct ether_header *);
- m_adj(m, sizeof(struct ether_header));
/* Pass the packet up. */
- ether_input(ifp, eh, m);
+ (*ifp->if_input)(ifp, m);
}
static void
@@ -1055,8 +1052,7 @@ hme_start(struct ifnet *ifp)
break;
} else {
enq = 1;
- if (ifp->if_bpf)
- bpf_mtap(ifp, m);
+ BPF_MTAP(ifp, m);
}
}
@@ -1376,11 +1372,6 @@ hme_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
s = splnet();
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) != 0) {
@@ -1420,7 +1411,7 @@ hme_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii->mii_media, cmd);
break;
default:
- error = ENOTTY;
+ error = ether_ioctl(ifp, cmd, data);
break;
}
OpenPOWER on IntegriCloud