aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 3aa8fb1ad77f..9297f574b71c 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -633,7 +633,7 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
633 REGWRITE_BUFFER_FLUSH(ah); 633 REGWRITE_BUFFER_FLUSH(ah);
634} 634}
635 635
636static void ath9k_hw_ani_read_counters(struct ath_hw *ah) 636static bool ath9k_hw_ani_read_counters(struct ath_hw *ah)
637{ 637{
638 struct ath_common *common = ath9k_hw_common(ah); 638 struct ath_common *common = ath9k_hw_common(ah);
639 struct ar5416AniState *aniState = &ah->curchan->ani; 639 struct ar5416AniState *aniState = &ah->curchan->ani;
@@ -646,10 +646,10 @@ static void ath9k_hw_ani_read_counters(struct ath_hw *ah)
646 ath_hw_cycle_counters_update(common); 646 ath_hw_cycle_counters_update(common);
647 listenTime = ath_hw_get_listen_time(common); 647 listenTime = ath_hw_get_listen_time(common);
648 648
649 if (listenTime < 0) { 649 if (listenTime <= 0) {
650 ah->stats.ast_ani_lneg++; 650 ah->stats.ast_ani_lneg++;
651 ath9k_ani_restart(ah); 651 ath9k_ani_restart(ah);
652 return; 652 return false;
653 } 653 }
654 654
655 if (!use_new_ani(ah)) { 655 if (!use_new_ani(ah)) {
@@ -683,7 +683,7 @@ static void ath9k_hw_ani_read_counters(struct ath_hw *ah)
683 REG_WRITE(ah, AR_PHY_ERR_MASK_2, 683 REG_WRITE(ah, AR_PHY_ERR_MASK_2,
684 AR_PHY_ERR_CCK_TIMING); 684 AR_PHY_ERR_CCK_TIMING);
685 } 685 }
686 return; 686 return false;
687 } 687 }
688 688
689 ofdmPhyErrCnt = phyCnt1 - ofdm_base; 689 ofdmPhyErrCnt = phyCnt1 - ofdm_base;
@@ -695,7 +695,7 @@ static void ath9k_hw_ani_read_counters(struct ath_hw *ah)
695 ah->stats.ast_ani_cckerrs += 695 ah->stats.ast_ani_cckerrs +=
696 cckPhyErrCnt - aniState->cckPhyErrCount; 696 cckPhyErrCnt - aniState->cckPhyErrCount;
697 aniState->cckPhyErrCount = cckPhyErrCnt; 697 aniState->cckPhyErrCount = cckPhyErrCnt;
698 698 return true;
699} 699}
700 700
701void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan) 701void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
@@ -711,7 +711,8 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan)
711 if (WARN_ON(!aniState)) 711 if (WARN_ON(!aniState))
712 return; 712 return;
713 713
714 ath9k_hw_ani_read_counters(ah); 714 if (!ath9k_hw_ani_read_counters(ah))
715 return;
715 716
716 ofdmPhyErrRate = aniState->ofdmPhyErrCount * 1000 / 717 ofdmPhyErrRate = aniState->ofdmPhyErrCount * 1000 /
717 aniState->listenTime; 718 aniState->listenTime;