diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-04-08 10:07:48 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-04-08 10:07:48 +0000 |
commit | 8039d47b3db01a6f217429b0b9712a98dc51ce9a (patch) | |
tree | 975bbc68e9062a3bc589de2cd64af866ac6e6b9d /sys/dev | |
parent | 57c48b07e29f5921d3406cc0a75cb741145024f0 (diff) |
Convert to if_input().
ok dlg@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_bce.c | 18 | ||||
-rw-r--r-- | sys/dev/pci/if_lge.c | 16 | ||||
-rw-r--r-- | sys/dev/pci/if_nge.c | 16 | ||||
-rw-r--r-- | sys/dev/pci/if_vge.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/if_wb.c | 17 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_malo.c | 17 |
6 files changed, 36 insertions, 60 deletions
diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c index 92f9e146099..286239e93e4 100644 --- a/sys/dev/pci/if_bce.c +++ b/sys/dev/pci/if_bce.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -694,6 +694,7 @@ void 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; @@ -741,17 +742,7 @@ bce_rxintr(struct bce_softc *sc) 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, @@ -760,6 +751,9 @@ bce_rxintr(struct bce_softc *sc) if (curr >= BCE_NRXDESC) curr = BCE_NRXDESC - 1; } + + if_input(ifp, &ml); + sc->bce_rxin = curr; } diff --git a/sys/dev/pci/if_lge.c b/sys/dev/pci/if_lge.c index 1db8b765567..eaba08d34ae 100644 --- a/sys/dev/pci/if_lge.c +++ b/sys/dev/pci/if_lge.c @@ -1,4 +1,4 @@ -/* $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 @@ -680,6 +680,7 @@ lge_newbuf(struct lge_softc *sc, struct lge_rx_desc *c, struct mbuf *m) 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; @@ -727,20 +728,11 @@ lge_rxeof(struct lge_softc *sc, int cnt) } 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)) @@ -755,9 +747,11 @@ lge_rxeof(struct lge_softc *sc, int cnt) 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; } diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index fe685e59506..4fdf2c83ce6 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $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 @@ -1002,6 +1002,7 @@ nge_newbuf(struct nge_softc *sc, struct nge_desc *c, struct mbuf *m) 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; @@ -1076,7 +1077,6 @@ nge_rxeof(struct nge_softc *sc) m = m0; #ifndef __STRICT_ALIGNMENT } else { - m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = total_len; } #endif @@ -1091,14 +1091,6 @@ nge_rxeof(struct nge_softc *sc) } #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)) @@ -1111,9 +1103,11 @@ nge_rxeof(struct nge_softc *sc) 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; } diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index e4f0ee6c2b6..6977dd0630c 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -1,4 +1,4 @@ -/* $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 @@ -983,6 +983,7 @@ vge_rx_list_init(struct vge_softc *sc) void vge_rxeof(struct vge_softc *sc) { + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct mbuf *m; struct ifnet *ifp; int i, total_len; @@ -1119,7 +1120,6 @@ vge_rxeof(struct vge_softc *sc) m->m_data += ETHER_ALIGN; #endif ifp->if_ipackets++; - m->m_pkthdr.rcvif = ifp; /* Do RX checksumming */ @@ -1140,17 +1140,15 @@ vge_rxeof(struct vge_softc *sc) } #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, diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c index 88fa5c1282c..a6f847a8790 100644 --- a/sys/dev/pci/if_wb.c +++ b/sys/dev/pci/if_wb.c @@ -1,4 +1,4 @@ -/* $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 @@ -922,6 +922,7 @@ wb_newbuf(sc, c) 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; @@ -947,7 +948,7 @@ void wb_rxeof(sc) "bug, forcing reset\n", sc->sc_dev.dv_xname); wb_fixmedia(sc); wb_init(sc); - return; + break; } if (rxstat & WB_RXSTAT_RXERR) { @@ -978,18 +979,10 @@ void wb_rxeof(sc) 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) diff --git a/sys/dev/pcmcia/if_malo.c b/sys/dev/pcmcia/if_malo.c index aa4bec3b79a..bdf2c99d152 100644 --- a/sys/dev/pcmcia/if_malo.c +++ b/sys/dev/pcmcia/if_malo.c @@ -1,4 +1,4 @@ -/* $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> @@ -925,6 +925,7 @@ cmalo_rx(struct malo_softc *sc) 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; @@ -972,16 +973,18 @@ cmalo_rx(struct malo_softc *sc) 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 |