If you have one of the Broadcom wireless chipsets that are not supported by b43, you were stuck with broadcom-sta … until now.
The nice people at linuxwireless.org have created an OpenSource driver which is now part of the official Linux kernel. It’s actually quite easy to set up and mostly documented, but there are a few pitfalls. So I thought I’ll write a little Howto to sum up the necessary steps.
First, you need a 2.6.38 Linux kernel or higher. Gentoo’s latest gentoo-sources currently are at 2.6.38-r1.
Start menuconfig, and go to:
-> Staging drivers
-> Exclude Staging drivers from being built
-> Broadcom IEEE802.11n WLAN drivers
-> Broadcom IEEE802.11n driver style
In the selection menu, select the correct driver type. For 4353, this will be the “SoftMAC” driver.
The new driver still needs firmware to be built into the kernel. This firmware is available from the kernel’s Git repository:
mkdir ~/kernelgit
cd ~/kernelgit
git clone git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git
This will give you a bunch of firmware files. For 4353, we need two files which are in the linux-firmware/brcm/ directory and are named something like bcm43xx-0-610-809-0.fw and bcm43xx_hdr-0-610-809-0.fw. The numeric parts may vary.
Now here comes the special part, which isn’t documented, at least not good enough: Usually, you would simply put these files in /lib/firmware, and add them to
Device Drivers --->
Generic Driver Options --->
External firmware blobs to build into the kernel binary
resulting in something like this:
(bcm43xx-0-610-809-0.fw bcm43xx_hdr-0-610-809-0.fw) External firmware blobs to build into the kernel binary
(/lib/firmware) Firmware blobs root directory
If this is done, you can build the kernel the usual way.
But: When starting the system, you will see with lsmod that although the driver is loaded, iwconfig won’t show wireless devices. Why’s that? The answer is provided by dmesg:
brcm80211: module is from the staging directory, the quality is unknown, you have been warned.
brcm80211 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
brcm80211 0000:02:00.0: setting latency timer to 64
brcm80211: fail to load firmware brcm/bcm43xx-0.fw
brcm80211: Failed to find firmware usually in /lib/firmware/brcm
brcm80211 0000:02:00.0: PCI INT A disabled
brcm80211: wl_pci_probe: wl_attach failed!
Apparently, the driver doesn’t use the firmware built into the kernel, but it loads the firmware from the userspace. And: it expects a different file at a different location!
Therefore, you must create the directory /lib/firmware/brcm directory and put the files – renamed! – there:
cd /lib/firmware
mkdir brcm
cp bcm43xx-0-610-809-0.fw brcm/bcm43xx-0.fw
cp bcm43xx_hdr-0-610-809-0.fw brcm/bcm43xx_hdr-0.fw
modprobe -r brcm80211 && modprobe brcm80211
dmesg | tail -n 15
where the dmesg command will issue:
brcm80211: module is from the staging directory, the quality is unknown, you have been warned.
brcm80211 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
brcm80211 0000:02:00.0: setting latency timer to 64
Found chip type AI (0x1381a8d8)
Applying 43224B0+ WARs
wlc_bmac_attach:: deviceid 0x4353 nbands 2 board 0xe macaddr: c4:46:19:0e:dc:46
ieee80211 phy4: Selected rate control algorithm 'minstrel_ht'
wl_set_hint: Sending country code US to MAC80211
wl0: Broadcom BCM43xx 802.11 MAC80211 Driver (1.82.8.0) (Compiled at 02:08:44 on Apr 4 2011)
And iwconfig will now show the device, too.
Hooray!
(Of course, it makes sense to put the firmware files into the expected location directly, so we don’t need to keep each file twice.)