Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp846566rdh; Thu, 26 Oct 2023 18:46:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGV1X7OA30EFzvU1Z4hizjmGbswFu+d+iIiRfqJkG3qR3UMYYIHw3pK7eq7pLuPTRryC74f X-Received: by 2002:a9d:7499:0:b0:6b9:1917:b2f3 with SMTP id t25-20020a9d7499000000b006b91917b2f3mr1198039otk.33.1698371175448; Thu, 26 Oct 2023 18:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698371175; cv=none; d=google.com; s=arc-20160816; b=yrwdvVGFDYsbg397BPsE/hrQg58Fi9FH6fKeQEXz3JOkfA9u5Da8fv4ez6U7fgVhf7 WKKsEwtDPBHGq7njp3Kqf0rncXVpnOhqscFQbQZ8NqIKmUebPciRqwpiuCzL4h3hTj1o hhINrWeCZSHw5cQ4K8JsxV85Ui0S6YNIzBmkF1C8eIGX7JEXlGvid3Lb4WyJMkcUKjaO kI/5e7zn197uqYG2RzNNGyNty5dxc96/2UmJlcHjeFjTDRWBMQZpYR00DVG3f2iPYoOx L9MmDpW8bAsX+0WVWXhZkzEYX2dfUU/wu+zNCbpfc7EU8mlU126gXIry8M6p99g/E6Fa keuw== 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; bh=dNJu0HTbBKCNRrBcFf5CoisBOWRHfUbiqZxoCka8UsU=; fh=TSuyMlfOTyCx0zt3ucDyTttlN37QPvmvgk5pf20rBgY=; b=In25pzBozJsnrnCpKd7rgxvxZ25ycxV/5fHOmu1YyQrX5hqc28Ha4AwYrbn547UIsN +w9VXINYRLg/Y6Tcej/3ROSBSUUVuaIzn108exMMHIxJaFM5HBrajuuta99se/ywY8ua l/YSVptkj05SKuYC+TiCkGgU7nXtXtsXTE8jRTH3RtWPvlRVcn3AcgxV7EyxeITI2IiS BPqzlYwamw5hbIWcDeT0dJH3BhJiR2XJl6p2SD3BDNBTYYabm5vhjuM7T6K/dvs0Xr+w oBeLtozJ7GOAl0cFwP4gOUP9buo1H4DQcegGoN41fg3NuZVL8nRwnO3Y5lXa6vrpiMQs bAww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id i10-20020a816d0a000000b0059219587f24si827611ywc.388.2023.10.26.18.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 18:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 444BA82990DA; Thu, 26 Oct 2023 18:45:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345097AbjJ0Bp5 (ORCPT + 52 others); Thu, 26 Oct 2023 21:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345082AbjJ0Bp5 (ORCPT ); Thu, 26 Oct 2023 21:45:57 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4CA4111 for ; Thu, 26 Oct 2023 18:45:54 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 39R1jmKV33456432, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.93/5.92) with ESMTPS id 39R1jmKV33456432 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Oct 2023 09:45:48 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Fri, 27 Oct 2023 09:45:44 +0800 Received: from [127.0.1.1] (172.21.69.94) 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.2375.7; Fri, 27 Oct 2023 09:45:41 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 4/4] wifi: rtw89: extend PHY status parser to support WiFi 7 chips Date: Fri, 27 Oct 2023 09:45:06 +0800 Message-ID: <20231027014506.9570-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027014402.9448-1-pkshih@realtek.com> References: <20231027014402.9448-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.94] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 26 Oct 2023 18:45:58 -0700 (PDT) PHY status IEs is used to have more information about received packets, such as RSSI and EVM. For each PHY IE type, it has different predefined PHY IE length, and the length are changed, so add them for WiFi 7 chips accordingly. Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/core.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index ac99434c0e66..554191086336 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -1513,14 +1513,24 @@ static void rtw89_core_rx_process_phy_ppdu_iter(void *data, static u16 rtw89_core_get_phy_status_ie_len(struct rtw89_dev *rtwdev, const struct rtw89_phy_sts_iehdr *iehdr) { - static const u8 physts_ie_len_tab[32] = { - 16, 32, 24, 24, 8, 8, 8, 8, VAR_LEN, 8, VAR_LEN, 176, VAR_LEN, - VAR_LEN, VAR_LEN, VAR_LEN, VAR_LEN, VAR_LEN, 16, 24, VAR_LEN, - VAR_LEN, VAR_LEN, 0, 24, 24, 24, 24, 32, 32, 32, 32 + static const u8 physts_ie_len_tabs[RTW89_CHIP_GEN_NUM][32] = { + [RTW89_CHIP_AX] = { + 16, 32, 24, 24, 8, 8, 8, 8, VAR_LEN, 8, VAR_LEN, 176, VAR_LEN, + VAR_LEN, VAR_LEN, VAR_LEN, VAR_LEN, VAR_LEN, 16, 24, VAR_LEN, + VAR_LEN, VAR_LEN, 0, 24, 24, 24, 24, 32, 32, 32, 32 + }, + [RTW89_CHIP_BE] = { + 32, 40, 24, 24, 8, 8, 8, 8, VAR_LEN, 8, VAR_LEN, 176, VAR_LEN, + VAR_LEN, VAR_LEN, VAR_LEN, VAR_LEN, VAR_LEN, 16, 24, VAR_LEN, + VAR_LEN, VAR_LEN, 0, 24, 24, 24, 24, 32, 32, 32, 32 + }, }; + const u8 *physts_ie_len_tab; u16 ie_len; u8 ie; + physts_ie_len_tab = physts_ie_len_tabs[rtwdev->chip->chip_gen]; + ie = le32_get_bits(iehdr->w0, RTW89_PHY_STS_IEHDR_TYPE); if (physts_ie_len_tab[ie] != VAR_LEN) ie_len = physts_ie_len_tab[ie]; @@ -1607,6 +1617,9 @@ static int rtw89_core_rx_process_phy_ppdu(struct rtw89_dev *rtwdev, len_from_header = le32_get_bits(hdr->w0, RTW89_PHY_STS_HDR_W0_LEN) << 3; + if (rtwdev->chip->chip_gen == RTW89_CHIP_BE) + len_from_header += PHY_STS_HDR_LEN; + if (len_from_header != phy_ppdu->len) { rtw89_debug(rtwdev, RTW89_DBG_UNEXP, "phy ppdu len mismatch\n"); return -EINVAL; -- 2.25.1