From: VMware, Inc <> Date: Tue, 13 Mar 2012 20:15:15 +0000 (-0700) Subject: Fix vmxnet driver compilation for kernel 3.3 X-Git-Tag: 2012.03.13-651368~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d2b02b1aa90d1a3df7777246416288ef89511f2;p=thirdparty%2Fopen-vm-tools.git Fix vmxnet driver compilation for kernel 3.3 Some ethtool callbacks were deprecated, remove them. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/modules/linux/vmxnet/vmxnet.c b/open-vm-tools/modules/linux/vmxnet/vmxnet.c index 0f6f119cf..e423e65a8 100644 --- a/open-vm-tools/modules/linux/vmxnet/vmxnet.c +++ b/open-vm-tools/modules/linux/vmxnet/vmxnet.c @@ -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); diff --git a/open-vm-tools/modules/linux/vmxnet/vmxnet_version.h b/open-vm-tools/modules/linux/vmxnet/vmxnet_version.h index aaacd86c3..ee19e5caf 100644 --- a/open-vm-tools/modules/linux/vmxnet/vmxnet_version.h +++ b/open-vm-tools/modules/linux/vmxnet/vmxnet_version.h @@ -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_ */