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>
This commit is contained in:
Vasanthakumar Thiagarajan
2009-01-09 18:14:15 +05:30
committed by John W. Linville
parent 01f8162a85
commit a8302de934
4 changed files with 42 additions and 2 deletions

View File

@@ -214,10 +214,16 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
changed |= IEEE80211_CONF_CHANGE_CHANNEL;
}
if (!local->user_power_level)
if (local->sw_scanning)
power = chan->max_power;
else
power = min(chan->max_power, local->user_power_level);
power = local->power_constr_level ?
(chan->max_power - local->power_constr_level) :
chan->max_power;
if (local->user_power_level)
power = min(power, local->user_power_level);
if (local->hw.conf.power_level != power) {
changed |= IEEE80211_CONF_CHANGE_POWER;
local->hw.conf.power_level = power;