Gentoo Archives: gentoo-commits

From: "Vadim Kuznetsov (vadimk)" <vadimk@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/vmware-modules/files: 238-3.2.0.patch 238-netdevice.patch
Date: Tue, 10 Jan 2012 14:53:56
Message-Id: 20120110145341.A595A2004B@flycatcher.gentoo.org
1 vadimk 12/01/10 14:53:41
2
3 Added: 238-3.2.0.patch 238-netdevice.patch
4 Log:
5 patches for 3.1.x and 3.2 kernels. Bug 395305
6
7 (Portage version: 2.1.10.44/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-emulation/vmware-modules/files/238-3.2.0.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/238-3.2.0.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/238-3.2.0.patch?rev=1.1&content-type=text/plain
14
15 Index: 238-3.2.0.patch
16 ===================================================================
17 diff --git a/vmmon-only/linux/iommu.c b/vmmon-only/linux/iommu.c
18 index b0ee013..f0f5c9a 100644
19 --- a/vmmon-only/linux/iommu.c
20 +++ b/vmmon-only/linux/iommu.c
21 @@ -36,6 +36,12 @@
22 #define PCI_BDF_SLOTFUNC(bdf) PCI_DEVFN(PCI_SLOT(bdf), PCI_FUNC(bdf))
23 #define PCI_BDF_BUS(bdf) (((bdf) >> 8) & 0xff)
24
25 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
26 +#include <linux/pci.h>
27 +#define iommu_found() iommu_present(&pci_bus_type)
28 +#define iommu_domain_alloc() iommu_domain_alloc(&pci_bus_type)
29 +#endif
30 +
31 typedef struct PassthruDevice {
32 struct pci_dev *pdev;
33 VMLinux *vmLinux;
34 diff --git a/vmnet-only/filter.c b/vmnet-only/filter.c
35 index b0017d7..6c0687f 100644
36 --- a/vmnet-only/filter.c
37 +++ b/vmnet-only/filter.c
38 @@ -41,6 +41,10 @@
39 #include "vnetInt.h"
40 #include "vmnetInt.h"
41
42 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
43 +#include <linux/export.h>
44 +#endif
45 +
46 // VNet_FilterLogPacket.action for dropped packets
47 #define VNET_FILTER_ACTION_DRP (1)
48 #define VNET_FILTER_ACTION_DRP_SHORT (2)
49 diff --git a/vmnet-only/netif.c b/vmnet-only/netif.c
50 index b3c752b..79d4896 100644
51 --- a/vmnet-only/netif.c
52 +++ b/vmnet-only/netif.c
53 @@ -62,7 +62,9 @@ static int VNetNetifClose(struct net_device *dev);
54 static int VNetNetifStartXmit(struct sk_buff *skb, struct net_device *dev);
55 static struct net_device_stats *VNetNetifGetStats(struct net_device *dev);
56 static int VNetNetifSetMAC(struct net_device *dev, void *addr);
57 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
58 static void VNetNetifSetMulticast(struct net_device *dev);
59 +#endif
60 #if 0
61 static void VNetNetifTxTimeout(struct net_device *dev);
62 #endif
63 @@ -131,7 +133,9 @@ VNetNetIfSetup(struct net_device *dev) // IN:
64 .ndo_stop = VNetNetifClose,
65 .ndo_get_stats = VNetNetifGetStats,
66 .ndo_set_mac_address = VNetNetifSetMAC,
67 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
68 .ndo_set_multicast_list = VNetNetifSetMulticast,
69 +#endif
70 /*
71 * We cannot stuck... If someone will report problems under
72 * low memory conditions or some such, we should enable it.
73 @@ -152,7 +156,9 @@ VNetNetIfSetup(struct net_device *dev) // IN:
74 dev->stop = VNetNetifClose;
75 dev->get_stats = VNetNetifGetStats;
76 dev->set_mac_address = VNetNetifSetMAC;
77 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
78 dev->set_multicast_list = VNetNetifSetMulticast;
79 +#endif
80 /*
81 * We cannot stuck... If someone will report problems under
82 * low memory conditions or some such, we should enable it.
83 @@ -621,11 +627,12 @@ VNetNetifSetMAC(struct net_device *dev, // IN:
84 *----------------------------------------------------------------------
85 */
86
87 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
88 void
89 VNetNetifSetMulticast(struct net_device *dev) // IN: unused
90 {
91 }
92 -
93 +#endif
94
95 /*
96 *----------------------------------------------------------------------
97 diff --git a/vmnet-only/userif.c b/vmnet-only/userif.c
98 index 4e65c76..fd12aa9 100644
99 --- a/vmnet-only/userif.c
100 +++ b/vmnet-only/userif.c
101 @@ -572,10 +572,18 @@ VNetCsumCopyDatagram(const struct sk_buff *skb, // IN: skb to copy
102 unsigned int tmpCsum;
103 const void *vaddr;
104
105 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
106 + vaddr = kmap(skb_frag_page(frag));
107 +#else
108 vaddr = kmap(frag->page);
109 +#endif
110 tmpCsum = csum_and_copy_to_user(vaddr + frag->page_offset,
111 curr, frag->size, 0, &err);
112 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
113 + kunmap(skb_frag_page(frag));
114 +#else
115 kunmap(frag->page);
116 +#endif
117 if (err) {
118 return err;
119 }
120
121
122
123 1.1 app-emulation/vmware-modules/files/238-netdevice.patch
124
125 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/238-netdevice.patch?rev=1.1&view=markup
126 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/238-netdevice.patch?rev=1.1&content-type=text/plain
127
128 Index: 238-netdevice.patch
129 ===================================================================
130 diff --git a/vmnet-only/compat_netdevice.h b/vmnet-only/compat_netdevice.h
131 index 7a56304..9ff4548 100644
132 --- a/vmnet-only/compat_netdevice.h
133 +++ b/vmnet-only/compat_netdevice.h
134 @@ -47,6 +47,19 @@
135 # define net_device device
136 #endif
137
138 +/* it looks like these have been removed from the kernel 3.1
139 + * probably because the "transition" is considered complete.
140 + * so to keep this source compatible we just redefine them like they were
141 + * previously
142 + */
143 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
144 +#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
145 + functions are available. */
146 +#define HAVE_FREE_NETDEV /* free_netdev() */
147 +#define HAVE_NETDEV_PRIV /* netdev_priv() */
148 +#define HAVE_NETIF_QUEUE
149 +#define HAVE_NET_DEVICE_OPS
150 +#endif
151
152 /*
153 * SET_MODULE_OWNER appeared sometime during 2.3.x. It was setting