Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2102966iof; Tue, 7 Jun 2022 19:51:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwnQ88o2hoU4p5JNxtes9XAXf7Tpm85blzkVths0jkViWFAJLMFkmeJEmG/oEKM3vDOLFl X-Received: by 2002:a17:902:9006:b0:167:5c8c:4d37 with SMTP id a6-20020a170902900600b001675c8c4d37mr21445987plp.109.1654656661487; Tue, 07 Jun 2022 19:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654656661; cv=none; d=google.com; s=arc-20160816; b=VloliBX1NT+Oa1lKjkZIKjkxNXssbW1MB+bo0gLp2W/bsl9kwCYYXCTYqP8Lw2/wG8 2SFGqeDnUxBIEH1Q1Gd/Oy4B6rVFLGGqHUC0zFNmTDSS2bEHnYpzKcsPrfasRt4bKaZo iy9gG5ZMY8lOF4alh/cpt5gUx8FipO72CICFusZb3OXeElwgDmcfmhL9L/JLOfrAIy/P K4BDrD5u9VufYrbo1V16K3QtcPBpsrqGLY2bEb98EZXKvnqVIA96fa2L0Dd2SKFy4TNt RUKi5/Np0xhXjL70jaS+qlCNDxVIfWHLKINHKfrVPoj3e8nl3EkLgHyOzOsjY1jiF9jK bFkg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8eq8gUyiezmlNzMMpOYXgPk8k4E5H5sqDa5dbZ7rdlM=; b=TKQBuhv2XibAjEXtciTzEHTeotjveU8U1MSa5U0t2TbBgt7j4aXLC0j3yI/duovQn9 uB8rrxWCV2et3fK5+b8vEG4crh75CfBd9nD/amidM5JKTtfMc6A9HabZayUg7GNi24li y3ioWdW6UEJ9Uz01geE7QKx1yfBPCSAmmyDyIEPZz2kU81GJYjAD3AmczdkBHnvJWXhK k2nAaXIn7+/Hs4zg12TTfZfMDdN1K6NtJx3tx5qbE7vbHmwAWH0vWRbu6fKajNVt6eSI 4omsz8EsCvLRLg6c2mJugGwi00blAeH64eCsVe6GMhA4CwETXCsLZNsjKZCMHzNLZ8h4 Ml4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yNFQUbF2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 20-20020a630114000000b003fd4101223bsi1646938pgb.798.2022.06.07.19.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 19:51:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yNFQUbF2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CC4792823E6; Tue, 7 Jun 2022 18:20:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384007AbiFGWKC (ORCPT + 99 others); Tue, 7 Jun 2022 18:10:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379287AbiFGVFv (ORCPT ); Tue, 7 Jun 2022 17:05:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 123F818DAE5; Tue, 7 Jun 2022 11:49:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D9DA3B82018; Tue, 7 Jun 2022 18:49:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D4A9C385A5; Tue, 7 Jun 2022 18:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627757; bh=R5pzKpdEPHGtsz9epenICLHLl0Q4w/B8PhegQPUoeNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yNFQUbF2dpU91kIGS4j1LZ8aHitrNuQrJA4JRXAu5IT2R3X44GWqIFOHMDY57Gmoo wH0KYzVEmLHf1rEDh/PFnv4Bm9hv1Vho36xuM6B1Vgbxj8wgjHhaYOhETYY6r4U7aA U6V86xchEuhV/uh+VSA7WANuwiBueEbkDJOZakaw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Po-Hao Huang , Ping-Ke Shih , Kalle Valo , Sasha Levin Subject: [PATCH 5.18 083/879] rtw88: 8821c: fix debugfs rssi value Date: Tue, 7 Jun 2022 18:53:21 +0200 Message-Id: <20220607165005.098729519@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-kernel@vger.kernel.org From: Po-Hao Huang [ Upstream commit ece31c93d4d68f7eb8eea4431b052aacdb678de2 ] RSSI value per frame is reported to mac80211 but not maintained in our own statistics, add it back to help us debug. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220407095858.46807-7-pkshih@realtek.com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw88/rtw8821c.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c index 99eee128ae94..ec38a7c84951 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -512,6 +512,7 @@ static s8 get_cck_rx_pwr(struct rtw_dev *rtwdev, u8 lna_idx, u8 vga_idx) static void query_phy_status_page0(struct rtw_dev *rtwdev, u8 *phy_status, struct rtw_rx_pkt_stat *pkt_stat) { + struct rtw_dm_info *dm_info = &rtwdev->dm_info; s8 rx_power; u8 lna_idx = 0; u8 vga_idx = 0; @@ -523,6 +524,7 @@ static void query_phy_status_page0(struct rtw_dev *rtwdev, u8 *phy_status, pkt_stat->rx_power[RF_PATH_A] = rx_power; pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, 1); + dm_info->rssi[RF_PATH_A] = pkt_stat->rssi; pkt_stat->bw = RTW_CHANNEL_WIDTH_20; pkt_stat->signal_power = rx_power; } @@ -530,6 +532,7 @@ static void query_phy_status_page0(struct rtw_dev *rtwdev, u8 *phy_status, static void query_phy_status_page1(struct rtw_dev *rtwdev, u8 *phy_status, struct rtw_rx_pkt_stat *pkt_stat) { + struct rtw_dm_info *dm_info = &rtwdev->dm_info; u8 rxsc, bw; s8 min_rx_power = -120; @@ -549,6 +552,7 @@ static void query_phy_status_page1(struct rtw_dev *rtwdev, u8 *phy_status, pkt_stat->rx_power[RF_PATH_A] = GET_PHY_STAT_P1_PWDB_A(phy_status) - 110; pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, 1); + dm_info->rssi[RF_PATH_A] = pkt_stat->rssi; pkt_stat->bw = bw; pkt_stat->signal_power = max(pkt_stat->rx_power[RF_PATH_A], min_rx_power); -- 2.35.1