--- src/sys/dev/netif/an/if_an.c 2005/06/11 04:26:53 1.26 +++ src/sys/dev/netif/an/if_an.c 2005/07/27 21:56:32 1.27 @@ -804,6 +804,23 @@ an_attach(sc, dev, flags) return(0); } +int +an_detach(device_t dev) +{ + struct an_softc *sc = device_get_softc(dev); + struct ifnet *ifp = &sc->arpcom.ac_if; + + crit_enter(); + an_stop(sc); + ifmedia_removeall(&sc->an_ifmedia); + ether_ifdetach(ifp); + bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); + crit_exit(); + + an_release_resources(dev); + return 0; +} + static void an_rxeof(sc) struct an_softc *sc;