aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSergey Ryazanov <ryazanov.s.a@gmail.com>2020-04-24 03:49:21 +0300
committerKalle Valo <kvalo@codeaurora.org>2020-04-28 12:07:16 +0300
commit2bb7027b64b68bf8620b849d6ec1c223572c7e92 (patch)
treec653c41dd65218850b42cbfff9ab85d91e778aad
parentath9k: do not miss longcal on AR9002 (diff)
downloadwireguard-linux-2bb7027b64b68bf8620b849d6ec1c223572c7e92.tar.xz
wireguard-linux-2bb7027b64b68bf8620b849d6ec1c223572c7e92.zip
ath9k: interleaved NF calibration on AR9002
NF calibration and other elements of long calibration are usually faster than ADCs & I/Q calibrations due to independence of receiption of the OFDM signal. Moreover sometime I/Q calibration can not be completed at all without preceding NF calibration. This is due to AGC, which has a habit to block a weak signal without regular NF calibration. Thus, we do not need to deferr the long calibration forever. So, if the long calibration is requested, then deferr the ADCs & I/Q calibration(s) and run the longcal (the NF calibration in particular) to obtain fresh noise data. Run tested with AR9220. Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200424004923.17129-5-ryazanov.s.a@gmail.com
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_calib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index ad8db7720993..68188f500949 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -680,8 +680,12 @@ static int ar9002_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan,
return 0;
ah->cal_list_curr = currCal = currCal->calNext;
- if (currCal->calState == CAL_WAITING)
- ath9k_hw_reset_calibration(ah, currCal);
+ percal_pending = currCal->calState == CAL_WAITING;
+ }
+
+ /* Do not start a next calibration if the longcal is in action */
+ if (percal_pending && !nfcal && !longcal) {
+ ath9k_hw_reset_calibration(ah, currCal);
return 0;
}