* [PATCH] brcmfmac: fix RSSI report in AP mode
@ 2024-11-22 21:03 Alex Shumsky
2024-11-25 11:58 ` Kalle Valo
2024-11-26 11:13 ` Arend van Spriel
0 siblings, 2 replies; 7+ messages in thread
From: Alex Shumsky @ 2024-11-22 21:03 UTC (permalink / raw)
To: linux-wireless
Cc: Alex Shumsky, Alexey Berezhok, Alvin Šipraga,
Arend van Spriel, Hector Martin, Janne Grunau, Kalle Valo,
Kees Cook, Neal Gompa, Wolfram Sang, brcm80211-dev-list.pdl,
brcm80211, linux-kernel
After commit 9a1590934d9a ("brcmfmac: correctly report average RSSI in
station info") it is required from firmware to provide rx_lastpkt_rssi.
If this field is not provided brcmfmac doesn't report any RSSI at all.
Unfortunately some firmwares doesn't provide it. One example is firmware
for BCM43455 found in Raspbberry Pi.
See https://github.com/raspberrypi/linux/issues/4574
Fix it by falling back to rssi field if rx_lastpkt_rssi is not provided
(like it was before 9a1590934d9a).
Fixes: 9a1590934d9a ("brcmfmac: correctly report average RSSI in station info")
Signed-off-by: Alex Shumsky <alexthreed@gmail.com>
---
.../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 349aa3439502..8fc10858e936 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -3125,6 +3125,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
s32 total_rssi = 0;
s32 count_rssi = 0;
int rssi;
+ int rx_lastpkt_rssi;
u32 i;
brcmf_dbg(TRACE, "Enter, MAC %pM\n", mac);
@@ -3190,15 +3191,16 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
sinfo->rx_bytes = le64_to_cpu(sta_info_le.rx_tot_bytes);
}
for (i = 0; i < BRCMF_ANT_MAX; i++) {
- if (sta_info_le.rssi[i] == 0 ||
- sta_info_le.rx_lastpkt_rssi[i] == 0)
+ if (sta_info_le.rssi[i] == 0)
continue;
+ rx_lastpkt_rssi = sta_info_le.rx_lastpkt_rssi[i] != 0 ?
+ sta_info_le.rx_lastpkt_rssi[i] :
+ sta_info_le.rssi[i];
sinfo->chains |= BIT(count_rssi);
- sinfo->chain_signal[count_rssi] =
- sta_info_le.rx_lastpkt_rssi[i];
+ sinfo->chain_signal[count_rssi] = rx_lastpkt_rssi;
sinfo->chain_signal_avg[count_rssi] =
sta_info_le.rssi[i];
- total_rssi += sta_info_le.rx_lastpkt_rssi[i];
+ total_rssi += rx_lastpkt_rssi;
total_rssi_avg += sta_info_le.rssi[i];
count_rssi++;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] brcmfmac: fix RSSI report in AP mode
2024-11-22 21:03 [PATCH] brcmfmac: fix RSSI report in AP mode Alex Shumsky
@ 2024-11-25 11:58 ` Kalle Valo
2024-11-26 11:13 ` Arend van Spriel
1 sibling, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2024-11-25 11:58 UTC (permalink / raw)
To: Alex Shumsky
Cc: linux-wireless, Alexey Berezhok, Alvin Šipraga,
Arend van Spriel, Hector Martin, Janne Grunau, Kees Cook,
Neal Gompa, Wolfram Sang, brcm80211-dev-list.pdl, brcm80211,
linux-kernel
Alex Shumsky <alexthreed@gmail.com> writes:
> After commit 9a1590934d9a ("brcmfmac: correctly report average RSSI in
> station info") it is required from firmware to provide rx_lastpkt_rssi.
> If this field is not provided brcmfmac doesn't report any RSSI at all.
> Unfortunately some firmwares doesn't provide it. One example is firmware
> for BCM43455 found in Raspbberry Pi.
> See https://github.com/raspberrypi/linux/issues/4574
>
> Fix it by falling back to rssi field if rx_lastpkt_rssi is not provided
> (like it was before 9a1590934d9a).
>
> Fixes: 9a1590934d9a ("brcmfmac: correctly report average RSSI in station info")
> Signed-off-by: Alex Shumsky <alexthreed@gmail.com>
'wifi:' missing but I can add it, no need to resend because of this.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] brcmfmac: fix RSSI report in AP mode
2024-11-22 21:03 [PATCH] brcmfmac: fix RSSI report in AP mode Alex Shumsky
2024-11-25 11:58 ` Kalle Valo
@ 2024-11-26 11:13 ` Arend van Spriel
2024-12-09 21:08 ` Alex Shumsky
2024-12-17 18:54 ` Alex Shumsky
1 sibling, 2 replies; 7+ messages in thread
From: Arend van Spriel @ 2024-11-26 11:13 UTC (permalink / raw)
To: Alex Shumsky, linux-wireless
Cc: Alexey Berezhok, Alvin Šipraga, Hector Martin, Janne Grunau,
Kalle Valo, Kees Cook, Neal Gompa, Wolfram Sang,
brcm80211-dev-list.pdl, brcm80211, linux-kernel
On 11/22/2024 10:03 PM, Alex Shumsky wrote:
> After commit 9a1590934d9a ("brcmfmac: correctly report average RSSI in
> station info") it is required from firmware to provide rx_lastpkt_rssi.
> If this field is not provided brcmfmac doesn't report any RSSI at all.
> Unfortunately some firmwares doesn't provide it. One example is firmware
> for BCM43455 found in Raspbberry Pi.
> See https://github.com/raspberrypi/linux/issues/4574
>
> Fix it by falling back to rssi field if rx_lastpkt_rssi is not provided
> (like it was before 9a1590934d9a).
Sounds like a reasonable approach. However, I would like to learn more
about the issue. Maybe it is a per-vendor issue so I am interested what
the sta_info version is that we get from firmware. It is printed in
brcmf_cfg80211_get_station() with brcmf_dbg(). You can make it a
bphy_err() call instead or enable TRACE level debug messages in the driver.
Also would be good to know the firmware version and kernel version of
the BCM43455.
Regards,
Arend
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] brcmfmac: fix RSSI report in AP mode
2024-11-26 11:13 ` Arend van Spriel
@ 2024-12-09 21:08 ` Alex Shumsky
2024-12-09 21:43 ` KeithG
2024-12-17 18:54 ` Alex Shumsky
1 sibling, 1 reply; 7+ messages in thread
From: Alex Shumsky @ 2024-12-09 21:08 UTC (permalink / raw)
To: Arend van Spriel
Cc: linux-wireless, Alexey Berezhok, Alvin Šipraga,
Hector Martin, Janne Grunau, Kalle Valo, Kees Cook, Neal Gompa,
Wolfram Sang, brcm80211-dev-list.pdl, brcm80211, linux-kernel
On Tue, Nov 26, 2024 at 2:13 PM Arend van Spriel
<arend.vanspriel@broadcom.com> wrote:
>
> On 11/22/2024 10:03 PM, Alex Shumsky wrote:
> > After commit 9a1590934d9a ("brcmfmac: correctly report average RSSI in
> > station info") it is required from firmware to provide rx_lastpkt_rssi.
> > If this field is not provided brcmfmac doesn't report any RSSI at all.
> > Unfortunately some firmwares doesn't provide it. One example is firmware
> > for BCM43455 found in Raspbberry Pi.
> > See https://github.com/raspberrypi/linux/issues/4574
> >
> > Fix it by falling back to rssi field if rx_lastpkt_rssi is not provided
> > (like it was before 9a1590934d9a).
>
> Sounds like a reasonable approach. However, I would like to learn more
> about the issue. Maybe it is a per-vendor issue so I am interested what
> the sta_info version is that we get from firmware. It is printed in
> brcmf_cfg80211_get_station() with brcmf_dbg(). You can make it a
> bphy_err() call instead or enable TRACE level debug messages in the driver.
>
> Also would be good to know the firmware version and kernel version of
> the BCM43455.
>
> Regards,
> Arend
I've just checked sta version in trace logs:
brcmf_cfg80211_get_station version 4
Firmware I currently use:
BCM4345/6 wl0: Aug 29 2023 01:47:08 version 7.45.265 (28bca26 CY) FWID
01-b677b91b
https://github.com/murata-wireless/cyw-fmac-fw/blob/e024d0c0a3ab241f547cb44303de7e1b49f0ca78/cyfmac43455-sdio.bin
I'm not sure what firmware version is used in the raspberry pi distro.
From raspberry forums it looks, like:
Firmware: BCM4345/6 wl0: Nov 1 2021 00:37:25 version 7.45.241 (1a2f2fa
CY) FWID 01-703fd60
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] brcmfmac: fix RSSI report in AP mode
2024-12-09 21:08 ` Alex Shumsky
@ 2024-12-09 21:43 ` KeithG
0 siblings, 0 replies; 7+ messages in thread
From: KeithG @ 2024-12-09 21:43 UTC (permalink / raw)
To: Alex Shumsky
Cc: Arend van Spriel, linux-wireless, Alexey Berezhok,
Alvin Šipraga, Hector Martin, Janne Grunau, Kalle Valo,
Kees Cook, Neal Gompa, Wolfram Sang, brcm80211-dev-list.pdl,
brcm80211, linux-kernel
From my updated aarch64 RPiOS Bookworm as of today, it is:
Firmware: BCM4345/6 wl0: Aug 29 2023 01:47:08 version 7.45.265 (28bca26
CY) FWID 01-b677b91b
On Mon, Dec 9, 2024 at 3:08 PM Alex Shumsky <alexthreed@gmail.com> wrote:
>
> On Tue, Nov 26, 2024 at 2:13 PM Arend van Spriel
> <arend.vanspriel@broadcom.com> wrote:
> >
> > On 11/22/2024 10:03 PM, Alex Shumsky wrote:
> > > After commit 9a1590934d9a ("brcmfmac: correctly report average RSSI in
> > > station info") it is required from firmware to provide rx_lastpkt_rssi.
> > > If this field is not provided brcmfmac doesn't report any RSSI at all.
> > > Unfortunately some firmwares doesn't provide it. One example is firmware
> > > for BCM43455 found in Raspbberry Pi.
> > > See https://github.com/raspberrypi/linux/issues/4574
> > >
> > > Fix it by falling back to rssi field if rx_lastpkt_rssi is not provided
> > > (like it was before 9a1590934d9a).
> >
> > Sounds like a reasonable approach. However, I would like to learn more
> > about the issue. Maybe it is a per-vendor issue so I am interested what
> > the sta_info version is that we get from firmware. It is printed in
> > brcmf_cfg80211_get_station() with brcmf_dbg(). You can make it a
> > bphy_err() call instead or enable TRACE level debug messages in the driver.
> >
> > Also would be good to know the firmware version and kernel version of
> > the BCM43455.
> >
> > Regards,
> > Arend
>
> I've just checked sta version in trace logs:
> brcmf_cfg80211_get_station version 4
>
> Firmware I currently use:
> BCM4345/6 wl0: Aug 29 2023 01:47:08 version 7.45.265 (28bca26 CY) FWID
> 01-b677b91b
> https://github.com/murata-wireless/cyw-fmac-fw/blob/e024d0c0a3ab241f547cb44303de7e1b49f0ca78/cyfmac43455-sdio.bin
>
> I'm not sure what firmware version is used in the raspberry pi distro.
> From raspberry forums it looks, like:
> Firmware: BCM4345/6 wl0: Nov 1 2021 00:37:25 version 7.45.241 (1a2f2fa
> CY) FWID 01-703fd60
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] brcmfmac: fix RSSI report in AP mode
2024-11-26 11:13 ` Arend van Spriel
2024-12-09 21:08 ` Alex Shumsky
@ 2024-12-17 18:54 ` Alex Shumsky
2024-12-17 19:45 ` Arend van Spriel
1 sibling, 1 reply; 7+ messages in thread
From: Alex Shumsky @ 2024-12-17 18:54 UTC (permalink / raw)
To: Arend van Spriel
Cc: linux-wireless, Alexey Berezhok, Alvin Šipraga,
Hector Martin, Janne Grunau, Kalle Valo, Kees Cook, Neal Gompa,
Wolfram Sang, brcm80211-dev-list.pdl, brcm80211, linux-kernel
On Tue, Nov 26, 2024 at 2:13 PM Arend van Spriel
<arend.vanspriel@broadcom.com> wrote:
>
> On 11/22/2024 10:03 PM, Alex Shumsky wrote:
> > After commit 9a1590934d9a ("brcmfmac: correctly report average RSSI in
> > station info") it is required from firmware to provide rx_lastpkt_rssi.
> > If this field is not provided brcmfmac doesn't report any RSSI at all.
> > Unfortunately some firmwares doesn't provide it. One example is firmware
> > for BCM43455 found in Raspbberry Pi.
> > See https://github.com/raspberrypi/linux/issues/4574
> >
> > Fix it by falling back to rssi field if rx_lastpkt_rssi is not provided
> > (like it was before 9a1590934d9a).
>
> Sounds like a reasonable approach. However, I would like to learn more
> about the issue. Maybe it is a per-vendor issue so I am interested what
> the sta_info version is that we get from firmware. It is printed in
> brcmf_cfg80211_get_station() with brcmf_dbg(). You can make it a
> bphy_err() call instead or enable TRACE level debug messages in the driver.
>
> Also would be good to know the firmware version and kernel version of
> the BCM43455.
>
> Regards,
> Arend
Hi Arend,
Is the info I have provided sufficient?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] brcmfmac: fix RSSI report in AP mode
2024-12-17 18:54 ` Alex Shumsky
@ 2024-12-17 19:45 ` Arend van Spriel
0 siblings, 0 replies; 7+ messages in thread
From: Arend van Spriel @ 2024-12-17 19:45 UTC (permalink / raw)
To: Alex Shumsky
Cc: linux-wireless, Alexey Berezhok, Alvin Šipraga,
Hector Martin, Janne Grunau, Kalle Valo, Kees Cook, Neal Gompa,
Wolfram Sang, brcm80211-dev-list.pdl, brcm80211, linux-kernel
On 12/17/2024 7:54 PM, Alex Shumsky wrote:
> On Tue, Nov 26, 2024 at 2:13 PM Arend van Spriel
> <arend.vanspriel@broadcom.com> wrote:
>>
>> On 11/22/2024 10:03 PM, Alex Shumsky wrote:
>>> After commit 9a1590934d9a ("brcmfmac: correctly report average RSSI in
>>> station info") it is required from firmware to provide rx_lastpkt_rssi.
>>> If this field is not provided brcmfmac doesn't report any RSSI at all.
>>> Unfortunately some firmwares doesn't provide it. One example is firmware
>>> for BCM43455 found in Raspbberry Pi.
>>> See https://github.com/raspberrypi/linux/issues/4574
>>>
>>> Fix it by falling back to rssi field if rx_lastpkt_rssi is not provided
>>> (like it was before 9a1590934d9a).
>>
>> Sounds like a reasonable approach. However, I would like to learn more
>> about the issue. Maybe it is a per-vendor issue so I am interested what
>> the sta_info version is that we get from firmware. It is printed in
>> brcmf_cfg80211_get_station() with brcmf_dbg(). You can make it a
>> bphy_err() call instead or enable TRACE level debug messages in the driver.
>>
>> Also would be good to know the firmware version and kernel version of
>> the BCM43455.
>>
>> Regards,
>> Arend
>
> Hi Arend,
>
> Is the info I have provided sufficient?
I am missing the kernel version and whether it is upstream kernel or not.
Regards,
Arend
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-12-17 19:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-22 21:03 [PATCH] brcmfmac: fix RSSI report in AP mode Alex Shumsky
2024-11-25 11:58 ` Kalle Valo
2024-11-26 11:13 ` Arend van Spriel
2024-12-09 21:08 ` Alex Shumsky
2024-12-09 21:43 ` KeithG
2024-12-17 18:54 ` Alex Shumsky
2024-12-17 19:45 ` Arend van Spriel
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).