From c8fcaa1f12159bd0fcbb2fa4550007a73f644826 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Thu, 10 Jul 2014 22:09:18 +0200 Subject: [PATCH] - up to 8.038.00 - linux 3.10 support added upstream - added fix for linux 3.15+ --- linux-3.10.patch | 67 ------------------------------------------------ linux-3.15.patch | 14 ++++++++++ r8168.spec | 8 +++--- 3 files changed, 18 insertions(+), 71 deletions(-) delete mode 100644 linux-3.10.patch create mode 100644 linux-3.15.patch diff --git a/linux-3.10.patch b/linux-3.10.patch deleted file mode 100644 index b52856e..0000000 --- a/linux-3.10.patch +++ /dev/null @@ -1,67 +0,0 @@ -Author: Ko Matsumura -Description: add kernel 3.10 support -Origin: other, https://code.google.com/p/r8168/issues/detail?id=15#c1 -Bug-Debian: http://bugs.debian.org/717161 - ---- a/src/r8168_n.c 2013-06-17 20:42:48.000000000 +0900 -+++ b/src/r8168_n.c 2013-07-21 00:20:02.000000000 +0900 -@@ -52,6 +52,10 @@ - #include - #include - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) -+#include -+#endif -+ - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) - #include - #endif -@@ -2232,6 +2236,9 @@ - swab16(opts2 & 0xffff)); - ret = 0; - } -+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) -+ if (opts2 & RxVlanTag) -+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), swab16(opts2 & 0xffff)); - #else - if (opts2 & RxVlanTag) - __vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff)); -@@ -2294,8 +2301,11 @@ - tp->cp_cmd |= RxChkSum; - else - tp->cp_cmd &= ~RxChkSum; -- -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) -+ if (dev->features & NETIF_F_HW_VLAN_CTAG_RX) -+#else - if (dev->features & NETIF_F_HW_VLAN_RX) -+#endif - tp->cp_cmd |= RxVlan; - else - tp->cp_cmd &= ~RxVlan; -@@ -16195,7 +16205,11 @@ - - #ifdef CONFIG_R8168_VLAN - if (tp->mcfg != CFG_METHOD_DEFAULT) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) -+ dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX; -+#else - dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; -+#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) - dev->vlan_rx_kill_vid = rtl8168_vlan_rx_kill_vid; - #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) -@@ -16209,8 +16223,13 @@ - tp->cp_cmd |= RxChkSum; - #else - dev->features |= NETIF_F_RXCSUM; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) -+ dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | -+ NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX; -+#else - dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | - NETIF_F_RXCSUM | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; -+#endif - dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | - NETIF_F_HIGHDMA; - #endif diff --git a/linux-3.15.patch b/linux-3.15.patch new file mode 100644 index 0000000..ee5ba05 --- /dev/null +++ b/linux-3.15.patch @@ -0,0 +1,14 @@ +--- r8168-8.038.00/src/r8168_n.c~ 2014-01-08 09:56:43.000000000 +0100 ++++ r8168-8.038.00/src/r8168_n.c 2014-07-10 22:02:50.895076111 +0200 +@@ -19119,7 +19119,11 @@ + { + struct rtl8168_private *tp = netdev_priv(dev); + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) + PREPARE_DELAYED_WORK(&tp->task, task); ++#else ++ INIT_DELAYED_WORK(&tp->task, task); ++#endif + schedule_delayed_work(&tp->task, 4); + } + #endif diff --git a/r8168.spec b/r8168.spec index 862ce14..f19d452 100644 --- a/r8168.spec +++ b/r8168.spec @@ -19,12 +19,12 @@ exit 1 %define kpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%kernel_pkg ; done) %define bkpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%build_kernel_pkg ; done) -%define rel 8 +%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.036.00 +Version: 8.038.00 Release: %{rel}%{?_pld_builder:@%{_kernel_ver_str}} License: GPL Group: Base/Kernel @@ -33,8 +33,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: a9a5b238f59cc30eefa5917d7f6b728e -Patch0: linux-3.10.patch +# Source0-md5: fe2962824587070a2ec53f77e40b0fea +Patch0: linux-3.15.patch BuildRequires: rpmbuild(macros) >= 1.678 %{?with_dist_kernel:%{expand:%kbrs}} BuildRoot: %{tmpdir}/%{pname}-%{version}-root-%(id -u -n) -- 2.44.0