Skip to contentSkip to conversation

wifi: rtw88: 8703b: avoid converting RX SNR twice

PATCH In review Hungyu Lin 3 participants 6 messages Oct 10 – Nov 3 Realtek wireless driver (rtw88)

lore
Share & tools
lore

Hungyu Lin

author
#0 lore raw

PATCH 1/1 wifi: rtw88: 8703b: avoid converting RX SNR twice

query_phy_status_ofdm() divides the SNR report by two when filling pkt_stat->rx_snr, then shifts it again when updating dm_info->rx_snr. This halves the SNR used for diagnostics and average statistics.

Store the raw report in pkt_stat->rx_snr and convert it only when updating dm_info->rx_snr, as the other chip drivers do.

Fixes 61a486bcd782 ("wifi: rtw88: Add rtw8703b.c")
---
 drivers/net/wireless/realtek/rtw88/rtw8703b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/rtw8703b.c +1 -1
index 25456f0367b2..1920277d626f 100644
@@ -959,7 +959,7 @@ static void query_phy_status_ofdm(struct rtw_dev *rtwdev, u8 *phy_raw,
 	val_s8 = phy_status->path_agc[RF_PATH_A].gain & 0x3F;
 	pkt_stat->rx_power[RF_PATH_A] = (val_s8 * 2) - 110;
 	pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, 1);
-	pkt_stat->rx_snr[RF_PATH_A] = (s8)(phy_status->path_rxsnr[RF_PATH_A] / 2);
+	pkt_stat->rx_snr[RF_PATH_A] = phy_status->path_rxsnr[RF_PATH_A];
 
 	/* signal power reported by HW */
 	val_s8 = phy_status->cck_sig_qual_ofdm_pwdb_all >> 1;
#1 lore raw
Quoted 19 lines · Hungyu Lin

query_phy_status_ofdm() divides the SNR report by two when filling pkt_stat->rx_snr, then shifts it again when updating dm_info->rx_snr. This halves the SNR used for diagnostics and average statistics.

Store the raw report in pkt_stat->rx_snr and convert it only when updating dm_info->rx_snr, as the other chip drivers do.

Fixes 61a486bcd782 ("wifi: rtw88: Add rtw8703b.c")
---
 drivers/net/wireless/realtek/rtw88/rtw8703b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/rtw8703b.c +0 -0
index 25456f0367b2..1920277d626f 100644

drivers/net/wireless/realtek/rtw88/rtw8703b.c static void query_phy_status_ofdm(struct rtw_dev *rtwdev, u8 *phy_raw, · line 965

Quoted 8 lines
drivers/net/wireless/realtek/rtw88/rtw8703b.c +1 -1
@@ -959,7 +959,7 @@ static void query_phy_status_ofdm(struct rtw_dev *rtwdev, u8 *phy_raw,
 val_s8 = phy_status->path_agc[RF_PATH_A].gain & 0x3F;
 pkt_stat->rx_power[RF_PATH_A] = (val_s8 * 2) - 110;
 pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, 1);
- pkt_stat->rx_snr[RF_PATH_A] = (s8)(phy_status->path_rxsnr[RF_PATH_A] / 2);
+ pkt_stat->rx_snr[RF_PATH_A] = phy_status->path_rxsnr[RF_PATH_A];
 
 /* signal power reported by HW */
 val_s8 = phy_status->cck_sig_qual_ofdm_pwdb_all >> 1;

Mind explaining why did you resend this?

#2 lore raw
Quoted 28 lines · Luka Gejak
Quoted 25 lines · Hungyu Lin

query_phy_status_ofdm() divides the SNR report by two when filling
pkt_stat->rx_snr, then shifts it again when updating dm_info->rx_snr. This halves the SNR used for diagnostics and average statistics.

Store the raw report in pkt_stat->rx_snr and convert it only when updating dm_info->rx_snr, as the other chip drivers do.

Fixes 61a486bcd782 ("wifi: rtw88: Add rtw8703b.c")

---

 drivers/net/wireless/realtek/rtw88/rtw8703b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8703b.c b/drivers/net/wireless/realtek/rtw88/rtw8703b.c index 25456f0367b2..1920277d626f 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c
@@ -959,7 +959,7 @@ static void query_phy_status_ofdm(struct rtw_dev *rtwdev, u8 *phy_raw, val_s8 = phy_status->path_agc[RF_PATH_A].gain & 0x3F;
pkt_stat->rx_power[RF_PATH_A] = (val_s8 * 2) - 110;
pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, 1);
- pkt_stat->rx_snr[RF_PATH_A] = (s8)(phy_status->path_rxsnr[RF_PATH_A] / 2);
+ pkt_stat->rx_snr[RF_PATH_A] = phy_status->path_rxsnr[RF_PATH_A];

Quoted 5 lines
Quoted 3 lines

/* signal power reported by HW */
val_s8 = phy_status->cck_sig_qual_ofdm_pwdb_all >> 1;

Mind explaining why did you resend this?

Ignore this email I misread the driver name.

Sorry.

Reviewed-by on v1 1/1
#3 lore raw
In reply to Hungyu Lin
Quoted 20 lines · Hungyu Lin

query_phy_status_ofdm() divides the SNR report by two when filling pkt_stat->rx_snr, then shifts it again when updating dm_info->rx_snr. This halves the SNR used for diagnostics and average statistics.

Store the raw report in pkt_stat->rx_snr and convert it only when updating dm_info->rx_snr, as the other chip drivers do.

Fixes 61a486bcd782 ("wifi: rtw88: Add rtw8703b.c")
---
 drivers/net/wireless/realtek/rtw88/rtw8703b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/rtw8703b.c +0 -0
index 25456f0367b2..1920277d626f 100644

drivers/net/wireless/realtek/rtw88/rtw8703b.c static void query_phy_status_ofdm(struct rtw_dev *rtwdev, u8 *phy_raw, · line 965

Quoted 8 lines
drivers/net/wireless/realtek/rtw88/rtw8703b.c +1 -1
@@ -959,7 +959,7 @@ static void query_phy_status_ofdm(struct rtw_dev *rtwdev, u8 *phy_raw,
 val_s8 = phy_status->path_agc[RF_PATH_A].gain & 0x3F;
 pkt_stat->rx_power[RF_PATH_A] = (val_s8 * 2) - 110;
 pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, 1);
- pkt_stat->rx_snr[RF_PATH_A] = (s8)(phy_status->path_rxsnr[RF_PATH_A] / 2);
+ pkt_stat->rx_snr[RF_PATH_A] = phy_status->path_rxsnr[RF_PATH_A];
 
 /* signal power reported by HW */
 val_s8 = phy_status->cck_sig_qual_ofdm_pwdb_all >> 1;

Looking good to me.

Best regards,
Luka Gejak

maintainer Acked-by on v1 1/1
#4 lore raw
In reply to Hungyu Lin
Quoted 9 lines · Hungyu Lin

query_phy_status_ofdm() divides the SNR report by two when filling pkt_stat->rx_snr, then shifts it again when updating dm_info->rx_snr. This halves the SNR used for diagnostics and average statistics.

Store the raw report in pkt_stat->rx_snr and convert it only when updating dm_info->rx_snr, as the other chip drivers do.

Fixes 61a486bcd782 ("wifi: rtw88: Add rtw8703b.c")
maintainer
#5 lore raw
In reply to Hungyu Lin
Quoted 11 lines · Hungyu Lin

query_phy_status_ofdm() divides the SNR report by two when filling pkt_stat->rx_snr, then shifts it again when updating dm_info->rx_snr. This halves the SNR used for diagnostics and average statistics.

Store the raw report in pkt_stat->rx_snr and convert it only when updating dm_info->rx_snr, as the other chip drivers do.

Fixes 61a486bcd782 ("wifi: rtw88: Add rtw8703b.c")

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

c3ae9e68e138 wifi: rtw88: 8703b: avoid converting RX SNR twice

---
https://github.com/pkshih/rtw.git