[packages/r8168] - fix building with kernel 4.9.256 - rel 2

baggins baggins at pld-linux.org
Sat Feb 6 21:20:41 CET 2021


commit a838d1bd0922bbd3970537728e780d63b1e80bee
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Feb 6 21:20:17 2021 +0100

    - fix building with kernel 4.9.256
    - rel 2

 kernel-4.9.256.patch | 41 +++++++++++++++++++++++++++++++++++++++++
 r8168.spec           |  4 +++-
 2 files changed, 44 insertions(+), 1 deletion(-)
---
diff --git a/r8168.spec b/r8168.spec
index 2d0e5fe..b0a433c 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	1
+%define		rel	2
 %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
@@ -20,6 +20,7 @@ URL:		http://www.realtek.com.tw/
 Source0:	%{pname}-%{version}.tar.bz2
 # Source0-md5:	45370f7630da1ff6e3a9996e445a94af
 Patch0:		kernel-5.6.patch
+Patch1:		kernel-4.9.256.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)
@@ -72,6 +73,7 @@ Express Gigabit Ethernet.\
 %prep
 %setup -q -n %{pname}-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{expand:%build_kernel_packages}
diff --git a/kernel-4.9.256.patch b/kernel-4.9.256.patch
new file mode 100644
index 0000000..3c8feb5
--- /dev/null
+++ b/kernel-4.9.256.patch
@@ -0,0 +1,41 @@
+diff -ur r8168-8.048.02/src/r8168_n.c r8168-8.048.02-256/src/r8168_n.c
+--- r8168-8.048.02/src/r8168_n.c	2021-02-06 21:15:28.271768114 +0100
++++ r8168-8.048.02-256/src/r8168_n.c	2021-02-06 21:15:11.085159309 +0100
+@@ -24389,11 +24389,11 @@
+         tp->advertising = advertising_mode;
+ 
+         tp->max_jumbo_frame_size = rtl_chip_info[tp->chipset].jumbo_frame_sz;
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
+         /* MTU range: 60 - hw-specific max */
+         dev->min_mtu = ETH_ZLEN;
+         dev->max_mtu = tp->max_jumbo_frame_size;
+-#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
++#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
+         tp->eee_enabled = eee_enable;
+         tp->eee_adv_t = MDIO_EEE_1000T | MDIO_EEE_100TX;
+ }
+@@ -27421,12 +27421,12 @@
+         int ret = 0;
+         unsigned long flags;
+ 
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
+         if (new_mtu < ETH_ZLEN)
+                 return -EINVAL;
+         else if (new_mtu > tp->max_jumbo_frame_size)
+                 new_mtu = tp->max_jumbo_frame_size;
+-#endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
++#endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
+ 
+         spin_lock_irqsave(&tp->lock, flags);
+         dev->mtu = new_mtu;
+@@ -28798,7 +28798,7 @@
+                 }
+ #endif
+ 
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
+                 if (RTL_NETIF_RX_COMPLETE(dev, napi, work_done) == FALSE) return RTL_NAPI_RETURN_VALUE;
+ #else
+                 RTL_NETIF_RX_COMPLETE(dev, napi, work_done);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/r8168.git/commitdiff/a838d1bd0922bbd3970537728e780d63b1e80bee



More information about the pld-cvs-commit mailing list