1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-05 09:14:03 +00:00

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.
This commit is contained in:
Warner Losh 2005-01-27 04:51:44 +00:00
parent 118c73087b
commit 221db7416d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140888
3 changed files with 17 additions and 2 deletions

View File

@ -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
*/

View File

@ -114,9 +114,7 @@ static device_method_t cs_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pccard_compat_probe),
DEVMETHOD(device_attach, pccard_compat_attach),
#ifdef CS_HAS_DETACH
DEVMETHOD(device_detach, cs_detach),
#endif
/* Card interface */
DEVMETHOD(card_compat_match, cs_pccard_match),

View File

@ -72,6 +72,7 @@ int cs_alloc_memory(device_t dev, int rid, int size);
int cs_alloc_irq(device_t dev, int rid, int flags);
int cs_attach(device_t dev);
int cs_cs89x0_probe(device_t dev);
int cs_detach(device_t dev);
void cs_release_resources(device_t dev);
driver_intr_t csintr;