Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/wi/if_wi.c
Show First 20 Lines • Show All 1,137 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
wi_parent(struct ieee80211com *ic) | wi_parent(struct ieee80211com *ic) | ||||
{ | { | ||||
struct wi_softc *sc = ic->ic_softc; | struct wi_softc *sc = ic->ic_softc; | ||||
int startall = 0; | int startall = 0; | ||||
WI_LOCK(sc); | WI_LOCK(sc); | ||||
/* | |||||
* Can't do promisc and hostap at the same time. If all that's | |||||
* changing is the promisc flag, try to short-circuit a call to | |||||
* wi_init() by just setting PROMISC in the hardware. | |||||
*/ | |||||
if (ic->ic_nrunning > 0) { | if (ic->ic_nrunning > 0) { | ||||
if (ic->ic_opmode != IEEE80211_M_HOSTAP && | if (!(sc->sc_flags & WI_FLAGS_RUNNING)) { | ||||
sc->sc_flags & WI_FLAGS_RUNNING) { | |||||
if (ic->ic_promisc > 0 && | |||||
(sc->sc_flags & WI_FLAGS_PROMISC) == 0) { | |||||
wi_write_val(sc, WI_RID_PROMISC, 1); | |||||
sc->sc_flags |= WI_FLAGS_PROMISC; | |||||
} else if (ic->ic_promisc == 0 && | |||||
(sc->sc_flags & WI_FLAGS_PROMISC) != 0) { | |||||
wi_write_val(sc, WI_RID_PROMISC, 0); | |||||
sc->sc_flags &= ~WI_FLAGS_PROMISC; | |||||
} else { | |||||
wi_init(sc); | wi_init(sc); | ||||
startall = 1; | startall = 1; | ||||
} | } | ||||
} else { | |||||
wi_init(sc); | |||||
startall = 1; | |||||
} | |||||
} else if (sc->sc_flags & WI_FLAGS_RUNNING) { | } else if (sc->sc_flags & WI_FLAGS_RUNNING) { | ||||
wi_stop(sc, 1); | wi_stop(sc, 1); | ||||
sc->wi_gone = 0; | sc->wi_gone = 0; | ||||
} | } | ||||
WI_UNLOCK(sc); | WI_UNLOCK(sc); | ||||
if (startall) | if (startall) | ||||
ieee80211_start_all(ic); | ieee80211_start_all(ic); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 364 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
wi_update_promisc(struct ieee80211com *ic) | wi_update_promisc(struct ieee80211com *ic) | ||||
{ | { | ||||
struct wi_softc *sc = ic->ic_softc; | struct wi_softc *sc = ic->ic_softc; | ||||
WI_LOCK(sc); | WI_LOCK(sc); | ||||
/* XXX handle WEP special case handling? */ | /* XXX handle WEP special case handling? */ | ||||
/* Can't do promisc and hostap at the same time. */ | |||||
wi_write_val(sc, WI_RID_PROMISC, | wi_write_val(sc, WI_RID_PROMISC, | ||||
ic->ic_opmode != IEEE80211_M_HOSTAP && | |||||
(ic->ic_opmode == IEEE80211_M_MONITOR || | (ic->ic_opmode == IEEE80211_M_MONITOR || | ||||
(ic->ic_promisc > 0))); | ic->ic_promisc > 0)); | ||||
WI_UNLOCK(sc); | WI_UNLOCK(sc); | ||||
} | } | ||||
static void | static void | ||||
wi_read_nicid(struct wi_softc *sc) | wi_read_nicid(struct wi_softc *sc) | ||||
{ | { | ||||
struct wi_card_ident *id; | struct wi_card_ident *id; | ||||
char *p; | char *p; | ||||
▲ Show 20 Lines • Show All 494 Lines • Show Last 20 Lines |