aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2009-01-09 07:44:15 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:00:15 -0500
commita8302de934b5d1897ff146cd0c7ab87d1417c092 (patch)
tree5a73ad4dd787cc02e14aa8975d267adb5812d8fe /net/mac80211/main.c
parent01f8162a854df7f9c259c839ad3c1168ac13b7b8 (diff)
mac80211: Handle power constraint level advertised in 11d+h beacon
This patch uses power constraint level while determining the maximum transmit power, there by it makes sure that any power mitigation requirement for the channel in the current regulatory domain is met. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
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;