--- 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, */ +static DECLARE_COMPLETION(config); /* New DECLARE, */ +static DECLARE_COMPLETION(notify); /* New DECLARE, */ +#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 */ + #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 */ + #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, */ +static DECLARE_COMPLETION(config); /* New DECLARE, */ +static DECLARE_COMPLETION(notify); /* New DECLARE, */ +#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, */ +#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 */ + #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 */ + #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 /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/