ath5k: Always write tx powertable on hw
Nick Kossifidis
maintainerPATCH 1/6 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.
--- drivers/net/wireless/ath/ath5k/phy.c | 33 +++++++++++++++++++++------------ 1 files changed, 21 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath5k/phy.c +21 -12
@@ -2742,10 +2742,12 @@ ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah,/* Write PDADC values on hw */ static void -ath5k_setup_pwr_to_pdadc_table (struct ath5k_hw *ah, -u8 pdcurves,u8 *pdg_to_idx) +ath5k_setup_pwr_to_pdadc_table (struct ath5k_hw *ah,u8 ee_mode) { +struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;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;u8 i;
@@ -2992,7 +2994,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah, ee->ee_pd_gains[ee_mode]);/* 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 * can be negative */
@@ -3114,12 +3116,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,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 */ switch (ah->ah_radio) {case AR5K_RF5110 :
@@ -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 * just use the cached one */ 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, ee_mode, type); -if (ret) -return ret; - } +if (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 */ ath5k_get_max_ctl_power (ah, channel);
Quoted 80 lines · Nick Kossifidis
* 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 Nick Kossifidis <[email protected]>---
drivers/net/wireless/ath/ath5k/phy.c | 33 +++++++++++++++++++++------------1 files changed, 21 insertions(+), 12 deletions(-)drivers/net/wireless/ath/ath5k/phy.c +0
-0@@ -2742,10 +2742,12 @@ ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah, /* Write PDADC values on hw */static void
drivers/net/wireless/ath/ath5k/phy.c +1
-2-ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah, - u8 pdcurves, u8 *pdg_to_idx) +ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah, u8 ee_mode){
+ structath5k_eeprom_info*ee =&ah->ah_capabilities.cap_eeprom; 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;
u8 i;drivers/net/wireless/ath/ath5k/phy.c +1
-7@@ -2992,7 +2994,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah, ee->ee_pd_gains[ee_mode]); /* 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* can be negative */ @@ -3114,12 +3116,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel, 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 */ switch (ah->ah_radio) {case
AR5K_RF5110:drivers/net/wireless/ath/ath5k/phy.c +16
-3@@ -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 * just use the cached one */ 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, ee_mode, type); - if (ret) - return ret; - } + if (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 */ ath5k_get_max_ctl_power(ah, channel);
Quoted 5 lines · Nick Kossifidis
* 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 Nick Kossifidis <[email protected]>
Hey, Nick -- just a process note...
All your patches have " Signed-off-by..." (notice the leading space), which looks a bit funny. Could you figure-out why this is happening and change it to remove the leading space?
Thanks,
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Quoted 5 lines · John W. Linville
Quoted 4 lines · Nick Kossifidis
* 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.
Quoted 7 lines
Quoted 1 line
Signed-off-by Nick Kossifidis <[email protected]>Hey, Nick -- just a process note...
All your patches have " Signed-off-by..." (notice the leading space), which looks a bit funny. Could you figure-out why this is happening and change it to remove the leading space?
Also the "*" thing is a bit weird as kernel commit messages go.
Signature · 1 line
Bob Copeland %% www.bobcopeland.com
Nick Kossifidis
maintainer2010/12/4 Bob Copeland <[email protected]>:
Quoted 8 lines · John W. Linville
Quoted 7 lines · Nick Kossifidis
Quoted 5 lines
* 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 Nick Kossifidis <[email protected]>
Quoted 8 lines
Quoted 5 lines
Hey, Nick -- just a process note...
All your patches have " Signed-off-by..." (notice the leading space), which looks a bit funny. Could you figure-out why this is happening and change it to remove the leading space?
Also the "*" thing is a bit weird as kernel commit messages go.
Sorry, bad habits, will change that next time ;-)
Signature · 3 lines
GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick
Quoted 5 lines · Nick Kossifidis
* 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 Nick Kossifidis <[email protected]>
Just a very late heads-up, this patch seems to be causing problems for me.
Seems a bit weird given the content, but the symptom is that when I bring up the device none of my probe requests are actually getting sent, according to wireshark captures from another device. Reverting just this patch helps, so my power table must be broken at start up.
I saw that Bruno had a later series that touched this area, so I'll try them next.
Signature · 1 line
Bob Copeland %% www.bobcopeland.com
Quoted 1 line · On Thursday 30 December 2010 06:02:29 Bob Copeland wrote:
On Thu, Dec 2, 2010 at 11:03 PM, Nick Kossifidis <[email protected]>
Quoted 9 lines · wrote:
Quoted 5 lines
* 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 Nick Kossifidis <[email protected]>Just a very late heads-up, this patch seems to be causing problems for me.
Quoted 8 lines
Seems a bit weird given the content, but the symptom is that when I bring up the device none of my probe requests are actually getting sent, according to wireshark captures from another device. Reverting just this patch helps, so my power table must be broken at start up.
I saw that Bruno had a later series that touched this area, so I'll try them next.
Yep, they should fix that problem. Please try them and report if they don't.
Bruno
Quoted 7 lines · Bruno Randolf
Quoted 5 lines
Reverting just this patch helps, so my power table must be broken at start up.
I saw that Bruno had a later series that touched this area, so I'll try them next.
Yep, they should fix that problem. Please try them and report if they don't.
Indeed, applied first 3 patches and problem is resolved (and now I see you pointed it out in patch 3). Thanks!
Signature · 1 line
Bob Copeland %% www.bobcopeland.com