lantiq: Update to the latest DSL driver / application versions
[openwrt.git] / package / kernel / lantiq / ltq-vdsl / patches / 100-compat.patch
1 --- a/src/Makefile.in
2 +++ b/src/Makefile.in
3 @@ -63,7 +63,7 @@ POST_UNINSTALL = :
4  
5  # the headerfile of linux kernels 2.6.x contain to much arithmetic
6  # with void pointers (which is allowed for gcc!)
7 -@KERNEL_2_6_FALSE@am__append_6 = -Wpointer-arith
8 +@KERNEL_2_6_FALSE@am__append_6 =
9  subdir = src
10  DIST_COMMON = $(drv_dsl_cpe_api_include_HEADERS) $(srcdir)/Makefile.am \
11         $(srcdir)/Makefile.in
12 --- a/src/common/drv_dsl_cpe_os_linux.c
13 +++ b/src/common/drv_dsl_cpe_os_linux.c
14 @@ -11,6 +11,7 @@
15  
16  #define DSL_INTERN
17  
18 +#include <linux/device.h>
19  #include "drv_dsl_cpe_api.h"
20  #include "drv_dsl_cpe_api_ioctl.h"
21  
22 @@ -238,24 +239,10 @@ static DSL_long_t DSL_DRV_Ioctls(DSL_DRV
23     }
24  
25  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
26 -   if (pFile->f_dentry != DSL_NULL)
27 -   {
28 -      pINode = pFile->f_dentry->d_inode;
29 -   }
30 -   else
31 -   {
32 -      pINode = DSL_NULL;
33 -   }
34 +   pINode = file_inode(pFile);
35  #endif
36  
37 -   if (pINode == DSL_NULL)
38 -   {
39 -      bIsInKernel = DSL_TRUE;
40 -   }
41 -   else
42 -   {
43        bIsInKernel = DSL_FALSE;
44 -   }
45  
46     if ( (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API) ||
47          (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_G997) ||
48 @@ -1102,6 +1089,9 @@ static void DSL_DRV_DebugInit(void)
49     return;
50  }
51  
52 +static struct class *dsl_class;
53 +static dev_t dsl_devt;
54 +
55  /* Entry point of driver */
56  int __init DSL_ModuleInit(void)
57  {
58 @@ -1140,6 +1130,10 @@ int __init DSL_ModuleInit(void)
59  
60     DSL_DRV_DevNodeInit();
61  
62 +   dsl_class = class_create(THIS_MODULE, "dsl_cpe_api0");
63 +   dsl_devt = MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0);
64 +   device_create(dsl_class, NULL, dsl_devt, NULL, "dsl_cpe_api0");
65 +
66     return 0;
67  }
68  
69 @@ -1147,6 +1141,11 @@ void __exit DSL_ModuleCleanup(void)
70  {
71     printk("Module will be unloaded"DSL_DRV_CRLF);
72  
73 +   device_destroy(dsl_class, dsl_devt);
74 +   dsl_devt = NULL;
75 +   class_destroy(dsl_class);
76 +   dsl_class = NULL;
77 +
78     unregister_chrdev(nMajorNum, DRV_DSL_CPE_API_DEV_NAME);
79  
80     DSL_DRV_Cleanup();