Пример #1
0
int
snc_shutdown(device_t dev)
{
	struct snc_softc *sc = device_get_softc(dev);

	SNC_LOCK(sc);
	sncshutdown(sc);
	SNC_UNLOCK(sc);

	return (0);
}
Пример #2
0
/*
 *      snc_pccard_detach - 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);
}