-/* $OpenBSD: hme.c,v 1.67 2014/12/22 02:26:54 tedu Exp $ */
+/* $OpenBSD: hme.c,v 1.68 2015/04/08 10:07:47 mpi Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
u_int32_t flags;
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
if (len <= sizeof(struct ether_header) ||
ifp->if_ipackets++;
-#if NBPFILTER > 0
- /*
- * Check if there's a BPF listener on this interface.
- * If so, hand off the raw packet to BPF.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
- /* Pass the packet up. */
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
+ if_input(ifp, &ml);
}
void
-/* $OpenBSD: if_bce.c,v 1.43 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_bce.c,v 1.44 2015/04/08 10:07:47 mpi Exp $ */
/* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */
/*
bce_rxintr(struct bce_softc *sc)
{
struct ifnet *ifp = &sc->bce_ac.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct rx_pph *pph;
struct mbuf *m;
int curr;
BCE_PREPKT_HEADER_SIZE, len, ETHER_ALIGN, ifp);
ifp->if_ipackets++;
-#if NBPFILTER > 0
- /*
- * Pass this up to any BPF listeners, but only
- * pass it up the stack if it's for us.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- /* Pass it on. */
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
/* re-check current in case it changed */
curr = (bus_space_read_4(sc->bce_btag, sc->bce_bhandle,
if (curr >= BCE_NRXDESC)
curr = BCE_NRXDESC - 1;
}
+
+ if_input(ifp, &ml);
+
sc->bce_rxin = curr;
}
-/* $OpenBSD: if_lge.c,v 1.64 2014/12/22 02:28:52 tedu Exp $ */
+/* $OpenBSD: if_lge.c,v 1.65 2015/04/08 10:07:47 mpi Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
void
lge_rxeof(struct lge_softc *sc, int cnt)
{
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
struct ifnet *ifp;
struct lge_rx_desc *cur_rx;
}
m = m0;
} else {
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = total_len;
}
ifp->if_ipackets++;
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
/* Do IP checksum checking. */
if (rxsts & LGE_RXSTS_ISIP) {
if (!(rxsts & LGE_RXSTS_IPCSUMERR))
m->m_pkthdr.csum_flags |= M_UDP_CSUM_IN_OK;
}
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
+ if_input(ifp, &ml);
+
sc->lge_cdata.lge_rx_cons = i;
}
-/* $OpenBSD: if_nge.c,v 1.81 2014/12/22 02:28:52 tedu Exp $ */
+/* $OpenBSD: if_nge.c,v 1.82 2015/04/08 10:07:47 mpi Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
void
nge_rxeof(struct nge_softc *sc)
{
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
struct ifnet *ifp;
struct nge_desc *cur_rx;
m = m0;
#ifndef __STRICT_ALIGNMENT
} else {
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = total_len;
}
#endif
}
#endif
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet.
- */
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
/* Do IP checksum checking. */
if (extsts & NGE_RXEXTSTS_IPPKT) {
if (!(extsts & NGE_RXEXTSTS_IPCSUMERR))
m->m_pkthdr.csum_flags |= M_UDP_CSUM_IN_OK;
}
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
+ if_input(ifp, &ml);
+
sc->nge_cdata.nge_rx_prod = i;
}
-/* $OpenBSD: if_vge.c,v 1.60 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_vge.c,v 1.61 2015/04/08 10:07:47 mpi Exp $ */
/* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */
/*
* Copyright (c) 2004
void
vge_rxeof(struct vge_softc *sc)
{
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
struct ifnet *ifp;
int i, total_len;
m->m_data += ETHER_ALIGN;
#endif
ifp->if_ipackets++;
- m->m_pkthdr.rcvif = ifp;
/* Do RX checksumming */
}
#endif
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
lim++;
if (lim == VGE_RX_DESC_CNT)
break;
}
+ if_input(ifp, &ml);
+
/* Flush the RX DMA ring */
bus_dmamap_sync(sc->sc_dmat,
sc->vge_ldata.vge_rx_list_map,
-/* $OpenBSD: if_wb.c,v 1.58 2014/12/22 02:28:52 tedu Exp $ */
+/* $OpenBSD: if_wb.c,v 1.59 2015/04/08 10:07:47 mpi Exp $ */
/*
* Copyright (c) 1997, 1998
void wb_rxeof(sc)
struct wb_softc *sc;
{
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct ifnet *ifp;
struct wb_chain_onefrag *cur_rx;
int total_len = 0;
"bug, forcing reset\n", sc->sc_dev.dv_xname);
wb_fixmedia(sc);
wb_init(sc);
- return;
+ break;
}
if (rxstat & WB_RXSTAT_RXERR) {
ifp->if_ipackets++;
-#if NBPFILTER > 0
- /*
- * Handle BPF listeners. Let the BPF user see the packet.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
- /* pass it on. */
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
- return;
+ if_input(ifp, &ml);
}
void wb_rxeoc(sc)
-/* $OpenBSD: if_malo.c,v 1.82 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: if_malo.c,v 1.83 2015/04/08 10:07:47 mpi Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = &ic->ic_if;
struct malo_rx_desc *rxdesc;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
uint8_t *data;
uint16_t psize;
return;
}
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
/* push the frame up to the network stack if not in monitor mode */
if (ic->ic_opmode != IEEE80211_M_MONITOR) {
- ether_input_mbuf(ifp, m);
ifp->if_ipackets++;
+ ml_enqueue(&ml, m);
+ if_input(ifp, &ml);
+#if NBPFILTER > 0
+ } else {
+ if (ifp->if_bpf)
+ bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
+#endif
}
+
}
void