]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ath9k_hw: fix dma descriptor rx error bit parsing
authorFelix Fietkau <nbd@openwrt.org>
Tue, 28 Dec 2010 14:46:16 +0000 (15:46 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 Jan 2011 19:43:01 +0000 (14:43 -0500)
An Rx DMA descriptor can have multiple error bits set, and some error
bits (e.g. MIC failure) are filtered by the driver based on other criteria.
Remove the 'else' in various error bit checks so that all error information
is properly passed to the driver.

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

index b6e4ee48ef78e2ff539c8f8269352d35ad5818d2..4ceddbbdfcee6d0b24917e6c9bd82e46032dca84 100644 (file)
@@ -613,9 +613,9 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
                 * possibly be reviewing the last subframe. AR_CRCErr
                 * is the CRC of the actual data.
                 */
-               if (rxsp->status11 & AR_CRCErr) {
+               if (rxsp->status11 & AR_CRCErr)
                        rxs->rs_status |= ATH9K_RXERR_CRC;
-               } else if (rxsp->status11 & AR_PHYErr) {
+               if (rxsp->status11 & AR_PHYErr) {
                        phyerr = MS(rxsp->status11, AR_PHYErrCode);
                        /*
                         * If we reach a point here where AR_PostDelimCRCErr is
@@ -638,11 +638,12 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
                                rxs->rs_phyerr = phyerr;
                        }
 
-               } else if (rxsp->status11 & AR_DecryptCRCErr) {
+               }
+               if (rxsp->status11 & AR_DecryptCRCErr)
                        rxs->rs_status |= ATH9K_RXERR_DECRYPT;
-               } else if (rxsp->status11 & AR_MichaelErr) {
+               if (rxsp->status11 & AR_MichaelErr)
                        rxs->rs_status |= ATH9K_RXERR_MIC;
-               } else if (rxsp->status11 & AR_KeyMiss)
+               if (rxsp->status11 & AR_KeyMiss)
                        rxs->rs_status |= ATH9K_RXERR_DECRYPT;
        }
 
index e3d2ebf00e2ed58b1c67540bdb28023f4c25958f..180170d3ce25511e40f3e252aa7c5223d664920e 100644 (file)
@@ -692,15 +692,16 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
        if ((ads.ds_rxstatus8 & AR_RxFrameOK) == 0) {
                if (ads.ds_rxstatus8 & AR_CRCErr)
                        rs->rs_status |= ATH9K_RXERR_CRC;
-               else if (ads.ds_rxstatus8 & AR_PHYErr) {
+               if (ads.ds_rxstatus8 & AR_PHYErr) {
                        rs->rs_status |= ATH9K_RXERR_PHY;
                        phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode);
                        rs->rs_phyerr = phyerr;
-               } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
+               }
+               if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
                        rs->rs_status |= ATH9K_RXERR_DECRYPT;
-               else if (ads.ds_rxstatus8 & AR_MichaelErr)
+               if (ads.ds_rxstatus8 & AR_MichaelErr)
                        rs->rs_status |= ATH9K_RXERR_MIC;
-               else if (ads.ds_rxstatus8 & AR_KeyMiss)
+               if (ads.ds_rxstatus8 & AR_KeyMiss)
                        rs->rs_status |= ATH9K_RXERR_DECRYPT;
        }