# brcmsmac and Broadcom BCM43224 [14e4:4353] Wireless Card

## Psachnodaimonia

As the subject line suggests I am trying to get my Broadcom Wireless Card to run with the in kernel brcmsmac driver and wpa_supplicant. I am running the 3.7.10-gentoo x86_64 kernel. I have been following these instructions from linux wireless for the kernel configuration. ("Broadcom IEEE802.11n PCIe SoftMAC WLAN driver" is compiled as a module). The needed firmware comes from the sys-kernel/linux-firmware package and is located in /lib/firmware/brcm/. Some commands with relevant output:

```
Psachnodaimonia ~ # lsmod

Module                  Size  Used by

brcmsmac              498041  0 

brcmutil                2841  1 brcmsmac

```

```
Psachnodaimonia ~ # dmesg | fgrep brcm

[    8.261029] brcmsmac bcma0:0: mfg 4bf core 812 rev 23 class 0 irq 17

[   11.222397] ieee80211 phy0: brcms_ops_bss_info_changed: qos enabled: false (implement)

[   11.222405] ieee80211 phy0: brcms_ops_config: change power-save mode: false (implement)

```

```
Psachnodaimonia ~ # /etc/init.d/net.wlan0 start

 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...

ioctl[SIOCSIWPMKSA]: Invalid argument

ioctl[SIOCSIWMODE]: Invalid argument

ioctl[SIOCGIWRANGE]: Invalid argument

ioctl[SIOCGIWMODE]: Invalid argument

ioctl[SIOCSIWAP]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWPMKSA]: Invalid argument 

 *   Starting wpa_cli on wlan0 ...

 *   Backgrounding ... ...

 * WARNING: net.wlan0 has started, but is inactive

```

```
Psachnodaimonia ~ # lspci -vnn

04:00.0 Network controller [0280]: Broadcom Corporation BCM43224 802.11a/b/g/n [14e4:4353] (rev 01)

        Subsystem: Dell Wireless 1520 Half-size Mini PCIe Card [1028:000e]

        Flags: bus master, fast devsel, latency 0, IRQ 17

        Memory at f8000000 (64-bit, non-prefetchable) [size=16K]

        Capabilities: [40] Power Management version 3

        Capabilities: [58] Vendor Specific Information: Len=78 <?>

        Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+

        Capabilities: [d0] Express Endpoint, MSI 00

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [13c] Virtual Channel

        Capabilities: [160] Device Serial Number 00-00-e6-ff-ff-89-0c-ee

        Capabilities: [16c] Power Budgeting <?>

        Kernel driver in use: bcma-pci-bridge

```

```
Psachnodaimonia ~ # ifconfig

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        ether 0c:ee:e6:89:54:f3  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

I don't know if this helps, but I previously tried to use the b43 driver which would not even give me an interface, though the driver should support my card (according to this list on linux wireless). I switched to the brcm driver since that is what is used when booting from the Linux Mint installation CD where my wireless card runs without problems.

I am at the end of my wits here, any help is greatly appreciated!Last edited by Psachnodaimonia on Sun Mar 10, 2013 10:13 am; edited 1 time in total

----------

## Ion Silverbolt

Looks like you're on the right track to me. What does your wpa_supplicant.conf file look like?

----------

## Psachnodaimonia

So far I haven't really considered that this might be a problem with how wpa_supplicant talks to the driver, rather than a problem with the driver itself. I would not be at all surprised if I did have something wonky in some configuration file somewhere. (I got them from a friend and then just migrated them from system to system without ever pausing to think what their content might mean.)   :Twisted Evil: 

/etc/wpa_supplicant/wpa_supplicant.conf:

```
# 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

ap_scan=1

fast_reauth=1

#eapol_version=1

network={

        ssid="blablabla"

        key_mgmt=NONE

        wep_key0=N1TNTE82TILBII4947L5SH9Z42

        wep_tx_keyidx=1

        priority=10

}

```

I obviously changed the ssid and key above. That being said, I doubt there is anything wrong with the network block since it works on my other machine. Before I get told off, note that the router set-up is not mine.

Also, /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 /usr/share/doc/openrc*/net.example* and save your configuration

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

# naming the network:

dns_domain_lo="homenetwork"

# use dhcp:

config_eth0="dhcp"

# use wpa_supplicant:

#hotplug_wlan0="no"

#modules_wlan0=( "wpa_supplicant" "udhcpc" )

#modules="wpa_supplicant"
```

Note how I only commented out the configuration for my other computer with out replacing with anything equivalent.    :Twisted Evil: 

----------

## ppurka

Your net file has wpa_supplicant and the config for wlan0 commented out. Is that intentional?

----------

## Psachnodaimonia

Intentional, but not necessarily for a good reason. Like I said that is the configuration from my other computer and at some point I decided that it was better not to have a configuration and hope things work anyway as opposed to a random configuration I don't understand. That being said, I tried adding the following lines with identical results:

```
 12 # use wpa_supplicant:

 13 hotplug_wlan0="no"

 14 modules_wlan0=( "wpa_supplicant" "udhcpc" )

 15 modules="wpa_supplicant"

 16 

 17 # use brcmsmac driver for wlan0:

 18 wpa_supplicant_wlan0="brcmsmac"

```

(The line numbers are added by vim.)

Given the output of lspci I also tried replacing 'wpa_supplicant_wlan0="brcmsmac"' with 'wpa_supplicant_wlan0="bcma-pci-bridge"'. (Like I said, I don't actually know what I am doing with these config files   :Confused:  ). Alas, none of this solves my problem so far.   :Crying or Very sad: 

----------

## ppurka

Since your interface comes up, maybe you should try merging something like wicd or networkmanager/nm-applet. At least temporarily you can try and connect using them. Once the connection is successful, you will find that those network management programs create wpa_supplicant conf files. You can then just copy the configuration and try out net.wlan0 directly. Alternatively, use wpa_gui and try to configure your wireless via the GUI.

----------

## Gusar

wpa_supplicant doesn't interface directly with the driver, it uses either nl80211 or wext. Most drivers nowadays use nl80211 (notable exceptions being ipw2200 and r8712u, also the closed source broadcom-wl driver), but you can activate wext compatibility in the kernel. Yeah, gentoo's official documentation is really poor in this regard.

ioctl errors are usually a sign of missing wext compatibility in the kernel. You can either activate that, or use tools that work with nl20811 (net-wireless/iw and wpa_supplicant with -Dnl28011).

----------

## Psachnodaimonia

Let me report some relevant developments. Me and a friend who is far more knowledgeable than me spent some time trying to get the wireless up and the problem has now evolved to a slightly different one: I believe I am now able to connect to the wireless network, but I am not getting a proper IP address from the router and hence no internet connectivity. 

For starters, the 'wpa_supplicant_wlan0="brcmsmac"' line was indeed nonsense. Instead it now reads 'wpa_supplicant_wlan0="-Dnl80211"' which is one of the things Gusar mentioned in the previous post. My /etc/conf.d/net file in it's entirety now looks like this:

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

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

# please review /usr/share/doc/openrc*/net.example* and save your configuration

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

# naming the network:

dns_domain_lo="homenetwork"

# use dhcp:

config_eth0="dhcp"

# use wpa_supplicant:

modules_wlan0="wpa_supplicant"

wpa_supplicant_wlan0="-Dnl80211"

config_wlan0=( "dhcp" )
```

With this config file in place I no longer get the ioctl errors when running the wlan0 init script:

```
Psachnodaimonia ~ # /etc/init.d/net.wlan0 start

 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...  

 *   Starting wpa_cli on wlan0 ...

 *   Backgrounding ... ...

 * WARNING: net.wlan0 has started, but is inactive

```

However, I do not get an IP address either:

```
Psachnodaimonia ~ # ifconfig wlan0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet6 fe80::eee:e6ff:fe89:54f3  prefixlen 64  scopeid 0x20<link>

        ether 0c:ee:e6:89:54:f3  txqueuelen 1000  (Ethernet)

        RX packets 1591  bytes 78685 (76.8 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 68  bytes 11470 (11.2 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

I also tried (after bringing the interface back down with "/etc/init.d/net.wlan0 stop") starting wpa_supplicant manually as follows:

```
Psachnodaimonia ~ # /usr/sbin/wpa_supplicant -Dnl80211 -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0

Trying to authenticate with 88:25:2c:6d:fc:94 (SSID='blablabla' freq=2437 MHz)

Trying to associate with 88:25:2c:6d:fc:94 (SSID='blablabla' freq=2437 MHz)

Associated with 88:25:2c:6d:fc:94

CTRL-EVENT-CONNECTED - Connection to 88:25:2c:6d:fc:94 completed (auth) [id=2 id_str=]

```

and in another terminal (the first one will be busy for as long as the wpa process continues to run):

```
Psachnodaimonia ~ # dhcpcd wlan0

dhcpcd[3023]: sending commands to master dhcpcd process

```

Running ifconfig I then get the following (still no proper router set IP address or internet connectivity):

```
Psachnodaimonia ~ # ifconfig wlan0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 169.254.144.236  netmask 255.255.0.0  broadcast 169.254.255.255

        inet6 fe80::eee:e6ff:fe89:54f3  prefixlen 64  scopeid 0x20<link>

        ether 0c:ee:e6:89:54:f3  txqueuelen 1000  (Ethernet)

        RX packets 2621  bytes 153726 (150.1 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 119  bytes 20124 (19.6 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

If any of that gives anyone any further ideas what I might try to do, great. Independently of any further comments, I will try to follow up some of the other suggestions already in this thread (enabling kernel support for wext, installing a graphical client to cheat my way into a working configuration   :Wink:  ) as soon as I can regain the will to invest any more time and effort. In some sense I just wanted to add the above for the benefit of anyone with a similar problem that ends up reading this thread in the future, since I wish I had chanced upon some of these commands earlier than I did. In that context I also found the "route" command to be useful:

```
Psachnodaimonia quirin # route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

default         speedport.ip    0.0.0.0         UG    2      0        0 eth0

loopback        localhost       255.0.0.0       UG    0      0        0 lo

link-local      *               255.255.0.0     U     204    0        0 wlan0

192.168.2.0     *               255.255.255.0   U     2      0        0 eth0

```

----------

## Psachnodaimonia

And that has done it. I have enabled wext support in the kernel:

```
  [*] Networking support  --->

      -*- Wireless  --->

      <*>   cfg80211 - wireless configuration API

      [*]     cfg80211 wireless extensions compatibility

```

And finally, I replaced [wpa_supplicant_wlan0="-Dnl80211"] with [wpa_supplicant_wlan0="wext"] in my [/etc/conf.d/net] file. I now have internet connectivity via my wireless card. Thanks again to everyone that replied!

PS: Is there some way to mark this thread as "solved"?

----------

