ubuntu20解决intel wifi 驱动问题

ubuntu20解决intel wifi 驱动问题

产生问题条件

复制代码
1. 内核版本 5.15.0-139-generic
bash 复制代码
uname -a
Linux wj 5.15.0-139-generic #149~20.04.1-Ubuntu SMP Wed Apr 16 08:29:56 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
复制代码
2. wifi 硬件型号 Intel AX211
bash 复制代码
   lspci -nn | grep -i net
    00:14.3 Network controller [0280]: Intel Corporation Device [8086:51f1] (rev 01)
    02:00.0 Ethernet controller [0200]: Intel Corporation Device [8086:15f3] (rev 03)
    03:00.0 Ethernet controller [0200]: Intel Corporation Device [8086:15f3] (rev 03)

快速解决方法

1、 更新最新固件

bash 复制代码
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/iwlwifi-so-a0-hr-b0-77.ucode
cd linux-firmware/

覆盖之前wifi 固件
sudo cp iwlwifi-* /lib/firmware/

2、 驱动安装

bash 复制代码
git clone https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git
cd backport-iwlwifi

失败处理之 修改为本系统当前版本 API接口

将下面代码差异diff 到backport-iwlwifi/backport-include/linux/timer.h

c 复制代码
diff --git a/backport-include/linux/timer.h b/backport-include/linux/timer.h
index d4faec0a5..d8a661da9 100644
--- a/backport-include/linux/timer.h
+++ b/backport-include/linux/timer.h
@@ -3,6 +3,8 @@
 
 #include_next <linux/timer.h>
 
+
+
 #ifndef setup_deferrable_timer
 /*
  * The TIMER_DEFERRABLE flag has not been around since 3.0 so
@@ -67,6 +69,7 @@ static inline void timer_setup(struct timer_list *timer,
 		__TIMER_INITIALIZER(_function, 0, 0, 0)
 #endif
 
+#if 0
 #if LINUX_VERSION_IS_LESS(6,2,0)
 static inline int timer_shutdown(struct timer_list *t)
 {
@@ -79,6 +82,7 @@ static inline int timer_shutdown_sync(struct timer_list *t)
 }
 #endif
 
+#endif
 /* This was backported to 4.19.312 and 5,4,274, but we do not support such high minor numbers use 255 instead. */
 #if LINUX_VERSION_IS_LESS(6,1,84) &&			\
 	!LINUX_VERSION_IN_RANGE(4,19,255, 4,20,0) &&	\
@@ -91,6 +95,7 @@ static inline int timer_delete_sync(struct timer_list *timer)
 }
 #endif /* < 6.1.84 */
 
+#if 0
 #if LINUX_VERSION_IS_LESS(6,2,0)
 static inline int timer_delete(struct timer_list *timer)
 {
@@ -98,6 +103,33 @@ static inline int timer_delete(struct timer_list *timer)
 }
 #endif
 
+
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
+
+static inline int timer_shutdown(struct timer_list *t)
+{
+    del_timer(t);
+    return 0;
+}
+
+static inline int timer_shutdown_sync(struct timer_list *t)
+{
+    del_timer_sync(t);
+    return 0;
+}
+
+static inline int timer_delete(struct timer_list *timer)
+{
+    del_timer(timer);
+    return 0;
+}
+
+#endif /* < 5.15 */
+
+
+
 #ifndef timer_container_of
 #define timer_container_of from_timer
 #endif

安装驱动

bash 复制代码
make defconfig-iwlwifi-public
sudo make install
bash 复制代码
重启电脑
reboot

重启电脑大工搞成

相关推荐
不做无法实现的梦~2 小时前
使用ros2来跑通mid360的驱动包
linux·嵌入式硬件·机器人·自动驾驶
bai5459362 小时前
STM32 CubeIDE 使用蓝牙模块实现手机控制LED灯
stm32·单片机·嵌入式硬件
点云SLAM2 小时前
C++内存泄漏检测之Windows 专用工具(CRT Debug、Dr.Memory)和Linux 专业工具(ASan 、heaptrack)
linux·c++·windows·asan·dr.memory·c++内存泄漏检测·c++内存管理
LuiChun2 小时前
Docker Compose 容器服务查询与文件查看操作指南(Windows Docker Desktop 版)【一】
linux·运维·windows·docker·容器
${王小剑}3 小时前
在离线ubuntu上布置深度学习环境
linux·运维·ubuntu
gihigo19983 小时前
基于DSP28335 SCI模块控制ESP8266 WiFi模块的实现方案
单片机·嵌入式硬件
想放学的刺客3 小时前
单片机嵌入式嵌入式试题(第16期):硬件可靠性设计与复杂状态机架构设计
c语言·stm32·单片机·嵌入式硬件·物联网
Java程序之猿3 小时前
Linux使用U盘安装centos及报错You might want to saue “/run/initramfs/rdsosreport.txt“ 处理
linux·运维·服务器
CC.GG4 小时前
【Linux】进程概念(五)(虚拟地址空间----建立宏观认知)
java·linux·运维