diff options
author | Senthil Balasubramanian <senthilkumar@atheros.com> | 2008-12-24 07:33:58 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:37 -0500 |
commit | cb33c4126ba9825b047463352d12dc3ed983d320 (patch) | |
tree | d514182c8e7262954a2b23da60948105d190e362 /drivers/net/wireless/ath9k/eeprom.c | |
parent | 92d6128e1766bb7a7b6dc58f012fdf772fdf1100 (diff) |
ath9k: INI update for Atheros AR9280 and AR9285 chipset.
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/eeprom.c')
-rw-r--r-- | drivers/net/wireless/ath9k/eeprom.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath9k/eeprom.c b/drivers/net/wireless/ath9k/eeprom.c index acd6c5374d44..1ef8b5a70e5b 100644 --- a/drivers/net/wireless/ath9k/eeprom.c +++ b/drivers/net/wireless/ath9k/eeprom.c | |||
@@ -2121,6 +2121,7 @@ void ath9k_hw_set_addac(struct ath_hal *ah, struct ath9k_channel *chan) | |||
2121 | static bool ath9k_hw_eeprom_set_def_board_values(struct ath_hal *ah, | 2121 | static bool ath9k_hw_eeprom_set_def_board_values(struct ath_hal *ah, |
2122 | struct ath9k_channel *chan) | 2122 | struct ath9k_channel *chan) |
2123 | { | 2123 | { |
2124 | #define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) | ||
2124 | struct modal_eep_header *pModal; | 2125 | struct modal_eep_header *pModal; |
2125 | struct ath_hal_5416 *ahp = AH5416(ah); | 2126 | struct ath_hal_5416 *ahp = AH5416(ah); |
2126 | struct ar5416_eeprom_def *eep = &ahp->ah_eeprom.def; | 2127 | struct ar5416_eeprom_def *eep = &ahp->ah_eeprom.def; |
@@ -2163,9 +2164,7 @@ static bool ath9k_hw_eeprom_set_def_board_values(struct ath_hal *ah, | |||
2163 | AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); | 2164 | AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); |
2164 | 2165 | ||
2165 | if ((i == 0) || AR_SREV_5416_V20_OR_LATER(ah)) { | 2166 | if ((i == 0) || AR_SREV_5416_V20_OR_LATER(ah)) { |
2166 | if ((eep->baseEepHeader.version & | 2167 | if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { |
2167 | AR5416_EEP_VER_MINOR_MASK) >= | ||
2168 | AR5416_EEP_MINOR_VER_3) { | ||
2169 | txRxAttenLocal = pModal->txRxAttenCh[i]; | 2168 | txRxAttenLocal = pModal->txRxAttenCh[i]; |
2170 | if (AR_SREV_9280_10_OR_LATER(ah)) { | 2169 | if (AR_SREV_9280_10_OR_LATER(ah)) { |
2171 | REG_RMW_FIELD(ah, | 2170 | REG_RMW_FIELD(ah, |
@@ -2332,8 +2331,7 @@ static bool ath9k_hw_eeprom_set_def_board_values(struct ath_hal *ah, | |||
2332 | pModal->thresh62); | 2331 | pModal->thresh62); |
2333 | } | 2332 | } |
2334 | 2333 | ||
2335 | if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= | 2334 | if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_2) { |
2336 | AR5416_EEP_MINOR_VER_2) { | ||
2337 | REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, | 2335 | REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, |
2338 | AR_PHY_TX_END_DATA_START, | 2336 | AR_PHY_TX_END_DATA_START, |
2339 | pModal->txFrameToDataStart); | 2337 | pModal->txFrameToDataStart); |
@@ -2341,15 +2339,29 @@ static bool ath9k_hw_eeprom_set_def_board_values(struct ath_hal *ah, | |||
2341 | pModal->txFrameToPaOn); | 2339 | pModal->txFrameToPaOn); |
2342 | } | 2340 | } |
2343 | 2341 | ||
2344 | if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= | 2342 | if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { |
2345 | AR5416_EEP_MINOR_VER_3) { | ||
2346 | if (IS_CHAN_HT40(chan)) | 2343 | if (IS_CHAN_HT40(chan)) |
2347 | REG_RMW_FIELD(ah, AR_PHY_SETTLING, | 2344 | REG_RMW_FIELD(ah, AR_PHY_SETTLING, |
2348 | AR_PHY_SETTLING_SWITCH, | 2345 | AR_PHY_SETTLING_SWITCH, |
2349 | pModal->swSettleHt40); | 2346 | pModal->swSettleHt40); |
2350 | } | 2347 | } |
2351 | 2348 | ||
2349 | if (AR_SREV_9280_20(ah) && AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_20) { | ||
2350 | if (IS_CHAN_HT20(chan)) | ||
2351 | REG_RMW_FIELD(ah, AR_AN_TOP1, AR_AN_TOP1_DACIPMODE, | ||
2352 | eep->baseEepHeader.dacLpMode); | ||
2353 | else if (eep->baseEepHeader.dacHiPwrMode_5G) | ||
2354 | REG_RMW_FIELD(ah, AR_AN_TOP1, AR_AN_TOP1_DACIPMODE, 0); | ||
2355 | else | ||
2356 | REG_RMW_FIELD(ah, AR_AN_TOP1, AR_AN_TOP1_DACIPMODE, | ||
2357 | eep->baseEepHeader.dacLpMode); | ||
2358 | |||
2359 | REG_RMW_FIELD(ah, AR_PHY_FRAME_CTL, AR_PHY_FRAME_CTL_TX_CLIP, | ||
2360 | pModal->miscBits >> 2); | ||
2361 | } | ||
2362 | |||
2352 | return true; | 2363 | return true; |
2364 | #undef AR5416_VER_MASK | ||
2353 | } | 2365 | } |
2354 | 2366 | ||
2355 | static bool ath9k_hw_eeprom_set_4k_board_values(struct ath_hal *ah, | 2367 | static bool ath9k_hw_eeprom_set_4k_board_values(struct ath_hal *ah, |
@@ -2739,6 +2751,7 @@ static u32 ath9k_hw_get_eeprom_4k(struct ath_hal *ah, | |||
2739 | static u32 ath9k_hw_get_eeprom_def(struct ath_hal *ah, | 2751 | static u32 ath9k_hw_get_eeprom_def(struct ath_hal *ah, |
2740 | enum eeprom_param param) | 2752 | enum eeprom_param param) |
2741 | { | 2753 | { |
2754 | #define AR5416_VER_MASK (pBase->version & AR5416_EEP_VER_MINOR_MASK) | ||
2742 | struct ath_hal_5416 *ahp = AH5416(ah); | 2755 | struct ath_hal_5416 *ahp = AH5416(ah); |
2743 | struct ar5416_eeprom_def *eep = &ahp->ah_eeprom.def; | 2756 | struct ar5416_eeprom_def *eep = &ahp->ah_eeprom.def; |
2744 | struct modal_eep_header *pModal = eep->modalHeader; | 2757 | struct modal_eep_header *pModal = eep->modalHeader; |
@@ -2774,7 +2787,7 @@ static u32 ath9k_hw_get_eeprom_def(struct ath_hal *ah, | |||
2774 | case EEP_DB_2: | 2787 | case EEP_DB_2: |
2775 | return pModal[1].db; | 2788 | return pModal[1].db; |
2776 | case EEP_MINOR_REV: | 2789 | case EEP_MINOR_REV: |
2777 | return pBase->version & AR5416_EEP_VER_MINOR_MASK; | 2790 | return AR5416_VER_MASK; |
2778 | case EEP_TX_MASK: | 2791 | case EEP_TX_MASK: |
2779 | return pBase->txMask; | 2792 | return pBase->txMask; |
2780 | case EEP_RX_MASK: | 2793 | case EEP_RX_MASK: |
@@ -2783,10 +2796,15 @@ static u32 ath9k_hw_get_eeprom_def(struct ath_hal *ah, | |||
2783 | return pBase->rxGainType; | 2796 | return pBase->rxGainType; |
2784 | case EEP_TXGAIN_TYPE: | 2797 | case EEP_TXGAIN_TYPE: |
2785 | return pBase->txGainType; | 2798 | return pBase->txGainType; |
2786 | 2799 | case EEP_DAC_HPWR_5G: | |
2800 | if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_20) | ||
2801 | return pBase->dacHiPwrMode_5G; | ||
2802 | else | ||
2803 | return 0; | ||
2787 | default: | 2804 | default: |
2788 | return 0; | 2805 | return 0; |
2789 | } | 2806 | } |
2807 | #undef AR5416_VER_MASK | ||
2790 | } | 2808 | } |
2791 | 2809 | ||
2792 | static u32 (*ath9k_get_eeprom[])(struct ath_hal *, enum eeprom_param) = { | 2810 | static u32 (*ath9k_get_eeprom[])(struct ath_hal *, enum eeprom_param) = { |