diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-04-05 15:35:16 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-04-05 15:35:16 +0000 |
commit | 53f28cdef695592409cd9222362538d4712ef0d0 (patch) | |
tree | 148bdc42ed900d098c5377d1c70d72c03cb4244e /sys/dev/pcmcia | |
parent | 8bca1c45cf6defda6a2887903a2a61f6b88e2588 (diff) |
Actually set wi_gone when we detach, based on what the an driver does.
Diffstat (limited to 'sys/dev/pcmcia')
-rw-r--r-- | sys/dev/pcmcia/if_wi_pcmcia.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/pcmcia/if_wi_pcmcia.c b/sys/dev/pcmcia/if_wi_pcmcia.c index 1538cb802c8..a88da93bf25 100644 --- a/sys/dev/pcmcia/if_wi_pcmcia.c +++ b/sys/dev/pcmcia/if_wi_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_pcmcia.c,v 1.22 2002/04/04 18:44:35 millert Exp $ */ +/* $OpenBSD: if_wi_pcmcia.c,v 1.23 2002/04/05 15:35:15 millert Exp $ */ /* $NetBSD: if_wi_pcmcia.c,v 1.14 2001/11/26 04:34:56 ichiro Exp $ */ /* @@ -373,12 +373,22 @@ wi_pcmcia_detach(dev, flags) struct wi_softc *sc = &psc->sc_wi; struct ifnet *ifp = &sc->arpcom.ac_if; + if (sc->wi_gone) { + printf("%s: already detached\n", sc->sc_dev.dv_xname); + return (0); + } + + if (ifp->if_flags & IFF_RUNNING) + wi_stop(sc); + pcmcia_io_unmap(psc->sc_pf, psc->sc_io_window); pcmcia_io_free(psc->sc_pf, &psc->sc_pcioh); ether_ifdetach(ifp); if_detach(ifp); + sc->wi_gone = 1; + return (0); } |