ath79: do not build TP-Link tiny images by default
[oweals/openwrt.git] / package / kernel / lantiq / ltq-vdsl / 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 @@ -917,12 +911,19 @@ DSL_int32_t DSL_DRV_ThreadShutdown(
39  
40  DSL_uint32_t DSL_DRV_SysTimeGet(DSL_uint32_t nOffset)
41  {
42 -   struct timeval tv;
43     DSL_uint32_t nTime = 0;
44 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
45 +   struct timeval tv;
46  
47     memset(&tv, 0, sizeof(tv));
48     do_gettimeofday(&tv);
49     nTime = (DSL_uint32_t)tv.tv_sec;
50 +#else
51 +   struct timespec64 now;
52 +
53 +   ktime_get_real_ts64(&now);
54 +   nTime = (DSL_uint32_t)now.tv_sec;
55 +#endif
56  
57     if ( (nOffset == 0) || (nOffset > nTime) )
58     {
59 @@ -1203,6 +1204,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t
60  }
61  #endif
62  
63 +static struct class *dsl_class;
64 +static dev_t dsl_devt;
65 +
66  /* Entry point of driver */
67  int __init DSL_ModuleInit(void)
68  {
69 @@ -1241,6 +1245,10 @@ int __init DSL_ModuleInit(void)
70  
71     DSL_DRV_DevNodeInit();
72  
73 +   dsl_class = class_create(THIS_MODULE, "dsl_cpe_api0");
74 +   dsl_devt = MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0);
75 +   device_create(dsl_class, NULL, dsl_devt, NULL, "dsl_cpe_api0");
76 +
77     return 0;
78  }
79  
80 @@ -1248,6 +1256,11 @@ void __exit DSL_ModuleCleanup(void)
81  {
82     printk("Module will be unloaded"DSL_DRV_CRLF);
83  
84 +   device_destroy(dsl_class, dsl_devt);
85 +   dsl_devt = NULL;
86 +   class_destroy(dsl_class);
87 +   dsl_class = NULL;
88 +
89     unregister_chrdev(nMajorNum, DRV_DSL_CPE_API_DEV_NAME);
90     
91     DSL_DRV_Cleanup();
92 --- a/src/device/drv_dsl_cpe_device_vrx.c
93 +++ b/src/device/drv_dsl_cpe_device_vrx.c
94 @@ -5337,6 +5337,7 @@ DSL_Error_t DSL_DRV_DEV_HybridTypeGet(
95  #undef DSL_DBG_BLOCK
96  #define DSL_DBG_BLOCK DSL_DBG_NOTIFICATIONS
97  
98 +#if 0
99  DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignaling
100  (
101     DSL_Context_t *pContext,
102 @@ -5384,6 +5385,15 @@ DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignal
103  
104     return nErrCode;
105  }
106 +#else
107 +DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignaling
108 +(
109 +   DSL_Context_t *pContext,
110 +   DSL_TcLayerSelection_t nTcLayer)
111 +{
112 +   return DSL_SUCCESS;
113 +}
114 +#endif
115  
116  DSL_Error_t DSL_DRV_DEV_MeiShowtimeSignaling
117  (