diff options
author | Bob Copeland <me@bobcopeland.com> | 2009-10-14 14:16:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:18 -0400 |
commit | e5e2647fd6ceef2cdc479954b84517535eb7febd (patch) | |
tree | f0b22db14bae1881ea5cb4a9c6825192ac4a6afc /drivers/net/wireless/ath/ath5k/reset.c | |
parent | e307fcf0a10f9c0c21b3d8b2ff7862b29796cc7f (diff) |
ath5k: use noise calibration from madwifi hal
This updates ath5k to calibrate the noise floor similar to the
way it is done in the madwifi hal and ath9k. Of note:
- we start NF measurement at the same time as AGC calibration,
but do not actually read the value until the periodic (long)
calibration
- we keep a history of the last few values read and write the
median back to the hardware for CCA
- we do not complain if NF calibration isn't complete, instead
we keep the last read value.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/reset.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/reset.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c index 3dab3d856d7b..62954fc77869 100644 --- a/drivers/net/wireless/ath/ath5k/reset.c +++ b/drivers/net/wireless/ath/ath5k/reset.c | |||
@@ -1293,7 +1293,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1293 | * out and/or noise floor calibration might timeout. | 1293 | * out and/or noise floor calibration might timeout. |
1294 | */ | 1294 | */ |
1295 | AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL, | 1295 | AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL, |
1296 | AR5K_PHY_AGCCTL_CAL); | 1296 | AR5K_PHY_AGCCTL_CAL | AR5K_PHY_AGCCTL_NF); |
1297 | 1297 | ||
1298 | /* At the same time start I/Q calibration for QAM constellation | 1298 | /* At the same time start I/Q calibration for QAM constellation |
1299 | * -no need for CCK- */ | 1299 | * -no need for CCK- */ |
@@ -1314,21 +1314,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
1314 | channel->center_freq); | 1314 | channel->center_freq); |
1315 | } | 1315 | } |
1316 | 1316 | ||
1317 | /* | ||
1318 | * If we run NF calibration before AGC, it always times out. | ||
1319 | * Binary HAL starts NF and AGC calibration at the same time | ||
1320 | * and only waits for AGC to finish. Also if AGC or NF cal. | ||
1321 | * times out, reset doesn't fail on binary HAL. I believe | ||
1322 | * that's wrong because since rx path is routed to a detector, | ||
1323 | * if cal. doesn't finish we won't have RX. Sam's HAL for AR5210/5211 | ||
1324 | * enables noise floor calibration after offset calibration and if noise | ||
1325 | * floor calibration fails, reset fails. I believe that's | ||
1326 | * a better approach, we just need to find a polling interval | ||
1327 | * that suits best, even if reset continues we need to make | ||
1328 | * sure that rx path is ready. | ||
1329 | */ | ||
1330 | ath5k_hw_noise_floor_calibration(ah, channel->center_freq); | ||
1331 | |||
1332 | /* Restore antenna mode */ | 1317 | /* Restore antenna mode */ |
1333 | ath5k_hw_set_antenna_mode(ah, ah->ah_ant_mode); | 1318 | ath5k_hw_set_antenna_mode(ah, ah->ah_ant_mode); |
1334 | 1319 | ||