# Broadcom Corporation BCM4312 802.11b/g (rev 01)

## creiss

Hey!

Has anyone had any luck getting the

Broadcom Corporation BCM4312 802.11b/g (rev 01)

with Gentoo to work? So far I emerged the broadcom-sta driver (unmasked for amd64) and got an interface up (ie, i see eth1 in ifconfig). I am unsure, however, about the  wlan button on the notebook, wether the card is "on" or not. Its a brand new notebook (Dell Studio 1555) and I have no clue if there is supposed to be a visual feedback of sorts somewhere. The key on the keyboard for wlan on/off does not work with Linux, at least I havent gotten it to work.

Anyway.

Lets assume it works for now. I need/ want to connect to a WPA/PSK AP. I read wpa_supplicant is up for the job, tho it only supports a limited set of drivers. I am unsure wether the proprierty driver of Broadcom will work with it, so I guessed this for conf.d/net:

```

# Prefer wpa_supplicant over wireless-tools

modules=( "wpa_supplicant" )

# It's important that we tell wpa_supplicant which driver we should

# be using as it's not very good at guessing yet

modules_eth1=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dnl80211"

```

I linked net.lo to net.eth1 and created a /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

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers

network={

  ssid="myNet"

  psk="mycleartestphrase"

  # The higher the priority the sooner we are matched

  priority=5

}

```

And started /etc/init.d/net.eth1. However:

```

eth1      Link encap:Ethernet  HWaddr 00:26:5e:83:72:85  

          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)

          Interrupt:17 

```

As usual, any help is greatly appreciated.

Cheers!

-Chris

----------

## d2_racing

Hi, you should read this : https://forums.gentoo.org/viewtopic-t-789838-highlight-.html

----------

## pappy_mcfae

And let me know if you have any issues after you read that thread.

Blessed be!

Pappy

----------

## creiss

Hey and thank you all for your replies!

I read that forum post but there was nothing in there that solved my problem. I do not run ssb as module nor is the b43 driver loaded. The broadcom-sta driver is, hence the eth1 interface. Scanning with wpa_gui (as root, just to be sure) shows no access points, tho there are at least 4 in range. I guess this might be related due one of these things:

1. The Dell Studio 1555 has, like any other modern notebook, a wlan on/off switch. Wlan might be deactivated, but pressing WLAN ON button has no effect.

2. Wrong driver, incorrectly configured.

As Gentoo doesnt even find networks I'll skip the wpa_supplicant problems  :Wink: 

Thank again!

(Hey, it's my birthday, make me a present and help me get the thing to work! (yay, 30!))

-Chris.

----------

## creiss

Quick update:

Tried the Ubuntu installation cd (for testing ONLY!, geesh!) And wlan works there, it even connects with WPA.

No light is flashing, no button pressed, so rule out problem Nr. 1.  :Smile: 

Cheers!

-Chris

----------

## d2_racing

Ok, can you post this then :

```

# cat /etc/udev/rules.d/70-persistent-net.rules

```

----------

## creiss

```

# This file was automatically generated by the /lib64/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# line, and change only the value of the NAME= key.

# PCI device 0x14e4:0x1698 (tg3)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:19:fd:d2:d7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x14e4:0x4315 (wl)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:26:5e:83:72:85", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

```

----------

## d2_racing

Ok, remove these lines and reboot and repost the result :

```

# PCI device 0x14e4:0x4315 (wl)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:26:5e:83:72:85", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

```

----------

## pappy_mcfae

Change this:

```
modules_eth1=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dnl80211" 
```

to this:

```
modules_eth1=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext" 
```

and retry. There is a feature/anomaly/bug in the way wpa_supplicant works with Gentoo. The only device that will work is Dwext. Any other designation does not.

Blessed be!

Pappy

----------

## d2_racing

Also, I tought that the Broadcom-sta driver would create the wlan0 and wmaster0 interface. Why in that case it's eth1 ?

I think that's part of the problem right now.

----------

## pappy_mcfae

From what I've read, wmaster0 comes from kernel native drivers. Since the broadcom-sta isn't kernel native, it wouldn't have that interface.

Blessed be!

Pappy

----------

## d2_racing

And on your box Pappy, do you have an interface wlan0 ? Because the wiki that you wrote had wlan0 and wmaster0  :Razz: 

----------

## pappy_mcfae

For the b43, that should be the case. For the broadcom-sta, you should get:

```
# iwconfig

lo        no wireless extensions.

dummy0    no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11bg  ESSID:""  Nickname:""

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

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

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

          Power Managementmode:All packets received

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

This is my wireless connection as it exists while the wired NIC is operating. wmaster0 is only for b43 and other kernel-native drivers.

Blessed be!

Pappy

----------

## d2_racing

But you have at least wlan0 instead of eth1 like creiss has.

----------

## pappy_mcfae

I named it that through udev. I do it to keep the wireless adapters named as wlan0 until such time as they are setup by my automatic network setup. Though wlan0 is technically functional, it is not up. eth0 in this case is the wired adapter.

Blessed be!

Pappy

----------

## d2_racing

Hi Pappy, can you post your udev rules that do that plz  :Razz: 

----------

## pappy_mcfae

Sure

```
# This file was automatically generated by the /lib/udev/write_net_rules

# program, probably run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single line.

# PCI device 0x10ec:0x8139 (8139too)

#wired adapter

# PCI device 0x10ec:0000:08:08.0 (8139too)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:d4:bd:2b:64", ATTR{type}=="1", KERNEL=="eth*", NAME="wth0"

#broadcom-sta

# PCI device 0x14e4:0x4311 (wl)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:73:20:85:cb", ATTR{type}=="1", KERNEL=="eth*", NAME="wlan0"
```

Hope that helps.

Blessed be!

Pappy

Blessed be!

Pappy

----------

## d2_racing

So, that's the part that is important : 

```
KERNEL=="eth*", NAME="wlan0"
```

----------

## pappy_mcfae

Yes. Originally, it was named eth0. This is not a desired state with my network setup until after the network has detected whether or not the wired adapter is plugged in. That's why I renamed it.

Blessed be!

Pappy

----------

## d2_racing

That makes all your wifi interface wlan0, so that's nice  :Razz: 

----------

## pappy_mcfae

It works well. Sometimes one has to be sneaky to get the computer to cooperate.  :Smile: 

Blessed be!

Pappy

----------

## d2_racing

Yep, in fact  :Razz: 

----------

