Search Linux Wireless

[PATCH 4/6] ath9k: Fix high tx power in multi-chain mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Miaoqing Pan <miaoqing@xxxxxxxxxxxxxxxx>

For multi-chain chips, if the thermometer is switched off for a chain
which can be disabled by software(e.g tx_chainmask=0x1), the measured tx
power is about 5dB higher than target power.

Set thermometer on for all chains to fix this issue.

Signed-off-by: Miaoqing Pan <miaoqing@xxxxxxxxxxxxxxxx>
Signed-off-by: Sujith Manoharan <c_manoha@xxxxxxxxxxxxxxxx>
---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 80c6eac..a5f4b19 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -4084,25 +4084,27 @@ static void ar9003_hw_thermometer_apply(struct ath_hw *ah)
 
 	REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4,
 		      AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on);
-	if (ah->caps.tx_chainmask & BIT(1))
+	if (!AR_SREV_9330(ah) && !AR_SREV_9485(ah)) {
 		REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4,
 			      AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on);
-	if (ah->caps.tx_chainmask & BIT(2))
-		REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
-			      AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on);
+		if (!AR_SREV_9340(ah) && !AR_SREV_9462(ah) && !AR_SREV_9531(ah))
+			REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
+				      AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR,
+				      therm_on);
+	}
 
 	therm_on = (thermometer < 0) ? 0 : (thermometer == 0);
 	REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4,
 		      AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);
-	if (ah->caps.tx_chainmask & BIT(1)) {
+	if (!AR_SREV_9330(ah) && !AR_SREV_9485(ah)) {
 		therm_on = (thermometer < 0) ? 0 : (thermometer == 1);
 		REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4,
 			      AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);
-	}
-	if (ah->caps.tx_chainmask & BIT(2)) {
-		therm_on = (thermometer < 0) ? 0 : (thermometer == 2);
-		REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
-			      AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);
+		if (!AR_SREV_9340(ah) && !AR_SREV_9462(ah) && !AR_SREV_9531(ah)) {
+			therm_on = (thermometer < 0) ? 0 : (thermometer == 2);
+			REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
+				      AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);
+		}
 	}
 }
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux