Skip to content
Permalink
Browse files
Fixing out of the tree wireless driver compilation (#2635)
* Fix compilating on 5.10.y / 5.11.y for Realtek 8188EU

* Cleanup
  • Loading branch information
igorpecovnik committed Feb 15, 2021
1 parent 514d213 commit 03e4f604d3ee991183840ff7a3c0959be1e28637
Showing with 51 additions and 1 deletion.
  1. +3 −1 lib/compilation-prepare.sh
  2. +48 −0 patch/misc/wireless-rtl8188eu.patch
@@ -429,7 +429,7 @@ compilation_prepare()

# Wireless drivers for Realtek 8188EU 8188EUS and 8188ETV chipsets

if linux-version compare "${version}" ge 3.14 && linux-version compare "${version}" le 5.9 && [ "$EXTRAWIFI" == yes ]; then
if linux-version compare "${version}" ge 3.14 && [ "$EXTRAWIFI" == yes ]; then

# attach to specifics tag or branch
local rtl8188euver="branch:v5.7.6.1"
@@ -461,6 +461,8 @@ compilation_prepare()
sed -i '/source "drivers\/net\/wireless\/ti\/Kconfig"/a source "drivers\/net\/wireless\/rtl8188eu\/Kconfig"' \
"$kerneldir/drivers/net/wireless/Kconfig"

process_patch_file "${SRC}/patch/misc/wireless-rtl8188eu.patch" "applying"

fi


@@ -0,0 +1,48 @@
From 64cd5169be2f2da24b0949a93aef2b3e40c4e4ec Mon Sep 17 00:00:00 2001
From: Igor Pecovnik <igor.pecovnik@gmail.com>
Date: Mon, 15 Feb 2021 12:28:44 +0100
Subject: [PATCH] wifi

Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
---
.../net/wireless/rtl8188eu/os_dep/osdep_service.c | 13 +++++--------
1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/rtl8188eu/os_dep/osdep_service.c b/drivers/net/wireless/rtl8188eu/os_dep/osdep_service.c
index 27366fa09..c6b3f65bb 100644
--- a/drivers/net/wireless/rtl8188eu/os_dep/osdep_service.c
+++ b/drivers/net/wireless/rtl8188eu/os_dep/osdep_service.c
@@ -2276,7 +2276,7 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
static int storeToFile(const char *path, u8 *buf, u32 sz)
{
int ret = 0;
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
+ #ifdef set_fs
mm_segment_t oldfs;
#endif
struct file *fp;
@@ -2285,17 +2285,14 @@ 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);
-
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
- #else
- set_fs(get_ds());
- #endif
ret = writeFile(fp, buf, sz);
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs);
- #endif
+#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

0 comments on commit 03e4f60

Please sign in to comment.