diff -rupN orig/vmnet-only/driver-config.h patched/vmnet-only/driver-config.h --- orig/vmnet-only/driver-config.h 2009-10-21 03:43:26.000000000 +0200 +++ patched/vmnet-only/driver-config.h 2010-05-09 10:34:11.556430370 +0200 @@ -32,7 +32,7 @@ #define INCLUDE_ALLOW_VMNIXMOD #include "includeCheck.h" -#include +//#include #include "compat_version.h" /* diff -rupN orig/vmmon-only/include/driver-config.h patched/vmmon-only/include/driver-config.h --- orig/vmmon-only/include/driver-config.h 2009-10-21 03:43:25.000000000 +0200 +++ patched/vmmon-only/include/driver-config.h 2010-05-09 10:33:07.015055213 +0200 @@ -32,7 +32,7 @@ #define INCLUDE_ALLOW_VMNIXMOD #include "includeCheck.h" -#include +//#include #include "compat_version.h" /* diff -rupN orig/vsock-only/include/driver-config.h patched/vsock-only/include/driver-config.h --- orig/vsock-only/include/driver-config.h 2009-10-21 03:43:28.000000000 +0200 +++ patched/vsock-only/include/driver-config.h 2010-05-09 10:28:17.093067269 +0200 @@ -32,7 +32,7 @@ #define INCLUDE_ALLOW_VMNIXMOD #include "includeCheck.h" -#include +//#include #include "compat_version.h" /* diff -rupN orig/vmci-only/include/driver-config.h patched/vmci-only/include/driver-config.h --- orig/vmci-only/include/driver-config.h 2009-10-21 03:43:27.000000000 +0200 +++ patched/vmci-only/include/driver-config.h 2010-05-09 10:11:35.172403415 +0200 @@ -32,7 +32,7 @@ #define INCLUDE_ALLOW_VMNIXMOD #include "includeCheck.h" -#include +//#include #include "compat_version.h" /* diff -rupN orig/vmci-only/include/compat_wait.h patched/vmci-only/include/compat_wait.h --- orig/vmci-only/include/compat_wait.h 2009-03-27 07:17:11.000000000 +0000 +++ patched/vmci-only/include/compat_wait.h 2009-10-14 11:39:57.199696858 +0000 @@ -75,7 +75,11 @@ extern void poll_initwait(compat_poll_wq #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // { /* If prototype does not match, build will abort here */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) extern void poll_initwait(compat_poll_wqueues *); +#else +extern void poll_initwait(struct poll_wqueues *pwq); +#endif #define compat_poll_initwait(wait, table) ( \ (wait) = (table), \ diff -rupN orig/vmci-only/linux/vmciKernelIf.c patched/vmci-only/linux/vmciKernelIf.c --- orig/vmci-only/linux/vmciKernelIf.c 2009-03-27 07:17:11.000000000 +0000 +++ patched/vmci-only/linux/vmciKernelIf.c 2009-10-14 11:45:36.273704758 +0000 @@ -34,6 +34,7 @@ #define EXPORT_SYMTAB #define __NO_VERSION__ #include "compat_module.h" +#include "compat_sched.h" #include "compat_version.h" #include "compat_wait.h" diff -rupN orig/vmmon-only/include/compat_wait.h patched/vmmon-only/include/compat_wait.h --- orig/vmmon-only/include/compat_wait.h 2009-03-27 07:17:09.000000000 +0000 +++ patched/vmmon-only/include/compat_wait.h 2009-10-14 11:52:31.841571827 +0000 @@ -75,7 +75,11 @@ extern void poll_initwait(compat_poll_wq #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // { /* If prototype does not match, build will abort here */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) extern void poll_initwait(compat_poll_wqueues *); +#else +extern void poll_initwait(struct poll_wqueues *pwq); +#endif #define compat_poll_initwait(wait, table) ( \ (wait) = (table), \ diff -rupN orig/vmmon-only/linux/driver.c patched/vmmon-only/linux/driver.c --- orig/vmmon-only/linux/driver.c 2009-03-27 07:17:09.000000000 +0000 +++ patched/vmmon-only/linux/driver.c 2009-10-14 11:55:35.289574574 +0000 @@ -1984,10 +1984,17 @@ pageLockEnd: } case IOCTL_VMX86_ALLOW_CORE_DUMP: - if (current->euid == current->uid && - current->fsuid == current->uid && - current->egid == current->gid && - current->fsgid == current->gid) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) + if (current->euid == current->uid && + current->fsuid == current->uid && + current->egid == current->gid && + current->fsgid == current->gid) { +#else /* 2.6.29 and higher */ + if (current->cred->euid == current->cred->uid && + current->cred->fsuid == current->cred->uid && + current->cred->egid == current->cred->gid && + current->cred->fsgid == current->cred->gid) { +#endif /* 2.6.29 check */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) || defined(MMF_DUMPABLE) /* Dump core, readable by user. */ set_bit(MMF_DUMPABLE, ¤t->mm->flags); diff -rupN orig/vmmon-only/linux/hostif.c patched/vmmon-only/linux/hostif.c --- orig/vmmon-only/linux/hostif.c 2009-03-27 07:17:08.000000000 +0000 +++ patched/vmmon-only/linux/hostif.c 2009-10-14 11:52:31.846571625 +0000 @@ -2719,13 +2719,22 @@ HostIF_SemaphoreWait(VMDriver *vm, set_fs(get_ds()); { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) compat_poll_wqueues table; poll_table *wait; +#else /* 2.6.29 and above */ + struct poll_wqueues table; + struct poll_wqueues *wait; +#endif /* 2.6.29 and above */ unsigned int mask; compat_poll_initwait(wait, &table); current->state = TASK_INTERRUPTIBLE; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) mask = file->f_op->poll(file, wait); +#else + mask = file->f_op->poll(file, (poll_table *) wait); +#endif /* 2.6.29 */ if (!(mask & (POLLIN | POLLERR | POLLHUP))) { #ifdef KERNEL_2_4_0 vm->vmhost->vcpuSemaTask[vcpuid] = current; @@ -2744,7 +2753,6 @@ HostIF_SemaphoreWait(VMDriver *vm, } res = file->f_op->read(file, &ch, 1, &file->f_pos); - set_fs(old_fs); compat_fput(file); @@ -3456,8 +3464,13 @@ HostIFFastClockThread(void *data) // IN oldFS = get_fs(); set_fs(KERNEL_DS); compat_allow_signal(SIGKILL); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) cap_raise(current->cap_effective, CAP_SYS_RESOURCE); compat_set_user_nice(current, linuxState.fastClockPriority); +#else /* 2.6.29 */ + (void) cap_raised(current->cred->cap_effective, CAP_SYS_RESOURCE); + set_user_nice(current, linuxState.fastClockPriority); +#endif /* 2.6.29 and higher */ while (linuxState.fastClockRate > HZ + HZ/16) { unsigned long buf; @@ -3580,19 +3593,38 @@ HostIF_SetFastClockRate(unsigned int rat Bool cap; long pid; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) fsuid = current->fsuid; current->fsuid = 0; +#else + fsuid = current->cred->fsuid; +#warning current->cred->fsuid = 0; +#endif /* 2.6.29 */ filp = filp_open("/dev/rtc", O_RDONLY, 0); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) current->fsuid = fsuid; +#else +#warning current->cred->fsuid = fsuid; +#endif /* 2.6.29 */ if (IS_ERR(filp)) { Warning("/dev/rtc open failed: %d\n", (int)(VA)filp); return -(int)(VA)filp; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) cap = cap_raised(current->cap_effective, CAP_SYS_RESOURCE); cap_raise(current->cap_effective, CAP_SYS_RESOURCE); +#else /* 2.6.29 */ + cap = cap_raised(current->cred->cap_effective, CAP_SYS_RESOURCE); + (void) cap_raised(current->cred->cap_effective, CAP_SYS_RESOURCE); +#endif /* 2.6.29 */ res = HostIFDoIoctl(filp, RTC_PIE_ON, 0); if (!cap) { - cap_lower(current->cap_effective, CAP_SYS_RESOURCE); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) + cap_lower(current->cap_effective, CAP_SYS_RESOURCE); +#else +#warning cap_lower(current->cred->cap_effective, CAP_SYS_RESOURCE); +#endif /* 2.6.29 */ } if (res < 0) { Warning("/dev/rtc enable interrupt failed: %d\n", res); diff -rupN orig/vmmon-only/linux/vmmonInt.h patched/vmmon-only/linux/vmmonInt.h --- orig/vmmon-only/linux/vmmonInt.h 2009-03-27 07:17:08.000000000 +0000 +++ patched/vmmon-only/linux/vmmonInt.h 2009-10-14 11:52:31.846571625 +0000 @@ -46,7 +46,10 @@ #endif #if defined(CONFIG_SMP) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 8) -#ifdef VMW_HAVE_SMP_CALL_3ARG +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) +#define VMW_HAVE_SMP_CALL_3ARG +#endif +#ifdef VMW_HAVE_SMP_CALL_3ARG #define compat_smp_call_function(fn, info, wait) smp_call_function(fn, info, wait) #else #define compat_smp_call_function(fn, info, wait) smp_call_function(fn, info, 1, wait) diff -rupN orig/vmnet-only/bridge.c patched/vmnet-only/bridge.c --- orig/vmnet-only/bridge.c 2009-03-27 07:17:10.000000000 +0000 +++ patched/vmnet-only/bridge.c 2009-10-14 11:58:27.712572979 +0000 @@ -646,7 +646,11 @@ VNetBridgeReceiveFromVNet(VNetJack dev_unlock_list(); } else { struct sock *sk = bridge->sk; - atomic_add(skb->truesize, &sk->sk_wmem_alloc); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) + atomic_add(skb->truesize, &sk->sk_wmem_alloc); +#else +#warning EHUD gotta figure out what this does and how to fix it: atomic_add(skb->truesize, &sk->sk_wmem_alloc); +#endif /* 2.6.29 */; clone->sk = sk; clone->protocol = ((struct ethhdr *)skb->data)->h_proto; // XXX if ((dev->flags & IFF_UP) != 0) { diff -rupN orig/vmnet-only/compat_wait.h patched/vmnet-only/compat_wait.h --- orig/vmnet-only/compat_wait.h 2009-03-27 07:17:10.000000000 +0000 +++ patched/vmnet-only/compat_wait.h 2009-10-14 11:52:31.847572660 +0000 @@ -75,7 +75,11 @@ extern void poll_initwait(compat_poll_wq #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // { /* If prototype does not match, build will abort here */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) extern void poll_initwait(compat_poll_wqueues *); +#else /* 2.6.29 */ +extern void poll_initwait(struct poll_wqueues *); +#endif /* 2.6.29 */ #define compat_poll_initwait(wait, table) ( \ (wait) = (table), \ diff -rupN orig/vmnet-only/driver.c patched/vmnet-only/driver.c --- orig/vmnet-only/driver.c 2009-03-27 07:17:10.000000000 +0000 +++ patched/vmnet-only/driver.c 2009-10-14 11:52:31.848572228 +0000 @@ -146,6 +146,13 @@ struct proto vmnet_proto = { .owner = THIS_MODULE, .obj_size = sizeof(struct sock), }; +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) +struct proto vmnet_proto = { + .name = "VMNET", + .owner = THIS_MODULE, + .obj_size = sizeof(struct sock), +}; + #endif /* diff -rupN orig/vmnet-only/netif.c patched/vmnet-only/netif.c --- orig/vmnet-only/netif.c 2009-03-27 07:17:10.000000000 +0000 +++ patched/vmnet-only/netif.c 2009-10-14 12:16:46.708698049 +0000 @@ -194,10 +194,27 @@ VNetNetifTxTimeout(struct net_device *de *---------------------------------------------------------------------- */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) + +static const struct net_device_ops vnet_netdev_ops = { + + .ndo_init = VNetNetifProbe, + .ndo_open = VNetNetifOpen, + .ndo_start_xmit = VNetNetifStartXmit, + .ndo_stop = VNetNetifClose, + .ndo_get_stats = VNetNetifGetStats, + .ndo_set_mac_address = VNetNetifSetMAC, + .ndo_set_multicast_list = VNetNetifSetMulticast, +}; +#endif + static void VNetNetIfSetup(struct net_device *dev) // IN: { ether_setup(dev); // turns on IFF_BROADCAST, IFF_MULTICAST +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) + dev->netdev_ops = &vnet_netdev_ops; +#else dev->init = VNetNetifProbe; dev->open = VNetNetifOpen; dev->hard_start_xmit = VNetNetifStartXmit; @@ -205,7 +222,7 @@ VNetNetIfSetup(struct net_device *dev) dev->get_stats = VNetNetifGetStats; dev->set_mac_address = VNetNetifSetMAC; dev->set_multicast_list = VNetNetifSetMulticast; -#ifdef KERNEL_2_3_43 +#endif /* * We cannot stuck... If someone will report problems under * low memory conditions or some such, we should enable it. @@ -214,7 +231,6 @@ VNetNetIfSetup(struct net_device *dev) dev->tx_timeout = VNetNetifTxTimeout; dev->watchdog_timeo = TX_TIMEOUT; #endif -#endif } @@ -324,7 +340,10 @@ VNetNetIf_Create(char *devName, // IN: goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) dev->priv = netIf; +#endif /* 2.6.29 */ + netIf->dev = dev; memcpy(dev->dev_addr, netIf->port.paddr, sizeof netIf->port.paddr); @@ -566,7 +585,11 @@ int VNetNetifStartXmit(struct sk_buff *skb, // IN: struct net_device *dev) // IN: { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) VNetNetIF *netIf = (VNetNetIF*)dev->priv; +#else + VNetNetIF *netIf = netdev_priv(dev); +#endif /* 2.6.29 */ if(skb == NULL) { return 0; @@ -618,7 +641,12 @@ int VNetNetifSetMAC(struct net_device *dev, // IN: void *p) // IN: { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) VNetNetIF *netIf = (VNetNetIF*)dev->priv; +#else + VNetNetIF *netIf = netdev_priv(dev); +#endif /* 2.6.29 */ + struct sockaddr const *addr = p; if (!VMX86_IS_STATIC_MAC(addr->sa_data)) { return -EINVAL; @@ -675,7 +703,11 @@ VNetNetifSetMulticast(struct net_device struct net_device_stats * VNetNetifGetStats(struct net_device *dev) // IN: { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) VNetNetIF *netIf = (VNetNetIF*)dev->priv; +#else + VNetNetIF *netIf = netdev_priv(dev); +#endif /* 2.6.29 */ return &(netIf->stats); } diff -rupN orig/vmnet-only/vnetUserListener.c patched/vmnet-only/vnetUserListener.c --- orig/vmnet-only/vnetUserListener.c 2009-03-27 07:17:10.000000000 +0000 +++ patched/vmnet-only/vnetUserListener.c 2009-10-14 12:17:34.862572106 +0000 @@ -33,6 +33,7 @@ #include #include "compat_skbuff.h" #include "compat_wait.h" +#include "compat_sched.h" #include "vnetInt.h" typedef struct VNetUserListener_EventNode VNetUserListener_EventNode; diff -rupN orig/vsock-only/include/compat_wait.h patched/vsock-only/include/compat_wait.h --- orig/vsock-only/include/compat_wait.h 2009-03-27 07:17:12.000000000 +0000 +++ patched/vsock-only/include/compat_wait.h 2009-10-14 12:23:08.205572121 +0000 @@ -75,7 +75,11 @@ extern void poll_initwait(compat_poll_wq #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // { /* If prototype does not match, build will abort here */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) extern void poll_initwait(compat_poll_wqueues *); +#else +extern void poll_initwait(struct poll_wqueues *pwq); +#endif #define compat_poll_initwait(wait, table) ( \ (wait) = (table), \