add chaos_calmer branch
[15.05/openwrt.git] / package / kernel / lantiq / ltq-ifxos / patches / 100-compat.patch
1 Index: lib_ifxos-1.5.14/configure.in
2 ===================================================================
3 --- lib_ifxos-1.5.14.orig/configure.in  2010-07-22 18:34:07.000000000 +0200
4 +++ lib_ifxos-1.5.14/configure.in       2013-03-14 08:23:57.481810836 +0100
5 @@ -64,7 +64,7 @@
6  AC_ARG_ENABLE(kernelbuild,
7         AS_HELP_STRING(--enable-kernelbuild=x,Set the target kernel build path (only for kernel 2.6.x)),
8         [
9 -               if test -e $enableval/include/linux/autoconf.h; then
10 +               if test -e $enableval/include/linux/autoconf.h -o -e $enableval/include/generated/autoconf.h; then
11                         AC_SUBST([KERNEL_BUILD_PATH],[$enableval])
12                 else
13                         AC_MSG_ERROR([The kernel build directory is not valid or not configured!])
14 Index: lib_ifxos-1.5.14/src/linux/ifxos_linux_thread_drv.c
15 ===================================================================
16 --- lib_ifxos-1.5.14.orig/src/linux/ifxos_linux_thread_drv.c    2010-01-08 18:10:47.000000000 +0100
17 +++ lib_ifxos-1.5.14/src/linux/ifxos_linux_thread_drv.c 2013-03-14 08:23:57.481810836 +0100
18 @@ -34,8 +34,8 @@
19  #include <linux/sched.h>
20  #include <linux/version.h>
21  #include <linux/completion.h>
22 -#include <linux/smp_lock.h>
23  #include <linux/signal.h>
24 +#include <linux/kthread.h>
25  
26  
27  #include "ifx_types.h"
28 @@ -68,10 +68,6 @@
29  #if ( defined(IFXOS_HAVE_THREAD) && (IFXOS_HAVE_THREAD == 1) )
30  
31  
32 -IFXOS_STATIC IFX_int32_t IFXOS_KernelThreadStartup(
33 -                              IFXOS_ThreadCtrl_t *pThrCntrl);
34 -
35 -
36  /* ============================================================================
37     IFX Linux adaptation - Kernel Thread handling
38     ========================================================================= */
39 @@ -96,9 +92,9 @@
40     - IFX_SUCCESS on success
41     - IFX_ERROR on error
42  */
43 -IFXOS_STATIC IFX_int32_t IFXOS_KernelThreadStartup(
44 -                              IFXOS_ThreadCtrl_t *pThrCntrl)
45 +int IFXOS_KernelThreadStartup(void *data)
46  {
47 +   IFXOS_ThreadCtrl_t *pThrCntrl = (IFXOS_ThreadCtrl_t*) data;
48     IFX_int32_t retVal          = IFX_ERROR;
49  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
50     struct task_struct *kthread = current;
51 @@ -139,7 +135,7 @@
52     /* let others run */
53     unlock_kernel();
54  #else
55 -   daemonize(pThrCntrl->thrParams.pName);
56 +   //daemonize(pThrCntrl->thrParams.pName);
57  
58     /* Enable signals in Kernel >= 2.6 */
59     allow_signal(SIGKILL);
60 @@ -218,9 +214,7 @@
61           init_completion(&pThrCntrl->thrCompletion);
62  
63           /* start kernel thread via the wrapper function */
64 -         pThrCntrl->tid = kernel_thread( (IFXOS_KERNEL_THREAD_StartRoutine)IFXOS_KernelThreadStartup,
65 -                        (void *)pThrCntrl,
66 -                        IFXOS_DRV_THREAD_OPTIONS);
67 +         pThrCntrl->tid = kthread_run(IFXOS_KernelThreadStartup, (void *)pThrCntrl, "ifxos");
68  
69           pThrCntrl->bValid = IFX_TRUE;
70  
71 Index: lib_ifxos-1.5.14/src/include/ifxos_thread.h
72 ===================================================================
73 --- lib_ifxos-1.5.14.orig/src/include/ifxos_thread.h    2010-01-14 10:59:13.000000000 +0100
74 +++ lib_ifxos-1.5.14/src/include/ifxos_thread.h 2013-03-14 08:24:43.577812806 +0100
75 @@ -111,7 +111,7 @@
76  /**
77     Function type of the user thread/task function.
78  */
79 -typedef IFX_int32_t (*IFXOS_ThreadFunction_t)(IFXOS_ThreadParams_t *);
80 +typedef int (*IFXOS_ThreadFunction_t)(void*);
81  
82  /** @} */
83  
84 Index: lib_ifxos-1.5.14/src/include/linux/ifxos_linux_thread.h
85 ===================================================================
86 --- lib_ifxos-1.5.14.orig/src/include/linux/ifxos_linux_thread.h        2010-01-08 18:10:27.000000000 +0100
87 +++ lib_ifxos-1.5.14/src/include/linux/ifxos_linux_thread.h     2013-03-14 08:25:13.193814073 +0100
88 @@ -152,7 +152,7 @@
89     IFXOS_ThreadFunction_t  pThrFct;
90  
91     /** Kernel thread process ID */
92 -   IFX_int32_t             tid;
93 +   struct task_struct             *tid;
94  
95     /** requested kernel thread priority */
96     IFX_int32_t             nPriority;