lantiq: rename ltq-vdsl folder to ltq-vdsl-vr9
[openwrt/staging/hauke.git] / package / kernel / lantiq / ltq-vdsl-vr9 / patches / 100-compat.patch
1 --- a/src/Makefile.in
2 +++ b/src/Makefile.in
3 @@ -117,7 +117,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 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
11 am__aclocal_m4_deps = $(top_srcdir)/configure.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 @@ -249,14 +250,7 @@ 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 @@ -491,7 +485,11 @@ DSL_void_t* DSL_DRV_VMalloc(
39 DSL_DRV_size_t nSize)
40 {
41 /* VRX500-BU: Better to use vmalloc or vzmalloc here?! */
42 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
43 return __vmalloc((unsigned long)nSize, GFP_KERNEL, PAGE_KERNEL);
44 +#else
45 + return __vmalloc((unsigned long)nSize, GFP_KERNEL);
46 +#endif
47 /* return vmalloc(nSize);*/
48 }
49
50 @@ -917,12 +915,19 @@ DSL_int32_t DSL_DRV_ThreadShutdown(
51
52 DSL_uint32_t DSL_DRV_SysTimeGet(DSL_uint32_t nOffset)
53 {
54 - struct timeval tv;
55 DSL_uint32_t nTime = 0;
56 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
57 + struct timeval tv;
58
59 memset(&tv, 0, sizeof(tv));
60 do_gettimeofday(&tv);
61 nTime = (DSL_uint32_t)tv.tv_sec;
62 +#else
63 + struct timespec64 now;
64 +
65 + ktime_get_real_ts64(&now);
66 + nTime = (DSL_uint32_t)now.tv_sec;
67 +#endif
68
69 if ( (nOffset == 0) || (nOffset > nTime) )
70 {
71 @@ -1203,6 +1208,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t
72 }
73 #endif
74
75 +static struct class *dsl_class;
76 +static dev_t dsl_devt;
77 +
78 /* Entry point of driver */
79 int __init DSL_ModuleInit(void)
80 {
81 @@ -1241,6 +1249,10 @@ int __init DSL_ModuleInit(void)
82
83 DSL_DRV_DevNodeInit();
84
85 + dsl_class = class_create(THIS_MODULE, DRV_DSL_CPE_API_DEV_NAME);
86 + dsl_devt = MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0);
87 + device_create(dsl_class, NULL, dsl_devt, NULL, "dsl_cpe_api/0");
88 +
89 return 0;
90 }
91
92 @@ -1248,6 +1260,11 @@ void __exit DSL_ModuleCleanup(void)
93 {
94 printk("Module will be unloaded"DSL_DRV_CRLF);
95
96 + device_destroy(dsl_class, dsl_devt);
97 + dsl_devt = NULL;
98 + class_destroy(dsl_class);
99 + dsl_class = NULL;
100 +
101 unregister_chrdev(nMajorNum, DRV_DSL_CPE_API_DEV_NAME);
102
103 DSL_DRV_Cleanup();
104 --- a/src/device/drv_dsl_cpe_device_vrx.c
105 +++ b/src/device/drv_dsl_cpe_device_vrx.c
106 @@ -5337,6 +5337,7 @@ DSL_Error_t DSL_DRV_DEV_HybridTypeGet(
107 #undef DSL_DBG_BLOCK
108 #define DSL_DBG_BLOCK DSL_DBG_NOTIFICATIONS
109
110 +#if 0
111 DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignaling
112 (
113 DSL_Context_t *pContext,
114 @@ -5384,6 +5385,15 @@ DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignal
115
116 return nErrCode;
117 }
118 +#else
119 +DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignaling
120 +(
121 + DSL_Context_t *pContext,
122 + DSL_TcLayerSelection_t nTcLayer)
123 +{
124 + return DSL_SUCCESS;
125 +}
126 +#endif
127
128 DSL_Error_t DSL_DRV_DEV_MeiShowtimeSignaling
129 (