Skip to contentSkip to conversation

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

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

lore
Share & tools
lore

Hungyu Lin

author
#0 lore raw

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

rtw8723b_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 d726c70ce082 ("wifi: rtw88: 8723b: add the RTL8723B chip driver")

---
Changes in v2:
- Store the raw SNR report in pkt_stat->rx_snr and keep the shift when updating dm_info->rx_snr.

 drivers/net/wireless/realtek/rtw88/rtw8723b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/rtw8723b.c +1 -1
index 8bb9c03d769c..18bd2b108ccb 100644
@@ -1280,7 +1280,7 @@ static void rtw8723b_query_phy_status_ofdm(struct rtw_dev *rtwdev, void *phy_raw
 	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;
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Hungyu Lin

rtw8723b_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 d726c70ce082 ("wifi: rtw88: 8723b: add the RTL8723B chip driver")

Ping-Ke should fixes tag be present here if this commit isn't in mainline yet?

Quoted 14 lines

---
Changes in v2:
- Store the raw SNR report in pkt_stat->rx_snr and keep the shift when updating dm_info->rx_snr.

 drivers/net/wireless/realtek/rtw88/rtw8723b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/rtw8723b.c +0 -0
index 8bb9c03d769c..18bd2b108ccb 100644

drivers/net/wireless/realtek/rtw88/rtw8723b.c static void rtw8723b_query_phy_status_ofdm(struct rtw_dev *rtwdev, void *phy_raw · line 1286

Quoted 8 lines
drivers/net/wireless/realtek/rtw88/rtw8723b.c +1 -1
@@ -1280,7 +1280,7 @@ static void rtw8723b_query_phy_status_ofdm(struct rtw_dev *rtwdev, void *phy_raw
 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;

Either way change looks good to me.

Best regards,
Luka Gejak

maintainer Acked-by
#2 lore raw
Quoted 11 lines · Luka Gejak
Quoted 11 lines

rtw8723b_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 d726c70ce082 ("wifi: rtw88: 8723b: add the RTL8723B chip driver")
Quoted 3 lines

Ping-Ke should fixes tag be present here if this commit isn't in mainline yet?

My pull-request including the patch was merged, so the SHA1 will be constant.

Ping-Ke

maintainer
#3 lore raw
In reply to Hungyu Lin
Quoted 5 lines · Hungyu Lin

rtw8723b_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.

Quoted 7 lines

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 d726c70ce082 ("wifi: rtw88: 8723b: add the RTL8723B chip driver")

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

1d72d0db9111 wifi: rtw88: 8723b: avoid converting RX SNR twice

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