brcmfmac disconnects when iwd scans

KeithG <[email protected]> Tue, 22 Apr 2025 20:00:05 -0500
Newsgroups dev.linux.lists.iwd
Message-ID <CAG17S_M4_+CR1uSsajyvHBjig6cfCuxegipnHREhk1sXjSyOsA@mail.gmail.com>
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

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
It is only with iwd that the network goes down when iwd scans for ssids.
iwctl station wlan0 scan

This is what it shows in the log (with brcmfmac debug) when it scans:
lost of scan redults above then:
Apr 22 18:27:24 pi4 hostapd[32625]: ap0: STA 50:84:92:a6:7a:7a IEEE
802.11: disassociated
Apr 22 18:27:24 pi4 hostapd[32625]: ap0: STA 50:84:92:a6:7a:7a IEEE
802.11: disassociated
Apr 22 18:27:24 pi4 kernel: brcmfmac: brcmf_rx_event Enter:
mmc1:0001:1: rxp=00000000a28ac6b0
Apr 22 18:27:24 pi4 kernel: brcmfmac: brcmf_rx_event Enter:
mmc1:0001:1: rxp=00000000a28ac6b0
Apr 22 18:27:24 pi4 kernel: brcmfmac: brcmf_fweh_event_worker event
DEAUTH_IND (6:6) ifidx 1 bsscfg 1 addr 50:84:92:a6:7a:7a
Apr 22 18:27:24 pi4 kernel: brcmfmac: brcmf_fweh_event_worker
version 2 flags 0 status 0 reason 4
Apr 22 18:27:24 pi4 kernel: brcmutil: event payload, len=2
Apr 22 18:27:24 pi4 kernel: 00000000: 04 00
                ..
Apr 22 18:27:24 pi4 kernel: brcmfmac: brcmf_fweh_event_worker event
DISASSOC_IND (12:12) ifidx 1 bsscfg 1 addr 50:84:92:a6:7a:7a
Apr 22 18:27:24 pi4 kernel: brcmfmac: brcmf_fweh_event_worker
version 2 flags 0 status 0 reason 8
Apr 22 18:27:24 pi4 kernel: brcmutil: event payload, len=0
Apr 22 18:27:24 pi4 kernel: brcmfmac: CONSOLE: 001705.564 wl0:
wlc_recvfilter: scb is null, dont resend deauth
Apr 22 18:27:24 pi4 hostapd[32625]: ap0: STA 50:84:92:a6:7a:7a IEEE
802.11: disassociated
Apr 22 18:27:24 pi4 kernel: brcmfmac: brcmf_rx_event Enter:
mmc1:0001:1: rxp=00000000102035b7
Apr 22 18:27:24 pi4 kernel: brcmfmac: brcmf_fweh_event_worker event
DEAUTH (5:5) ifidx 1 bsscfg 1 addr 50:84:92:a6:7a:7a
Apr 22 18:27:24 pi4 kernel: brcmfmac: brcmf_fweh_event_worker
version 2 flags 0 status 0 reason 7
Apr 22 18:27:24 pi4 kernel: brcmutil: event payload, len=0
Apr 22 18:27:25 pi4 kernel: brcmfmac: CONSOLE: 001705.683 wl0:
wlc_recvfilter: scb is null, dont resend deauth
Apr 22 18:27:25 pi4 kernel: brcmfmac: brcmf_rx_event Enter:
mmc1:0001:1: rxp=00000000baa46293