summaryrefslogtreecommitdiff
path: root/community/ndiswrapper/linux33.patch
blob: 3998c84502120a874017098f8ad0a9e1cc9e4c8f (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
--- driver/ndis.c	2011-12-31 21:30:16.000000000 +0100
+++ driver/ndis.c.new	2012-04-08 11:14:16.746614153 +0200
@@ -2654,9 +2654,15 @@
 	(ULONG *idle, ULONG *kernel_user, ULONG *index)
 {
 	int cpu = smp_processor_id();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
+	*idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE];
+	*kernel_user = kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM] +
+	 kcpustat_cpu(cpu).cpustat[CPUTIME_USER];
+#else
 	*idle = kstat_cpu(cpu).cpustat.idle;
 	*kernel_user = kstat_cpu(cpu).cpustat.system +
 		kstat_cpu(cpu).cpustat.user;
+#endif
 	*index = cpu;
 }
 
--- driver/wrapndis.c	2011-12-31 21:30:16.000000000 +0100
+++ driver/wrapndis.c.new	2012-04-08 11:13:00.574116936 +0200
@@ -1684,6 +1684,7 @@
 		return 0;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
 static u32 ndis_get_rx_csum(struct net_device *dev)
 {
 	struct ndis_device *wnd = netdev_priv(dev);
@@ -1735,18 +1736,21 @@
 	else
 		return -EOPNOTSUPP;
 }
+#endif
 
 static struct ethtool_ops ndis_ethtool_ops = {
 	.get_drvinfo	= ndis_get_drvinfo,
 	.get_link	= ndis_get_link,
 	.get_wol	= ndis_get_wol,
 	.set_wol	= ndis_set_wol,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
 	.get_tx_csum	= ndis_get_tx_csum,
 	.get_rx_csum	= ndis_get_rx_csum,
 	.set_tx_csum	= ndis_set_tx_csum,
 	.set_rx_csum	= ndis_set_rx_csum,
 	.get_sg		= ndis_get_sg,
 	.set_sg		= ndis_set_sg,
+#endif
 };
 
 static int notifier_event(struct notifier_block *notifier, unsigned long event,