From patchwork Thu May 19 06:38:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1633088 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=qf4h5+zg; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L3gFD6pXfz9s0r for ; Thu, 19 May 2022 16:39:28 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nrZof-0003aJ-Os; Thu, 19 May 2022 06:39:21 +0000 Received: from mail-pf1-f175.google.com ([209.85.210.175]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nrZoa-0003Ng-Lj for kernel-team@lists.ubuntu.com; Thu, 19 May 2022 06:39:16 +0000 Received: by mail-pf1-f175.google.com with SMTP id p8so4291710pfh.8 for ; Wed, 18 May 2022 23:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0PoBk5pUpvy5tOuq5Rxnqv/gPkhKAKv+opes7OStWj0=; b=qf4h5+zgseHgVuBp2eCM6tIfRu12p2LwaWvmDLGA/BVswg8uKZyYsHygB6ukWr1HdW /Yd1Hbk7ojpFl44F7J+PXf11rkX0FJ4mdhe9NED0ZQX6pkz2mSlPyRRYH7Q0utFaobW3 wnJEHo/7RwU+rGXpSbreVKI1EsYkn6WPWNM319rDulrheibqVrGPDpZfzMm1Jbdupmzi w21SrI6h5ph6RchO8KFj7msv5ia/eb1x8BMvWQDyF0PZYOQoo7uMoHaoTm9JD398NiS8 PqvDjVIO8Yu2jos5OMC8ujphITVIKrGwhEGuQs+OQ56bRsPNR80P6zClnfY1iebEMdWo jjkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0PoBk5pUpvy5tOuq5Rxnqv/gPkhKAKv+opes7OStWj0=; b=MfSVF0DDepb6rxc9gEUV+r1mqbQc8dUFmqu5ixMMA3t9wfcsImtlOgvs/mOywbWWHI ka9J56cb9TKk36/Iyf1F5A+3K+RE4XpvpVPcx5wzUQSXA+CIBbMWb/SX8Rbi9aqScKpG 3zUazAtMvSRFGr5/u2Ga17U2sDZFpZ/auFnYgzIAVJeO/FHJ2zmZvpGcv6Chj1wLE6xD Re4d3TtQU+9fI4y9DWAK8xNKeMXwe2hv4uZ3WskXzcIevg16rBnVLu916aredM5wF6dx NNl0VwfVjswFyMaujm/SqJ4i1hV/HrrPMxnm0NsB/393nNDQOiLnTIrsD7hUmQfxqswR AzJQ== X-Gm-Message-State: AOAM530nAYiXDt0aURxNrggbNJKxuk8cSrFher0wAZ43Bzohksd+8XiJ XNRrhtNDz59I8Xm03JcLvM+bugLDljE= X-Google-Smtp-Source: ABdhPJw0PWfNk2q7OJSuFIjeKv0n3HTAw/KLjXaaurZtCMJ1VV52gh3jeZ0aklQGaDHcnJam6zuOcg== X-Received: by 2002:a63:9dc7:0:b0:3f6:17f0:f310 with SMTP id i190-20020a639dc7000000b003f617f0f310mr2660922pgd.285.1652942352892; Wed, 18 May 2022 23:39:12 -0700 (PDT) Received: from localhost (220-135-95-34.hinet-ip.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id a185-20020a621ac2000000b005182d505389sm2760059pfa.72.2022.05.18.23.39.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 23:39:12 -0700 (PDT) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 6/6][SRU][OEM-5.17] rtw88: 8821c: fix debugfs rssi value Date: Thu, 19 May 2022 14:38:51 +0800 Message-Id: <20220519063857.1102980-7-acelan.kao@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220519063857.1102980-1-acelan.kao@canonical.com> References: <20220519063857.1102980-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.175; envelope-from=acelan@gmail.com; helo=mail-pf1-f175.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Po-Hao Huang BugLink: https://bugs.launchpad.net/bugs/1969326 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 (cherry picked from commit ece31c93d4d68f7eb8eea4431b052aacdb678de2 linux-next) Signed-off-by: Chia-Lin Kao (AceLan) --- 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 80d4761796b1..0f16f649e03f 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);