summaryrefslogtreecommitdiff
path: root/network/ndiswrapper-kernel/kernel-3.14.patch
blob: cc40e5c87c4df9e4aa01dbc2ea80b44c6abbd25c (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
Description: Kernel 3.14 changes

This is a diff consisting of upstream revisions 3199, 3201, 3203.

* Use prandom_seed() instead of net_srandom() on Linux 3.8+
net_srandom() is going away.

* Avoid preempt_enable_no_resched(), it's no longer available for modules
Use preempt_enable() instead. This makes nt_spin_unlock_irqrestore()
fully complementary to nt_spin_lock_irqsave().

* Define reinit_completion() based on the kernel version
Checking for INIT_COMPLETION was a temporary hack needed before Linux
3.13-rc1 was released.

The last patch might not be really related to kernel 3.14, but is included
as well.

Origin: upstream, http://sourceforge.net/p/ndiswrapper/code/

--- a/driver/crt.c
+++ b/driver/crt.c
@@ -467,7 +467,7 @@ noregparm int WIN_FUNC(_win_memcmp,3)
 noregparm void WIN_FUNC(_win_srand,1)
 	(UINT seed)
 {
-	net_srandom(seed);
+	prandom_seed((__force u32)(seed));
 }
 
 noregparm int WIN_FUNC(rand,0)
--- a/driver/ntoskernel.h
+++ b/driver/ntoskernel.h
@@ -347,7 +347,7 @@ static inline void netif_poll_disable(st
 #define netdev_notifier_info_to_dev(x) ((struct net_device *)(x))
 #endif
 
-#ifdef INIT_COMPLETION
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
 static inline void reinit_completion(struct completion *x)
 {
 	INIT_COMPLETION(*x);
@@ -797,9 +797,8 @@ do {									\
 #define nt_spin_unlock_irqrestore(lock, flags)				\
 do {									\
 	nt_spin_unlock(lock);						\
-	preempt_enable_no_resched();					\
+	preempt_enable();					\
 	local_irq_restore(flags);					\
-	preempt_check_resched();					\
 } while (0)
 
 static inline ULONG SPAN_PAGES(void *ptr, SIZE_T length)