summarylogtreecommitdiffstats
path: root/linux-4.15.patch
diff options
context:
space:
mode:
Diffstat (limited to 'linux-4.15.patch')
-rw-r--r--linux-4.15.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/linux-4.15.patch b/linux-4.15.patch
new file mode 100644
index 000000000000..290055ef83fd
--- /dev/null
+++ b/linux-4.15.patch
@@ -0,0 +1,94 @@
+diff --git a/src/r8168_n.c b/src/r8168_n.c
+index 4cd540a..e7ee078 100755
+--- a/src/r8168_n.c
++++ b/src/r8168_n.c
+@@ -87,6 +87,8 @@
+ #include <linux/seq_file.h>
+ #endif
+
++unsigned long __devicepointer;
++
+ /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
+ The RTL chips use a 64 element hash table based on the Ethernet CRC. */
+ static const int multicast_filter_limit = 32;
+@@ -407,8 +409,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 +22972,12 @@ 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)
++ __devicepointer = (unsigned long)dev;
++ 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 +22991,12 @@ 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)
++ __devicepointer = (unsigned long)dev;
++ 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 +24735,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 net_device *dev = (struct net_device *)__devicepointer;
++ struct rtl8168_private *tp = netdev_priv(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 +24881,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 net_device *dev = (struct net_device *)__devicepointer;
++ struct rtl8168_private *tp = netdev_priv(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