# [HOWTO] Broadcom cards with B43 & WPA - 2.6.24 kernel

## willie_wang

Note: This is still a work-in-progress. If you spot any errors in syntax, can you please reply and I'll try to get this fixed! Thanks! ~ ww

So here we are again with the famed Broadcom wireless cards. I've gone through a lot of grief trying to get these cards to work in various distros, all having to use ndiswrapper, but with the advent of the 2.6.24 series kernel, and the new B43 native linux wireless drivers, we finally have a full open-source solution to our Broadcom woes.

I have a Broadcom 4318 card, but this should work for other Broadcom cards too. Depending on your card, you may need the B43 Legacy drivers rather than the B43 drivers. If in doubt, there is a list of the supported cards here: http://linuxwireless.org/en/users/Drivers/b43

Special thanks to pappy_mcfae: reading his bug reports and forum posts have helped alot in getting my own wireless working. Thanks also to sera for helping me with the kernel configuration.

Configuring your Kernel

You need to compile your kernel with the B43 or the B43 Legacy module. If in doubt, you can look here http://linuxwireless.org/en/users/Drivers/b43 for the specific module for your card, or you can just install both modules, and the kernel will select the appropriate module for your card.

The Firmware and b43-fwcutter

Once the kernel has been compiled and you've copied the bzimage/genkernel file to your boot folder, you then need to extract and install the firmware. The easiest way is to use wget to get the packages:

```
emerge wget

```

If you are using a 2.6.25 kernel, then you need to extract the newer firmware. Details are on the b43 homepage listed above.

Fetch the b43-fwcutter and the firmware and extract them to /usr/src:

```
cd /usr/src

wget http://bu3sch.de/b43/fwcutter/b43-fwcutter-011.tar.bz2

wget http://downloads.openwrt.org/sources/broadcom-wl-4.80.53.0.tar.bz2

tar xvjf b43-fwcutter-011.tar.bz2

tar xvjf broadcom-wl-4.80.53.0.tar.bz2

```

Compile the b43-fwcutter module:

```
cd b43-fwcutter-011

make && make install

```

Then you can use the firmware cutter to extract the firmware to /lib/firmware. To do that, the directory must exist, so create it, then extract the firmware.

```
mkdir /lib/firmware

b43-fwcutter -w /lib/firmware ../broadcom-wl-4.80.53.0/kmod/apsta.o

```

There you go, you now have the firmware in the correct place. If you compilied the kernel correctly, the kernel will look for the firmware where you just put it.

DHCP, Wireless tools and wpa_supplicant

You need to emerge a few packages to make your firmware operate correctly: dchpcd - for dhcp; wireless tools; wpa_supplicant for WPA protected networks. Unmask these if necessary before emerging.

```
emerge dhcpcd

emerge wireless-tools

emerge wpa_supplicant

```

Configuring wlan0 and starting at boot

you need to create a symlink from from net.lo to net.wlan0 in the init.d folder and then add it to the default run-level so it will start on boot.

```

ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0

rc-update add net.wlan0 default

```

Configuring wpa_supplicant

Configure the network to recognise the wpa_supplicant module, and then configure the driver for wpa_supplicant. This is done by editing the /etc/conf.d/net file.

```
nano /etc/conf.d/net

```

Then add the following to the file:

```
modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf"

```

Next you need to edit your wpa_supplicant file to recognise your wireless network.

```
nano /etc/wpa_supplicant/wpa_supplicant.conf

```

My wpa_supplicant.conf file looks remarkably similar to this:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

ap_scan=1

network={

  ssid="HOME"

  proto=WPA

  key_mgmt=WPA-PSK

  pairwise=TKIP

  psk="This is my secret WPA password"

  priority=2

}

```

Acer Laptops - acer_acpi

If you have an acer laptop, (because they're great! mine's a 5020 series - soon to get an 8920 model! woohoo!) then you need to install acer_acpi for all kernels before 2.6.25, from kernel 2.6.25, acer_acpi is included as wmi_acer.

```
echo "app-laptop/acer_acpi ~amd64" >> /etc/portage/package.keywords

emerge acer_acpi

modprobe acer_acpi

echo "acer_acpi" >> /etc/modules.autoload.d/kernel-2.6

echo "1" > /proc/acpi/acer/wireless

```

Obviously, substitute the "~amd64" for your architecture, ie. "x86" or whatever.

The last line is to enable your wireless card. This line is essential to making your wireless work on acer laptops. Enabling this once should suffice, but sometimes it may be required on each boot.

Few things to note

On loading wlan0, wpa_supplicant throws up an error message. ***INSERT ***

In my experience, this error message has not caused any problems so far, so can safely be ignored.

Also, I'm no linux genius, I've only just started using Gentoo (love it!) but if these instructions don't work, please don't hunt me down. I'll try to help as much as possible though, if you post your comments here.

So on that note, I really hopes this helps people. And happy native linux wirelessing!

 :Very Happy: Last edited by willie_wang on Mon Apr 14, 2008 4:01 pm; edited 1 time in total

----------

## meal

Good work dude!

But for some cards (eg. 4311 ) kernel patch is needed. It can be found @ linuxwireless.org

----------

## willie_wang

 *meal wrote:*   

> Good work dude!
> 
> But for some cards (eg. 4311 ) kernel patch is needed. It can be found @ linuxwireless.org

 

Cheers! Thanks for the pointer  :Smile: 

----------

## willie_wang

Ok. After trying the B43 module for a few days now, I can confirm what pappy_mcfae has been saying in other threads.

The B43 thread is somewhat unreliable. It also has trouble connecting to WPA enterprise networks.

Once I switched to ndiswrapper and the windows drivers, the problem with low bandwidth and WPA enterprise networks was sorted out. I really hope the developers can make a better B43 module - but so far, their progress has been good. The B43 module is definitely a step up from the old BCM43xx one.

To install ndiswrapper and broadcom cards onto 2.6.24 kernels, make sure you blacklist the B43 and ssb modules in /etc/modprobe.d/blacklist for ndiswrapper to work. ~ww

----------

## fbi78

Great work...

Sorry but I haven't followed the develop of the broadcom driver...and I have configurated my cards long time ago...

I have a broadcom 4318 with integrated bluetooth.

Is the new bc43 driver inserted in the kernel 2.6.24?

Why have I to use b43-fwcutter?

Thank you.

----------

## willie_wang

 *fbi78 wrote:*   

> Great work...
> 
> Sorry but I haven't followed the develop of the broadcom driver...and I have configurated my cards long time ago...
> 
> I have a broadcom 4318 with integrated bluetooth.
> ...

 

The b43 module is in the 2.6.24 kernel, but it is my understanding that you also need to use b43-fwcutter to extract the relevant firmware from a file (wl_apsta.o or something like that) into a folder where your kernel can find it, namely in this case, the /lib/firmware folder.

Without this firmware, the kernel module will fail to initialise your wireless device.

----------

## fbi78

Thank you willie_w.

----------

## Nemo1970

Fantastic !!!!! work very well !!!

Thank you for tutorial !!

----------

## madchaz

A litle something I would like to add. 

I am currently trying to get this to work. I noticed b43-fwcutter is in portage, but it is masked. To install it

```
ACCEPT_KEYWORDS="~x86" emerge -a b43-fwcutter
```

Will give more if I find anything

----------

## madchaz

using the b43legacy driver and the right firmware, I can now get my card to start. However, it will not connect. 

My AP is using WEP. My current config looks like this

```

/etc/wpa_supplicant/wpa_supplicant.conf

network={

        key_mgmt=NONE

        priority=-9999999

}

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

network={

        ssid="MYSIDHERE"

        scan_ssid=1

        key_mgmt=IEEE8021X

        eap=TLS

        identity="gohan"

        ca_cert="/etc/cert/ca.pem"

        client_cert="/etc/cert/user.pem"

        private_key="/etc/cert/user.prv"

        private_key_passwd="The passphrase I used on my router to generate my key"

        priority=2

        }

```

When I start wlan0, I get the following

 *Quote:*   

> gohan ~ # /etc/init.d/net.wlan0 start
> 
>  * Starting wlan0
> 
>  *   Starting wpa_supplicant on wlan0 ...
> ...

 

ifconfig shows wlan0 as up, but no IP. I removed the wired card and left only the wireless, same thing. 

```
wlan0     Link encap:Ethernet  HWaddr 00:0D:3A:72:6F:B8  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

my dhcp never sees the ip request comming, so I doupt I ever made it to my AP, who is about 1 foot away.

----------

## madchaz

I was able to get a litle further. 

Got the card recognise and everything using wireless tools. However, the web decrypt fails with the following error

```
WEP decrypt failed (ICV)
```

any idea?

----------

## willie_wang

 *madchaz wrote:*   

> I was able to get a litle further. 
> 
> Got the card recognise and everything using wireless tools. However, the web decrypt fails with the following error
> 
> ```
> ...

 

Hey madchaz!

How are you passing your WEP password to your router? I can't see anything in your wpa_supplicant.conf where this is passed through.

Your first line in your wpa_supplicant looks a little suspect too. Try editing your wpa_supplicant file so it looks something like this:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

ap_scan=1

network={

        key_mgmt=NONE

        priority=-9999999

}

network={

   ssid="static-wep-test2"

   key_mgmt=NONE

   wep_key0="abcde"

   wep_key1=0102030405

   wep_key2="1234567890123"

   wep_tx_keyidx=0

   priority=5

   auth_alg=SHARED

        }

```

Make sure the key matches to its corresponding key index.

It may help to post your /etc/conf.d/net file and also the results of iwlist scan. Also can you connect when your router has no wireless encryption? If you still can't when it has no encryption, then maybe your kernel configuration needs looking at a little more. ~ww

----------

## madchaz

I was never able to get that far with wpa_supplicant. As I stated, I got that far with wireless tools.  

Going back to wpa_supplicant.conf, the first part is actually the default in the file. Removing it changed nothing. 

I am a bit lost with wep_key0 1 and 2. My AP only provides 1 key, not 3. Where am I supposed to put it?

Right now, here is what I get if I try to use the proposed conf, with key1 having been replaced by my WEP key. 

```

 /etc/init.d/net.wlan0 restart

 * Starting wlan0

 *   Starting wpa_supplicant on wlan0 ...

ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Operation not supported                                                                                                                                       [ ok ]th param 5 value 0x1 - 

 *   Starting wpa_cli on wlan0 ...                                                                                                                                                                       [ ok ]

 *     Backgrounding ...
```

I I get this result with or without encryption. I am sure something needs changing, I just can't figure out what...

Here is what I get from ifconfig and iwconfig

```

gohan ~ # iwconfig 

lo        no wireless extensions.

wmaster0  no wireless extensions.

wlan0     IEEE 802.11g  ESSID:""  

          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated   

          Tx-Power=off   

          Retry min limit:7   RTS thr:off   Fragment thr=2346 B   

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

eth0      no wireless extensions.

gohan ~ # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:09:5B:1C:DD:32  

          inet addr:192.168.100.59  Bcast:192.168.100.255  Mask:255.255.255.0

          inet6 addr: fe80::209:5bff:fe1c:dd32/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1727 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1170 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:160345 (156.5 Kb)  TX bytes:161994 (158.1 Kb)

          Interrupt:3 Base address:0x300 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:8 errors:0 dropped:0 overruns:0 frame:0

          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)

wlan0     Link encap:Ethernet  HWaddr 00:0D:3A:72:6F:B8  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

wmaster0  Link encap:UNSPEC  HWaddr 00-0D-3A-72-6F-B8-38-80-00-00-00-00-00-00-00-00  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

/etc/conf.d/net

```

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf" 

```

/etc/wpa_supplicant/wpa_supplicant.conf

```

ap_scan=1

network={

        key_mgmt=NONE

        priority=-9999999

}

network={

   ssid="dbz"

   key_mgmt=NONE

   wep_key0="abcde"

   wep_key1=XXXXXXXXXXXX (real key normaly here)

   wep_key2="1234567890123"

   wep_tx_keyidx=0

   priority=5

   auth_alg=SHARED

        }
```

Here is the result of iwlist scan

```

gohan ~ # iwlist scan

lo        Interface doesn't support scanning.

wmaster0  Interface doesn't support scanning.

wlan0     No scan results

eth0      Interface doesn't support scanning.

```

I know the AP is in range (they are sitting next to one another) and broadcasting SSID. (I can see it using the same card and windows)

----------

## madchaz

Dusted out my d-link wpa capable AP to see if I could get this to work. Upgraded the firmware to the latest version (Had put it away as it had HUGE stability issues that are apparently fixed in the latest firmware)

Got it all setup. Configured wpa_supplicant to use it. I am geting the exact same error as above when trying to start net.wlan0

----------

## willie_wang

Well, first thing's first. You're not picking up any AP scan results from your wireless card (see iwlist scan), which means that it's not actually working properly. Although the firmware must be installed (because the card shows). Have you got a wireless switch anywhere on your machine, if so, just double check if you've switched it on. The results of 

```
dmesg | grep b43
```

 might help us determine what's wrong with your setup. Please could you post the results?

Ok, I'm not a router expert, but I'm pretty sure when you set your WEP key, then you usually have 4 text input slots, sure and safe method would be to put the same key in all of the key fields on your router then format the relevant bit in your wpa_supplicant.conf so it looks like below,

network={

        ssid="My-Home"

        key_mgmt=NONE

	wep_key0=ABCDEF01234

	wep_tx_keyidx=0

	priority=5

}

This code:

```
ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Operation not supported                                                                                                                                       [ ok ]th param 5 value 0x1 -

 *   Starting wpa_cli on wlan0 ...                                                                                                                                                                       [ ok ] 
```

is okay. It's exactly the same as what I get when I use B43, but my wireless works fine, so I'd ignore this.

Also, just have a look at your dmesg output to see if there's anything strange going on there.

----------

## madchaz

Thanks for your help, it is very appreciated

The card is PCMCIA, not internal, so no switch. 

My router only asks for a "passphrase" that it then changes into an HEX value that I use to authenticate. This HEX number is what I input under windows to get the card to connect. (for the WEP one)

dmesg does not give much. Ran this after having tried to restart net.wlan0

```
gohan ~ # dmesg | grep b43

b43legacy-phy0: Broadcom 4306 WLAN found

b43legacy-phy0: Radio turned off by software

```

----------

## mage2k06

I don't see either the B43 or the B43 legacy drivers anywhere in the menuconfig menus (nor the bcm43xx).  Is there something else I need to enable to get them to show up?  I can see the drivers in drivers/net/wireless directory but it doesn't appear that they've ever been built (no .o/.ko files).

----------

## mage2k06

 *mage2k06 wrote:*   

> I don't see either the B43 or the B43 legacy drivers anywhere in the menuconfig menus (nor the bcm43xx).  Is there something else I need to enable to get them to show up?  I can see the drivers in drivers/net/wireless directory but it doesn't appear that they've ever been built (no .o/.ko files).

 Ok, nevermind, I just figured out that I can backtrack kernel dependencies by crossreferencing the Kconfig files with the .config file.  I'll be back here if I have any more issues.

----------

## willie_wang

 *mage2k06 wrote:*   

>  *mage2k06 wrote:*   I don't see either the B43 or the B43 legacy drivers anywhere in the menuconfig menus (nor the bcm43xx).  Is there something else I need to enable to get them to show up?  I can see the drivers in drivers/net/wireless directory but it doesn't appear that they've ever been built (no .o/.ko files). Ok, nevermind, I just figured out that I can backtrack kernel dependencies by crossreferencing the Kconfig files with the .config file.  I'll be back here if I have any more issues.

 

or while in "make menuconfig", you can just hit the "/" button and type in "b43" and it'll tell you where to find the module and what it depends on.  :Wink: 

----------

## mage2k06

 *willie_w wrote:*   

>  *mage2k06 wrote:*    *mage2k06 wrote:*   I don't see either the B43 or the B43 legacy drivers anywhere in the menuconfig menus (nor the bcm43xx).  Is there something else I need to enable to get them to show up?  I can see the drivers in drivers/net/wireless directory but it doesn't appear that they've ever been built (no .o/.ko files). Ok, nevermind, I just figured out that I can backtrack kernel dependencies by crossreferencing the Kconfig files with the .config file.  I'll be back here if I have any more issues. 
> 
> or while in "make menuconfig", you can just hit the "/" button and type in "b43" and it'll tell you where to find the module and what it depends on. 

 Even better  :Smile: 

----------

## madchaz

Bump

still can't get it to work ...

----------

## willie_wang

 *madchaz wrote:*   

> Bump
> 
> still can't get it to work ...

 

Have you tried connecting with an open AP, i.e. no encryption? Try that, if you can connect with no encryption, then it's a problem with your wpa_supplicant info.

If you can't, then it'll be the way you set up your hardware. Check your kernel configuration. In kernels before 2.6.25, check that networking > wireless > networking stack > then the various decryption options are compiled.

Then double check your wpa_supplicant - look at the howtos on the wiki - they got me up and running.

Hope this helps - if you still can't get this set up, then I suppose ndiswrapper'll be your next best friend  :Wink: 

----------

## pilla

Moved from Networking & Security to Documentation, Tips & Tricks.

----------

## NixdorfZippaHed

 *willie_wang wrote:*   

> To install ndiswrapper and broadcom cards onto 2.6.24 kernels, make sure you blacklist the B43 and ssb modules in /etc/modprobe.d/blacklist for ndiswrapper to work. ~ww

 

I haven't been able to get ndiswrapper working on my laptop (I have an acer ferrari 3400 with an amd64 processor) for any of the 2.6.24- line of kernels. I have been using ndiswrapper with a Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03) since 2005 (1118404930: Started emerge on: Jun 10, 2005 12:02:10). Did you have to change any of your kernel settings when you went to the 2.6.24 line of kernels? When I build my kernel I do not build any of the bcm modules. Should I?

Thanks.

----------

## IvanMajhen

 *madchaz wrote:*   

> Thanks for your help, it is very appreciated
> 
> The card is PCMCIA, not internal, so no switch. 
> 
> My router only asks for a "passphrase" that it then changes into an HEX value that I use to authenticate. This HEX number is what I input under windows to get the card to connect. (for the WEP one)
> ...

 

Do you have RFKILL=y selected?

----------

## iulius

Hi!

I've read this discussion and read the wiki entry for the b43 driver. my card just runs with the b43legacy driver but it's up and running and i can see my neighbours wirelesses.

anyway, when i try to connect to my wpa1 secured wireless i get the following error message:

```
ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 5 value 0x1 - Trying to associate with SSID 'Netzwerk'

ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 5 value 0x1 - 

```

i'm using this conf file:

```

# This is a network block that connects to any unsecured access point.

# We give it a low priority so any defined blocks are preferred.

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

ap_scan=2

update_config=1

network={

        ssid="Netzwerk"

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=TKIP

        psk="my_key"

        priority=1

}

```

however i can't get it working. any ideas, what's wrong?

thx!

Iulius

----------

## NixdorfZippaHed

 *iulius wrote:*   

> Hi!
> 
> I've read this discussion and read the wiki entry for the b43 driver. my card just runs with the b43legacy driver but it's up and running and i can see my neighbours wirelesses.
> 
> anyway, when i try to connect to my wpa1 secured wireless i get the following error message:
> ...

 

I haven't been able to get the braodcom drivers working yet, but I have ndiswrapper working on kernel 2.6.23-gentoo-r9. I used the wpa gui to connect to a wpa protected network and it produced a few different options that are not in your config. I'll paste it below. Have you tried the gui to configure your network?

```

network={

        ssid="DarkCrystal"

        psk="EssenceOfGelfling"

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=TKIP

        group=TKIP WEP104 WEP40

}

```

Cheers.

----------

## code933k

Posting your card series BCMxxx, kernel and used firmware would make easier our lives   :Wink: 

BTW b43 doesn't work quite good with earlier kernels. Look at their home page. 2.6.24 should work

but latest firmware versions require higher kernels (ie. 2.6.25.x).

----------

## krenshala

I'd just like to throw out a thank you for this thread, as it has helped me get a BCM4318 PCMCIA card working in 2.6.26-r4.

The error about Operation not permitted I was able to fix by changing my firewall (iptables) settings to allow the wireless card to send and receive data (I hadn't unblocked it yet since it wasn't working before).

Oh, and for others that use a Passphrase for WEP: use the hex key generated from the passphrase, and if you aren't sure about which key to use pick wep_key_0 (or if you only have one key listed in the router).

----------

## JoHo42

Hi people,

i use the kernel 2.6.26.

I try with howto with different firmwares, but they all not works.

Use some people the gentoo-kernel-2.6.26, with b43 broadcom module?

greating

joerg

----------

