Repository navigation
wifi: brcmfmac: report a failed join against the BSS it asked for - #1024
Merged
Merged
Conversation
A failed station join is reported to cfg80211 against profile->bssid (brcmf_bss_connect_done()). That field is only set when the firmware reports a successful join, so after any earlier association a failure names the BSS the interface was last associated with, not the one it tried. wpa_supplicant puts the reported BSS on its ignore list. On an M2 and M1 Pro after s2idle resume it tried the 2.4 GHz BSS of the home AP, which the firmware cannot join; every timeout was blamed on the 5 GHz BSS it had just left. wpa_supplicant ignored the working BSS for 10, then 60, then 120 seconds while it kept retrying the failing one, until NetworkManager gave up and restarted the connection: Wi-Fi came back 18 to 21 seconds after most resumes. Record the BSS a join asks for when it starts, or none. The firmware's SET_SSID success still overwrites it with the BSS it joined. A join that asked for no BSS and failed names none. Add host controls for the reported BSS on failure, success and the firmware supplicant path, with mutations for a stale target, a zero BSSID reported as a BSS, and a connect handler that does not record its target. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This was referenced Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a suspend that disconnects Wi-Fi, the M2 and M1 Pro took 18 to 21 s to get back on the network on most resumes.
A failed join is reported to cfg80211 against profile->bssid, and that field is only set when a join succeeds. So every failure was blamed on the BSS the Mac was last connected to.
What happens on the test network: wpa_supplicant ignores the 5 GHz BSS for 10 s after our own suspend disconnect and tries the router's 2.4 GHz BSS instead. That router band-steers, so the 2.4 GHz join always times out (a pinned 2.4 GHz join fails without any suspend too). Each timeout was reported against the 5 GHz BSS, so wpa_supplicant kept pushing the working BSS further down its ignore list (10, 60, 120 s) and kept retrying the failing one until NetworkManager's 15 s link timeout reset everything. kprobes on the join path showed the join going to the 2.4 GHz BSSID while the reject named the 5 GHz one.
Now the connect handler records the BSS it asks the firmware to join, or none. A successful join still overwrites it with what the firmware reports. On a failure wpa_supplicant now ignores the BSS that was tried and goes back to 5 GHz.
Tested with fleet17 + this, one-shot boots:
New host test brcmf-join-bssid-tests.py covers failure, success and the firmware supplicant path, with three mutations that it catches. The old code fails it. Full host suite 189/189.
The remaining ~4 s is NetworkManager rescanning after wake. Keeping the association across suspend, as macOS does, would need WoWLAN, which this firmware doesn't advertise here.
🤖 Generated with Claude Code