updated on Sat Jan 21 16:18:39 UTC 2012
[aur-mirror.git] / vmware-patch / vmnet-3.2.0.diff
blob35d19f3c4fde9269817f64a5c87c6322c487431f
1 diff -u -r vmnet-only/compat_netdevice.h vmnet-only/compat_netdevice.h
2 --- vmnet-only/compat_netdevice.h 2011-08-23 02:11:46.000000000 +0200
3 +++ vmnet-only/compat_netdevice.h 2011-09-17 09:38:03.000000000 +0200
4 @@ -47,6 +47,19 @@
5 # define net_device device
6 #endif
8 +/* it looks like these have been removed from the kernel 3.1
9 + * probably because the "transition" is considered complete.
10 + * so to keep this source compatible we just redefine them like they were
11 + * previously
12 + */
13 +#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)
14 +#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
15 + functions are available. */
16 +#define HAVE_FREE_NETDEV /* free_netdev() */
17 +#define HAVE_NETDEV_PRIV /* netdev_priv() */
18 +#define HAVE_NETIF_QUEUE
19 +#define HAVE_NET_DEVICE_OPS
20 +#endif
23 * SET_MODULE_OWNER appeared sometime during 2.3.x. It was setting
24 diff -u -r vmnet-only/filter.c vmnet-only/filter.c
25 --- vmnet-only/filter.c 2011-08-23 02:11:47.000000000 +0200
26 +++ vmnet-only/filter.c 2011-11-09 15:57:12.000000000 +0100
27 @@ -40,6 +40,10 @@
28 #include "vnetInt.h"
29 #include "vmnetInt.h"
31 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
32 +#include <linux/export.h>
33 +#endif
35 // VNet_FilterLogPacket.action for dropped packets
36 #define VNET_FILTER_ACTION_DRP (1)
37 #define VNET_FILTER_ACTION_DRP_SHORT (2)
38 diff -u -r vmnet-only/netif.c vmnet-only/netif.c
39 --- vmnet-only/netif.c 2011-08-23 02:11:47.000000000 +0200
40 +++ vmnet-only/netif.c 2011-11-09 15:53:30.000000000 +0100
41 @@ -62,7 +62,9 @@
42 static int VNetNetifStartXmit(struct sk_buff *skb, struct net_device *dev);
43 static struct net_device_stats *VNetNetifGetStats(struct net_device *dev);
44 static int VNetNetifSetMAC(struct net_device *dev, void *addr);
45 +#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)
46 static void VNetNetifSetMulticast(struct net_device *dev);
47 +#endif
48 #if 0
49 static void VNetNetifTxTimeout(struct net_device *dev);
50 #endif
51 @@ -131,7 +133,9 @@
52 .ndo_stop = VNetNetifClose,
53 .ndo_get_stats = VNetNetifGetStats,
54 .ndo_set_mac_address = VNetNetifSetMAC,
55 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
56 .ndo_set_multicast_list = VNetNetifSetMulticast,
57 +#endif
59 * We cannot stuck... If someone will report problems under
60 * low memory conditions or some such, we should enable it.
61 @@ -625,11 +629,12 @@
62 *----------------------------------------------------------------------
65 +#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)
66 void
67 VNetNetifSetMulticast(struct net_device *dev) // IN: unused
71 +#endif
74 *----------------------------------------------------------------------
75 diff -u -r vmnet-only/userif.c vmnet-only/userif.c
76 --- vmnet-only/userif.c 2011-08-23 02:11:46.000000000 +0200
77 +++ vmnet-only/userif.c 2011-11-09 16:21:20.000000000 +0100
78 @@ -517,10 +517,18 @@
79 unsigned int tmpCsum;
80 const void *vaddr;
82 +#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)
83 + vaddr = kmap(skb_frag_page(frag));
84 +#else
85 vaddr = kmap(frag->page);
86 +#endif
87 tmpCsum = csum_and_copy_to_user(vaddr + frag->page_offset,
88 curr, frag->size, 0, &err);
89 +#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)
90 + kunmap(skb_frag_page(frag));
91 +#else
92 kunmap(frag->page);
93 +#endif
94 if (err) {
95 return err;