Commit 793c5929 authored by Senthil Balasubramanian's avatar Senthil Balasubramanian Committed by John W. Linville

ath9k: Fix AR9285 specific noise floor eeprom reads.

Fix AR9285 specific noise floor reads and initialize tx and rx
chainmask during reset. This along with the following earlier
patches of ath9k fixes an issue with association noticed in
noisy environment.

ath9k: Fix typo in chip version check
ath9k: Remove unnecessary gpio configuration in ath9k_hw_reset()
ath9k: Fix bug in NF calibration
Signed-off-by: default avatarSenthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0c6666e4
...@@ -105,6 +105,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah, ...@@ -105,6 +105,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah,
"NF calibrated [ctl] [chain 0] is %d\n", nf); "NF calibrated [ctl] [chain 0] is %d\n", nf);
nfarray[0] = nf; nfarray[0] = nf;
if (!AR_SREV_9285(ah)) {
if (AR_SREV_9280_10_OR_LATER(ah)) if (AR_SREV_9280_10_OR_LATER(ah))
nf = MS(REG_READ(ah, AR_PHY_CH1_CCA), nf = MS(REG_READ(ah, AR_PHY_CH1_CCA),
AR9280_PHY_CH1_MINCCA_PWR); AR9280_PHY_CH1_MINCCA_PWR);
...@@ -127,6 +128,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah, ...@@ -127,6 +128,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah,
"NF calibrated [ctl] [chain 2] is %d\n", nf); "NF calibrated [ctl] [chain 2] is %d\n", nf);
nfarray[2] = nf; nfarray[2] = nf;
} }
}
if (AR_SREV_9280_10_OR_LATER(ah)) if (AR_SREV_9280_10_OR_LATER(ah))
nf = MS(REG_READ(ah, AR_PHY_EXT_CCA), nf = MS(REG_READ(ah, AR_PHY_EXT_CCA),
...@@ -141,6 +143,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah, ...@@ -141,6 +143,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah,
"NF calibrated [ext] [chain 0] is %d\n", nf); "NF calibrated [ext] [chain 0] is %d\n", nf);
nfarray[3] = nf; nfarray[3] = nf;
if (!AR_SREV_9285(ah)) {
if (AR_SREV_9280_10_OR_LATER(ah)) if (AR_SREV_9280_10_OR_LATER(ah))
nf = MS(REG_READ(ah, AR_PHY_CH1_EXT_CCA), nf = MS(REG_READ(ah, AR_PHY_CH1_EXT_CCA),
AR9280_PHY_CH1_EXT_MINCCA_PWR); AR9280_PHY_CH1_EXT_MINCCA_PWR);
...@@ -163,6 +166,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah, ...@@ -163,6 +166,7 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah,
"NF calibrated [ext] [chain 2] is %d\n", nf); "NF calibrated [ext] [chain 2] is %d\n", nf);
nfarray[5] = nf; nfarray[5] = nf;
} }
}
} }
static bool getNoiseFloorThresh(struct ath_hal *ah, static bool getNoiseFloorThresh(struct ath_hal *ah,
...@@ -668,12 +672,6 @@ int16_t ath9k_hw_getnf(struct ath_hal *ah, ...@@ -668,12 +672,6 @@ int16_t ath9k_hw_getnf(struct ath_hal *ah,
int16_t nfarray[NUM_NF_READINGS] = { 0 }; int16_t nfarray[NUM_NF_READINGS] = { 0 };
struct ath9k_nfcal_hist *h; struct ath9k_nfcal_hist *h;
struct ieee80211_channel *c = chan->chan; struct ieee80211_channel *c = chan->chan;
u8 chainmask;
if (AR_SREV_9280(ah))
chainmask = 0x1B;
else
chainmask = 0x3F;
chan->channelFlags &= (~CHANNEL_CW_INT); chan->channelFlags &= (~CHANNEL_CW_INT);
if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) { if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) {
......
...@@ -2165,7 +2165,10 @@ int ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan, ...@@ -2165,7 +2165,10 @@ int ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan,
ahp->ah_txchainmask = sc->sc_tx_chainmask; ahp->ah_txchainmask = sc->sc_tx_chainmask;
ahp->ah_rxchainmask = sc->sc_rx_chainmask; ahp->ah_rxchainmask = sc->sc_rx_chainmask;
if (AR_SREV_9280(ah)) { if (AR_SREV_9285(ah)) {
ahp->ah_txchainmask &= 0x1;
ahp->ah_rxchainmask &= 0x1;
} else if (AR_SREV_9280(ah)) {
ahp->ah_txchainmask &= 0x3; ahp->ah_txchainmask &= 0x3;
ahp->ah_rxchainmask &= 0x3; ahp->ah_rxchainmask &= 0x3;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment