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
5 # define net_device device
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
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
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
31 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
32 +#include <linux/export.h>
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
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);
49 static void VNetNetifTxTimeout(struct net_device *dev);
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,
59 * We cannot stuck... If someone will report problems under
60 * low memory conditions or some such, we should enable it.
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)
67 VNetNetifSetMulticast(struct net_device *dev) // IN: unused
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
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));
85 vaddr = kmap(frag->page);
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));