From patchwork Wed Jun 22 08:30:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: MeiChia Chiu X-Patchwork-Id: 12890299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2AF36CCA47E for ; Wed, 22 Jun 2022 08:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=8N4tYoFo2D2PQf3r99KzRzwoLejFHdbj5YlWXRCYlVY=; b=HrSA1N0jrRmMG+lqWVDNFyDV25 YodocLqYpVKdF3NJ9QV50irHJSVjZQejFHtfY6ZtRfJE5Megcbly4Ewo+/3ASoCquMzVaHpzmmQSv ogrAcL67fftobIRoC7k1xSkP0vvX2PN+tdBKTsfgVi55cBIy9o2AydR5nyk9G/RcoZO3nAh1QOHcV qMeYGy6D9vkfaueXsBVoSLh3/WcbkMUNN66BVlf4+CDQsumMhuqvifFu/8tN/hxI4H0lrOkCfZGpl WZvC4PA8ItlicwuQ5EKeBjWZ45prBvaG5GQAmStGu9uwufcp4nPnK5t9Q9j9RHEVmt9VRSFZnwIBl 6N0Aiybw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3vlz-009G9f-H1; Wed, 22 Jun 2022 08:31:39 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3vlv-009G88-RG for linux-mediatek@lists.infradead.org; Wed, 22 Jun 2022 08:31:38 +0000 X-UUID: 4263e5cc68d34b21b5db6db2d1244bbc-20220622 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.6,REQID:1effbef1-1b61-48dc-ad55-3b5a0f25b178,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-META: VersionHash:b14ad71,CLOUDID:8eef33ea-f7af-4e69-92ee-0fd74a0c286c,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: 4263e5cc68d34b21b5db6db2d1244bbc-20220622 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 541931223; Wed, 22 Jun 2022 01:31:26 -0700 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Jun 2022 01:30:37 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Jun 2022 16:30:36 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.3 via Frontend Transport; Wed, 22 Jun 2022 16:30:36 +0800 From: MeiChia Chiu To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , Ryder Lee , , , MeiChia Chiu Subject: [PATCH] mt76: do not check the ccmp pn for ONLY_MONITOR frame Date: Wed, 22 Jun 2022 16:30:34 +0800 Message-ID: <20220622083034.22472-1-MeiChia.Chiu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_013135_924267_B3E4ABE3 X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org if the received frame enables RX_FLAG_ONLY_MONITOR, driver doesn't need to check the ccmp pn of this frame. Reviewed-by: Ryder Lee Signed-off-by: MeiChia Chiu --- drivers/net/wireless/mediatek/mt76/mac80211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 60da9995357e..ecf5bd9605db 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -1030,6 +1030,9 @@ mt76_check_ccmp_pn(struct sk_buff *skb) if (!(status->flag & RX_FLAG_DECRYPTED)) return 0; + if (status->flag & RX_FLAG_ONLY_MONITOR) + return 0; + if (!wcid || !wcid->rx_check_pn) return 0;