summaryrefslogtreecommitdiff
path: root/package/mac80211/patches/550-ath9k_decrypt_error_fix.patch
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-01-13 23:07:58 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-01-13 23:07:58 +0000
commit1480761fe11ef8decc4edef3a97e2313937412da (patch)
tree465123f14cf14432a450a91f5def3020f2e12c07 /package/mac80211/patches/550-ath9k_decrypt_error_fix.patch
parent5dceefad48811fa6313f7f01eb55508570d612de (diff)
ath9k: fix spurious decryption crc error regression
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24976 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/patches/550-ath9k_decrypt_error_fix.patch')
-rw-r--r--package/mac80211/patches/550-ath9k_decrypt_error_fix.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/package/mac80211/patches/550-ath9k_decrypt_error_fix.patch b/package/mac80211/patches/550-ath9k_decrypt_error_fix.patch
new file mode 100644
index 0000000000..795018c57a
--- /dev/null
+++ b/package/mac80211/patches/550-ath9k_decrypt_error_fix.patch
@@ -0,0 +1,56 @@
+--- 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
+ */
+ if (rxsp->status11 & AR_CRCErr)
+ rxs->rs_status |= ATH9K_RXERR_CRC;
+- if (rxsp->status11 & AR_PHYErr) {
++ else if (rxsp->status11 & AR_PHYErr) {
+ phyerr = MS(rxsp->status11, AR_PHYErrCode);
+ /*
+ * If we reach a point here where AR_PostDelimCRCErr is
+@@ -638,11 +638,11 @@ int ath9k_hw_process_rxdesc_edma(struct
+ rxs->rs_phyerr = phyerr;
+ }
+
+- }
+- if (rxsp->status11 & AR_DecryptCRCErr)
++ } else if (rxsp->status11 & AR_DecryptCRCErr)
+ rxs->rs_status |= ATH9K_RXERR_DECRYPT;
+- if (rxsp->status11 & AR_MichaelErr)
++ else if (rxsp->status11 & AR_MichaelErr)
+ rxs->rs_status |= ATH9K_RXERR_MIC;
++
+ if (rxsp->status11 & AR_KeyMiss)
+ rxs->rs_status |= ATH9K_RXERR_DECRYPT;
+ }
+--- 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 *a
+ rs->rs_flags |= ATH9K_RX_DECRYPT_BUSY;
+
+ if ((ads.ds_rxstatus8 & AR_RxFrameOK) == 0) {
++ /*
++ * Treat these errors as mutually exclusive to avoid spurious
++ * extra error reports from the hardware. If a CRC error is
++ * reported, then decryption and MIC errors are irrelevant,
++ * the frame is going to be dropped either way
++ */
+ if (ads.ds_rxstatus8 & AR_CRCErr)
+ rs->rs_status |= ATH9K_RXERR_CRC;
+- if (ads.ds_rxstatus8 & AR_PHYErr) {
++ else if (ads.ds_rxstatus8 & AR_PHYErr) {
+ rs->rs_status |= ATH9K_RXERR_PHY;
+ phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode);
+ rs->rs_phyerr = phyerr;
+- }
+- if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
++ } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
+ rs->rs_status |= ATH9K_RXERR_DECRYPT;
+- if (ads.ds_rxstatus8 & AR_MichaelErr)
++ else if (ads.ds_rxstatus8 & AR_MichaelErr)
+ rs->rs_status |= ATH9K_RXERR_MIC;
++
+ if (ads.ds_rxstatus8 & AR_KeyMiss)
+ rs->rs_status |= ATH9K_RXERR_DECRYPT;
+ }