aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath9k/eeprom.c15
-rw-r--r--drivers/net/wireless/ath9k/eeprom.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath9k/eeprom.c b/drivers/net/wireless/ath9k/eeprom.c
index b55e9920a5d4..34e9d818fadd 100644
--- a/drivers/net/wireless/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath9k/eeprom.c
@@ -2615,6 +2615,21 @@ static int ath9k_hw_def_set_txpower(struct ath_hw *ah,
2615 else 2615 else
2616 ah->regulatory.max_power_level = ratesArray[i]; 2616 ah->regulatory.max_power_level = ratesArray[i];
2617 2617
2618 switch(ar5416_get_ntxchains(ah->txchainmask)) {
2619 case 1:
2620 break;
2621 case 2:
2622 ah->regulatory.max_power_level += INCREASE_MAXPOW_BY_TWO_CHAIN;
2623 break;
2624 case 3:
2625 ah->regulatory.max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN;
2626 break;
2627 default:
2628 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM,
2629 "Invalid chainmask configuration\n");
2630 break;
2631 }
2632
2618 return 0; 2633 return 0;
2619} 2634}
2620 2635
diff --git a/drivers/net/wireless/ath9k/eeprom.h b/drivers/net/wireless/ath9k/eeprom.h
index 99863b570441..b7c656c84ba3 100644
--- a/drivers/net/wireless/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath9k/eeprom.h
@@ -75,6 +75,9 @@
75#define SUB_NUM_CTL_MODES_AT_5G_40 2 75#define SUB_NUM_CTL_MODES_AT_5G_40 2
76#define SUB_NUM_CTL_MODES_AT_2G_40 3 76#define SUB_NUM_CTL_MODES_AT_2G_40 3
77 77
78#define INCREASE_MAXPOW_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */
79#define INCREASE_MAXPOW_BY_THREE_CHAIN 10 /* 10*log10(3)*2 */
80
78#define AR_EEPROM_MAC(i) (0x1d+(i)) 81#define AR_EEPROM_MAC(i) (0x1d+(i))
79#define ATH9K_POW_SM(_r, _s) (((_r) & 0x3f) << (_s)) 82#define ATH9K_POW_SM(_r, _s) (((_r) & 0x3f) << (_s))
80#define FREQ2FBIN(x, y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5)) 83#define FREQ2FBIN(x, y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5))