我的无线网卡出现了几个问题。
重新启动后(我认为是在内核更新后)我在网络设置中看不到网卡,但可以使用来看到它lspci
。
遵循本指南安装 Broadcom 无线驱动程序
这对我的 PCI.ID - 14e4:4331 (rev 02) 建议:
sudo apt install firmware-b43-installer
sudo apt install linux-firmware
似乎部分起作用了。Wifi 可用,但仅限 2.4GHz 信道。
所以我也尝试了 bcmwl-kernel-source。
问题似乎在于 bcmwl-kernel-source 无法在最新内核 5.8.0-7630-generic 上正确编译。(尝试从“附加驱动程序”安装时会获得类似结果):
administrator@ub-mbp:~$ sudo apt install bcmwl-kernel-source
[sudo] password for administrator:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
bcmwl-kernel-source
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,544 kB of archives.
After this operation, 8,068 kB of additional disk space will be used.
Selecting previously unselected package bcmwl-kernel-source.
(Reading database ... 401485 files and directories currently installed.)
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 bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ...
Loading new bcmwl-6.30.223.271+bdcom DKMS files...
Building for 5.8.0-7630-generic
Building for architecture x86_64
Building initial module for 5.8.0-7630-generic
ERROR (dkms apport): kernel package linux-headers-5.8.0-7630-generic is not supported
Error! Bad return status for module build on kernel: 5.8.0-7630-generic (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more informati
on.
dpkg: error processing package bcmwl-kernel-source (--configure):
installed bcmwl-kernel-source package post-installation script subprocess retur
ned error exit status 10
Errors were encountered while processing:
bcmwl-kernel-source
E: Sub-process /usr/bin/dpkg returned an error code (1)
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log 的输出
DKMS make.log for bcmwl-6.30.223.271+bdcom for kernel 5.8.0-7630-generic (x86_64)
Wed 06 Jan 2021 06:51:22 PM EST
make: Entering directory '/usr/src/linux-headers-5.8.0-7630-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/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));
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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[1]: *** Waiting for unfinished jobs....
/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),
| ^
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:
| ^~~~~~~
/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,
| ^~~~~~~~~~~~~~~~
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: *** [Makefile:1780: /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.8.0-7630-generic'
有没有什么办法可以在这个内核上修复这个问题?
lshw -class network
以下是有帮助的结果:
*-network
description: Wireless interface
product: BCM4331 802.11a/b/g/n
vendor: Broadcom Inc. and subsidiaries
physical id: 0
bus info: pci@0000:03:00.0
logical name: wlp3s0b1
version: 02
serial: e0:f8:47:00:dd:02
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=b43 driverversion=5.8.0-7630-generic firmware=666.2 ip=192.168.0.54 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:17 memory:a0600000-a0603fff
答案1
作为临时修复,我启动了 5.4.0-59-generic 内核。
- 在启动期间,在 Grub 屏幕上,选择选项#2(ubuntu 的高级选项)。
- 然后选择第三个选项(“Ubuntu,带有 Linux 5.8.0-34-generic”)
重新启动后,您的系统应该可以接收 wifi 适配器。
要使启动进入 5.4.0-39-generic 成为默认选项:
sudo emacs /etc/default/grub
# 或者使用您喜欢的编辑器- 编辑 GRUB_DEFAULT 行以读取
GRUB_DEFAULT="1>2"
- 保存并退出编辑器
sudo update-grub
这GRUB_DEFAULT="1>2"
告诉 Grub 菜单在第一个屏幕上选择第二个选项(从 0 开始计数)(即“Ubuntu 的高级选项”),然后在第二个屏幕上选择第三个选项(也从 0 开始计数)。您可以让 Grub 屏幕超时或按两次回车键,这样就可以将您引导到内核版本 5.4.0-39-generic。
正如我所说,这是我的临时解决方案。我认为永久解决方案可能需要供应商提供驱动程序更新。
答案2
为 5.8.0-7630-generic 构建初始模块
Ubuntu 存储库中包含的默认驱动程序包显然无法编写为支持每个内核版本(例如 5.8.0-7630)。但是,它确实支持默认的 Ubuntu 内核版本。例如,从我的机器上:
$ uname -r
5.8.0-34-generic
和:
$ sudo dpkg -s bcmwl-kernel-source
Package: bcmwl-kernel-source
Status: install ok installed
我建议您恢复到标准的 Ubuntu 内核和头文件版本。然后软件包应该可以干净地安装。
然而,如果它支持 5 gHz 通道,我会感到非常惊讶。
答案3
我所做的只是删除 5.8.0-34-generic 内核,现在它运行完全正常。
我没有寻找任何其他解决方案,因为我有一个计算机科学项目需要在两天内完成。