aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index e9f3e85d1a9e..c78304db475e 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -214,10 +214,16 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
214 changed |= IEEE80211_CONF_CHANGE_CHANNEL; 214 changed |= IEEE80211_CONF_CHANGE_CHANNEL;
215 } 215 }
216 216
217 if (!local->user_power_level) 217 if (local->sw_scanning)
218 power = chan->max_power; 218 power = chan->max_power;
219 else 219 else
220 power = min(chan->max_power, local->user_power_level); 220 power = local->power_constr_level ?
221 (chan->max_power - local->power_constr_level) :
222 chan->max_power;
223
224 if (local->user_power_level)
225 power = min(power, local->user_power_level);
226
221 if (local->hw.conf.power_level != power) { 227 if (local->hw.conf.power_level != power) {
222 changed |= IEEE80211_CONF_CHANGE_POWER; 228 changed |= IEEE80211_CONF_CHANGE_POWER;
223 local->hw.conf.power_level = power; 229 local->hw.conf.power_level = power;