93c2f67796ac875a6fa804af7b8e310ad5145ed7
[openwrt/.git] / package / kernel / lantiq / ltq-adsl / patches / 130-linux3.8.patch
1 --- a/src/common/drv_dsl_cpe_os_linux.c
2 +++ b/src/common/drv_dsl_cpe_os_linux.c
3 @@ -11,6 +11,7 @@
4  #ifdef __LINUX__
5  
6  #define DSL_INTERN
7 +#include <linux/kthread.h>
8  #include <linux/of_platform.h>
9  
10  #include "drv_dsl_cpe_api.h"
11 @@ -39,7 +40,7 @@ static DSL_ssize_t DSL_DRV_Write(DSL_DRV
12  static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_inode_t * pINode, DSL_DRV_file_t * pFile,
13                           DSL_uint_t nCommand, unsigned long nArg);
14  #else
15 -static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_file_t * pFile,
16 +static long DSL_DRV_Ioctls(DSL_DRV_file_t * pFile,
17                           DSL_uint_t nCommand, unsigned long nArg);
18  #endif
19  static int DSL_DRV_Open(DSL_DRV_inode_t * ino, DSL_DRV_file_t * fil);
20 @@ -183,7 +184,7 @@ static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_
21     DSL_uint_t nCommand,
22     unsigned long nArg)
23  #else
24 -static DSL_int_t DSL_DRV_Ioctls(
25 +static long DSL_DRV_Ioctls(
26     DSL_DRV_file_t * pFile,
27     DSL_uint_t nCommand,
28     unsigned long nArg)
29 @@ -520,9 +521,9 @@ DSL_void_t* DSL_IoctlMemCpyTo(
30     - IFX_SUCCESS on success
31     - IFX_ERROR on error
32  */
33 -DSL_DRV_STATIC DSL_int32_t DSL_DRV_KernelThreadStartup(
34 -                              DSL_DRV_ThreadCtrl_t *pThrCntrl)
35 +static int DSL_DRV_KernelThreadStartup(void *data)
36  {
37 +   DSL_DRV_ThreadCtrl_t *pThrCntrl = (DSL_DRV_ThreadCtrl_t*) data;
38     DSL_int32_t retVal          = -1;
39  #ifndef _lint
40  
41 @@ -545,30 +546,6 @@ DSL_DRV_STATIC DSL_int32_t DSL_DRV_Kerne
42        (DSL_NULL, "ENTER - Kernel Thread Startup <%s>" DSL_DRV_CRLF,
43          pThrCntrl->thrParams.pName));
44  
45 -   /* do LINUX specific setup */
46 -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
47 -   daemonize();
48 -   reparent_to_init();
49 -
50 -   /* lock the kernel. A new kernel thread starts without
51 -      the big kernel lock, regardless of the lock state
52 -      of the creator (the lock level is *not* inheritated)
53 -   */
54 -   lock_kernel();
55 -
56 -   /* Don't care about any signals. */
57 -   siginitsetinv(&current->blocked, 0);
58 -
59 -   /* set name of this process */
60 -   strcpy(kthread->comm, pThrCntrl->thrParams.pName);
61 -
62 -   /* let others run */
63 -   unlock_kernel();
64 -#else
65 -   daemonize(pThrCntrl->thrParams.pName);
66 -
67 -#endif
68 -
69     /*DSL_DRV_ThreadPriorityModify(pThrCntrl->nPriority);*/
70  
71     pThrCntrl->thrParams.bRunning = 1;
72 @@ -638,9 +615,7 @@ DSL_int32_t DSL_DRV_ThreadInit(
73           init_completion(&pThrCntrl->thrCompletion);
74  
75           /* start kernel thread via the wrapper function */
76 -         pThrCntrl->pid = kernel_thread( (DSL_DRV_KERNEL_THREAD_StartRoutine)DSL_DRV_KernelThreadStartup,
77 -                        (void *)pThrCntrl,
78 -                        DSL_DRV_DRV_THREAD_OPTIONS);
79 +         pThrCntrl->pid = kthread_run(DSL_DRV_KernelThreadStartup, (void *)pThrCntrl, pThrCntrl->thrParams.pName);
80  
81           pThrCntrl->bValid = DSL_TRUE;
82  
83 @@ -1070,12 +1045,12 @@ static void DSL_DRV_DebugInit(void)
84  #endif
85  
86  /* Entry point of driver */
87 -static int __devinit ltq_adsl_probe(struct platform_device *pdev)
88 +static int ltq_adsl_probe(struct platform_device *pdev)
89  {
90     struct class *dsl_class;
91     DSL_int_t i;
92  
93 -   printk(DSL_DRV_CRLF DSL_DRV_CRLF "Infineon CPE API Driver version: %s" DSL_DRV_CRLF,
94 +   printk("Infineon CPE API Driver version: %s" DSL_DRV_CRLF,
95        &(dsl_cpe_api_version[4]));
96  
97     DSL_DRV_MemSet( ifxDevices, 0, sizeof(DSL_devCtx_t) * DSL_DRV_MAX_DEVICE_NUMBER );
98 @@ -1124,7 +1099,7 @@ static int __devinit ltq_adsl_probe(stru
99     return 0;
100  }
101  
102 -static int __devexit ltq_adsl_remove(struct platform_device *pdev)
103 +static int ltq_adsl_remove(struct platform_device *pdev)
104  {
105     printk("Module will be unloaded"DSL_DRV_CRLF);
106  
107 @@ -1169,7 +1144,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match);
108  
109  static struct platform_driver ltq_adsl_driver = {
110         .probe = ltq_adsl_probe,
111 -       .remove = __devexit_p(ltq_adsl_remove),
112 +       .remove = ltq_adsl_remove,
113         .driver = {
114                 .name = "adsl",
115                 .owner = THIS_MODULE,
116 --- a/src/include/drv_dsl_cpe_os_lint_map.h
117 +++ b/src/include/drv_dsl_cpe_os_lint_map.h
118 @@ -247,7 +247,7 @@ typedef struct
119     DSL_DRV_ThreadFunction_t  pThrFct;
120  
121     /** Kernel thread process ID */
122 -   DSL_int32_t             pid;
123 +   struct task_struct             *pid;
124  
125     /** requested kernel thread priority */
126     DSL_int32_t             nPriority;
127 --- a/src/include/drv_dsl_cpe_os_linux.h
128 +++ b/src/include/drv_dsl_cpe_os_linux.h
129 @@ -288,7 +288,7 @@ typedef struct
130     DSL_DRV_ThreadFunction_t  pThrFct;
131  
132     /** Kernel thread process ID */
133 -   DSL_int32_t             pid;
134 +   struct task_struct             *pid;
135  
136     /** requested kernel thread priority */
137     DSL_int32_t             nPriority;