diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2011-03-01 11:59:36 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-04 14:05:17 -0500 |
commit | b06af7a57de42707fee6eec784ee507960cc9131 (patch) | |
tree | 64c3b2e0aea2bf096774098eb09b184e75f686d6 /drivers/net/wireless/ath | |
parent | 582d00641b03efa892b3d2cfe6b45c1fe6d422a1 (diff) |
ath9k_hw: Read noise floor only for available chains for AR9003
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index 8d60f4f09acc..eb250d6b8038 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -1020,28 +1020,29 @@ static bool ar9003_hw_ani_control(struct ath_hw *ah, | |||
1020 | static void ar9003_hw_do_getnf(struct ath_hw *ah, | 1020 | static void ar9003_hw_do_getnf(struct ath_hw *ah, |
1021 | int16_t nfarray[NUM_NF_READINGS]) | 1021 | int16_t nfarray[NUM_NF_READINGS]) |
1022 | { | 1022 | { |
1023 | int16_t nf; | 1023 | #define AR_PHY_CH_MINCCA_PWR 0x1FF00000 |
1024 | 1024 | #define AR_PHY_CH_MINCCA_PWR_S 20 | |
1025 | nf = MS(REG_READ(ah, AR_PHY_CCA_0), AR_PHY_MINCCA_PWR); | 1025 | #define AR_PHY_CH_EXT_MINCCA_PWR 0x01FF0000 |
1026 | nfarray[0] = sign_extend32(nf, 8); | 1026 | #define AR_PHY_CH_EXT_MINCCA_PWR_S 16 |
1027 | |||
1028 | nf = MS(REG_READ(ah, AR_PHY_CCA_1), AR_PHY_CH1_MINCCA_PWR); | ||
1029 | nfarray[1] = sign_extend32(nf, 8); | ||
1030 | 1027 | ||
1031 | nf = MS(REG_READ(ah, AR_PHY_CCA_2), AR_PHY_CH2_MINCCA_PWR); | 1028 | int16_t nf; |
1032 | nfarray[2] = sign_extend32(nf, 8); | 1029 | int i; |
1033 | |||
1034 | if (!IS_CHAN_HT40(ah->curchan)) | ||
1035 | return; | ||
1036 | 1030 | ||
1037 | nf = MS(REG_READ(ah, AR_PHY_EXT_CCA), AR_PHY_EXT_MINCCA_PWR); | 1031 | for (i = 0; i < AR9300_MAX_CHAINS; i++) { |
1038 | nfarray[3] = sign_extend32(nf, 8); | 1032 | if (ah->rxchainmask & BIT(i)) { |
1033 | nf = MS(REG_READ(ah, ah->nf_regs[i]), | ||
1034 | AR_PHY_CH_MINCCA_PWR); | ||
1035 | nfarray[i] = sign_extend32(nf, 8); | ||
1039 | 1036 | ||
1040 | nf = MS(REG_READ(ah, AR_PHY_EXT_CCA_1), AR_PHY_CH1_EXT_MINCCA_PWR); | 1037 | if (IS_CHAN_HT40(ah->curchan)) { |
1041 | nfarray[4] = sign_extend32(nf, 8); | 1038 | u8 ext_idx = AR9300_MAX_CHAINS + i; |
1042 | 1039 | ||
1043 | nf = MS(REG_READ(ah, AR_PHY_EXT_CCA_2), AR_PHY_CH2_EXT_MINCCA_PWR); | 1040 | nf = MS(REG_READ(ah, ah->nf_regs[ext_idx]), |
1044 | nfarray[5] = sign_extend32(nf, 8); | 1041 | AR_PHY_CH_EXT_MINCCA_PWR); |
1042 | nfarray[ext_idx] = sign_extend32(nf, 8); | ||
1043 | } | ||
1044 | } | ||
1045 | } | ||
1045 | } | 1046 | } |
1046 | 1047 | ||
1047 | static void ar9003_hw_set_nf_limits(struct ath_hw *ah) | 1048 | static void ar9003_hw_set_nf_limits(struct ath_hw *ah) |