Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bwn/if_bwn.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,207 Lines • ▼ Show 20 Lines | bwn_parent(struct ieee80211com *ic) | ||||
struct bwn_softc *sc = ic->ic_softc; | struct bwn_softc *sc = ic->ic_softc; | ||||
int startall = 0; | int startall = 0; | ||||
BWN_LOCK(sc); | BWN_LOCK(sc); | ||||
if (ic->ic_nrunning > 0) { | if (ic->ic_nrunning > 0) { | ||||
if ((sc->sc_flags & BWN_FLAG_RUNNING) == 0) { | if ((sc->sc_flags & BWN_FLAG_RUNNING) == 0) { | ||||
bwn_init(sc); | bwn_init(sc); | ||||
startall = 1; | startall = 1; | ||||
} else | } | ||||
bwn_update_promisc(ic); | |||||
} else if (sc->sc_flags & BWN_FLAG_RUNNING) | } else if (sc->sc_flags & BWN_FLAG_RUNNING) | ||||
bwn_stop(sc); | bwn_stop(sc); | ||||
BWN_UNLOCK(sc); | BWN_UNLOCK(sc); | ||||
if (startall) | if (startall) | ||||
ieee80211_start_all(ic); | ieee80211_start_all(ic); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,642 Lines • ▼ Show 20 Lines | |||||
static struct ieee80211vap * | static struct ieee80211vap * | ||||
bwn_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, | bwn_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, | ||||
enum ieee80211_opmode opmode, int flags, | enum ieee80211_opmode opmode, int flags, | ||||
const uint8_t bssid[IEEE80211_ADDR_LEN], | const uint8_t bssid[IEEE80211_ADDR_LEN], | ||||
const uint8_t mac[IEEE80211_ADDR_LEN]) | const uint8_t mac[IEEE80211_ADDR_LEN]) | ||||
{ | { | ||||
struct ieee80211vap *vap; | struct ieee80211vap *vap; | ||||
struct bwn_vap *bvp; | struct bwn_vap *bvp; | ||||
int firstvap = 1; | |||||
if (!TAILQ_EMPTY(&ic->ic_vaps)) | |||||
firstvap = 0; | |||||
switch (opmode) { | switch (opmode) { | ||||
case IEEE80211_M_HOSTAP: | case IEEE80211_M_HOSTAP: | ||||
case IEEE80211_M_MBSS: | case IEEE80211_M_MBSS: | ||||
case IEEE80211_M_STA: | case IEEE80211_M_STA: | ||||
case IEEE80211_M_WDS: | case IEEE80211_M_WDS: | ||||
case IEEE80211_M_MONITOR: | case IEEE80211_M_MONITOR: | ||||
case IEEE80211_M_IBSS: | case IEEE80211_M_IBSS: | ||||
case IEEE80211_M_AHDEMO: | case IEEE80211_M_AHDEMO: | ||||
Show All 12 Lines | bwn_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, | ||||
/* override max aid so sta's cannot assoc when we're out of sta id's */ | /* override max aid so sta's cannot assoc when we're out of sta id's */ | ||||
vap->iv_max_aid = BWN_STAID_MAX; | vap->iv_max_aid = BWN_STAID_MAX; | ||||
ieee80211_ratectl_init(vap); | ieee80211_ratectl_init(vap); | ||||
/* complete setup */ | /* complete setup */ | ||||
ieee80211_vap_attach(vap, ieee80211_media_change, | ieee80211_vap_attach(vap, ieee80211_media_change, | ||||
ieee80211_media_status, mac); | ieee80211_media_status, mac); | ||||
/* Reflect promisc mode settings. */ | |||||
if (!firstvap) | |||||
bwn_update_promisc(ic); | |||||
return (vap); | return (vap); | ||||
} | } | ||||
static void | static void | ||||
bwn_vap_delete(struct ieee80211vap *vap) | bwn_vap_delete(struct ieee80211vap *vap) | ||||
{ | { | ||||
struct bwn_vap *bvp = BWN_VAP(vap); | struct bwn_vap *bvp = BWN_VAP(vap); | ||||
▲ Show 20 Lines • Show All 11,175 Lines • Show Last 20 Lines |