How to restore stable WiFi on the Broadcom Corporation BCM4331 wireless chip after upgrading from Ubuntu 13.04 (Raring) to 13.10 (Saucy Salamander).
I have a Macbook Pro 9.2 at work, though the first thing I did upon receiving it was to install (Ubuntu) Linux on it. Surprisingly, after figuring out the nuances of the EFI booting, everything worked surprisingly well. This included wireless, bluetooth and backlight control, all working out of the box.
Now, this all changed when I upgraded to 13.10 however. Suddenly, I no
longer found my wireless to be particularly stable. At home, this manifested
itself in particularly unstable SSH sessions, though oddly, it was usually
fine besides that. At work however, the experience was much worse, giving
frequent disconnects, packet loss and overall high latency. The kernel log
was also full of
ERROR @wl_cfg80211_get_station : Wrong Mac address, though
I was seeing this on my home network as well.
Some searching around quickly revealed there are lots of people with similar issues, the general concensus being Broadcom’s proprietary drivers are just, well, crap. (There’s also an opensource driver which does work with the chip in this Macbook, but after trying it out, I can safely say that experience was even worse.)
Fed up with the situation at last, I decided to try and downgrade back to the drivers shipped with 13.04 in an effort to get back to that previous level of stability. To make a long story short, after some research and experimentation, I have successfully downgraded and am now enjoying a stable wireless experience again. The rest of this post will be a guide on how to perform these steps yourself as well, in case you find yourself in the same boat I was in.
Downgrading to 126.96.36.199+bdcom-0ubuntu6
First, grab the 188.8.131.52+bdcom-0ubuntu6 version of bcmwl-kernel-source and then install it. It will fail to build the kernel module once dkms kicks in, but that’s okay. It won’t prevent the package itself from installing.
# Find a mirror close to you at: # http://packages.ubuntu.com/raring/i385/bcmwl-kernel-source/download (i386) # or: # http://packages.ubuntu.com/raring/amd64/bcmwl-kernel-source/download (amd64, like this macbook) wget http://nl.archive.ubuntu.com/ubuntu/pool/restricted/b/bcmwl/bcmwl-kernel-source_184.108.40.206+bdcom-0ubuntu6_amd64.deb # And then install it dpkg -i bcmwl-kernel-source_220.127.116.11+bdcom-0ubuntu6_amd64.deb
To make it build on the 3.11 kernel currently shipped with Ubuntu 13.10, two extra patches are needed. I managed to find these in the 18.104.22.168+bdcom-0ubuntu1 version of bcmwl-kernel-source that we just replaced, but for your convenience I’ve mirrorred them here as well:
The first patch needs to be patched (har har) however to apply cleanly. If you downloaded my version above, I’ve already done this for you.
--- 0008-add-support-for-linux-3.9.0.patch +++ 0008-add-support-for-linux-3.9.0.patch @@ -4,8 +4,8 @@ Subject: [PATCH 1/1] Add support for Linux 3.9 --- ---- a/src/wl/sys/wl_cfg80211_hybrid.c -+++ a/src/wl/sys/wl_cfg80211_hybrid.c +--- a/src/wl/sys/wl_cfg80211.c ++++ a/src/wl/sys/wl_cfg80211.c @@ -2048,7 +2048,11 @@ ie_len = (size_t)(ies->len); rcu_read_unlock();
Place these into
/usr/src/bcmwl-22.214.171.124+bdcom/patches, then adjust
/usr/src/bcmwl-126.96.36.199+bdcom/dkms.conf to use them:
--- /usr/src/bcmwl-188.8.131.52+bdcom/dkms.conf +++ /usr/src/bcmwl-184.108.40.206+bdcom/dkms.conf @@ -12,6 +12,8 @@ PATCH="0005-add-support-for-linux-3.4.0.patch" PATCH="0006-add-support-for-linux-3.8.0.patch" PATCH="0007-nl80211-move-scan-API-to-wdev.patch" +PATCH="0008-add-support-for-linux-3.9.0.patch" +PATCH="0009-add-support-for-linux-3.10.0.patch" #PATCH_MATCH="^3." #PATCH_MATCH="^3." AUTOINSTALL="yes"
At this point, it should build and install successfully:
dkms build -m bcmwl -v 220.127.116.11+bdcom && dkms install -m bcmwl -v 18.104.22.168+bdcom
Assuming that went off without a hitch, you can reload the
to use this version now (note: this will of course disconnect you):
rmmod wl && modprobe wl
To verify you really are running the 22.214.171.124 version of the driver,
you can check the last few lines of
dmesg output. It should show
Broadcom BCM4331 802.11 Hybrid Wireless Controller 126.96.36.199 (r326264)
(note the version number there).
Making sure it stays put
Finally, you’ll also want to ensure that an update doesn’t pull the
newer version back in, which would undo all the hard work you’ve just
done. This can be done by pinning
the version of bcmwl-kernel-source. Create
/etc/apt/preferences.d/bcmwl-kernel-source with the following
contents, and you should be all set.
Package: bcmwl-kernel-source Pin: version 188.8.131.52+bdcom* Pin-Priority: 1001
None of this is officially supported by Ubuntu of course, so don’t blame
me if it doesn’t work or stops working on a kernel update some day in the
future :) That said, the procedure is safe, and if you ever want to return
back to the original state, you only have to remove the
/etc/apt/preferences.d/bcmwl-kernel-source file to undo the pinning, then
apt-get upgrade or
aptitude upgrade to install the latest