Commit e832bf10 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath9k_hw: remove the tx power index offset

It is always 0
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bb1f3ad9
...@@ -248,8 +248,7 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah, ...@@ -248,8 +248,7 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
} }
static void ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah, static void ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah,
struct ath9k_channel *chan, struct ath9k_channel *chan)
int16_t *pTxPowerIndexOffset)
{ {
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k; struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k;
...@@ -356,8 +355,6 @@ static void ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah, ...@@ -356,8 +355,6 @@ static void ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah,
REGWRITE_BUFFER_FLUSH(ah); REGWRITE_BUFFER_FLUSH(ah);
} }
} }
*pTxPowerIndexOffset = 0;
} }
static void ath9k_hw_set_4k_power_per_rate_table(struct ath_hw *ah, static void ath9k_hw_set_4k_power_per_rate_table(struct ath_hw *ah,
...@@ -580,7 +577,6 @@ static void ath9k_hw_4k_set_txpower(struct ath_hw *ah, ...@@ -580,7 +577,6 @@ static void ath9k_hw_4k_set_txpower(struct ath_hw *ah,
struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k; struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k;
struct modal_eep_4k_header *pModal = &pEepData->modalHeader; struct modal_eep_4k_header *pModal = &pEepData->modalHeader;
int16_t ratesArray[Ar5416RateSize]; int16_t ratesArray[Ar5416RateSize];
int16_t txPowerIndexOffset = 0;
u8 ht40PowerIncForPdadc = 2; u8 ht40PowerIncForPdadc = 2;
int i; int i;
...@@ -597,11 +593,10 @@ static void ath9k_hw_4k_set_txpower(struct ath_hw *ah, ...@@ -597,11 +593,10 @@ static void ath9k_hw_4k_set_txpower(struct ath_hw *ah,
twiceMaxRegulatoryPower, twiceMaxRegulatoryPower,
powerLimit); powerLimit);
ath9k_hw_set_4k_power_cal_table(ah, chan, &txPowerIndexOffset); ath9k_hw_set_4k_power_cal_table(ah, chan);
regulatory->max_power_level = 0; regulatory->max_power_level = 0;
for (i = 0; i < ARRAY_SIZE(ratesArray); i++) { for (i = 0; i < ARRAY_SIZE(ratesArray); i++) {
ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]);
if (ratesArray[i] > MAX_RATE_POWER) if (ratesArray[i] > MAX_RATE_POWER)
ratesArray[i] = MAX_RATE_POWER; ratesArray[i] = MAX_RATE_POWER;
......
...@@ -307,8 +307,7 @@ static void ar9287_eeprom_olpc_set_pdadcs(struct ath_hw *ah, ...@@ -307,8 +307,7 @@ static void ar9287_eeprom_olpc_set_pdadcs(struct ath_hw *ah,
} }
static void ath9k_hw_set_ar9287_power_cal_table(struct ath_hw *ah, static void ath9k_hw_set_ar9287_power_cal_table(struct ath_hw *ah,
struct ath9k_channel *chan, struct ath9k_channel *chan)
int16_t *pTxPowerIndexOffset)
{ {
struct cal_data_per_freq_ar9287 *pRawDataset; struct cal_data_per_freq_ar9287 *pRawDataset;
struct cal_data_op_loop_ar9287 *pRawDatasetOpenLoop; struct cal_data_op_loop_ar9287 *pRawDatasetOpenLoop;
...@@ -444,8 +443,6 @@ static void ath9k_hw_set_ar9287_power_cal_table(struct ath_hw *ah, ...@@ -444,8 +443,6 @@ static void ath9k_hw_set_ar9287_power_cal_table(struct ath_hw *ah,
REGWRITE_BUFFER_FLUSH(ah); REGWRITE_BUFFER_FLUSH(ah);
} }
} }
*pTxPowerIndexOffset = 0;
} }
static void ath9k_hw_set_ar9287_power_per_rate_table(struct ath_hw *ah, static void ath9k_hw_set_ar9287_power_per_rate_table(struct ath_hw *ah,
...@@ -720,7 +717,6 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah, ...@@ -720,7 +717,6 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
struct ar9287_eeprom *pEepData = &ah->eeprom.map9287; struct ar9287_eeprom *pEepData = &ah->eeprom.map9287;
struct modal_eep_ar9287_header *pModal = &pEepData->modalHeader; struct modal_eep_ar9287_header *pModal = &pEepData->modalHeader;
int16_t ratesArray[Ar5416RateSize]; int16_t ratesArray[Ar5416RateSize];
int16_t txPowerIndexOffset = 0;
u8 ht40PowerIncForPdadc = 2; u8 ht40PowerIncForPdadc = 2;
int i; int i;
...@@ -736,11 +732,10 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah, ...@@ -736,11 +732,10 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
twiceMaxRegulatoryPower, twiceMaxRegulatoryPower,
powerLimit); powerLimit);
ath9k_hw_set_ar9287_power_cal_table(ah, chan, &txPowerIndexOffset); ath9k_hw_set_ar9287_power_cal_table(ah, chan);
regulatory->max_power_level = 0; regulatory->max_power_level = 0;
for (i = 0; i < ARRAY_SIZE(ratesArray); i++) { for (i = 0; i < ARRAY_SIZE(ratesArray); i++) {
ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]);
if (ratesArray[i] > MAX_RATE_POWER) if (ratesArray[i] > MAX_RATE_POWER)
ratesArray[i] = MAX_RATE_POWER; ratesArray[i] = MAX_RATE_POWER;
......
...@@ -693,8 +693,7 @@ static void ath9k_adjust_pdadc_values(struct ath_hw *ah, ...@@ -693,8 +693,7 @@ static void ath9k_adjust_pdadc_values(struct ath_hw *ah,
} }
static void ath9k_hw_set_def_power_cal_table(struct ath_hw *ah, static void ath9k_hw_set_def_power_cal_table(struct ath_hw *ah,
struct ath9k_channel *chan, struct ath9k_channel *chan)
int16_t *pTxPowerIndexOffset)
{ {
#define SM_PD_GAIN(x) SM(0x38, AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_##x) #define SM_PD_GAIN(x) SM(0x38, AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_##x)
#define SM_PDGAIN_B(x, y) \ #define SM_PDGAIN_B(x, y) \
...@@ -855,7 +854,6 @@ static void ath9k_hw_set_def_power_cal_table(struct ath_hw *ah, ...@@ -855,7 +854,6 @@ static void ath9k_hw_set_def_power_cal_table(struct ath_hw *ah,
} }
} }
*pTxPowerIndexOffset = 0;
#undef SM_PD_GAIN #undef SM_PD_GAIN
#undef SM_PDGAIN_B #undef SM_PDGAIN_B
} }
...@@ -1143,7 +1141,6 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah, ...@@ -1143,7 +1141,6 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
struct modal_eep_header *pModal = struct modal_eep_header *pModal =
&(pEepData->modalHeader[IS_CHAN_2GHZ(chan)]); &(pEepData->modalHeader[IS_CHAN_2GHZ(chan)]);
int16_t ratesArray[Ar5416RateSize]; int16_t ratesArray[Ar5416RateSize];
int16_t txPowerIndexOffset = 0;
u8 ht40PowerIncForPdadc = 2; u8 ht40PowerIncForPdadc = 2;
int i, cck_ofdm_delta = 0; int i, cck_ofdm_delta = 0;
...@@ -1160,11 +1157,10 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah, ...@@ -1160,11 +1157,10 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
twiceMaxRegulatoryPower, twiceMaxRegulatoryPower,
powerLimit); powerLimit);
ath9k_hw_set_def_power_cal_table(ah, chan, &txPowerIndexOffset); ath9k_hw_set_def_power_cal_table(ah, chan);
regulatory->max_power_level = 0; regulatory->max_power_level = 0;
for (i = 0; i < ARRAY_SIZE(ratesArray); i++) { for (i = 0; i < ARRAY_SIZE(ratesArray); i++) {
ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]);
if (ratesArray[i] > MAX_RATE_POWER) if (ratesArray[i] > MAX_RATE_POWER)
ratesArray[i] = MAX_RATE_POWER; ratesArray[i] = MAX_RATE_POWER;
if (ratesArray[i] > regulatory->max_power_level) if (ratesArray[i] > regulatory->max_power_level)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment