summaryrefslogtreecommitdiffstats
path: root/sys/dev/fatm
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-06-22 06:44:24 +0000
committerharti <harti@FreeBSD.org>2005-06-22 06:44:24 +0000
commit88579b1e2870864a5ed9e3b0340a9fa311420b5a (patch)
treec760ec114bebd2a8345a2018885b1ff213966331 /sys/dev/fatm
parent0fca1a44023afcc9e6793cd9476dde654321d25d (diff)
downloadFreeBSD-src-88579b1e2870864a5ed9e3b0340a9fa311420b5a.zip
FreeBSD-src-88579b1e2870864a5ed9e3b0340a9fa311420b5a.tar.gz
Free the struct ifnet when detaching is complete. Also add BPF stuff.
Approved by: re
Diffstat (limited to 'sys/dev/fatm')
-rw-r--r--sys/dev/fatm/if_fatm.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c
index bb9a34d..4842db4 100644
--- a/sys/dev/fatm/if_fatm.c
+++ b/sys/dev/fatm/if_fatm.c
@@ -60,6 +60,9 @@ __FBSDID("$FreeBSD$");
#include <net/if_types.h>
#include <net/if_atm.h>
#include <net/route.h>
+#ifdef ENABLE_BPF
+#include <net/bpf.h>
+#endif
#ifdef INET
#include <netinet/in.h>
#include <netinet/if_atm.h>
@@ -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) {
OpenPOWER on IntegriCloud