summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_tl.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2002-11-14 23:49:09 +0000
committersam <sam@FreeBSD.org>2002-11-14 23:49:09 +0000
commit10eb947d277840d02ef35d6c6303b64329d53806 (patch)
tree372bb632d763ce1dd7c8d223701c4caeb192eea9 /sys/pci/if_tl.c
parentad30a004454fdbce77e4ea74fce4280cee5cf184 (diff)
downloadFreeBSD-src-10eb947d277840d02ef35d6c6303b64329d53806.zip
FreeBSD-src-10eb947d277840d02ef35d6c6303b64329d53806.tar.gz
o track either_ifattach/ether_ifdetach API changes
o use if_input for input packet processing o don't strip the Ethernet header for input packets o use BPF_* macros bpf tapping o call ether_ioctl to handle default ioctl case o track vlan changes Reviewed by: many Approved by: re
Diffstat (limited to 'sys/pci/if_tl.c')
-rw-r--r--sys/pci/if_tl.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c
index 5cda958..0fc990a 100644
--- a/sys/pci/if_tl.c
+++ b/sys/pci/if_tl.c
@@ -1348,7 +1348,7 @@ tl_attach(dev)
/*
* Call MI attach routine.
*/
- ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifattach(ifp, sc->arpcom.ac_enaddr);
TL_UNLOCK(sc);
return(0);
@@ -1370,7 +1370,7 @@ tl_detach(dev)
ifp = &sc->arpcom.ac_if;
tl_stop(sc);
- ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifdetach(ifp);
bus_generic_detach(dev);
device_delete_child(dev, sc->tl_miibus);
@@ -1543,15 +1543,13 @@ tl_intvec_rxeof(xsc, type)
sc->tl_cdata.tl_rx_tail->tl_next = cur_rx;
sc->tl_cdata.tl_rx_tail = cur_rx;
- eh = mtod(m, struct ether_header *);
- m->m_pkthdr.rcvif = ifp;
-
/*
* Note: when the ThunderLAN chip is in 'capture all
* frames' mode, it will receive its own transmissions.
* We drop don't need to process our own transmissions,
* so we drop them here and continue.
*/
+ eh = mtod(m, struct ether_header *);
/*if (ifp->if_flags & IFF_PROMISC && */
if (!bcmp(eh->ether_shost, sc->arpcom.ac_enaddr,
ETHER_ADDR_LEN)) {
@@ -1559,11 +1557,10 @@ tl_intvec_rxeof(xsc, type)
continue;
}
- /* Remove header from mbuf and pass it on. */
- m->m_pkthdr.len = m->m_len =
- total_len - sizeof(struct ether_header);
- m->m_data += sizeof(struct ether_header);
- ether_input(ifp, eh, m);
+ m->m_pkthdr.rcvif = ifp;
+ m->m_pkthdr.len = m->m_len = total_len;
+
+ (*ifp->if_input)(ifp, m);
}
return(r);
@@ -2015,8 +2012,7 @@ tl_start(ifp)
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
- if (ifp->if_bpf)
- bpf_mtap(ifp, cur_tx->tl_mbuf);
+ BPF_MTAP(ifp, cur_tx->tl_mbuf);
}
/*
@@ -2217,11 +2213,6 @@ tl_ioctl(ifp, command, data)
s = splimp();
switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
if (ifp->if_flags & IFF_RUNNING &&
@@ -2261,7 +2252,7 @@ tl_ioctl(ifp, command, data)
}
break;
default:
- error = EINVAL;
+ error = ether_ioctl(ifp, command, data);
break;
}
OpenPOWER on IntegriCloud