]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ath9k_hw: simplify tx queue interrupt mask handling
authorFelix Fietkau <nbd@openwrt.org>
Wed, 14 Mar 2012 15:40:21 +0000 (16:40 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 15 Mar 2012 17:43:13 +0000 (13:43 -0400)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/mac.c

index 5f4ae6c9a93c69f4605bf7af447bc29e1c8cb583..13b6afd678265d96040f5bd7fa15d62fd6937d3f 100644 (file)
@@ -340,6 +340,15 @@ int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type,
 }
 EXPORT_SYMBOL(ath9k_hw_setuptxqueue);
 
+static void ath9k_hw_clear_queue_interrupts(struct ath_hw *ah, u32 q)
+{
+       ah->txok_interrupt_mask &= ~(1 << q);
+       ah->txerr_interrupt_mask &= ~(1 << q);
+       ah->txdesc_interrupt_mask &= ~(1 << q);
+       ah->txeol_interrupt_mask &= ~(1 << q);
+       ah->txurn_interrupt_mask &= ~(1 << q);
+}
+
 bool ath9k_hw_releasetxqueue(struct ath_hw *ah, u32 q)
 {
        struct ath_common *common = ath9k_hw_common(ah);
@@ -354,11 +363,7 @@ bool ath9k_hw_releasetxqueue(struct ath_hw *ah, u32 q)
        ath_dbg(common, QUEUE, "Release TX queue: %u\n", q);
 
        qi->tqi_type = ATH9K_TX_QUEUE_INACTIVE;
-       ah->txok_interrupt_mask &= ~(1 << q);
-       ah->txerr_interrupt_mask &= ~(1 << q);
-       ah->txdesc_interrupt_mask &= ~(1 << q);
-       ah->txeol_interrupt_mask &= ~(1 << q);
-       ah->txurn_interrupt_mask &= ~(1 << q);
+       ath9k_hw_clear_queue_interrupts(ah, q);
        ath9k_hw_set_txq_interrupts(ah, qi);
 
        return true;
@@ -510,26 +515,17 @@ bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q)
        if (AR_SREV_9300_20_OR_LATER(ah))
                REG_WRITE(ah, AR_Q_DESC_CRCCHK, AR_Q_DESC_CRCCHK_EN);
 
+       ath9k_hw_clear_queue_interrupts(ah, q);
        if (qi->tqi_qflags & TXQ_FLAG_TXOKINT_ENABLE)
                ah->txok_interrupt_mask |= 1 << q;
-       else
-               ah->txok_interrupt_mask &= ~(1 << q);
        if (qi->tqi_qflags & TXQ_FLAG_TXERRINT_ENABLE)
                ah->txerr_interrupt_mask |= 1 << q;
-       else
-               ah->txerr_interrupt_mask &= ~(1 << q);
        if (qi->tqi_qflags & TXQ_FLAG_TXDESCINT_ENABLE)
                ah->txdesc_interrupt_mask |= 1 << q;
-       else
-               ah->txdesc_interrupt_mask &= ~(1 << q);
        if (qi->tqi_qflags & TXQ_FLAG_TXEOLINT_ENABLE)
                ah->txeol_interrupt_mask |= 1 << q;
-       else
-               ah->txeol_interrupt_mask &= ~(1 << q);
        if (qi->tqi_qflags & TXQ_FLAG_TXURNINT_ENABLE)
                ah->txurn_interrupt_mask |= 1 << q;
-       else
-               ah->txurn_interrupt_mask &= ~(1 << q);
        ath9k_hw_set_txq_interrupts(ah, qi);
 
        return true;