summaryrefslogtreecommitdiff
blob: 164830379d9c0cf2f907e7b4728ac36caf6936e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff --git a/bridge.c b/bridge.c
index cdf9e0b..de78618 100644
--- a/bridge.c
+++ b/bridge.c
@@ -275,7 +275,11 @@ VNetBridgeDevCompatible(VNetBridge *bridge,      // IN: Bridge
                         struct net_device *net)  // IN: Network device
 {
 #ifdef VMW_NETDEV_HAS_NET
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+   if (dev_net(net) != dev_net(bridge->internalDev)) {
+#else
    if (net->nd_net != bridge->internalDev->nd_net) {
+#endif
       return 0;
    }
 #endif
diff --git a/compat_semaphore.h b/compat_semaphore.h
index a3a88c2..c3038d7 100644
--- a/compat_semaphore.h
+++ b/compat_semaphore.h
@@ -6,7 +6,11 @@
 #   define __COMPAT_SEMAPHORE_H__
 
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+#include <linux/semaphore.h>
+#else
 #include <asm/semaphore.h>
+#endif
 
 
 /*
diff --git a/procfs.c b/procfs.c
index 07e894d..73d31e8 100644
--- a/procfs.c
+++ b/procfs.c
@@ -63,7 +63,7 @@ VNetProc_Init(void)
 {
    int retval;
 
-   retval = VNetProc_MakeEntry(&proc_root, "vmnet", S_IFDIR, &base);
+   retval = VNetProc_MakeEntry(NULL, "vmnet", S_IFDIR, &base);
    if (retval) {
       return retval;
    }
@@ -95,7 +95,7 @@ VNetProc_Init(void)
 void
 VNetProc_Cleanup(void)
 {
-   VNetProc_RemoveEntry(base, &proc_root);
+   VNetProc_RemoveEntry(base, NULL);
    base = NULL;
 }
 
diff --git a/vmnetInt.h b/vmnetInt.h
index 483c457..2328ec6 100644
--- a/vmnetInt.h
+++ b/vmnetInt.h
@@ -63,7 +63,11 @@
 #   define dev_lock_list()    read_lock(&dev_base_lock)
 #   define dev_unlock_list()  read_unlock(&dev_base_lock)
 #   ifdef VMW_NETDEV_HAS_NET
+#     if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
 #      define DEV_GET(x)      __dev_get_by_name((x)->internalDev->nd_net, (x)->name)
+#     else
+#      define DEV_GET(x)      __dev_get_by_name(dev_net((x)->internalDev), (x)->name)
+#     endif
 #   else
 #      define DEV_GET(x)      __dev_get_by_name((x)->name)
 #   endif
@@ -87,8 +91,13 @@
 
 #ifdef VMW_NETDEV_HAS_NET
 extern struct proto vmnet_proto;
+#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+#   define compat_sk_alloc(_bri, _pri) sk_alloc(dev_net((_bri)->internalDev), \
+                                                PF_NETLINK, _pri, &vmnet_proto)
+#  else
 #   define compat_sk_alloc(_bri, _pri) sk_alloc((_bri)->internalDev->nd_net, \
                                                 PF_NETLINK, _pri, &vmnet_proto)
+#  endif
 #elif defined(VMW_HAVE_SK_ALLOC_WITH_PROTO)
 extern struct proto vmnet_proto;
 #   define compat_sk_alloc(_bri, _pri) sk_alloc(PF_NETLINK, _pri, &vmnet_proto, 1)