Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp594189pxb; Thu, 15 Apr 2021 01:48:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMsbw5jGAPm5Erna+PkXoOpiAw6LEP9sNhu5y16hOnfp1NZyMzsFVBu5atdJygq6uEkdBs X-Received: by 2002:a50:e607:: with SMTP id y7mr2886747edm.18.1618476495991; Thu, 15 Apr 2021 01:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618476495; cv=none; d=google.com; s=arc-20160816; b=Fuz6PaKRH5PSX54hronA5Angb+d6o2PQ+PWbTDXZbkq02xoXmHx7byIQ5uAq4YE8j1 neaI2IiDyeekxGOiMysAEYrt45kSt+/yBdPpDMFL9iFWo9RB44DCDITKEegF1ket2OIV aR0niC4Lbc3Q6xyLR3VHgQGkew41V6s+cq4RB4gA6ZhFNA0doCFSQ8Xvt4GhjWtUoCG0 V04zwn5BsvxEnMfmeGDXNqj3kgpeTOCdcS9m++KeI/AVohsiG0rbpXUEG8Wwc+aRdwS4 8GliZcIzBrglLWNc5KSWnKvLXpJtm4X+C9OGy6okHnyT2hE/oPP6Wls6Ele2wYA7ojpT YTLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :authenticated-by; bh=BetZ9d2RwXuSmID3+9C+cinK1y+bc0uDKDVs2pdvW/Y=; b=kg0teDPVsIMu5XHyg1OYK+uOJLRcn0zMbaLhtkguWmI9wnYIpsNRWWXJkMNjyT3Nxd z2HkUAwXYc0d6aecowvUDZZq3cBfoesEMivEgzeoUtIlxeRV4kLsqwM7Ec6Jl/hQM2cT W6pTcAZTpPTdTzxKQN6MiQS8WJOIUuhgo6k2hgFlh8rMJajD1sHBEWSnTd2GBg8GSxwg Vgd8/qG32bqIu5FPCNnhFHJCndqTj7NZARQkgI4u8/xfUejojDn4kAoOXiIi3uUNTaTB YevRcNe/mUBDZBRVTArMbLCys3RSCu2neGTkQZjmQjlgZAoOI7UufPC8PtNt9MuuzmZm 9QnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x22si1555674ejs.326.2021.04.15.01.47.52; Thu, 15 Apr 2021 01:48:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231678AbhDOIrv (ORCPT + 99 others); Thu, 15 Apr 2021 04:47:51 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:52862 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231534AbhDOIru (ORCPT ); Thu, 15 Apr 2021 04:47:50 -0400 Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.73 with qID 13F8lKkaD022671, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36502.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.71/5.88) with ESMTPS id 13F8lKkaD022671 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 15 Apr 2021 16:47:20 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36502.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 15 Apr 2021 16:47:20 +0800 Received: from localhost (172.21.69.146) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 15 Apr 2021 16:47:19 +0800 From: Ping-Ke Shih To: , CC: , , , , Subject: [PATCH 1/3] rtw88: 8821c: Don't set RX_FLAG_DECRYPTED if packet has no encryption Date: Thu, 15 Apr 2021 16:47:01 +0800 Message-ID: <20210415084703.27255-2-pkshih@realtek.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210415084703.27255-1-pkshih@realtek.com> References: <20210415084703.27255-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.146] X-ClientProxiedBy: RTEXMBS03.realtek.com.tw (172.21.6.96) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: =?big5?B?Q2xlYW4sIGJhc2VzOiAyMDIxLzQvMTUgpFekyCAwNjowMDowMA==?= X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-KSE-AntiSpam-Outbound-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 04/15/2021 08:05:31 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 10 X-KSE-AntiSpam-Info: Lua profiles 163124 [Apr 15 2021] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: pkshih@realtek.com X-KSE-AntiSpam-Info: LuaCore: 442 442 b985cb57763b61d2a20abb585d5d4cc10c315b09 X-KSE-AntiSpam-Info: {Prob_from_in_msgid} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: realtek.com:7.1.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: {Track_Chinese_Simplified, headers_charset} X-KSE-AntiSpam-Info: Rate: 10 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 04/15/2021 08:07:00 X-KSE-ServerInfo: RTEXH36502.realtek.com.tw, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: =?big5?B?Q2xlYW4sIGJhc2VzOiAyMDIxLzQvMTUgpFekyCAwNzoxMDowMA==?= X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-KSE-AntiSpam-Outbound-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 04/15/2021 08:09:32 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 10 X-KSE-AntiSpam-Info: Lua profiles 163124 [Apr 15 2021] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: pkshih@realtek.com X-KSE-AntiSpam-Info: LuaCore: 442 442 b985cb57763b61d2a20abb585d5d4cc10c315b09 X-KSE-AntiSpam-Info: {Prob_from_in_msgid} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;realtek.com:7.1.1 X-KSE-AntiSpam-Info: {Track_Chinese_Simplified, headers_charset} X-KSE-AntiSpam-Info: Rate: 10 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 04/15/2021 08:12:00 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Guo-Feng Fan The value of GET_RX_DESC_SWDEC() indicates that if this RX packet requires software decryption or not. And software decryption is required when the packet was encrypted and the hardware failed to decrypt it. So, GET_RX_DESC_SWDEC() is negative does not mean that this packet is decrypted, it might just have no encryption at all. To actually see if the packet is decrypted, driver needs to further check if the hardware has successfully decrypted it, with a specific type of encryption algorithm. Signed-off-by: Guo-Feng Fan Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw88/rtw8821c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c index 33c6cf1206c8..785b8181513f 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -581,7 +581,8 @@ static void rtw8821c_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc, pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc); pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc); pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc); - pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc); + pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) && + GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE; pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc); pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc); pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc); -- 2.21.0