diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-05-01 14:56:19 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-05-01 14:56:19 +0000 |
commit | f3bd8ae2f67589b1d9eeaf21402768d1203c1ae8 (patch) | |
tree | 15453e2978f8d9ac5215265b538a13cb8202cf0a /sys/dev/ic/lance.c | |
parent | 862db6b1f27ef456ccced532e02426ae48ae46c6 (diff) |
Convert to if_input(), ok miod@
Diffstat (limited to 'sys/dev/ic/lance.c')
-rw-r--r-- | sys/dev/ic/lance.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/sys/dev/ic/lance.c b/sys/dev/ic/lance.c index 317e085b5f8..1eb8d7ad5ca 100644 --- a/sys/dev/ic/lance.c +++ b/sys/dev/ic/lance.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lance.c,v 1.5 2014/12/22 02:28:51 tedu Exp $ */ +/* $OpenBSD: lance.c,v 1.6 2015/05/01 14:56:18 mpi Exp $ */ /* $NetBSD: lance.c,v 1.46 2012/02/02 19:43:03 tls Exp $ */ /*- @@ -358,14 +358,12 @@ lance_put(struct lance_softc *sc, int boff, struct mbuf *m) integrate struct mbuf * lance_get(struct lance_softc *sc, int boff, int totlen) { - struct ifnet *ifp = &sc->sc_arpcom.ac_if; struct mbuf *m, *top, **mp; int len, pad; 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; @@ -403,10 +401,7 @@ lance_get(struct lance_softc *sc, int boff, int totlen) return (top); } -/* - * Pass a packet to the higher levels. - */ -void +struct mbuf * lance_read(struct lance_softc *sc, int boff, int len) { struct mbuf *m; @@ -422,14 +417,14 @@ lance_read(struct lance_softc *sc, int boff, int len) sc->sc_dev.dv_xnam, len); #endif ifp->if_ierrors++; - return; + return (NULL); } /* Pull packet off interface. */ m = lance_get(sc, boff, len); if (m == NULL) { ifp->if_ierrors++; - return; + return (NULL); } ifp->if_ipackets++; @@ -447,7 +442,7 @@ lance_read(struct lance_softc *sc, int boff, int len) if (ETHER_CMP(eh->ether_dhost, sc->sc_arpcom.ac_enaddr) && ETHER_CMP(eh->ether_dhost, bcast_enaddr)) { m_freem(m); - return; + return (NULL); } #endif @@ -457,20 +452,10 @@ lance_read(struct lance_softc *sc, int boff, int len) */ if (!ETHER_CMP(eh->ether_shost, sc->sc_arpcom.ac_enaddr)) { m_freem(m); - return; + return (NULL); } -#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); + return (m); } void |