aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-13 18:06:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-19 11:36:09 -0500
commit115dad7a7f42e68840392767323ceb9306dbdb36 (patch)
treee2ab014c925b9cfb0836aca470feac423755e553 /drivers/net/wireless/ath/ath9k
parentdf6ba5d80d6c9b51471d5fa046c3c06988e5f62a (diff)
ath9k_hw: partially revert "fix dma descriptor rx error bit parsing"
The rx error bit parsing was changed to consider PHY errors and various decryption errors separately. While correct according to the documentation, this is causing spurious decryption error reports in some situations. Fix this by restoring the original order of the checks in those places, where the errors are meant to be mutually exclusive. If a CRC error is reported, then MIC failure and decryption errors are irrelevant, and a PHY error is unlikely. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_mac.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c14
2 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index 4ceddbbdfcee..038a0cbfc6e7 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -615,7 +615,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
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 if (rxsp->status11 & AR_PHYErr) { 618 else 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,11 @@ 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 } 641 } else if (rxsp->status11 & AR_DecryptCRCErr)
642 if (rxsp->status11 & AR_DecryptCRCErr)
643 rxs->rs_status |= ATH9K_RXERR_DECRYPT; 642 rxs->rs_status |= ATH9K_RXERR_DECRYPT;
644 if (rxsp->status11 & AR_MichaelErr) 643 else if (rxsp->status11 & AR_MichaelErr)
645 rxs->rs_status |= ATH9K_RXERR_MIC; 644 rxs->rs_status |= ATH9K_RXERR_MIC;
645
646 if (rxsp->status11 & AR_KeyMiss) 646 if (rxsp->status11 & AR_KeyMiss)
647 rxs->rs_status |= ATH9K_RXERR_DECRYPT; 647 rxs->rs_status |= ATH9K_RXERR_DECRYPT;
648 } 648 }
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 180170d3ce25..c75d40fb86f1 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -690,17 +690,23 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
690 rs->rs_flags |= ATH9K_RX_DECRYPT_BUSY; 690 rs->rs_flags |= ATH9K_RX_DECRYPT_BUSY;
691 691
692 if ((ads.ds_rxstatus8 & AR_RxFrameOK) == 0) { 692 if ((ads.ds_rxstatus8 & AR_RxFrameOK) == 0) {
693 /*
694 * Treat these errors as mutually exclusive to avoid spurious
695 * extra error reports from the hardware. If a CRC error is
696 * reported, then decryption and MIC errors are irrelevant,
697 * the frame is going to be dropped either way
698 */
693 if (ads.ds_rxstatus8 & AR_CRCErr) 699 if (ads.ds_rxstatus8 & AR_CRCErr)
694 rs->rs_status |= ATH9K_RXERR_CRC; 700 rs->rs_status |= ATH9K_RXERR_CRC;
695 if (ads.ds_rxstatus8 & AR_PHYErr) { 701 else if (ads.ds_rxstatus8 & AR_PHYErr) {
696 rs->rs_status |= ATH9K_RXERR_PHY; 702 rs->rs_status |= ATH9K_RXERR_PHY;
697 phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode); 703 phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode);
698 rs->rs_phyerr = phyerr; 704 rs->rs_phyerr = phyerr;
699 } 705 } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
700 if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
701 rs->rs_status |= ATH9K_RXERR_DECRYPT; 706 rs->rs_status |= ATH9K_RXERR_DECRYPT;
702 if (ads.ds_rxstatus8 & AR_MichaelErr) 707 else if (ads.ds_rxstatus8 & AR_MichaelErr)
703 rs->rs_status |= ATH9K_RXERR_MIC; 708 rs->rs_status |= ATH9K_RXERR_MIC;
709
704 if (ads.ds_rxstatus8 & AR_KeyMiss) 710 if (ads.ds_rxstatus8 & AR_KeyMiss)
705 rs->rs_status |= ATH9K_RXERR_DECRYPT; 711 rs->rs_status |= ATH9K_RXERR_DECRYPT;
706 } 712 }