diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-03-11 22:15:23 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-03-11 22:15:23 +0000 |
commit | 5b1896b132a8add8cef6724aebcc75c1a98c1388 (patch) | |
tree | 4e8a6080aebfe2e47708d3317e9c4b946eadec69 /sys | |
parent | 567207f7ab6696c774ba6590b7e4a4864cf83b95 (diff) |
Convert to if_input().
Tested and ok benno@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_cas.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index bedb32c3025..314d3e3380d 100644 --- a/sys/dev/pci/if_cas.c +++ b/sys/dev/pci/if_cas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cas.c,v 1.37 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_cas.c,v 1.38 2015/03/11 22:15:22 mpi Exp $ */ /* * @@ -1164,6 +1164,7 @@ cas_rint(struct cas_softc *sc) bus_space_tag_t t = sc->sc_memt; bus_space_handle_t h = sc->sc_memh; struct cas_rxsoft *rxs; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct mbuf *m; u_int64_t word[4]; int len, off, idx; @@ -1197,23 +1198,13 @@ cas_rint(struct cas_softc *sc) cp = rxs->rxs_kva + off * 256 + ETHER_ALIGN; m = m_devget(cp, len, ETHER_ALIGN, ifp); - + if (word[0] & CAS_RC0_RELEASE_HDR) cas_add_rxbuf(sc, idx); if (m != NULL) { - -#if NBPFILTER > 0 - /* - * Pass this up to any BPF listeners, but only - * pass it up the stack if its for us. - */ - if (ifp->if_bpf) - bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN); -#endif /* NBPFILTER > 0 */ - ifp->if_ipackets++; - ether_input_mbuf(ifp, m); + ml_enqueue(&ml, m); } else ifp->if_ierrors++; } @@ -1238,17 +1229,8 @@ cas_rint(struct cas_softc *sc) cas_add_rxbuf(sc, idx); if (m != NULL) { -#if NBPFILTER > 0 - /* - * Pass this up to any BPF listeners, but only - * pass it up the stack if its for us. - */ - if (ifp->if_bpf) - bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN); -#endif /* NBPFILTER > 0 */ - ifp->if_ipackets++; - ether_input_mbuf(ifp, m); + ml_enqueue(&ml, m); } else ifp->if_ierrors++; } @@ -1276,6 +1258,8 @@ cas_rint(struct cas_softc *sc) DPRINTF(sc, ("cas_rint: done sc->rxptr %d, complete %d\n", sc->sc_rxptr, bus_space_read_4(t, h, CAS_RX_COMPLETION))); + if_input(ifp, &ml); + return (1); } |