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/an/if_an.c | 6 ++---- sys/dev/an/if_an_isa.c | 2 +- sys/dev/an/if_an_pccard.c | 2 +- sys/dev/an/if_an_pci.c | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) (limited to 'sys/dev/an') diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 8abf07b..2cce3bd 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -369,12 +369,10 @@ int an_attach(sc, unit, flags) bzero((char *)&sc->an_stats, sizeof(sc->an_stats)); /* - * Call MI attach routines. + * Call MI attach routine. */ - if_attach(ifp); - ether_ifattach(ifp); + ether_ifattach(ifp, ETHER_BPF_SUPPORTED); callout_handle_init(&sc->an_stat_ch); - bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); return(0); } diff --git a/sys/dev/an/if_an_isa.c b/sys/dev/an/if_an_isa.c index e798437..2d78fcb 100644 --- a/sys/dev/an/if_an_isa.c +++ b/sys/dev/an/if_an_isa.c @@ -131,7 +131,7 @@ an_detach_isa(device_t dev) struct ifnet *ifp = &sc->arpcom.ac_if; an_stop(sc); - if_detach(ifp); + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); an_release_resources(dev); diff --git a/sys/dev/an/if_an_pccard.c b/sys/dev/an/if_an_pccard.c index 6809d6e..66e5590 100644 --- a/sys/dev/an/if_an_pccard.c +++ b/sys/dev/an/if_an_pccard.c @@ -105,7 +105,7 @@ an_pccard_detach(device_t dev) } an_stop(sc); ifp->if_flags &= ~IFF_RUNNING; - if_detach(ifp); + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); sc->an_gone = 1; bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); an_release_resources(dev); diff --git a/sys/dev/an/if_an_pci.c b/sys/dev/an/if_an_pci.c index 987def3..468a5bc 100644 --- a/sys/dev/an/if_an_pci.c +++ b/sys/dev/an/if_an_pci.c @@ -198,7 +198,7 @@ an_detach_pci(device_t dev) struct ifnet *ifp = &sc->arpcom.ac_if; an_stop(sc); - if_detach(ifp); + ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); an_release_resources(dev); -- cgit v1.1