aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>2019-07-03 20:10:33 +0200
committerMathias Kresin <dev@kresin.me>2019-07-04 08:29:13 +0200
commitbf21b6e44d0dd90846582249cc26230f249e6a63 (patch)
tree316a4e5bd8d94568c4eb5a470351404c95bf3117
parentc3e31b6a9b040912be0b532f9bf29d91c6c74382 (diff)
downloadupstream-bf21b6e44d0dd90846582249cc26230f249e6a63.tar.gz
upstream-bf21b6e44d0dd90846582249cc26230f249e6a63.tar.bz2
upstream-bf21b6e44d0dd90846582249cc26230f249e6a63.zip
lantiq: ltq-tapi: fix compatibility with Linux 4.15+
Linux 4.15 removes the init_timer() API. It's replaced by two functions: - timer_setup() is used instead of init_timer() and also replaces the timer "function" (callback) setup. - from_timer() has to be used to obtain the use-case specific data from a struct timer_list, which is now passed to the timer callback. Update the timer API to be compatible with Linux 4.15+ so it compiles with the upcoming Linux 4.19 kernel update. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
-rw-r--r--package/kernel/lantiq/ltq-tapi/patches/400-linux-415.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/package/kernel/lantiq/ltq-tapi/patches/400-linux-415.patch b/package/kernel/lantiq/ltq-tapi/patches/400-linux-415.patch
new file mode 100644
index 0000000000..cddb1b6553
--- /dev/null
+++ b/package/kernel/lantiq/ltq-tapi/patches/400-linux-415.patch
@@ -0,0 +1,48 @@
+--- a/src/drv_tapi_linux.c
++++ b/src/drv_tapi_linux.c
+@@ -119,7 +119,11 @@ struct _TAPI_FD_PRIV_DATA
+ /* ============================= */
+ /* Local Functions */
+ /* ============================= */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ static IFX_void_t TAPI_timer_call_back (IFX_ulong_t arg);
++#else
++static IFX_void_t TAPI_timer_call_back (struct timer_list *t);
++#endif
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
+ static IFX_void_t TAPI_tqueue (IFX_void_t *pWork);
+ #else /* for Kernel newer or equal 2.6.20 */
+@@ -3384,11 +3388,15 @@ Timer_ID TAPI_Create_Timer(TIMER_ENTRY p
+ pTimerData->nArgument = nArgument;
+ pTimerData->bStopped = IFX_FALSE;
+
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0))
+ init_timer(&(pTimerData->Timer_List));
+
+ /* set timer call back function */
+ pTimerData->Timer_List.function = TAPI_timer_call_back;
+ pTimerData->Timer_List.data = (IFX_ulong_t) pTimerData;
++#else
++ timer_setup(&(pTimerData->Timer_List), TAPI_timer_call_back, 0);
++#endif
+
+ /* Initialize Timer Task */
+ #ifdef LINUX_2_6
+@@ -3529,9 +3537,17 @@ static IFX_void_t TAPI_tqueue (struct wo
+
+ \param arg Pointer to corresponding timer ID.
+ */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ static IFX_void_t TAPI_timer_call_back (IFX_ulong_t arg)
++#else
++static IFX_void_t TAPI_timer_call_back (struct timer_list *t)
++#endif
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
+ Timer_ID Timer = (Timer_ID) arg;
++#else
++ Timer_ID Timer = from_timer(Timer, t, Timer_List);
++#endif
+ /* do the operation in process context,
+ not in interrupt context */
+ #ifdef LINUX_2_6