Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net80211/ieee80211_sta.c
Show First 20 Lines • Show All 1,224 Lines • ▼ Show 20 Lines | done: | ||||
IEEE80211_UNLOCK(ic); | IEEE80211_UNLOCK(ic); | ||||
} | } | ||||
/* | /* | ||||
* Return non-zero if a background scan may be continued: | * Return non-zero if a background scan may be continued: | ||||
* o bg scan is active | * o bg scan is active | ||||
* o no channel switch is pending | * o no channel switch is pending | ||||
* o there has not been any traffic recently | * o there has not been any traffic recently | ||||
* o no full-offload scan support (no need for explicitly continuing scan then) | |||||
* | * | ||||
* Note we do not check if there is an administrative enable; | * Note we do not check if there is an administrative enable; | ||||
* this is only done to start the scan. We assume that any | * this is only done to start the scan. We assume that any | ||||
* change in state will be accompanied by a request to cancel | * change in state will be accompanied by a request to cancel | ||||
* active scans which will otherwise cause this test to fail. | * active scans which will otherwise cause this test to fail. | ||||
*/ | */ | ||||
static __inline int | static __inline int | ||||
contbgscan(struct ieee80211vap *vap) | contbgscan(struct ieee80211vap *vap) | ||||
{ | { | ||||
struct ieee80211com *ic = vap->iv_ic; | struct ieee80211com *ic = vap->iv_ic; | ||||
return ((ic->ic_flags_ext & IEEE80211_FEXT_BGSCAN) && | return ((ic->ic_flags_ext & IEEE80211_FEXT_BGSCAN) && | ||||
(ic->ic_flags & IEEE80211_F_CSAPENDING) == 0 && | (ic->ic_flags & IEEE80211_F_CSAPENDING) == 0 && | ||||
!(vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) && | |||||
vap->iv_state == IEEE80211_S_RUN && /* XXX? */ | vap->iv_state == IEEE80211_S_RUN && /* XXX? */ | ||||
ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle)); | ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle)); | ||||
} | } | ||||
/* | /* | ||||
* Return non-zero if a backgrond scan may be started: | * Return non-zero if a backgrond scan may be started: | ||||
* o bg scanning is administratively enabled | * o bg scanning is administratively enabled | ||||
* o no channel switch is pending | * o no channel switch is pending | ||||
* o we are not boosted on a dynamic turbo channel | * o we are not boosted on a dynamic turbo channel | ||||
* o there has not been a scan recently | * o there has not been a scan recently | ||||
* o there has not been any traffic recently | * o there has not been any traffic recently (don't check if full-offload scan) | ||||
*/ | */ | ||||
static __inline int | static __inline int | ||||
startbgscan(struct ieee80211vap *vap) | startbgscan(struct ieee80211vap *vap) | ||||
{ | { | ||||
struct ieee80211com *ic = vap->iv_ic; | struct ieee80211com *ic = vap->iv_ic; | ||||
return ((vap->iv_flags & IEEE80211_F_BGSCAN) && | return ((vap->iv_flags & IEEE80211_F_BGSCAN) && | ||||
(ic->ic_flags & IEEE80211_F_CSAPENDING) == 0 && | (ic->ic_flags & IEEE80211_F_CSAPENDING) == 0 && | ||||
#ifdef IEEE80211_SUPPORT_SUPERG | #ifdef IEEE80211_SUPPORT_SUPERG | ||||
!IEEE80211_IS_CHAN_DTURBO(ic->ic_curchan) && | !IEEE80211_IS_CHAN_DTURBO(ic->ic_curchan) && | ||||
#endif | #endif | ||||
ieee80211_time_after(ticks, ic->ic_lastscan + vap->iv_bgscanintvl) && | ieee80211_time_after(ticks, ic->ic_lastscan + vap->iv_bgscanintvl) && | ||||
ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle)); | ((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) || | ||||
ieee80211_time_after(ticks, ic->ic_lastdata + vap->iv_bgscanidle))); | |||||
} | } | ||||
static void | static void | ||||
sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, | sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, | ||||
const struct ieee80211_rx_stats *rxs, | const struct ieee80211_rx_stats *rxs, | ||||
int rssi, int nf) | int rssi, int nf) | ||||
{ | { | ||||
#define ISREASSOC(_st) ((_st) == IEEE80211_FC0_SUBTYPE_REASSOC_RESP) | #define ISREASSOC(_st) ((_st) == IEEE80211_FC0_SUBTYPE_REASSOC_RESP) | ||||
▲ Show 20 Lines • Show All 589 Lines • Show Last 20 Lines |