linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <linux@rempel-privat.de>
To: ath9k-devel@lists.ath9k.org, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org
Cc: Oleksij Rempel <linux@rempel-privat.de>
Subject: [PATCH v2 08/13] ath9k_htc: use ath9k_cmn_rx_accept
Date: Tue,  4 Feb 2014 10:27:45 +0100	[thread overview]
Message-ID: <1391506070-8636-9-git-send-email-linux@rempel-privat.de> (raw)
In-Reply-To: <1391506070-8636-1-git-send-email-linux@rempel-privat.de>

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 45 +++++----------------------
 1 file changed, 8 insertions(+), 37 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 6bd7ef8..8aba265 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -974,6 +974,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
 	struct ath_htc_rx_status *rxstatus;
 	struct ath_rx_status rx_stats;
 	int hdrlen, padsize;
+	bool decrypt_error;
 	__le16 fc;
 
 	if (skb->len < HTC_RX_FRAME_HEADER_SIZE) {
@@ -1012,43 +1013,13 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
 
 	rx_status_htc_to_ath(&rx_stats, &rxbuf->rxstatus);
 
-	if (rxbuf->rxstatus.rs_status != 0) {
-		if (rxbuf->rxstatus.rs_status & ATH9K_RXERR_CRC)
-			rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
-		if (rxbuf->rxstatus.rs_status & ATH9K_RXERR_PHY)
-			goto rx_next;
-
-		if (rxbuf->rxstatus.rs_status & ATH9K_RXERR_DECRYPT) {
-			/* FIXME */
-		} else if (rxbuf->rxstatus.rs_status & ATH9K_RXERR_MIC) {
-			if (ieee80211_is_ctl(fc))
-				/*
-				 * Sometimes, we get invalid
-				 * MIC failures on valid control frames.
-				 * Remove these mic errors.
-				 */
-				rxbuf->rxstatus.rs_status &= ~ATH9K_RXERR_MIC;
-			else
-				rx_status->flag |= RX_FLAG_MMIC_ERROR;
-		}
-
-		/*
-		 * Reject error frames with the exception of
-		 * decryption and MIC failures. For monitor mode,
-		 * we also ignore the CRC error.
-		 */
-		if (priv->ah->opmode == NL80211_IFTYPE_MONITOR) {
-			if (rxbuf->rxstatus.rs_status &
-			    ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
-			      ATH9K_RXERR_CRC))
-				goto rx_next;
-		} else {
-			if (rxbuf->rxstatus.rs_status &
-			    ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC)) {
-				goto rx_next;
-			}
-		}
-	}
+	/*
+	 * everything but the rate is checked here, the rate check is done
+	 * separately to avoid doing two lookups for a rate for each frame.
+	 */
+	if (!ath9k_cmn_rx_accept(common, hdr, rx_status, &rx_stats,
+			&decrypt_error, priv->rxfilter))
+		goto rx_next;
 
 	if (!(rxbuf->rxstatus.rs_status & ATH9K_RXERR_DECRYPT)) {
 		u8 keyix;
-- 
1.9.rc1


  parent reply	other threads:[~2014-02-04  9:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04  9:27 [PATCH v2 00/13] eliminate some ath9k_htc code Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 01/13] ath: add last_rssi to ath_common Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 02/13] ath9k: move ath9k_process_rssi to common.c Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 03/13] ath9k: move ath9k_process_rate " Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 04/13] ath9k: move ath9k_rx_accept " Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 05/13] ath9k_htc: add rx header converter to make it usable by ath9k Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 06/13] ath9k_htc: use ath9k_cmn_process_rssi Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 07/13] ath9k_htc: use ath9k_cmn_process_rate Oleksij Rempel
2014-02-04  9:27 ` Oleksij Rempel [this message]
2014-02-04  9:27 ` [PATCH v2 09/13] ath9k_htc: sync rx_status-> related code with ath9k Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 10/13] ath9k: move ath9k_rx_skb_postprocess to common.c Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 11/13] ath9k_htc: use ath9k_cmn_rx_skb_postprocess Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 12/13] ath9k_htc: remove useless memcpy Oleksij Rempel
2014-02-04  9:27 ` [PATCH v2 13/13] ath9k_htc: catch fw panic pattern Oleksij Rempel
2014-02-11  7:57 ` [PATCH v2 00/13] eliminate some ath9k_htc code Oleksij Rempel
2014-02-12 15:15   ` [ath9k-devel] " Sujith Manoharan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391506070-8636-9-git-send-email-linux@rempel-privat.de \
    --to=linux@rempel-privat.de \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).