summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_ep.c
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2000-05-14 02:18:43 +0000
committerarchie <archie@FreeBSD.org>2000-05-14 02:18:43 +0000
commitfa21035b4e2f11d2c8f90174690853600b670e2d (patch)
tree9afb8dacfff6d7607064d8aa2bbf2da5069e8be6 /sys/dev/ep/if_ep.c
parentd066b073153b986a54fd18a31d6bcc5d697933a2 (diff)
downloadFreeBSD-src-fa21035b4e2f11d2c8f90174690853600b670e2d.zip
FreeBSD-src-fa21035b4e2f11d2c8f90174690853600b670e2d.tar.gz
Move code to handle BPF and bridging for incoming Ethernet packets out
of the individual drivers and into the common routine ether_input(). Also, remove the (incomplete) hack for matching ethernet headers in the ip_fw code. The good news: net result of 1016 lines removed, and this should make bridging now work with *all* Ethernet drivers. The bad news: it's nearly impossible to test every driver, especially for bridging, and I was unable to get much testing help on the mailing lists. Reviewed by: freebsd-net
Diffstat (limited to 'sys/dev/ep/if_ep.c')
-rw-r--r--sys/dev/ep/if_ep.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index e4b4001..a1762b6 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -410,8 +410,7 @@ ep_if_init(xsc)
#ifdef EP_LOCAL_STATS
sc->rx_no_first = sc->rx_no_mbuf =
- sc->rx_bpf_disc = sc->rx_overrunf = sc->rx_overrunl =
- sc->tx_underrun = 0;
+ sc->rx_overrunf = sc->rx_overrunl = sc->tx_underrun = 0;
#endif
EP_FSET(sc, F_RX_FIRST);
if (sc->top) {
@@ -593,8 +592,8 @@ rescan:
printf("\tStat: %x\n", sc->stat);
printf("\tIpackets=%d, Opackets=%d\n",
ifp->if_ipackets, ifp->if_opackets);
- printf("\tNOF=%d, NOMB=%d, BPFD=%d, RXOF=%d, RXOL=%d, TXU=%d\n",
- sc->rx_no_first, sc->rx_no_mbuf, sc->rx_bpf_disc, sc->rx_overrunf,
+ printf("\tNOF=%d, NOMB=%d, RXOF=%d, RXOL=%d, TXU=%d\n",
+ sc->rx_no_first, sc->rx_no_mbuf, sc->rx_overrunf,
sc->rx_overrunl, sc->tx_underrun);
#else
@@ -772,35 +771,6 @@ read_again:
top->m_pkthdr.rcvif = &sc->arpcom.ac_if;
top->m_pkthdr.len = sc->cur_len;
- if (ifp->if_bpf) {
- bpf_mtap(ifp, top);
-
- /*
- * Note that the interface cannot be in promiscuous mode if there are
- * no BPF listeners. And if we are in promiscuous mode, we have to
- * check if this packet is really ours.
- */
- eh = mtod(top, struct ether_header *);
- if ((ifp->if_flags & IFF_PROMISC) &&
- (eh->ether_dhost[0] & 1) == 0 &&
- bcmp(eh->ether_dhost, sc->arpcom.ac_enaddr,
- sizeof(eh->ether_dhost)) != 0 &&
- bcmp(eh->ether_dhost, etherbroadcastaddr,
- sizeof(eh->ether_dhost)) != 0) {
- if (sc->top) {
- m_freem(sc->top);
- sc->top = 0;
- }
- EP_FSET(sc, F_RX_FIRST);
-#ifdef EP_LOCAL_STATS
- sc->rx_bpf_disc++;
-#endif
- while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
- outw(BASE + EP_COMMAND, SET_RX_EARLY_THRESH | RX_INIT_EARLY_THRESH);
- return;
- }
- }
-
eh = mtod(top, struct ether_header *);
m_adj(top, sizeof(struct ether_header));
ether_input(ifp, eh, top);
OpenPOWER on IntegriCloud