From: Jan Stary Subject: Re: bwfm fixes To: tech@openbsd.org Date: Fri, 15 Aug 2025 15:35:10 +0200 On Aug 04 20:19:08, mbuhl@openbsd.org wrote: > Dear tech, > > I currently use a MacBook m2 and I always have trouble with the > bwfm in it. > > Here are three fixes: > 1. receive EAPOL event messages. > After debugging this for a few days, I noticed that EAPOL frames > do not cause an interrupt and with my macbook the messag either > comes with the previous WL_EVENTS that change the link state and > finish the ASSOC state, or the firmware crashes about 100ms later. > > I can imagine this may also help with crashes in AP mode on other > devices. > > 2. do ieee80211 state changes inside of the interrupt handler. > To my understanding this is in line with outher drivers and it is > necessary for the wpa handshake to process it within 100 ms which > we could miss because of the additional queueing. > > 3. process control messages before rx messages. > Otherwise a EAPOL frame could be processed before changing from > ASSOC to RUN. > > I would appreciate additional testing on other devices. Testing on MacMook Air M1 (dmesg below) with bwfm0 at pci1 dev 0 function 0 "Broadcom BCM4378" rev 0x03: msi I don't see any regression. Generaly, I used to see drops and reconnects on various eduroam networks bwfm0: Associated with 00:00:00:00:00:00 bwfm0: Authentication with 00:00:00:00:00:00 timed out. bwfm0: No network configuration found for the current AP bwfm0: CTRL-EVENT-DISCONNECTED bssid=f4:f2:6d:53:e8:98 reason=3 locally_generated=1 bwfm0: CTRL-EVENT-TERMINATING I will let it run like this for a couple of days. Thanks, Jan OpenBSD 7.7-current (GENERIC.MP) #0: Fri Aug 15 15:17:00 CEST 2025 hans@mb.stare.cz:/usr/src/sys/arch/arm64/compile/GENERIC.MP real mem = 7996813312 (7626MB) avail mem = 7624105984 (7270MB) random: good seed from bootblocks mainbus0 at root: Apple MacBook Air (M1, 2020) efi0 at mainbus0: UEFI 2.10 efi0: Das U-Boot rev 0x20240100 cpu0 at mainbus0 mpidr 0: Apple Icestorm r1p1 cpu0: 128KB 64b/line 8-way L1 VIPT I-cache, 64KB 64b/line 8-way L1 D-cache cpu0: 4096KB 128b/line 16-way L2 cache cpu0: TLBIOS+IRANGE,TS+AXFLAG,FHM,DP,SHA3,RDM,Atomic,CRC32,SHA2+SHA512,SHA1,AES+PMULL,SPECRES,SB,FRINTTS,GPI,LRCPC+LDAPUR,FCMA,JSCVT,API+EPAC,DPB+DCCVADP,SpecSEI,PAN+ATS1E1,LO,HPDS,VH,IDS,AT,CSV3,CSV2,DIT,RAS,AdvSIMD+HP,FP+HP,SSBS+MSR cpu1 at mainbus0 mpidr 1: Apple Icestorm r1p1 cpu1: 128KB 64b/line 8-way L1 VIPT I-cache, 64KB 64b/line 8-way L1 D-cache cpu1: 4096KB 128b/line 16-way L2 cache cpu2 at mainbus0 mpidr 2: Apple Icestorm r1p1 cpu2: 128KB 64b/line 8-way L1 VIPT I-cache, 64KB 64b/line 8-way L1 D-cache cpu2: 4096KB 128b/line 16-way L2 cache cpu3 at mainbus0 mpidr 3: Apple Icestorm r1p1 cpu3: 128KB 64b/line 8-way L1 VIPT I-cache, 64KB 64b/line 8-way L1 D-cache cpu3: 4096KB 128b/line 16-way L2 cache cpu4 at mainbus0 mpidr 10100: Apple Firestorm r1p1 cpu4: 192KB 64b/line 6-way L1 VIPT I-cache, 128KB 64b/line 8-way L1 D-cache cpu4: 12288KB 128b/line 12-way L2 cache cpu5 at mainbus0 mpidr 10101: Apple Firestorm r1p1 cpu5: 192KB 64b/line 6-way L1 VIPT I-cache, 128KB 64b/line 8-way L1 D-cache cpu5: 12288KB 128b/line 12-way L2 cache cpu6 at mainbus0 mpidr 10102: Apple Firestorm r1p1 cpu6: 192KB 64b/line 6-way L1 VIPT I-cache, 128KB 64b/line 8-way L1 D-cache cpu6: 12288KB 128b/line 12-way L2 cache cpu7 at mainbus0 mpidr 10103: Apple Firestorm r1p1 cpu7: 192KB 64b/line 6-way L1 VIPT I-cache, 128KB 64b/line 8-way L1 D-cache cpu7: 12288KB 128b/line 12-way L2 cache "asc-firmware" at mainbus0 not configured "asc-firmware" at mainbus0 not configured "framebuffer" at mainbus0 not configured "region95" at mainbus0 not configured "region94" at mainbus0 not configured "region57" at mainbus0 not configured "dcp_data" at mainbus0 not configured "flash" at mainbus0 not configured "flash" at mainbus0 not configured "uat-handoff" at mainbus0 not configured "uat-pagetables" at mainbus0 not configured "uat-ttbs" at mainbus0 not configured "isp-heap" at mainbus0 not configured apm0 at mainbus0 "opp-table-0" at mainbus0 not configured "opp-table-1" at mainbus0 not configured "opp-table-gpu" at mainbus0 not configured agtimer0 at mainbus0: 24000 kHz "pmu-e" at mainbus0 not configured "pmu-p" at mainbus0 not configured "clock-ref" at mainbus0 not configured "clock-120m" at mainbus0 not configured "clock-200m" at mainbus0 not configured "clock-disp0" at mainbus0 not configured "clock-dispext0" at mainbus0 not configured "clock-ref-nco" at mainbus0 not configured simplebus0 at mainbus0: "soc" aplpmgr0 at simplebus0 aplpmgr1 at simplebus0 aplmbox0 at simplebus0 apldart0 at simplebus0: 32 bits apldart1 at simplebus0: 32 bits, locked apldart2 at simplebus0: 32 bits, locked aplmbox1 at simplebus0 apldart3 at simplebus0: 32 bits, bypass apldart4 at simplebus0: 32 bits apldart5 at simplebus0: 32 bits apldart6 at simplebus0: 32 bits, bypass aplintc0 at simplebus0 nirq 896 ndie 1 aplpinctrl0 at simplebus0 aplpinctrl1 at simplebus0 apldog0 at simplebus0 aplmbox2 at simplebus0 aplpinctrl2 at simplebus0 aplpinctrl3 at simplebus0 aplmbox3 at simplebus0 aplefuse0 at simplebus0 apldart7 at simplebus0: 32 bits, bypass apldart8 at simplebus0: 32 bits, bypass apldart9 at simplebus0: 32 bits, bypass apldart10 at simplebus0: 32 bits, bypass apldart11 at simplebus0: 32 bits "gpu" at simplebus0 not configured aplcpu0 at simplebus0 aplcpu1 at simplebus0 apldcp0 at simplebus0 apldrm0 at simplebus0 drm0 at apldrm0 "isp" at simplebus0 not configured apliic0 at simplebus0 iic0 at apliic0 tipd0 at iic0 addr 0x38 tipd1 at iic0 addr 0x3f apliic1 at simplebus0 iic1 at apliic1 tascodec0 at iic1 addr 0x31 apliic2 at simplebus0 iic2 at apliic2 tascodec1 at iic2 addr 0x34 "cirrus,cs42l83" at iic2 addr 0x48 not configured aplpwm0 at simplebus0 aplspi0 at simplebus0 aplspi1 at simplebus0 aplhidev0 at aplspi1 aplkbd0 at aplhidev0: 8 variable keys, 6 key codes wskbd0 at aplkbd0: console keyboard aplms0 at aplhidev0 wsmouse0 at aplms0 mux 0 exuart0 at simplebus0 exuart1 at simplebus0 apldma0 at simplebus0 aplmca0 at simplebus0 aplnco0 at simplebus0 aplspmi0 at simplebus0 aplpmu0 at aplspmi0 sid 0xf aplsmc0 at simplebus0 aplsart0 at simplebus0 aplns0 at simplebus0 nvme0 at aplns0: NVMe 1.1 nvme0: APPLE SSD AP0256Q, firmware 532.140., serial 0ba016e96434ee18 scsibus0 at nvme0: 2 targets, initiator 0 sd0 at scsibus0 targ 1 lun 0: sd0: 239372MB, 4096 bytes/sector, 61279344 sectors xhci0 at simplebus0, xHCI 1.10 usb0 at xhci0: USB revision 3.0 uhub0 at usb0 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1 "phy" at simplebus0 not configured xhci1 at simplebus0, xHCI 1.10 usb1 at xhci1: USB revision 3.0 uhub1 at usb1 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1 "phy" at simplebus0 not configured aplpcie0 at simplebus0 pci0 at aplpcie0 ppb0 at pci0 dev 0 function 0 "Apple M1 PCIe" rev 0x01 pci1 at ppb0 bus 1 bwfm0 at pci1 dev 0 function 0 "Broadcom BCM4378" rev 0x03: msi vendor "Broadcom", unknown product 0x5f69 (class network subclass miscellaneous, rev 0x03) at pci1 dev 0 function 1 not configured pwmleds0 at mainbus0 "fixed-regulator-tas5770-sdz" at mainbus0 not configured aplaudio0 at mainbus0 audio0 at aplaudio0 vscsi0 at root scsibus1 at vscsi0: 256 targets softraid0 at root scsibus2 at softraid0: 256 targets root on sd0a (0f72c500fa6fee6b.a) swap on sd0b dump on sd0b apldrm0: 2560x1600, 32bpp wsdisplay0 at apldrm0 mux 1: console (std, vt100 emulation), using wskbd0 wsdisplay0: screen 1-5 added (std, vt100 emulation) bwfm0: address d4:57:63:c6:35:69 "framebuffer" at mainbus0 not configured