ath9k_hw: use the configured power limit for AR9003
authorFelix Fietkau <nbd@openwrt.org>
Mon, 26 Apr 2010 19:04:37 +0000 (15:04 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Apr 2010 20:09:18 +0000 (16:09 -0400)
Since the new AR9003 EEPROM code does tune the card for the configured
tx power level, we need to fill in the correct power limits in the TPC
part of the DMA descriptor.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
drivers/net/wireless/ath/ath9k/ar9003_mac.c
drivers/net/wireless/ath/ath9k/hw.h

index 5d92be47c5a5cd2a2d0db060051412eeb8d65e32..79b0e28747314a0facb6f973e52bf8aa0678efc3 100644 (file)
@@ -1817,6 +1817,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
                                        u8 twiceMaxRegulatoryPower,
                                        u8 powerLimit)
 {
+       ah->txpower_limit = powerLimit;
        ar9003_hw_set_target_power_eeprom(ah, chan->channel);
        ar9003_hw_calibration_apply(ah, chan->channel);
 }
index 7d111fbf8bc54175de243a1dd383c0eabd6e3ec2..37ba37481a47eea72df41a631e3b6252423b334e 100644 (file)
@@ -311,6 +311,9 @@ static void ar9003_hw_set11n_txdesc(struct ath_hw *ah, void *ds,
 {
        struct ar9003_txc *ads = (struct ar9003_txc *) ds;
 
+       if (txpower > ah->txpower_limit)
+               txpower = ah->txpower_limit;
+
        txpower += ah->txpower_indexoffset;
        if (txpower > 63)
                txpower = 63;
index bc682da28b2ad10aee81a2887de54b8566ec5049..77245dff599358e5070c92293df0dc97d2f1bd1f 100644 (file)
@@ -719,6 +719,7 @@ struct ath_hw {
        u32 *addac5416_21;
        u32 *bank6Temp;
 
+       u8 txpower_limit;
        int16_t txpower_indexoffset;
        int coverage_class;
        u32 beacon_interval;
This page took 0.0293 seconds and 5 git commands to generate.