-/* $OpenBSD: if_cdce.c,v 1.63 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: if_cdce.c,v 1.64 2015/04/10 08:41:43 mpi Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com>
struct cdce_softc *sc = c->cdce_sc;
struct ifnet *ifp = GET_IFP(sc);
struct mbuf *m;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
int total_len = 0;
int s;
}
ifp->if_ipackets++;
-
m->m_pkthdr.len = m->m_len = total_len;
- m->m_pkthdr.rcvif = ifp;
-
- s = splnet();
+ ml_enqueue(&ml, m);
if (cdce_newbuf(sc, c, NULL) == ENOBUFS) {
ifp->if_ierrors++;
- goto done1;
+ goto done;
}
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
-
-done1:
+ s = splnet();
+ if_input(ifp, &ml);
splx(s);
done:
-/* $OpenBSD: if_cdcef.c,v 1.35 2014/12/22 02:28:52 tedu Exp $ */
+/* $OpenBSD: if_cdcef.c,v 1.36 2015/04/10 08:41:43 mpi Exp $ */
/*
* Copyright (c) 2007 Dale Rahn <drahn@openbsd.org>
struct cdcef_softc *sc = priv;
int total_len = 0;
struct ifnet *ifp = GET_IFP(sc);
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m = NULL;
goto done;
}
- s = splnet();
if (ifp->if_flags & IFF_RUNNING) {
m = cdcef_newbuf();
if (m == NULL) {
/* message? */
ifp->if_ierrors++;
- goto done1;
+ goto done;
}
m->m_pkthdr.len = m->m_len = total_len;
bcopy(sc->sc_buffer_out, mtod(m, char *), total_len);
- m->m_pkthdr.rcvif = ifp;
ifp->if_ipackets++;
-
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
}
-done1:
+ s = splnet();
+ if_input(ifp, &ml);
splx(s);
-
done:
/* Setup another xfer. */
usbf_setup_xfer(xfer, sc->sc_pipe_out, sc, sc->sc_buffer_out,
-/* $OpenBSD: if_cue.c,v 1.69 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: if_cue.c,v 1.70 2015/04/10 08:41:43 mpi Exp $ */
/* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
struct cue_chain *c = priv;
struct cue_softc *sc = c->cue_sc;
struct ifnet *ifp = GET_IFP(sc);
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
int total_len = 0;
u_int16_t len;
ifp->if_ipackets++;
m_adj(m, sizeof(u_int16_t));
m->m_pkthdr.len = m->m_len = total_len;
+ ml_enqueue(&ml, m);
- m->m_pkthdr.rcvif = ifp;
-
- s = splnet();
-
- /* XXX ugly */
if (cue_newbuf(sc, c, NULL) == ENOBUFS) {
ifp->if_ierrors++;
- goto done1;
+ goto done;
}
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- DPRINTFN(10,("%s: %s: deliver %d\n", sc->cue_dev.dv_xname,
- __func__, m->m_len));
- ether_input_mbuf(ifp, m);
- done1:
+ s = splnet();
+ if_input(ifp, &ml);
splx(s);
done:
-/* $OpenBSD: if_kue.c,v 1.78 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: if_kue.c,v 1.79 2015/04/10 08:41:43 mpi Exp $ */
/* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
struct kue_chain *c = priv;
struct kue_softc *sc = c->kue_sc;
struct ifnet *ifp = GET_IFP(sc);
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
int total_len = 0;
int s;
ifp->if_ipackets++;
m->m_pkthdr.len = m->m_len = total_len;
+ ml_enqueue(&ml, m);
- m->m_pkthdr.rcvif = ifp;
-
- s = splnet();
-
- /* XXX ugly */
if (kue_newbuf(sc, c, NULL) == ENOBUFS) {
ifp->if_ierrors++;
- goto done1;
+ goto done;
}
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- DPRINTFN(10,("%s: %s: deliver %d\n", sc->kue_dev.dv_xname,
- __func__, m->m_len));
- ether_input_mbuf(ifp, m);
- done1:
+ s = splnet();
+ if_input(ifp, &ml);
splx(s);
done:
-/* $OpenBSD: if_mos.c,v 1.28 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: if_mos.c,v 1.29 2015/04/10 08:41:43 mpi Exp $ */
/*
* Copyright (c) 2008 Johann Christian Rode <jcrode@gmx.net>
u_int8_t rxstat;
u_int32_t total_len;
u_int16_t pktlen = 0;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
int s;
}
ifp->if_ipackets++;
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = pktlen;
memcpy(mtod(m, char *), buf, pktlen);
- /* push the packet up */
- s = splnet();
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
+ ml_enqueue(&ml, m);
+ s = splnet();
+ if_input(ifp, &ml);
splx(s);
done:
-/* $OpenBSD: if_upl.c,v 1.63 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: if_upl.c,v 1.64 2015/04/10 08:41:43 mpi Exp $ */
/* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
struct upl_chain *c = priv;
struct upl_softc *sc = c->upl_sc;
struct ifnet *ifp = &sc->sc_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
int total_len = 0;
int s;
ifp->if_ipackets++;
m->m_pkthdr.len = m->m_len = total_len;
+ ml_enqueue(&ml, m);
- m->m_pkthdr.rcvif = ifp;
-
- s = splnet();
-
- /* XXX ugly */
if (upl_newbuf(sc, c, NULL) == ENOBUFS) {
ifp->if_ierrors++;
- goto done1;
- }
-
-#if NBPFILTER > 0
- if (ifp->if_bpf) {
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
+ goto done;
}
-#endif
-
- DPRINTFN(10,("%s: %s: deliver %d\n", sc->sc_dev.dv_xname,
- __func__, m->m_len));
- ether_input_mbuf(ifp, m);
-
- done1:
+ s = splnet();
+ if_input(ifp, &ml);
splx(s);
-
done:
#if 1
/* Setup new transfer. */