Skip to content

June 18, 2012

Wireless BCM4312 with the 3.4 and 3.5 kernel

Broadcom Chipset BCM4312
The hybrid driver from Broadcom is still a bit behind in terms of support for the latest kernels but there are workarounds. This particular issue also effects other kernel modules such as the out of tree Nvidia and ATI blobs that require the asm/system.h file in their includes.

I’ve had success with replacing it with asm/switch_to.h which seems to have fixed things for now. The cause for this can be found on the LKML.

Chipsets supported by “Broadcom’s IEEE 802.11a/b/g/n hybrid Linux® device driver” are: BCM4311, BCM4312, BCM4313, BCM4321, BCM4322, BCM43224, and BCM43225, BCM43227 and BCM43228.


Errors:

bcurtis@ronin:~/workspace/wl$ make
KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory `/usr/src/linux-headers-3.5.0-030500rc3-generic’
Wireless Extension is the only possible API for this kernel version
Using Wireless Extension API
LD /home/bcurtis/workspace/wl/built-in.o
CC [M] /home/bcurtis/workspace/wl/src/shared/linux_osl.o
CC [M] /home/bcurtis/workspace/wl/src/wl/sys/wl_linux.o
/home/bcurtis/workspace/wl/src/wl/sys/wl_linux.c:43:24: fatal error: asm/system.h: No such file or directory
compilation terminated.
make[2]: *** [/home/bcurtis/workspace/wl/src/wl/sys/wl_linux.o] Error 1
make[1]: *** [_module_/home/bcurtis/workspace/wl] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.5.0-030500rc3-generic’
make: *** [all] Error 2

The rundown:

  1. Download the 32 or 64-bit version:
    http://www.broadcom.com/support/802.11/linux_sta.php
  2. Download my patches: bc_wl_abiupdate.patch and switch_to.patch
  3. Extract the sources:
    cd ~/Downloads; mkdir -p wl; cd wl; tar xf ../hybrid-portsrc*.tar.gz
  4. Patch and compile the sources:
    patch -p0 src/wl/sys/wl_linux.c < ~/Downloads/switch_to.patch; patch -p0 src/wl/sys/wl_linux.c < ~/Downloads/bc_wl_abiupdate.patch;
    make; sudo make install; sudo depmod; sudo modprobe wl

Give Ubuntu a few seconds after loading the “wl” kernel module, then eventually the Network Manager will start looking for wireless networks.

TL;DR: These patches are required for a working wl kernel module for the 3.4 and 3.5 kernel series.

Update: Also verified to work with Linux 3.6 series.

55 Comments Post a comment
  1. DEH
    Jul 9 2012

    It’s like this tip was made just for me. It worked like a charm after I used the mentioned directory structure. Thanks!

    Reply
  2. Dennis
    Jul 11 2012

    Thanks! Wifi finally works now. BCM4313 with kernel 3.4.4 on debian Squeeze.

    Reply
  3. Jul 18 2012

    Thanks! Wifi works now. BCM4312 with kernel Thanks! Wifi finally works now. BCM4313 with kernel 3.4.4.2 i 686 on opensuse 12.1.

    Reply
  4. Jul 23 2012

    very very very cool baby!!!
    thanks a lot!!!!!
    it works on my

    - Fedora 16, 32 bit
    - kernel 3.4.6
    - Broadcom BCM4313

    Great!
    ;)

    Reply
  5. João Gondim
    Aug 4 2012

    I dont know how to thank you, man! Straight from brazil here, really thankfull for this! Using BCM4313 and Ubuntu 12.04

    Reply
  6. Aug 12 2012

    Nice man, thanks a lot, I love compile the kernel and broadcom always is problem.
    And is more 1 brazilian here :)

    my kernel 3.5.1

    Reply
  7. Martin
    Aug 14 2012

    Thank you, it works for me.

    Reply
  8. Michael
    Aug 24 2012

    It works perfect, thanks so much

    Reply
  9. Richard
    Sep 6 2012

    Great tip, thought I would never get it working Thanks :)

    Reply
  10. balaji
    Sep 19 2012

    Awesome man, finally because of you I can upgrade my kernel after an year.

    Thanks a lot !!!

    Reply
  11. jane
    Oct 11 2012

    Not working for me in Ubuntu 12.04 with 3.5 kernel……

    worked in 3.4 kernel..

    This post also might prove useful:
    https://bugs.launchpad.net/ubuntu/+source/bcmwl/+bug/994255

    Reply
    • Oct 12 2012

      Considering that 12.04 uses the 3.2 kernel by default, if you are using mainline kernel 3.5 (also from Ubuntu but meant for Quantal), this also works as I’ve just tested it. It also works against kernel 3.6 without problems. If you want, please post the output you are seeing here and I can have a look at it.

  12. Alfonso
    Oct 14 2012

    Hi,

    I’m running Ubuntu 11.10 with kernel 3.6.2-030602-generic i386

    Before I found your page I messed up big time.
    I ended up in a situation where kernel 3.6.2 had no internet connection (wired or wireless) and I had to blacklist wl in order to get wired back.

    Now I tried to remove all packages I could think of related to b43 and followed your instruction.

    after I copy wl.ko (according to the instructions in http://www.broadcom.com/docs/linux_sta/README.txt)

    # cp wl.ko /lib/modules/3.6.2-030602-generic/kernel/drivers/net/wireless/wl.ko

    # depmod
    # modprobe wl

    at this stage the GUI breaks, I have no wireless and every command related to wireless (e.g. iwconfig) hangs (I tried from an ssh connection since I have no more GUI).

    any idea?

    thank you!

    Reply
  13. Alfonso
    Oct 14 2012

    rookie mistake…

    $ sudo find / | grep wl.ko
    /home/alfonso/wifi/wl/wl.ko
    /home/alfonso/wifi/wl/.wl.ko.cmd
    /lib/modules/3.6.2-030602-generic/updates/dkms/wl.ko
    /lib/modules/3.6.2-030602-generic/kernel/drivers/net/wireless/wl.ko

    I copied /home/alfonso/wifi/wl/wl.ko on /lib/modules/3.6.2-030602-generic/kernel/drivers/net/wireless/wl.ko instead of copying it to /lib/modules/3.6.2-030602-generic/updates/dkms/wl.ko

    now it works! thanks!!!

    Reply
    • Oct 15 2012

      Glad to hear that you got it sorted out. Did you happen to have any problems with the 3.5 series like jane above you had? I cannot reproduce the issue.

    • Alfonso
      Oct 15 2012

      didn’t try with 3.5 – I just swtiched to 3.6

      thank you for the great post!

  14. leo
    Nov 11 2012

    thanks!! is workign on linux 3.6 :D

    Reply
  15. David Haight
    Nov 16 2012

    After adding the switch_to.patch into the patches directory, and editing dkms.conf to use the new patch, wl module finally built and installed correctly. Network-manager seems to find the device and autoscan for networks a lot slower than under 3.2, but at least it works after a delay!

    Thanks for this writeup

    Reply
  16. Tobi
    Nov 26 2012

    Your patch works great on a openSUSE 12.2 x86 system! Thanks a lot for your efforts, really appreciated!

    Reply
  17. Gabriel
    Dec 5 2012

    Thanks =D

    Ubuntu 12.04
    BCM4313
    kernel 3.5.0

    Reply
  18. Daniel
    Dec 13 2012

    Hello!

    I tried to follow many times your solution, but things won’t work…
    I’m under Linux 3.6.2, amd_64, and when I try to run “sudo modprobe wl”, I get this error :

    “ERROR: could not insert ‘wl’: Unknown symbol in module, or unknown parameter (see dmesg)
    libkmod: ERROR ../libkmod/libkmod-module.c:925 command_do: Error running install command for wl
    ERROR: could not insert ‘wl’: Operation not permitted”

    I blacklisted compat and bcma, since I thought they could disturb wl, but I still get this error.

    Does someone know what’s happening?

    Reply
  19. Daniel
    Dec 13 2012

    When I run dmesg, I get


    [ 186.462566] wl: disagrees about version of symbol lib80211_get_crypto_ops
    [ 186.462573] wl: Unknown symbol lib80211_get_crypto_ops (err -22)
    [ 591.873883] wl: disagrees about version of symbol lib80211_get_crypto_ops
    [ 591.873887] wl: Unknown symbol lib80211_get_crypto_ops (err -22)
    [ 770.760994] wl: disagrees about version of symbol lib80211_get_crypto_ops
    [ 770.761002] wl: Unknown symbol lib80211_get_crypto_ops (err -22)

    Reply
    • Dec 13 2012

      I just tested with 3.6.2-030602-generic and everything compiled and installed without a problem. In dmesg I see:

      [ 64.799857] lib80211: common routines for IEEE802.11 drivers
      [ 64.799863] lib80211_crypt: registered algorithm ‘NULL’
      [ 64.803804] wl: module license ‘unspecified’ taints kernel.
      [ 64.803810] Disabling lock debugging due to kernel taint

      From looking at your output: either there is something wrong with your kernel headers not matching your currently running kernel, or you have forcefully injected wl or some other kernel module that was not made for your currently running kernel and wl is complaining.

      I hope you can figure it out.

  20. EW
    Dec 16 2012

    Thanks a lot for the tip, worked like a charm! BCM43228/Ubuntu 12.10.

    Reply
  21. Toraman
    Dec 22 2012

    Worked. Slackware 64 14. Kernel 3.7.1

    Reply
  22. Nadav Kavalerchik (nadavkav)
    Dec 22 2012

    Thanks! help me with my Ubuntu 12.04 GNU/Linux 3.5 kernel
    Broadcom BCM4315 802.11 Hybrid Wireless Controller 5.100.82.112

    Reply
  23. Andrei
    Dec 28 2012

    Thank you !!!

    Reply
  24. johnwind
    Jan 8 2013

    Awesome !! Thank you.

    Reply
  25. system.waw
    Jan 9 2013

    Works on 3.7 Ubuntu 13.04!!!

    Reply
  26. Brammee
    Jan 12 2013

    Works on Ubuntu 12.04 + 3.7.2-030702-generic

    :) thnx!

    Reply
  27. Jan 12 2013

    Thank you! I finally made my Broadcom 4322 up & running. I will make a simple post on my blog just to have a manual what to do next time I have to install it :) Of course I will credit you! You are my savior!

    Reply
  28. Philip Orleans
    Jan 28 2013

    I am having the same issue wuthe Netxtreme 5708 Server Driver. It does not compile with 3.5. Is it possible that you point me in the right direction as to how to make this work?

    Reply
    • Jan 28 2013

      I’m not sure I can help you, but if the your error is similar to the one I posted about, then you can try it for yourself. The patches above won’t be a 100% match, but you can patch the files manually by looking at what I did. Good luck!

    • Philip Orleans
      Jan 28 2013

      I wish to hire you to write patch for me.
      Please contact me via email at venefax at gmail and I can give you the credentials. I pay via Paypal.

  29. elbis
    Feb 3 2013

    Hi,

    I tried your method but got the following error at the make stage:

    ld: Relocatable linking with relocations from format elf64-x86-64 (/home/user/Downloads/hyb/wl/lib/wlc_hybrid.o_shipped) to format elf32-i386 (/home/user/Downloads/hyb/wl/wl.o) is not supported

    Any help will be appreciated!!

    Reply
    • Feb 3 2013

      That is because you are mixing 32 and 64bit. Did you download the correct version from the website for your machine? You can find out by running ‘uname -a’, i386 is 32b and x86_64 is 64. Good luck!

    • elbis
      Feb 3 2013

      `uname -a` gave me “Linux elbis 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux”

      Is it 32b or 64?

    • Feb 3 2013

      i686 is still 32 bit. Cheers!

    • elbis
      Feb 3 2013

      Bret! Thanks for following up. I also figured out after your comment.
      The problem is even after downloading 32bit package and following your suggestions, i’m’ not able to get my wifi working.

      lsmod | grep wl
      wl 2442848 0
      lib80211 14040 1 wl

    • Feb 4 2013

      It looks like you got it to compile and loaded into your kernel without problems. You either need blacklist one of the other kernel modules that is trying to initialize your wireless or your wireless isn’t supported.

      Try this:
      http://askubuntu.com/questions/240124/what-do-i-type-to-blacklist-b43-in-an-installed-ubuntu-system

      Success!

  30. Feb 5 2013

    If you’re running Ubuntu 12.10, broadcom-sta-dkms is supposed to provide and build this driver.

    But it’s broken, as outlined on this webpage (above.)

    But not in quantal-backports:

    sudo aptitude -t quantal-backports install broadcom-sta-dkms

    Reply
    • Feb 5 2013

      You’re right, sadly it isn’t in earlier Ubuntu releases and some of us still have to use the LTS.

  31. Feb 5 2013

    Thanks a lot!! :)

    Reply
  32. Thankfuluser
    Mar 5 2013

    Confirmed to work on Linux 3.8.2-030802-generic (Ubuntu 12.04 LTS). Thank you very much for this!!!!!!

    Reply
  33. Nick
    Mar 9 2013

    Thanks man :D

    Reply
  34. mihai george
    Mar 21 2013

    Thank you ! This worked under gentoo amd64 kernel 3.8.2.

    Reply
  35. bitter lemon
    Mar 25 2013

    Thanks, it worked perfectly.

    The kernel patch solved my problem of no wifi with a siduction 3.5 kernel on a debian system with broadcom 43228 wireless.

    Sticking to 3.5 for now since it’s (unofficially) supported till Mar 2014 and 3.7 is already EOL.

    Thanks man!

    Reply
  36. Ash P
    May 3 2013

    For anybody who just installed Ubuntu 13.10 Saucy Salamander daily build this works for the 3.9.0.0 kernel.

    Thanks bret, great patch

    Reply
  37. Tom
    May 3 2013

    Unbelievable, I have no idea what I just did there (cut, paste in terminal, hope for the best)

    Thank you for the help, now using fixed wifi to post this. This fix worked on perfect on Ubuntu Studio 13.04.

    Reply
  38. Juan
    May 12 2013

    #sudo modprobe wl

    ERROR: could not insert ‘wl’: Exec format error
    libkmod: ERROR ../libkmod/libkmod-module.c:925 command_do: Error running install command for wl
    ERROR: could not insert ‘wl’: Operation not permitted

    bcm43225
    ubuntu 13.04 Kernel 3.5.0-17-generic
    64 bits

    Alguien me ayuda??

    Reply
    • May 13 2013

      Have you tried ‘sudo make install’ and ‘sudo depmod’ before running ‘sudo modprobe wl’ ?

Trackbacks & Pingbacks

  1. Инсталация на Broadcom Wi-Fi карта на Ubuntu | Маруш "Луци" Денчев
  2. Ubuntu备忘 | 自留地
  3. Wireless BCM4312 with the 3.6, 3.7 and 3.8 kernel | Mindwerks
  4. Linux下Broadcom无线网卡驱动安装 | northcamel

Share your thoughts, post a comment.

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments

%d bloggers like this: