关于如何获取 Realtek 8168 适用的驱动程序有什么线索吗?
Intel 无线功能正常,但是 Realtek 有线功能无法运行,因为驱动程序编译失败。
编译错误:
DKMS make.log for r8168-8.045.08 for kernel 5.3.0-22-generic (x86_64)
Thu Nov 14 11:16:00 CET 2019
make: Entering directory '/usr/src/linux-headers-5.3.0-22-generic'
CC [M] /var/lib/dkms/r8168/8.045.08/build/r8168_n.o
CC [M] /var/lib/dkms/r8168/8.045.08/build/r8168_asf.o
CC [M] /var/lib/dkms/r8168/8.045.08/build/rtl_eeprom.o
CC [M] /var/lib/dkms/r8168/8.045.08/build/rtltool.o
/var/lib/dkms/r8168/8.045.08/build/r8168_n.c: In function ‘rtl8168_down’:
/var/lib/dkms/r8168/8.045.08/build/r8168_n.c:27919:9: error: implicit declaration of function ‘synchronize_sched’; did you mean ‘synchronize_net’? [-Werror=implicit-function-declaration]
synchronize_sched(); /* FIXME: should this be synchronize_irq()? */
^~~~~~~~~~~~~~~~~
synchronize_net
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/var/lib/dkms/r8168/8.045.08/build/r8168_n.o' failed
make[1]: *** [/var/lib/dkms/r8168/8.045.08/build/r8168_n.o] Error 1
Makefile:1655: recipe for target '_module_/var/lib/dkms/r8168/8.045.08/build' failed
make: *** [_module_/var/lib/dkms/r8168/8.045.08/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.3.0-22-generic'
lshw 的输出... sudo lshw -C 网络
*-network
description: Wireless interface
product: Wireless 7260
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:02:00.0
logical name: wlp2s0
version: 6b
serial: 7c:7a:91:26:92:15
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=5.3.0-22-generic firmware=17.3216344376.0 ip=192.168.18.40 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:47 memory:f7d00000-f7d01fff
*-network UNCLAIMED
description: Ethernet controller
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:03:00.0
version: 0c
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list
configuration: latency=0
resources: ioport:e000(size=256) memory:f7c00000-f7c00fff memory:f0000000-f0003fff
sudo dpkg -l | grep r8168; dkms status
rc r8168-dkms 8.045.08-2 all dkms source for the r8168 network driver
v4l2loopback, 0.10.0, 5.3.0-20-generic, x86_64: installed
v4l2loopback, 0.10.0, 5.3.0-22-generic, x86_64: installed
答案1
这意味着该驱动程序版本与 5.3 Linux 内核不兼容。
但很可能您根本不需要这个驱动程序,因为r8169
内核模块应该可以很好地驱动网络适配器。
您可以通过以下方式删除此驱动程序
sudo apt remove r8168-dkms
如果它是使用 安装的apt
。
移除此模块后,重新启动,你的 NIC 应该已经由 驱动r8169
。