From adceaad04f6fd5872996207d9bc5e69aa07f9584 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Thu, 12 Feb 2015 09:08:48 +0000 Subject: Convert to if_input(). ok dlg@ --- sys/dev/ic/fxp.c | 17 +++++++---------- sys/dev/usb/if_url.c | 12 ++++-------- 2 files changed, 11 insertions(+), 18 deletions(-) (limited to 'sys') diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c index d636a4d4d7a..681773a1323 100644 --- a/sys/dev/ic/fxp.c +++ b/sys/dev/ic/fxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fxp.c,v 1.118 2014/12/22 02:28:51 tedu Exp $ */ +/* $OpenBSD: fxp.c,v 1.119 2015/02/12 09:08:00 mpi Exp $ */ /* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */ /* @@ -785,6 +785,7 @@ fxp_intr(void *arg) { struct fxp_softc *sc = arg; struct ifnet *ifp = &sc->sc_arpcom.ac_if; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); u_int16_t statack; bus_dmamap_t rxmap; int claimed = 0; @@ -911,15 +912,8 @@ rcvloop: goto rcvloop; } - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = m->m_len = - total_len; -#if NBPFILTER > 0 - if (ifp->if_bpf) - bpf_mtap(ifp->if_bpf, m, - BPF_DIRECTION_IN); -#endif /* NBPFILTER > 0 */ - ether_input_mbuf(ifp, m); + m->m_pkthdr.len = m->m_len = total_len; + ml_enqueue(&ml, m); } goto rcvloop; } @@ -935,6 +929,9 @@ rcvloop: } } + + if_input(ifp, &ml); + return (claimed); } diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index 90f3154febd..eb8941ed441 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_url.c,v 1.71 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_url.c,v 1.72 2015/02/12 09:08:47 mpi Exp $ */ /* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */ /* * Copyright (c) 2001, 2002 @@ -912,6 +912,7 @@ url_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status) struct url_chain *c = priv; struct url_softc *sc = c->url_sc; struct ifnet *ifp = GET_IFP(sc); + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct mbuf *m; u_int32_t total_len; url_rxhdr_t rxhdr; @@ -970,7 +971,7 @@ url_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status) m = c->url_mbuf; m->m_pkthdr.len = m->m_len = total_len; - m->m_pkthdr.rcvif = ifp; + ml_enqueue(&ml, m); s = splnet(); @@ -979,14 +980,9 @@ url_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status) goto done1; } -#if NBPFILTER > 0 - if (ifp->if_bpf) - bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN); -#endif - DPRINTF(("%s: %s: deliver %d\n", sc->sc_dev.dv_xname, __func__, m->m_len)); - ether_input_mbuf(ifp, m); + if_input(ifp, &ml); done1: splx(s); -- cgit v1.2.3