summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-03-18 02:54:39 +0000
committerimp <imp@FreeBSD.org>2003-03-18 02:54:39 +0000
commit78371158c8a40f9bc2f40c86692e1e8b2a6c6725 (patch)
treecbea438d4c242fc9c57ac9a5a107b7d71616697d
parent7f214b15015d0e4fff36e43362b01dd4fbc673f9 (diff)
downloadFreeBSD-src-78371158c8a40f9bc2f40c86692e1e8b2a6c6725.zip
FreeBSD-src-78371158c8a40f9bc2f40c86692e1e8b2a6c6725.tar.gz
Move symbol reset detection code back into wi_reset. This is a more
reliable way to detect if the symbol cards have been reset or not. This makes symbol cards work better. Submitted by: deischen
-rw-r--r--sys/dev/wi/if_wi.c17
-rw-r--r--sys/dev/wi/if_wivar.h1
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 7a12be8..6d2b10b 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -627,15 +627,11 @@ wi_init(void *arg)
return;
}
- wasenabled = sc->sc_enabled;
- if (!sc->sc_enabled) {
- sc->sc_enabled = 1;
- } else
- wi_stop(ifp, 0);
-
/* Symbol firmware cannot be initialized more than once */
- if (sc->sc_firmware_type != WI_SYMBOL || !wasenabled)
- wi_reset(sc);
+ if ((wasenabled = sc->sc_enabled))
+ wi_stop(ifp, 0);
+ sc->sc_enabled = 1;
+ wi_reset(sc);
/* common 802.11 configuration */
ic->ic_flags &= ~IEEE80211_F_IBSSON;
@@ -957,6 +953,11 @@ wi_reset(struct wi_softc *sc)
#define WI_INIT_TRIES 5
int i, error;
+ /* Symbol firmware cannot be reset more than once. */
+ if (sc->sc_firmware_type == WI_SYMBOL && sc->sc_reset)
+ return (0);
+ sc->sc_reset = 1;
+
for (i = 0; i < WI_INIT_TRIES; i++) {
if ((error = wi_cmd(sc, WI_CMD_INI, 0, 0, 0)) == 0)
break;
diff --git a/sys/dev/wi/if_wivar.h b/sys/dev/wi/if_wivar.h
index bfc1d28..6b6200f 100644
--- a/sys/dev/wi/if_wivar.h
+++ b/sys/dev/wi/if_wivar.h
@@ -68,6 +68,7 @@ struct wi_softc {
int sc_unit;
int wi_gone;
int sc_enabled;
+ int sc_reset;
int sc_firmware_type;
#define WI_NOTYPE 0
#define WI_LUCENT 1
OpenPOWER on IntegriCloud