# Broadcom BCM4312 connects by manual call to wpa_supplicant

## gustafson

Edited 1 time: The subject line has been updated to better reflect my current understanding of the problem... this first post is left for archival purposes.

--

My wireless only connects to insecure ESSIDs and only when I let it connect automatically without the /etc/conf.d/net file.  

When I try connecting to my secure (WPA-PSK) router, it fails.  I'm using baselayout 2.

My hardware is:

```
04:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g (rev 01)
```

My /etc/conf.d/net is:

```
modules_wlan0="!iwconfig wpa_supplicant"

preferred_aps="theESSID" 

config_theESSID="192.168.1.3"

routes_theESSID="default via 192.168.1.1"

dns_servers_theESSID="192.168.1.1"
```

My /etc/wpa_supplicant/wpa_supplicant.conf file is:

```
network={

        ssid="theESSID"

        key_mgmt=WPA-PSK

        psk="thekey"

}
```

I have tried both the b43 and broadcom-sta drivers.  (one at a time... removing both b43 and ssb when trying broadcom-sta)

It doesn't connect when I run the init scripts... the errors are:

```
 /etc/init.d/net.eth1 restart

 * Caching service dependencies ...                                                                                                                    [ ok ]

 * Bringing down interface eth1

 *   Stopping dhcpcd on eth1 ...                                                                                                                          [ ok ]

 *   Removing addresses

 * Bringing up interface eth1

 *   Configuring wireless network for eth1

 *   Scanning for access points

 *     Found "theESSID" at XX:XX:XX:XX:XX:XX, managed, encrypted

 *   WEP key is not set for "theESSID"

 *   Couldn't associate with any access points on eth1

 *   Failed to configure wireless for eth1

 * ERROR: net.eth1 failed to start
```

 for the broadcom driver and

```
 * Bringing down interface wlan0

 *   Removing addresses

 * Bringing up interface wlan0

 *   No configuration specified; defaulting to DHCP

 *   dhcp ...

 *     Running dhcpcd ...

wlan0: dhcpcd 4.0.15 starting

wlan0: read_interface: Unknown error 132                                                                                                                                  [ ok ]

 *     received address                                                                                                                                                               [ ok ]
```

 for the b43 driver.

Also my kernel is:

```
Linux hostname 2.6.33-tuxonice-r2 #21 SMP Thu Jun 17 11:22:09 EDT 2010 x86_64 Intel(R) Core(TM)2 Duo CPU P7450 @ 2.13GHz GenuineIntel GNU/Linux
```

It connects to a neighbors wireless router if I delete /etc/conf.d/net but fails completely when I use the above file.  Any suggestions?  The error messages suggest it is ignoring my wpa_supplicant.conf file.

Trying to connect directly with wpa_supplicant.conf has lead to a connection with the broadcom.sta driver (not reliably).  However, I can't seem to force its use within /etc/conf.d/netLast edited by gustafson on Sun Jun 20, 2010 7:05 pm; edited 1 time in total

----------

## cach0rr0

I would wager you're  missing these from your kernel

```

$ zgrep 80211_CRYPT /proc/config.gz 

CONFIG_LIB80211_CRYPT_WEP=m

CONFIG_LIB80211_CRYPT_CCMP=m

CONFIG_LIB80211_CRYPT_TKIP=m

```

----------

## cach0rr0

sorry for the double post

regarding the 4312, I don't think this works with broadcom-sta

but if you want to try it, broadcom-sta is especially finicky about what kernel options you have selected

I've outlined some of them here - 

https://forums.gentoo.org/viewtopic-t-832270-highlight-broadcom.html

https://forums.gentoo.org/viewtopic-t-816158-highlight-tkip.html#6187066

the short version: try adding LIBIPW and HOSTAP to your kernel, then search through and make sure TKIP, WEP, and CCMP are enabled under the LIB80211_CRYPT_*

----------

## gustafson

OK thanks, 

Yes, I'd seen one of those posts.  I do currently have the CONFIG_LIB80211_CRYPT_{WEP,CCMP,TKIP} and the HOSTAP options set.

Broadcom-sta does work with 4312 (at least in some cases). it worked flawlessly in my first install before I screwed it up debugging sound and had to start from scratch (the short story... don't ever do cat /dev/urandom > /dev/sda when you mean cat /dev/urandom > /dev/dsp... the typo from hell)

Unless I have to, I don't want to mess with the kernel config any more... because the following works with broadcom-sta:

```
wpa_supplicant -ieth1 -c/etc/wpa_supplicant/wpa_supplicant.conf
```

It only works if I explicitly call wpa_supplicant ie neither automatically nor with the net.eth1 script.  However, this means the kernel config is OK... right?  Also, I want to specify my IP address and I haven't found anywhere else to do that beside /etc/conf.d/net.

In that other post, you said these:

```
B43=N

SSB=N

LIB80211=M

WIRELESS_EXT=Y

CFG80211_WEXT=M

WEXT_PRIV=Y

MAC80211=N 
```

I have these:

```
B43=m

SSB=m

LIB80211=y

WIRELESS_EXT=Y

CFG80211_WEXT=M

WEXT_PRIV=Y

MAC80211=M
```

I'm also blacklisting ssb and b43 and mac80211 is not loaded.  (I think this is how it worked in my previous install.)

----------

