Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp18132pxj; Thu, 13 May 2021 19:32:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwtszWd5V3tTj0v5V297++zKAcuNKl3aq9dg5+s+WOFANc/mGUncXq8uqFCY+TP8dIQZF4 X-Received: by 2002:a17:907:7747:: with SMTP id kx7mr29753094ejc.400.1620959549088; Thu, 13 May 2021 19:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620959549; cv=none; d=google.com; s=arc-20160816; b=ouX4EqYVXzIgiACdtNL00zIz+QT+IAoXvkND/mE7iSxfxk0uJg0TZEUtUSmcAaqFdk GUk6nka5QX03Ifl3Bo892XgVQRXkVCvxAIfPbhOaMEZzE8mJXrwojX9UEeQHh3X7X0DD xnhtPA1Yz/dlzCL5HONpFW4HVqerjdDWYpj1v/Qghhk6CTK0zUy3ZCb8683fI01DAS2S BbLlqsXeS5Us0SS+Ho/G57gWOAGhE71gyImk+NVIyDsPH2CLdwc860sKlE5WJyQAzYe8 4YIVj4kimfJVxdPfM72qAl2kwnpOhF9I0QVkTRVjqaEKk31ykNgV2ySHlaUhjTUAil58 x5NQ== 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=l3GYAH/YXwcFBDoJ7TnwxIwuh3J3Cc0SpFLI6OaedEc=; b=IopfH0QgmwKyusDYLdhGq7tLMbpZ4T0GxNvAGS/08tF8cnsUJrGCWKSR+j8A0RSjXF diMsM0n3PxYynP34ydRO9Tt1obNrqSP0UsVkuwW88T59x/vLnt58SKhunbWFM7iFPbsE ysW3DUJ7yVLsbldMnishP6M/uAVvmbWk46DaRTYm/ItWynOudpwsnR55SsSqh3kbrjT/ 0p8KiDnl5+FxgABbvaBqYszJqsrGtgo4lWqkre7QbRTaNIUmdnWWLW6LcOydTT3ieo5M E++5+ipFtdNqr9pUPe7tJ/731P6bDJxZkGyUIh2BBAvV67MMaXWKTKfENq6Q8Coqjqf5 Xw8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga21si4523722ejc.607.2021.05.13.19.32.05; Thu, 13 May 2021 19:32:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230525AbhENCGW (ORCPT + 99 others); Thu, 13 May 2021 22:06:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbhENCGU (ORCPT ); Thu, 13 May 2021 22:06:20 -0400 Received: from mxout017.mail.hostpoint.ch (mxout017.mail.hostpoint.ch [IPv6:2a00:d70:0:e::317]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB485C061756 for ; Thu, 13 May 2021 19:05:08 -0700 (PDT) Received: from [10.0.2.45] (helo=asmtp012.mail.hostpoint.ch) by mxout017.mail.hostpoint.ch with esmtp (Exim 4.94.2 (FreeBSD)) (envelope-from ) id 1lhNCK-0005TS-Li; Fri, 14 May 2021 04:05:04 +0200 Received: from [2a02:168:6182:1:4ea5:a8cc:a141:509c] (helo=ryzen2700.home.reto-schneider.ch) by asmtp012.mail.hostpoint.ch with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2 (FreeBSD)) (envelope-from ) id 1lhNCK-000L6T-HT; Fri, 14 May 2021 04:05:04 +0200 X-Authenticated-Sender-Id: reto-schneider@reto-schneider.ch From: Reto Schneider To: Jes.Sorensen@gmail.com, linux-wireless@vger.kernel.org, pkshih@realtek.com Cc: yhchuang@realtek.com, Larry.Finger@lwfinger.net, tehuang@realtek.com, reto.schneider@husqvarnagroup.com, ccchiu77@gmail.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, Chris Chiu , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 6/7] rtl8xxxu: Fix the reported rx signal strength Date: Fri, 14 May 2021 04:04:41 +0200 Message-Id: <20210514020442.946-7-code@reto-schneider.ch> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210514020442.946-1-code@reto-schneider.ch> References: <20210514020442.946-1-code@reto-schneider.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Chris Chiu In rtl8xxxx_rx_query_desc for each chip in rtlwifi family, the rx_status->signal is always the status->recvsignalpower + 10. We also observe the same thing in air capture that the RSSI is always ~10dBm higher than reported from driver. Add this 10dBm to avoid confusion. (cherry picked from commit e1a4f83da577474dfa23e85483a83eb7fb707edc) Signed-off-by: Reto Schneider --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 0c997c360028..088e007e8bd0 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -5319,6 +5319,11 @@ static void rtl8xxxu_rx_parse_phystats(struct rtl8xxxu_priv *priv, rx_status->signal = (phy_stats->cck_sig_qual_ofdm_pwdb_all >> 1) - 110; } + + // refers to rtlxxxx_rx_query_desc of rtlwifi/rtlxxxx/trx.c + // needs to verify on RTL8723BU + if (priv->rtl_chip != RTL8723B && priv->rtl_chip != RTL8192E) + rx_status->signal += 10; } static void rtl8xxxu_free_rx_resources(struct rtl8xxxu_priv *priv) -- 2.29.2