aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-07-22 22:31:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-26 15:32:42 -0400
commit487f0e010cf5b6ba504150dfb20c21fd93e3b9e6 (patch)
treef8b371210cfc47ed78806e56140c7320f7dfa306 /drivers
parentd9292c0db7b4e98ae6d34a662ef49a8bd127fd8f (diff)
ath9k_hw: simplify noisefloor calibration chainmask calculation
The noisefloor array index always corresponds to the rx chain number it belongs to (with an offset of 3 for the extension chain). It's much simpler (and actually more correct) to directly use the chainmask to calculate the bitmask for the noisefloor array, instead of using these weird chip revision checks and hardcoded mask values. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/calib.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
index 07372462a8ea..139289e4e933 100644
--- a/drivers/net/wireless/ath/ath9k/calib.c
+++ b/drivers/net/wireless/ath/ath9k/calib.c
@@ -172,26 +172,9 @@ void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
172 struct ath9k_nfcal_hist *h; 172 struct ath9k_nfcal_hist *h;
173 unsigned i, j; 173 unsigned i, j;
174 int32_t val; 174 int32_t val;
175 u8 chainmask; 175 u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask;
176 struct ath_common *common = ath9k_hw_common(ah); 176 struct ath_common *common = ath9k_hw_common(ah);
177 177
178 if (AR_SREV_9300_20_OR_LATER(ah))
179 chainmask = 0x3F;
180 else if (AR_SREV_9285(ah) || AR_SREV_9271(ah))
181 chainmask = 0x9;
182 else if (AR_SREV_9280(ah) || AR_SREV_9287(ah)) {
183 if ((ah->rxchainmask & 0x2) || (ah->rxchainmask & 0x4))
184 chainmask = 0x1B;
185 else
186 chainmask = 0x09;
187 } else {
188 if (ah->rxchainmask & 0x4)
189 chainmask = 0x3F;
190 else if (ah->rxchainmask & 0x2)
191 chainmask = 0x1B;
192 else
193 chainmask = 0x09;
194 }
195 h = ah->nfCalHist; 178 h = ah->nfCalHist;
196 179
197 for (i = 0; i < NUM_NF_READINGS; i++) { 180 for (i = 0; i < NUM_NF_READINGS; i++) {