1 Author: Ko Matsumura <minaco2@gmail.com>
2 Description: add kernel 3.10 support
3 Origin: other, https://code.google.com/p/r8168/issues/detail?id=15#c1
4 Bug-Debian: http://bugs.debian.org/717161
6 --- a/src/r8168_n.c 2013-06-17 20:42:48.000000000 +0900
7 +++ b/src/r8168_n.c 2013-07-21 00:20:02.000000000 +0900
9 #include <linux/init.h>
10 #include <linux/rtnetlink.h>
12 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
13 +#include <uapi/linux/if_ether.h>
16 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
17 #include <linux/pci-aspm.h>
20 swab16(opts2 & 0xffff));
23 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
24 + if (opts2 & RxVlanTag)
25 + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), swab16(opts2 & 0xffff));
27 if (opts2 & RxVlanTag)
28 __vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff));
29 @@ -2294,8 +2301,11 @@
30 tp->cp_cmd |= RxChkSum;
32 tp->cp_cmd &= ~RxChkSum;
34 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
35 + if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
37 if (dev->features & NETIF_F_HW_VLAN_RX)
41 tp->cp_cmd &= ~RxVlan;
42 @@ -16195,7 +16205,11 @@
44 #ifdef CONFIG_R8168_VLAN
45 if (tp->mcfg != CFG_METHOD_DEFAULT) {
46 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
47 + dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
49 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
51 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
52 dev->vlan_rx_kill_vid = rtl8168_vlan_rx_kill_vid;
53 #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
54 @@ -16209,8 +16223,13 @@
55 tp->cp_cmd |= RxChkSum;
57 dev->features |= NETIF_F_RXCSUM;
58 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
59 + dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
60 + NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
62 dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
63 NETIF_F_RXCSUM | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
65 dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |