130-linux3.8.patch 4.5 KB

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