diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-03-29 10:59:48 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-03-29 10:59:48 +0000 |
commit | 2b7187e37fc90594e365eaea83d5699a82489e68 (patch) | |
tree | 7b16a323d12e1451162c37c682e5b282b568d9b6 /sys | |
parent | 3ff05852f5dbafbb167414959e2e1b24915eeae7 (diff) |
Convert qe(4) et be(4) to if_input().
Tested by miod@, thanks!
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc/dev/be.c | 18 | ||||
-rw-r--r-- | sys/arch/sparc/dev/qe.c | 17 | ||||
-rw-r--r-- | sys/arch/sparc/dev/qec.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc/dev/qecvar.h | 4 |
4 files changed, 14 insertions, 31 deletions
diff --git a/sys/arch/sparc/dev/be.c b/sys/arch/sparc/dev/be.c index eb15de77124..256ce82f21f 100644 --- a/sys/arch/sparc/dev/be.c +++ b/sys/arch/sparc/dev/be.c @@ -1,4 +1,4 @@ -/* $OpenBSD: be.c,v 1.49 2015/03/28 19:07:07 miod Exp $ */ +/* $OpenBSD: be.c,v 1.50 2015/03/29 10:59:47 mpi Exp $ */ /* * Copyright (c) 1998 Theo de Raadt and Jason L. Wright. @@ -988,6 +988,7 @@ be_read(sc, idx, len) int idx, 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) || @@ -1003,24 +1004,15 @@ be_read(sc, idx, len) /* * Pull packet off interface. */ - m = qec_get(ifp, sc->sc_bufs->rx_buf[idx & BE_RX_RING_MASK], len); + m = qec_get(sc->sc_bufs->rx_buf[idx & BE_RX_RING_MASK], len); if (m == NULL) { ifp->if_ierrors++; return; } 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); } /* diff --git a/sys/arch/sparc/dev/qe.c b/sys/arch/sparc/dev/qe.c index d7155680bc0..399c76d85fe 100644 --- a/sys/arch/sparc/dev/qe.c +++ b/sys/arch/sparc/dev/qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qe.c,v 1.38 2015/03/28 19:07:07 miod Exp $ */ +/* $OpenBSD: qe.c,v 1.39 2015/03/29 10:59:47 mpi Exp $ */ /* * Copyright (c) 1998, 2000 Jason L. Wright. @@ -747,6 +747,7 @@ qe_read(sc, idx, len) int idx, 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) || @@ -762,23 +763,15 @@ qe_read(sc, idx, len) /* * Pull packet off interface. */ - m = qec_get(ifp, sc->sc_bufs->rx_buf[idx & QE_RX_RING_MASK], len); + m = qec_get(sc->sc_bufs->rx_buf[idx & QE_RX_RING_MASK], len); if (m == NULL) { ifp->if_ierrors++; return; } 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); } /* diff --git a/sys/arch/sparc/dev/qec.c b/sys/arch/sparc/dev/qec.c index d4af90d799b..a887e51732d 100644 --- a/sys/arch/sparc/dev/qec.c +++ b/sys/arch/sparc/dev/qec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qec.c,v 1.22 2015/03/22 12:45:59 miod Exp $ */ +/* $OpenBSD: qec.c,v 1.23 2015/03/29 10:59:47 mpi Exp $ */ /* * Copyright (c) 1998 Theo de Raadt and Jason L. Wright. @@ -348,8 +348,7 @@ qec_put(buf, m0) * we copy into clusters. */ struct mbuf * -qec_get(ifp, buf, totlen) - struct ifnet *ifp; +qec_get(buf, totlen) u_int8_t *buf; int totlen; { @@ -359,7 +358,6 @@ qec_get(ifp, buf, totlen) 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); len = MHLEN; diff --git a/sys/arch/sparc/dev/qecvar.h b/sys/arch/sparc/dev/qecvar.h index 8c9e0f737f1..68de6570304 100644 --- a/sys/arch/sparc/dev/qecvar.h +++ b/sys/arch/sparc/dev/qecvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: qecvar.h,v 1.11 2006/06/02 20:00:54 miod Exp $ */ +/* $OpenBSD: qecvar.h,v 1.12 2015/03/29 10:59:47 mpi Exp $ */ /* * Copyright (c) 1998 Theo de Raadt and Jason L. Wright. @@ -46,4 +46,4 @@ struct qec_softc { void qec_reset(struct qec_softc *); int qec_put(u_int8_t *, struct mbuf *); -struct mbuf *qec_get(struct ifnet *, u_int8_t *, int); +struct mbuf *qec_get(u_int8_t *, int); |