Advertisement
BinaryMn

vmware8kernel32vmblockpatchmod

Aug 14th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 5.12 KB | None | 0 0
  1. diff -u -r source30//vmmon-only/linux/iommu.c source/vmmon-only/linux/iommu.c
  2. --- source30//vmmon-only/linux/iommu.c  2011-08-23 02:11:45.000000000 +0200
  3. +++ source/vmmon-only/linux/iommu.c 2011-11-09 15:19:36.000000000 +0100
  4. @@ -42,6 +42,12 @@
  5.  #define PCI_BDF_SLOTFUNC(bdf) PCI_DEVFN(PCI_SLOT(bdf), PCI_FUNC(bdf))
  6.  #define PCI_BDF_BUS(bdf)      (((bdf) >> 8) & 0xff)
  7.  
  8. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
  9. +#include <linux/pci.h>
  10. +#define iommu_found() iommu_present(&pci_bus_type)
  11. +#define iommu_domain_alloc() iommu_domain_alloc(&pci_bus_type)
  12. +#endif
  13. +
  14.  typedef struct PassthruDevice {
  15.     uint32 bdf;
  16.     struct pci_dev *pdev;
  17. diff -u -r source30//vmnet-only/compat_netdevice.h source/vmnet-only/compat_netdevice.h
  18. --- source30//vmnet-only/compat_netdevice.h 2011-08-23 02:11:46.000000000 +0200
  19. +++ source/vmnet-only/compat_netdevice.h    2011-09-17 09:38:03.000000000 +0200
  20. @@ -47,6 +47,19 @@
  21.  #   define net_device device
  22.  #endif
  23.  
  24. +/* it looks like these have been removed from the kernel 3.1
  25. + * probably because the "transition" is considered complete.
  26. + * so to keep this source compatible we just redefine them like they were
  27. + * previously
  28. + */
  29. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 41, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
  30. +#define HAVE_ALLOC_NETDEV      /* feature macro: alloc_xxxdev
  31. +                      functions are available. */
  32. +#define HAVE_FREE_NETDEV       /* free_netdev() */
  33. +#define HAVE_NETDEV_PRIV       /* netdev_priv() */
  34. +#define HAVE_NETIF_QUEUE
  35. +#define HAVE_NET_DEVICE_OPS
  36. +#endif
  37.  
  38.  /*
  39.   * SET_MODULE_OWNER appeared sometime during 2.3.x. It was setting
  40. diff -u -r source30//vmnet-only/filter.c source/vmnet-only/filter.c
  41. --- source30//vmnet-only/filter.c   2011-08-23 02:11:47.000000000 +0200
  42. +++ source/vmnet-only/filter.c  2011-11-09 15:57:12.000000000 +0100
  43. @@ -40,6 +40,10 @@
  44.  #include "vnetInt.h"
  45.  #include "vmnetInt.h"
  46.  
  47. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
  48. +#include <linux/export.h>
  49. +#endif
  50. +
  51.  // VNet_FilterLogPacket.action for dropped packets
  52.  #define VNET_FILTER_ACTION_DRP         (1)
  53.  #define VNET_FILTER_ACTION_DRP_SHORT   (2)
  54. diff -u -r source30//vmnet-only/netif.c source/vmnet-only/netif.c
  55. --- source30//vmnet-only/netif.c    2011-08-23 02:11:47.000000000 +0200
  56. +++ source/vmnet-only/netif.c   2011-11-09 15:53:30.000000000 +0100
  57. @@ -62,7 +62,9 @@
  58.  static int  VNetNetifStartXmit(struct sk_buff *skb, struct net_device *dev);
  59.  static struct net_device_stats *VNetNetifGetStats(struct net_device *dev);
  60.  static int  VNetNetifSetMAC(struct net_device *dev, void *addr);
  61. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
  62.  static void VNetNetifSetMulticast(struct net_device *dev);
  63. +#endif
  64.  #if 0
  65.  static void VNetNetifTxTimeout(struct net_device *dev);
  66.  #endif
  67. @@ -131,7 +133,9 @@
  68.        .ndo_stop = VNetNetifClose,
  69.        .ndo_get_stats = VNetNetifGetStats,
  70.        .ndo_set_mac_address = VNetNetifSetMAC,
  71. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
  72.        .ndo_set_multicast_list = VNetNetifSetMulticast,
  73. +#endif
  74.        /*
  75.         * We cannot stuck... If someone will report problems under
  76.         * low memory conditions or some such, we should enable it.
  77. @@ -625,11 +629,12 @@
  78.   *----------------------------------------------------------------------
  79.   */
  80.  
  81. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
  82.  void
  83.  VNetNetifSetMulticast(struct net_device *dev) // IN: unused
  84.  {
  85.  }
  86. -
  87. +#endif
  88.  
  89.  /*
  90.   *----------------------------------------------------------------------
  91. diff -u -r source30//vmnet-only/userif.c source/vmnet-only/userif.c
  92. --- source30//vmnet-only/userif.c   2011-08-23 02:11:46.000000000 +0200
  93. +++ source/vmnet-only/userif.c  2011-11-09 16:21:20.000000000 +0100
  94. @@ -517,10 +517,18 @@
  95.      unsigned int tmpCsum;
  96.      const void *vaddr;
  97.  
  98. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
  99. +    vaddr = kmap(skb_frag_page(frag));
  100. +#else
  101.      vaddr = kmap(frag->page);
  102. +#endif
  103.      tmpCsum = csum_and_copy_to_user(vaddr + frag->page_offset,
  104.                      curr, frag->size, 0, &err);
  105. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
  106. +    kunmap(skb_frag_page(frag));
  107. +#else
  108.      kunmap(frag->page);
  109. +#endif
  110.      if (err) {
  111.         return err;
  112.      }
  113.  
  114. diff -u -r source30//vmblock-only/linux/filesystem.c source/vmblock-only/linux/filesystem.c
  115. --- source30//vmblock-only/linux/filesystem.c   2011-08-23 02:11:46.000000000 +0200
  116. +++ source/vmblock-only/linux/filesystem.c  2012-08-14 19:05:34.000000000 -0500
  117. @@ -525,7 +525,7 @@
  118.        return -EINVAL;
  119.     }
  120.  
  121. -   rootDentry = d_alloc_root(rootInode);
  122. +   rootDentry = d_make_root(rootInode);
  123.     if (!rootDentry) {
  124.        iput(rootInode);
  125.        return -ENOMEM;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement