Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89865
b: refs/heads/master
c: 69d464d
h: refs/heads/master
i:
  89863: c753550
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Feb 29, 2008
1 parent 76e738f commit 8989ccf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee688b000d35f413f33561ec9c7d3355be561e2f
refs/heads/master: 69d464d5938ca0f4fb3447b3e32872e0ca79efc1
24 changes: 18 additions & 6 deletions trunk/net/mac80211/ieee80211_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -3412,22 +3412,28 @@ void ieee80211_sta_scan_work(struct work_struct *work)

switch (local->scan_state) {
case SCAN_SET_CHANNEL:
/* get current scan band */
/*
* Get current scan band. scan_band may be IEEE80211_NUM_BANDS
* after we successfully scanned the last channel of the last
* band (and the last band is supported by the hw)
*/
if (local->scan_band < IEEE80211_NUM_BANDS)
sband = local->hw.wiphy->bands[local->scan_band];
else
sband = NULL;

/* if we started at an unsupported one, advance */
while (!sband && local->scan_band < IEEE80211_NUM_BANDS) {
/*
* If we are at an unsupported band and have more bands
* left to scan, advance to the next supported one.
*/
while (!sband && local->scan_band < IEEE80211_NUM_BANDS - 1) {
local->scan_band++;
sband = local->hw.wiphy->bands[local->scan_band];
local->scan_channel_idx = 0;
}

if (!sband ||
(local->scan_channel_idx >= sband->n_channels &&
local->scan_band >= IEEE80211_NUM_BANDS)) {
/* if no more bands/channels left, complete scan */
if (!sband || local->scan_channel_idx >= sband->n_channels) {
ieee80211_scan_completed(local_to_hw(local));
return;
}
Expand All @@ -3449,8 +3455,14 @@ void ieee80211_sta_scan_work(struct work_struct *work)
}
}

/* advance state machine to next channel/band */
local->scan_channel_idx++;
if (local->scan_channel_idx >= sband->n_channels) {
/*
* scan_band may end up == IEEE80211_NUM_BANDS, but
* we'll catch that case above and complete the scan
* if that is the case.
*/
local->scan_band++;
local->scan_channel_idx = 0;
}
Expand Down

0 comments on commit 8989ccf

Please sign in to comment.