Broadcom 43xx

From Gentoo-en
Jump to: navigation, search

This article details the configuration of Broadcom 43xx series devices by three different methods:

  1. Using the open source driver provided in the Linux kernel
  2. Using NDISwrapper
  3. Using the binary/proprietary Broadcom 802.11 Linux STA driver


It is important to know whether or not your specific Broadcom device is supported. This info and other worthwhile reading is available below...

  • Models supported by the open-source "b43" driver (available in any modern kernel)
  • Models supported by the open-source "brcm80211" driver (available only in kernel 2.6.37 and above)
  • Models supported by the proprietary binary broadcom-sta driver (available in the Portage tree)

    There may be other Broadcom drivers coming to the Linux kernel for the 3.2 release (more info). Note that this article only covers the specifics required for these devices. For generic installation instructions please see the Gentoo Handbook.

    Open Source Kernel Driver

    Note: Most recent kernels offer the standard open source "b43" driver, the main subject of this article. In Linux Kernel 2.6.37 the new Broadcom open source driver is available for BCM4313, BCM43224, and BCM43225 (explained further here and here and here).


    First, enable the following options in the kernel, then build and install as normal. The deselected options are possible extras or alternatives, depending on your device. (The instructions below are for the traditional "b43" kernel driver. The kernel configuration for the new Broadcom "brcm80211" driver can be seen here)

    Linux Kernel Configuration: b43 / b43-legacy kernel options (2.6.25+)
         Bus options (PCI etc.)  -->
           < > PCCard (PCMCIA/CardBus) support  --->
    
     [*] Networking support  -->
           Wireless -->
             -*- Improved wireless configuration API
             -*- Wireless extensions
             <*> Generic IEEE 802.11 Networking Stack (mac80211)
    
     Device Drivers --> 
       [*] Network device support --> 
          Wireless LAN
           [*] Wireless LAN (IEEE 802.11)
           <*>   Broadcom 43xx wireless support (mac80211 stack)
           [ ]     Broadcom 43xx PCMCIA device support
           [*]     Broadcom 43xx debugging
           < >   Broadcom 43xx-legacy wireless support (mac80211 stack)
           [ ]     Broadcom 43xx-legacy debugging
                   Broadcom 43xx-legacy data transfer mode (DMA + PIO) --->*
       [*] DMA Engine Support -->
    

    (*) Broadcom 43xx-legacy data transfer mode (DMA + PIO) kernel option reports that "not all devices of the b43legacy series support PIO. You should use PIO only if DMA does not work for you."


    The following options may enable support for laptop LEDs.

    Linux Kernel Configuration: Extra Options for Laptops (2.6.25+)
     [*] Networking support  --->
           Wireless  --->
             <*> Generic IEEE 802.11 Networking Stack (mac80211)
             [*]   Enable LED triggers
           <*> RF switch subsystem support  --->
             <*> Input layer to RF switch connector
    
         Device Drivers  --->
           [*] LED Support  --->
             [*] LED Trigger support
             <*>   LED Timer Trigger
             <*>   LED Heartbeat Trigger
             <*>   LED Default ON Trigger
           Input device support  --->
             -*- Generic input layer (needed for keyboard, mouse, ...)
               <*> Polled input device skeleton
    

    Firmware

    In addition to the kernel driver, you will need the firmware for your card.

    Kernel >=2.6.32

    You can install the firmware from portage tree without fwcutter:

    emerge net-wireless/b43-firmware

    Older Kernels

    For manual installation you will need a firmware cutter (which extracts the firmware and places it in /lib/firmware)

    Install the firmware cutter with:
    emerge b43-fwcutter

    Download the appropriate firmware file from the documentation site.

    Now extract the firmware file (replacing the example used below with the version of firmware recommended by the b43 documentation):

    tar -xjf broadcom-wl-4.150.10.5.tar.bz2

    then

    cd broadcom-wl-4.150.10.5/driver
    If /lib/firmware does not exist, create it:
    mkdir /lib/firmware

    Cut the firmware with:

    b43-fwcutter -w /lib/firmware <firmware file>

    brcm80211

    The firmware is available in sys-kernel/linux-firmware

    Loading the Module

    If you opted to compile the driver as a module, it will be named either b43 or b43legacy depending on which you chose.

    modprobe b43

    or

    modprobe b43legacy

    For most users, installation should now be complete. Reboot and configure your wireless.

    Note: The device name created by the b43 is "wlan#" (and not eth# as it is the case for the Broadcom wl driver). You may want to adapt your boot sequence accordingly by creating a symlink from net.lo to net.wlan0 and adding wlan0 to your runlevel "boot" via rc-update.

    Optional: Monitor mode

    If you want monitor mode, you will need to patch the kernel driver. If you don't know what Monitor Mode means, you probably don't need it.

    Generally, monitor mode is only needed for networking research and packet injection by aircrack-ng and similar tools.

    You can find documentation on these patches on the aircrack-ng website. The patches themselves can be downloaded from http://patches.aircrack-ng.org/

    It is best to use the wireless testing kernel to patch against:

    Kernel 2.6.26

    cd /usr/src git clone git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git cd /usr/src/linux/ wget http://patches.aircrack-ng.org/b43-injection-2.6.26-wl.patch wget http://patches.aircrack-ng.org/mac80211_2.6.26-wl_frag.patch patch -p1 < b43-injection-2.6.26-wl.patch patch -p1 < mac80211_2.6.26-wl_frag.patch make && make modules_install

    Kernel 2.6.25

    cd /usr/src/linux/ wget http://patches.aircrack-ng.org/b43-injection-2.6.25-wl.patch wget http://www.latinsud.com/bcm/mac80211_2.6.24.4_frag.patch patch -p1 < b43-injection-2.6.25-wl.patch patch -p1 < mac80211_2.6.24.4_frag.patch make && make modules_install

    Ndiswrapper - Wrapping Windows Drivers

    If the process above doesn't work, you can try to use the ndiswrapper drivers which are the drivers that came with your laptop or wireless card. If those fail, check for the latest version from the manufacturers website.

    Note: Vista drivers are not supported because ndiswrapper does not support version 6 of the NDIS API yet
    Note: Make sure to grab the 64 bit version of the driver if you are running x86_64. This can be a problem because not all chipsets necessarily have 64 bit XP drivers

    If you own a macbook (4th or 5th generation) try using the bootcamp winxp driver. It's located on the 1st install DVD and named "broadcomxpinstaller.exe", just unrar it.

    Then just follow Ndiswrapper.

    Broadcom 802.11 Linux STA driver

    Broadcom has released its own kernel driver. It's closed source but works and seems to release "often" (at least 3 times between the summer of 2008 and the February 2009). However, there has been no new releases since December, 2010.

    There is now an ebuild (net-wireless/broadcom-sta) for this binary Broadcom-provided kernel module. The ebuild also contains patches so that it will work on the latest kernel. Just accept the license (by adding "Broadcom" to ACCEPT_LICENSE in /etc/make.conf), and emerge as usual.


    emerge -av net-wireless/broadcom-sta


    Note: This driver appears to be incompatible with suspending, so make sure you blacklist the module.
    This could not be verified on a MacBookPro6,2 (2010-05) with BCM4353 and broadcom-sta-5.60.48.36 on gentoo-sources-2.6.33-r1. The driver survived a suspend (hibernate not tested) and NetworkManager could connect afterwards.
    Note: It might be necessary to run "update-modules -f" to install the driver correctly! This was required before it was an ebuild, but if you are having issues loading the module.
    Note: If you experience frequent disconnects try changing the "power" iwconfig setting to "off".
    Note: On newer kernels (tested on 2.6.33) the HOSTAP option (Device Drivers -> Network device support -> Wireless LAN -> IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)) has to be set to implicitly get the WIRELESS_EXT and WEXT_PRIV options which are not accessible with menuconfig.

    Optional: Monitor mode

    Since 5.100.82.111 broadcom-sta driver supports monitor mode. To enable it run

    echo 1 > /proc/brcm_monitor0

    and to disable:

    echo 0 > /proc/brcm_monitor0


    When monitor mode is enabled, prism0 network interface appears. This interface can be used by wireshark, airodump-ng, etc to scan wireless network traffic.

    Troubleshooting

    General Advice

    Your first port of call when problems arise is the output of dmesg, which displays the kernel log. It is also helpful to make sure that only one of the 3 possible modules is loading. The best way to do this is blacklist the modules you don't want. Add the relevant entries from below.

    File: /etc/modprobe.d/blacklist.conf
    blacklist ndiswrapper

    blacklist b43

    blacklist wl

    WEP encryption is not enabled for your device

    If you get an error message saying "WEP encryption is not enabled for your device" or similar it may be necessary to compile the following into the kernel to ensure that the required cryptographic options are enabled. If you compile the cryptographic options as modules, they may not be loaded automatically by the driver.

    iwconfig reports txpower off

    On some laptops the driver does not initialise the device in powered on mode. This can be resolved by adding the following to your network configuration (assuming wlan0 is the device name).

    File: /etc/conf.d/net
    postup () {
            if [[ ${IFACE} == "wlan0" ]]; then
                    iwconfig wlan0 txpower on
            fi
    }
    

    WPA authentication doesn't work with broadcom-sta

    If authentication fails with broadcom-sta, you probably need to enable Host AP (CONFIG_HOSTAP).

    Linux Kernel Configuration: Enabling AP
     Device Drivers --> 
       [*] Network device support --> 
          Wireless LAN
           <*>   IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)
    

    (Old) Device Support List for 43xx Open Source Driver

    This table is *incomplete*, and probably out of date. If your card is unlisted, that doesn't mean that it isn't supported.

    For an up-to-date list for the in-kernel (open source) 43XX driver, read http://wireless.kernel.org/en/users/Drivers/b43/devices

    PCI ID Subsystem PCI ID Device name b43 b43-legacy wl (broadcom-sta)
    14e4:4311 103c:1374 Broadcom Corporation BCM4311 802.11b/g WLAN Yes Not tested Not tested
    14e4:4311 1468:0422 Broadcom Corporation BCM94311MCG wlan mini-PCI (rev 01) Yes Not tested Not tested
    14e4:4312 1028:0007 Broadcom Corporation BCM4312 802.11a/b/g (rev 01) Yes Not tested Not tested
    14e4:4312 103c:1370 Broadcom Corporation BCM4312 802.11a/b/g (rev 02) Partially (results vary with kernel and patches) Not tested Not tested
    14e4:4313 1028:0010 Broadcom Corporation BCM4313 802.11b/g/n (rev 01) No No Yes
    14e4:4315 1028:000b Broadcom Corporation BCM4312 802.11b/g (rev 01) No No Not tested
    14e4:4315 1028:000c Broadcom Corporation BCM4312 802.11b/g (rev 01) No No Yes
    14e4:4315 103c:1508 Broadcom Corporation BCM4312 802.11b/g (rev 01) Yes Not tested Not tested
    14e4:4315 103c:137c Broadcom Corporation BCM4312 802.11b/g (rev 01) No No Yes
    14e4:4315 103c:137d Broadcom Corporation BCM4310 802.11a/b/g (rev 01) No No Not tested
    14e4:4315 105b:e003 Broadcom Corporation BCM4310 USB Controller (rev 01) No No Not tested
    14e4:4315 105b:e003 Broadcom Corporation BCM4312 Mini PCI-E Controller 802.11b/g (rev 01) No No Not tested
    14e4:4318 103c:1355 Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g (rev 02) Yes Not tested Not tested
    14e4:4318 1799:7010 Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 02) No Yes Not tested
    14e4:4320 103c:12fa Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03) Yes No Not tested
    14e4:4320 1737:4320 Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03) Yes No Not tested
    14e4:4320 1799:7010 Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 02) No Yes Not tested
    14e4:4328 103c:1366 Broadcom Corporation BCM4328 802.11a/b/g/n (rev 03)* No No Not tested
    14e4:432b 103c:137f Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01) Not tested Not tested Yes
    14e4:432b 106b:008d Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01) No No Yes
    14e4:4353 106b:0093 Broadcom Corporation Device (rev 01) No No Yes
    14e4:4357 105b:e021 Broadcom Corporation BCM43225 802.11b/g/n Wireless LAN Controller No No Yes
    14e4:4358 105b:e040 Broadcom Corporation BCM43227 802.11a/b/g/n Wireless LAN Controller No Not tested Yes

    (*) N-series Broadcom chips are not supported by any of the 43xx drivers in Linux at this time (August 2008) - https://lists.berlios.de/pipermail/bcm43xx-dev/2008-May/007517.html


    Related Links