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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
--- 1/fritz/src/driver.c.orig 2008-01-30 01:32:05.000000000 +0100
+++ 1/fritz/src/driver.c 2008-01-30 01:36:11.000000000 +0100
@@ -108,9 +108,14 @@
static DECLARE_TASKLET(rx_tasklet, rx_task, 0);
static DECLARE_WAIT_QUEUE_HEAD(wait);
static DECLARE_WAIT_QUEUE_HEAD(capi_wait);
+static DECLARE_COMPLETION(hotplug); /* New DECLARE, <arnd.feldmueller@web.de> */
+static DECLARE_COMPLETION(config); /* 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(config);
static DECLARE_MUTEX_LOCKED(notify);
+#endif
#define SCHED_WAKEUP_CAPI { atomic_set (&thread_capi_flag, 1); wake_up_interruptible (&capi_wait); }
#define SCHED_WAKEUP { atomic_set (&got_kicked, 1); wake_up_interruptible (&wait); }
@@ -785,7 +790,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 */
@@ -1349,7 +1354,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 */
@@ -1392,7 +1400,10 @@
SCHED_WAKEUP;
}
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;
--- 1/fritz/src/driver.h.orig 2008-01-30 01:32:05.000000000 +0100
+++ 1/fritz/src/driver.h 2008-01-30 01:32:06.000000000 +0100
@@ -58,7 +58,9 @@
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
typedef long intptr_t;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
typedef unsigned long uintptr_t;
+#endif
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
--- 2/fritz/src/driver.c.orig 2008-01-30 01:32:06.000000000 +0100
+++ 2/fritz/src/driver.c 2008-01-30 01:32:06.000000000 +0100
@@ -131,12 +131,20 @@
static DECLARE_TASKLET(rx_tasklet, rx_task, 0);
static DECLARE_WAIT_QUEUE_HEAD(wait);
static DECLARE_WAIT_QUEUE_HEAD(capi_wait);
+static DECLARE_COMPLETION(hotplug); /* New DECLARE, <arnd.feldmueller@web.de> */
+static DECLARE_COMPLETION(config); /* 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(config);
static DECLARE_MUTEX_LOCKED(notify);
+#endif
static DECLARE_WAIT_QUEUE_HEAD(dbg_wait);
+static DECLARE_COMPLETION(thread_sync); /* New DECLARE, <arnd.feldmueller@web.de> */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
static DECLARE_MUTEX_LOCKED(thread_sync);
+#endif
#define SCHED_WAKEUP_CAPI { atomic_set (&thread_capi_flag, 1); wake_up_interruptible (&capi_wait); }
#define SCHED_WAKEUP { atomic_set (&got_kicked, 1); wake_up_interruptible (&wait); }
@@ -434,7 +442,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 */
@@ -1180,7 +1188,10 @@
}
}
LOG("Scheduler thread stopped.\n");
+ complete(&thread_sync); /* Complete Thread Sync here <arnd.feldmueller@web.de> */
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
up (&thread_sync);
+ #endif
return 0;
} /* scheduler */
@@ -1214,7 +1225,10 @@
SCHED_WAKEUP;
}
LOG("Thread signalled, waiting for termination...\n");
+ wait_for_completion(&thread_sync); /* Wait for complete Thread Sync <arnd.feldmueller@web.de> */
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
down (&thread_sync);
+ #endif
LOG("Thread[%d] terminated.\n", thread_pid);
}
thread_pid = -1;
--- 2/fritz/src/common.h.orig 2005-08-05 00:00:00.000000000 +0200
+++ 2/fritz/src/common.h 2008-01-30 01:32:06.000000000 +0100
@@ -51,7 +51,9 @@
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
typedef long intptr_t;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
typedef unsigned long uintptr_t;
+#endif
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
|