Commit d84938c9 authored by Nick Kossifidis's avatar Nick Kossifidis Committed by John W. Linville

ath5k: Always write tx powertable on hw

 * By skipping tx power table calibration we also skip setting
 tx power table on hw. Make sure we always write tx power table
 on hw since it gets cleared on reset.
Signed-off-by: default avatarNick Kossifidis <mickflemm@gmail.com>
Tested-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 04ac3c0e
...@@ -2742,10 +2742,12 @@ ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah, ...@@ -2742,10 +2742,12 @@ ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah,
/* Write PDADC values on hw */ /* Write PDADC values on hw */
static void static void
ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah, ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah, u8 ee_mode)
u8 pdcurves, u8 *pdg_to_idx)
{ {
struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
u8 *pdadc_out = ah->ah_txpower.txp_pd_table; u8 *pdadc_out = ah->ah_txpower.txp_pd_table;
u8 *pdg_to_idx = ee->ee_pdc_to_idx[ee_mode];
u8 pdcurves = ee->ee_pd_gains[ee_mode];
u32 reg; u32 reg;
u8 i; u8 i;
...@@ -2992,7 +2994,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah, ...@@ -2992,7 +2994,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
ee->ee_pd_gains[ee_mode]); ee->ee_pd_gains[ee_mode]);
/* Write settings on hw */ /* Write settings on hw */
ath5k_setup_pwr_to_pdadc_table(ah, pdg, pdg_curve_to_idx); ath5k_setup_pwr_to_pdadc_table(ah, ee_mode);
/* Set txp.offset, note that table_min /* Set txp.offset, note that table_min
* can be negative */ * can be negative */
...@@ -3114,12 +3116,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3114,12 +3116,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
return -EINVAL; return -EINVAL;
} }
/* Reset TX power values */
memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
ah->ah_txpower.txp_min_pwr = 0;
ah->ah_txpower.txp_max_pwr = AR5K_TUNE_MAX_TXPOWER;
/* Initialize TX power table */ /* Initialize TX power table */
switch (ah->ah_radio) { switch (ah->ah_radio) {
case AR5K_RF5110: case AR5K_RF5110:
...@@ -3146,11 +3142,24 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3146,11 +3142,24 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
* so there is no need to recalculate the powertable, we 'll * so there is no need to recalculate the powertable, we 'll
* just use the cached one */ * just use the cached one */
if (!fast) { if (!fast) {
/* Reset TX power values */
memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
ah->ah_txpower.txp_min_pwr = 0;
ah->ah_txpower.txp_max_pwr = AR5K_TUNE_MAX_TXPOWER;
/* Calculate the powertable */
ret = ath5k_setup_channel_powertable(ah, channel, ret = ath5k_setup_channel_powertable(ah, channel,
ee_mode, type); ee_mode, type);
if (ret) if (ret)
return ret; return ret;
} /* Write cached table on hw */
} else if (type == AR5K_PWRTABLE_PWR_TO_PDADC)
ath5k_setup_pwr_to_pdadc_table(ah, ee_mode);
else
ath5k_setup_pcdac_table(ah);
/* Limit max power if we have a CTL available */ /* Limit max power if we have a CTL available */
ath5k_get_max_ctl_power(ah, channel); ath5k_get_max_ctl_power(ah, channel);
......
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