diff options
Diffstat (limited to 'drivers/net/wireless/ath5k/reset.c')
-rw-r--r-- | drivers/net/wireless/ath5k/reset.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c index 685dc213edae..7a17d31b2fd9 100644 --- a/drivers/net/wireless/ath5k/reset.c +++ b/drivers/net/wireless/ath5k/reset.c | |||
@@ -664,29 +664,35 @@ static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah, | |||
664 | struct ieee80211_channel *channel, u8 *ant, u8 ee_mode) | 664 | struct ieee80211_channel *channel, u8 *ant, u8 ee_mode) |
665 | { | 665 | { |
666 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; | 666 | struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; |
667 | s16 cck_ofdm_pwr_delta; | ||
667 | 668 | ||
668 | /* Set CCK to OFDM power delta */ | 669 | /* Adjust power delta for channel 14 */ |
669 | if (ah->ah_phy_revision >= AR5K_SREV_PHY_5212A) { | 670 | if (channel->center_freq == 2484) |
670 | int16_t cck_ofdm_pwr_delta; | 671 | cck_ofdm_pwr_delta = |
671 | 672 | ((ee->ee_cck_ofdm_power_delta - | |
672 | /* Adjust power delta for channel 14 */ | 673 | ee->ee_scaled_cck_delta) * 2) / 10; |
673 | if (channel->center_freq == 2484) | 674 | else |
674 | cck_ofdm_pwr_delta = | 675 | cck_ofdm_pwr_delta = |
675 | ((ee->ee_cck_ofdm_power_delta - | 676 | (ee->ee_cck_ofdm_power_delta * 2) / 10; |
676 | ee->ee_scaled_cck_delta) * 2) / 10; | ||
677 | else | ||
678 | cck_ofdm_pwr_delta = | ||
679 | (ee->ee_cck_ofdm_power_delta * 2) / 10; | ||
680 | 677 | ||
678 | /* Set CCK to OFDM power delta on tx power | ||
679 | * adjustment register */ | ||
680 | if (ah->ah_phy_revision >= AR5K_SREV_PHY_5212A) { | ||
681 | if (channel->hw_value == CHANNEL_G) | 681 | if (channel->hw_value == CHANNEL_G) |
682 | ath5k_hw_reg_write(ah, | 682 | ath5k_hw_reg_write(ah, |
683 | AR5K_REG_SM((ee->ee_cck_ofdm_power_delta * -1), | 683 | AR5K_REG_SM((ee->ee_cck_ofdm_gain_delta * -1), |
684 | AR5K_PHY_TX_PWR_ADJ_CCK_GAIN_DELTA) | | 684 | AR5K_PHY_TX_PWR_ADJ_CCK_GAIN_DELTA) | |
685 | AR5K_REG_SM((cck_ofdm_pwr_delta * -1), | 685 | AR5K_REG_SM((cck_ofdm_pwr_delta * -1), |
686 | AR5K_PHY_TX_PWR_ADJ_CCK_PCDAC_INDEX), | 686 | AR5K_PHY_TX_PWR_ADJ_CCK_PCDAC_INDEX), |
687 | AR5K_PHY_TX_PWR_ADJ); | 687 | AR5K_PHY_TX_PWR_ADJ); |
688 | else | 688 | else |
689 | ath5k_hw_reg_write(ah, 0, AR5K_PHY_TX_PWR_ADJ); | 689 | ath5k_hw_reg_write(ah, 0, AR5K_PHY_TX_PWR_ADJ); |
690 | } else { | ||
691 | /* For older revs we scale power on sw during tx power | ||
692 | * setup */ | ||
693 | ah->ah_txpower.txp_cck_ofdm_pwr_delta = cck_ofdm_pwr_delta; | ||
694 | ah->ah_txpower.txp_cck_ofdm_gainf_delta = | ||
695 | ee->ee_cck_ofdm_gain_delta; | ||
690 | } | 696 | } |
691 | 697 | ||
692 | /* Set antenna idle switch table */ | 698 | /* Set antenna idle switch table */ |
@@ -994,7 +1000,8 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
994 | /* | 1000 | /* |
995 | * Set TX power (FIXME) | 1001 | * Set TX power (FIXME) |
996 | */ | 1002 | */ |
997 | ret = ath5k_hw_txpower(ah, channel, AR5K_TUNE_DEFAULT_TXPOWER); | 1003 | ret = ath5k_hw_txpower(ah, channel, ee_mode, |
1004 | AR5K_TUNE_DEFAULT_TXPOWER); | ||
998 | if (ret) | 1005 | if (ret) |
999 | return ret; | 1006 | return ret; |
1000 | 1007 | ||