FreeBSD/sys/dev/snc/if_snc_pccard.c
/*
 *      snc_pccard_detach - detach this instance from the device.
 */
detach this instance from the device.
detach this instance from the device .
static int
snc_pccard_detach(device_t dev)
{
	struct snc_softc *sc = device_get_softc(dev);
	struct ifnet *ifp = sc->sc_ifp;
	if (sc->gone) {
		device_printf(dev, "already unloaded\n");
		return (0);
	}
	SNC_LOCK(sc);
	sncshutdown(sc);
	SNC_UNLOCK(sc);
	callout_drain(&sc->sc_timer);
	ether_ifdetach(ifp);
	sc->gone = 1;
	bus_teardown_intr(dev, sc->irq, sc->irq_handle);
	snc_release_resources(dev);
	mtx_destroy(&sc->sc_lock);
	return (0);
}
static int snc_pccard_detach ( device_t dev ) { struct snc_softc * sc = device_get_softc ( dev ) ; struct ifnet * ifp = sc -> sc_ifp ; if ( sc -> gone ) { device_printf ( dev , " \n " ) ; return ( 0 ) ; } SNC_LOCK ( sc ) ; sncshutdown ( sc ) ; SNC_UNLOCK ( sc ) ; callout_drain ( & sc -> sc_timer ) ; ether_ifdetach ( ifp ) ; sc -> gone = 1 ; bus_teardown_intr ( dev , sc -> irq , sc -> irq_handle ) ; snc_release_resources ( dev ) ; mtx_destroy ( & sc -> sc_lock ) ; return ( 0 ) ; }
snc_pccard_detach - detach this instance from the device.
snc_pccard_detach - detach this instance from the device .