aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/lantiq/ltq-ifxos/patches/100-compat.patch
blob: 45059890e1188c7d2e403af9242ae86e282dca90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
--- a/src/linux/ifxos_linux_memory_map_drv.c
+++ b/src/linux/ifxos_linux_memory_map_drv.c
@@ -25,6 +25,7 @@
    IFX Linux adaptation - Global Includes - Kernel
    ========================================================================= */
 
+#include <linux/version.h>
 #include <linux/kernel.h>
 #ifdef MODULE
    #include <linux/module.h>
@@ -97,8 +98,13 @@ IFX_int32_t IFXOS_Phy2VirtMap(
    }
 
    /* remap memory (not cache able): physical --> virtual */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
    pVirtAddr = (IFX_uint8_t *)ioremap_nocache( physicalAddr,
                                                addrRangeSize_byte );
+#else
+   pVirtAddr = (IFX_uint8_t *)ioremap(physicalAddr, addrRangeSize_byte);
+#endif
+
    if (pVirtAddr == IFX_NULL)
    {
       IFXOS_PRN_USR_ERR_NL( IFXOS, IFXOS_PRN_LEVEL_ERR,
--- a/src/linux/ifxos_linux_socket_drv.c
+++ b/src/linux/ifxos_linux_socket_drv.c
@@ -165,8 +165,12 @@ IFX_int_t IFXOS_SocketRecvFrom(
    IFXOS_sockAddr_t *pSocAddr)
 {
    struct msghdr msg;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
    struct iovec iov;
    mm_segment_t old_fs;
+#else
+   struct kvec iov;
+#endif
    int ret;
 
    IFXOS_RETURN_IF_POINTER_NULL(pBuffer, IFX_ERROR);
@@ -181,6 +185,8 @@ IFX_int_t IFXOS_SocketRecvFrom(
    msg.msg_controllen = 0;
    msg.msg_flags = 0;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
    msg.msg_iov = &iov;
    msg.msg_iovlen = 1;
@@ -200,6 +206,10 @@ IFX_int_t IFXOS_SocketRecvFrom(
 #endif
    set_fs(old_fs);
 
+#else
+   ret = kernel_recvmsg (socFd, &msg, &iov, 1, bufSize_byte, 0);
+#endif
+
    return ret;
 }
 
@@ -229,8 +239,12 @@ IFX_int_t IFXOS_SocketSendTo(
                   IFXOS_sockAddr_t  *pSocAddr)
 {
    struct msghdr msg;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
    struct iovec iov;
    mm_segment_t old_fs;
+#else
+   struct kvec iov;
+#endif
    int ret;
 
    IFXOS_RETURN_IF_POINTER_NULL(pBuffer, IFX_ERROR);
@@ -245,6 +259,8 @@ IFX_int_t IFXOS_SocketSendTo(
    msg.msg_controllen = 0;
    msg.msg_flags = MSG_DONTWAIT;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
    msg.msg_iov = &iov;
    msg.msg_iovlen = 1;
@@ -264,6 +280,10 @@ IFX_int_t IFXOS_SocketSendTo(
 #endif
    set_fs(old_fs);
 
+#else
+   ret = kernel_sendmsg(socFd, &msg, &iov, 1, bufSize_byte);
+#endif
+
    return ret;
 }