aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2009-01-26 09:58:14 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:49 -0500
commit793c592995b841667fa6d1a36a98880430dcc8f4 (patch)
tree64388d808d27c48e14f4b6338347409d921832ff /drivers/net/wireless
parent0c6666e4c43a10a224c63e3270c963d97f7e8cc8 (diff)
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: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath9k/calib.c78
-rw-r--r--drivers/net/wireless/ath9k/hw.c5
2 files changed, 42 insertions, 41 deletions
diff --git a/drivers/net/wireless/ath9k/calib.c b/drivers/net/wireless/ath9k/calib.c
index c6d1de0f1e21..69ff01ce968b 100644
--- a/drivers/net/wireless/ath9k/calib.c
+++ b/drivers/net/wireless/ath9k/calib.c
@@ -105,27 +105,29 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah,
105 "NF calibrated [ctl] [chain 0] is %d\n", nf); 105 "NF calibrated [ctl] [chain 0] is %d\n", nf);
106 nfarray[0] = nf; 106 nfarray[0] = nf;
107 107
108 if (AR_SREV_9280_10_OR_LATER(ah)) 108 if (!AR_SREV_9285(ah)) {
109 nf = MS(REG_READ(ah, AR_PHY_CH1_CCA), 109 if (AR_SREV_9280_10_OR_LATER(ah))
110 AR9280_PHY_CH1_MINCCA_PWR); 110 nf = MS(REG_READ(ah, AR_PHY_CH1_CCA),
111 else 111 AR9280_PHY_CH1_MINCCA_PWR);
112 nf = MS(REG_READ(ah, AR_PHY_CH1_CCA), 112 else
113 AR_PHY_CH1_MINCCA_PWR); 113 nf = MS(REG_READ(ah, AR_PHY_CH1_CCA),
114 114 AR_PHY_CH1_MINCCA_PWR);
115 if (nf & 0x100)
116 nf = 0 - ((nf ^ 0x1ff) + 1);
117 DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE,
118 "NF calibrated [ctl] [chain 1] is %d\n", nf);
119 nfarray[1] = nf;
120 115
121 if (!AR_SREV_9280(ah)) {
122 nf = MS(REG_READ(ah, AR_PHY_CH2_CCA),
123 AR_PHY_CH2_MINCCA_PWR);
124 if (nf & 0x100) 116 if (nf & 0x100)
125 nf = 0 - ((nf ^ 0x1ff) + 1); 117 nf = 0 - ((nf ^ 0x1ff) + 1);
126 DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, 118 DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE,
127 "NF calibrated [ctl] [chain 2] is %d\n", nf); 119 "NF calibrated [ctl] [chain 1] is %d\n", nf);
128 nfarray[2] = nf; 120 nfarray[1] = nf;
121
122 if (!AR_SREV_9280(ah)) {
123 nf = MS(REG_READ(ah, AR_PHY_CH2_CCA),
124 AR_PHY_CH2_MINCCA_PWR);
125 if (nf & 0x100)
126 nf = 0 - ((nf ^ 0x1ff) + 1);
127 DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE,
128 "NF calibrated [ctl] [chain 2] is %d\n", nf);
129 nfarray[2] = nf;
130 }
129 } 131 }
130 132
131 if (AR_SREV_9280_10_OR_LATER(ah)) 133 if (AR_SREV_9280_10_OR_LATER(ah))
@@ -141,27 +143,29 @@ static void ath9k_hw_do_getnf(struct ath_hal *ah,
141 "NF calibrated [ext] [chain 0] is %d\n", nf); 143 "NF calibrated [ext] [chain 0] is %d\n", nf);
142 nfarray[3] = nf; 144 nfarray[3] = nf;
143 145
144 if (AR_SREV_9280_10_OR_LATER(ah)) 146 if (!AR_SREV_9285(ah)) {
145 nf = MS(REG_READ(ah, AR_PHY_CH1_EXT_CCA), 147 if (AR_SREV_9280_10_OR_LATER(ah))
146 AR9280_PHY_CH1_EXT_MINCCA_PWR); 148 nf = MS(REG_READ(ah, AR_PHY_CH1_EXT_CCA),
147 else 149 AR9280_PHY_CH1_EXT_MINCCA_PWR);
148 nf = MS(REG_READ(ah, AR_PHY_CH1_EXT_CCA), 150 else
149 AR_PHY_CH1_EXT_MINCCA_PWR); 151 nf = MS(REG_READ(ah, AR_PHY_CH1_EXT_CCA),
152 AR_PHY_CH1_EXT_MINCCA_PWR);
150 153
151 if (nf & 0x100)
152 nf = 0 - ((nf ^ 0x1ff) + 1);
153 DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE,
154 "NF calibrated [ext] [chain 1] is %d\n", nf);
155 nfarray[4] = nf;
156
157 if (!AR_SREV_9280(ah)) {
158 nf = MS(REG_READ(ah, AR_PHY_CH2_EXT_CCA),
159 AR_PHY_CH2_EXT_MINCCA_PWR);
160 if (nf & 0x100) 154 if (nf & 0x100)
161 nf = 0 - ((nf ^ 0x1ff) + 1); 155 nf = 0 - ((nf ^ 0x1ff) + 1);
162 DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE, 156 DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE,
163 "NF calibrated [ext] [chain 2] is %d\n", nf); 157 "NF calibrated [ext] [chain 1] is %d\n", nf);
164 nfarray[5] = nf; 158 nfarray[4] = nf;
159
160 if (!AR_SREV_9280(ah)) {
161 nf = MS(REG_READ(ah, AR_PHY_CH2_EXT_CCA),
162 AR_PHY_CH2_EXT_MINCCA_PWR);
163 if (nf & 0x100)
164 nf = 0 - ((nf ^ 0x1ff) + 1);
165 DPRINTF(ah->ah_sc, ATH_DBG_CALIBRATE,
166 "NF calibrated [ext] [chain 2] is %d\n", nf);
167 nfarray[5] = nf;
168 }
165 } 169 }
166} 170}
167 171
@@ -668,12 +672,6 @@ int16_t ath9k_hw_getnf(struct ath_hal *ah,
668 int16_t nfarray[NUM_NF_READINGS] = { 0 }; 672 int16_t nfarray[NUM_NF_READINGS] = { 0 };
669 struct ath9k_nfcal_hist *h; 673 struct ath9k_nfcal_hist *h;
670 struct ieee80211_channel *c = chan->chan; 674 struct ieee80211_channel *c = chan->chan;
671 u8 chainmask;
672
673 if (AR_SREV_9280(ah))
674 chainmask = 0x1B;
675 else
676 chainmask = 0x3F;
677 675
678 chan->channelFlags &= (~CHANNEL_CW_INT); 676 chan->channelFlags &= (~CHANNEL_CW_INT);
679 if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) { 677 if (REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) {
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index bb8628c7efa1..77282345efc1 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -2165,7 +2165,10 @@ int ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan,
2165 ahp->ah_txchainmask = sc->sc_tx_chainmask; 2165 ahp->ah_txchainmask = sc->sc_tx_chainmask;
2166 ahp->ah_rxchainmask = sc->sc_rx_chainmask; 2166 ahp->ah_rxchainmask = sc->sc_rx_chainmask;
2167 2167
2168 if (AR_SREV_9280(ah)) { 2168 if (AR_SREV_9285(ah)) {
2169 ahp->ah_txchainmask &= 0x1;
2170 ahp->ah_rxchainmask &= 0x1;
2171 } else if (AR_SREV_9280(ah)) {
2169 ahp->ah_txchainmask &= 0x3; 2172 ahp->ah_txchainmask &= 0x3;
2170 ahp->ah_rxchainmask &= 0x3; 2173 ahp->ah_rxchainmask &= 0x3;
2171 } 2174 }