-/* $OpenBSD: aic6915.c,v 1.15 2015/04/28 14:07:47 jsg Exp $ */
+/* $OpenBSD: aic6915.c,v 1.16 2015/05/19 11:24:01 mpi Exp $ */
/* $NetBSD: aic6915.c,v 1.15 2005/12/24 20:27:29 perry Exp $ */
/*-
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct sf_descsoft *ds;
struct sf_rcd_full *rcd;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
uint32_t cqci, word0;
int consumer, producer, bufproducer, rxidx, len;
- try_again:
cqci = sf_funcreg_read(sc, SF_CompletionQueueConsumerIndex);
consumer = CQCI_RxCompletionQ1ConsumerIndex_get(cqci);
ds->ds_dmamap->dm_mapsize, BUS_DMASYNC_PREREAD);
#endif /* __STRICT_ALIGNMENT */
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = len;
-#if NBPFILTER > 0
- /*
- * Pass this up to any BPF listeners.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif /* NBPFILTER > 0 */
-
- /* Pass it on. */
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
ifp->if_ipackets++;
}
+ if_input(ifp, &ml);
+
/* Update the chip's pointers. */
sf_funcreg_write(sc, SF_CompletionQueueConsumerIndex,
(cqci & ~CQCI_RxCompletionQ1ConsumerIndex(0x7ff)) |
CQCI_RxCompletionQ1ConsumerIndex(consumer));
sf_funcreg_write(sc, SF_RxDescQueue1Ptrs,
RXQ1P_RxDescQ1Producer(bufproducer));
-
- /* Double-check for any new completions. */
- goto try_again;
}
/*
-/* $OpenBSD: smc83c170.c,v 1.19 2015/03/14 03:38:47 jsg Exp $ */
+/* $OpenBSD: smc83c170.c,v 1.20 2015/05/19 11:24:01 mpi Exp $ */
/* $NetBSD: smc83c170.c,v 1.59 2005/02/27 00:27:02 perry Exp $ */
/*-
struct epic_rxdesc *rxd;
struct epic_txdesc *txd;
struct epic_descsoft *ds;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
u_int32_t intstat, rxstatus, txstatus;
int i, claimed = 0;
u_int len;
- top:
/*
* Get the interrupt status from the EPIC.
*/
}
}
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = len;
-#if NBPFILTER > 0
- /*
- * Pass this up to any BPF listeners, but only
- * pass it up the stack if its 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);
ifp->if_ipackets++;
}
}
}
+ if_input(ifp, &ml);
+
/*
* Check for transmission complete interrupts.
*/
(void) epic_init(ifp);
}
- /*
- * Check for more interrupts.
- */
- goto top;
+ return (claimed);
}
/*
-/* $OpenBSD: smc91cxx.c,v 1.38 2015/03/14 03:38:47 jsg Exp $ */
+/* $OpenBSD: smc91cxx.c,v 1.39 2015/05/19 11:24:01 mpi Exp $ */
/* $NetBSD: smc91cxx.c,v 1.11 1998/08/08 23:51:41 mycroft Exp $ */
/*-
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
bus_space_tag_t bst = sc->sc_bst;
bus_space_handle_t bsh = sc->sc_bsh;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
u_int16_t status, packetno, packetlen;
u_int8_t *data;
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
goto out;
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = packetlen;
/*
}
ifp->if_ipackets++;
-
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
m->m_pkthdr.len = m->m_len = packetlen;
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
out:
/*
* Check for another packet.
*/
packetno = bus_space_read_2(bst, bsh, FIFO_PORTS_REG_W);
- if (packetno & FIFO_REMPTY)
+ if (packetno & FIFO_REMPTY) {
+ if_input(ifp, &ml);
return;
+ }
goto again;
}
-/* $OpenBSD: ti.c,v 1.13 2015/03/14 03:38:47 jsg Exp $ */
+/* $OpenBSD: ti.c,v 1.14 2015/05/19 11:24:01 mpi Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
ti_rxeof(struct ti_softc *sc)
{
struct ifnet *ifp;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct ti_cmd_desc cmd;
ifp = &sc->arpcom.ac_if;
m->m_pkthdr.len = m->m_len = cur_rx->ti_len;
ifp->if_ipackets++;
- m->m_pkthdr.rcvif = ifp;
#if NVLAN > 0
if (cur_rx->ti_flags & TI_BDFLAG_VLAN_TAG) {
}
#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
-
if ((cur_rx->ti_ip_cksum ^ 0xffff) == 0)
m->m_pkthdr.csum_flags |= M_IPV4_CSUM_IN_OK;
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
/* Only necessary on the Tigon 1. */
TI_UPDATE_STDPROD(sc, sc->ti_std);
TI_UPDATE_MINIPROD(sc, sc->ti_mini);
TI_UPDATE_JUMBOPROD(sc, sc->ti_jumbo);
+
+ if_input(ifp, &ml);
}
void
-/* $OpenBSD: if_ef_isapnp.c,v 1.27 2014/12/22 02:28:51 tedu Exp $ */
+/* $OpenBSD: if_ef_isapnp.c,v 1.28 2015/05/19 11:24:01 mpi Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
int len;
}
ifp->if_ipackets++;
+ ml_enqueue(&ml, m);
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
+ if_input(ifp, &ml);
}
struct mbuf *
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct mbuf *top, **mp, *m;
int len, pad, s;
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
return (NULL);
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = totlen;
pad = ALIGN(sizeof(struct ether_header)) - sizeof(struct ether_header);
m->m_data += pad;
-/* $OpenBSD: if_eg.c,v 1.37 2015/05/13 10:42:46 jsg Exp $ */
+/* $OpenBSD: if_eg.c,v 1.38 2015/05/19 11:24:01 mpi Exp $ */
/* $NetBSD: if_eg.c,v 1.26 1996/05/12 23:52:27 mycroft Exp $ */
/*
egread(struct eg_softc *sc, caddr_t buf, int len)
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
-
+
if (len <= sizeof(struct ether_header) ||
len > ETHER_MAX_LEN) {
printf("%s: invalid packet size %d; dropping\n",
}
ifp->if_ipackets++;
+ ml_enqueue(&ml, m);
-#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
-
- ether_input_mbuf(ifp, m);
+ if_input(ifp, &ml);
}
/*
struct mbuf *
egget(struct eg_softc *sc, caddr_t buf, int totlen)
{
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct mbuf *top, **mp, *m;
int len;
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
return (0);
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = totlen;
len = MHLEN;
top = 0;
-/* $OpenBSD: if_el.c,v 1.25 2015/05/13 10:42:46 jsg Exp $ */
+/* $OpenBSD: if_el.c,v 1.26 2015/05/19 11:24:01 mpi Exp $ */
/* $NetBSD: if_el.c,v 1.39 1996/05/12 23:52:32 mycroft Exp $ */
/*
int len;
{
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++;
+ ml_enqueue(&ml, m);
-#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
-
- ether_input_mbuf(ifp, m);
+ if_input(ifp, &ml);
}
/*
struct el_softc *sc;
int totlen;
{
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
int iobase = sc->sc_iobase;
struct mbuf *top, **mp, *m;
int len;
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
return 0;
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = totlen;
len = MHLEN;
top = 0;
-/* $OpenBSD: if_ex.c,v 1.37 2014/12/22 02:28:51 tedu Exp $ */
+/* $OpenBSD: if_ex.c,v 1.38 2015/05/19 11:24:01 mpi Exp $ */
/*
* Copyright (c) 1997, Donald A. Schmidt
* Copyright (c) 1996, Javier MartÃn Rueda (jmrueda@diatel.upm.es)
ex_rx_intr(struct ex_softc *sc)
{
struct ifnet *ifp = &sc->arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
int rx_status, pkt_len, QQQ;
struct mbuf *m, *ipkt;
if (ipkt == NULL)
ifp->if_iqdrops++;
else {
- ipkt->m_pkthdr.rcvif = ifp;
ipkt->m_pkthdr.len = pkt_len;
ipkt->m_len = MHLEN;
while (pkt_len > 0) {
} /* QQQ */
}
#endif
-#if NBPFILTER > 0
- if (ifp->if_bpf != NULL)
- bpf_mtap(ifp->if_bpf, ipkt,
- BPF_DIRECTION_IN);
-#endif
- ether_input_mbuf(ifp, ipkt);
ifp->if_ipackets++;
+ ml_enqueue(&ml, ipkt);
}
} else
ifp->if_ierrors++;
else
CSR_WRITE_2(sc, RCV_STOP_REG, sc->rx_head - 2);
+ if_input(ifp, &ml);
+
DODEBUG(Start_End, printf("ex_rx_intr: finish\n"););
}
-/* $OpenBSD: if_cnw.c,v 1.28 2015/05/13 10:42:46 jsg Exp $ */
+/* $OpenBSD: if_cnw.c,v 1.29 2015/05/19 11:24:01 mpi Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
{
int rser;
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
- struct ether_header *eh;
for (;;) {
WAIT_WOC(sc);
rser = bus_space_read_1(sc->sc_memt, sc->sc_memh,
sc->sc_memoff + CNW_EREG_RSER);
if (!(rser & CNW_RSER_RXAVAIL))
- return;
+ break;
/* Pull packet off card */
m = cnw_read(sc);
/* Did we manage to get the packet from the interface? */
if (m == NULL) {
++ifp->if_ierrors;
- return;
+ break;
}
++ifp->if_ipackets;
-
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- /*
- * Check that the packet is for us or {multi,broad}cast. Maybe
- * there's a fool-poof hardware check for this, but I don't
- * really know...
- */
- eh = mtod(m, struct ether_header *);
- if ((eh->ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */
- bcmp(sc->sc_arpcom.ac_enaddr, eh->ether_dhost,
- sizeof(eh->ether_dhost)) != 0) {
- m_freem(m);
- continue;
- }
-
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
+
+ if_input(ifp, &ml);
}
-/* $OpenBSD: if_xe.c,v 1.48 2015/05/13 10:42:46 jsg Exp $ */
+/* $OpenBSD: if_xe.c,v 1.49 2015/05/19 11:24:01 mpi Exp $ */
/*
* Copyright (c) 1999 Niklas Hallqvist, Brandon Creighton, Job de Haas
{
u_int8_t rsr;
struct mbuf *top, **mp, *m;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
u_int16_t pktlen, len, recvcount = 0;
u_int8_t *data;
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
return (recvcount);
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = pktlen;
len = MHLEN;
top = 0;
/* Skip Rx packet. */
bus_space_write_2(sc->sc_bst, sc->sc_bsh, sc->sc_offset + DO0,
DO_SKIP_RX_PKT);
-
+
ifp->if_ipackets++;
-
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, top, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, top);
+ ml_enqueue(&ml, top);
+ if_input(ifp, &ml);
+
return (recvcount);
}