Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp372702rdb; Fri, 6 Oct 2023 06:14:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrw0XgwLDO4PcVya5hTFG7WmWBjLowVs9K8PNB34T9+Ldi45AlE9CIqBHTldqkpRS6ll3t X-Received: by 2002:a17:902:c3d5:b0:1c3:dafa:b1e9 with SMTP id j21-20020a170902c3d500b001c3dafab1e9mr8050753plj.10.1696598054871; Fri, 06 Oct 2023 06:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696598054; cv=none; d=google.com; s=arc-20160816; b=veYmk68XDmA/g+Gtr8zwIRakUahImnJhAlFLDU0mMIlbU3Gy7VQwuRIaZr/pUxBwY9 NEJ6g2NUtxsDpxyFhV/7ru3VxHvzIJh+MWERkeZSdAQqTn6tGqoXC3qlvvDb+7OKReQK 7AGBycc6AV+vAeOoOcRaW7UNxyqax9e++G029/ULgzOUIZXM5GRmPINbe5iOzkXq+WWY s5QSVrQ7zrPxy54CKoO0dsYRxhO4aEhq5vmD28O4NmQ1L3EjCGBe8NvNBkFn0+K1+IAh Fd13Mna7wwU0qeOhcq1ymHoUnY/K4r4kvC30dyy6Xmx9tm7fAG9R9Q1LgJ6UljnwzQQQ vgiQ== 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=ynLHQxJwsRr5u/t8TQ7P4d8S1vKqowbrgKZHP9rYThY=; fh=HazNXdIX0AV/SunPhS44scAMfyv5oAksttxwN9EpOFc=; b=FnJVjAay3ur/U3IjAkdmbfc9OvZe1+oP1gQ62+fBIMQ2ex9EuyC4M7myO3G2ZCJqc5 7fLhOh126lieoUOwujaCPcWFXI6fyU4zGuSUb1DHoDgOX+Imhf0c2jkCls682OCevo6K hl82MoUtrR206E7ox/OMSPE2ovPRZglgqIH4k8hoR5sgDNbcPX5zXa6CtTOS7ePN+0X1 Sla8CCmXXq7J01KBZ48nNp9RFZLtuv2z5RCqDtzUp5ptyvyUhd03UCxkOZwcwTHv9M3V jlcMZIED650r1totZZ6HqNsHKAnlwh2Xfqh1mTsHXAZFXWkOKs7PolFIMvfakSR8hDiH I0ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id iw11-20020a170903044b00b001c611f285a6si3450283plb.452.2023.10.06.06.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 06:14:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id D8F3C8313348; Fri, 6 Oct 2023 06:14:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232322AbjJFNOL (ORCPT + 52 others); Fri, 6 Oct 2023 09:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232202AbjJFNOK (ORCPT ); Fri, 6 Oct 2023 09:14:10 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3235ABE for ; Fri, 6 Oct 2023 06:14:08 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 396DDtXqA1891471, 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.92/5.92) with ESMTPS id 396DDtXqA1891471 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Oct 2023 21:13:55 +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, 6 Oct 2023 21:13:55 +0800 Received: from [127.0.1.1] (172.16.16.139) 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, 6 Oct 2023 21:13:55 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 4/6] wifi: rtw89: show EHT rate in debugfs Date: Fri, 6 Oct 2023 21:13:25 +0800 Message-ID: <20231006131327.16806-5-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231006131327.16806-1-pkshih@realtek.com> References: <20231006131327.16806-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.16.16.139] 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 06 Oct 2023 06:14:14 -0700 (PDT) Since we have TX rate from RA report of C2H event and RX rate from RX descriptor, show them in debugfs like TX rate [1]: EHT 2SS MCS-7 GI:3.2 BW:80 (hw_rate=0x427) RX rate [1]: EHT 2SS MCS-7 GI:3.2 BW:80 (hw_rate=0x427) Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/debug.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c index 6990d3679bc0..a3f795d240ea 100644 --- a/drivers/net/wireless/realtek/rtw89/debug.c +++ b/drivers/net/wireless/realtek/rtw89/debug.c @@ -3467,6 +3467,11 @@ static void rtw89_sta_info_get_iter(void *data, struct ieee80211_sta *sta) [NL80211_RATE_INFO_HE_GI_1_6] = "1.6", [NL80211_RATE_INFO_HE_GI_3_2] = "3.2", }; + static const char * const eht_gi_str[] = { + [NL80211_RATE_INFO_EHT_GI_0_8] = "0.8", + [NL80211_RATE_INFO_EHT_GI_1_6] = "1.6", + [NL80211_RATE_INFO_EHT_GI_3_2] = "3.2", + }; struct rtw89_sta *rtwsta = (struct rtw89_sta *)sta->drv_priv; struct rate_info *rate = &rtwsta->ra_report.txrate; struct ieee80211_rx_status *status = &rtwsta->rx_status; @@ -3492,6 +3497,10 @@ static void rtw89_sta_info_get_iter(void *data, struct ieee80211_sta *sta) seq_printf(m, "HE %dSS MCS-%d GI:%s", rate->nss, rate->mcs, rate->he_gi <= NL80211_RATE_INFO_HE_GI_3_2 ? he_gi_str[rate->he_gi] : "N/A"); + else if (rate->flags & RATE_INFO_FLAGS_EHT_MCS) + seq_printf(m, "EHT %dSS MCS-%d GI:%s", rate->nss, rate->mcs, + rate->eht_gi < ARRAY_SIZE(eht_gi_str) ? + eht_gi_str[rate->eht_gi] : "N/A"); else seq_printf(m, "Legacy %d", rate->legacy); seq_printf(m, "%s", rtwsta->ra_report.might_fallback_legacy ? " FB_G" : ""); @@ -3520,6 +3529,11 @@ static void rtw89_sta_info_get_iter(void *data, struct ieee80211_sta *sta) status->he_gi <= NL80211_RATE_INFO_HE_GI_3_2 ? he_gi_str[rate->he_gi] : "N/A"); break; + case RX_ENC_EHT: + seq_printf(m, "EHT %dSS MCS-%d GI:%s", status->nss, status->rate_idx, + status->eht.gi < ARRAY_SIZE(eht_gi_str) ? + eht_gi_str[status->eht.gi] : "N/A"); + break; } seq_printf(m, " BW:%u", rtw89_rate_info_bw_to_mhz(status->bw)); seq_printf(m, "\t(hw_rate=0x%x)\n", rtwsta->rx_hw_rate); -- 2.25.1