aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2008-12-24 03:23:11 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:36 -0500
commite3c92df08cbf6a0cb60a9c7ce377378383967e07 (patch)
tree088d70d7924c6dac0e900d4190db928623ec3c76 /net/mac80211
parenta085ff718c8c9f14c44feb337774fadfd982e1a5 (diff)
mac80211: Fix tx power setting
power_level in ieee80211_conf is being used for more than one purpose. It being used as user configured power limit and the final power limit given to the driver. By doing so, except very first time, the tx power limit is taken from min(chan->max_power, local->hw.conf.power_level) which is not what we want. This patch defines a new memeber in ieee80211_conf which is meant only for user configured power limit. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/main.c4
-rw-r--r--net/mac80211/wext.c5
2 files changed, 4 insertions, 5 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index a6cb480dda0d..dca4b7da6cad 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -214,10 +214,10 @@ 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->hw.conf.power_level) 217 if (!local->hw.conf.user_power_level)
218 power = chan->max_power; 218 power = chan->max_power;
219 else 219 else
220 power = min(chan->max_power, local->hw.conf.power_level); 220 power = min(chan->max_power, local->hw.conf.user_power_level);
221 if (local->hw.conf.power_level != power) { 221 if (local->hw.conf.power_level != power) {
222 changed |= IEEE80211_CONF_CHANGE_POWER; 222 changed |= IEEE80211_CONF_CHANGE_POWER;
223 local->hw.conf.power_level = power; 223 local->hw.conf.power_level = power;
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 48fc6b9a62a4..654041b93736 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -549,10 +549,9 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev,
549 else /* Automatic power level setting */ 549 else /* Automatic power level setting */
550 new_power_level = chan->max_power; 550 new_power_level = chan->max_power;
551 551
552 if (local->hw.conf.power_level != new_power_level) { 552 local->hw.conf.user_power_level = new_power_level;
553 local->hw.conf.power_level = new_power_level; 553 if (local->hw.conf.power_level != new_power_level)
554 reconf_flags |= IEEE80211_CONF_CHANGE_POWER; 554 reconf_flags |= IEEE80211_CONF_CHANGE_POWER;
555 }
556 555
557 if (local->hw.conf.radio_enabled != !(data->txpower.disabled)) { 556 if (local->hw.conf.radio_enabled != !(data->txpower.disabled)) {
558 local->hw.conf.radio_enabled = !(data->txpower.disabled); 557 local->hw.conf.radio_enabled = !(data->txpower.disabled);