summaryrefslogtreecommitdiff
path: root/sys/dev/pcmcia/if_wi_pcmcia.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-04-07 23:23:50 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-04-07 23:23:50 +0000
commit752fff194f19d2b87b971091292141daa060b18f (patch)
tree3a6a6853d650cec9fc59d5e0213772bf92e8192d /sys/dev/pcmcia/if_wi_pcmcia.c
parent22f3493ebcdf605c8797fed0a307101a53259eb3 (diff)
Don't reset COR in wi_reset(), break it out into its own function and
only call it from wi_attach() and wi_pcmcia_activate() (ie: just once). It would be nicer to have the COR reset be part of the bus-specific code but we need to know whether or not we have a Lucent card since old Lucent firmware revs get messed up on a COR soft reset. Even with the COR reset we still need to avoid initializing Symbol cards more than once. However, we *do* want to do a reset after returning from suspend. Therefore, rename wi_gone to wi_flags and store both the attach and init status in it. wi_reset() now checks wi_flags to see if the card should be initialized in the Symbol case. Info on initializing Symbol cards once from NetBSD.
Diffstat (limited to 'sys/dev/pcmcia/if_wi_pcmcia.c')
-rw-r--r--sys/dev/pcmcia/if_wi_pcmcia.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pcmcia/if_wi_pcmcia.c b/sys/dev/pcmcia/if_wi_pcmcia.c
index bd12a0e9d82..d0f4695940b 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.26 2002/04/06 21:58:12 millert Exp $ */
+/* $OpenBSD: if_wi_pcmcia.c,v 1.27 2002/04/07 23:23:49 millert Exp $ */
/* $NetBSD: if_wi_pcmcia.c,v 1.14 2001/11/26 04:34:56 ichiro Exp $ */
/*
@@ -77,6 +77,7 @@ int wi_pcmcia_activate(struct device *, enum devact);
int wi_intr(void *);
int wi_attach(struct wi_softc *);
+void wi_cor_reset(struct wi_softc *);
void wi_init(struct wi_softc *);
void wi_stop(struct wi_softc *);
@@ -379,7 +380,7 @@ wi_pcmcia_detach(dev, flags)
struct wi_softc *sc = &psc->sc_wi;
struct ifnet *ifp = &sc->arpcom.ac_if;
- if (sc->wi_gone) {
+ if (!(sc->wi_flags & WI_FLAGS_ATTACHED)) {
printf("%s: already detached\n", sc->sc_dev.dv_xname);
return (0);
}
@@ -393,7 +394,7 @@ wi_pcmcia_detach(dev, flags)
ether_ifdetach(ifp);
if_detach(ifp);
- sc->wi_gone = 1;
+ sc->wi_flags = 0;
return (0);
}
@@ -414,6 +415,7 @@ wi_pcmcia_activate(dev, act)
pcmcia_function_enable(psc->sc_pf);
sc->sc_ih = pcmcia_intr_establish(psc->sc_pf, IPL_NET,
wi_intr, sc, sc->sc_dev.dv_xname);
+ wi_cor_reset(sc);
wi_init(sc);
break;
@@ -421,6 +423,7 @@ wi_pcmcia_activate(dev, act)
ifp->if_timer = 0;
if (ifp->if_flags & IFF_RUNNING)
wi_stop(sc);
+ sc->wi_flags &= ~WI_FLAGS_INITIALIZED;
pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
pcmcia_function_disable(psc->sc_pf);
break;