diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/eeprom.c')
-rw-r--r-- | drivers/net/wireless/ath9k/eeprom.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath9k/eeprom.c b/drivers/net/wireless/ath9k/eeprom.c index f935341bc5c4..183c949bcca1 100644 --- a/drivers/net/wireless/ath9k/eeprom.c +++ b/drivers/net/wireless/ath9k/eeprom.c | |||
@@ -640,7 +640,7 @@ static void ath9k_hw_get_4k_gain_boundaries_pdadcs(struct ath_hw *ah, | |||
640 | pPdGainBoundaries[i] = | 640 | pPdGainBoundaries[i] = |
641 | min((u16)AR5416_MAX_RATE_POWER, pPdGainBoundaries[i]); | 641 | min((u16)AR5416_MAX_RATE_POWER, pPdGainBoundaries[i]); |
642 | 642 | ||
643 | if ((i == 0) && !AR_SREV_5416_V20_OR_LATER(ah)) { | 643 | if ((i == 0) && !AR_SREV_5416_20_OR_LATER(ah)) { |
644 | minDelta = pPdGainBoundaries[0] - 23; | 644 | minDelta = pPdGainBoundaries[0] - 23; |
645 | pPdGainBoundaries[0] = 23; | 645 | pPdGainBoundaries[0] = 23; |
646 | } else { | 646 | } else { |
@@ -679,7 +679,7 @@ static void ath9k_hw_get_4k_gain_boundaries_pdadcs(struct ath_hw *ah, | |||
679 | vpdTableI[i][sizeCurrVpdTable - 2]); | 679 | vpdTableI[i][sizeCurrVpdTable - 2]); |
680 | vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep); | 680 | vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep); |
681 | 681 | ||
682 | if (tgtIndex > maxIndex) { | 682 | if (tgtIndex >= maxIndex) { |
683 | while ((ss <= tgtIndex) && | 683 | while ((ss <= tgtIndex) && |
684 | (k < (AR5416_NUM_PDADC_VALUES - 1))) { | 684 | (k < (AR5416_NUM_PDADC_VALUES - 1))) { |
685 | tmpVal = (int16_t) TMP_VAL_VPD_TABLE; | 685 | tmpVal = (int16_t) TMP_VAL_VPD_TABLE; |
@@ -713,11 +713,11 @@ static bool ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah, | |||
713 | u8 *pCalBChans = NULL; | 713 | u8 *pCalBChans = NULL; |
714 | u16 pdGainOverlap_t2; | 714 | u16 pdGainOverlap_t2; |
715 | static u8 pdadcValues[AR5416_NUM_PDADC_VALUES]; | 715 | static u8 pdadcValues[AR5416_NUM_PDADC_VALUES]; |
716 | u16 gainBoundaries[AR5416_PD_GAINS_IN_MASK]; | 716 | u16 gainBoundaries[AR5416_EEP4K_PD_GAINS_IN_MASK]; |
717 | u16 numPiers, i, j; | 717 | u16 numPiers, i, j; |
718 | int16_t tMinCalPower; | 718 | int16_t tMinCalPower; |
719 | u16 numXpdGain, xpdMask; | 719 | u16 numXpdGain, xpdMask; |
720 | u16 xpdGainValues[AR5416_NUM_PD_GAINS] = { 0, 0, 0, 0 }; | 720 | u16 xpdGainValues[AR5416_EEP4K_NUM_PD_GAINS] = { 0, 0 }; |
721 | u32 reg32, regOffset, regChainOffset; | 721 | u32 reg32, regOffset, regChainOffset; |
722 | 722 | ||
723 | xpdMask = pEepData->modalHeader.xpdGain; | 723 | xpdMask = pEepData->modalHeader.xpdGain; |
@@ -732,16 +732,16 @@ static bool ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah, | |||
732 | } | 732 | } |
733 | 733 | ||
734 | pCalBChans = pEepData->calFreqPier2G; | 734 | pCalBChans = pEepData->calFreqPier2G; |
735 | numPiers = AR5416_NUM_2G_CAL_PIERS; | 735 | numPiers = AR5416_EEP4K_NUM_2G_CAL_PIERS; |
736 | 736 | ||
737 | numXpdGain = 0; | 737 | numXpdGain = 0; |
738 | 738 | ||
739 | for (i = 1; i <= AR5416_PD_GAINS_IN_MASK; i++) { | 739 | for (i = 1; i <= AR5416_EEP4K_PD_GAINS_IN_MASK; i++) { |
740 | if ((xpdMask >> (AR5416_PD_GAINS_IN_MASK - i)) & 1) { | 740 | if ((xpdMask >> (AR5416_EEP4K_PD_GAINS_IN_MASK - i)) & 1) { |
741 | if (numXpdGain >= AR5416_NUM_PD_GAINS) | 741 | if (numXpdGain >= AR5416_EEP4K_NUM_PD_GAINS) |
742 | break; | 742 | break; |
743 | xpdGainValues[numXpdGain] = | 743 | xpdGainValues[numXpdGain] = |
744 | (u16)(AR5416_PD_GAINS_IN_MASK - i); | 744 | (u16)(AR5416_EEP4K_PD_GAINS_IN_MASK - i); |
745 | numXpdGain++; | 745 | numXpdGain++; |
746 | } | 746 | } |
747 | } | 747 | } |
@@ -754,8 +754,8 @@ static bool ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah, | |||
754 | xpdGainValues[1]); | 754 | xpdGainValues[1]); |
755 | REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_3, 0); | 755 | REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_3, 0); |
756 | 756 | ||
757 | for (i = 0; i < AR5416_MAX_CHAINS; i++) { | 757 | for (i = 0; i < AR5416_EEP4K_MAX_CHAINS; i++) { |
758 | if (AR_SREV_5416_V20_OR_LATER(ah) && | 758 | if (AR_SREV_5416_20_OR_LATER(ah) && |
759 | (ah->rxchainmask == 5 || ah->txchainmask == 5) && | 759 | (ah->rxchainmask == 5 || ah->txchainmask == 5) && |
760 | (i != 0)) { | 760 | (i != 0)) { |
761 | regChainOffset = (i == 1) ? 0x2000 : 0x1000; | 761 | regChainOffset = (i == 1) ? 0x2000 : 0x1000; |
@@ -771,7 +771,7 @@ static bool ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah, | |||
771 | &tMinCalPower, gainBoundaries, | 771 | &tMinCalPower, gainBoundaries, |
772 | pdadcValues, numXpdGain); | 772 | pdadcValues, numXpdGain); |
773 | 773 | ||
774 | if ((i == 0) || AR_SREV_5416_V20_OR_LATER(ah)) { | 774 | if ((i == 0) || AR_SREV_5416_20_OR_LATER(ah)) { |
775 | REG_WRITE(ah, AR_PHY_TPCRG5 + regChainOffset, | 775 | REG_WRITE(ah, AR_PHY_TPCRG5 + regChainOffset, |
776 | SM(pdGainOverlap_t2, | 776 | SM(pdGainOverlap_t2, |
777 | AR_PHY_TPCRG5_PD_GAIN_OVERLAP) | 777 | AR_PHY_TPCRG5_PD_GAIN_OVERLAP) |
@@ -1707,7 +1707,7 @@ static bool ath9k_hw_def_set_board_values(struct ath_hw *ah, | |||
1707 | break; | 1707 | break; |
1708 | } | 1708 | } |
1709 | 1709 | ||
1710 | if (AR_SREV_5416_V20_OR_LATER(ah) && | 1710 | if (AR_SREV_5416_20_OR_LATER(ah) && |
1711 | (ah->rxchainmask == 5 || ah->txchainmask == 5) | 1711 | (ah->rxchainmask == 5 || ah->txchainmask == 5) |
1712 | && (i != 0)) | 1712 | && (i != 0)) |
1713 | regChainOffset = (i == 1) ? 0x2000 : 0x1000; | 1713 | regChainOffset = (i == 1) ? 0x2000 : 0x1000; |
@@ -1728,7 +1728,7 @@ static bool ath9k_hw_def_set_board_values(struct ath_hw *ah, | |||
1728 | SM(pModal->iqCalQCh[i], | 1728 | SM(pModal->iqCalQCh[i], |
1729 | AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); | 1729 | AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); |
1730 | 1730 | ||
1731 | if ((i == 0) || AR_SREV_5416_V20_OR_LATER(ah)) { | 1731 | if ((i == 0) || AR_SREV_5416_20_OR_LATER(ah)) { |
1732 | if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { | 1732 | if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { |
1733 | txRxAttenLocal = pModal->txRxAttenCh[i]; | 1733 | txRxAttenLocal = pModal->txRxAttenCh[i]; |
1734 | if (AR_SREV_9280_10_OR_LATER(ah)) { | 1734 | if (AR_SREV_9280_10_OR_LATER(ah)) { |
@@ -2094,7 +2094,7 @@ static void ath9k_hw_get_def_gain_boundaries_pdadcs(struct ath_hw *ah, | |||
2094 | pPdGainBoundaries[i] = | 2094 | pPdGainBoundaries[i] = |
2095 | min((u16)AR5416_MAX_RATE_POWER, pPdGainBoundaries[i]); | 2095 | min((u16)AR5416_MAX_RATE_POWER, pPdGainBoundaries[i]); |
2096 | 2096 | ||
2097 | if ((i == 0) && !AR_SREV_5416_V20_OR_LATER(ah)) { | 2097 | if ((i == 0) && !AR_SREV_5416_20_OR_LATER(ah)) { |
2098 | minDelta = pPdGainBoundaries[0] - 23; | 2098 | minDelta = pPdGainBoundaries[0] - 23; |
2099 | pPdGainBoundaries[0] = 23; | 2099 | pPdGainBoundaries[0] = 23; |
2100 | } else { | 2100 | } else { |
@@ -2228,7 +2228,7 @@ static bool ath9k_hw_set_def_power_cal_table(struct ath_hw *ah, | |||
2228 | xpdGainValues[2]); | 2228 | xpdGainValues[2]); |
2229 | 2229 | ||
2230 | for (i = 0; i < AR5416_MAX_CHAINS; i++) { | 2230 | for (i = 0; i < AR5416_MAX_CHAINS; i++) { |
2231 | if (AR_SREV_5416_V20_OR_LATER(ah) && | 2231 | if (AR_SREV_5416_20_OR_LATER(ah) && |
2232 | (ah->rxchainmask == 5 || ah->txchainmask == 5) && | 2232 | (ah->rxchainmask == 5 || ah->txchainmask == 5) && |
2233 | (i != 0)) { | 2233 | (i != 0)) { |
2234 | regChainOffset = (i == 1) ? 0x2000 : 0x1000; | 2234 | regChainOffset = (i == 1) ? 0x2000 : 0x1000; |
@@ -2262,7 +2262,7 @@ static bool ath9k_hw_set_def_power_cal_table(struct ath_hw *ah, | |||
2262 | numXpdGain); | 2262 | numXpdGain); |
2263 | } | 2263 | } |
2264 | 2264 | ||
2265 | if ((i == 0) || AR_SREV_5416_V20_OR_LATER(ah)) { | 2265 | if ((i == 0) || AR_SREV_5416_20_OR_LATER(ah)) { |
2266 | if (OLC_FOR_AR9280_20_LATER) { | 2266 | if (OLC_FOR_AR9280_20_LATER) { |
2267 | REG_WRITE(ah, | 2267 | REG_WRITE(ah, |
2268 | AR_PHY_TPCRG5 + regChainOffset, | 2268 | AR_PHY_TPCRG5 + regChainOffset, |