lantiq: ltq-tapi: add kernel 5.10 compatiblity
[openwrt/staging/noltari.git] / package / kernel / lantiq / ltq-tapi / patches / 500-linux-509.patch
1 --- a/src/drv_tapi_linux.c
2 +++ b/src/drv_tapi_linux.c
3 @@ -3287,10 +3287,13 @@ static IFX_void_t proc_EntriesRemove(IFX
4 */
5 static IFX_void_t tapi_wq_setscheduler (IFX_int32_t foo)
6 {
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
8 struct sched_param sched_params;
9 -
10 sched_params.sched_priority = TAPI_OS_THREAD_PRIO_HIGH;
11 sched_setscheduler(current, SCHED_FIFO, &sched_params);
12 +#else
13 + sched_set_fifo_low(current);
14 +#endif
15 }
16 #endif /* LINUX_2_6 */
17
18 @@ -3727,6 +3730,7 @@ static IFX_int32_t TAPI_SelectCh (TAPI_F
19 */
20 IFX_int32_t TAPI_OS_ThreadPriorityModify(IFX_uint32_t newPriority)
21 {
22 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0))
23 struct sched_param sched_params;
24 IFX_int32_t ret;
25
26 @@ -3744,6 +3748,10 @@ IFX_int32_t TAPI_OS_ThreadPriorityModify
27 }
28
29 return (ret < 0) ? IFX_ERROR : IFX_SUCCESS;
30 +#else
31 + sched_set_fifo_low(current);
32 + return IFX_SUCCESS;
33 +#endif
34 }
35
36
37 --- a/src/drv_tapi_kpi.c
38 +++ b/src/drv_tapi_kpi.c
39 @@ -134,7 +134,11 @@ extern IFX_int32_t block_ingre
40 /* ========================================================================== */
41 static IFX_void_t ifx_tapi_KPI_IngressHandler (IFX_ulong_t foo);
42 #ifdef KPI_TASKLET
43 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
44 DECLARE_TASKLET(tl_kpi_ingress, ifx_tapi_KPI_IngressHandler, 0L);
45 +#else
46 +DECLARE_TASKLET_OLD(tl_kpi_ingress, ifx_tapi_KPI_IngressHandler);
47 +#endif
48 #endif /* KPI_TASKLET */
49 static IFX_int32_t ifx_tapi_KPI_IngressThread (IFXOS_ThreadParams_t *pThread);
50 static IFX_return_t ifx_tapi_KPI_GroupInit(IFX_uint32_t nKpiGroup);