mwlwifi: update to version 10.4.10-20231120
[openwrt/staging/blocktrron.git] / package / kernel / mwlwifi / patches / 006-remove-uaccess-and-get_fs-calls-from-PCIe-for-Kenel-.patch
1 From ad911365cac3723d1c00d048905a5e22ff4a10f3 Mon Sep 17 00:00:00 2001
2 From: Stefan Kalscheuer <stefan@stklcode.de>
3 Date: Sun, 18 Jun 2023 17:53:27 +0200
4 Subject: [PATCH 1/2] remove uaccess and get_fs calls from PCIe for Kenel >=
5 5.18
6
7 Remove the calls to deprecated get_fs and force_uaccess_* API for modern
8 kernels.
9
10 The get_fs functionality and the transitional force_uaccess_* calls have
11 been removed Kernel 5.18 [1] while read and write operations have been
12 refactored, so the code can work on kernel- and userspace data without
13 the need to shifting the boundary using set_fs().
14
15 [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=967747bbc084b93b54e66f9047d342232314cd25
16
17 Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
18 ---
19 hif/pcie/pcie.c | 6 ++++--
20 1 file changed, 4 insertions(+), 2 deletions(-)
21
22 --- a/hif/pcie/pcie.c
23 +++ b/hif/pcie/pcie.c
24 @@ -1439,7 +1439,9 @@ static void pcie_bf_mimo_ctrl_decode(str
25 const char filename[] = "/tmp/BF_MIMO_Ctrl_Field_Output.txt";
26 char str_buf[256];
27 char *buf = &str_buf[0];
28 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
29 mm_segment_t oldfs;
30 +#endif
31
32 #if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
33 oldfs = get_fs();
34 @@ -1447,7 +1449,7 @@ static void pcie_bf_mimo_ctrl_decode(str
35 #elif LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
36 oldfs = get_fs();
37 set_fs(KERNEL_DS);
38 -#else
39 +#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
40 oldfs = force_uaccess_begin();
41 #endif
42
43 @@ -1471,7 +1473,7 @@ static void pcie_bf_mimo_ctrl_decode(str
44
45 #if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
46 set_fs(oldfs);
47 -#else
48 +#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
49 force_uaccess_end(oldfs);
50 #endif
51 }