aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/iface.c3
-rw-r--r--net/mac80211/main.c14
-rw-r--r--net/mac80211/scan.c1
3 files changed, 11 insertions, 7 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 8b6daf0219f4..8c9f1c722cdb 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -964,5 +964,6 @@ void ieee80211_recalc_idle(struct ieee80211_local *local)
964 mutex_lock(&local->iflist_mtx); 964 mutex_lock(&local->iflist_mtx);
965 chg = __ieee80211_recalc_idle(local); 965 chg = __ieee80211_recalc_idle(local);
966 mutex_unlock(&local->iflist_mtx); 966 mutex_unlock(&local->iflist_mtx);
967 ieee80211_hw_config(local, chg); 967 if (chg)
968 ieee80211_hw_config(local, chg);
968} 969}
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index b80bc80e46cf..76df5eabf268 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -154,15 +154,17 @@ static void ieee80211_master_set_multicast_list(struct net_device *dev)
154 154
155int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) 155int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
156{ 156{
157 struct ieee80211_channel *chan; 157 struct ieee80211_channel *chan, *scan_chan;
158 int ret = 0; 158 int ret = 0;
159 int power; 159 int power;
160 enum nl80211_channel_type channel_type; 160 enum nl80211_channel_type channel_type;
161 161
162 might_sleep(); 162 might_sleep();
163 163
164 if (local->sw_scanning) { 164 scan_chan = local->scan_channel;
165 chan = local->scan_channel; 165
166 if (scan_chan) {
167 chan = scan_chan;
166 channel_type = NL80211_CHAN_NO_HT; 168 channel_type = NL80211_CHAN_NO_HT;
167 } else { 169 } else {
168 chan = local->oper_channel; 170 chan = local->oper_channel;
@@ -176,7 +178,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
176 changed |= IEEE80211_CONF_CHANGE_CHANNEL; 178 changed |= IEEE80211_CONF_CHANGE_CHANNEL;
177 } 179 }
178 180
179 if (local->sw_scanning) 181 if (scan_chan)
180 power = chan->max_power; 182 power = chan->max_power;
181 else 183 else
182 power = local->power_constr_level ? 184 power = local->power_constr_level ?
@@ -859,8 +861,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
859 if (!local->oper_channel) { 861 if (!local->oper_channel) {
860 /* init channel we're on */ 862 /* init channel we're on */
861 local->hw.conf.channel = 863 local->hw.conf.channel =
862 local->oper_channel = 864 local->oper_channel = &sband->channels[0];
863 local->scan_channel = &sband->channels[0]; 865 local->hw.conf.channel_type = NL80211_CHAN_NO_HT;
864 } 866 }
865 channels += sband->n_channels; 867 channels += sband->n_channels;
866 868
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index c99ef8d04d3d..e51b99b1473c 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -298,6 +298,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
298 was_hw_scan = local->hw_scanning; 298 was_hw_scan = local->hw_scanning;
299 local->hw_scanning = false; 299 local->hw_scanning = false;
300 local->sw_scanning = false; 300 local->sw_scanning = false;
301 local->scan_channel = NULL;
301 302
302 /* we only have to protect scan_req and hw/sw scan */ 303 /* we only have to protect scan_req and hw/sw scan */
303 mutex_unlock(&local->scan_mtx); 304 mutex_unlock(&local->scan_mtx);