From 4a584972baebf03b9b2148ed6baaf5ca3dac35ca Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 8 May 2009 14:12:21 +0200 Subject: [PATCH] --- yaml --- r: 150263 b: refs/heads/master c: 99c84cb0692729088788d8e1d1cee670154176e4 h: refs/heads/master i: 150261: 06e7fff817a0439fc49ed9c8cba7ea7dcdd617d3 150259: 51ae268c96b9c2c116dab875ac0f1d8fee35fcb6 150255: df9b95e6ad8516a4d4a1473019014013548ec090 v: v3 --- [refs] | 2 +- trunk/net/mac80211/scan.c | 31 +++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 179b6d37341c..e2f0509c604f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f2ca3ea484a51dc7ea5b738510fd03cb6ca7e2e2 +refs/heads/master: 99c84cb0692729088788d8e1d1cee670154176e4 diff --git a/trunk/net/mac80211/scan.c b/trunk/net/mac80211/scan.c index e51b99b1473c..e65d74ba404b 100644 --- a/trunk/net/mac80211/scan.c +++ b/trunk/net/mac80211/scan.c @@ -559,24 +559,39 @@ void ieee80211_scan_work(struct work_struct *work) if (skip) break; - next_delay = IEEE80211_PROBE_DELAY + - usecs_to_jiffies(local->hw.channel_change_time); + /* + * Probe delay is used to update the NAV, cf. 11.1.3.2.2 + * (which unfortunately doesn't say _why_ step a) is done, + * but it waits for the probe delay or until a frame is + * received - and the received frame would update the NAV). + * For now, we do not support waiting until a frame is + * received. + * + * In any case, it is not necessary for a passive scan. + */ + if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN || + !local->scan_req->n_ssids) { + next_delay = IEEE80211_PASSIVE_CHANNEL_TIME; + break; + } + + next_delay = IEEE80211_PROBE_DELAY; local->scan_state = SCAN_SEND_PROBE; break; case SCAN_SEND_PROBE: - next_delay = IEEE80211_PASSIVE_CHANNEL_TIME; - local->scan_state = SCAN_SET_CHANNEL; - - if (local->scan_channel->flags & IEEE80211_CHAN_PASSIVE_SCAN || - !local->scan_req->n_ssids) - break; for (i = 0; i < local->scan_req->n_ssids; i++) ieee80211_send_probe_req( sdata, NULL, local->scan_req->ssids[i].ssid, local->scan_req->ssids[i].ssid_len, local->scan_req->ie, local->scan_req->ie_len); + + /* + * After sending probe requests, wait for probe responses + * on the channel. + */ next_delay = IEEE80211_CHANNEL_TIME; + local->scan_state = SCAN_SET_CHANNEL; break; }