From 7357df6b4854f9914c605ad7c7cf3c01ea7700fd Mon Sep 17 00:00:00 2001 From: archie Date: Thu, 13 Jul 2000 22:54:34 +0000 Subject: Make all Ethernet drivers attach using ether_ifattach() and detach using ether_ifdetach(). The former consolidates the operations of if_attach(), ng_ether_attach(), and bpfattach(). The latter consolidates the corresponding detach operations. Reviewed by: julian, freebsd-net --- sys/dev/awi/awi.c | 7 ++----- sys/dev/awi/if_awi_pccard.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'sys/dev/awi') diff --git a/sys/dev/awi/awi.c b/sys/dev/awi/awi.c index 10cf224..65783c6 100644 --- a/sys/dev/awi/awi.c +++ b/sys/dev/awi/awi.c @@ -308,13 +308,10 @@ awi_attach(sc) sc->sc_dev.dv_xname, sc->sc_mib_phy.IEEE_PHY_Type == AWI_PHY_TYPE_FH ? "FH" : "DS", sc->sc_tx_rate / 10, ether_sprintf(sc->sc_mib_addr.aMAC_Address)); - if_attach(ifp); #ifdef __FreeBSD__ - ether_ifattach(ifp); -#if NBPFILTER > 0 - bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); -#endif + ether_ifattach(ifp, ETHER_BPF_SUPPORTED); #else + if_attach(ifp); ether_ifattach(ifp, sc->sc_mib_addr.aMAC_Address); #if NBPFILTER > 0 bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); diff --git a/sys/dev/awi/if_awi_pccard.c b/sys/dev/awi/if_awi_pccard.c index c9b8150..95bf1c5 100644 --- a/sys/dev/awi/if_awi_pccard.c +++ b/sys/dev/awi/if_awi_pccard.c @@ -198,7 +198,7 @@ awi_pccard_detach(device_t dev) struct awi_softc *sc = &psc->sc_awi; struct ifnet *ifp = &sc->sc_ec.ac_if; - if_detach(ifp); + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); ifp->if_flags &= ~IFF_RUNNING; if (psc->sc_intrhand) { bus_teardown_intr(dev, psc->sc_irq_res, psc->sc_intrhand); -- cgit v1.1