diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 8d291ccf5c8..3384ca16456 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -610,7 +610,6 @@ static int __ath9k_hw_init(struct ath_hw *ah) | |||
610 | else | 610 | else |
611 | ah->tx_trig_level = (AR_FTRIG_512B >> AR_FTRIG_S); | 611 | ah->tx_trig_level = (AR_FTRIG_512B >> AR_FTRIG_S); |
612 | 612 | ||
613 | ath9k_init_nfcal_hist_buffer(ah); | ||
614 | ah->bb_watchdog_timeout_ms = 25; | 613 | ah->bb_watchdog_timeout_ms = 25; |
615 | 614 | ||
616 | common->state = ATH_HW_INITIALIZED; | 615 | common->state = ATH_HW_INITIALIZED; |
@@ -1183,9 +1182,6 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, | |||
1183 | 1182 | ||
1184 | ath9k_hw_spur_mitigate_freq(ah, chan); | 1183 | ath9k_hw_spur_mitigate_freq(ah, chan); |
1185 | 1184 | ||
1186 | if (!chan->oneTimeCalsDone) | ||
1187 | chan->oneTimeCalsDone = true; | ||
1188 | |||
1189 | return true; | 1185 | return true; |
1190 | } | 1186 | } |
1191 | 1187 | ||
@@ -1218,7 +1214,7 @@ bool ath9k_hw_check_alive(struct ath_hw *ah) | |||
1218 | EXPORT_SYMBOL(ath9k_hw_check_alive); | 1214 | EXPORT_SYMBOL(ath9k_hw_check_alive); |
1219 | 1215 | ||
1220 | int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | 1216 | int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, |
1221 | bool bChannelChange) | 1217 | struct ath9k_hw_cal_data *caldata, bool bChannelChange) |
1222 | { | 1218 | { |
1223 | struct ath_common *common = ath9k_hw_common(ah); | 1219 | struct ath_common *common = ath9k_hw_common(ah); |
1224 | u32 saveLedState; | 1220 | u32 saveLedState; |
@@ -1243,9 +1239,19 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1243 | if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) | 1239 | if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) |
1244 | return -EIO; | 1240 | return -EIO; |
1245 | 1241 | ||
1246 | if (curchan && !ah->chip_fullsleep) | 1242 | if (curchan && !ah->chip_fullsleep && ah->caldata) |
1247 | ath9k_hw_getnf(ah, curchan); | 1243 | ath9k_hw_getnf(ah, curchan); |
1248 | 1244 | ||
1245 | ah->caldata = caldata; | ||
1246 | if (caldata && | ||
1247 | (chan->channel != caldata->channel || | ||
1248 | (chan->channelFlags & ~CHANNEL_CW_INT) != | ||
1249 | (caldata->channelFlags & ~CHANNEL_CW_INT))) { | ||
1250 | /* Operating channel changed, reset channel calibration data */ | ||
1251 | memset(caldata, 0, sizeof(*caldata)); | ||
1252 | ath9k_init_nfcal_hist_buffer(ah, chan); | ||
1253 | } | ||
1254 | |||
1249 | if (bChannelChange && | 1255 | if (bChannelChange && |
1250 | (ah->chip_fullsleep != true) && | 1256 | (ah->chip_fullsleep != true) && |
1251 | (ah->curchan != NULL) && | 1257 | (ah->curchan != NULL) && |
@@ -1256,7 +1262,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1256 | 1262 | ||
1257 | if (ath9k_hw_channel_change(ah, chan)) { | 1263 | if (ath9k_hw_channel_change(ah, chan)) { |
1258 | ath9k_hw_loadnf(ah, ah->curchan); | 1264 | ath9k_hw_loadnf(ah, ah->curchan); |
1259 | ath9k_hw_start_nfcal(ah); | 1265 | ath9k_hw_start_nfcal(ah, true); |
1260 | return 0; | 1266 | return 0; |
1261 | } | 1267 | } |
1262 | } | 1268 | } |
@@ -1461,11 +1467,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1461 | if (ah->btcoex_hw.enabled) | 1467 | if (ah->btcoex_hw.enabled) |
1462 | ath9k_hw_btcoex_enable(ah); | 1468 | ath9k_hw_btcoex_enable(ah); |
1463 | 1469 | ||
1464 | if (AR_SREV_9300_20_OR_LATER(ah)) { | 1470 | if (AR_SREV_9300_20_OR_LATER(ah)) |
1465 | ath9k_hw_loadnf(ah, curchan); | ||
1466 | ath9k_hw_start_nfcal(ah); | ||
1467 | ar9003_hw_bb_watchdog_config(ah); | 1471 | ar9003_hw_bb_watchdog_config(ah); |
1468 | } | ||
1469 | 1472 | ||
1470 | return 0; | 1473 | return 0; |
1471 | } | 1474 | } |