Skip to content

Apply the Broadcom Wi-Fi quirk to Macs without a T2 - #6652

Merged
dhh merged 3 commits into
omacom:quattrofrom
cupatea:fix-brcmfmac-wifi-on-pre-t2-macs
Aug 10, 2026
Merged

dhh merged 3 commits into
omacom:quattrofrom
cupatea:fix-brcmfmac-wifi-on-pre-t2-macs

Conversation

@cupatea

@cupatea cupatea commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Issue:

  • Old MacBook Pros (pre-T2) miss out on the WiFi fix, because they aren't
    detected as machines that need it. They have the same hardware issue as
    T2 Macs, so it needs to be fixed at install time too.

Fix:

  • Gate on an Apple machine with a Broadcom wireless part, instead of on the
    T2 chip. The bug is in the Broadcom firmware, not the T2 bridge.

Checked:

  • Manually applying the fix after installation on an old pre-T2 Mac fixes
    the issue

brcmfmac lets the Wi-Fi firmware run the WPA handshake itself, and on Apple
hardware that offload fails against an access point in WPA2/WPA3 transition
mode: the client associates, the four-way handshake never completes, and
NetworkManager reports the password as wrong. feature_disable=0x82000 turns off
the firmware supplicant and authenticator so wpa_supplicant does the handshake
in software.

That quirk already shipped, but only for Macs with a T2 chip. The bug is in the
Broadcom firmware rather than in the T2 bridge, so it was never the right thing
to gate on: a MacBookPro11,4 has BCM43602 with 2015 firmware, fails exactly this
way, and got nothing. Gate on the hardware that actually has the firmware — an
Apple machine with a Broadcom wireless part — which covers both.

Moving it out of fix-t2.sh also leaves one owner for the file. Two leaves writing
the same config would have meant the later one silently winning, decided by an
ordering in all.sh nobody would think to check.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI balanced review requested due to automatic review settings August 9, 2026 10:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the Broadcom Wi-Fi firmware workaround from T2 Macs to all applicable Apple hardware.

Changes:

  • Detects Apple systems with Broadcom wireless controllers.
  • Moves the brcmfmac configuration into a dedicated hardware setup script.
  • Adds shell coverage for supported and excluded hardware.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
install/hardware/all.sh Runs the new Broadcom workaround during hardware setup.
install/hardware/apple/fix-brcmfmac-supplicant.sh Detects affected Macs and writes the module configuration.
install/hardware/apple/fix-t2.sh Removes the T2-specific copy of the workaround.
test/shell.d/brcmfmac-supplicant-test.sh Tests detection, exclusions, and configuration ownership.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings August 10, 2026 20:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (3)

install/hardware/apple/fix-brcmfmac-supplicant.sh:18

  • The stated fix is to gate on an Apple machine with a Broadcom wireless part, but this condition still gates on T2 or one exact model. Consequently, every other pre-T2 Mac with the affected Broadcom hardware is skipped, while a MacBookPro11,4 with a replaced non-Broadcom card is still matched. Please detect both Apple hardware and the relevant Broadcom wireless device rather than hard-coding a single model, and apply the same predicate in the migration and tests.
if lspci -nn | grep "106b:180[12]" >/dev/null ||
  [[ $product_name == "MacBookPro11,4" ]]; then

migrations/1786391100.sh:13

  • This migration repeats the single-model predicate, so existing affected pre-T2 Macs other than MacBookPro11,4 will never receive the repair promised by the PR. Use the same Apple-plus-Broadcom hardware detection as the install-time leaf instead of limiting migration coverage to one DMI product.
if ! lspci -nn | grep "106b:180[12]" >/dev/null &&
  [[ $product_name != "MacBookPro11,4" ]]; then

test/shell.d/brcmfmac-supplicant-test.sh:88

  • This test encodes the opposite of the PR's Apple-plus-Broadcom requirement by asserting that every unlisted Mac is unaffected without checking its wireless device. Add Broadcom/non-Broadcom PCI fixtures and verify that any Apple machine with the affected Broadcom part is included while non-Broadcom Macs remain excluded.
# Every other Mac keeps the driver defaults until someone confirms the same
# failure on it.
run_leaf "MacBookPro9,2" 0 >/dev/null
[[ ! -f $test_tmp/etc/modprobe.d/brcmfmac.conf ]] ||
  fail "an unlisted Mac is left alone"

@dhh
dhh force-pushed the fix-brcmfmac-wifi-on-pre-t2-macs branch from ea06694 to 0232fba Compare August 10, 2026 20:10
Copilot AI review requested due to automatic review settings August 10, 2026 20:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (3)

install/hardware/apple/fix-brcmfmac-supplicant.sh:18

  • This gate does not match the PR’s stated Apple-plus-Broadcom detection: it still selects only T2 machines or the single MacBookPro11,4 model. Other pre-T2 Macs with the affected Broadcom/brcmfmac adapter remain skipped, so the advertised fix is incomplete. Detect both Apple hardware and the relevant Broadcom wireless device instead of hard-coding one product name, and update the migration and tests consistently.
if lspci -nn | grep "106b:180[12]" >/dev/null ||
  [[ $product_name == "MacBookPro11,4" ]]; then

migrations/1786391100.sh:13

  • The migration repeats the narrower model allowlist rather than the Apple-plus-Broadcom gate described by the PR. Consequently, existing installs on any affected pre-T2 model other than MacBookPro11,4 never receive the repair. Reuse the same Apple/vendor and Broadcom wireless detection as the install-time path.
if ! lspci -nn | grep "106b:180[12]" >/dev/null &&
  [[ $product_name != "MacBookPro11,4" ]]; then

test/shell.d/brcmfmac-supplicant-test.sh:97

  • This assertion codifies the opposite of the PR’s stated behavior by requiring every unlisted Mac to be skipped. The fixture does not model a Broadcom wireless device, so it cannot verify the intended Apple-plus-Broadcom gate. Add Broadcom-present/absent fixture state and cover an additional pre-T2 Apple model with Broadcom hardware rather than enforcing a one-model allowlist.
# Every other Mac keeps the driver defaults until someone confirms the same
# failure on it.
run_leaf "MacBookPro9,2" 0 >/dev/null
[[ ! -f $test_tmp/etc/modprobe.d/brcmfmac.conf ]] ||
  fail "an unlisted Mac is left alone"

Copilot AI review requested due to automatic review settings August 10, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

test/shell.d/brcmfmac-supplicant-test.sh:93

  • The documented device list omits BCM4377, although the loop includes its 4488 PCI ID and the production script identifies it as BCM4377. Include it so the test description matches the cases being exercised.
# Every Broadcom part brcmfmac drives, on a Mac with no T2 to detect: BCM43602
# and its single-band variants, BCM4350, BCM4355, BCM4364, BCM4378, BCM4387.

migrations/1786391100.sh:23

  • This substring match treats a different value such as feature_disable=0x820000 as if the required 0x82000 bitmask were installed, so the migration exits and leaves the Wi-Fi failure unfixed. Match a complete, uncommented option token and value instead.
  grep -Eq '^[[:space:]]*options[[:space:]]+brcmfmac[[:space:]].*feature_disable=0x82000' "$conf"; then

Comment on lines +28 to +34
mkdir -p /etc/modprobe.d
cat > /etc/modprobe.d/brcmfmac.conf <<'EOF'
# Broadcom's firmware supplicant and authenticator fail the WPA four-way
# handshake on Apple hardware, which surfaces as a rejected password. Disable
# both so wpa_supplicant performs the handshake instead.
options brcmfmac feature_disable=0x82000
EOF
dhh and others added 2 commits August 10, 2026 13:33
Sniffing lspci for an Apple vendor with a Broadcom network controller made T2
Macs depend on a detection line they never needed: they carry a T2 PCI ID that
is always there, and the class name half of `lspci -nn` comes from the pci.ids
database. Keep their original gate untouched.

Naming the rest by DMI model does not hold up either, because the model year
does not predict the part. A MacBookPro11,4 from Mid 2015 carries a BCM43602
and needs this; a MacBookAir7,2 from Early 2015 carries a BCM4360 and does
not. Covering the lineup by name takes around twenty identifiers across four
product lines and grows every time Apple ships hardware.

The set has an exact definition already: the PCI IDs brcmfmac binds, from the
driver's own brcm_hw_ids.h. That reaches the 2016 and 2017 MacBook Pros and
the T2-less iMac19,1 and iMac19,2 that a hand-written list missed, and it
leaves out the BCM4360 Macs for free, since their out-of-tree wl driver would
never read a brcmfmac option anyway.

Matching an exact vendor:device ID also drops the piped `grep -q`, which
returns 141 under pipefail once the producer is killed by SIGPIPE (omacom#6608). The
test runs the leaf with pipefail so the chatty lspci stub proves it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The quirk is written at install time, so a machine set up before it shipped
never gets it, and no pre-T2 Mac ever did. Those installs still fail the WPA
four-way handshake against an access point in WPA2/WPA3 transition mode,
which is the state the reporter had to repair by hand.

Appending leaves anything else in the config alone: modprobe reads every
options line for a module, and nothing else sets feature_disable. Only an
active options line counts as already applied, and the driver keeps the old
behaviour until it reloads, so this asks for a reboot rather than pulling
brcmfmac out from under a connection that currently works.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@dhh
dhh force-pushed the fix-brcmfmac-wifi-on-pre-t2-macs branch from 1eff356 to 0a8fc45 Compare August 10, 2026 20:34
@dhh

dhh commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for tracking this down — the diagnosis is right, and splitting the quirk into its own leaf with a single owner is the correct shape. I've pushed two commits on top of yours rather than leave a pile of review notes. Here's what changed and why.

The gate

lspci -nn | grep -qiE 'network controller.*\[14e4:' had two problems.

The first is grep -q, which is the SIGPIPE bug from #6608: grep exits at the first match, lspci keeps writing, and under pipefail the pipeline reports 141 — read as "no such hardware" on exactly the machines being targeted. b85ae70 removed that pattern repo-wide five days ago, including from the neighbouring fix-t2.sh.

The second is that it made T2 Macs depend on a detection line they never needed. They carry a T2 PCI ID that is always present, whereas the class-name half of lspci -nn output comes from the pci.ids database.

Naming the other machines by DMI model turned out not to work either, because the model year doesn't predict the part. MacBookPro11,4 (Mid 2015) carries a BCM43602 and needs this; MacBookAir7,2 (Early 2015) carries a BCM4360 and doesn't. Covering the lineup by name takes about twenty identifiers across four product lines.

So the gate is now the T2 PCI ID, or an Apple machine carrying one of the PCI IDs brcmfmac binds, taken from the driver's own brcm_hw_ids.h:

if lspci -nn | grep "106b:180[12]" >/dev/null ||
  { [[ $sys_vendor == Apple* ]] &&
    lspci -nn | grep -E "14e4:(43ba|43bb|43bc|43a3|43dc|4464|4488|4425|4433)" >/dev/null; }; then

That picks up two sets of machines the original missed: the 2016/2017 MacBook Pros (MacBookPro13,x/14,x, also BCM43602), and iMac19,1/iMac19,2 — which are BCM4364 and, per the t2linux Wi-Fi guide, not T2 Macs at all. It also excludes the BCM4360 Macs for free: 43a0 isn't a brcmfmac ID, because those run the out-of-tree wl driver and would never read a brcmfmac option.

Existing installs

The quirk only ran at install time, so it never reached a machine already running Omarchy — which is the situation you described repairing by hand. migrations/1786391100.sh applies the same gate to existing installs. It appends rather than overwrites so anything else in the file survives, treats only an active options line as already-applied (a commented-out one means the machine is still on the broken default), and sets reboot-required rather than reloading brcmfmac, which would drop a Wi-Fi connection that currently works — possibly the one carrying the update.

One thing worth confirming

The chip-ID list is derived, not tested. Your reproduction is on a MacBookPro11,4; if you or anyone on the thread has an iMac19,x or a 2017 MacBook Pro, confirmation there would be welcome.

— 🤖 Claude, posting on behalf of @dhh

@dhh
dhh merged commit 186668a into omacom:quattro Aug 10, 2026
csvenke added a commit to csvenke/omarchy that referenced this pull request Aug 19, 2026
linux-firmware ships brcmfmac43602-pcie.bin but not the board NVRAM,
and without it the 43602 firmware's country detection breaks: only
2.4GHz networks appear, signal collapses, and the WPA 4-way handshake
times out — which NetworkManager misreports as a wrong password
(kernel bug 193121).

Vendor the known-good NVRAM (Apple Boot Camp driver lineage, with
ccode=0/regrev=1 to bypass the broken detection) and install it for
Apple machines carrying a BCM43602 (14e4:43ba/43bb/43bc), at install
time and via migration for existing installs. The live interface MAC
is substituted in; the line is stripped when no MAC is discoverable.
An existing NVRAM is never overwritten, and the migration marks
reboot-required instead of reloading brcmfmac out from under the
connection carrying the update.

Verified on MacBookPro14,3: 5GHz networks appear, stronger signal and
handshake completes instantly. Complements the firmware-supplicant quirk from omacom#6652,
which was active on the affected machine but not sufficient on its own.
csvenke added a commit to csvenke/omarchy that referenced this pull request Aug 19, 2026
linux-firmware ships brcmfmac43602-pcie.bin but not the board NVRAM,
and without it the 43602 firmware's country detection breaks: only
2.4GHz networks appear, signal collapses, and the WPA 4-way handshake
times out — which NetworkManager misreports as a wrong password
(kernel bug 193121).

Vendor the known-good NVRAM (Apple Boot Camp driver lineage, with
ccode=0/regrev=1 to bypass the broken detection) and install it for
Apple machines carrying a BCM43602 (14e4:43ba/43bb/43bc), at install
time and via migration for existing installs. The live interface MAC
is substituted in; the line is stripped when no MAC is discoverable.
An existing NVRAM is never overwritten, and the migration marks
reboot-required instead of reloading brcmfmac out from under the
connection carrying the update.

Verified on MacBookPro14,3: 5GHz networks appear, stronger signal and
handshake completes instantly. Complements the firmware-supplicant quirk from omacom#6652,
which was active on the affected machine but not sufficient on its own.
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
* Apply the Broadcom Wi-Fi quirk to Macs without a T2

brcmfmac lets the Wi-Fi firmware run the WPA handshake itself, and on Apple
hardware that offload fails against an access point in WPA2/WPA3 transition
mode: the client associates, the four-way handshake never completes, and
NetworkManager reports the password as wrong. feature_disable=0x82000 turns off
the firmware supplicant and authenticator so wpa_supplicant does the handshake
in software.

That quirk already shipped, but only for Macs with a T2 chip. The bug is in the
Broadcom firmware rather than in the T2 bridge, so it was never the right thing
to gate on: a MacBookPro11,4 has BCM43602 with 2015 firmware, fails exactly this
way, and got nothing. Gate on the hardware that actually has the firmware — an
Apple machine with a Broadcom wireless part — which covers both.

Moving it out of fix-t2.sh also leaves one owner for the file. Two leaves writing
the same config would have meant the later one silently winning, decided by an
ordering in all.sh nobody would think to check.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Gate the Broadcom Wi-Fi quirk on the T2 ID or a brcmfmac chip ID

Sniffing lspci for an Apple vendor with a Broadcom network controller made T2
Macs depend on a detection line they never needed: they carry a T2 PCI ID that
is always there, and the class name half of `lspci -nn` comes from the pci.ids
database. Keep their original gate untouched.

Naming the rest by DMI model does not hold up either, because the model year
does not predict the part. A MacBookPro11,4 from Mid 2015 carries a BCM43602
and needs this; a MacBookAir7,2 from Early 2015 carries a BCM4360 and does
not. Covering the lineup by name takes around twenty identifiers across four
product lines and grows every time Apple ships hardware.

The set has an exact definition already: the PCI IDs brcmfmac binds, from the
driver's own brcm_hw_ids.h. That reaches the 2016 and 2017 MacBook Pros and
the T2-less iMac19,1 and iMac19,2 that a hand-written list missed, and it
leaves out the BCM4360 Macs for free, since their out-of-tree wl driver would
never read a brcmfmac option anyway.

Matching an exact vendor:device ID also drops the piped `grep -q`, which
returns 141 under pipefail once the producer is killed by SIGPIPE (omacom#6608). The
test runs the leaf with pipefail so the chatty lspci stub proves it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Fix Macs already installed without the Broadcom Wi-Fi quirk

The quirk is written at install time, so a machine set up before it shipped
never gets it, and no pre-T2 Mac ever did. Those installs still fail the WPA
four-way handshake against an access point in WPA2/WPA3 transition mode,
which is the state the reporter had to repair by hand.

Appending leaves anything else in the config alone: modprobe reads every
options line for a module, and nothing else sets feature_disable. Only an
active options line counts as already applied, and the driver keeps the old
behaviour until it reloads, so this asks for a reboot rather than pulling
brcmfmac out from under a connection that currently works.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: David Heinemeier Hansson <[email protected]>
ahmadtv added a commit to ahmadtv/omarchy-imac18-3 that referenced this pull request Sep 12, 2026
omacom/omarchy#6652 (merged 2026-08-10) applies the Broadcom handshake
quirk -- feature_disable=0x82000 in /etc/modprobe.d/brcmfmac.conf -- to
every Mac brcmfmac drives, BCM43602 included, and a migration brings it
to existing installs. The module wrote the same file with the same option,
and its remove would now have deleted Omarchy's copy and brought the
WPA2/WPA3 association failure back. The config stays; it is Omarchy's.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants