File r8168-kernel_version.patch of Package r8168
73
1
---
2
src/r8168.h | 4 ++++
3
src/r8168_n.c | 15 ++++++++++++++-
4
2 files changed, 18 insertions(+), 1 deletion(-)
5
6
--- src/r8168.h
7
+++ src/r8168.h 2024-03-13 11:51:59.011947503 +0000
8
9
} while (0)
10
#endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
11
12
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
13
+#include <linux/sched/signal.h>
14
+#endif
15
+
16
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
17
#if defined(skb_vlan_tag_present) && !defined(vlan_tx_tag_present)
18
#define vlan_tx_tag_present skb_vlan_tag_present
19
--- src/r8168_n.c
20
+++ src/r8168_n.c 2024-03-13 11:57:02.890342590 +0000
21
22
#include <linux/rtnetlink.h>
23
#include <linux/completion.h>
24
25
+#ifndef HAS_PCI_ASPM_H
26
+#define HAS_PCI_ASPM_H @ASPM@
27
+#endif
28
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
29
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
30
+#if HAS_PCI_ASPM_H
31
#include <linux/pci-aspm.h>
32
#endif
33
#endif
34
+#endif
35
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,37)
36
#include <linux/prefetch.h>
37
#endif
38
39
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
40
static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue);
41
#else
42
+#if !HAS_PCI_ASPM_H
43
+static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue);
44
+#else
45
static void rtl8168_tx_timeout(struct net_device *dev);
46
#endif
47
+#endif
48
static struct net_device_stats *rtl8168_get_stats(struct net_device *dev);
49
static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, struct rtl8168_rx_ring *, napi_budget);
50
#ifdef CONFIG_R8168_NAPI
51
52
rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue)
53
#else
54
static void
55
+#if !HAS_PCI_ASPM_H
56
+rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue)
57
+#else
58
rtl8168_tx_timeout(struct net_device *dev)
59
#endif
60
+#endif
61
{
62
struct rtl8168_private *tp = netdev_priv(dev);
63
64
65
66
if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0)
67
rtl8168_rx_skb(tp, skb, ring_index);
68
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
69
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
70
dev->last_rx = jiffies;
71
#endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
72
RTLDEV->stats.rx_bytes += pkt_size;
73