From patchwork Mon Nov 24 14:34:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5367851 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3275DC11AC for ; Mon, 24 Nov 2014 14:48:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 462F1203B6 for ; Mon, 24 Nov 2014 14:48:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B89A2034C for ; Mon, 24 Nov 2014 14:48:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xsuvt-0007k8-2d; Mon, 24 Nov 2014 14:48:05 +0000 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XsuuW-0006Ql-V3 for ath10k@lists.infradead.org; Mon, 24 Nov 2014 14:46:41 +0000 Received: by mail-wi0-f176.google.com with SMTP id ex7so5904462wid.9 for ; Mon, 24 Nov 2014 06:46:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=RA7TaziKUrIc97K8NAejbi2cJZnCdBi320SmBWbWSjM=; b=Q1vV75/hZ0eSRSFs99bw7/HeDLH8lNpq0GuV1w7eSKnkjkAwz3/cdbsrM2v1Z4XgoU pxsfYBa3Aw1fG7dBO9Myhl+zMiZsY3zbcYRTOmwK9CySq8icBMWXBQVpOjqWy4rzqfoY MrPYNuRqTdL4wu8AslyMYIhoCRR4Xy22bT+0A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RA7TaziKUrIc97K8NAejbi2cJZnCdBi320SmBWbWSjM=; b=bBrpnSSL+IsRJFaYCGViWMBqWYXSI2MurylJ/v71zINyQ4qRKazh34PGfTN6Ty16cX i+GoJ6Y0FKoxWLNdqVAKcUsJFmdqqNERsAXwUEEa/M0qGN5n1f4CBOcEq/9/rlbVhuLc m41IePfBxxStkTukEsL34TIQzYPumv+3yGYg3W8adnE7an+xXjroAH4z7Ju8+mTzsMQi TAbIhBWoOAT1QyixTnlZgHER14TywZDTXJBeb/xSmTTVKYsez50w6MRa0QxBUUKMoAxa d0wNiki12tS7pDUXDTHrwFLRnl4H4aQJ14t2yxMl/TOemJjwpAkf0nATobnxzNmyL4uK KJTQ== X-Gm-Message-State: ALoCoQksSvBQ7H5jwmZXepSbSmdBxkY+EdgT1Hev3FbQbdIRmGkqOwzG5TZpydNS0Xqd39Mnvx2T9WX7Dt5a2I75uxuBc4NUTRMHqkzb9/KBheNKsvEv1MyzHjFL7rQQrKj3sgZjKV890lDrvWzob7L6RgRkOhw5oqu2x/BbCc5ehlzw9pBinMU= X-Received: by 10.180.108.43 with SMTP id hh11mr21972832wib.80.1416840378432; Mon, 24 Nov 2014 06:46:18 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id pu3sm21326932wjc.14.2014.11.24.06.46.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Nov 2014 06:46:17 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: don't drop corrupted mgmt frames Date: Mon, 24 Nov 2014 15:34:08 +0100 Message-Id: <1416839648-31803-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141124_064641_220038_8945F67C X-CRM114-Status: GOOD ( 11.14 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some firmware revisions don't seem to deilver management frames with FCS error via WMI so narrow down the HTT rule to not drop corrupted management frames. This basically increases number of frames ath10k reports while sniffing. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/htt_rx.c | 13 +++++++++++-- drivers/net/wireless/ath/ath10k/wmi.c | 7 +++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 75b2293..85910b2 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -1381,6 +1381,8 @@ static bool ath10k_htt_rx_amsdu_allowed(struct ath10k *ar, { struct sk_buff *msdu; struct htt_rx_desc *rxd; + bool is_mgmt; + bool has_fcs_err; msdu = skb_peek(amsdu); rxd = (void *)msdu->data - sizeof(*rxd); @@ -1394,12 +1396,19 @@ static bool ath10k_htt_rx_amsdu_allowed(struct ath10k *ar, return false; } + is_mgmt = !!(rxd->attention.flags & + __cpu_to_le32(RX_ATTENTION_FLAGS_MGMT_TYPE)); + has_fcs_err = !!(rxd->attention.flags & + __cpu_to_le32(RX_ATTENTION_FLAGS_FCS_ERR)); + /* Management frames are handled via WMI events. The pros of such * approach is that channel is explicitly provided in WMI events * whereas HTT doesn't provide channel information for Rxed frames. + * + * However some firmware revisions don't report corrupted frames via + * WMI so don't drop them. */ - if (rxd->attention.flags & - __cpu_to_le32(RX_ATTENTION_FLAGS_MGMT_TYPE)) { + if (is_mgmt && !has_fcs_err) { ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx mgmt ctrl\n"); return false; } diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index c2bc828..df948a4 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1166,8 +1166,11 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) return 0; } - if (rx_status & WMI_RX_STATUS_ERR_CRC) - status->flag |= RX_FLAG_FAILED_FCS_CRC; + if (rx_status & WMI_RX_STATUS_ERR_CRC) { + dev_kfree_skb(skb); + return 0; + } + if (rx_status & WMI_RX_STATUS_ERR_MIC) status->flag |= RX_FLAG_MMIC_ERROR;