summaryrefslogtreecommitdiffstats
path: root/sys/dev/xe/if_xe.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/xe/if_xe.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/xe/if_xe.c')
-rw-r--r--sys/dev/xe/if_xe.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c
index df5262e..bbbf095 100644
--- a/sys/dev/xe/if_xe.c
+++ b/sys/dev/xe/if_xe.c
@@ -289,7 +289,7 @@ xe_attach (device_t dev)
device_printf(dev, "Ethernet address %6D\n", scp->arpcom.ac_enaddr, ":");
/* Attach the interface */
- ether_ifattach(scp->ifp, ETHER_BPF_SUPPORTED);
+ ether_ifattach(scp->ifp, scp->arpcom.ac_enaddr);
/* Done */
return 0;
@@ -416,12 +416,7 @@ xe_start(struct ifnet *ifp) {
}
/* Tap off here if there is a bpf listener */
- if (ifp->if_bpf) {
-#if XE_DEBUG > 1
- device_printf(scp->dev, "sending output packet to BPF\n");
-#endif
- bpf_mtap(ifp, mbp);
- }
+ BPF_MTAP(ifp, mbp);
ifp->if_timer = 5; /* In case we don't hear from the card again */
scp->tx_queued++;
@@ -446,12 +441,6 @@ xe_ioctl (register struct ifnet *ifp, u_long command, caddr_t data) {
switch (command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
-
case SIOCSIFFLAGS:
/*
* If the interface is marked up and stopped, then start it. If it is
@@ -489,7 +478,7 @@ xe_ioctl (register struct ifnet *ifp, u_long command, caddr_t data) {
break;
default:
- error = EINVAL;
+ error = ether_ioctl(ifp, command, data);
}
(void)splx(s);
@@ -729,9 +718,8 @@ xe_intr(void *xscp)
/* Deliver packet to upper layers */
if (mbp != NULL) {
- mbp->m_pkthdr.len = mbp->m_len = len - ETHER_HDR_LEN;
- mbp->m_data += ETHER_HDR_LEN; /* Strip off Ethernet header */
- ether_input(ifp, ehp, mbp); /* Send the packet on its way */
+ mbp->m_pkthdr.len = mbp->m_len = len;
+ (*ifp->if_input)(ifp, mbp); /* Send the packet on its way */
ifp->if_ipackets++; /* Success! */
}
XE_OUTW(XE_DO, 0x8000); /* skip_rx_packet command */
OpenPOWER on IntegriCloud