mt7601u-ap: fix build with kernel 5.10
Fixes: #473 (cherry picked from commit aa56b0d6ecd0939a47dd23381dcf7d2948a052af)
This commit is contained in:
parent
5fc7782dd4
commit
8636137f61
@ -0,0 +1,81 @@
|
||||
--- a/os/linux/rt_linux.c
|
||||
+++ b/os/linux/rt_linux.c
|
||||
@@ -938,6 +938,7 @@ static inline void __RtmpOSFSInfoChange(OS_FS_INFO * pOSFSInfo, BOOLEAN bSet)
|
||||
pOSFSInfo->fsuid = current_fsuid();
|
||||
pOSFSInfo->fsgid = current_fsgid();
|
||||
#endif
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
|
||||
pOSFSInfo->fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
} else {
|
||||
@@ -945,6 +946,7 @@ static inline void __RtmpOSFSInfoChange(OS_FS_INFO * pOSFSInfo, BOOLEAN bSet)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
|
||||
current->fsuid = pOSFSInfo->fsuid;
|
||||
current->fsgid = pOSFSInfo->fsgid;
|
||||
+#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1785,8 +1787,10 @@ VOID RtmpDrvAllMacPrint(
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
|
||||
orig_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
+#endif
|
||||
|
||||
/* open file */
|
||||
file_w = filp_open(fileName, O_WRONLY | O_CREAT, 0);
|
||||
@@ -1813,7 +1817,9 @@ VOID RtmpDrvAllMacPrint(
|
||||
}
|
||||
filp_close(file_w, NULL);
|
||||
}
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
|
||||
set_fs(orig_fs);
|
||||
+#endif
|
||||
os_free_mem(NULL, msg);
|
||||
}
|
||||
|
||||
@@ -1834,8 +1840,10 @@ VOID RtmpDrvAllE2PPrint(
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
|
||||
orig_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
+#endif
|
||||
|
||||
/* open file */
|
||||
file_w = filp_open(fileName, O_WRONLY | O_CREAT, 0);
|
||||
@@ -1863,7 +1871,9 @@ VOID RtmpDrvAllE2PPrint(
|
||||
}
|
||||
filp_close(file_w, NULL);
|
||||
}
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
|
||||
set_fs(orig_fs);
|
||||
+#endif
|
||||
os_free_mem(NULL, msg);
|
||||
}
|
||||
|
||||
@@ -1877,8 +1887,10 @@ VOID RtmpDrvAllRFPrint(
|
||||
PSTRING fileName = "RFDump.txt";
|
||||
mm_segment_t orig_fs;
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
|
||||
orig_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
+#endif
|
||||
|
||||
/* open file */
|
||||
file_w = filp_open(fileName, O_WRONLY | O_CREAT, 0);
|
||||
@@ -1894,7 +1906,9 @@ VOID RtmpDrvAllRFPrint(
|
||||
}
|
||||
filp_close(file_w, NULL);
|
||||
}
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
|
||||
set_fs(orig_fs);
|
||||
+#endif
|
||||
}
|
||||
#endif /* DBG */
|
||||
|
Loading…
x
Reference in New Issue
Block a user