[packages/r8168] - up to 8.045.08 - kernel 4.15 patch from Aurox
baggins
baggins at pld-linux.org
Mon Jan 29 21:35:27 CET 2018
commit 0eb37832c886be187457a39ced0c9f954e2ce718
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Mon Jan 29 21:35:05 2018 +0100
- up to 8.045.08
- kernel 4.15 patch from Aurox
kernel-4.15.patch | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
linux-4.11.patch | 12 --------
linux-4.5.patch | 14 ----------
linux-4.7.patch | 34 -----------------------
r8168.spec | 12 +++-----
5 files changed, 87 insertions(+), 68 deletions(-)
---
diff --git a/r8168.spec b/r8168.spec
index 3b71fcd..d5b170c 100644
--- a/r8168.spec
+++ b/r8168.spec
@@ -4,12 +4,12 @@
# nothing to be placed to debuginfo package
%define _enable_debug_packages 0
-%define rel 2
+%define rel 1
%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
Name: %{pname}%{_alt_kernel}
-Version: 8.042.00
+Version: 8.045.08
Release: %{rel}%{?_pld_builder:@%{_kernel_ver_str}}
License: GPL
Group: Base/Kernel
@@ -18,10 +18,8 @@ URL: http://www.realtek.com.tw/
# http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false
# unfortunately this download is not DF-friendly.
Source0: %{pname}-%{version}.tar.bz2
-# Source0-md5: 2c583809d1ebf26ed7f5e775c83e68e0
-Patch0: linux-4.5.patch
-Patch1: linux-4.7.patch
-Patch2: linux-4.11.patch
+# Source0-md5: 474442fe528aee9bbc3c7e9a19debcb5
+Patch0: kernel-4.15.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,8 +72,6 @@ Express Gigabit Ethernet.\
%prep
%setup -q -n %{pname}-%{version}
%patch0 -p1
-%patch1 -p1
-%patch2 -p1
%build
%{expand:%build_kernel_packages}
diff --git a/kernel-4.15.patch b/kernel-4.15.patch
new file mode 100644
index 0000000..f53ab78
--- /dev/null
+++ b/kernel-4.15.patch
@@ -0,0 +1,83 @@
+diff --git a/src/r8168_n.c b/src/r8168_n.c
+index 4cd540a..2dbb726 100755
+--- a/src/r8168_n.c
++++ b/src/r8168_n.c
+@@ -407,8 +407,14 @@ MODULE_VERSION(RTL8168_VERSION);
+ static void rtl8168_sleep_rx_enable(struct net_device *dev);
+ static void rtl8168_dsm(struct net_device *dev, int dev_state);
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++static void rtl8168_esd_timer(struct timer_list *timer);
++static void rtl8168_link_timer(struct timer_list *timer);
++#else
+ static void rtl8168_esd_timer(unsigned long __opaque);
+ static void rtl8168_link_timer(unsigned long __opaque);
++#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++
+ static void rtl8168_tx_clear(struct rtl8168_private *tp);
+ static void rtl8168_rx_clear(struct rtl8168_private *tp);
+
+@@ -22964,7 +22970,11 @@ static inline void rtl8168_request_esd_timer(struct net_device *dev)
+ struct rtl8168_private *tp = netdev_priv(dev);
+ struct timer_list *timer = &tp->esd_timer;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++ timer_setup(timer, rtl8168_esd_timer, 0);
++#else
+ setup_timer(timer, rtl8168_esd_timer, (unsigned long)dev);
++#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+ mod_timer(timer, jiffies + RTL8168_ESD_TIMEOUT);
+ }
+
+@@ -22978,7 +22988,11 @@ static inline void rtl8168_request_link_timer(struct net_device *dev)
+ struct rtl8168_private *tp = netdev_priv(dev);
+ struct timer_list *timer = &tp->link_timer;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++ timer_setup(timer, rtl8168_link_timer, 0);
++#else
+ setup_timer(timer, rtl8168_link_timer, (unsigned long)dev);
++#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+ mod_timer(timer, jiffies + RTL8168_LINK_TIMEOUT);
+ }
+
+@@ -24717,12 +24731,19 @@ err_out:
+ #define PCI_DEVICE_SERIAL_NUMBER (0x0164)
+
+ static void
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++rtl8168_esd_timer(struct timer_list *timer)
++{
++ struct rtl8168_private *tp = from_timer(tp, timer, esd_timer);
++ struct net_device *dev = tp->dev;
++#else
+ rtl8168_esd_timer(unsigned long __opaque)
+ {
+ struct net_device *dev = (struct net_device *)__opaque;
+ struct rtl8168_private *tp = netdev_priv(dev);
+- struct pci_dev *pdev = tp->pci_dev;
+ struct timer_list *timer = &tp->esd_timer;
++#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++ struct pci_dev *pdev = tp->pci_dev;
+ unsigned long timeout = RTL8168_ESD_TIMEOUT;
+ unsigned long flags;
+ u8 cmd;
+@@ -24856,11 +24877,18 @@ rtl8168_esd_timer(unsigned long __opaque)
+ }
+
+ static void
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++rtl8168_link_timer(struct timer_list *timer)
++{
++ struct rtl8168_private *tp = from_timer(tp, timer, link_timer);
++ struct net_device *dev = tp->dev;
++#else
+ rtl8168_link_timer(unsigned long __opaque)
+ {
+ struct net_device *dev = (struct net_device *)__opaque;
+ struct rtl8168_private *tp = netdev_priv(dev);
+ struct timer_list *timer = &tp->link_timer;
++#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+ unsigned long flags;
+
+ spin_lock_irqsave(&tp->lock, flags);
\ No newline at end of file
diff --git a/linux-4.11.patch b/linux-4.11.patch
deleted file mode 100644
index d77cbfe..0000000
--- a/linux-4.11.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- r8168-8.042.00/src/r8168_n.c~ 2017-05-10 00:51:08.000000000 +0200
-+++ r8168-8.042.00/src/r8168_n.c 2017-05-10 00:51:48.529625066 +0200
-@@ -25251,7 +25251,9 @@
- if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0)
- rtl8168_rx_skb(tp, skb);
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
- dev->last_rx = jiffies;
-+#endif
- RTLDEV->stats.rx_bytes += pkt_size;
- RTLDEV->stats.rx_packets++;
- }
diff --git a/linux-4.5.patch b/linux-4.5.patch
deleted file mode 100644
index 3dd8df1..0000000
--- a/linux-4.5.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- r8168-8.041.01/src/r8168_n.c~ 2015-10-06 08:33:04.000000000 +0200
-+++ r8168-8.041.01/src/r8168_n.c 2016-04-26 07:48:15.696296115 +0200
-@@ -4209,7 +4209,11 @@
- spin_lock_irqsave(&tp->lock, flags);
- if (dev->mtu > ETH_DATA_LEN) {
- features &= ~NETIF_F_ALL_TSO;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0)
- features &= ~NETIF_F_ALL_CSUM;
-+#else
-+ features &= ~NETIF_F_CSUM_MASK;
-+#endif
- }
- spin_unlock_irqrestore(&tp->lock, flags);
-
diff --git a/linux-4.7.patch b/linux-4.7.patch
deleted file mode 100644
index 6ef62d0..0000000
--- a/linux-4.7.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- r8168-8.042.00/src/r8168_n.c.orig 2016-08-01 21:20:42.000000000 +0200
-+++ r8168-8.042.00/src/r8168_n.c 2016-08-01 21:32:49.488072441 +0200
-@@ -22800,7 +22800,9 @@
- dev->hw_features &= ~NETIF_F_IPV6_CSUM;
- netif_set_gso_max_size(dev, LSO_32K);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
- dev->gso_min_segs = NIC_MIN_PHYS_BUF_COUNT;
-+#endif
- dev->gso_max_segs = NIC_MAX_PHYS_BUF_COUNT_LSO_64K;
- #endif
- } else {
-@@ -22808,7 +22810,9 @@
- dev->features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
- netif_set_gso_max_size(dev, LSO_64K);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
- dev->gso_min_segs = NIC_MIN_PHYS_BUF_COUNT;
-+#endif
- dev->gso_max_segs = NIC_MAX_PHYS_BUF_COUNT_LSO2;
- #endif
- }
-@@ -24970,7 +24974,11 @@
- wmb();
- txd->opts1 = cpu_to_le32(opts1);
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
- dev->trans_start = jiffies;
-+#else
-+ netif_trans_update(dev);
-+#endif
-
- tp->cur_tx += frags + 1;
-
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/r8168.git/commitdiff/0eb37832c886be187457a39ced0c9f954e2ce718
More information about the pld-cvs-commit
mailing list