diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c index bb9a34d501bd..4842db4b4456 100644 --- a/sys/dev/fatm/if_fatm.c +++ b/sys/dev/fatm/if_fatm.c @@ -60,6 +60,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef ENABLE_BPF +#include +#endif #ifdef INET #include #include @@ -1550,6 +1553,13 @@ fatm_intr_drain_rx(struct fatm_softc *sc) if (vc == NULL) { m_freem(m0); } else { +#ifdef ENABLE_BPF + if (!(vc->param.flags & ATMIO_FLAG_NG) && + vc->param.aal == ATMIO_AAL_5 && + (vc->param.flags & ATM_PH_LLCSNAP)) + BPF_MTAP(sc->ifp, m0); +#endif + ATM_PH_FLAGS(&aph) = vc->param.flags; ATM_PH_VPI(&aph) = vpi; ATM_PH_SETVCI(&aph, vci); @@ -1964,6 +1974,13 @@ fatm_tx(struct fatm_softc *sc, struct mbuf *m, struct card_vcc *vc, u_int mlen) m->m_data += sizeof(struct atm_pseudohdr); m->m_len -= sizeof(struct atm_pseudohdr); +#ifdef ENABLE_BPF + if (!(vc->param.flags & ATMIO_FLAG_NG) && + vc->param.aal == ATMIO_AAL_5 && + (vc->param.flags & ATM_PH_LLCSNAP)) + BPF_MTAP(sc->ifp, m); +#endif + /* map the mbuf */ error = bus_dmamap_load_mbuf(sc->tx_tag, q->map, m, fatm_tpd_load, tpd, BUS_DMA_NOWAIT); @@ -2621,6 +2638,8 @@ fatm_detach(device_t dev) mtx_destroy(&sc->mtx); + if_free(sc->ifp); + return (0); } @@ -3036,6 +3055,10 @@ fatm_attach(device_t dev) atm_ifattach(ifp); ifp->if_snd.ifq_maxlen = 512; +#ifdef ENABLE_BPF + bpfattach(ifp, DLT_ATM_RFC1483, sizeof(struct atmllc)); +#endif + error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_NET, fatm_intr, sc, &sc->ih); if (error) {