]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix vmxnet driver compilation for kernel 3.3
authorVMware, Inc <>
Tue, 13 Mar 2012 20:15:15 +0000 (13:15 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Wed, 14 Mar 2012 18:02:52 +0000 (11:02 -0700)
Some ethtool callbacks were deprecated, remove them.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/modules/linux/vmxnet/vmxnet.c
open-vm-tools/modules/linux/vmxnet/vmxnet_version.h

index 0f6f119cfaba4b344c25a8fc5a481dc2194f2734..e423e65a833e3095ae1229223f354912f1a99e21 100644 (file)
@@ -80,6 +80,10 @@ static int vmxnet_close(struct net_device *dev);
 static void vmxnet_set_multicast_list(struct net_device *dev);
 static int vmxnet_set_mac_address(struct net_device *dev, void *addr);
 static struct net_device_stats *vmxnet_get_stats(struct net_device *dev);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
+static int vmxnet_set_features(struct net_device *netdev, compat_netdev_features_t
+                              features);
+#endif
 #if defined(HAVE_CHANGE_MTU) || defined(HAVE_NET_DEVICE_OPS)
 static int vmxnet_change_mtu(struct net_device *dev, int new_mtu);
 #endif
@@ -353,6 +357,7 @@ vmxnet_get_drvinfo(struct net_device *dev,
 }
 
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
 /*
  *----------------------------------------------------------------------------
  *
@@ -482,7 +487,7 @@ vmxnet_set_rx_csum(struct net_device *netdev, uint32 val)
  *----------------------------------------------------------------------------
  */
 
-#ifdef VMXNET_DO_TSO
+#   ifdef VMXNET_DO_TSO
 static int
 vmxnet_set_tso(struct net_device *dev, u32 data)
 {
@@ -498,6 +503,7 @@ vmxnet_set_tso(struct net_device *dev, u32 data)
    }
    return 0;
 }
+#   endif
 #endif
 
 
@@ -506,17 +512,19 @@ vmxnet_ethtool_ops = {
    .get_settings        = vmxnet_get_settings,
    .get_drvinfo         = vmxnet_get_drvinfo,
    .get_link            = ethtool_op_get_link,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
    .get_rx_csum         = vmxnet_get_rx_csum,
    .set_rx_csum         = vmxnet_set_rx_csum,
    .get_tx_csum         = vmxnet_get_tx_csum,
    .set_tx_csum         = vmxnet_set_tx_csum,
    .get_sg              = ethtool_op_get_sg,
    .set_sg              = ethtool_op_set_sg,
-#ifdef VMXNET_DO_TSO
+#   ifdef VMXNET_DO_TSO
    .get_tso             = ethtool_op_get_tso,
    .set_tso             = vmxnet_set_tso,
-#   if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
+#      if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
    .get_ufo             = ethtool_op_get_ufo,
+#      endif
 #   endif
 #endif
 };
@@ -989,6 +997,9 @@ vmxnet_probe_device(struct pci_dev             *pdev, // IN: vmxnet PCI device
       .ndo_start_xmit = &vmxnet_start_tx,
       .ndo_stop = &vmxnet_close,
       .ndo_get_stats = &vmxnet_get_stats,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
+      .ndo_set_features = vmxnet_set_features,
+#endif
 #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
       .ndo_set_multicast_list = &vmxnet_set_multicast_list,
 #else
@@ -3103,6 +3114,20 @@ vmxnet_get_stats(struct net_device *dev)
    return &lp->stats;
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
+static int
+vmxnet_set_features(struct net_device *netdev, compat_netdev_features_t features)
+{
+   compat_netdev_features_t changed = features ^ netdev->features;
+
+   if (changed & (NETIF_F_RXCSUM)) {
+      if (features & NETIF_F_RXCSUM)
+         return 0;
+   }
+   return -1;
+}
+#endif
+
 module_init(vmxnet_init);
 module_exit(vmxnet_exit);
 MODULE_DEVICE_TABLE(pci, vmxnet_chips);
index aaacd86c3caee898ac03d5f3d54e53f5122c7950..ee19e5caf3b110769ec989c6c07c8aaf88aff927 100644 (file)
@@ -25,8 +25,8 @@
 #ifndef _VMXNET_VERSION_H_
 #define _VMXNET_VERSION_H_
 
-#define VMXNET_DRIVER_VERSION          2.0.12.0
-#define VMXNET_DRIVER_VERSION_COMMAS   2,0,12,0
-#define VMXNET_DRIVER_VERSION_STRING   "2.0.12.0"
+#define VMXNET_DRIVER_VERSION          2.0.13.0
+#define VMXNET_DRIVER_VERSION_COMMAS   2,0,13,0
+#define VMXNET_DRIVER_VERSION_STRING   "2.0.13.0"
 
 #endif /* _VMXNET_VERSION_H_ */