summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_ep.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/ep/if_ep.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/ep/if_ep.c')
-rw-r--r--sys/dev/ep/if_ep.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index e0a6795..749fa58 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -311,7 +311,7 @@ ep_attach(sc)
}
if (!attached)
- ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifattach(ifp, sc->arpcom.ac_enaddr);
#ifdef EP_LOCAL_STATS
sc->rx_no_first = sc->rx_no_mbuf = sc->rx_bpf_disc =
@@ -509,9 +509,7 @@ startagain:
splx(s);
- if (ifp->if_bpf) {
- bpf_mtap(ifp, top);
- }
+ BPF_MTAP(ifp, top);
ifp->if_timer = 2;
ifp->if_opackets++;
@@ -657,7 +655,6 @@ static void
epread(sc)
register struct ep_softc *sc;
{
- struct ether_header *eh;
struct mbuf *top, *mcur, *m;
struct ifnet *ifp;
int lenthisone;
@@ -765,9 +762,7 @@ read_again:
top->m_pkthdr.rcvif = &sc->arpcom.ac_if;
top->m_pkthdr.len = sc->cur_len;
- eh = mtod(top, struct ether_header *);
- m_adj(top, sizeof(struct ether_header));
- ether_input(ifp, eh, top);
+ (*ifp->if_input)(ifp, top);
sc->top = 0;
while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
outw(BASE + EP_COMMAND, SET_RX_EARLY_THRESH | RX_INIT_EARLY_THRESH);
@@ -857,12 +852,6 @@ ep_if_ioctl(ifp, cmd, 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)) {
@@ -899,7 +888,7 @@ ep_if_ioctl(ifp, cmd, data)
}
break;
default:
- error = EINVAL;
+ error = ether_ioctl(ifp, cmd, data);
break;
}
OpenPOWER on IntegriCloud