# Broadcom with WPA

## RobotGymnast

I've traversed Google a few times, and found out that my wireless network controller (Broadcom BCM 4312) is very bad at working with WPA under Gentoo. I am unable to connect to WPA networks on my Gentoo box, and it's becoming increasingly annoying. I have enabled the options mentioned [URL="https://forums.gentoo.org/viewtopic-t-819099-view-previous.html?sid=c913bec567510ae05ce835cd8a3d2402"]here[/url], and remerged b43-firmware a number of times. Nothing seems to work.

The WEIRD part is, I seem to be able to connect to WPA networks once or twice, for a few seconds, before I get disconnected. It's VERY strange. People around me are able to connect no problem, and there is certainly no MAC filtering or anything of the kind going on (that is, I'm sure it's my hardware/firmware/software combo).

Can ANYBODY help?

Thanks for any help!

----------

## BradN

Suggest trying wpa_supplicant if you're not already - it works well for me but with a different wireless card.

I have run into problems with a b43 - it would connect to the access point but would disconnect after some number of seconds unless I left a ping running, and even then it would perform very poorly.  Ended up solving that by replacing the access point (which was an old linksys B only using wep) with a newer one running dd-wrt.  After that it worked fine with wpa and wpa_supplicant.

I'd post a sample config but I don't have my laptop with me at the moment.  You don't need a lot in the config file besides the network{ } sections, and in those I think you only need the ssid and the key, but if you want to add an unencrypted access point, you need to explicitly tell it key_mgmt=NONE (not sure on the exact syntax, check before you do it).

----------

## RobotGymnast

 *BradN wrote:*   

> 
> 
> ...
> 
> You don't need a lot in the config file besides the network{ } sections, and in those I think you only need the ssid and the key, but if you want to add an unencrypted access point, you need to explicitly tell it key_mgmt=NONE (not sure on the exact syntax, check before you do it).

 

Thanks for the quick reply! So the only way to get it to work is to manually add all network entries, even unencrypted ones, rather than handling them through a manager like NetworkManager or wicd?

----------

## lxg

Please post your PCI ID and/or look at the Broadcom 43xx page in the Gentoo Wiki which driver is correct for you. For example, if your PCI ID is 14e4:4315, you might be better of using the (proprietary) broadcom-sta driver.

Don't fear … if your NIC works, you will be definitely able to use NM or WICD.

----------

## BradN

 *RobotGymnast wrote:*   

> 
> 
> Thanks for the quick reply! So the only way to get it to work is to manually add all network entries, even unencrypted ones, rather than handling them through a manager like NetworkManager or wicd?

 

That's the way I do it - it's not as nice as getting one of the other options working (and in fact I may try those), but for what I use my laptop for, I don't find myself having to connect to foreign AP's that often, and wpa_supplicant is good about choosing the correct AP to connect to as long as it can get scan results.

My only complaint about wpa_supplicant is that it performs kinda strangely with dhcpcd when it becomes disconnected from the AP before dhcpcd finishes what it's doing - you can end up with several of these dhcp scripts running at a time and it's a mess, but as long as your signal is good it shouldn't happen.  Coming out of suspend/hibernate, it gets me a connection in about 15 seconds or so.

----------

## RobotGymnast

 *lxg wrote:*   

> Please post your PCI ID and/or look at the Broadcom 43xx page in the Gentoo Wiki which driver is correct for you. For example, if your PCI ID is 14e4:4315, you might be better of using the (proprietary) broadcom-sta driver.
> 
> Don't fear … if your NIC works, you will be definitely able to use NM or WICD.

 

How to PCI ID?

----------

## lxg

```
lspci -nn | grep Broadcom
```

----------

## RobotGymnast

 *lxg wrote:*   

> 
> 
> ```
> lspci -nn | grep Broadcom
> ```
> ...

 

Huh yeah 14e4:4315. I'll try broadcom-sta.

Update: With broadcom-sta, I'm no longer able to see any wireless networks.

----------

## lxg

 *RobotGymnast wrote:*   

> Update: With broadcom-sta, I'm no longer able to see any wireless networks.

 

Was the package successfully built, or were there any warnings?

Have you actually loaded the driver (lsmod)?

----------

## RobotGymnast

 *lxg wrote:*   

>  *RobotGymnast wrote:*   Update: With broadcom-sta, I'm no longer able to see any wireless networks. 
> 
> Was the package successfully built, or were there any warnings?
> 
> Have you actually loaded the driver (lsmod)?

 

No warnings.Last edited by RobotGymnast on Sun Aug 15, 2010 1:05 pm; edited 2 times in total

----------

## lxg

Ok, during reboot, udev should find the NIC device and load the driver. However, next time you build a module, you also must load it.  :Wink: 

```
modprobe MODULNAME
```

----------

## RobotGymnast

Hmm still no wireless networks found. Configuration issue?

```

me@lappy486 ~ $ lsmod | grep wl

wl                   1947772  0

```

/etc/wpa_supplicant/wpa_supplicant.conf

```

# The below line not be changed otherwise we refuse to work

ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration

ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection

ap_scan=1

# Only WPA-PSK is used. Any valid cipher combination is accepted

network={

  ssid="linksys"

  proto=WPA

  key_mgmt=WPA-PSK

  pairwise=CCMP TKIP

  group=CCMP TKIP WEP104 WEP40

  psk=key

  priority=2

}

```

I don't know if that's right, though. It's mostly copypasta.

/etc/conf.d/net

```

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

modules=( "wpa_supplicant" )

config_eth0=( "dhcp" )

config_wlan0=( "dhcp" )

wpa_supplicant_eth0="-Dbroadcom"

wpa_supplicant_wlan0="-Dbroadcom"

modules_wlan0=( "wl" )

```

No idea if that's right either. Again, copypasta

----------

## lxg

Ok, let's put wpa_supplicant aside for a while.

I see that the driver is loaded. Ok. What does iwconfig or  iwconfig -a say?

What happens on /etc/init.d/net.wlan0 restart (provided that wlan0 is the wireless NIC)?

----------

## RobotGymnast

 *lxg wrote:*   

> Ok, let's put wpa_supplicant aside for a while.
> 
> I see that the driver is loaded. Ok. What does iwconfig or  iwconfig -a say?
> 
> What happens on /etc/init.d/net.wlan0 restart (provided that wlan0 is the wireless NIC)?

 

Ohhh.. there's ONE problem..

```

me@lappy486 ~ $ sudo iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11bg  ESSID:""  Nickname:""

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

          Bit Rate:54 Mb/s   Tx-Power:24 dBm   

          Retry min limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=5/5  Signal level=0 dBm  Noise level=0 dBm

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

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

```

Hmm I used to think my interface was wlan0.. well, it was. Looks like it's eth1 now?

```

me@lappy486 ~ $ sudo /etc/init.d/net.wlan0 restart

 * Caching service dependencies ...                                                                                                                                           [ ok ]

 * Starting wlan0

 *   Configuration not set for wlan0 - assuming DHCP

 *   Bringing up wlan0

 *     dhcp

 *       network interface wlan0 does not exist

 *       Please verify hardware or kernel module (driver)                                                                                                                     [ !! ]

```

----------

## lxg

Yes, seems to be eth1. (Sorry, I can't say for sure if broadcom-sta creates eth1 instead of wlan0, because the other machine isn't here right now – but it wouldn't be unusual.)

Then move /etc/init.d/net.wlan0 to /etc/init.d/net.eth1 and modify your /etc/conf.d/net accordingly.

Don't bother with wpa_supplicant, if you want to use Network Manager, as you stated above. (In fact, you don't even have to bother with /etc/conf.d/net if you're going for NM.)

If you want to use Network Manager with nm-applet, please try to work through the following tutorial: http://en.gentoo-wiki.com/wiki/NetworkManager Elsewise continue with wpa_supplicant as you tried before.

----------

## jordanwb

broadcom-sta creates eth1 instead of wlan0. The broadcom drivers are very finicky. Another laptop I own has a BCM4312 and I could not get it to work, all of a sudden it worked just fine. My current laptop's wired chip uses the tg3 chip (also broadcom) and I have to resort to a kludge in order to get it to work. If possible RobotGymnast, buy an Atheros chip online. You won't have any trouble with those.Last edited by jordanwb on Sun Aug 15, 2010 2:38 pm; edited 1 time in total

----------

## RobotGymnast

 *lxg wrote:*   

> Yes, seems to be eth1. (Sorry, I can't say for sure if broadcom-sta creates eth1 instead of wlan0, because the other machine isn't here right now – but it wouldn't be unusual.)
> 
> Then move /etc/init.d/net.wlan0 to /etc/init.d/net.eth1 and modify your /etc/conf.d/net accordingly.
> 
> Don't bother with wpa_supplicant, if you want to use Network Manager, as you stated above. (In fact, you don't even have to bother with /etc/conf.d/net if you're going for NM.)
> ...

 

Hmm well that's working now, but I get this issue

```

me@lappy486 ~ $ sudo /etc/init.d/net.eth1 start

 * Caching service dependencies ...                                                                                                                                           [ ok ]

 * Starting eth1

 *     The module "wl" does not exist

me@lappy486 ~ $ lsmod | grep wl

wl                   1947772  0 

```

Weird. Also, I was using wicd (which I now prefer to NetworkManager), but it wasn't able to connect to WPA networks, so I thought wpa_supplicant would be an alternative.

If I don't need to mod the /etc/conf.d/net file, can I leave it like I showed in a previous post, or should I reset it back to simpler times?

@jordanwb yeah, I'm definitely not planning on getting another broadcom chip with my next laptop =P

----------

## lxg

Sorry, I don't know wicd, I only can say that NetworkManager does not need (and in fact conflicts with) the /etc/init.d/net.* stuff as well wpa_supplicant. But it seems that the same is true for wicd, according to a tutorial on the Gentoo Wiki.

As for the message of the init script, I don't know what's causing it; one would have to investigate how the init script searches for modules. But as your iwconfig shows the device, it is definitely existent. I'd suggest that you try to try going on to set up wicd, without the init script. As said, it seems to work without net.*, too.

----------

## RobotGymnast

Huh.. well, wicd doesn't seem to work with WPA for me. The general consensus seems to be that broadcom + WPA = failure, so I guess I'll just keep using this ethernet and wait to get home to use the WEP network there.

Thanks for your patience!

----------

## lxg

I can defintely confirm that on the other notebook broadcom-sta works flawlessly with WPA/WPA2.

However – with NetworkManager. That's why I keep recommending it.  :Wink: 

(I can't say which specific Broadcom chip it is, but the machine is a Latitude E4310, if that helps. Next week I'll be able to get my hands on it again and post the PCI ID.)

----------

## RobotGymnast

 *lxg wrote:*   

> I can defintely confirm that on the other notebook broadcom-sta works flawlessly with WPA/WPA2.
> 
> However – with NetworkManager. That's why I keep recommending it. 
> 
> (I can't say which specific Broadcom chip it is, but the machine is a Latitude E4310, if that helps. Next week I'll be able to get my hands on it again and post the PCI ID.)

 

Well I'm not partial to wicd; in fact, I only switched to test if it would work with WPA better. Also, network manager was giving me issues with icons (the "secure network" icon was an "icon not found" icon). I'll try switching back and using broadcom-sta.

----------

## lxg

 *RobotGymnast wrote:*   

> (the "secure network" icon was an "icon not found" icon).

 

Well, if that's your worst problem, many people will certainly envy you.  :Wink: 

----------

