Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2244661rdb; Mon, 9 Oct 2023 19:11:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFpqLh3/Jx4t8EsBI+5lEfCWv3EBRh1zVMfFO8aFlKYNoqOxLHBUjOW/OixkOzGKf6p6Xa X-Received: by 2002:a17:902:720a:b0:1c3:a215:a9ba with SMTP id ba10-20020a170902720a00b001c3a215a9bamr15929877plb.33.1696903873025; Mon, 09 Oct 2023 19:11:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696903873; cv=none; d=google.com; s=arc-20160816; b=t+s8Fsgd3plc/xEXVgBLy8e2J6HsJ94HhIKw2cCqxtMl1xZqKSotlnrn0MxKczIzy6 S96rLrBf5G5YrlyZsdcDCWw/4goDIjWd6o4tyeGWsu4YD/p3KOQnywzSS+mz4EpxzghN ySdANLJwX9jp2Qhgj0aA88pVxqiaTLeZDBBOcTwzbQluE6UwG2o59/fYv0BBOKFEoh7b 7acYKNLTKibWtnpBUJH4sJi3NgQBSj958VGOHzgQEigXlow9liWqRs4SVThbCG809Zb0 tKjE4dlbYJE+q8yiuHKMZR48hCH5j3gctRUqmGJ9m7R5lRIP4FZo7XKSx1dgez04U+Fm y2iA== 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=lpC/8a3TKZnB15ndtigvtlFtT05MdGj800ur9PLTCvCgQD4v54acSJUFV8y3v3ffty I/dL8zGKmzkRhkGJEUQE4RnUi9ahBJDc5boZW3pz+oyVCZo076Php0me41mukI9Fa0Lk kEl28RKpGC2Pt5sHzCFiHDwnD+MxU4dYJnUKyZpSCoa1JY60okxM8DaMfDSE6TKSGzbB fIH+MKQFzlGAWj1FVlHhWxRoiL7yZsvF/n3yTerad1dCkY70+lI+AwVtwtMbmfuJkb+3 WN0EUGw63cwaizM+mChGl+7LlFlZk/mghDSXWi4R5+yjkTrJNIaSniQVA39oxj6k/zsj EHSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id l20-20020a170903005400b001b8b437b01esi270962pla.350.2023.10.09.19.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 19:11:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 52EC680560FE; Mon, 9 Oct 2023 19:11:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441855AbjJJCKu (ORCPT + 52 others); Mon, 9 Oct 2023 22:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441851AbjJJCKs (ORCPT ); Mon, 9 Oct 2023 22:10:48 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19B3D9E for ; Mon, 9 Oct 2023 19:10:46 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 39A2AZYt82015409, 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 39A2AZYt82015409 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Oct 2023 10:10:35 +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; Tue, 10 Oct 2023 10:10:35 +0800 Received: from [127.0.1.1] (172.16.16.25) 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; Tue, 10 Oct 2023 10:10:35 +0800 From: Ping-Ke Shih To: , CC: Subject: [PATCH v2 4/6] wifi: rtw89: show EHT rate in debugfs Date: Tue, 10 Oct 2023 10:10:04 +0800 Message-ID: <20231010021006.6061-5-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231010021006.6061-1-pkshih@realtek.com> References: <20231010021006.6061-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.25] 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=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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 19:11:09 -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