From: VMware, Inc <> Date: Tue, 13 Mar 2012 20:11:30 +0000 (-0700) Subject: Fix HGFS, pvscsi, vmxnet3, vmci, and vmnet build problems on 3.3 kernel X-Git-Tag: 2012.03.13-651368~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1da8fbf593f3586bb222b54f909cf1db98cf92ef;p=thirdparty%2Fopen-vm-tools.git Fix HGFS, pvscsi, vmxnet3, vmci, and vmnet build problems on 3.3 kernel hgfs: Mode argument is now umode_t, rather than int. vmxnet3: Features are netdev_features_t, rather than uint32 (and they are uint64 now). vmci, pvscsi: Bool module option is bool, not int. vmnet: Missing compat_module.h include. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/modules/linux/shared/compat_fs.h b/open-vm-tools/modules/linux/shared/compat_fs.h index 1d606c6f3..7ec30bd88 100644 --- a/open-vm-tools/modules/linux/shared/compat_fs.h +++ b/open-vm-tools/modules/linux/shared/compat_fs.h @@ -248,4 +248,10 @@ #define VMW_FSYNC_OLD #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) +typedef umode_t compat_umode_t; +#else +typedef int compat_umode_t; +#endif + #endif /* __COMPAT_FS_H__ */ diff --git a/open-vm-tools/modules/linux/shared/compat_netdevice.h b/open-vm-tools/modules/linux/shared/compat_netdevice.h index b7abd5624..3aec25ba1 100644 --- a/open-vm-tools/modules/linux/shared/compat_netdevice.h +++ b/open-vm-tools/modules/linux/shared/compat_netdevice.h @@ -331,4 +331,10 @@ compat_multiqueue_allowed(struct pci_dev *dev) # define compat_vlan_get_protocol(skb) (skb->protocol) #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) +typedef netdev_features_t compat_netdev_features_t; +#else +typedef u32 compat_netdev_features_t; +#endif + #endif /* __COMPAT_NETDEVICE_H__ */ diff --git a/open-vm-tools/modules/linux/vmci/linux/driver.c b/open-vm-tools/modules/linux/vmci/linux/driver.c index c27d0682f..b14b17129 100644 --- a/open-vm-tools/modules/linux/vmci/linux/driver.c +++ b/open-vm-tools/modules/linux/vmci/linux/driver.c @@ -150,11 +150,22 @@ static void process_bitmap(unsigned long data); # define VMCI_DISABLE_MSIX 1 #endif +/* + * Linux kernel < 2.6.31 takes 'int' for 'bool' module parameters. + * Linux kernel >= 3.3.0 takes 'bool' for 'bool' module parameters. + * Kernels between the two take either. So flip switch at 3.0.0. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) +# define compat_bool bool +#else +# define compat_bool int +#endif + static vmci_device vmci_dev; -static int vmci_disable_host = 0; -static int vmci_disable_guest = 0; -static int vmci_disable_msi; -static int vmci_disable_msix = VMCI_DISABLE_MSIX; +static compat_bool vmci_disable_host = 0; +static compat_bool vmci_disable_guest = 0; +static compat_bool vmci_disable_msi; +static compat_bool vmci_disable_msix = VMCI_DISABLE_MSIX; DECLARE_TASKLET(vmci_dg_tasklet, dispatch_datagrams, (unsigned long)&vmci_dev); diff --git a/open-vm-tools/modules/linux/vmhgfs/inode.c b/open-vm-tools/modules/linux/vmhgfs/inode.c index 16b68b0be..0f400d995 100644 --- a/open-vm-tools/modules/linux/vmhgfs/inode.c +++ b/open-vm-tools/modules/linux/vmhgfs/inode.c @@ -61,7 +61,7 @@ static int HgfsPackSetattrRequest(struct iattr *iattr, HgfsReq *req, Bool *changed); static int HgfsPackCreateDirRequest(struct dentry *dentry, - int mode, + compat_umode_t mode, HgfsOp opUsed, HgfsReq *req); static int HgfsTruncatePages(struct inode *inode, @@ -74,14 +74,14 @@ static int HgfsPackSymlinkCreateRequest(struct dentry *dentry, /* HGFS inode operations. */ static int HgfsCreate(struct inode *dir, struct dentry *dentry, - int mode, + compat_umode_t mode, struct nameidata *nd); static struct dentry *HgfsLookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd); static int HgfsMkdir(struct inode *dir, struct dentry *dentry, - int mode); + compat_umode_t mode); static int HgfsRmdir(struct inode *dir, struct dentry *dentry); static int HgfsUnlink(struct inode *dir, @@ -729,7 +729,7 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from static int HgfsPackCreateDirRequest(struct dentry *dentry, // IN: Directory to create - int mode, // IN: Mode to assign dir + compat_umode_t mode, // IN: Mode to assign dir HgfsOp opUsed, // IN: Op to be used. HgfsReq *req) // IN/OUT: Packet to write into { @@ -951,7 +951,7 @@ HgfsTruncatePages(struct inode *inode, // IN: Inode whose page to truncate static int HgfsCreate(struct inode *dir, // IN: Parent dir to create in struct dentry *dentry, // IN: Dentry containing name to create - int mode, // IN: Mode of file to be created + compat_umode_t mode, // IN: Mode of file to be created struct nameidata *nd) // IN: Intent, vfsmount, ... { HgfsAttrInfo attr; @@ -1107,7 +1107,7 @@ error: static int HgfsMkdir(struct inode *dir, // IN: Inode of parent directory struct dentry *dentry, // IN: Dentry with name to be created - int mode) // IN: Mode of dir to be created + compat_umode_t mode) // IN: Mode of dir to be created { HgfsReq *req; HgfsStatus replyStatus;