Saturday, 11 July 2009

Broadcom BCM4306 wireless LAN without ndiswrapper

I've been updating an old laptop as you might have read.

Last night I tried to start the wireless LAN, but too many kernel upgrades had obsoleted my setup! When I first got the laptop around 2004, ndiswrapper was the only option. By now I thought there must be a better way! I settled on the b43legacy drivers. Many thanks to that great site for all the specific details.

As I write, I'm using the wireless LAN with b43legacy without problems!

But how? I'll show you the details for the specific WLAN controller in the Dell Inspiron 9100.

According to wireless.kernel.org (wko)
If your card is a BCM4306 Rev 2, or only has 802.11b capability, it uses b43legacy. All other models use b43.
As you can see, I have revision 2, so I have to use the b43legacy driver. To identify your card, type `lspci -vnn | grep 14e4`. This is my response:

Subsystem: Broadcom Corporation Device [14e4:4d64]
02:00.0 Ethernet controller [0200]: Broadcom Corporation BCM4401 100Base-T [14e4:4401] (rev 01)
02:03.0 Network controller [0280]: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller [14e4:4320] (rev 02)
The 14e4 is necessary to use any b43 driver.

At wko, b43legacy is specified for revision 2, and b43 for revision 3.
Supported chip types
* bcm4306 (Rev. 2 uses b43legacy, Rev. 3 uses b43)
Now to configure your kernel. (This may be done for you). Check these options are set:
  • Networking support > wireless
  • Generic IEEE 802.11 Networking Stack (mac80211)
  • Enable LED triggers (MAC80211_LEDS) (if you have LEDs)
Also enable:
  • Network device support > wireless LAN
and the following options:
CONFIG_B43LEGACY=m
CONFIG_B43LEGACY_PCI_AUTOSELECT=y
CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y
CONFIG_B43LEGACY_LEDS=y
CONFIG_B43LEGACY_DEBUG=y
CONFIG_B43LEGACY_DMA=y
# CONFIG_B43LEGACY_DMA_AND_PIO_MODE is not set
CONFIG_B43LEGACY_DMA_MODE=y
# CONFIG_B43LEGACY_PIO_MODE is not set

Now make, install, and reboot! The module b43_legacy was loaded automatically for my by udev.

I use wpa_supplicant to connect. Your config files may vary. Somehow you need to specify that wpa_supplicant should be started like this:
wpa_supplicant -iwlan0 -Dwext -c/etc/wpa_supplement.conf

In gentoo, edit /etc/conf.d/net:
modules_wlan0="wpa_supplicant"
wpa_supplicant_wlan0="-Dwext"
config_wlan0="dhcp"
dhcpcd_wlan0="-L"


There's one final step. The BCM cards need firmware which is loaded by the proprietary windows drivers. You must download this in addition to a firware cutter called b43-fwcutter. In Gentoo, emerge b43-fwcutter. Then run these commands (thanks again to wko).
export FIRMWARE_INSTALL_DIR="/lib/firmware"
wget http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o
sudo b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" wl_apsta-3.130.20.0.o
The output looks like this:
This file is recognised as:
ID : FW10
filename : wl_apsta.o
version : 295.14
MD5 : e08665c5c5b66beb9c3b2dd54aa80cb3
Extracting b43legacy/ucode2.fw
Extracting b43legacy/ucode4.fw
Extracting b43legacy/ucode5.fw
Extracting b43legacy/ucode11.fw
Extracting b43legacy/pcm4.fw
Extracting b43legacy/pcm5.fw
Extracting b43legacy/a0g0bsinitvals2.fw
Extracting b43legacy/b0g0bsinitvals5.fw
Extracting b43legacy/a0g0initvals5.fw
Extracting b43legacy/a0g1bsinitvals5.fw
Extracting b43legacy/a0g0initvals2.fw
Extracting b43legacy/a0g1initvals5.fw
Extracting b43legacy/b0g0bsinitvals2.fw
Extracting b43legacy/b0g0initvals5.fw
Extracting b43legacy/b0g0initvals2.fw
Extracting b43legacy/a0g0bsinitvals5.fw

You may need to specify a different firmware directory. /lib/firmware is correct for Gentoo.

Now you should be able to start your network script. In Gentoo /etc/init.d/net.wlan0 start. syslog shows:

b43legacy-phy0: Loading firmware version 0x127, patch level 14 (2005-04-18 02:36:27)
b43legacy-phy0 debug: Chip initialized
b43legacy-phy0 debug: 30-bit DMA initialized
Registered led device: b43legacy-phy0:tx
Registered led device: b43legacy-phy0:rx
b43legacy-phy0 debug: Wireless interface started
b43legacy-phy0 debug: Adding Interface type 2
b43legacy-phy0 debug: Radio initialized
b43legacy-phy0: Radio turned off by software
b43legacy-phy0: Radio turned on by software
/etc/init.d/net.wlan0[12885]: WARNING: net.wlan0 has started, but is inactive
wlan0: direct probe to AP --:--:--:--:--:-- try 1
wlan0 direct probe responded
wlan0: authenticate with AP --:--:--:--:--:--
wlan0: authenticated
wlan0: associate with AP --:--:--:--:--:--
wlan0: RX AssocResp from --:--:--:--:--:-- (capab=0x431 status=0 aid=2)
wlan0: associated
wpa_cli: interface wlan0 CONNECTED
dhcpcd[13080]: wlan0: dhcpcd 4.0.13 starting
dhcpcd[13080]: wlan0: broadcasting for a lease
dhcpcd[13080]: wlan0: offered x.x.x.148 from x.x.x.1
dhcpcd[13080]: wlan0: acknowledged x.x.x.148 from x.x.x.1
dhcpcd[13080]: wlan0: checking x.x.x.148 is available on attached networks
dhcpcd[13080]: wlan0: leased x.x.x.148 for 604800 seconds
I removed IP addresses, hostnames, and MAC addresses.

And that's it! Let me know how you go, especially if you have an Inspiron 9100. If not, be sure to check out the official site for more details: http://wireless.kernel.org/en/users/Drivers/b43

No comments:

 
Copyright 2009 Another Blog. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan