diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/mac.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/mac.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c index b6b523a897e..0f90e1521ff 100644 --- a/drivers/net/wireless/ath/ath9k/mac.c +++ b/drivers/net/wireless/ath/ath9k/mac.c | |||
@@ -800,6 +800,11 @@ void ath9k_hw_disable_interrupts(struct ath_hw *ah) | |||
800 | { | 800 | { |
801 | struct ath_common *common = ath9k_hw_common(ah); | 801 | struct ath_common *common = ath9k_hw_common(ah); |
802 | 802 | ||
803 | if (!(ah->imask & ATH9K_INT_GLOBAL)) | ||
804 | atomic_set(&ah->intr_ref_cnt, -1); | ||
805 | else | ||
806 | atomic_dec(&ah->intr_ref_cnt); | ||
807 | |||
803 | ath_dbg(common, ATH_DBG_INTERRUPT, "disable IER\n"); | 808 | ath_dbg(common, ATH_DBG_INTERRUPT, "disable IER\n"); |
804 | REG_WRITE(ah, AR_IER, AR_IER_DISABLE); | 809 | REG_WRITE(ah, AR_IER, AR_IER_DISABLE); |
805 | (void) REG_READ(ah, AR_IER); | 810 | (void) REG_READ(ah, AR_IER); |
@@ -821,6 +826,13 @@ void ath9k_hw_enable_interrupts(struct ath_hw *ah) | |||
821 | if (!(ah->imask & ATH9K_INT_GLOBAL)) | 826 | if (!(ah->imask & ATH9K_INT_GLOBAL)) |
822 | return; | 827 | return; |
823 | 828 | ||
829 | if (!atomic_inc_and_test(&ah->intr_ref_cnt)) { | ||
830 | ath_dbg(common, ATH_DBG_INTERRUPT, | ||
831 | "Do not enable IER ref count %d\n", | ||
832 | atomic_read(&ah->intr_ref_cnt)); | ||
833 | return; | ||
834 | } | ||
835 | |||
824 | if (AR_SREV_9340(ah)) | 836 | if (AR_SREV_9340(ah)) |
825 | sync_default &= ~AR_INTR_SYNC_HOST1_FATAL; | 837 | sync_default &= ~AR_INTR_SYNC_HOST1_FATAL; |
826 | 838 | ||
@@ -852,7 +864,6 @@ void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints) | |||
852 | 864 | ||
853 | ath_dbg(common, ATH_DBG_INTERRUPT, "0x%x => 0x%x\n", omask, ints); | 865 | ath_dbg(common, ATH_DBG_INTERRUPT, "0x%x => 0x%x\n", omask, ints); |
854 | 866 | ||
855 | /* TODO: global int Ref count */ | ||
856 | mask = ints & ATH9K_INT_COMMON; | 867 | mask = ints & ATH9K_INT_COMMON; |
857 | mask2 = 0; | 868 | mask2 = 0; |
858 | 869 | ||
@@ -929,9 +940,6 @@ void ath9k_hw_set_interrupts(struct ath_hw *ah, enum ath9k_int ints) | |||
929 | REG_CLR_BIT(ah, AR_IMR_S5, AR_IMR_S5_TIM_TIMER); | 940 | REG_CLR_BIT(ah, AR_IMR_S5, AR_IMR_S5_TIM_TIMER); |
930 | } | 941 | } |
931 | 942 | ||
932 | if (ints & ATH9K_INT_GLOBAL) | ||
933 | ath9k_hw_enable_interrupts(ah); | ||
934 | |||
935 | return; | 943 | return; |
936 | } | 944 | } |
937 | EXPORT_SYMBOL(ath9k_hw_set_interrupts); | 945 | EXPORT_SYMBOL(ath9k_hw_set_interrupts); |