summaryrefslogtreecommitdiff
blob: a5f2043682bedfa68988e0f98c00971fd67617e6 (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
--- src/driver.c.orig	2008-01-30 02:07:00.000000000 +0100
+++ src/driver.c	2008-01-30 02:07:00.000000000 +0100
@@ -91,8 +91,12 @@
 static DECLARE_WAIT_QUEUE_HEAD(sched_wait);
 static DECLARE_WAIT_QUEUE_HEAD(tx_wait);
 static DECLARE_WAIT_QUEUE_HEAD(rx_wait);
+static DECLARE_COMPLETION(hotplug); /* New DECLARE, <arnd.feldmueller@web.de> */
+static DECLARE_COMPLETION(notify);  /* New DECLARE, <arnd.feldmueller@web.de> */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
 static DECLARE_MUTEX_LOCKED(hotplug);
 static DECLARE_MUTEX_LOCKED(notify);
+#endif
 
 /*---------------------------------------------------------------------------*\
 \*---------------------------------------------------------------------------*/
@@ -754,7 +758,7 @@
 	close_func = func;
 	close_data = data;
 
-	INIT_WORK (&closing_work, closing_worker);
+	INIT_WORK (&closing_work, (work_func_t)closing_worker);
 	schedule_work (&closing_work);
 	LOG("Worker scheduled.\n");
 } /* start_closing_worker */
@@ -1171,7 +1175,10 @@
 		}
 	}
 	LOG("Scheduler thread stopped.\n");
+	complete(&hotplug); /* Complete Thread Sync here <arnd.feldmueller@web.de> */
+	#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
 	up (&hotplug);
+	#endif
 	return 0;
 } /* scheduler */
 
@@ -1206,7 +1213,10 @@
 				wake_up_interruptible (&wait);
 			}
 			LOG("Scheduler thread signalled, waiting...\n");
+			wait_for_completion(&hotplug); /* Wait for complete Thread Sync <arnd.feldmueller@web.de> */
+			#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
 			down (&hotplug);
+			#endif
 			LOG("Scheduler thread[%d] terminated.\n", thread_pid);
 		}
 		thread_pid = -1;