summaryrefslogtreecommitdiff
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorHong Wu <Hong.Wu@dspg.com>2012-01-11 20:34:30 +0200
committerJohn W. Linville <linville@tuxdriver.com>2012-01-24 14:21:11 -0500
commita48b13ac811ee236151d9e0e0dcb5639b2ab4591 (patch)
tree0a9a83a9baa14a14932d44e4a3ba3554f951e1b5 /net/mac80211/main.c
parenteccc068e8e84c8fe997115629925e0422a98e4de (diff)
mac80211: Fix the maximum transmit power with power constraint
The local maximum transmit power for a channel is defined as the maximum regulatory transmission power minus the local power constraint specified for the channel in the Power Constraint element. (7.3.2.15 IEEE80211 2007) Signed-off-by: Hong Wu <hong.wu@dspg.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 0a0d94ad9b08..6192caadfab9 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -155,7 +155,8 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
power = chan->max_power;
else
power = local->power_constr_level ?
- (chan->max_power - local->power_constr_level) :
+ min(chan->max_power,
+ (chan->max_reg_power - local->power_constr_level)) :
chan->max_power;
if (local->user_power_level >= 0)