diff options
author | Nick Kossifidis <mickflemm@gmail.com> | 2010-11-23 14:04:43 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-30 13:52:34 -0500 |
commit | b405086ba47678a5b8f6e7cd835a3d27ebb6f744 (patch) | |
tree | ac24001381f96e48dc2f1cd02679ba718754a8a3 /drivers/net/wireless/ath/ath5k/reset.c | |
parent | 325089ab5847f5c1e43f42bb90d32f981867c4c1 (diff) |
ath5k: Increase PHY settling parameters for turo mode
* On turbo mode increase PHY settling times, note that
we only increase switch settling time on AR5212 as indicated
by initvals.
* A few cleanups: Move frame control settings for AR5210 from
reset_tx_queue to tweak_initvals and remove phy_scal settings
from tweak_initvals (we tweak them alread on set_sleep_clock).
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/reset.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/reset.c | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c index c9e5bad7cffc..c871d40b1ad7 100644 --- a/drivers/net/wireless/ath/ath5k/reset.c +++ b/drivers/net/wireless/ath/ath5k/reset.c | |||
@@ -688,19 +688,6 @@ static void ath5k_hw_tweak_initval_settings(struct ath5k_hw *ah, | |||
688 | AR5K_REG_DISABLE_BITS(ah, AR5K_TXCFG, | 688 | AR5K_REG_DISABLE_BITS(ah, AR5K_TXCFG, |
689 | AR5K_TXCFG_DCU_DBL_BUF_DIS); | 689 | AR5K_TXCFG_DCU_DBL_BUF_DIS); |
690 | 690 | ||
691 | /* Set DAC/ADC delays */ | ||
692 | if (ah->ah_version == AR5K_AR5212) { | ||
693 | u32 scal; | ||
694 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; | ||
695 | if (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4)) | ||
696 | scal = AR5K_PHY_SCAL_32MHZ_2417; | ||
697 | else if (ee->ee_is_hb63) | ||
698 | scal = AR5K_PHY_SCAL_32MHZ_HB63; | ||
699 | else | ||
700 | scal = AR5K_PHY_SCAL_32MHZ; | ||
701 | ath5k_hw_reg_write(ah, scal, AR5K_PHY_SCAL); | ||
702 | } | ||
703 | |||
704 | /* Set fast ADC */ | 691 | /* Set fast ADC */ |
705 | if ((ah->ah_radio == AR5K_RF5413) || | 692 | if ((ah->ah_radio == AR5K_RF5413) || |
706 | (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4))) { | 693 | (ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4))) { |
@@ -740,6 +727,45 @@ static void ath5k_hw_tweak_initval_settings(struct ath5k_hw *ah, | |||
740 | AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW_5211, | 727 | AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW_5211, |
741 | AR5K_DIAG_SW_ECO_ENABLE); | 728 | AR5K_DIAG_SW_ECO_ENABLE); |
742 | } | 729 | } |
730 | |||
731 | if (ah->ah_bwmode) { | ||
732 | /* Increase PHY switch and AGC settling time | ||
733 | * on turbo mode (ath5k_hw_commit_eeprom_settings | ||
734 | * will override settling time if available) */ | ||
735 | if (ah->ah_bwmode == AR5K_BWMODE_40MHZ) { | ||
736 | |||
737 | AR5K_REG_WRITE_BITS(ah, AR5K_PHY_SETTLING, | ||
738 | AR5K_PHY_SETTLING_AGC, | ||
739 | AR5K_AGC_SETTLING_TURBO); | ||
740 | |||
741 | /* XXX: Initvals indicate we only increase | ||
742 | * switch time on AR5212, 5211 and 5210 | ||
743 | * only change agc time (bug?) */ | ||
744 | if (ah->ah_version == AR5K_AR5212) | ||
745 | AR5K_REG_WRITE_BITS(ah, AR5K_PHY_SETTLING, | ||
746 | AR5K_PHY_SETTLING_SWITCH, | ||
747 | AR5K_SWITCH_SETTLING_TURBO); | ||
748 | |||
749 | if (ah->ah_version == AR5K_AR5210) { | ||
750 | /* Set Frame Control Register */ | ||
751 | ath5k_hw_reg_write(ah, | ||
752 | (AR5K_PHY_FRAME_CTL_INI | | ||
753 | AR5K_PHY_TURBO_MODE | | ||
754 | AR5K_PHY_TURBO_SHORT | 0x2020), | ||
755 | AR5K_PHY_FRAME_CTL_5210); | ||
756 | } | ||
757 | /* On 5413 PHY force window length for half/quarter rate*/ | ||
758 | } else if ((ah->ah_mac_srev >= AR5K_SREV_AR5424) && | ||
759 | (ah->ah_mac_srev <= AR5K_SREV_AR5414)) { | ||
760 | AR5K_REG_WRITE_BITS(ah, AR5K_PHY_FRAME_CTL_5211, | ||
761 | AR5K_PHY_FRAME_CTL_WIN_LEN, | ||
762 | 3); | ||
763 | } | ||
764 | } else if (ah->ah_version == AR5K_AR5210) { | ||
765 | /* Set Frame Control Register for normal operation */ | ||
766 | ath5k_hw_reg_write(ah, (AR5K_PHY_FRAME_CTL_INI | 0x1020), | ||
767 | AR5K_PHY_FRAME_CTL_5210); | ||
768 | } | ||
743 | } | 769 | } |
744 | 770 | ||
745 | static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah, | 771 | static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah, |