Ubuntu 22 中缺少 Wifi - Realtek Semiconductor Co., Ltd - b852

Ubuntu 22 中缺少 Wifi - Realtek Semiconductor Co., Ltd - b852

我在笔记本电脑上使用双启动(Windows / Ubuntu 22),Ubuntu 中没有显示 Wifi 选项(Windows 中一切正常)

以下是“sudo lshw -C network”的相关部分

  *-network UNCLAIMED
   description: Network controller
   product: Realtek Semiconductor Co., Ltd.
   vendor: Realtek Semiconductor Co., Ltd.
   physical id: 0
   bus info: pci@0000:2c:00.0
   version: 00
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress cap_list
   configuration: latency=0
   resources: ioport:3000(size=256) memory:5e400000-5e4fffff

这里来自“lspci -nnk | grep -iA2 net”

2c:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:b852]
Subsystem: Lenovo Device [17aa:4853]

我找到了这个答案: Realtek 10ec:b852 的网络驱动程序

但是运行“make”时出现以下错误:

   #rm -f .symvers.8852be
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.19.0-46-generic/build M=/home/jakob/Programs/rtl8852be  modules
make[1]: Entering directory '/usr/src/linux-headers-5.19.0-46-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.1) 11.3.0
  You are using:           gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
  CC [M]  /home/jakob/Programs/rtl8852be/platform/platform_linux_pc_pci.o
/home/jakob/Programs/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_cache_wback’:
/home/jakob/Programs/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/jakob/Programs/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_cache_inv’:
/home/jakob/Programs/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/jakob/Programs/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_get_bus_addr’:
/home/jakob/Programs/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/jakob/Programs/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_unmap_bus_addr’:
/home/jakob/Programs/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/jakob/Programs/rtl8852be/platform/platform_linux_pc_pci.c: In function ‘pci_free_noncache_mem’:
/home/jakob/Programs/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/jakob/Programs/rtl8852be/platform/platform_linux_pc_pci.o] Error 1
make[1]: *** [Makefile:1857: /home/jakob/Programs/rtl8852be] Error 2

请帮帮我。我完全不知道如何解决这个问题。

答案1

Realtek 驱动程序以存在问题而闻名,尤其是 RTL88xxxx 系列。过去我遇到过无数这样的问题。

查看日志我可以看到你的确切模型是RTL8852BE。好消息是 Linux 内核版本 6.2+ 附带了该驱动程序,因此 Ubuntu 23.04 本身附带了该驱动程序,所以您只需升级到版本 23.04 即可。

另一种方法(如果您不想进行发行版升级)是从此存储库编译并安装驱动程序:https://github.com/HRex39/rtl8852be

请注意您的内核版本,这仅适用于 <= 6.0.0 的内核版本。更多信息可以在存储库本身中找到。这些是由另一个人整理的,因此您可能会发现一些问题,但它们相对稳定。

请记住,这些驱动程序在内核更新后将失效,因此每次内核更新后您都必须重新安装这些驱动程序。此外,如果您使用双启动,请确保已禁用安全启动。

相关内容