aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-10-08 16:13:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-11 15:04:20 -0400
commitb5bfc5683db44a121ad47ec0a9f4efd4aac040e0 (patch)
treeb9d182f42cbbfdea95ad7ab425302617c5f40db9 /drivers/net/wireless/ath/ath9k/main.c
parent9d119f3ebd074bde0b801f476a44ca60d222efb2 (diff)
ath9k_hw: move the cycle counter tracking to ath
Instead of keeping track of wraparound, clear the counters on every access and keep separate deltas for ANI and later survey use. Also moves the function for calculating the 'listen time' for ANI Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 74c2dc8a8b8a..360c6f5e843a 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -399,6 +399,7 @@ void ath_ani_calibrate(unsigned long data)
399 bool aniflag = false; 399 bool aniflag = false;
400 unsigned int timestamp = jiffies_to_msecs(jiffies); 400 unsigned int timestamp = jiffies_to_msecs(jiffies);
401 u32 cal_interval, short_cal_interval, long_cal_interval; 401 u32 cal_interval, short_cal_interval, long_cal_interval;
402 unsigned long flags;
402 403
403 if (ah->caldata && ah->caldata->nfcal_interference) 404 if (ah->caldata && ah->caldata->nfcal_interference)
404 long_cal_interval = ATH_LONG_CALINTERVAL_INT; 405 long_cal_interval = ATH_LONG_CALINTERVAL_INT;
@@ -449,8 +450,11 @@ void ath_ani_calibrate(unsigned long data)
449 /* Skip all processing if there's nothing to do. */ 450 /* Skip all processing if there's nothing to do. */
450 if (longcal || shortcal || aniflag) { 451 if (longcal || shortcal || aniflag) {
451 /* Call ANI routine if necessary */ 452 /* Call ANI routine if necessary */
452 if (aniflag) 453 if (aniflag) {
454 spin_lock_irqsave(&common->cc_lock, flags);
453 ath9k_hw_ani_monitor(ah, ah->curchan); 455 ath9k_hw_ani_monitor(ah, ah->curchan);
456 spin_unlock_irqrestore(&common->cc_lock, flags);
457 }
454 458
455 /* Perform calibration if necessary */ 459 /* Perform calibration if necessary */
456 if (longcal || shortcal) { 460 if (longcal || shortcal) {
@@ -635,6 +639,7 @@ irqreturn_t ath_isr(int irq, void *dev)
635 639
636 struct ath_softc *sc = dev; 640 struct ath_softc *sc = dev;
637 struct ath_hw *ah = sc->sc_ah; 641 struct ath_hw *ah = sc->sc_ah;
642 struct ath_common *common = ath9k_hw_common(ah);
638 enum ath9k_int status; 643 enum ath9k_int status;
639 bool sched = false; 644 bool sched = false;
640 645
@@ -684,7 +689,12 @@ irqreturn_t ath_isr(int irq, void *dev)
684 689
685 if ((ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) && 690 if ((ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) &&
686 (status & ATH9K_INT_BB_WATCHDOG)) { 691 (status & ATH9K_INT_BB_WATCHDOG)) {
692
693 spin_lock(&common->cc_lock);
694 ath_hw_cycle_counters_update(common);
687 ar9003_hw_bb_watchdog_dbg_info(ah); 695 ar9003_hw_bb_watchdog_dbg_info(ah);
696 spin_unlock(&common->cc_lock);
697
688 goto chip_reset; 698 goto chip_reset;
689 } 699 }
690 700