diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-03-14 11:40:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-15 13:43:13 -0400 |
commit | ce8fdf6ef6bc2e299d2e1572c55325e0dca7e85f (patch) | |
tree | 80ae52af3e78de2ba8c676dbd997a506265c2e9e /drivers/net/wireless | |
parent | 7e03072edd6a915812c418e5662204f83bbb0c84 (diff) |
ath9k_hw: clean up tx completion interrupt handling
TXQ_FLAG_TXOKINT_ENABLE and TXQ_FLAG_TXERRINT_ENABLE are always set and
used together, and they share the same bitmask in enum ath9k_tx_queue_flags.
Simplify the code that tests for these flags.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/mac.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/mac.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 3 |
3 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c index 13b6afd6782..bfb95e5d263 100644 --- a/drivers/net/wireless/ath/ath9k/mac.c +++ b/drivers/net/wireless/ath/ath9k/mac.c | |||
@@ -516,10 +516,10 @@ bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q) | |||
516 | REG_WRITE(ah, AR_Q_DESC_CRCCHK, AR_Q_DESC_CRCCHK_EN); | 516 | REG_WRITE(ah, AR_Q_DESC_CRCCHK, AR_Q_DESC_CRCCHK_EN); |
517 | 517 | ||
518 | ath9k_hw_clear_queue_interrupts(ah, q); | 518 | ath9k_hw_clear_queue_interrupts(ah, q); |
519 | if (qi->tqi_qflags & TXQ_FLAG_TXOKINT_ENABLE) | 519 | if (qi->tqi_qflags & TXQ_FLAG_TXINT_ENABLE) { |
520 | ah->txok_interrupt_mask |= 1 << q; | 520 | ah->txok_interrupt_mask |= 1 << q; |
521 | if (qi->tqi_qflags & TXQ_FLAG_TXERRINT_ENABLE) | ||
522 | ah->txerr_interrupt_mask |= 1 << q; | 521 | ah->txerr_interrupt_mask |= 1 << q; |
522 | } | ||
523 | if (qi->tqi_qflags & TXQ_FLAG_TXDESCINT_ENABLE) | 523 | if (qi->tqi_qflags & TXQ_FLAG_TXDESCINT_ENABLE) |
524 | ah->txdesc_interrupt_mask |= 1 << q; | 524 | ah->txdesc_interrupt_mask |= 1 << q; |
525 | if (qi->tqi_qflags & TXQ_FLAG_TXEOLINT_ENABLE) | 525 | if (qi->tqi_qflags & TXQ_FLAG_TXEOLINT_ENABLE) |
@@ -743,8 +743,7 @@ int ath9k_hw_beaconq_setup(struct ath_hw *ah) | |||
743 | qi.tqi_cwmax = 0; | 743 | qi.tqi_cwmax = 0; |
744 | 744 | ||
745 | if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) | 745 | if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) |
746 | qi.tqi_qflags = TXQ_FLAG_TXOKINT_ENABLE | | 746 | qi.tqi_qflags = TXQ_FLAG_TXINT_ENABLE; |
747 | TXQ_FLAG_TXERRINT_ENABLE; | ||
748 | 747 | ||
749 | return ath9k_hw_setuptxqueue(ah, ATH9K_TX_QUEUE_BEACON, &qi); | 748 | return ath9k_hw_setuptxqueue(ah, ATH9K_TX_QUEUE_BEACON, &qi); |
750 | } | 749 | } |
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h index 11dbd1473a1..6476d907320 100644 --- a/drivers/net/wireless/ath/ath9k/mac.h +++ b/drivers/net/wireless/ath/ath9k/mac.h | |||
@@ -583,8 +583,7 @@ enum ath9k_tx_queue { | |||
583 | #define ATH9K_WME_UPSD 4 | 583 | #define ATH9K_WME_UPSD 4 |
584 | 584 | ||
585 | enum ath9k_tx_queue_flags { | 585 | enum ath9k_tx_queue_flags { |
586 | TXQ_FLAG_TXOKINT_ENABLE = 0x0001, | 586 | TXQ_FLAG_TXINT_ENABLE = 0x0001, |
587 | TXQ_FLAG_TXERRINT_ENABLE = 0x0001, | ||
588 | TXQ_FLAG_TXDESCINT_ENABLE = 0x0002, | 587 | TXQ_FLAG_TXDESCINT_ENABLE = 0x0002, |
589 | TXQ_FLAG_TXEOLINT_ENABLE = 0x0004, | 588 | TXQ_FLAG_TXEOLINT_ENABLE = 0x0004, |
590 | TXQ_FLAG_TXURNINT_ENABLE = 0x0008, | 589 | TXQ_FLAG_TXURNINT_ENABLE = 0x0008, |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 5faec1e04d6..c6b93f61984 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1355,8 +1355,7 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype) | |||
1355 | * based intr on the EOSP frames. | 1355 | * based intr on the EOSP frames. |
1356 | */ | 1356 | */ |
1357 | if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { | 1357 | if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { |
1358 | qi.tqi_qflags = TXQ_FLAG_TXOKINT_ENABLE | | 1358 | qi.tqi_qflags = TXQ_FLAG_TXINT_ENABLE; |
1359 | TXQ_FLAG_TXERRINT_ENABLE; | ||
1360 | } else { | 1359 | } else { |
1361 | if (qtype == ATH9K_TX_QUEUE_UAPSD) | 1360 | if (qtype == ATH9K_TX_QUEUE_UAPSD) |
1362 | qi.tqi_qflags = TXQ_FLAG_TXDESCINT_ENABLE; | 1361 | qi.tqi_qflags = TXQ_FLAG_TXDESCINT_ENABLE; |