Broadcom on 6.10.2

I use a Asus network wifi card, so i need to load the wl module to get the card up running, but after updating last time, i no longer get the card to show.

my hardware setting:

  boot = {
    kernelPackages = pkgs.linuxPackages_latest;
    loader = {
      systemd-boot.enable = true;
      efi = {
        canTouchEfiVariables = true;
        efiSysMountPoint = "/boot/efi";
      };
    };
    initrd = {
      availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
      kernelModules = ["amdgpu"];
    };
    kernelModules = ["kvm-amd" "wl"];
    extraModulePackages = [config.boot.kernelPackages.broadcom_sta];
    blacklistedKernelModules = ["b43" "ssb" "brcmfmac" "brcmsmac" "bcma"];
  };

lsmo | grep wl return:

wl                   6512640  0
cfg80211             1363968  1 wl

Been trying to look through issues on nixpkgs and kernel changelogs, but can not see why it no longer get loaded, so if anyone know what i am missing please shout out.

When running dmesg | grep wl, i get:

❯ dmesg | grep wl
[    4.574629] stage-1-init: [Fri Aug  2 18:15:59 UTC 2024] loading module wl...
[    4.621076] wl: loading out-of-tree module taints kernel.
[    4.621078] wl: module license 'MIXED/Proprietary' taints kernel.
[    4.621081] wl: module license taints kernel.
[    4.624775] Modules linked in: wl(PO+) cfg80211 rfkill amdgpu video wmi backlight amdxcp i2c_algo_bit drm_ttm_helper ttm drm_exec gpu_sched drm_suballoc_helper drm_buddy drm_display_helper cec
[    4.624837]  getvar+0x20/0x70 [wl]
[    4.624855]  ? __UNIQUE_ID_vermagic548+0x4ea37deda26d/0x4ea37deda26d [wl]
[    4.624871]  wl_module_init+0x17/0xa0 [wl]
[    4.624939] wl 0000:05:00.0: enabling device (0000 -> 0002)
[    4.908579] wl 0000:05:00.0 wlp5s0: renamed from eth0

After going to kernel 6.1.102 it now load again, and dmesg gives:

[    0.831121] stage-1-init: [Fri Aug  2 18:47:19 UTC 2024] loading module wl...
[    0.867473] wl: loading out-of-tree module taints kernel.
[    0.867475] wl: module license 'MIXED/Proprietary' taints kernel.
[    0.872836] wl 0000:05:00.0: enabling device (0000 -> 0002)
[    3.010102] wl 0000:05:00.0 wlp5s0: renamed from eth0
[ 3817.407275] IPv6: ADDRCONF(NETDEV_CHANGE): wlp5s0: link becomes ready
[ 3817.787472]  videobuf2_common mac_hid snd_timer button videodev acpi_cpufreq snd mc soundcore bcma sch_fq_codel atkbd libps2 serio vivaldi_fmap loop cpufreq_powersave xt_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 br_netfilter veth tun tap macvlan bridge stp llc kvm_amd ccp kvm irqbypass fuse deflate configfs efi_pstore nfnetlink efivarfs tpm rng_core dmi_sysfs ip_tables x_tables autofs4 hid_generic usbhid hid ahci libahci libata nvme xhci_pci xhci_pci_renesas nvme_core xhci_hcd nvme_common scsi_mod t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_generic crct10dif_pclmul scsi_common crct10dif_common rtc_cmos dm_mod dax btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq amdgpu drm_ttm_helper ttm iommu_v2 video wmi backlight gpu_sched drm_buddy drm_display_helper cec wl(PO) cfg80211 rfkill
[ 3821.095688]  videobuf2_common mac_hid snd_timer button videodev acpi_cpufreq snd mc soundcore bcma sch_fq_codel atkbd libps2 serio vivaldi_fmap loop cpufreq_powersave xt_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 br_netfilter veth tun tap macvlan bridge stp llc kvm_amd ccp kvm irqbypass fuse deflate configfs efi_pstore nfnetlink efivarfs tpm rng_core dmi_sysfs ip_tables x_tables autofs4 hid_generic usbhid hid ahci libahci libata nvme xhci_pci xhci_pci_renesas nvme_core xhci_hcd nvme_common scsi_mod t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_generic crct10dif_pclmul scsi_common crct10dif_common rtc_cmos dm_mod dax btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq amdgpu drm_ttm_helper ttm iommu_v2 video wmi backlight gpu_sched drm_buddy drm_display_helper cec wl(PO) cfg80211 rfkill

It looks like this dmesg output includes a kernel stack trace, probably from a WARNING or OOPS while loading the wl driver. If you post the full error with stack trace it might give more clues.

But I’m guessing that the wl out-of-tree driver needs some fixes to be compatible with kernel 6.10. A cursory web search shows plenty of complaints about this happening over and over again with kernel updates in years past. It’s a common occurrence with out-of-tree drivers.

Did revert to 6.10.2 and reboot, now dmesg:

❯ dmesg | grep wl
[    0.853406] stage-1-init: [Fri Aug  2 21:39:14 UTC 2024] loading module wl...
[    0.897620] wl: loading out-of-tree module taints kernel.
[    0.897623] wl: module license 'MIXED/Proprietary' taints kernel.
[    0.897625] wl: module license taints kernel.
[    0.901262] Modules linked in: wl(PO+) cfg80211 rfkill
[    0.901314]  getvar+0x20/0x70 [wl]
[    0.901332]  ? orc_header+0x194c/0x194c [wl]
[    0.901348]  wl_module_init+0x17/0xa0 [wl]
[    0.901414] wl 0000:05:00.0: enabling device (0000 -> 0002)
[    4.498267] wl 0000:05:00.0 wlp5s0: renamed from eth0

ifconfig showing:

wlp5s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether fa:e2:97:cf:a6:97  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 34

But when scanning for connection, it is as if the card is not active, i do not know what more to do.

Your dmesg | grep wl command is picking out four lines from a much larger error message with a stack trace. Try dmesg | less and find the error with its full stack trace.

Also bear in mind you can always switch your configuration to use an older kernel, as a workaround until the wl driver is fixed:

  boot.kernelPackages = pkgs.linuxPackages_6_9;

Nixpkgs tends to keep a wide selection of kernel versions, including all the active stable releases. You could stay on 6.1 for a while longer, unless you specifically need something from the newer kernel.

Using linuxPackages_latest means you are living on the bleeding edge and are likely to keep hitting problems with out-of-tree drivers.

Reverted back to 6.9.12, and the module is loading, the card is being reconized, still not finding any connection. As if the card is not searching.

Tried turning on my phone as a mobile hotspot, still nothing.

The full stack:

[    0.856064] stage-1-init: [Sat Aug  3 15:52:58 UTC 2024] loading module wl...
[    0.897447] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    0.898790] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    0.898908] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[    0.902266] wl: loading out-of-tree module taints kernel.
[    0.902268] wl: module license 'MIXED/Proprietary' taints kernel.
[    0.902269] Disabling lock debugging due to kernel taint
[    0.902270] wl: module license taints kernel.
[    0.906051] ------------[ cut here ]------------
[    0.906052] Unpatched return thunk in use. This should not happen!
[    0.906053] WARNING: CPU: 10 PID: 157 at arch/x86/kernel/cpu/bugs.c:3023 __warn_thunk+0x2e/0x40
[    0.906059] Modules linked in: wl(PO+) cfg80211 rfkill
[    0.906063] CPU: 10 PID: 157 Comm: modprobe Tainted: P           O       6.9.12 #1-NixOS
[    0.906065] Hardware name: System manufacturer System Product Name/ROG STRIX B450-F GAMING, BIOS 4402 06/28/2021
[    0.906066] RIP: 0010:__warn_thunk+0x2e/0x40
[    0.906068] Code: 0f 1f 44 00 00 80 3d a9 fe db 01 00 74 07 31 ff e9 12 90 ea 00 c6 05 99 fe db 01 01 90 48 c7 c7 00 ab 91 84 e8 23 59 06 00 90 <0f> 0b 90 90 31 ff e9 f2 8f ea 00 0f 1f 80 00 00 00 00 90 90 90 90
[    0.906070] RSP: 0018:ffffb47e005d7c98 EFLAGS: 00010246
[    0.906072] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[    0.906073] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[    0.906074] RBP: ffffb47e005d7ce8 R08: 0000000000000000 R09: 0000000000000000
[    0.906075] R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffc0da2a21
[    0.906076] R13: ffffb47e005d7d30 R14: ffff9dbe0604ca00 R15: ffff9dbe0611a128
[    0.906077] FS:  00007f0144fbc200(0000) GS:ffff9dc90f100000(0000) knlGS:0000000000000000
[    0.906079] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    0.906080] CR2: 00007f0144e6a000 CR3: 0000000106052000 CR4: 0000000000f50ef0
[    0.906081] PKRU: 55555554
[    0.906082] Call Trace:
[    0.906084]  <TASK>
[    0.906085]  ? __warn+0x80/0x120
[    0.906088]  ? __warn_thunk+0x2e/0x40
[    0.906090]  ? report_bug+0x172/0x1a0
[    0.906095]  ? handle_bug+0x43/0x90
[    0.906098]  ? exc_invalid_op+0x17/0x80
[    0.906100]  ? asm_exc_invalid_op+0x1a/0x20
[    0.906105]  ? __warn_thunk+0x2e/0x40
[    0.906107]  ? __warn_thunk+0x2d/0x40
[    0.906109]  warn_thunk_thunk+0x1a/0x30
[    0.906114]  getvar+0x20/0x70 [wl]
[    0.906133]  ? orc_header+0x194c/0x194c [wl]
[    0.906151]  wl_module_init+0x17/0xa0 [wl]
[    0.906171]  ? do_one_initcall+0x5b/0x330
[    0.906175]  ? do_init_module+0x90/0x270
[    0.906178]  ? init_module_from_file+0x86/0xd0
[    0.906182]  ? idempotent_init_module+0x120/0x2c0
[    0.906185]  ? __x64_sys_finit_module+0x5e/0xc0
[    0.906188]  ? do_syscall_64+0xb8/0x210
[    0.906190]  ? entry_SYSCALL_64_after_hwframe+0x77/0x7f
[    0.906194]  </TASK>
[    0.906195] ---[ end trace 0000000000000000 ]---
[    0.906222] wl 0000:05:00.0: enabling device (0000 -> 0002)
[    0.923584] eth0: Broadcom BCM43a0 802.11 Hybrid Wireless Controller 6.30.223.271 (r587334)

Then lower down:

[    4.465475] wl 0000:05:00.0 wlp5s0: renamed from eth0

actually its the error code -22 that’s the issue, coming from the wpa_supplicant package. If you do systemctl status wpa_supplicant … you’ll see the error.

Given that the issue is wpa_supplicant, there is another option,

networking = {
wireless.iwd.enable = true;
networkmanager = { enable = true; wifi.backend = “iwd”; };
};

then use the following commands to conenct to wifi:
iwctl station wlp6s0 scan
iwctl station wlp6s0 get-networks
iwctl station wlp6s0 connect “Network Name”
iwctl station wlp6s0 show

hope this helps.