omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

BCM43602 (MacBookPro11,4): timezone-derived WIRELESS_REGDOM="UA" removes 802.11ac (VHT) at brcmfmac load

Open akopitsa opened this issue 1 month ago • 4 comments

System details

Intel i7-4770HQ, Intel Iris Pro (Crystal Well), MacBookPro11,4 (Mid-2015 15"), BCM43602 [14e4:43ba] (Apple subsystem 106b:0152) on brcmfmac, firmware 7.35.177.61 from linux-firmware-broadcom 20260810-2, no NVRAM/CLM blob, Omarchy 4.0.4-1, kernel 7.2.5-3-omarchy

What's wrong?

install/hardware/set-wireless-regdom.sh sets the regulatory domain from the timezone. With Europe/Kyiv it writes WIRELESS_REGDOM="UA" to /etc/conf.d/wireless-regdom, and wireless-regdb's 85-regulatory.rules applies it on every boot. On this BCM43602 firmware, when UA is the user regdomain at the moment brcmfmac loads, the adapter loses 802.11ac completely. iw list has no VHT lines, Band 2 shows Capabilities: 0x1062 (HT40, no VHT), and the Mac stays on 2.4 GHz at 802.11n/g rates.

For each value: iw reg set <cc>, reload brcmfmac, count VHT lines, then force a join to the 5 GHz BSSID (nmcli connection up id <ssid> ap <5 GHz BSSID>):

User regdom at driver load iw list | grep -c VHT Joins the 5 GHz AP
UA (tested twice) 0 –
US 6 yes (5300 MHz, ch 60)
DE 6 yes (5300 MHz, ch 60)
00 (world) 6 no: ASSOC-REJECT status_code=16 (world domain marks 5 GHz no-initiate)
  • Changing the regdomain after the driver has loaded doesn't help. iw reg set US/DE/00 on a live driver left VHT at 0. Only a reload under a non-UA regdomain brings it back.
  • This doesn't depend on NetworkManager. With NetworkManager and wpa_supplicant stopped, a reload under UA still gave VHT=0 for the whole polling window.
  • The feature_disable value doesn't change it either. Under UA, VHT is missing with both 0x82000 and 0.

Correction to #13164

I now think the missing VHT I reported in #13164 was caused by this regdomain issue, not by the feature_disable=0x82000 quirk. My warm reloads with feature_disable=0 brought VHT back only because an earlier iw reg set experiment had left the user regdomain at something other than UA. On the next boot udev set UA again, and VHT was gone however many times I reloaded. Under a non-UA regdomain, a reload with 0x82000 does show VHT. That matches the MacBookPro11,5 datapoint in the #13164 comments. In that one run the card associated on 2.4 GHz instead of 5 GHz, but I didn't repeat the test with a band pin. Whether the quirk itself blocks 5 GHz on a WPA2/WPA3 transition network is not confirmed yet.

Steps to reproduce

  1. BCM43602 Mac with stock firmware and no CLM blob. Install Omarchy with timezone Europe/Kyiv, so /etc/conf.d/wireless-regdom contains WIRELESS_REGDOM="UA".
  2. Boot, then run iw list | grep -c VHT. It prints 0.
  3. sudo iw reg set DE && sudo modprobe -r brcmfmac_wcc brcmfmac && sudo modprobe brcmfmac, then run iw list | grep -c VHT. It prints 6.
  4. sudo iw reg set UA && sudo modprobe -r brcmfmac_wcc brcmfmac && sudo modprobe brcmfmac, then run iw list | grep -c VHT. It prints 0.

Verified workaround

Replace the derived value in /etc/conf.d/wireless-regdom:

WIRELESS_REGDOM="DE"

DE uses the EU/ETSI rules, the closest to Ukraine's. US also works. set-wireless-regdom.sh exits early when a WIRELESS_REGDOM= line already exists, so the change survives updates. It has held across reboots for two weeks: iw list | grep -c VHT = 6, and the Mac is associated to the 5 GHz BSSID at 5260 MHz. (The Country IE mitigation from #13168 is also in place on this machine. That one is a separate failure, where the link drops within a minute of joining.)

Possible fix

  • In set-wireless-regdom.sh, or in an Apple Broadcom quirk next to fix-brcmfmac-supplicant.sh: on BCM43602 (14e4:43ba), when the derived country is one this firmware mishandles (UA is confirmed), write a working country from the same regulatory family instead, such as an ETSI country, with a comment explaining why.
  • Don't fall back to 00, because it blocks 5 GHz association on this firmware.
  • I only tested UA, US, DE and 00. Other countries may be affected too. A BCM43602 NVRAM/CLM file (#7672) might make the firmware accept UA, but I haven't tested that.

Related: #13164, #13168, #9019, #7672

akopitsa avatar Oct 10 '26 07:10 akopitsa

US-regdomain control from identical hardware (MacBookPro11,5, BCM43602 14e4:43ba subsys 106b:0152, fw 7.35.177.61, linux-firmware-broadcom 20260810-2, 7.2.8-1-omarchy):

  • /etc/conf.d/wireless-regdom: WIRELESS_REGDOM="US" (installer-derived from America/Los_Angeles)
  • /etc/modprobe.d/brcmfmac.conf: options brcmfmac feature_disable=0x82000
  • iw reg get: global US (DFS-FCC); iw list | grep -c VHT = 6
  • Associated 5 GHz: ch149/5745 MHz, 40 MHz, 400/400 Mbit/s, -41 dBm
  • AP Country IE here is US (CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE alpha2=US), no drop

Matches the corrected model in https://github.com/omacom/omarchy/issues/13164: quirk + non-UA -> VHT present. Deliberately no reload repro here (unload during a timeout cascade oopses in _cfg80211_unregister_wdev; this kernel predates upstream 08a3f02).

rand0mdud3 avatar Oct 17 '26 21:10 rand0mdud3

Thanks for running the sweep and for correcting #13164. I read this against current quattro. As second opinions, Codex Medium and muse-spark-1.3-contributor (via pi, thinking high) reviewed the same. Nothing ran on a worker, because the missing VHT needs your BCM43602 and its firmware, and a VM has neither.

Where UA comes from in Omarchy. This part is confirmed in source. install/hardware/set-wireless-regdom.sh can't take a country from the first part of Europe/Kyiv, so it looks the timezone up in zone.tab, gets UA, and appends WIRELESS_REGDOM="UA" to /etc/conf.d/wireless-regdom (lines 16–23). wireless-regdb's 85-regulatory.rules then applies it every time cfg80211 loads. On a deferred install, bin/omarchy-provision-owner (configure_wireless_regdom, line 945) runs the same script after the owner picks a timezone and applies the result live. That script is the only thing in the repository that chooses a country. The Apple quirk (install/hardware/apple/fix-brcmfmac-supplicant.sh, migration 1786391100.sh) only writes feature_disable=0x82000 and never touches the regulatory domain, which fits your 0x82000-vs-0 result under UA and @rand0mdud3's 11,5 datapoint under US.

Why the firmware drops VHT under UA. This is still open. Your controlled sweep is the evidence, and I couldn't reproduce it. The Codex review pointed out that upstream brcmfmac gates VHT on the firmware's vhtmode and re-runs band setup after a country change. So "the firmware's built-in UA locale has no 80 MHz" doesn't explain on its own why only a reload brings VHT back. The likely cause is firmware locale handling without a CLM blob, but that isn't established.

Not a duplicate, and no fix to try yet. #13164 is the same symptom, but its cause is now this one, and it's tracked here. Open PR #11748 doesn't fix this: it writes the saved country (UA on your machine) as cfg80211.ieee80211_regdom, so it applies the same value earlier. I haven't drafted a fix, because every option is a regulatory choice rather than a correction. Writing DE for someone in Ukraine sets a jurisdiction they aren't in. Leaving the domain unset falls back to 00, which you showed rejects 5 GHz association. Picking which countries count as "mishandled" from one confirmed value is also a judgement call. Both reviewers agreed this needs a decision rather than a patch.

This is waiting on the maintainer to decide whether Omarchy should substitute a country on this chip, and if so which one. Until then, your WIRELESS_REGDOM="DE" workaround in /etc/conf.d/wireless-regdom survives updates, because the script leaves an existing line alone. If you have time: does a reload under another non-EU/US ETSI country (MD or GE, say) show VHT? That would show whether UA is special or whether the firmware only knows a short list of countries.

omarchybot avatar Oct 22 '26 08:10 omarchybot

Another BCM43602 datapoint: on MacBookPro14,3 with timezone Asia/Seoul, the derived WIRELESS_REGDOM="KR" is also mishandled by this firmware — and here it takes out 2.4 GHz as well as 802.11ac, not just VHT.

System details

  • MacBookPro14,3 (2017 Touch Bar), BCM43602 [14e4:43ba] (Apple subsystem 106b:0173) on brcmfmac
  • Omarchy 4.5.0-3, kernel 7.2.15-1-omarchy, linux-firmware 20260916-1
  • Firmware 7.35.177.61 (2015), no CLM/txcap blob; feature_disable=0x82000 quirk present
  • /etc/conf.d/wireless-regdom derived from timezone: WIRELESS_REGDOM="KR"

Before any fix

iw phy showed only Band 1 with every channel (disabled) and no Band 2; iw list | grep -c VHT = 0; wpa_supplicant logged CTRL-EVENT-SCAN-FAILED ret=-22; nmcli device wifi list was empty. Internet was only available through a USB-tethered phone.

I then installed the calibrated NVRAM from #7671 under /usr/lib/firmware/updates/brcm/. That restored 5 GHz only (e.g. U+NetD54C_5G, ch 149) but left 2.4 GHz disabled and VHT at 0 — so the NVRAM alone does not address the regdomain problem.

Controlled regdom comparison (NVRAM installed, brcmfmac reloaded for each value)

User regdom at driver load iw list | grep -c VHT 2.4 GHz 5 GHz Visible APs
KR 0 all channels disabled ch 149–161 only U+NetD54C_5G only
US 6 ch 1–11 enabled (20 dBm) ch 36–165 enabled (DFS incl.) U+NetD54C (ch 1) and U+NetD54C_5G (ch 149)

As in #14828, iw reg set US on an already-loaded driver did not bring VHT/2.4 GHz back; the driver had to be reloaded while the user regdom was US. iw reg get also showed phy#1 country 99: DFS-UNSET under KR.

Verified workaround here

Both of these were needed to make it survive a cold boot:

# /etc/conf.d/wireless-regdom
WIRELESS_REGDOM="US"
# /etc/modprobe.d/cfg80211.conf
options cfg80211 ieee80211_regdom=US

The second one avoids the boot-time race where brcmfmac loads before the udev rule applies the saved country (same class of issue as #9019). Current state: country US: DFS-FCC, VHT = 6, 2.4 GHz ch 1–11 and 5 GHz ch 36–165 enabled, both AP bands scanning normally.

Suggested fix

Please add KR to the countries this firmware mishandles in set-wireless-regdom.sh / the Apple Broadcom quirk, mapping it to a working country from the same regulatory family (US works and stays within the calibrated 20 dBm ceiling). Pinning the initial cfg80211 regdom on BCM43602 would also close the boot-order race. As noted in #14828, do not fall back to 00 — it blocks 5 GHz association on this firmware.

Related: #14828, #9019, #7671, #13168

unfill avatar Dec 02 '26 11:12 unfill

Codex High reviewed the current installer and the MacBookPro14,3 reload results with Opus 5.5 High and muse-wonder via pi, thinking high. With the same board calibration in place, the report still shows all 2.4 GHz channels disabled and no 802.11ac under KR. #11748 applies the saved country earlier. An automatic switch to US would change the radio limits because the two domains use different channel and radar-detection rules. Linux wireless regulatory database

@unfill, if you have logs from a failing KR boot, could you share the brcmfmac and cfg80211 lines from journalctl -k -b and the full iw reg get output from the same boot? Opus pointed out that the per-device 99 value identifies the driver’s built-in domain. The log and global domain can help tell whether KR reached the driver and whether the firmware rejected it. Verification requires a physical BCM43602, and the issue remains open for a fix that preserves the local country.

omarchybot avatar Dec 02 '26 11:12 omarchybot