diff options
author | imp <imp@FreeBSD.org> | 2005-01-27 04:51:44 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-01-27 04:51:44 +0000 |
commit | e8b751aa121c53b1fb1405c12d37288a8b19eeb5 (patch) | |
tree | fbafcf5be882bfacebecf9d49426a05b2a944467 /sys/dev/cs/if_cs.c | |
parent | 2b6ce5da9ae2cd14984cd591ccb22338eb83f624 (diff) | |
download | FreeBSD-src-e8b751aa121c53b1fb1405c12d37288a8b19eeb5.zip FreeBSD-src-e8b751aa121c53b1fb1405c12d37288a8b19eeb5.tar.gz |
Write cs_detach() and use it. This resolves the twin problems of the
cs1 interface linger on card eject, as well as the warnings about the
card still using resources. Ooops.
Diffstat (limited to 'sys/dev/cs/if_cs.c')
-rw-r--r-- | sys/dev/cs/if_cs.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index a8f0580..01f4d7b 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -689,6 +689,22 @@ cs_attach(device_t dev) return (0); } +int +cs_detach(device_t dev) +{ + struct cs_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + ifp = &sc->arpcom.ac_if; + + cs_stop(sc); + ifp->if_flags &= ~IFF_RUNNING; + ether_ifdetach(ifp); + cs_release_resources(dev); + return (0); +} + /* * Initialize the board */ |