Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c30cc19 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville
Browse files

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: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1e1f4ad2
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -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
		 * possibly be reviewing the last subframe. AR_CRCErr
		 * is the CRC of the actual data.
		 * is the CRC of the actual data.
		 */
		 */
		if (rxsp->status11 & AR_CRCErr) {
		if (rxsp->status11 & AR_CRCErr)
			rxs->rs_status |= ATH9K_RXERR_CRC;
			rxs->rs_status |= ATH9K_RXERR_CRC;
		} else if (rxsp->status11 & AR_PHYErr) {
		if (rxsp->status11 & AR_PHYErr) {
			phyerr = MS(rxsp->status11, AR_PHYErrCode);
			phyerr = MS(rxsp->status11, AR_PHYErrCode);
			/*
			/*
			 * If we reach a point here where AR_PostDelimCRCErr is
			 * 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;
				rxs->rs_phyerr = phyerr;
			}
			}


		} else if (rxsp->status11 & AR_DecryptCRCErr) {
		}
		if (rxsp->status11 & AR_DecryptCRCErr)
			rxs->rs_status |= ATH9K_RXERR_DECRYPT;
			rxs->rs_status |= ATH9K_RXERR_DECRYPT;
		} else if (rxsp->status11 & AR_MichaelErr) {
		if (rxsp->status11 & AR_MichaelErr)
			rxs->rs_status |= ATH9K_RXERR_MIC;
			rxs->rs_status |= ATH9K_RXERR_MIC;
		} else if (rxsp->status11 & AR_KeyMiss)
		if (rxsp->status11 & AR_KeyMiss)
			rxs->rs_status |= ATH9K_RXERR_DECRYPT;
			rxs->rs_status |= ATH9K_RXERR_DECRYPT;
	}
	}


+5 −4
Original line number Original line Diff line number Diff line
@@ -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_RxFrameOK) == 0) {
		if (ads.ds_rxstatus8 & AR_CRCErr)
		if (ads.ds_rxstatus8 & AR_CRCErr)
			rs->rs_status |= ATH9K_RXERR_CRC;
			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;
			rs->rs_status |= ATH9K_RXERR_PHY;
			phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode);
			phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode);
			rs->rs_phyerr = phyerr;
			rs->rs_phyerr = phyerr;
		} else if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
		}
		if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
			rs->rs_status |= ATH9K_RXERR_DECRYPT;
			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;
			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;
			rs->rs_status |= ATH9K_RXERR_DECRYPT;
	}
	}