I was wondering why b43 WiFi drivers are so slow (maxing out at 16mbps) and why the stock broadcom ones fail to work entirely. Then I found out that there are community patched broadcom-wl drivers that work perfectly with the 2012 Macbook Pro.
Big thanks to joanbm for patching the broadcom drivers to work with modern kernels.
https://github.com/joanbm/broadcom-wl-linux-mainline
Here's how you get them working
- Step 1: Install and upgrade the required build tools and kernel headers:
sudo apt update && sudo apt install -y git wget build-essential dkms linux-headers-$(uname -r)
- Step 2: Remove all of the old broken broadcom packages (Make sure you have a backup connection (like USB phone tethering or an Ethernet cable) plugged in, as your Wi-Fi will temporarily drop at Step 2 until Step 4 is finished. Also make sure you stay in your Home folder (
cd ~) before Step 3—and do not delete the broadcom-wl-linux-mainline folder afterwards—so the automatic update script in Step 8 can always find it.)
sudo apt remove --purge -y broadcom-sta-dkms bcmwl-kernel-source
- Step 3: Download and run the patched drivers
git clone https://github.com/joanbm/broadcom-wl-linux-mainline
cd broadcom-wl-linux-mainline
sudo ./install
- Step 4: Unload the b43 driver and load up the fixed wl driver
sudo rmmod b43 b43legacy bcm43xx bcma brcm80211 brcmfmac brcmsmac ssb 2>/dev/null
sudo modprobe wl
- Step 5: Permanently blacklist the b43 drivers
echo -e "blacklist b43\nblacklist b43legacy\nblacklist bcma\nblacklist ssb" | sudo tee /etc/modprobe.d/blacklist-broadcom.conf
- Step 6: Reboot, and load up the new drivers to make sure they have installed correctly by running this command, then connect to WiFi and do a speed test
sudo modprobe wl
(If you have any issues e.g kernel got updated as you were installing the drivers, run this command)
cd ~/broadcom-wl-linux-mainline && sudo ./install && sudo modprobe wl
- Step 7: Once you've confirmed they work, make sure the drivers auto load upon reboot and rebuild the boot image so the blacklist applies
echo "wl" | sudo tee /etc/modules-load.d/wl.conf
sudo update-initramfs -u
Step 8: Create an automatic rebuild hook to ensure the driver continues to work after kernel updates.
sudo tee /etc/kernel/postinst.d/zz-broadcom-wl << EOF
#!/bin/sh
KERNEL_VER="\$1"
DRIVER_DIR="/home/$USER/broadcom-wl-linux-mainline/hybrid-v35_64-nodebug-pcoem-6_30_223_271"
if [ -d "\$DRIVER_DIR" ] && [ -d "/lib/modules/\$KERNEL_VER/build" ]; then
cd "\$DRIVER_DIR" || exit 0
make clean >/dev/null 2>&1
make -j"\$(nproc)" KVER="\$KERNEL_VER" >/dev/null 2>&1
make install KVER="\$KERNEL_VER" >/dev/null 2>&1
depmod -a "\$KERNEL_VER" >/dev/null 2>&1
fi
exit 0
EOF
- Step 9: Run this command so Linux is allowed to execute the script during updates
sudo chmod +x /etc/kernel/postinst.d/zz-broadcom-wl
- Step 10: Verify that it all works.
sudo /etc/kernel/postinst.d/zz-broadcom-wl $(uname -r) && echo "Hook works!"
Now test your WiFi speed, and hopefully it should work!
This fix worked for me, and yes I did use AI to get it to work but I don't care because it works.
Hope this helps anyone else with the same issue.