diff options
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/link.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 3 |
4 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index dfe6a4707fd2..77c2c16b6961 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -437,6 +437,7 @@ void ath9k_set_beacon(struct ath_softc *sc); | |||
437 | #define ATH_LONG_CALINTERVAL_INT 1000 /* 1000 ms */ | 437 | #define ATH_LONG_CALINTERVAL_INT 1000 /* 1000 ms */ |
438 | #define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */ | 438 | #define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */ |
439 | #define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */ | 439 | #define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */ |
440 | #define ATH_ANI_MAX_SKIP_COUNT 10 | ||
440 | 441 | ||
441 | #define ATH_PAPRD_TIMEOUT 100 /* msecs */ | 442 | #define ATH_PAPRD_TIMEOUT 100 /* msecs */ |
442 | #define ATH_PLL_WORK_INTERVAL 100 | 443 | #define ATH_PLL_WORK_INTERVAL 100 |
@@ -642,6 +643,7 @@ enum sc_op_flags { | |||
642 | #define PS_WAIT_FOR_PSPOLL_DATA BIT(2) | 643 | #define PS_WAIT_FOR_PSPOLL_DATA BIT(2) |
643 | #define PS_WAIT_FOR_TX_ACK BIT(3) | 644 | #define PS_WAIT_FOR_TX_ACK BIT(3) |
644 | #define PS_BEACON_SYNC BIT(4) | 645 | #define PS_BEACON_SYNC BIT(4) |
646 | #define PS_WAIT_FOR_ANI BIT(5) | ||
645 | 647 | ||
646 | struct ath_rate_table; | 648 | struct ath_rate_table; |
647 | 649 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index dbc1b7a4cbfd..1d4f5f1fdd8d 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -834,6 +834,7 @@ struct ath_hw { | |||
834 | int coarse_low[5]; | 834 | int coarse_low[5]; |
835 | int firpwr[5]; | 835 | int firpwr[5]; |
836 | enum ath9k_ani_cmd ani_function; | 836 | enum ath9k_ani_cmd ani_function; |
837 | u32 ani_skip_count; | ||
837 | 838 | ||
838 | #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT | 839 | #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT |
839 | struct ath_btcoex_hw btcoex_hw; | 840 | struct ath_btcoex_hw btcoex_hw; |
diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c index 7b88b9c39ccd..223b9693527e 100644 --- a/drivers/net/wireless/ath/ath9k/link.c +++ b/drivers/net/wireless/ath/ath9k/link.c | |||
@@ -350,8 +350,18 @@ void ath_ani_calibrate(unsigned long data) | |||
350 | ATH_AP_SHORT_CALINTERVAL : ATH_STA_SHORT_CALINTERVAL; | 350 | ATH_AP_SHORT_CALINTERVAL : ATH_STA_SHORT_CALINTERVAL; |
351 | 351 | ||
352 | /* Only calibrate if awake */ | 352 | /* Only calibrate if awake */ |
353 | if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE) | 353 | if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE) { |
354 | if (++ah->ani_skip_count >= ATH_ANI_MAX_SKIP_COUNT) { | ||
355 | spin_lock_irqsave(&sc->sc_pm_lock, flags); | ||
356 | sc->ps_flags |= PS_WAIT_FOR_ANI; | ||
357 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); | ||
358 | } | ||
354 | goto set_timer; | 359 | goto set_timer; |
360 | } | ||
361 | ah->ani_skip_count = 0; | ||
362 | spin_lock_irqsave(&sc->sc_pm_lock, flags); | ||
363 | sc->ps_flags &= ~PS_WAIT_FOR_ANI; | ||
364 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); | ||
355 | 365 | ||
356 | ath9k_ps_wakeup(sc); | 366 | ath9k_ps_wakeup(sc); |
357 | 367 | ||
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index dd45edfa6bae..2da62be081f7 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -131,7 +131,8 @@ void ath9k_ps_restore(struct ath_softc *sc) | |||
131 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | | 131 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | |
132 | PS_WAIT_FOR_CAB | | 132 | PS_WAIT_FOR_CAB | |
133 | PS_WAIT_FOR_PSPOLL_DATA | | 133 | PS_WAIT_FOR_PSPOLL_DATA | |
134 | PS_WAIT_FOR_TX_ACK))) { | 134 | PS_WAIT_FOR_TX_ACK | |
135 | PS_WAIT_FOR_ANI))) { | ||
135 | mode = ATH9K_PM_NETWORK_SLEEP; | 136 | mode = ATH9K_PM_NETWORK_SLEEP; |
136 | if (ath9k_hw_btcoex_is_enabled(sc->sc_ah)) | 137 | if (ath9k_hw_btcoex_is_enabled(sc->sc_ah)) |
137 | ath9k_btcoex_stop_gen_timer(sc); | 138 | ath9k_btcoex_stop_gen_timer(sc); |