From 03e4f604d3ee991183840ff7a3c0959be1e28637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?= Date: Mon, 15 Feb 2021 13:19:40 +0100 Subject: [PATCH] Fixing out of the tree wireless driver compilation (#2635) * Fix compilating on 5.10.y / 5.11.y for Realtek 8188EU * Cleanup --- lib/compilation-prepare.sh | 4 ++- patch/misc/wireless-rtl8188eu.patch | 48 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 patch/misc/wireless-rtl8188eu.patch diff --git a/lib/compilation-prepare.sh b/lib/compilation-prepare.sh index 59f56f20a..fa68be955 100644 --- a/lib/compilation-prepare.sh +++ b/lib/compilation-prepare.sh @@ -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 diff --git a/patch/misc/wireless-rtl8188eu.patch b/patch/misc/wireless-rtl8188eu.patch new file mode 100644 index 000000000..d6b12dfdf --- /dev/null +++ b/patch/misc/wireless-rtl8188eu.patch @@ -0,0 +1,48 @@ +From 64cd5169be2f2da24b0949a93aef2b3e40c4e4ec Mon Sep 17 00:00:00 2001 +From: Igor Pecovnik +Date: Mon, 15 Feb 2021 12:28:44 +0100 +Subject: [PATCH] wifi + +Signed-off-by: Igor Pecovnik +--- + .../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 +