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
|
From cc2a99963b0039573464816f0cf86803381d5f11 Mon Sep 17 00:00:00 2001
From: Evgeny Grin <k2k@narod.ru>
Date: Mon, 3 Apr 2023 16:46:39 +0300
Subject: [PATCH] Fixed compatibility with Linux kernel versions >= 6.1
---
src/r8125.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/r8125.h b/src/r8125.h
index 9eac0eb..4a29116 100644
--- a/src/r8125.h
+++ b/src/r8125.h
@@ -676,7 +676,11 @@ typedef int *napi_budget;
typedef struct napi_struct *napi_ptr;
typedef int napi_budget;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add_weight(ndev, &priv->napi, function, weight)
+#else // LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0)
#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight)
+#endif // LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0)
#define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget)
#define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr)
#define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev;
--
2.40.0
|