diff options
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_calib.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c index 16851cb109a6..a4cd1617092b 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c | |||
@@ -908,12 +908,15 @@ static bool ar9003_hw_rtt_restore(struct ath_hw *ah, struct ath9k_channel *chan) | |||
908 | int i; | 908 | int i; |
909 | bool restore; | 909 | bool restore; |
910 | 910 | ||
911 | if (!(ah->caps.hw_caps & ATH9K_HW_CAP_RTT) || !ah->caldata) | 911 | if (!ah->caldata) |
912 | return false; | 912 | return false; |
913 | 913 | ||
914 | hist = &ah->caldata->rtt_hist; | 914 | hist = &ah->caldata->rtt_hist; |
915 | if (!hist->num_readings) | ||
916 | return false; | ||
917 | |||
915 | ar9003_hw_rtt_enable(ah); | 918 | ar9003_hw_rtt_enable(ah); |
916 | ar9003_hw_rtt_set_mask(ah, 0x10); | 919 | ar9003_hw_rtt_set_mask(ah, 0x00); |
917 | for (i = 0; i < AR9300_MAX_CHAINS; i++) { | 920 | for (i = 0; i < AR9300_MAX_CHAINS; i++) { |
918 | if (!(ah->rxchainmask & (1 << i))) | 921 | if (!(ah->rxchainmask & (1 << i))) |
919 | continue; | 922 | continue; |
@@ -1070,6 +1073,7 @@ skip_tx_iqcal: | |||
1070 | if (is_reusable && (hist->num_readings < RTT_HIST_MAX)) { | 1073 | if (is_reusable && (hist->num_readings < RTT_HIST_MAX)) { |
1071 | u32 *table; | 1074 | u32 *table; |
1072 | 1075 | ||
1076 | hist->num_readings++; | ||
1073 | for (i = 0; i < AR9300_MAX_CHAINS; i++) { | 1077 | for (i = 0; i < AR9300_MAX_CHAINS; i++) { |
1074 | if (!(ah->rxchainmask & (1 << i))) | 1078 | if (!(ah->rxchainmask & (1 << i))) |
1075 | continue; | 1079 | continue; |