summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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