antoineco / broadcom-wl

Broadcom Linux hybrid wireless driver (64-bit)
https://www.broadcom.com/support/download-search?pg=Wireless+Embedded+Solutions+and+RF+Components&pf=Legacy+Wireless&pa=Driver&dk=BCM4312&l=true
163 stars 47 forks source link

BCM4360 - Ubuntu doesn't seems to use the driver #40

Closed moi15moi closed 11 months ago

moi15moi commented 11 months ago

I have a Rosewill RNX-AC1300PCE wifi-card which use BCM4360. I installed this package by following the manual instruction in the readme (so the make installation). I rebooted my computer, but ubuntu doesn't recognize my wifi-card like you can see in this screenshot: Capture d’écran du 2023-12-04 22-48-38

I don't know if it is revelant, but I also got some warning when I did a make. I don't know if it change anything:

moi15moi@moi15moi-System-Product-Name:~/Téléchargements/broadcom-wl-patch-linux4.7$ make
KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
make[1] : on entre dans le répertoire « /usr/src/linux-headers-6.2.0-26-generic »
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-11 (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
  You are using:           gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
CFG80211 API is prefered for this kernel version
Using CFG80211 API
  CC [M]  /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/src/shared/linux_osl.o
  CC [M]  /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/src/wl/sys/wl_linux.o
  CC [M]  /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/src/wl/sys/wl_iw.o
  CC [M]  /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/src/wl/sys/wl_cfg80211_hybrid.o
  LD [M]  /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/wl.o
CFG80211 API is prefered for this kernel version
Using CFG80211 API
  MODPOST /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/Module.symvers
  CC [M]  /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/wl.mod.o
  LD [M]  /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/wl.ko
  BTF [M] /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/wl.ko
Skipping BTF generation for /home/moi15moi/Téléchargements/broadcom-wl-patch-linux4.7/wl.ko due to unavailability of vmlinux
make[1] : on quitte le répertoire « /usr/src/linux-headers-6.2.0-26-generic »

Here is the details of my Network controller:

moi15moi@moi15moi-System-Product-Name:~$ sudo lspci -vnn -d 14e4:
[sudo] Mot de passe de moi15moi : 
04:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)
    Subsystem: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter [14e4:0619]
    Flags: bus master, fast devsel, latency 0, IRQ 17
    Memory at f7400000 (64-bit, non-prefetchable) [size=32K]
    Memory at f7200000 (64-bit, non-prefetchable) [size=2M]
    Capabilities: [48] Power Management version 3
    Capabilities: [58] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [68] Vendor Specific Information: Len=44 <?>
    Capabilities: [ac] Express Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [13c] Device Serial Number 68-1c-00-ff-ff-00-00-00
    Capabilities: [150] Power Budgeting <?>
    Capabilities: [160] Virtual Channel
    Capabilities: [1b0] Latency Tolerance Reporting
    Capabilities: [220] Physical Resizable BAR
    Kernel driver in use: bcma-pci-bridge
    Kernel modules: bcma, wl
antoineco commented 11 months ago

The README file contains all the instructions. Please follow them and share the output of lsmod.

moi15moi commented 11 months ago

The README file contains all the instructions

I did the rmmod command for all the modules listed I wrote in the file /etc/modprobe.d/blacklist.conf the same text in the readme. Finally, I followed the instruction for the manual installation (the make installation) Is there something I missed?

Please follow them and share the output of lsmod.

moi15moi@moi15moi-System-Product-Name:~$ sudo lsmod
[sudo] Mot de passe de moi15moi : 
Module                  Size  Used by
uas                    28672  0
usb_storage            86016  2 uas
intel_rapl_msr         20480  0
intel_rapl_common      40960  1 intel_rapl_msr
intel_tcc_cooling      16384  0
x86_pkg_temp_thermal    20480  0
intel_powerclamp       24576  0
coretemp               24576  0
mei_pxp                20480  0
mei_hdcp               28672  0
kvm_intel             499712  0
snd_soc_avs           172032  0
snd_soc_hda_codec      24576  1 snd_soc_avs
kvm                  1347584  1 kvm_intel
snd_hda_ext_core       36864  2 snd_soc_avs,snd_soc_hda_codec
snd_hda_codec_realtek   192512  1
irqbypass              16384  1 kvm
snd_soc_core          417792  2 snd_soc_avs,snd_soc_hda_codec
snd_hda_codec_generic   118784  1 snd_hda_codec_realtek
snd_compress           28672  2 snd_soc_avs,snd_soc_core
crct10dif_pclmul       16384  1
polyval_clmulni        16384  0
polyval_generic        16384  1 polyval_clmulni
snd_hda_codec_hdmi     94208  1
ghash_clmulni_intel    16384  0
ac97_bus               16384  1 snd_soc_core
snd_pcm_dmaengine      20480  1 snd_soc_core
sha512_ssse3           53248  0
binfmt_misc            24576  1
aesni_intel           397312  0
crypto_simd            20480  1 aesni_intel
cryptd                 28672  2 crypto_simd,ghash_clmulni_intel
snd_hda_intel          61440  3
snd_intel_dspcfg       36864  2 snd_soc_avs,snd_hda_intel
snd_intel_sdw_acpi     20480  1 snd_intel_dspcfg
wl                   6488064  0
rapl                   20480  0
snd_hda_codec         204800  6 snd_hda_codec_generic,snd_soc_avs,snd_hda_codec_hdmi,snd_soc_hda_codec,snd_hda_intel,snd_hda_codec_realtek
intel_cstate           24576  0
nls_iso8859_1          16384  2
eeepc_wmi              16384  0
wmi_bmof               16384  0
ee1004                 20480  0
snd_usb_audio         421888  1
snd_hda_core          135168  8 snd_hda_codec_generic,snd_soc_avs,snd_hda_codec_hdmi,snd_soc_hda_codec,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek
snd_usbmidi_lib        53248  1 snd_usb_audio
snd_hwdep              20480  2 snd_usb_audio,snd_hda_codec
nouveau              2826240  2
cfg80211             1241088  1 wl
snd_pcm               192512  9 snd_soc_avs,snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,snd_compress,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
snd_seq_midi           20480  0
mxm_wmi                16384  1 nouveau
snd_seq_midi_event     16384  1 snd_seq_midi
drm_ttm_helper         16384  1 nouveau
uvcvideo              139264  0
ttm                   110592  2 drm_ttm_helper,nouveau
videobuf2_vmalloc      20480  1 uvcvideo
snd_rawmidi            53248  2 snd_seq_midi,snd_usbmidi_lib
drm_display_helper    212992  1 nouveau
cec                    94208  1 drm_display_helper
videobuf2_memops       20480  1 videobuf2_vmalloc
snd_seq                94208  2 snd_seq_midi,snd_seq_midi_event
rc_core                77824  1 cec
videobuf2_v4l2         36864  1 uvcvideo
drm_kms_helper        249856  4 drm_display_helper,nouveau
videodev              323584  2 videobuf2_v4l2,uvcvideo
i2c_algo_bit           16384  1 nouveau
videobuf2_common       86016  4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
syscopyarea            16384  1 drm_kms_helper
input_leds             16384  0
joydev                 32768  0
xpad                   53248  0
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
ff_memless             24576  1 xpad
snd_timer              49152  2 snd_seq,snd_pcm
mc                     81920  5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common
snd                   135168  23 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
mei_me                 57344  2
sysfillrect            20480  1 drm_kms_helper
soundcore              16384  1 snd
mei                   167936  5 mei_hdcp,mei_pxp,mei_me
sysimgblt              20480  1 drm_kms_helper
sch_fq_codel           24576  2
mac_hid                16384  0
acpi_pad              184320  0
msr                    16384  0
parport_pc             53248  1
ppdev                  24576  0
lp                     28672  0
parport                73728  3 parport_pc,lp,ppdev
ramoops                36864  0
reed_solomon           28672  1 ramoops
drm                   696320  8 drm_kms_helper,drm_display_helper,drm_ttm_helper,ttm,nouveau
pstore_blk             16384  0
pstore_zone            36864  1 pstore_blk
efi_pstore             16384  0
ip_tables              36864  0
x_tables               65536  1 ip_tables
autofs4                57344  2
hid_logitech_hidpp     61440  0
hid_logitech_dj        32768  0
hid_generic            16384  0
usbhid                 73728  2 hid_logitech_dj,hid_logitech_hidpp
hid                   176128  4 usbhid,hid_generic,hid_logitech_dj,hid_logitech_hidpp
mfd_aaeon              16384  0
asus_wmi               73728  2 eeepc_wmi,mfd_aaeon
ledtrig_audio          16384  2 snd_hda_codec_generic,asus_wmi
sparse_keymap          16384  1 asus_wmi
platform_profile       16384  1 asus_wmi
nvme                   61440  2
r8169                 114688  0
crc32_pclmul           16384  0
i2c_i801               40960  0
nvme_core             208896  3 nvme
i2c_smbus              20480  1 i2c_i801
bcma                   86016  0
realtek                36864  1
ahci                   49152  0
xhci_pci               24576  0
nvme_common            28672  1 nvme_core
libahci                57344  1 ahci
xhci_pci_renesas       20480  1 xhci_pci
video                  73728  2 asus_wmi,nouveau
wmi                    40960  6 video,asus_wmi,wmi_bmof,mfd_aaeon,mxm_wmi,nouveau
antoineco commented 11 months ago

The wl module was loaded just fine.

If you disable your WiFi interface and re-enable it (e.g. by restarting the network service) do you see any relevant error reported by the dmesg command?

moi15moi commented 11 months ago

The output it too long, so I put it in a text file Output.txt

But, I don't see any apparent error

antoineco commented 11 months ago

The wl module "taints" the kernel according to the logs, but that shouldn't be a blocker.

Possibly the bcma module wasn't blacklisted properly and your device is trying to use it:

[    0.883240] bcma-pci-bridge 0000:04:00.0: bus0: Bus registered

In your original message you wrote:

    Kernel driver in use: bcma-pci-bridge
    Kernel modules: bcma, wl
moi15moi commented 11 months ago

Possibly the bcma module wasn't blacklisted properly and your device is trying to use it:

Here is my /etc/modprobe.d/blacklist.conf file. Like you can see at the end of it, I wrote blacklist bcma, so I guess it should be good, no?

moi15moi@moi15moi-System-Product-Name:~$ cat /etc/modprobe.d/blacklist.conf
# This file lists those modules which we don't want to be loaded by
# alias expansion, usually so some other driver will be loaded for the
# device instead.

# evbug is a debug tool that should be loaded explicitly
blacklist evbug

# these drivers are very simple, the HID drivers are usually preferred
blacklist usbmouse
blacklist usbkbd

# replaced by e100
blacklist eepro100

# replaced by tulip
blacklist de4x5

# causes no end of confusion by creating unexpected network interfaces
blacklist eth1394

# snd_intel8x0m can interfere with snd_intel8x0, doesn't seem to support much
# hardware on its own (Ubuntu bug #2011, #6810)
blacklist snd_intel8x0m

# Conflicts with dvb driver (which is better for handling this device)
blacklist snd_aw2

# replaced by p54pci
blacklist prism54

# replaced by b43 and ssb.
blacklist bcm43xx

# most apps now use garmin usb driver directly (Ubuntu: #114565)
blacklist garmin_gps

# replaced by asus-laptop (Ubuntu: #184721)
blacklist asus_acpi

# low-quality, just noise when being used for sound playback, causes
# hangs at desktop session start (Ubuntu: #246969)
blacklist snd_pcsp

# ugly and loud noise, getting on everyone's nerves; this should be done by a
# nice pulseaudio bing (Ubuntu: #77010)
blacklist pcspkr

# EDAC driver for amd76x clashes with the agp driver preventing the aperture
# from being initialised (Ubuntu: #297750). Blacklist so that the driver
# continues to build and is installable for the few cases where its
# really needed.
blacklist amd76x_edac

# wireless drivers (conflict with Broadcom hybrid wireless driver 'wl')
blacklist ssb
blacklist bcma
blacklist b43
blacklist brcmsmac
antoineco commented 11 months ago

Let's check a few things:

  1. Blacklisted entries are only considered after a reboot. Did you reboot?
  2. To unload modules which were already loaded, you have to call rmmod (with sudo). But since you said you already did it, I'm not sure what the problem could be. Are you certain that sudo rmmod bcma returned without error?
  3. Maybe check your /etc/modules file and ensure that there is no bcma entry in there? (or any of the other blacklisted modules)
moi15moi commented 11 months ago
  • Blacklisted entries are only considered after a reboot. Did you reboot?

Yes, I did reboot.

  • To unload modules which were already loaded, you have to call rmmod (with sudo). But since you said you already did it, I'm not sure what the problem could be. Are you certain that sudo rmmod bcma returned without error?

It doesn't print anything when I run sudo rmmod bcma. Is that a good sign?

3. Maybe check your /etc/modules file and ensure that there is no bcma entry in there? (or any of the other blacklisted modules)

I don't have a folder named /etc/modules. I verified all the file in /etc/modprobe.d/ and none of them (except of course blacklist.conf) blacklist bcma.

antoineco commented 11 months ago

/etc/modules is a regular file. If you don't have any, all good.

What happens if you rmmod wl and modprobe wl again? As before, please check dmesg for clues and verify with sudo lspci -vnn -d 14e4 what driver is in use.

moi15moi commented 11 months ago

Here is the output of these command (I runned all of them has root): Output.txt

It seems to be pretty much the same has the previous output I share of those commands

moi15moi commented 11 months ago

I found a solution.

I runned the command sudo update-initramfs -u (I saw the solution here) and rebooted. Now, it doesn't ignore the blacklist for bcma.

I can now connect to my local router.

It may be a good idea to mention it in the Readme. What do you think?

moi15moi commented 11 months ago

Strange, I just rebooted and now, ubuntu detect my wifi-card, but it cannot anymore connect to my wifi. It can see my wifi, but when I try to connect to it, it load indefinitely

When I boot, I need to forget the wifi and restart the network because it won't connect to my router via sudo systemctl restart systemd-networkd. Also, it seems that the wifi only work for a few minute and then, it deconnect from the wifi (but ubuntu still can see the wifi)

antoineco commented 11 months ago

Interesting, I had never heard of the blacklist file being in the initramfs before. If that's a standard thing on Ubuntu I should definitely mention it indeed.

I have personally not experienced instabilities of that sort, but dmesg will show you any error relating to the wl module.

antoineco commented 11 months ago

I see that the Debian package is doing exactly what you did upon installation: https://salsa.debian.org/broadcom-sta-team/broadcom-sta/-/blob/debian/debian/broadcom-sta-common.postinst (learned something!)

They are also blacklisting a few extra modules, maybe you should try that as well: https://salsa.debian.org/broadcom-sta-team/broadcom-sta/-/blob/debian/debian/broadcom-sta-common.modprobe

Side question: since Ubuntu also has this package, why not simply install it? This would save you the effort of re-building the module on every kernel update, or setting up dkms manually.

moi15moi commented 11 months ago

I have personally not experienced instabilities of that sort, but dmesg will show you any error relating to the wl module.

Here is the output: output.txt It says [ 3.961427] wl: module verification failed: signature and/or required key missing - tainting kernel

Side question: since Ubuntu also has this package, why not simply install it? This would save you the effort of re-building the module on every kernel update, or setting up dkms manually.

Because I'm too far from my router to use an ethernet cable.

They are also blacklisting a few extra modules, maybe you should try that as well: https://salsa.debian.org/broadcom-sta-team/broadcom-sta/-/blob/debian/debian/broadcom-sta-common.modprobe

I tried, but it doesn't correct the problem.

antoineco commented 11 months ago

From the kernel logs alone, everything is looking fine to me:

[    3.967072] wl 0000:04:00.0: enabling device (0000 -> 0002)
[    4.038135] wlan0: Broadcom BCM43a0 802.11 Hybrid Wireless Controller 6.30.223.271 (r587334)
[    4.199668] wl 0000:04:00.0 wlp4s0: renamed from wlan0

When I boot, I need to forget the wifi and restart the network because it won't connect to my router via sudo systemctl restart systemd-networkd.

That is more of an OS configuration issue than a kernel module issue. I don't have enough information to help here, but it could be that the network is managed through the NetworkManager service (one level on top of systemd).

Also, it seems that the wifi only work for a few minute and then, it deconnect from the wifi (but ubuntu still can see the wifi)

If it works and then disconnects without emitting any kernel message, it means that the issue isn't caused by a failure of the kernel module. In case I was right about NetworkManager being in charge of the network on Ubuntu, I would suggest checking the journal logs of that service around the time the network disconnected.

moi15moi commented 11 months ago

At 9:32, the wifi work, but from 9:36, it automatically disconnect

Here is the output of sudo journalctl -fu NetworkManager : output.txt

moi15moi commented 11 months ago

I found the problem. It was my fault.

In brief, I just needed sudo update-initramfs -u to correct my problem.