]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ath9k_hw: fix potential spurious tx error bit interpretation
authorFelix Fietkau <nbd@openwrt.org>
Thu, 21 Oct 2010 00:47:23 +0000 (02:47 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 15 Nov 2010 18:24:19 +0000 (13:24 -0500)
According to documentation, AR_ExcessiveRetries, AR_Filtered and
AR_FIFOUnderrun are only valid if AR_FrmXmitOK is clear.

Not checking this might result in suboptimal FIFO settings, unnecessary
retransmissions, or other connectivity issues.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ar9002_mac.c

index 3b4c52c9181c15958358f2097ac9396c2cec7dd9..f0268e5eab3406831b88640bb37480c7b78de1b6 100644 (file)
@@ -237,13 +237,15 @@ static int ar9002_hw_proc_txdesc(struct ath_hw *ah, void *ds,
        status = ACCESS_ONCE(ads->ds_txstatus1);
        if (status & AR_FrmXmitOK)
                ts->ts_status |= ATH9K_TX_ACKED;
-       if (status & AR_ExcessiveRetries)
-               ts->ts_status |= ATH9K_TXERR_XRETRY;
-       if (status & AR_Filtered)
-               ts->ts_status |= ATH9K_TXERR_FILT;
-       if (status & AR_FIFOUnderrun) {
-               ts->ts_status |= ATH9K_TXERR_FIFO;
-               ath9k_hw_updatetxtriglevel(ah, true);
+       else {
+               if (status & AR_ExcessiveRetries)
+                       ts->ts_status |= ATH9K_TXERR_XRETRY;
+               if (status & AR_Filtered)
+                       ts->ts_status |= ATH9K_TXERR_FILT;
+               if (status & AR_FIFOUnderrun) {
+                       ts->ts_status |= ATH9K_TXERR_FIFO;
+                       ath9k_hw_updatetxtriglevel(ah, true);
+               }
        }
        if (status & AR_TxTimerExpired)
                ts->ts_status |= ATH9K_TXERR_TIMER_EXPIRED;