From: Mohamed Abbas Date: Thu, 20 Mar 2008 15:14:29 +0000 (-0700) Subject: mac80211: prevent tuning during scanning X-Git-Tag: v2.6.26-rc1~1138^2~350^2~8 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=675ef586f04e3a4566c9f437790a340711be5bd2;p=linux-2.6-omap-h63xx.git mac80211: prevent tuning during scanning Postpone calling ieee80211_hw_config if hardware scanning is active. This is similar to solution for software scanning where channel setting is delayed until scan complete. Signed-off-by: Mohamed Abbas Signed-off-by: Reinette Chatre Acked-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 8e8e5a19d89..5af23d31872 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c @@ -287,7 +287,7 @@ int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz) if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { local->oper_channel = chan; - if (local->sta_sw_scanning) + if (local->sta_sw_scanning || local->sta_hw_scanning) ret = 0; else ret = ieee80211_hw_config(local); diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index fc73ca4abc0..bf130b6255a 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c @@ -3615,6 +3615,9 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) if (local->sta_hw_scanning) { local->sta_hw_scanning = 0; + if (ieee80211_hw_config(local)) + printk(KERN_DEBUG "%s: failed to restore operational " + "channel after scan\n", dev->name); /* Restart STA timer for HW scan case */ rcu_read_lock(); list_for_each_entry_rcu(sdata, &local->interfaces, list)