Bringing wireless driver support to 5.15.y + (#3538)

This commit is contained in:
Igor Pečovnik 2022-03-16 17:53:33 +01:00 committed by GitHub
parent 73e878d49f
commit e6c7b84c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 91 additions and 0 deletions

View File

@ -707,6 +707,9 @@ compilation_prepare()
sed -i '/source "drivers\/net\/wireless\/ti\/Kconfig"/a source "drivers\/net\/wireless\/rtl8822bs\/Kconfig"' \
$kerneldir/drivers/net/wireless/Kconfig
# add support for K5.11+
process_patch_file "${SRC}/patch/misc/wireless-rtl8822bs.patch" "applying"
fi

View File

@ -0,0 +1,88 @@
From 321ba9cbeefcb10522d65fd02848f313d6b2f771 Mon Sep 17 00:00:00 2001
From: Igor Pecovnik <igor.pecovnik@gmail.com>
Date: Wed, 16 Mar 2022 01:08:57 +0100
Subject: [PATCH] kdsd
Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
---
.../wireless/rtl8822bs/os_dep/osdep_service.c | 21 ++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/rtl8822bs/os_dep/osdep_service.c b/drivers/net/wireless/rtl8822bs/os_dep/osdep_service.c
index 86eeb995e..3727d9b49 100644
--- a/drivers/net/wireless/rtl8822bs/os_dep/osdep_service.c
+++ b/drivers/net/wireless/rtl8822bs/os_dep/osdep_service.c
@@ -2085,14 +2085,18 @@ static int isFileReadable(const char *path, u32 *sz)
{
struct file *fp;
int ret = 0;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
char buf;
fp = filp_open(path, O_RDONLY, 0);
if (IS_ERR(fp))
ret = PTR_ERR(fp);
else {
+#ifdef set_fs
oldfs = get_fs();
+#endif
set_fs(KERNEL_DS);
if (1 != readFile(fp, &buf, 1))
@@ -2105,8 +2109,9 @@ static int isFileReadable(const char *path, u32 *sz)
*sz = i_size_read(fp->f_dentry->d_inode);
#endif
}
-
+#ifdef set_fs
set_fs(oldfs);
+#endif
filp_close(fp, NULL);
}
return ret;
@@ -2122,18 +2127,22 @@ static int isFileReadable(const char *path, u32 *sz)
static int retriveFromFile(const char *path, u8 *buf, u32 sz)
{
int ret = -1;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
struct file *fp;
if (path && buf) {
ret = openFile(&fp, path, O_RDONLY, 0);
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
-
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
- ret = readFile(fp, buf, sz);
set_fs(oldfs);
+#else
+ ret = readFile(fp, buf, sz);
+#endif
closeFile(fp);
RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret);
@@ -2164,11 +2173,13 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
ret = openFile(&fp, path, O_CREAT | O_WRONLY, 0666);
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
-
+#ifdef set_fs
oldfs = get_fs();
- set_fs(KERNEL_DS);
ret = writeFile(fp, buf, sz);
set_fs(oldfs);
+#else
+ ret = writeFile(fp, buf, sz);
+#endif
closeFile(fp);
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);
--
Created with Armbian build tools https://github.com/armbian/build