As suggested by phk, unconditionalize BPF support in these drivers. Since

there are stubs compiled into the kernel if BPF support is not enabled,
there aren't any problems with unresolved symbols. The modules in /modules
are compiled with BPF support enabled anyway, so the most this will do is
bloat GENERIC a little.
This commit is contained in:
Bill Paul 1999-09-23 03:32:57 +00:00
parent 62e93e1c86
commit 98a229f65e
21 changed files with 26 additions and 212 deletions

View File

@ -78,8 +78,6 @@
* registers inside the 256-byte I/O window.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -94,9 +92,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -815,9 +811,7 @@ static int sf_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1002,7 +996,6 @@ static void sf_rxeof(sc)
eh = mtod(m, struct ether_header *);
ifp->if_ipackets++;
#if NBPF > 0
if (ifp->if_bpf) {
bpf_mtap(ifp, m);
if (ifp->if_flags & IFF_PROMISC &&
@ -1012,7 +1005,6 @@ static void sf_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
@ -1333,10 +1325,9 @@ static void sf_start(ifp)
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
#if NBPF > 0
if (ifp->if_bpf)
bpf_mtap(ifp, m_head);
#endif
SF_INC(i, SF_TX_DLIST_CNT);
sc->sf_tx_cnt++;
if (sc->sf_tx_cnt == (SF_TX_DLIST_CNT - 2))

View File

@ -61,8 +61,6 @@
* both XMACs to operate as independent interfaces.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -78,9 +76,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -1150,9 +1146,7 @@ static int sk_attach_xmac(sc, port)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
return(0);
}
@ -1455,10 +1449,8 @@ static void sk_start(ifp)
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
#if NBPF > 0
if (ifp->if_bpf)
bpf_mtap(ifp, m_head);
#endif
}
/* Transmit */
@ -1563,7 +1555,6 @@ static void sk_rxeof(sc_if)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
#if NBPF > 0
if (ifp->if_bpf) {
bpf_mtap(ifp, m);
if (ifp->if_flags & IFF_PROMISC &&
@ -1573,7 +1564,7 @@ static void sk_rxeof(sc_if)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);

View File

@ -78,7 +78,6 @@
* - Andrew Gallatin for providing FreeBSD/Alpha support.
*/
#include "bpf.h"
#include "vlan.h"
#include <sys/param.h>
@ -96,9 +95,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#if NVLAN > 0
#include <net/if_types.h>
@ -1728,9 +1725,7 @@ static int ti_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1859,7 +1854,6 @@ static void ti_rxeof(sc)
eh = mtod(m, struct ether_header *);
m->m_pkthdr.rcvif = ifp;
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1876,7 +1870,6 @@ static void ti_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
@ -2144,10 +2137,8 @@ static void ti_start(ifp)
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
#if NBPF > 0
if (ifp->if_bpf)
bpf_mtap(ifp, m_head);
#endif
}
/* Transmit */

View File

@ -59,8 +59,6 @@
* transmission.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -75,9 +73,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include "opt_bdg.h"
#ifdef BRIDGE
@ -810,9 +806,7 @@ static int vr_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1049,7 +1043,6 @@ static void vr_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1066,7 +1059,7 @@ static void vr_rxeof(sc)
continue;
}
}
#endif /* NBPF>0 */
#ifdef BRIDGE
if (do_bridge) {
struct ifnet *bdg_ifp;
@ -1385,14 +1378,13 @@ static void vr_start(ifp)
if (cur_tx != start_tx)
VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->vr_mbuf);
#endif
VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
VR_SETBIT16(sc, VR_COMMAND, /*VR_CMD_TX_ON|*/VR_CMD_TX_GO);
}

View File

@ -67,7 +67,6 @@
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
#include "bpf.h"
#include "card.h"
#include "wi.h"
@ -95,9 +94,7 @@
#include <netinet/if_ether.h>
#endif
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <machine/clock.h>
#include <machine/md_var.h>
@ -364,9 +361,7 @@ static int wi_attach(isa_dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
EVENTHANDLER_REGISTER(shutdown_post_sync, wi_shutdown, sc,
SHUTDOWN_PRI_DEFAULT);
@ -465,7 +460,6 @@ static void wi_rxeof(sc)
ifp->if_ipackets++;
#if NBPF > 0
/* Handle BPF listeners. */
if (ifp->if_bpf) {
bpf_mtap(ifp, m);
@ -476,7 +470,6 @@ static void wi_rxeof(sc)
return;
}
}
#endif
/* Receive packet. */
m_adj(m, sizeof(struct ether_header));
@ -1241,14 +1234,12 @@ static void wi_start(ifp)
m0->m_pkthdr.len + 2);
}
#if NBPF > 0
/*
* If there's a BPF listner, bounce a copy of
* this frame to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, m0);
#endif
m_freem(m0);

View File

@ -67,7 +67,6 @@
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
#include "bpf.h"
#include "card.h"
#include "wi.h"
@ -95,9 +94,7 @@
#include <netinet/if_ether.h>
#endif
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <machine/clock.h>
#include <machine/md_var.h>
@ -364,9 +361,7 @@ static int wi_attach(isa_dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
EVENTHANDLER_REGISTER(shutdown_post_sync, wi_shutdown, sc,
SHUTDOWN_PRI_DEFAULT);
@ -465,7 +460,6 @@ static void wi_rxeof(sc)
ifp->if_ipackets++;
#if NBPF > 0
/* Handle BPF listeners. */
if (ifp->if_bpf) {
bpf_mtap(ifp, m);
@ -476,7 +470,6 @@ static void wi_rxeof(sc)
return;
}
}
#endif
/* Receive packet. */
m_adj(m, sizeof(struct ether_header));
@ -1241,14 +1234,12 @@ static void wi_start(ifp)
m0->m_pkthdr.len + 2);
}
#if NBPF > 0
/*
* If there's a BPF listner, bounce a copy of
* this frame to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, m0);
#endif
m_freem(m0);

View File

@ -60,8 +60,6 @@
* (bits 16, 17, 18 and 19 in the serial I/O register control the MII).
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -76,9 +74,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -972,9 +968,7 @@ static int al_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1182,7 +1176,7 @@ static void al_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1199,7 +1193,7 @@ static void al_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
@ -1473,14 +1467,12 @@ static void al_start(ifp)
break;
}
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, m_head);
#endif
}
/* Transmit */

View File

@ -49,8 +49,6 @@
* the registers.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -65,9 +63,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -1344,9 +1340,7 @@ static int ax_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1547,7 +1541,7 @@ static void ax_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1564,7 +1558,7 @@ static void ax_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
@ -1871,14 +1865,13 @@ static void ax_start(ifp)
if (cur_tx != start_tx)
AX_TXOWN(cur_tx) = AX_TXSTAT_OWN;
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->ax_mbuf);
#endif
AX_TXOWN(cur_tx) = AX_TXSTAT_OWN;
CSR_WRITE_4(sc, AX_TXSTART, 0xFFFFFFFF);
}

View File

@ -51,8 +51,6 @@
* overruns.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -67,9 +65,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -896,9 +892,7 @@ static int dm_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1109,7 +1103,7 @@ static void dm_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1126,7 +1120,7 @@ static void dm_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
@ -1413,14 +1407,12 @@ static void dm_start(ifp)
break;
}
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, m_head);
#endif
}
sc->dm_cdata.dm_tx_prod = idx;

View File

@ -56,8 +56,6 @@
* the NWAY support.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -72,9 +70,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -1605,9 +1601,7 @@ int mx_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1818,7 +1812,6 @@ static void mx_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1835,7 +1828,7 @@ static void mx_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
@ -2159,14 +2152,13 @@ static void mx_start(ifp)
if (cur_tx != start_tx)
MX_TXOWN(cur_tx) = MX_TXSTAT_OWN;
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->mx_mbuf);
#endif
MX_TXOWN(cur_tx) = MX_TXSTAT_OWN;
CSR_WRITE_4(sc, MX_TXSTART, 0xFFFFFFFF);

View File

@ -57,8 +57,6 @@
* 100BaseTX PHY.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -73,9 +71,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include "opt_bdg.h"
#ifdef BRIDGE
@ -1265,9 +1261,7 @@ static int pn_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1631,7 +1625,6 @@ static void pn_rxeof(sc)
}
#endif
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1648,7 +1641,7 @@ static void pn_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
@ -1962,14 +1955,13 @@ static void pn_start(ifp)
if (cur_tx != start_tx)
PN_TXOWN(cur_tx) = PN_TXSTAT_OWN;
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->pn_mbuf);
#endif
PN_TXOWN(cur_tx) = PN_TXSTAT_OWN;
CSR_WRITE_4(sc, PN_TXSTART, 0xFFFFFFFF);
}

View File

@ -83,8 +83,6 @@
* to select which interface to use depending on the chip type.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -99,9 +97,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -963,9 +959,7 @@ static int rl_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1163,7 +1157,6 @@ static void rl_rxeof(sc)
eh = mtod(m, struct ether_header *);
ifp->if_ipackets++;
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1180,7 +1173,7 @@ static void rl_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
@ -1371,14 +1364,13 @@ static void rl_start(ifp)
rl_encap(sc, m_head);
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, RL_CUR_TXMBUF(sc));
#endif
/*
* Transmit the frame.
*/

View File

@ -78,8 +78,6 @@
* registers inside the 256-byte I/O window.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -94,9 +92,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -815,9 +811,7 @@ static int sf_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1002,7 +996,6 @@ static void sf_rxeof(sc)
eh = mtod(m, struct ether_header *);
ifp->if_ipackets++;
#if NBPF > 0
if (ifp->if_bpf) {
bpf_mtap(ifp, m);
if (ifp->if_flags & IFF_PROMISC &&
@ -1012,7 +1005,6 @@ static void sf_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
@ -1333,10 +1325,9 @@ static void sf_start(ifp)
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
#if NBPF > 0
if (ifp->if_bpf)
bpf_mtap(ifp, m_head);
#endif
SF_INC(i, SF_TX_DLIST_CNT);
sc->sf_tx_cnt++;
if (sc->sf_tx_cnt == (SF_TX_DLIST_CNT - 2))

View File

@ -54,8 +54,6 @@
* longword aligned.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -70,9 +68,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -705,9 +701,7 @@ static int sis_attach(dev)
ether_ifattach(ifp);
callout_handle_init(&sc->sis_stat_ch);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -911,7 +905,7 @@ static void sis_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -927,7 +921,7 @@ static void sis_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
@ -1164,14 +1158,13 @@ static void sis_start(ifp)
break;
}
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, m_head);
#endif
}
/* Transmit */

View File

@ -61,8 +61,6 @@
* both XMACs to operate as independent interfaces.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -78,9 +76,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -1150,9 +1146,7 @@ static int sk_attach_xmac(sc, port)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
return(0);
}
@ -1455,10 +1449,8 @@ static void sk_start(ifp)
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
#if NBPF > 0
if (ifp->if_bpf)
bpf_mtap(ifp, m_head);
#endif
}
/* Transmit */
@ -1563,7 +1555,6 @@ static void sk_rxeof(sc_if)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
#if NBPF > 0
if (ifp->if_bpf) {
bpf_mtap(ifp, m);
if (ifp->if_flags & IFF_PROMISC &&
@ -1573,7 +1564,7 @@ static void sk_rxeof(sc_if)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);

View File

@ -32,9 +32,6 @@
* $FreeBSD$
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -49,9 +46,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include "opt_bdg.h"
#ifdef BRIDGE
@ -726,11 +721,9 @@ static void ste_rxeof(sc)
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = total_len;
#if NBPF > 0
/* Handle BPF listeners. Let the BPF user see the packet. */
if (ifp->if_bpf)
bpf_mtap(ifp, m);
#endif
#ifdef BRIDGE
if (do_bridge) {
@ -746,7 +739,6 @@ static void ste_rxeof(sc)
}
#endif
#if NBPF > 0
/*
* Don't pass packet up to the ether_input() layer unless it's
* a broadcast packet, multicast packet, matches our ethernet
@ -760,7 +752,6 @@ static void ste_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
@ -1107,9 +1098,7 @@ static int ste_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1566,14 +1555,12 @@ static void ste_start(ifp)
}
prev = cur_tx;
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copt of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->ste_mbuf);
#endif
}
if (cur_tx == NULL)

View File

@ -78,7 +78,6 @@
* - Andrew Gallatin for providing FreeBSD/Alpha support.
*/
#include "bpf.h"
#include "vlan.h"
#include <sys/param.h>
@ -96,9 +95,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#if NVLAN > 0
#include <net/if_types.h>
@ -1728,9 +1725,7 @@ static int ti_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1859,7 +1854,6 @@ static void ti_rxeof(sc)
eh = mtod(m, struct ether_header *);
m->m_pkthdr.rcvif = ifp;
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1876,7 +1870,6 @@ static void ti_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
@ -2144,10 +2137,8 @@ static void ti_start(ifp)
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
#if NBPF > 0
if (ifp->if_bpf)
bpf_mtap(ifp, m_head);
#endif
}
/* Transmit */

View File

@ -178,8 +178,6 @@
* itself thereby reducing the load on the host CPU.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -194,9 +192,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include <vm/vm.h> /* for vtophys */
#include <vm/pmap.h> /* for vtophys */
@ -1342,9 +1338,7 @@ static int tl_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1551,7 +1545,6 @@ static int tl_intvec_rxeof(xsc, type)
continue;
}
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1571,7 +1564,7 @@ static int tl_intvec_rxeof(xsc, type)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m->m_pkthdr.len = m->m_len =
total_len - sizeof(struct ether_header);
@ -2011,10 +2004,8 @@ static void tl_start(ifp)
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
#if NBPF > 0
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->tl_mbuf);
#endif
}
/*

View File

@ -59,8 +59,6 @@
* transmission.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -75,9 +73,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include "opt_bdg.h"
#ifdef BRIDGE
@ -810,9 +806,7 @@ static int vr_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1049,7 +1043,6 @@ static void vr_rxeof(sc)
ifp->if_ipackets++;
eh = mtod(m, struct ether_header *);
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1066,7 +1059,7 @@ static void vr_rxeof(sc)
continue;
}
}
#endif /* NBPF>0 */
#ifdef BRIDGE
if (do_bridge) {
struct ifnet *bdg_ifp;
@ -1385,14 +1378,13 @@ static void vr_start(ifp)
if (cur_tx != start_tx)
VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->vr_mbuf);
#endif
VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
VR_SETBIT16(sc, VR_COMMAND, /*VR_CMD_TX_ON|*/VR_CMD_TX_GO);
}

View File

@ -83,7 +83,6 @@
* three of my test boards seems fine.
*/
#include "bpf.h"
#include "opt_bdg.h"
#include <sys/param.h>
@ -101,9 +100,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#ifdef BRIDGE
#include <net/bridge.h>
@ -977,9 +974,7 @@ static int wb_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
if (error)
@ -1220,7 +1215,6 @@ static void wb_rxeof(sc)
}
#endif
#if NBPF > 0
/*
* Handle BPF listeners. Let the BPF user see the packet, but
* don't pass it up to the ether_input() layer unless it's
@ -1237,7 +1231,7 @@ static void wb_rxeof(sc)
break;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
ether_input(ifp, eh, m);
@ -1583,14 +1577,12 @@ static void wb_start(ifp)
if (cur_tx != start_tx)
WB_TXOWN(cur_tx) = WB_TXSTAT_OWN;
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->wb_mbuf);
#endif
}
/*

View File

@ -91,8 +91,6 @@
* PCI-based NICs.
*/
#include "bpf.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -107,9 +105,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#if NBPF > 0
#include <net/bpf.h>
#endif
#include "opt_bdg.h"
#ifdef BRIDGE
@ -1496,9 +1492,7 @@ static int xl_attach(dev)
if_attach(ifp);
ether_ifattach(ifp);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
fail:
splx(s);
@ -1745,11 +1739,9 @@ static void xl_rxeof(sc)
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = total_len;
#if NBPF > 0
/* Handle BPF listeners. Let the BPF user see the packet. */
if (ifp->if_bpf)
bpf_mtap(ifp, m);
#endif
#ifdef BRIDGE
if (do_bridge) {
@ -1765,7 +1757,6 @@ static void xl_rxeof(sc)
}
#endif
#if NBPF > 0
/*
* Don't pass packet up to the ether_input() layer unless it's
* a broadcast packet, multicast packet, matches our ethernet
@ -1779,7 +1770,6 @@ static void xl_rxeof(sc)
continue;
}
}
#endif
/* Remove header from mbuf and pass it on. */
m_adj(m, sizeof(struct ether_header));
@ -2198,14 +2188,12 @@ static void xl_start(ifp)
}
prev = cur_tx;
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->xl_mbuf);
#endif
}
/*
@ -2347,14 +2335,12 @@ static void xl_start_90xB(ifp)
prev->xl_ptr->xl_next = cur_tx->xl_phys;
prev = cur_tx;
#if NBPF > 0
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, cur_tx->xl_mbuf);
#endif
XL_INC(idx, XL_TX_LIST_CNT);
sc->xl_cdata.xl_tx_cnt++;