|
| 1 | +From 37bbdad26212b500f80d099e50b635c4ec387510 Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= < [email protected]> |
| 3 | +Date: Sat, 27 Dec 2025 12:08:47 +0100 |
| 4 | +Subject: [PATCH] r8101: fix build with kernels > 6.16 |
| 5 | +MIME-Version: 1.0 |
| 6 | +Content-Type: text/plain; charset=UTF-8 |
| 7 | +Content-Transfer-Encoding: 8bit |
| 8 | + |
| 9 | +Signed-off-by: Álvaro Fernández Rojas < [email protected]> |
| 10 | +--- |
| 11 | + src/r8101.h | 5 +++++ |
| 12 | + src/r8101_n.c | 8 ++++---- |
| 13 | + 2 files changed, 9 insertions(+), 4 deletions(-) |
| 14 | + |
| 15 | +--- a/src/r8101.h |
| 16 | ++++ b/src/r8101.h |
| 17 | +@@ -109,6 +109,12 @@ static inline void ether_addr_copy(u8 *d |
| 18 | + } |
| 19 | + #endif |
| 20 | + |
| 21 | ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0) |
| 22 | ++#define timer_container_of(var, callback_timer, timer_fieldname) \ |
| 23 | ++ from_timer(var, callback_timer, timer_fieldname) |
| 24 | ++#define timer_delete_sync(timer) del_timer_sync(timer) |
| 25 | ++#endif |
| 26 | ++ |
| 27 | + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) |
| 28 | + #define setup_timer(_timer, _function, _data) \ |
| 29 | + do { \ |
| 30 | +--- a/src/r8101_n.c |
| 31 | ++++ b/src/r8101_n.c |
| 32 | +@@ -10163,7 +10163,7 @@ rtl8101_hw_phy_config(struct net_device |
| 33 | + |
| 34 | + static inline void rtl8101_delete_link_timer(struct net_device *dev, struct timer_list *timer) |
| 35 | + { |
| 36 | +- del_timer_sync(timer); |
| 37 | ++ timer_delete_sync(timer); |
| 38 | + } |
| 39 | + |
| 40 | + static inline void rtl8101_request_link_timer(struct net_device *dev) |
| 41 | +@@ -10181,7 +10181,7 @@ static inline void rtl8101_request_link_ |
| 42 | + |
| 43 | + static inline void rtl8101_delete_esd_timer(struct net_device *dev, struct timer_list *timer) |
| 44 | + { |
| 45 | +- del_timer_sync(timer); |
| 46 | ++ timer_delete_sync(timer); |
| 47 | + } |
| 48 | + |
| 49 | + static inline void rtl8101_request_esd_timer(struct net_device *dev) |
| 50 | +@@ -11600,7 +11600,7 @@ rtl8101_esd_timer(struct timer_list *t) |
| 51 | + struct rtl8101_private *tp = netdev_priv(dev); |
| 52 | + struct timer_list *timer = &tp->esd_timer; |
| 53 | + #else |
| 54 | +- struct rtl8101_private *tp = from_timer(tp, t, esd_timer); |
| 55 | ++ struct rtl8101_private *tp = timer_container_of(tp, t, esd_timer); |
| 56 | + struct net_device *dev = tp->dev; |
| 57 | + struct timer_list *timer = t; |
| 58 | + #endif |
| 59 | +@@ -11776,7 +11776,7 @@ rtl8101_link_timer(struct timer_list *t) |
| 60 | + struct rtl8101_private *tp = netdev_priv(dev); |
| 61 | + struct timer_list *timer = &tp->link_timer; |
| 62 | + #else |
| 63 | +- struct rtl8101_private *tp = from_timer(tp, t, link_timer); |
| 64 | ++ struct rtl8101_private *tp = timer_container_of(tp, t, link_timer); |
| 65 | + struct net_device *dev = tp->dev; |
| 66 | + struct timer_list *timer = t; |
| 67 | + #endif |
0 commit comments