BCM4313 - Broadcom Wi-Fi - Which Driver to use?

Way outside my skill set, I'm afraid.

I'll probably just re-install from the USB.

You can, but can also try to switch to TTY2 with Ctrl+Alt+F2 and log in to the terminal environment.
Then you could simply plug in your phone, tap through on your phone to USB tethering and a connection would appear automatically on your computer.

Sorry...Greek to me.

I'll get back to you guys after the re-install and try to post the 3 reports that tbg asked for before it breaks again.

1 Like

Admittedly it sounded the same to me before I tried it. :blush:

1 Like
lsmod | sort

ac                     16384  0
acpi_cpufreq           28672  0
af_alg                 28672  6 algif_hash,algif_skcipher
agpgart                53248  2 ttm,drm
ahci                   40960  2
algif_hash             16384  1
algif_skcipher         16384  1
atkbd                  36864  0
b43                   454656  0
battery                24576  1 thinkpad_acpi
bcma                   65536  3 b43,brcmsmac
bluetooth             671744  41 btrtl,btintel,btbcm,bnep,btusb,rfcomm
bnep                   28672  2
brcmsmac              630784  0
brcmutil               20480  1 brcmsmac
btbcm                  16384  1 btusb
btintel                28672  1 btusb
btrtl                  24576  1 btusb
btusb                  65536  0
ccm                    20480  6
ccp                    98304  0
cfg80211              851968  3 b43,mac80211,brcmsmac
cmac                   16384  3
cordic                 16384  2 b43,brcmsmac
crc16                  16384  2 bluetooth,ext4
crc32c_generic         16384  2
crypto_user            16384  0
drm                   516096  11 drm_kms_helper,radeon,ttm
drm_kms_helper        217088  1 radeon
ecc                    32768  1 ecdh_generic
ecdh_generic           16384  2 bluetooth
ehci_hcd               98304  1 ehci_pci
ehci_pci               20480  0
evdev                  24576  24
ext4                  782336  1
fb_sys_fops            16384  1 drm_kms_helper
fuse                  139264  5
hid                   143360  2 usbhid,hid_generic
hid_generic            16384  0
i2c_algo_bit           16384  1 radeon
i2c_piix4              28672  0
i8042                  32768  0
input_leds             16384  0
ip_tables              36864  0
irqbypass              16384  1 kvm
jbd2                  135168  1 ext4
joydev                 28672  0
k10temp                16384  0
kvm                   790528  0
ledtrig_audio          16384  3 snd_hda_codec_generic,snd_hda_codec_realtek,thinkpad_acpi
libahci                40960  1 ahci
libarc4                16384  1 mac80211
libata                274432  2 libahci,ahci
libphy                102400  2 r8169,realtek
libps2                 20480  2 atkbd,psmouse
loop                   40960  0
mac80211              991232  2 b43,brcmsmac
mac_hid                16384  0
mbcache                16384  1 ext4
mc                     61440  4 videodev,videobuf2_v4l2,uvcvideo,videobuf2_common
memstick               20480  1 rtsx_pci_ms
mmc_core              184320  3 rtsx_pci_sdmmc,b43,ssb
Module                  Size  Used by
mousedev               24576  0
nvram                  16384  1 thinkpad_acpi
ohci_hcd               57344  1 ohci_pci
ohci_pci               20480  0
pcmcia                 77824  1 ssb
pcmcia_core            32768  1 pcmcia
pcspkr                 16384  0
psmouse               180224  0
r8169                  94208  0
radeon               1646592  26
realtek                20480  1
rfcomm                 90112  16
rfkill                 28672  9 bluetooth,thinkpad_acpi,cfg80211
rng_core               16384  2 ccp,b43
rtsx_pci               81920  2 rtsx_pci_sdmmc,rtsx_pci_ms
rtsx_pci_ms            24576  0
rtsx_pci_sdmmc         32768  0
scsi_mod              249856  2 sd_mod,libata
sd_mod                 57344  3
serio                  28672  10 serio_raw,atkbd,psmouse,i8042
serio_raw              20480  0
snd                   106496  17 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,thinkpad_acpi,snd_pcm
snd_hda_codec         155648  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_codec_generic    94208  1 snd_hda_codec_realtek
snd_hda_codec_hdmi     73728  1
snd_hda_codec_realtek   126976  1
snd_hda_core          102400  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_hda_intel          49152  4
snd_hwdep              16384  1 snd_hda_codec
snd_intel_nhlt         20480  1 snd_hda_intel
snd_pcm               135168  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
snd_timer              40960  1 snd_pcm
soundcore              16384  1 snd
sp5100_tco             20480  0
squashfs               69632  0
ssb                    94208  1 b43
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
thinkpad_acpi         110592  0
ttm                   122880  1 radeon
uinput                 20480  0
usbhid                 65536  0
uvcvideo              114688  0
videobuf2_common       57344  2 videobuf2_v4l2,uvcvideo
videobuf2_memops       20480  1 videobuf2_vmalloc
videobuf2_v4l2         28672  1 uvcvideo
videobuf2_vmalloc      20480  1 uvcvideo
videodev              249856  3 videobuf2_v4l2,uvcvideo,videobuf2_common
wmi                    36864  1 wmi_bmof
wmi_bmof               16384  0
xhci_hcd              282624  1 xhci_pci
xhci_pci               20480  0
x_tables               49152  1 ip_tables


inxi -SM; hwinfo --netcard --bluetooth | grep -Ei "(hotplug|speed|model|status|cmd|file|detected|driver:)" | grep -v "Config S" && echo "System install date $(head -n1 /var/log/pacman.log | cut -d " " -f1 | cut -c 2-11)"
System:
  Host: ThinkPad-X131e Kernel: 5.4.6-2-MANJARO x86_64 bits: 64 
  Desktop: KDE Plasma 5.17.4 Distro: Manjaro Linux 
Machine:
  Type: Laptop System: LENOVO product: 33722WU v: ThinkPad X131e 
  serial: <root required> 
  Mobo: LENOVO model: 33722WU v: Win8 Pro DPK TPG serial: <root required> 
  UEFI [Legacy]: LENOVO v: G9ETA0WW (2.60 ) date: 03/13/2015 
  Model: "Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller"
  Driver: "r8169"
  Device File: enp3s0
  Link detected: no
    Driver Status: r8169 is active
    Driver Activation Cmd: "modprobe r8169"
  Model: "Broadcom BCM4313 802.11bgn Wireless Network Adapter"
  Driver: "bcma-pci-bridge"
  Device File: wlp2s0b1
  Link detected: yes
    Driver Status: bcma is active
    Driver Activation Cmd: "modprobe bcma"
System install date 2020-01-25

sudo dmesg  | grep -Ei 'error|fail|firm|regdom|wmi|wl|b43|80211|brcm|ssb|bcma|deauth' | grep -viE 'acpi|ras|nvidia|eth'
[sudo] password for dave: 
[    1.034145] pci 0000:00:14.2: reg 0x10: [mem 0xf0b40000-0xf0b43fff 64bit]
[   13.484831] bcma-pci-bridge 0000:02:00.0: bus0: Found chip with id 0x4313, rev 0x01 and package 0x08
[   13.484872] bcma-pci-bridge 0000:02:00.0: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x24, class 0x0)
[   13.484898] bcma-pci-bridge 0000:02:00.0: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x18, class 0x0)
[   13.484940] bcma-pci-bridge 0000:02:00.0: bus0: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x11, class 0x0)
[   13.568252] bcma-pci-bridge 0000:02:00.0: bus0: Bus registered
[   14.384346] battery: extension failed to load: ThinkPad Battery Extension
[   16.013351] psmouse serio5: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 3/3
[   18.179998] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   18.227255] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   18.959722] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-21f4.hcd failed with error -2
[   18.959737] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-0a5c-21f4.hcd not found
[   19.489865] Support for cores revisions 0x17 and 0x18 disabled by module param allhwsupport=0. Try b43.allhwsupport=1
[   19.489936] b43: probe of bcma0:1 failed with error -524
[   19.738608] brcmsmac bcma0:1: mfg 4bf core 812 rev 24 class 0 irq 17
[   19.740328] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   19.741537] ieee80211 phy0: registered radio enabled led device: brcmsmac-phy0:radio gpio: 499
[   19.790613] brcmsmac bcma0:1 wlp2s0b1: renamed from wlan0
[   23.777159] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)
[   23.777178] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)
[   23.900641] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)
[   23.900660] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)
[  137.180416] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: false (implement)
[  137.180435] brcmsmac bcma0:1: brcms_ops_config: change power-save mode: false (implement)
[  138.309923] wlp2s0b1: authenticate with 14:59:c0:84:e3:b3
[  138.325540] wlp2s0b1: send auth to 14:59:c0:84:e3:b3 (try 1/3)
[  138.327842] wlp2s0b1: authenticated
[  138.329957] wlp2s0b1: associate with 14:59:c0:84:e3:b3 (try 1/3)
[  138.336462] wlp2s0b1: RX AssocResp from 14:59:c0:84:e3:b3 (capab=0x1411 status=0 aid=1)
[  138.337035] brcmsmac bcma0:1: brcmsmac: brcms_ops_bss_info_changed: associated
[  138.337044] brcmsmac bcma0:1: brcms_ops_bss_info_changed: qos enabled: true (implement)
[  138.337079] wlp2s0b1: associated
[  138.346949] brcmsmac bcma0:1: wl0: brcms_c_d11hdrs_mac80211: AC_VO txop exceeded phylen 159/256 dur 1778/1504
[  138.365170] brcmsmac bcma0:1: wl0: brcms_c_d11hdrs_mac80211: AC_VO txop exceeded phylen 137/256 dur 1602/1504
[  138.554675] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0b1: link becomes ready
[  139.767109] brcmsmac bcma0:1: brcms_ops_bss_info_changed: arp filtering: 1 addresses (implement)

Blacklist the wl, brcm80211 and b43 modules and all its dependencies.

With a root capable text editor create the following blacklist file:

/etc/modprobe.d/brcmsmac.conf

Use this command to create the required conf file:

sudo nano /etc/modprobe.d/brcmsmac.conf

Paste the following into the new conf file:

blacklist mac80211
blacklist brcm80211
blacklist brcmsmac
blacklist brcmfmac
blacklist cfg80211
blacklist lib80211_crypt_tkip
blacklist lib80211
blacklist b43
blacklist b43legacy
blacklist bcma
blacklist ssb
blacklist wl

Save the file and then reboot:

After rebooting issue:

sudo modprobe brcmsmac && sudo depmod -a && sudo mkinitcpio -P && sudo systemctl restart NetworkManager

Your wifi driver will now not autoload at boot without a modprobe (after creating the blacklist file).

After login the brcmsmac driver can be loaded manually via modprobing with:

sudo modprobe brcmsmac

The driver can be made to load automatically after start up with a service.

Create the following file with a root text editor:

/etc/systemd/system/brcmsmac.service

Add the following contents to the file:

#/etc/systemd/system/brcmsmac.service
#sudo systemctl enable brcmsmac.service
#sudo systemctl start brcmsmac.service
#systemctl list-unit-files --state=enabled
#sudo systemctl status brcmsmac.service
#sudo systemctl stop brcmsmac.service
#sudo systemctl disable brcmsmac.service
#sudo systemctl daemon-reload

[Unit]
Description=Load brcmsmac module after start up
After=network-pre.target

[Service]
Type=simple
ExecStartPre=sleep 3
ExecStart=/usr/bin/modprobe brcmsmac

[Install]
WantedBy=multi-user.target


Once you have created and saved the service file, enable the service:

sudo systemctl enable brcmsmac.service

Then reboot the computer.


1 Like

@tbg I am reasonably willing to attempt all this (having never done so) but I'd prefer to not have to do it twice because I picked from a hat a text editor that is NOT "root capable" (my searches turn up a lot about Android, rooting phones, etc).

I'm conveniently skipping past the blacklist part on the assumption that I'll figure it out. It's just a strait terminal command, right?

So, can you suggest one or two text editors that would meet your criteria? For that matter, will this work: sudo gedit /etc/modprobe.d/blacklist.conf (or is that a Debian command?)

sudo nano /etc/modprobe.d/brcmsmac.conf

Should work for you.

@tbg Okay, I created the file, saved it, then ran the sudo command you gave me. Much crunching ensued....ending with ==> Image generation successful.

Is there anything I need to check to make sure whatever intended changes have been made? Or something to look for in terms of the wifi connectivity?

Also, while I'm thinking of it...since this was the first thing I attended to after the re-install I did when Manjaro froze at the lock screen...is there anything I ought to save somewhere for any possible future re-install/re-build to avoid having to do this again (not that it was so much, after all)?

And.....while I think of another thing....with 243 updates awaiting me...is there any chance that any of them will undo anything that's just been accomplished?

Yes the updates could break your system again. You would be best to install timeshift and make a backup before you update just in case.

Please post this again:

hwinfo --netcard --bluetooth | grep -Ei "(hotplug|speed|model|status|cmd|file|detected|driver:)" | grep -v "Config S"

Is your wifi now working correctly?


I hate to inform you, but your wifi driver will not load at boot without a modprobe. This can be done manually with:

sudo modprobe brcmsmac

The driver can be made to load automatically with a service after start up, but you need to make sure the brcmsmac driver is working correctly before you go to the trouble of writing a service. Don't worry about that part I know all about writing services.

The reason the wifi wasn't working properly was because conflicting drivers were loading at boot. That was why the blacklist was required. Unfortunately the brcmsmac driver now requires loading after the blacklist has been processed. A service will do this automatically for you.

The b43 driver is not the correct driver for the bcm4313, so your title really requires editing. I'm actually quite happy to get your outputs because it put me on to how to hopefully fix this flaky adapters problems with loading the correct kernel modules.

1 Like

As far as I can tell, it's working okay. But, again, the problem wasn't that the wireless connection didn't work....it was that it didn't seem to be working as good as it could (especially since I have an Ubuntu Budgie install on this same laptop to compare it to). However, to this untrained eye, it's hard to spot the quantitative difference between fair, good and better.

As far as the sudo modprobe brcmsmac manual "run." that's been done in the session I'm currently running. And here are the results you wanted to see, which have been collected after the modprobe:

hwinfo --netcard --bluetooth | grep -Ei "(hotplug|speed|model|status|cmd|file|detected|driver:)" | grep -v "Config S"
Model: "Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller"
Driver: "r8169"
Device File: enp3s0
Link detected: no
Driver Status: r8169 is active
Driver Activation Cmd: "modprobe r8169"
Model: "Broadcom BCM4313 802.11bgn Wireless Network Adapter"
Driver: "bcma-pci-bridge"
Device File: wlp2s0b1
Link detected: yes
Driver Status: bcma is active
Driver Activation Cmd: "modprobe bcma"

Timeshift has been set up and the initial Snapshot is being created as I type this.

I used the reference to b43 because that had been in the title of the thread I located here from 2016 when you provided the solution that at least got my installation to connect to my wifi. I'll edit the title to add that it's really about bcm4313 if that's your suggestion.

Even though it's not me helping you, I'm glad my particular situation can provide some assistance!

BTW, I still have not run the updates after the recent re-install....and won't until/unless there seems to be no reason to wait any longer (that Timeshift Snapshot was completed).

1 Like

So, in the short term...should I just plan on entering that command every time I start up or re-start?

A systemd service can autostart it for you, it is quite easy to write. I cen help you with that, but I don't have the time ATM.

And I officially accept that generous offer! Much appreciated!

But...I should plan on using it after each start/restart until then?

You can just add

brcmsmac

to /etc/modules-load.d/modules.conf very similar to how you blacklisted the other modules with the command:

sudo nano /etc/module-load.d/modules.conf

to load that module on boot.

If that's the solution tbg has in mind, yeah, I could manage that. OTOH, maybe your approach is a different approach compared to the service he has described....?

The one I gave you is loaded by systemd-modules-load.serviceand will do the exact same thing @tbg offered to do for you. AFAIK, it's something that's included with systemd and is always used on boot.

I'm obviously missing a step.

I entered sudo nano /etc/module-load.c/modules.conf

That opened the Nano editor and I typed brcmsmac (there was nothing else on the screen so I gather the command created that file, right?) and then typed Ctrl-O to WriteOut (save).

The filename was produced at the bottom for File Name to Write: and since it was correct, I hit Enter...but that produced:

{ Error writing /etc/module-load.d/modules.conf: no such file or directory ]

Forum kindly sponsored by