[packages/r8168] - fix building with kernel 5.19, rel 3
baggins
baggins at pld-linux.org
Sat Aug 13 14:11:30 CEST 2022
commit b550b8cb511c464287dc3a22d91d7cd4e0b736c5
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sat Aug 13 14:11:15 2022 +0200
- fix building with kernel 5.19, rel 3
kernel-5.19.patch | 40 ++++++++++++++++++++++++++++++++++++++++
r8168.spec | 4 +++-
2 files changed, 43 insertions(+), 1 deletion(-)
---
diff --git a/r8168.spec b/r8168.spec
index 879ca00..4725114 100644
--- a/r8168.spec
+++ b/r8168.spec
@@ -4,7 +4,7 @@
# nothing to be placed to debuginfo package
%define _enable_debug_packages 0
-%define rel 2
+%define rel 3
%define pname r8168
Summary: Linux driver for RTL8111/8168B PCI Express Gigabit Ethernet controllers
Summary(pl.UTF-8): Linuksowy sterownik dla kart sieciowych RTL8111/8168B PCI Express Gigabit Ethernet
@@ -21,6 +21,7 @@ Source0: %{pname}-%{version}.tar.bz2
# Source0-md5: 9c2191ca3ff85102bc18a41916eceb8b
Patch0: kernel-5.17.patch
Patch1: kernel-5.18.patch
+Patch2: kernel-5.19.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)
@@ -74,6 +75,7 @@ Express Gigabit Ethernet.\
%setup -q -n %{pname}-%{version}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
%{expand:%build_kernel_packages}
diff --git a/kernel-5.19.patch b/kernel-5.19.patch
new file mode 100644
index 0000000..a5b8f6b
--- /dev/null
+++ b/kernel-5.19.patch
@@ -0,0 +1,40 @@
+--- r8168-8.049.02/src/r8168_n.c.orig 2022-08-13 13:32:08.000000000 +0200
++++ r8168-8.049.02/src/r8168_n.c 2022-08-13 14:10:04.268095369 +0200
+@@ -25602,6 +25602,10 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+ if ((tp->mcfg == CFG_METHOD_1) || (tp->mcfg == CFG_METHOD_2) || (tp->mcfg == CFG_METHOD_3)) {
+ dev->hw_features &= ~NETIF_F_IPV6_CSUM;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
++ netif_set_tso_max_size(dev, LSO_32K);
++ netif_set_tso_max_segs(dev, NIC_MAX_PHYS_BUF_COUNT_LSO_64K);
++#else
+ netif_set_gso_max_size(dev, LSO_32K);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
+ dev->gso_max_segs = NIC_MAX_PHYS_BUF_COUNT_LSO_64K;
+@@ -25609,6 +25613,7 @@
+ dev->gso_min_segs = NIC_MIN_PHYS_BUF_COUNT;
+ #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
+ #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
++#endif
+ } else {
+ dev->hw_features |= NETIF_F_IPV6_CSUM;
+ dev->features |= NETIF_F_IPV6_CSUM;
+@@ -25616,6 +25621,10 @@
+ dev->hw_features |= NETIF_F_TSO6;
+ //dev->features |= NETIF_F_TSO6;
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
++ netif_set_tso_max_size(dev, LSO_64K);
++ netif_set_tso_max_segs(dev, NIC_MAX_PHYS_BUF_COUNT_LSO2);
++#else
+ netif_set_gso_max_size(dev, LSO_64K);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
+ dev->gso_max_segs = NIC_MAX_PHYS_BUF_COUNT_LSO2;
+@@ -25623,6 +25632,7 @@
+ dev->gso_min_segs = NIC_MIN_PHYS_BUF_COUNT;
+ #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
+ #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
++#endif
+ }
+ #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+ #endif //LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/r8168.git/commitdiff/b550b8cb511c464287dc3a22d91d7cd4e0b736c5
More information about the pld-cvs-commit
mailing list