Better wireless drivers for the bcm4331

So as of the other day, I found the solution to the last of my troubles regarding running Linux on my mid-2012 15″ Retina MacBook Pro – namely, that the wireless drivers were incredibly flakey and would drop randomly and frequently.

Basically, there are two major wireless drivers available for Linux for the Broadcom chipsets; the b43 drivers which are in the upstream kernel, and the broadcom-wl STA drivers. The b43 drivers work fairly well, but don’t implement power management for the bcm4331 and so can frequently/randomly drop. On the other side of the fence, there’s Broadcom’s Linux driver page. However, you’d be forgiven for thinking that Broadcom hasn’t released new drivers in over 2 years, right? And as a result, the currently available drivers don’t support the bcm4331? Wrong. Turns out Ubuntu managed to get newer drivers out of Broadcom in December.

Anyway, one of the major features of the new driver in the December release (version 6.2.155.19) is that it supports the bcm4331 found in the newer MacBook Pro models, amongst other computers. So if you just download the source (I used apt-get source bcmwl on a 13.04 machine), it will compile on pretty much any modern kernel and seems to work fine. For reference, I’m using it now on Fedora 17 running kernel 3.7.9. It even suspends/resumes fine.

14 thoughts on “Better wireless drivers for the bcm4331

  1. Just wondering how you built this on Fedora? When trying to build it from the Ubuntu .orig.tar.gz I get:

    tar xzf bcmwl_6.20.155.1+bdcom.orig.tar.gz
    [alex@alpha Downloads]$ cd bcmwl-6.20.155.1+bdcom/
    [alex@alpha bcmwl-6.20.155.1+bdcom]$ make
    KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
    make[1]: Entering directory `/usr/src/kernels/3.8.2-206.fc18.x86_64′
    CFG80211 API is prefered for this kernel version
    Using CFG80211 API
    LD /home/alex/Downloads/bcmwl-6.20.155.1+bdcom/built-in.o
    make[2]: *** No rule to make target `/home/alex/Downloads/bcmwl-6.20.155.1+bdcom/src/shared/linux_osl.o’, needed by `/home/alex/Downloads/bcmwl-6.20.155.1+bdcom/wl.o’. Stop.
    make[1]: *** [_module_/home/alex/Downloads/bcmwl-6.20.155.1+bdcom] Error 2
    make[1]: Leaving directory `/usr/src/kernels/3.8.2-206.fc18.x86_64′
    make: *** [all] Error 2

  2. Thank you so much for this… I’ve been using the b43 driver for half a year now and it was driving me crazy. This one is soooo much faster and I can finally use 5GHz again. So far it seemed stable too. Can’t believe I missed that since December.

    • Seems to work for me…?

      [george@aluminium ~]$ modinfo wl
      filename: /lib/modules/3.8.3-103.fc17.x86_64/kernel/drivers/net/wireless/wl.ko
      license: MIXED/Proprietary
      alias: pci:v*d*sv*sd*bc02sc80i*
      depends: cfg80211,lib80211
      vermagic: 3.8.3-103.fc17.x86_64 SMP mod_unload

  3. Also of interest: Rafał Miłecki has submitted a whole heap of patches to implement HT-PHY power management support (amongst other things) in the b43 driver, so hopefully once those land the b43 driver will become viable for bcm4331. I don’t know if the patches implement support for 5GHz, though.

  4. any help for installing the driver in Fedora 18 kernel 3.8.4?
    I get
    [user@user-macbook-pro bcmwl-6.20.155.1+bdcom]$ make
    KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
    make[1]: Entering directory `/usr/src/kernels/3.8.4-202.fc18.x86_64′
    CFG80211 API is prefered for this kernel version
    Using CFG80211 API
    make[2]: *** No rule to make target `/home/user/Downloads/bcmWIRELESS_MAC/bcmwl-6.20.155.1+bdcom/src/shared/linux_osl.o’, needed by `/home/user/Downloads/bcmWIRELESS_MAC/bcmwl-6.20.155.1+bdcom/wl.o’. Stop.
    make[1]: *** [_module_/home/user/Downloads/bcmWIRELESS_MAC/bcmwl-6.20.155.1+bdcom] Error 2
    make[1]: Leaving directory `/usr/src/kernels/3.8.4-202.fc18.x86_64′
    make: *** [all] Error 2

  5. Thank you for writing this post. I’m on Debian and was almost going to give up when I found this. Compiling the source deb in the linked bug solved the problem for me.

  6. Thanks for the post. I’m glad to see that there is a possible solution out there. Unfortunately, I’m not having any luck. When I load the wl driver the OS is not showing the interface in the list of available interfaces. Not sure what might be wrong. Any advice would be appreciated.

    user@localhost:/tmp$ lspci -vvnn | grep 14e4
    01:00.0 Ethernet controller [0200]: Broadcom Corporation NetXtreme BCM57765 Gigabit Ethernet PCIe [14e4:16b4] (rev 10)
    Subsystem: Broadcom Corporation NetXtreme BCM57765 Gigabit Ethernet PCIe [14e4:16b4]
    01:00.1 SD Host controller [0805]: Broadcom Corporation NetXtreme BCM57765 Memory Card Reader [14e4:16bc] (rev 10) (prog-if 01)
    Subsystem: Broadcom Corporation Device [14e4:0000]
    02:00.0 Network controller [0280]: Broadcom Corporation BCM4331 802.11a/b/g/n [14e4:4331] (rev 02)
    user@localhost:/tmp$ lsmod | grep b43
    user@localhost:/tmp$ lsmod | grep wl
    wl 3074449 0
    lib80211 14352 1 wl
    cfg80211 510937 2 wl,mac80211
    user@localhost:/tmp$ modinfo wl
    filename: /lib/modules/3.8.0-22-generic/updates/dkms/wl.ko
    license: MIXED/Proprietary
    srcversion: 6E2531203CF49EB24353067
    alias: pci:v*d*sv*sd*bc02sc80i*
    depends: cfg80211,lib80211
    vermagic: 3.8.0-22-generic SMP mod_unload modversions
    parm: oneonly:int
    parm: piomode:int
    parm: instance_base:int
    parm: nompc:int
    parm: intf_name:string
    user@localhost:/tmp$ uname -a
    Linux localhost.local 3.8.0-22-generic #33-Ubuntu SMP Thu May 16 15:17:14 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux 0.3.1-1ubuntu2 amd64 CMIS protocol client library
    user@localhost:/tmp$ dpkg -l | grep bcmwl
    ii bcmwl-kernel-source 6.20.155.1+bdcom-0ubuntu6 amd64 Broadcom 802.11 Linux STA wireless driver source
    user@localhost:/tmp$ ifconfig -a
    eth0 Link encap:Ethernet HWaddr 40:6c:8f:58:63:80
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    Interrupt:16

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:14003 errors:0 dropped:0 overruns:0 frame:0
    TX packets:14003 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:4018161 (4.0 MB) TX bytes:4018161 (4.0 MB)

    usb0 Link encap:Ethernet HWaddr 56:9d:67:02:b1:74
    inet addr:192.168.42.239 Bcast:192.168.42.255 Mask:255.255.255.0
    inet6 addr: fe80::549d:67ff:fe02:b174/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:60692 errors:25 dropped:0 overruns:0 frame:25
    TX packets:50833 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:63010034 (63.0 MB) TX bytes:15438140 (15.4 MB)

    • Did you ensure the kernel module bcma is unloaded as well? Do lspci -v and see what “Kernel module in use” says for the 4331 chip.

      • I waited for a while before making another attempt and I’ve gotten a new kernel from Ubuntu since. Now eth1 is coming up when I load the wl driver but network-manager is not yet able to join either the 2.4 or 5 network. Will keep hacking.

        Thanks for the help!

  7. Try blacklisting bcma. As soon as I did that, my bcm4331 popped up in ifconfig -a as an ethernet device. One reboot, and it was automatically detected. That was about 30 seconds ago, and so far it’s working like a charm.

    If you install the deb package, bcma gets blacklisted by default. I suspect it conflicts with the wl module somehow.

  8. On LUbuntu 13.04 with a MacBookPro9,1 and Broadcom BCM4331 802.11a/b/g/n (rev 02), this is what did it for me:

    sudo apt-get install bcmwl-kernel-source

    Note that this takes care of getting the source AND building it. Boom! WiFi.

  9. Hey! I’m trying to get this driver working on Kali, but with no luck. I understand that since it is Debian I have to apply the patches in the pathces directory, but I have no idea as to how… I do patch -p1 < /path/to/patch but then I have no idea what "File to patch: "
    Sorry if this is too basic, but I really have no idea.
    I did apt-get source bcmwl on a Ubuntu 13.04 machine, and copied the files to the Kali machine, when entering the directory under Kali and running make, I get this:

    KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
    make[1]: Entering directory `/usr/src/linux-headers-3.7-trunk-amd64'
    CFG80211 API is prefered for this kernel version
    Using CFG80211 API
    make[4]: *** No rule to make target `/root/Downloads/bcmwl/bcmwl-6.20.155.1+bdcom/src/shared/linux_osl.o', needed by `/root/Downloads/bcmwl/bcmwl-6.20.155.1+bdcom/wl.o'. Stop.
    make[3]: *** [_module_/root/Downloads/bcmwl/bcmwl-6.20.155.1+bdcom] Error 2
    make[2]: *** [sub-make] Error 2
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-3.7-trunk-amd64'
    make: *** [all] Error 2

    Any help would be greatly appreciated!!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>