SHARE
TWEET

r8168 - Patch for 4.15 kernel

dgdev91 Dec 27th, 2017 175 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/src/r8168_n.c b/src/r8168_n.c
  2. index 4cd540a..2dbb726 100755
  3. --- a/src/r8168_n.c
  4. +++ b/src/r8168_n.c
  5. @@ -407,8 +407,14 @@ MODULE_VERSION(RTL8168_VERSION);
  6.  static void rtl8168_sleep_rx_enable(struct net_device *dev);
  7.  static void rtl8168_dsm(struct net_device *dev, int dev_state);
  8.  
  9. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  10. +static void rtl8168_esd_timer(struct timer_list *timer);
  11. +static void rtl8168_link_timer(struct timer_list *timer);
  12. +#else
  13.  static void rtl8168_esd_timer(unsigned long __opaque);
  14.  static void rtl8168_link_timer(unsigned long __opaque);
  15. +#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  16. +
  17.  static void rtl8168_tx_clear(struct rtl8168_private *tp);
  18.  static void rtl8168_rx_clear(struct rtl8168_private *tp);
  19.  
  20. @@ -22964,7 +22970,11 @@ static inline void rtl8168_request_esd_timer(struct net_device *dev)
  21.          struct rtl8168_private *tp = netdev_priv(dev);
  22.          struct timer_list *timer = &tp->esd_timer;
  23.  
  24. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  25. +        timer_setup(timer, rtl8168_esd_timer, 0);
  26. +#else
  27.          setup_timer(timer, rtl8168_esd_timer, (unsigned long)dev);
  28. +#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  29.          mod_timer(timer, jiffies + RTL8168_ESD_TIMEOUT);
  30.  }
  31.  
  32. @@ -22978,7 +22988,11 @@ static inline void rtl8168_request_link_timer(struct net_device *dev)
  33.          struct rtl8168_private *tp = netdev_priv(dev);
  34.          struct timer_list *timer = &tp->link_timer;
  35.  
  36. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  37. +        timer_setup(timer, rtl8168_link_timer, 0);
  38. +#else
  39.          setup_timer(timer, rtl8168_link_timer, (unsigned long)dev);
  40. +#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  41.          mod_timer(timer, jiffies + RTL8168_LINK_TIMEOUT);
  42.  }
  43.  
  44. @@ -24717,12 +24731,19 @@ err_out:
  45.  #define PCI_DEVICE_SERIAL_NUMBER (0x0164)
  46.  
  47.  static void
  48. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  49. +rtl8168_esd_timer(struct timer_list *timer)
  50. +{
  51. +        struct rtl8168_private *tp = from_timer(tp, timer, esd_timer);
  52. +        struct net_device *dev = tp->dev;
  53. +#else
  54.  rtl8168_esd_timer(unsigned long __opaque)
  55.  {
  56.          struct net_device *dev = (struct net_device *)__opaque;
  57.          struct rtl8168_private *tp = netdev_priv(dev);
  58. -        struct pci_dev *pdev = tp->pci_dev;
  59.          struct timer_list *timer = &tp->esd_timer;
  60. +#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  61. +        struct pci_dev *pdev = tp->pci_dev;
  62.          unsigned long timeout = RTL8168_ESD_TIMEOUT;
  63.          unsigned long flags;
  64.          u8 cmd;
  65. @@ -24856,11 +24877,18 @@ rtl8168_esd_timer(unsigned long __opaque)
  66.  }
  67.  
  68.  static void
  69. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  70. +rtl8168_link_timer(struct timer_list *timer)
  71. +{
  72. +        struct rtl8168_private *tp = from_timer(tp, timer, link_timer);
  73. +        struct net_device *dev = tp->dev;
  74. +#else
  75.  rtl8168_link_timer(unsigned long __opaque)
  76.  {
  77.          struct net_device *dev = (struct net_device *)__opaque;
  78.          struct rtl8168_private *tp = netdev_priv(dev);
  79.          struct timer_list *timer = &tp->link_timer;
  80. +#endif//LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
  81.          unsigned long flags;
  82.  
  83.          spin_lock_irqsave(&tp->lock, flags);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top