aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-12-28 09:46:16 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-04 14:43:01 -0500
commit1c30cc19081c16b1fe73ac13f2cb2abc009cdcc4 (patch)
treeaf987d6d649b6dc221e098147b81b8d0523916de
parent1e1f4ad25fab29ca48b1166e74a81e9c89ddf0fb (diff)
ath9k_hw: fix dma descriptor rx error bit parsing
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>
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_mac.c11
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c9
2 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index b6e4ee48ef78..4ceddbbdfcee 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -613,9 +613,9 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
613 * possibly be reviewing the last subframe. AR_CRCErr 613 * possibly be reviewing the last subframe. AR_CRCErr
614 * is the CRC of the actual data. 614 * is the CRC of the actual data.
615 */ 615 */
616 if (rxsp->status11 & AR_CRCErr) { 616 if (rxsp->status11 & AR_CRCErr)
617 rxs->rs_status |= ATH9K_RXERR_CRC; 617 rxs->rs_status |= ATH9K_RXERR_CRC;
618 } else if (rxsp->status11 & AR_PHYErr) { 618 if (rxsp->status11 & AR_PHYErr) {
619 phyerr = MS(rxsp->status11, AR_PHYErrCode); 619 phyerr = MS(rxsp->status11, AR_PHYErrCode);
620 /* 620 /*
621 * If we reach a point here where AR_PostDelimCRCErr is 621 * 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,
638 rxs->rs_phyerr = phyerr; 638 rxs->rs_phyerr = phyerr;
639 } 639 }
640 640
641 } else if (rxsp->status11 & AR_DecryptCRCErr) { 641 }
642 if (rxsp->status11 & AR_DecryptCRCErr)
642 rxs->rs_status |= ATH9K_RXERR_DECRYPT; 643 rxs->rs_status |= ATH9K_RXERR_DECRYPT;
643 } else if (rxsp->status11 & AR_MichaelErr) { 644 if (rxsp->status11 & AR_MichaelErr)
644 rxs->rs_status |= ATH9K_RXERR_MIC; 645 rxs->rs_status |= ATH9K_RXERR_MIC;
645 } else if (rxsp->status11 & AR_KeyMiss) 646 if (rxsp->status11 & AR_KeyMiss)
646 rxs->rs_status |= ATH9K_RXERR_DECRYPT; 647 rxs->rs_status |= ATH9K_RXERR_DECRYPT;
647 } 648 }
648 649
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index e3d2ebf00e2e..180170d3ce25 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -692,15 +692,16 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
692 if ((ads.ds_rxstatus8 & AR_RxFrameOK) == 0) { 692 if ((ads.ds_rxstatus8 & AR_RxFrameOK) == 0) {
693 if (ads.ds_rxstatus8 & AR_CRCErr) 693 if (ads.ds_rxstatus8 & AR_CRCErr)
694 rs->rs_status |= ATH9K_RXERR_CRC; 694 rs->rs_status |= ATH9K_RXERR_CRC;
695 else if (ads.ds_rxstatus8 & AR_PHYErr) { 695 if (ads.ds_rxstatus8 & AR_PHYErr) {
696 rs->rs_status |= ATH9K_RXERR_PHY; 696 rs->rs_status |= ATH9K_RXERR_PHY;
697 phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode); 697 phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode);
698 rs->rs_phyerr = phyerr; 698 rs->rs_phyerr = phyerr;
699 } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr) 699 }
700 if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
700 rs->rs_status |= ATH9K_RXERR_DECRYPT; 701 rs->rs_status |= ATH9K_RXERR_DECRYPT;
701 else if (ads.ds_rxstatus8 & AR_MichaelErr) 702 if (ads.ds_rxstatus8 & AR_MichaelErr)
702 rs->rs_status |= ATH9K_RXERR_MIC; 703 rs->rs_status |= ATH9K_RXERR_MIC;
703 else if (ads.ds_rxstatus8 & AR_KeyMiss) 704 if (ads.ds_rxstatus8 & AR_KeyMiss)
704 rs->rs_status |= ATH9K_RXERR_DECRYPT; 705 rs->rs_status |= ATH9K_RXERR_DECRYPT;
705 } 706 }
706 707