Ubuntu – Bcmwl-kernel-source broken on kernel: 5.8.0-34-generic

broadcomdriverskernelmacbook-airwireless

Similar to bcmwl-kernel-source broken on kernel: 5.8.0-7630-generic except I'm using a standard kernel – WiFi worked without issues on my MacBook Air (2013) right until I pulled in the latest 20.04.2 update which included the 5.8.0-34-generic kernel, and booting back into 5.4.0-59-generic afterwards does not solve the issue. Anyway, details are as follows; any help would be much appreciated.

lspci -vnn | grep Network

03:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)
    Subsystem: Apple Inc. BCM4360 802.11ac Wireless Network Adapter [106b:0117]

ip link show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:49:bc:05 brd ff:ff:ff:ff:ff:ff
3: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:49:bc:05 brd ff:ff:ff:ff:ff:ff
5: bnep0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 84:38:35:4a:43:4b brd ff:ff:ff:ff:ff:ff

As can be seen, there's no wireless interface.

sudo lshw -class network

  *-network                 
       description: Network controller
       product: BCM4360 802.11ac Wireless Network Adapter
       vendor: Broadcom Inc. and subsidiaries
       physical id: 0
       bus info: pci@0000:03:00.0
       version: 03
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: driver=bcma-pci-bridge latency=0
       resources: irq:18 memory:b0600000-b0607fff memory:b0400000-b05fffff
  *-network:0
       description: Ethernet interface
       physical id: 1
       logical name: virbr0
       serial: 52:54:00:49:bc:05
       capabilities: ethernet physical
       configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=192.168.122.1 link=no multicast=yes
  *-network:1
       description: Ethernet interface
       physical id: 2
       logical name: bnep0
       serial: 84:38:35:4a:43:4b
       capabilities: ethernet physical
       configuration: broadcast=yes ip=192.168.44.124 multicast=yes
  *-network:2 DISABLED
       description: Ethernet interface
       physical id: 3
       logical name: virbr0-nic
       serial: 52:54:00:49:bc:05
       size: 10Mbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s

Steps I took to try to resolve the issue

I followed Installing Broadcom Wireless Drivers and did the following:

  1. lspci -nn -d 14e4: reveals that the PCI.ID is 14e4:43a0 (rev 03) so I should (re)install bcmwl-kernel-source
  2. sudo apt purge -y bcmwl-kernel-source
  3. sudo apt autoremove
  4. sudo apt update
  5. sudo update-pciids
  6. sudo apt-get install -y bcmwl-kernel-source

… followed by a reboot.

I did all the steps (except the first one) with both the 5.8.0-34-generic and 5.4.0-59-generic kernels and the outputs for the last command are as follows:

5.8.0-34-generic

STDOUT:

Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  dkms
Suggested packages:
  menu
The following NEW packages will be installed:
  bcmwl-kernel-source dkms
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,611 kB of archives.
After this operation, 8,364 kB of additional disk space will be used.
Selecting previously unselected package dkms.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 204877 files and directories currently installed.)
Preparing to unpack .../dkms_2.8.1-5ubuntu1_all.deb ...
Unpacking dkms (2.8.1-5ubuntu1) ...
Selecting previously unselected package bcmwl-kernel-source.
Preparing to unpack .../bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu5_amd64.deb ...
Unpacking bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
Setting up dkms (2.8.1-5ubuntu1) ...
Setting up bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
Loading new bcmwl-6.30.223.271+bdcom DKMS files...
Building for 5.8.0-34-generic
Building for architecture x86_64
Building initial module for 5.8.0-34-generic
Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more information.
dpkg: error processing package bcmwl-kernel-source (--configure):
 installed bcmwl-kernel-source package post-installation script subprocess returned error exit status 10
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 bcmwl-kernel-source

STDERR:

E: Sub-process /usr/bin/dpkg returned an error code (1)

5.4.0-59-generic

STDOUT:

Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  dkms
Suggested packages:
  menu
The following NEW packages will be installed:
  bcmwl-kernel-source dkms
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,611 kB of archives.
After this operation, 8,364 kB of additional disk space will be used.
Selecting previously unselected package dkms.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 204877 files and directories currently installed.)
Preparing to unpack .../dkms_2.8.1-5ubuntu1_all.deb ...
Unpacking dkms (2.8.1-5ubuntu1) ...
Selecting previously unselected package bcmwl-kernel-source.
Preparing to unpack .../bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu5_amd64.deb ...
Unpacking bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
Setting up dkms (2.8.1-5ubuntu1) ...
Setting up bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
Loading new bcmwl-6.30.223.271+bdcom DKMS files...
Building for 5.4.0-59-generic 5.8.0-34-generic
Building for architecture x86_64
Building initial module for 5.4.0-59-generic
This system doesn't support Secure Boot
Secure Boot not enabled on this system.
Done.

wl.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-59-generic/updates/dkms/

depmod...

DKMS: install completed.
Building initial module for 5.8.0-34-generic
Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more information.
dpkg: error processing package bcmwl-kernel-source (--configure):
 installed bcmwl-kernel-source package post-installation script subprocess returned error exit status 10
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 bcmwl-kernel-source

STDERR:

E: Sub-process /usr/bin/dpkg returned an error code (1)

In both cases, the output suggests looking at /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log which shows:

DKMS make.log for bcmwl-6.30.223.271+bdcom for kernel 5.8.0-34-generic (x86_64)
Thursday, January 07, 2021 PM01:19:23 CST
make: Entering directory '/usr/src/linux-headers-5.8.0-34-generic'
CFG80211 API is prefered for this kernel version
Using CFG80211 API
  AR      /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/built-in.a
  CC [M]  /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.o
  CC [M]  /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.o
  CC [M]  /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_iw.o
  CC [M]  /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.o
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_attach’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:593:20: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
  593 |  if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
      |                    ^~~~~~~~~~~~~~~
      |                    ioremap_cache
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:593:18: warning: assignment to ‘void *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  593 |  if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
      |                  ^
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_pci_probe’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:780:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  780 |  if ((val & 0x0000ff00) != 0)
      |  ^~
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:782:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  782 |   bar1_size = pci_resource_len(pdev, 2);
      |   ^~~~~~~~~
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:783:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  783 |   bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
      |               ^
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_reg_proc_entry’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:3376:58: error: passing argument 4 of ‘proc_create_data’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 3376 |  if ((wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_fops, wl)) == NULL) {
      |                                                          ^~~~~~~~
      |                                                          |
      |                                                          const struct file_operations *
In file included from /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:38:
./include/linux/proc_fs.h:102:31: note: expected ‘const struct proc_ops *’ but argument is of type ‘const struct file_operations *’
  102 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.c: In function ‘osl_reg_map’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.c:949:10: error: implicit declaration of function ‘ioremap_nocache’; did you mean ‘ioremap_cache’? [-Werror=implicit-function-declaration]
  949 |  return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
      |          ^~~~~~~~~~~~~~~
      |          ioremap_cache
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.c:949:10: warning: returning ‘int’ from a function with return type ‘void *’ makes pointer from integer without a cast [-Wint-conversion]
  949 |  return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
      |         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:40:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_set_auth_type’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.h:52:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
   52 |  if (wl_dbg_level & WL_DBG_DBG) {   \
      |     ^
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:816:3: note: in expansion of macro ‘WL_DBG’
  816 |   WL_DBG(("network eap\n"));
      |   ^~~~~~
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_cfg80211_hybrid.c:817:2: note: here
  817 |  default:
      |  ^~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:288: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.o] Error 1
make[1]: *** Waiting for unfinished jobs....
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:288: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/shared/linux_osl.o] Error 1
make: *** [Makefile:1780: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.8.0-34-generic'

In the meantime, my Bluetooth is working so I am connecting to the Internet by Bluetooth tethering with my Android device. But it's very much a temporary solution and I would not like to rely on it for the long run.

Best Answer

The reason is obvious. Almost every time Canonical rolls out a HWE kernel, they forget to upgrade bcmwl-kernel-source in the repos.

You have two solutions (use one or the other, it makes no sense to use both):

  1. Install bcmwl-kernel-source from groovy repos. You can find it e.g. here. http://mirrors.kernel.org/ubuntu/pool/restricted/b/bcmwl/bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu7_amd64.deb It will compile with the 5.8 kernel.

Download the deb and install it by

sudo dpkg -i bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu7_amd64.deb
  1. Remove all 5.8 kernel packages using these commands:

     sudo apt remove linux-{image,modules,modules-extra,headers}-5.8.0-36-generic linux-hwe-5.8-headers-5.8.0-36
     sudo apt install linux-generic
    

Make sure that the linux-generic meta package is installed.

It is recommended to boot with the 5.4 kernel before you remove the 5.8.

The second solution will keep the 5.4 major kernel version with normal security upgrades.