linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Reto Schneider <code@reto-schneider.ch>
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 <chiu@endlessos.org>,
	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	[thread overview]
Message-ID: <20210514020442.946-7-code@reto-schneider.ch> (raw)
In-Reply-To: <20210514020442.946-1-code@reto-schneider.ch>

From: Chris Chiu <chiu@endlessos.org>

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 <reto.schneider@husqvarnagroup.com>
---

 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


  parent reply	other threads:[~2021-05-14  2:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 13:50 rtl8xxxu: Wi-Fi Alliance Certification on Realtek RTL8188CUS Reto Schneider
2021-05-14  2:04 ` [PATCH 0/7] [RFC] rtl8xxxu/RTL8188CUS: Wi-Fi Alliance Certification Reto Schneider
2021-05-14  2:04   ` [PATCH 1/7] rtl8xxxu: add code to handle BSS_CHANGED_TXPOWER/IEEE80211_CONF_CHANGE_POWER Reto Schneider
2021-05-14  4:09     ` Joe Perches
2021-05-14  2:04   ` [PATCH 2/7] rtl8xxxu: add handle for mac80211 get_txpower Reto Schneider
2021-05-14  4:22     ` Joe Perches
2021-05-14  2:04   ` [PATCH 3/7] rtl8xxxu: Enable RX STBC by default Reto Schneider
2021-05-14  2:04   ` [PATCH 4/7] rtl8xxxu: feed antenna information for mac80211 Reto Schneider
2021-05-14  2:04   ` [PATCH 5/7] rtl8xxxu: fill up txrate info for all chips Reto Schneider
2021-05-14  2:04   ` Reto Schneider [this message]
2021-05-14  2:04   ` [PATCH 7/7] rtl8xxxu: Fix ampdu_action to get block ack session work Reto Schneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210514020442.946-7-code@reto-schneider.ch \
    --to=code@reto-schneider.ch \
    --cc=Jes.Sorensen@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=ccchiu77@gmail.com \
    --cc=chiu@endlessos.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=reto.schneider@husqvarnagroup.com \
    --cc=tehuang@realtek.com \
    --cc=yhchuang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).