summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Rękorajski2022-12-17 18:15:13 (GMT)
committerJan Rękorajski2022-12-17 18:15:13 (GMT)
commit8cae434201646c3e27b80d817021e4abc61eb717 (patch)
tree29a70d326009d2e3a79349c96842d44428e674f2
parentb550b8cb511c464287dc3a22d91d7cd4e0b736c5 (diff)
downloadr8168-8cae434201646c3e27b80d817021e4abc61eb717.zip
r8168-8cae434201646c3e27b80d817021e4abc61eb717.tar.gz
- fix building with kernel 6.1
-rw-r--r--kernel-6.1.patch14
-rw-r--r--r8168.spec2
2 files changed, 16 insertions, 0 deletions
diff --git a/kernel-6.1.patch b/kernel-6.1.patch
new file mode 100644
index 0000000..3e65fc9
--- /dev/null
+++ b/kernel-6.1.patch
@@ -0,0 +1,14 @@
+--- r8168-8.049.02/src/r8168.h~ 2021-06-11 17:25:16.000000000 +0200
++++ r8168-8.049.02/src/r8168.h 2022-12-17 19:14:10.556568693 +0100
+@@ -553,7 +553,11 @@
+ 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(ndev, &priv->napi, function, weight)
++#else
++#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function)
++#endif
+ #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;
diff --git a/r8168.spec b/r8168.spec
index 4725114..d51da0c 100644
--- a/r8168.spec
+++ b/r8168.spec
@@ -22,6 +22,7 @@ Source0: %{pname}-%{version}.tar.bz2
Patch0: kernel-5.17.patch
Patch1: kernel-5.18.patch
Patch2: kernel-5.19.patch
+Patch3: kernel-6.1.patch
BuildRequires: rpmbuild(macros) >= 1.701
%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
BuildRoot: %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
@@ -76,6 +77,7 @@ Express Gigabit Ethernet.\
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
%{expand:%build_kernel_packages}