1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
From b4effa4f4a573f76b3a95c055d037712fa35b57d Mon Sep 17 00:00:00 2001
From: FSE <dev@fsenterprise.de>
Date: Fri, 8 Aug 2025 02:45:36 +0200
Subject: [PATCH] Fix dev_set_mac_address() call for Linux 6.16+ API change
---
r8152.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/r8152.c b/r8152.c
index 1d12099..9512720 100644
--- a/r8152.c
+++ b/r8152.c
@@ -35,6 +35,9 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10)
#include <net/gso.h>
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10) */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0)
+#include <linux/socket.h>
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0) */
/* Version Information */
#define DRIVER_SUFFIX
@@ -26240,9 +26243,12 @@ static int rtl8152_post_reset(struct usb_interface *intf)
rtnl_lock();
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
dev_set_mac_address(tp->netdev, &sa);
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0)
dev_set_mac_address(tp->netdev, &sa, NULL);
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) */
+#else /* >= 6.16: __kernel_sockaddr_storage API change */
+ dev_set_mac_address(tp->netdev,
+ (struct __kernel_sockaddr_storage *)&sa, NULL);
+#endif
rtnl_unlock();
}
|