aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211.c
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2007-11-21 21:53:21 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:55:27 -0500
commitece8edddf067d21c4e5abfe3f1205da1588edbb2 (patch)
tree25450d1aedc630a538ca2f13aa0fa47100256182 /net/mac80211/ieee80211.c
parentf68635e627f9b21db05102e2d8fcd2894493d6bc (diff)
mac80211: hardware scan rework
The scan code in mac80211 makes the software scan assumption in various places. For example, we stop the Tx queue during a software scan so that all the Tx packets will be queued by the stack. We also drop frames not related to scan in the software scan process. But these are not true for hardware scan. Some wireless hardwares (for example iwl3945/4965) has the ability to perform the whole scan process by hardware and/or firmware. The hardware scan is relative powerful in that it tries to maintain normal network traffic while doing a scan in the background. Some drivers (i.e iwlwifi) do provide a way to tune the hardware scan parameters (for example if the STA is associated, what's the max time could the STA leave from the associated channel, how long the scans get suspended after returning to the service channel, etc). But basically this is transparent to the stack. mac80211 should not stop Tx queues or drop Rx packets during a hardware scan. This patch resolves the above problem by spliting the current scan indicator local->sta_scanning into local->sta_sw_scanning and local->sta_hw_scanning. It then changes the scan related code to be aware of hardware scan or software scan in various places. With this patch, iwlwifi performs much better in the scan-while-associated condition and disable_hw_scan=1 should never be required. Cc: Mohamed Abbas <mohamed.abbas@intel.com> Cc: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211.c')
-rw-r--r--net/mac80211/ieee80211.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 6378850d8580..4f8b6653e364 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -350,11 +350,14 @@ static int ieee80211_stop(struct net_device *dev)
350 synchronize_rcu(); 350 synchronize_rcu();
351 skb_queue_purge(&sdata->u.sta.skb_queue); 351 skb_queue_purge(&sdata->u.sta.skb_queue);
352 352
353 if (!local->ops->hw_scan && 353 if (local->scan_dev == sdata->dev) {
354 local->scan_dev == sdata->dev) { 354 if (!local->ops->hw_scan) {
355 local->sta_scanning = 0; 355 local->sta_sw_scanning = 0;
356 cancel_delayed_work(&local->scan_work); 356 cancel_delayed_work(&local->scan_work);
357 } else
358 local->sta_hw_scanning = 0;
357 } 359 }
360
358 flush_workqueue(local->hw.workqueue); 361 flush_workqueue(local->hw.workqueue);
359 362
360 sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED; 363 sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED;
@@ -526,7 +529,7 @@ int ieee80211_hw_config(struct ieee80211_local *local)
526 struct ieee80211_channel *chan; 529 struct ieee80211_channel *chan;
527 int ret = 0; 530 int ret = 0;
528 531
529 if (local->sta_scanning) { 532 if (local->sta_sw_scanning) {
530 chan = local->scan_channel; 533 chan = local->scan_channel;
531 mode = local->scan_hw_mode; 534 mode = local->scan_hw_mode;
532 } else { 535 } else {