linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw88: Report the signal strength only if it's known
@ 2024-10-22 17:20 Bitterblue Smith
  2024-10-23  1:57 ` Ping-Ke Shih
  2024-10-29  3:38 ` Ping-Ke Shih
  0 siblings, 2 replies; 5+ messages in thread
From: Bitterblue Smith @ 2024-10-22 17:20 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

RTL8811CU doesn't report the signal strength for many (any?) data
frames. When the signal strength is not known, set
RX_FLAG_NO_SIGNAL_VAL in order to avoid reporting a signal
strength of 0.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/rx.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/rx.c b/drivers/net/wireless/realtek/rtw88/rx.c
index 1de93fc9efe9..90fc8a5fa89e 100644
--- a/drivers/net/wireless/realtek/rtw88/rx.c
+++ b/drivers/net/wireless/realtek/rtw88/rx.c
@@ -234,10 +234,14 @@ static void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
 	else
 		rx_status->bw = RATE_INFO_BW_20;
 
-	rx_status->signal = pkt_stat->signal_power;
-	for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
-		rx_status->chains |= BIT(path);
-		rx_status->chain_signal[path] = pkt_stat->rx_power[path];
+	if (pkt_stat->phy_status) {
+		rx_status->signal = pkt_stat->signal_power;
+		for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
+			rx_status->chains |= BIT(path);
+			rx_status->chain_signal[path] = pkt_stat->rx_power[path];
+		}
+	} else {
+		rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
 	}
 
 	rtw_rx_addr_match(rtwdev, pkt_stat, hdr);
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH] wifi: rtw88: Report the signal strength only if it's known
  2024-10-22 17:20 [PATCH] wifi: rtw88: Report the signal strength only if it's known Bitterblue Smith
@ 2024-10-23  1:57 ` Ping-Ke Shih
  2024-10-23 13:16   ` Bitterblue Smith
  2024-10-29  3:38 ` Ping-Ke Shih
  1 sibling, 1 reply; 5+ messages in thread
From: Ping-Ke Shih @ 2024-10-23  1:57 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> 
> RTL8811CU doesn't report the signal strength for many (any?) data
> frames. When the signal strength is not known, set
> RX_FLAG_NO_SIGNAL_VAL in order to avoid reporting a signal
> strength of 0.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

> ---
>  drivers/net/wireless/realtek/rtw88/rx.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/rx.c b/drivers/net/wireless/realtek/rtw88/rx.c
> index 1de93fc9efe9..90fc8a5fa89e 100644
> --- a/drivers/net/wireless/realtek/rtw88/rx.c
> +++ b/drivers/net/wireless/realtek/rtw88/rx.c
> @@ -234,10 +234,14 @@ static void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
>         else
>                 rx_status->bw = RATE_INFO_BW_20;
> 
> -       rx_status->signal = pkt_stat->signal_power;
> -       for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
> -               rx_status->chains |= BIT(path);
> -               rx_status->chain_signal[path] = pkt_stat->rx_power[path];
> +       if (pkt_stat->phy_status) {

When only pkt_stat->phy_status is set, driver calls rtwdev->chip->ops->query_phy_status()
to get PHY status. Have you reviewed all places accessing PHY fields 
also check pkt_stat->phy_status? 


> +               rx_status->signal = pkt_stat->signal_power;
> +               for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
> +                       rx_status->chains |= BIT(path);
> +                       rx_status->chain_signal[path] = pkt_stat->rx_power[path];
> +               }
> +       } else {
> +               rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
>         }
> 
>         rtw_rx_addr_match(rtwdev, pkt_stat, hdr);
> --
> 2.46.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: rtw88: Report the signal strength only if it's known
  2024-10-23  1:57 ` Ping-Ke Shih
@ 2024-10-23 13:16   ` Bitterblue Smith
  2024-10-24  1:17     ` Ping-Ke Shih
  0 siblings, 1 reply; 5+ messages in thread
From: Bitterblue Smith @ 2024-10-23 13:16 UTC (permalink / raw)
  To: Ping-Ke Shih, linux-wireless@vger.kernel.org

On 23/10/2024 04:57, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>>
>> RTL8811CU doesn't report the signal strength for many (any?) data
>> frames. When the signal strength is not known, set
>> RX_FLAG_NO_SIGNAL_VAL in order to avoid reporting a signal
>> strength of 0.
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> 
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
> 
>> ---
>>  drivers/net/wireless/realtek/rtw88/rx.c | 12 ++++++++----
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtw88/rx.c b/drivers/net/wireless/realtek/rtw88/rx.c
>> index 1de93fc9efe9..90fc8a5fa89e 100644
>> --- a/drivers/net/wireless/realtek/rtw88/rx.c
>> +++ b/drivers/net/wireless/realtek/rtw88/rx.c
>> @@ -234,10 +234,14 @@ static void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
>>         else
>>                 rx_status->bw = RATE_INFO_BW_20;
>>
>> -       rx_status->signal = pkt_stat->signal_power;
>> -       for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
>> -               rx_status->chains |= BIT(path);
>> -               rx_status->chain_signal[path] = pkt_stat->rx_power[path];
>> +       if (pkt_stat->phy_status) {
> 
> When only pkt_stat->phy_status is set, driver calls rtwdev->chip->ops->query_phy_status()
> to get PHY status. Have you reviewed all places accessing PHY fields 
> also check pkt_stat->phy_status? 
> 

Yes, I think this was the only place that didn't check pkt_stat->phy_status.

> 
>> +               rx_status->signal = pkt_stat->signal_power;
>> +               for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
>> +                       rx_status->chains |= BIT(path);
>> +                       rx_status->chain_signal[path] = pkt_stat->rx_power[path];
>> +               }
>> +       } else {
>> +               rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
>>         }
>>
>>         rtw_rx_addr_match(rtwdev, pkt_stat, hdr);
>> --
>> 2.46.0
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] wifi: rtw88: Report the signal strength only if it's known
  2024-10-23 13:16   ` Bitterblue Smith
@ 2024-10-24  1:17     ` Ping-Ke Shih
  0 siblings, 0 replies; 5+ messages in thread
From: Ping-Ke Shih @ 2024-10-24  1:17 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> On 23/10/2024 04:57, Ping-Ke Shih wrote:
> > Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> >> diff --git a/drivers/net/wireless/realtek/rtw88/rx.c b/drivers/net/wireless/realtek/rtw88/rx.c
> >> index 1de93fc9efe9..90fc8a5fa89e 100644
> >> --- a/drivers/net/wireless/realtek/rtw88/rx.c
> >> +++ b/drivers/net/wireless/realtek/rtw88/rx.c
> >> @@ -234,10 +234,14 @@ static void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
> >>         else
> >>                 rx_status->bw = RATE_INFO_BW_20;
> >>
> >> -       rx_status->signal = pkt_stat->signal_power;
> >> -       for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
> >> -               rx_status->chains |= BIT(path);
> >> -               rx_status->chain_signal[path] = pkt_stat->rx_power[path];
> >> +       if (pkt_stat->phy_status) {
> >
> > When only pkt_stat->phy_status is set, driver calls rtwdev->chip->ops->query_phy_status()
> > to get PHY status. Have you reviewed all places accessing PHY fields
> > also check pkt_stat->phy_status?
> >
> 
> Yes, I think this was the only place that didn't check pkt_stat->phy_status.
> 

Great! Thanks for the confirmation. 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: rtw88: Report the signal strength only if it's known
  2024-10-22 17:20 [PATCH] wifi: rtw88: Report the signal strength only if it's known Bitterblue Smith
  2024-10-23  1:57 ` Ping-Ke Shih
@ 2024-10-29  3:38 ` Ping-Ke Shih
  1 sibling, 0 replies; 5+ messages in thread
From: Ping-Ke Shih @ 2024-10-29  3:38 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:

> RTL8811CU doesn't report the signal strength for many (any?) data
> frames. When the signal strength is not known, set
> RX_FLAG_NO_SIGNAL_VAL in order to avoid reporting a signal
> strength of 0.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

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

47f754b3f838 wifi: rtw88: Report the signal strength only if it's known

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-29  3:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-22 17:20 [PATCH] wifi: rtw88: Report the signal strength only if it's known Bitterblue Smith
2024-10-23  1:57 ` Ping-Ke Shih
2024-10-23 13:16   ` Bitterblue Smith
2024-10-24  1:17     ` Ping-Ke Shih
2024-10-29  3:38 ` Ping-Ke Shih

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