Re: brcmfmac disconnects when iwd scans

KeithG <[email protected]> Wed, 23 Apr 2025 19:52:14 -0500
Newsgroups dev.linux.lists.iwd
Message-ID <CAG17S_MKZXf3vC0zgaK_MUrA1nqRzhGcPGUho873KU3jYVShXw@mail.gmail.com>
On Wed, Apr 23, 2025 at 9:42 AM Denis Kenzior <[email protected]> wrote:
>
> Hi Keith,
>
> On 4/22/25 8:00 PM, KeithG wrote:
> > I ran into this a while back and James came up with a few patches that
> > I have been using to keep it from restarting the AP0 interface.
> > [PATCH 1/3] station: remove scan subsets for dbus scans
> > [PATCH 2/3] eap: fix compile issue on ARM/GCC 12
> > [PATCH 3/3] scan: use ifindex and only active scans
>
> Likely this is the fix.  Passive scans take too long to remain off-channel.
>
> >
> > These no longer seem to work with current builds of iwd from git. I am
> > running iwd 3.6.r10.g4ded663e. My kernel is 6.12.20. The firmware is:
> > [    3.496006] brcmfmac: brcmf_fw_alloc_request: using
> > brcm/brcmfmac43455-sdio for chip BCM4345/6
> > [    3.839254] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6
> > wl0: Oct 28 2024 23:27:00 version 7.45.286 (be70ab3 CY) FWID
> > 01-95efe7fa
> >
> > I get the same response with the firmware that ships with RPiOS,
> > 7.45.265 as well. I am building a fresh kernel to be able to get iwmon
> > data and should be able to do so tomorrow.
> >
> > This flakiness of ap0 happens regardless if I use iwd or hostap to
> > bring up ap0. When I use hostapd, I use this to bring up the
> > interface:
> >
> > iw dev wlan0 interface add ap0 type __ap
> > ip link set dev ap0 address d8:3a:dd:60:a3:cg
> > systemctl start hostapd
> > systemctl start dnsmasq
> > ip addr add 192.168.5.1/24 broadcast 192.168.5.255 dev ap0
> >
> > With this, I can have the ap0 up and can scan on wlan0 with the single
> > brcmfmac card. If I use wpa_supplicant, ap0 does not go down when
> > wpa_supplicant scans for ssids.
> > iw wlan0 scan
>
> This uses an active scan.  See what happens with
> 'iw wlan0 scan passive'
>
> > It is only with iwd that the network goes down when iwd scans for ssids.
> > iwctl station wlan0 scan
>
> iwd uses active scans when connected or if the hardware is capable of
> anonymizing the active scan.   Otherwise it uses a passive scan.
>
> Regards,
> -Denis

Denis,

I am building iwd from git with those 3 patches and every time it
scans, it disconnects the AP.
When I use wpa_supplicant, it does not disconnect regardless of using:
iw wlan0 scan passive
or
iw wlan0 scan

it is only with iwd that it disconnects and only with iwctl. If I run
'iw wlan0 scan passive' or
'iw wlan0 scan' when iwd is running and wpa_aupplicant is removed, It
seems to be OK.
My laptop shows a disconnect, sometimes, but when I check the wlan0 on
the laptop
it is still connected to the ap running on the RPi. I think it looses
the connection for a
second but reconnects. If I run the 'iwctl station wlan0 scan' it will
disconnect and not reconnect.
When it does, the ap0 gets to a strange state as it takes a number of
attempts to get it to
reconnect and sometimes it requires a tear down and restart of ap0
before I can reconnect

This is an iwmon log of my RPi.
https://drive.google.com/file/d/1WNZz0dOip0XZZVIOs7RGcYIeLY2W4bXC/view?usp=sharing
I had connected to it from my laptop. I then ran:

# iw wlan0 scan
# iw wlan0 scan passive
# iwctl station wlan0 scan

after I ran the last command, the Pi's ap0 disconnected from my laptop.

Keith