Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp755536rdg; Wed, 11 Oct 2023 04:53:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxnIax11wgD+9Cf4NTlW5cfFAtYpDAix8XJSF6mssjReUvvkHJg7NQiK9yw3X881rrd6vm X-Received: by 2002:a05:6358:4298:b0:143:8af4:229e with SMTP id s24-20020a056358429800b001438af4229emr25101247rwc.9.1697025233043; Wed, 11 Oct 2023 04:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697025233; cv=none; d=google.com; s=arc-20160816; b=VFrmQ64GJ//e+d+hKdSCpEo5wR4HOohOytuQeVtMoPkdUWUM/8vfz1/gDKYbFQ2DdW ZrQabeRkkAMHqzTaiZyfgZkkFC5YVX/f3ttK4kbA3fSUvGKEzEpM2OEztINKDltKitY3 WS+EQ82o9mhUsmJc/vEUVrNAq54U9remVson+5BKH4xrPbWzRxvByVLqM7ek+eWFqaJs Y6nXDrdswv2RwbmbUd7i+lsM3Cc13OKCubvWhXgpy/6Qtj5mnh/Zonu4vK/wCe6E+WK/ sUEPjsSgAnN/Jer5rmp/ueACnztq11pCzWJ72mMveM+8lkCdO2TYlTvlsZt9OU8m6CZB PAqA== 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=oKuxOziNuKIHRWEE7GwCapp1mTyfB2navqkSz/+SQhw=; b=ggP8hj+PtMB2+pjtwF+n2+sT2vi8L5AmPkycK6jQCKSoTtF3wKuyJm28Ef3fKqtywq +HxPmGHFdn8Mwwy75bHjaLEN+GJcsHWvgoXMs81jO7Ka9ecE75IlmrL+6pU1KIf15Bj2 FLtRzvS/yy/kc36iVHvPM0ohaC7HkWhT2Se/0uQMx6fl728H3nJgjCFEOrbjNjgScE17 9HCwICFgrLiQ3bZ+3waML0+KS06XcFjZ0Nb5RdcKfuctmZ1g7OguSxia3zG+P3y2ILWK bRKP9JvcAZhHhOkrLW1jrgiJM1EwtwHR8EKFVzGtWYNOiIk1mkIYYYgRJ5fNmbW7KLEW eGqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id s16-20020a056a0008d000b0068fee0e95c5si12502391pfu.89.2023.10.11.04.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id AA0E7804BDE9; Wed, 11 Oct 2023 04:53:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234760AbjJKLxo (ORCPT + 52 others); Wed, 11 Oct 2023 07:53:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232111AbjJKLxn (ORCPT ); Wed, 11 Oct 2023 07:53:43 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19F49A4 for ; Wed, 11 Oct 2023 04:53:40 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 39BBrNUB13997542, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.92/5.92) with ESMTPS id 39BBrNUB13997542 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 19:53:23 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.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.2375.32; Wed, 11 Oct 2023 19:53:23 +0800 Received: from [127.0.1.1] (172.16.16.120) 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; Wed, 11 Oct 2023 19:53:23 +0800 From: Ping-Ke Shih To: , CC: Subject: [PATCH v3 5/6] wifi: rtw89: show EHT rate in debugfs Date: Wed, 11 Oct 2023 19:52:55 +0800 Message-ID: <20231011115256.6121-6-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231011115256.6121-1-pkshih@realtek.com> References: <20231011115256.6121-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.120] 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-KSE-ServerInfo: RTEXH36505.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=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Wed, 11 Oct 2023 04:53:50 -0700 (PDT) X-Spam-Level: ** 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