我一直在关注这个gh-repo在 Ubuntu(22.04)上手动安装 Realtek 驱动程序。
到目前为止,我的理解是,Linux 无法正确“识别”此特定卡,因此手动安装驱动程序是一种解决方法。在过去的几个月里,每次内核更新后,问题都会重新出现,rtl8852be
我会在 dir 上重新运行以下命令:
make clean
make
sudo make install
Ubuntu 会再次识别网卡,一切都会正常工作。今天,在 Ubuntu 更新后,系统重启时我遇到了预期的问题。按照常规步骤操作,但在
make
收到以下意外错误:
#rm -f .symvers.8852be
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.19.0-32-generic/build M=/home/user/rtl8852be modules
make[1]: Entering directory '/usr/src/linux-headers-5.19.0-32-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
You are using: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
CC [M] /home/user/rtl8852be/platform/platform_linux_pc_pci.o
/home/user/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_cache_wback’:
/home/user/rtl8852be/platform/platform_linux_pc_pci.c:21:17: error: implicit declaration of function ‘pci_dma_sync_single_for_device’; did you mean ‘dma_sync_single_for_device’? [-Werror=implicit-function-declaration]
21 | pci_dma_sync_single_for_device(hwdev, *bus_addr, size,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| dma_sync_single_for_device
/home/user/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_cache_inv’:
/home/user/rtl8852be/platform/platform_linux_pc_pci.c:30:17: error: implicit declaration of function ‘pci_dma_sync_single_for_cpu’; did you mean ‘dma_sync_single_for_cpu’? [-Werror=implicit-function-declaration]
30 | pci_dma_sync_single_for_cpu(hwdev, *bus_addr, size, direction);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| dma_sync_single_for_cpu
/home/user/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_get_bus_addr’:
/home/user/rtl8852be/platform/platform_linux_pc_pci.c:39:29: error: implicit declaration of function ‘pci_map_single’; did you mean ‘dma_map_single’? [-Werror=implicit-function-declaration]
39 | *bus_addr = pci_map_single(hwdev, vir_addr, size, direction);
| ^~~~~~~~~~~~~~
| dma_map_single
/home/user/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_unmap_bus_addr’:
/home/user/rtl8852be/platform/platform_linux_pc_pci.c:50:17: error: implicit declaration of function ‘pci_unmap_single’; did you mean ‘dma_unmap_single’? [-Werror=implicit-function-declaration]
50 | pci_unmap_single(hwdev, *bus_addr, size, direction);
| ^~~~~~~~~~~~~~~~
| dma_unmap_single
/home/user/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_free_noncache_mem’:
/home/user/rtl8852be/platform/platform_linux_pc_pci.c:97:17: error: implicit declaration of function ‘pci_free_consistent’ [-Werror=implicit-function-declaration]
97 | pci_free_consistent(pdev, size, vir_addr, *bus_addr);
| ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:257: /home/user/rtl8852be/platform/platform_linux_pc_pci.o] Error 1
make[1]: *** [Makefile:1850: /home/user/rtl8852be] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.19.0-32-generic'
make: *** [Makefile:637: modules] Error 2
我对 Linux 和 C 知之甚少,因此提前感谢您的耐心。目前我无法使用 WI-FI 连接。任何帮助都将不胜感激。
答案1
正如@Pilot6 所说,该驱动程序无法使用新的 5.19 内核构建。我建议您从系统中删除 rtl8852be 目录。接下来,使用临时以太网连接、网络共享或任何可能的方式,执行以下操作:
git clone https://github.com/lwfinger/rtw89.git
cd rtw89
make
sudo make install
重启。一切就绪。