# [SOLVED] broadcom-sta with BCM4331 issue after world update

## DZoom

The wl module just didn't work any more, switching to b43 did. See below for details

Original post:

Hi,

I updated my Gentoo but after a final reboot the wifi stopped working.

As it's an old Macbook, i need the broadcom-sta firmware for the contained BCM4331 WiFi chip.

Worked flawlessly before, but wpa_supplicant doesn't work right now.

When starting to look into it, i found that seemingly before the update the wifi device name was wlp3s0b1, while now it is wlp3s0.

So i changed it in /etc/init.d:

```
cd /etc/init.d

rm net.wlp3s0b1

ln -s net.lo net.wlp3s0
```

And didn't add it to any runlevel as it was before:

```
# rc-update show -v | grep 'net\.'

         net.enp2s0f0 |                                        

               net.lo |                                        

           net.wlp3s0 | 
```

And i updated /etc/conf.d/net accordingly:

```
# cat /etc/conf.d/net

# ethernet

config_enp2s0f0="dhcp"

# wifi

modules_wlp3s0="wpa_supplicant"

config_wlp3s0="dhcp"
```

My modules blacklist:

```
# cat /etc/modprobe.d/blacklist.conf 

# deactivate the following four module to run the proprietary

#  broadcom-sta B43 driver

blacklist b43

blacklist bcma

blacklist ssb

blacklist mac80211
```

And what dmesg says:

```
[    3.683551] systemd-udevd[2169]: eth0: Process 'net.sh enp2s0f0 start' failed with exit code 1.

[    3.691872] wl: loading out-of-tree module taints kernel.

[    3.691877] wl: module license 'MIXED/Proprietary' taints kernel.

[    3.691878] Disabling lock debugging due to kernel taint

[    3.720235] systemd-udevd[2177]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.

[    3.720244] systemd-udevd[2182]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.

[    3.725496] systemd-udevd[2177]: sit0: Process 'net.sh sit0 start' failed with exit code 1.

[    3.749005] systemd-udevd[2173]: Using default interface naming scheme 'v245'.

[    3.834768] wlan0: Broadcom BCM4331 802.11 Hybrid Wireless Controller 6.30.223.271 (r587334)

[    3.836034] systemd-udevd[2175]: Using default interface naming scheme 'v245'.

[    3.837181] systemd-udevd[2175]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.

[    3.837322] wl 0000:03:00.0 wlp3s0: renamed from wlan0
```

When i plug in an ethernet  cable, ethernet works, but Wifi doesn't.

wpa_gui just gives me ret=-22.

Loading and unloading the module wl doesn't change anything.

Restartung wpa_supplicant doesn't change anything.

I'm out of options, any ideas?Last edited by DZoom on Tue Jan 19, 2021 12:55 pm; edited 1 time in total

----------

## NeddySeagoon

DZoom,

That all looks good but it appears that the interface did not start.

What does 

```
/etc/init.d/net.wlp3s0 start
```

 do?

What is in 

```
ifconfig
```

 now?

Be aware that with both interfaces up in the same subnet, you may well loose networking altogether.

```
/etc/init.d/net.wlp3s0 stop
```

should fix that.

----------

## DZoom

Hi,

I had to remove the old '/var/run/wpa_supplicant/wlp3s0', but afterwards the interface seemed to come up:

```
# /etc/init.d/net.wlp3s0 start

 * Bringing up interface wlp3s0

 *   Starting wpa_supplicant on wlp3s0 ...

Successfully initialized wpa_supplicant                                                                                                                  [ ok ]

 *   Starting wpa_cli on wlp3s0 ...                                                                                                                      [ ok ]

 *   Backgrounding ... ...

 * WARNING: net.wlp3s0 has started, but is inactive
```

ifconfig:

```
# ifconfig

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

        inet 192.168.0.189  netmask 255.255.255.0  broadcast 192.168.0.255

        ether c8:2a:14:01:ca:8a  txqueuelen 1000  (Ethernet)

        RX packets 234  bytes 23527 (22.9 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 183  bytes 24038 (23.4 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

        device interrupt 16  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        loop  txqueuelen 1000  (Local Loopback)

        RX packets 8  bytes 540 (540.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 8  bytes 540 (540.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

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

        ether e0:f8:47:0d:33:44  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

        device interrupt 17
```

Usually only Wifi is used, currently i ethernetted the macbook so i can access it from my Desktop and write this posts

----------

## NeddySeagoon

DZoom,

There is no IP address for wlp3s0 in ifconfig.

What did the attempt to start it leave in dmesg?

Further,  

```
# /etc/init.d/net.wlp3s0 start

 * Bringing up interface wlp3s0 
```

did not spit out a warning about wlp3s0 already being started.

What does 

```
rfkill
```

 have to say about wifi?

----------

## DZoom

How could there be an IP address, wpa_supplicant can't trigger the connection to the right WiFi which runs the DHCP server?

Bringing the device up manually (/etc/init.d/net.wlp3s0 start) doesn't add anything to dmesg.

Before i manually started net.wlp3s0 it wasn't started, it's not in any runlevel (see my first post).

rfkill output:

```
# rfkill

ID TYPE DEVICE        SOFT      HARD

 0 wlan phy0     unblocked unblocked

 1 wlan brcmwl-0 unblocked unblocked
```

----------

## NeddySeagoon

DZoom,

wpa_supplicant should have been triggered by 

```
/etc/init.d/net.wlp3s0 start
```

----------

## DZoom

Well that's what wrote in my second post, when starting wlp3s0, wpa_supplicant was brought up without errors as well, right?

----------

## NeddySeagoon

DZoom,

You did.

```
 * Bringing up interface wlp3s0

 *   Starting wpa_supplicant on wlp3s0 ...
```

You also wrote  *Quote:*   

> Bringing the device up manually (/etc/init.d/net.wlp3s0 start) doesn't add anything to dmesg.

 which is a contradiction.

wpa_supplicant starting should have left messages in dmesg about associating and authenticating.

Those steps are required before dhcpcd can use the wifi to request an IP address.

----------

## DZoom

NeddySeagon, thank you for your input.

In the end i solved the issues a way not everybody might agree with, as i didn't further investigate what was with the wl module offered by broadcom-sta.

Works-For-Me solution:

1. unmerge broadcom-sta

2. emerge sys-firmware/b43-firmware

3. edit /etc/conf.d/modules, replacing the loaded module wl with b43:

```
# cat /etc/conf.d/modules

modules=b43
```

4. update the module blacklisting, comment every module that had to be blacklisted for wl, and blacklist wl, new content of file:

```
# cat /etc/modprobe.d/blacklist.conf

blacklist wl
```

5. as i don't know which file takes precedence (/etc/conf.d/modules or /etc/modules-load.d/network.conf), i updated the one present in my system (/etc/conf.d/modules) and followed the handbook [1] / kernel module guide [2] and created /etc/modules-load.d/network.conf as well and put b43 there:

```
# cat /etc/modules-load.d/network.conf

b43
```

After a reboot lsmod now shows the modules that are necessary for the b43 module to work and no more wl.

I don't know if this solution is what actually solved the issue, because in the process i also migrated to NetworkManager as described here [3] with one important addition: i commented out everything in /etc/conf.d/net, so the file is now essentially empty. To my understanding this should be the case, but the documentation lacks such a statement?

Only open question: Do i need /etc/conf.d/modules and /etc/modules-load.d/network.conf? Or is one a leftover and only the other one necessary? In theory it should be possible to keep only the relevant one, remove wl.ko from /lib/modules/5.4.80-gentoo-r1/net/wireless and then no module has to be blacklisted anymore.

Anyway, this problem is solved.

[1] https://wiki.gentoo.org/wiki/Handbook:Parts/Installation/Kernel

[2] https://wiki.gentoo.org/wiki/Kernel_Modules

[3] https://wiki.gentoo.org/wiki/NetworkManager

----------

