Skip to content

June 18, 2012

73

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:

[email protected]:~/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.

73 Comments Post a comment
  1. stefan
    Aug 13 2013

    THANKS!!!

    For documentation purposes (maybe it helps others…):
    Ubuntu 12.04 with a Broadcom 4313 (14e4:4727)
    – brcmsmac was useless because the signal was so weak, it only found access points within a few meters radius
    – broadcom-sta (the package provided by Ubuntu) could connect to my access point, but getting a DHCP lease failed (while static IP worked, but is not very user friendly)

    Only after trying to build the sta drivers myself (downloaded from the Broadcom website) and applying your patches I can now connect to all access points (not just the ones within a 10m radius) AND get a DHCP lease.

    Again, thanks a LOT!

    Reply
  2. Ali
    Aug 27 2013

    I would have kissed your hands a 100 times for writing this if you were in front of me. Thanks a lot

    Reply
  3. betaoxd
    Aug 30 2013

    Thanks. The patchs worked fine.

    Reply
  4. joerg
    Aug 30 2013

    Thank you so much!!
    Worked exactly as described.
    Joerg

    Reply
  5. Sep 14 2013

    First of all, thanks for the tutorial!

    However, when I go to patch my wl_linux.c with either files (both switch_to.patch and bc_ml_abiupdate.patch), I am getting an Hunk FAILED error, saying it failed at 40 for switch_to.patch, and failed at 332 for the bc_ml_abiupdate.patch. I am running 64 bit Fedora 18, and using the 64 bit source from Broadcom. Any idea what could be causing this?

    Reply
    • Sep 16 2013

      Possibly because you don’t need the patches? Does it compile without?

  6. Stryk9
    Jan 13 2014

    I am also getting the same error as Brennan on line 40. I will simply try compiling without bother patching and will notify if working or not. Been spending about 5+ hours on this… Ahhh, trying to get it to work with kali

    Reply
  7. Stryk9
    Jan 13 2014

    No luck installing it without patches. Also another thing I wanted to make note of, when trying the command “apt-get install build-essential linux-headers-generic” it does not work, stating

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package linux-headers-generic is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘linux-headers-generic’ has no installation candidate

    Reply

Trackbacks & Pingbacks

  1. Konfigurasi Ethernet Broadcom 43225 di Slackware |

Share your thoughts, post a comment.

(required)
(required)

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

Subscribe to comments