diff options
| author | Warner Losh <imp@FreeBSD.org> | 2003-03-18 02:54:39 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2003-03-18 02:54:39 +0000 |
| commit | 572ab50c542ea45b36c972543147fe34bd0fb8e8 (patch) | |
| tree | cbea438d4c242fc9c57ac9a5a107b7d71616697d | |
| parent | 08d49adb7f08ee671c8efb1ddfb2ada4a647c81d (diff) | |
Notes
| -rw-r--r-- | sys/dev/wi/if_wi.c | 17 | ||||
| -rw-r--r-- | sys/dev/wi/if_wivar.h | 1 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 7a12be844456..6d2b10be36b6 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 bfc1d2840417..6b6200ff4971 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 |
