0001-Fix-vmxnet-module-on-kernels-3.16.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From 08836a47c56b47b658025e41a20027c5d915f836 Mon Sep 17 00:00:00 2001
  2. From: "Scott M. Kroll" <skroll@gmail.com>
  3. Date: Fri, 15 Aug 2014 10:40:38 -0400
  4. Subject: [PATCH 1/3] Fix vmxnet module on kernels >= 3.16
  5. * Add compat check for ethtool_ops in net_device struct.
  6. * SET_ETHTOOL_OPS is no longer defined, but can be manually.
  7. ---
  8. open-vm-tools/modules/linux/shared/compat_netdevice.h | 4 ++++
  9. open-vm-tools/modules/linux/vmxnet/vmxnet.c | 13 ++++++++-----
  10. 2 files changed, 12 insertions(+), 5 deletions(-)
  11. diff --git a/open-vm-tools/modules/linux/shared/compat_netdevice.h b/open-vm-tools/modules/linux/shared/compat_netdevice.h
  12. index 3aec25b..a65d59b 100644
  13. --- a/open-vm-tools/modules/linux/shared/compat_netdevice.h
  14. +++ b/open-vm-tools/modules/linux/shared/compat_netdevice.h
  15. @@ -337,4 +337,8 @@ typedef netdev_features_t compat_netdev_features_t;
  16. typedef u32 compat_netdev_features_t;
  17. #endif
  18. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || defined(SET_ETHTOOL_OPS)
  19. +#define VMW_HAVE_ETHTOOL_OPS 1
  20. +#endif
  21. +
  22. #endif /* __COMPAT_NETDEVICE_H__ */
  23. diff --git a/open-vm-tools/modules/linux/vmxnet/vmxnet.c b/open-vm-tools/modules/linux/vmxnet/vmxnet.c
  24. index 33afb9b..40abde5 100644
  25. --- a/open-vm-tools/modules/linux/vmxnet/vmxnet.c
  26. +++ b/open-vm-tools/modules/linux/vmxnet/vmxnet.c
  27. @@ -279,8 +279,7 @@ vmxnet_change_mtu(struct net_device *dev, int new_mtu)
  28. #endif
  29. -
  30. -#ifdef SET_ETHTOOL_OPS
  31. +#ifdef VMW_HAVE_ETHTOOL_OPS
  32. /*
  33. *----------------------------------------------------------------------------
  34. *
  35. @@ -526,7 +525,7 @@ vmxnet_ethtool_ops = {
  36. };
  37. -#else /* !defined(SET_ETHTOOL_OPS) */
  38. +#else /* !defined(VMW_HAVE_ETHTOOL_OPS) */
  39. /*
  40. @@ -739,7 +738,7 @@ vmxnet_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
  41. }
  42. return -EOPNOTSUPP;
  43. }
  44. -#endif /* SET_ETHTOOL_OPS */
  45. +#endif /* !defined(VMW_HAVE_ETHTOOL_OPS) */
  46. /*
  47. @@ -1142,8 +1141,12 @@ vmxnet_probe_device(struct pci_dev *pdev, // IN: vmxnet PCI device
  48. dev->watchdog_timeo = VMXNET_WATCHDOG_TIMEOUT;
  49. #endif
  50. -#ifdef SET_ETHTOOL_OPS
  51. +#ifdef VMW_HAVE_ETHTOOL_OPS
  52. +# ifdef SET_ETHTOOL_OPS
  53. SET_ETHTOOL_OPS(dev, &vmxnet_ethtool_ops);
  54. +# else
  55. + dev->ethtool_ops = &vmxnet_ethtool_ops;
  56. +# endif
  57. #else
  58. dev->do_ioctl = vmxnet_ioctl;
  59. #endif
  60. --
  61. 2.3.4