From a2d8d47ddb830f3078b84c5e21b7e2c7def37aa3 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Thu, 19 Aug 2021 12:06:28 +0800 Subject: [PATCH] rtl8192eu: add new package Also removed obsolete packages. (cherry picked from commit de9c37bc1b00fce6a91b9f84375c1c07f67e8528) --- package/kernel/rtl8192du/Makefile | 66 ----------------- .../patches/010-missing-header-in-ipv6.patch | 14 ---- package/kernel/rtl8192eu/Makefile | 74 +++++++++++++++++++ .../patches/001-use-kernel-byteorder.patch | 15 ++++ .../010-disable-default-build-x86.patch | 11 +++ .../patches/020-remove-repeat-flies.patch | 39 ++++++++++ .../patches/030-wireless-5.8.patch} | 14 ++-- 7 files changed, 146 insertions(+), 87 deletions(-) delete mode 100644 package/kernel/rtl8192du/Makefile delete mode 100644 package/kernel/rtl8192du/patches/010-missing-header-in-ipv6.patch create mode 100644 package/kernel/rtl8192eu/Makefile create mode 100644 package/kernel/rtl8192eu/patches/001-use-kernel-byteorder.patch create mode 100644 package/kernel/rtl8192eu/patches/010-disable-default-build-x86.patch create mode 100644 package/kernel/rtl8192eu/patches/020-remove-repeat-flies.patch rename package/kernel/{rtl8192du/patches/020-wireless-5.8.patch => rtl8192eu/patches/030-wireless-5.8.patch} (60%) diff --git a/package/kernel/rtl8192du/Makefile b/package/kernel/rtl8192du/Makefile deleted file mode 100644 index 7195cd5a8a..0000000000 --- a/package/kernel/rtl8192du/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# -# Copyright (C) 2006-2018 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=rtl8192du -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/lwfinger/rtl8192du -PKG_SOURCE_DATE:=2020-12-12 -PKG_SOURCE_VERSION:=331ec03d89d0c0ebe771c4011846f029f6af33d3 -PKG_MIRROR_HASH:=f0acb833dd51cde41b982be3d341356548c7454d33afecbd25b2e03dea6d53b0 - -PKG_BUILD_PARALLEL:=1 -PKG_MAINTAINER:=Larry Finger - -STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h - -include $(INCLUDE_DIR)/kernel.mk -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/rtl8192du - SUBMENU:=Wireless Drivers - TITLE:=Realtek RTL8192DU support - DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT - FILES:= $(PKG_BUILD_DIR)/8192du.ko - AUTOLOAD:=$(call AutoProbe,8192du) -endef - -define KernelPackage/rtl8192du/description - Kernel modules for the Realtek 8192DU USB 802.11n wireless USB adapters -endef - -NOSTDINC_FLAGS = \ - -I$(PKG_BUILD_DIR) \ - -I$(PKG_BUILD_DIR)/include \ - -I$(STAGING_DIR)/usr/include/mac80211-backport \ - -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ - -I$(STAGING_DIR)/usr/include/mac80211 \ - -I$(STAGING_DIR)/usr/include/mac80211/uapi \ - -include backport/autoconf.h \ - -include backport/backport.h - -NOSTDINC_FLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DCONFIG_CONCURRENT_MODE -DBUILD_OPENWRT - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(LINUX_DIR) \ - $(KERNEL_MAKE_FLAGS) \ - M="$(PKG_BUILD_DIR)" \ - NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ - CONFIG_RTL8192DU=m \ - modules -endef - -define KernelPackage/rtl8192du/install - $(INSTALL_DIR) $(1)/lib/firmware/rtlwifi - $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtl8192dufw.bin $(1)/lib/firmware/rtlwifi/ - $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtl8192dufw_wol.bin $(1)/lib/firmware/rtlwifi/ -endef - -$(eval $(call KernelPackage,rtl8192du)) diff --git a/package/kernel/rtl8192du/patches/010-missing-header-in-ipv6.patch b/package/kernel/rtl8192du/patches/010-missing-header-in-ipv6.patch deleted file mode 100644 index 57938b2df2..0000000000 --- a/package/kernel/rtl8192du/patches/010-missing-header-in-ipv6.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c -index 964b366..ec1c620 100644 ---- a/core/rtw_br_ext.c -+++ b/core/rtw_br_ext.c -@@ -51,6 +51,9 @@ - #include - #include - #include -+#ifndef _HAVE_ARCH_IPV6_CSUM -+#include -+#endif - #endif - #endif - diff --git a/package/kernel/rtl8192eu/Makefile b/package/kernel/rtl8192eu/Makefile new file mode 100644 index 0000000000..55f38bdbfc --- /dev/null +++ b/package/kernel/rtl8192eu/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2021 ImmortalWrt +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rtl8192eu +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://github.com/Mange/rtl8192eu-linux-driver.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2021-05-12 +PKG_SOURCE_VERSION:=546419675335bb80d4548e22ccef915573a5a1e2 +PKG_MIRROR_HASH:=a425a934d973aad20bc51ab2d1131bb81d2c6ebab687a029310e78cf9c81c4f3 + +PKG_BUILD_PARALLEL:=1 + +STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h + +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/rtl8192eu + SUBMENU:=Wireless Drivers + TITLE:=Realtek RTL8192EU support + DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT + FILES:=$(PKG_BUILD_DIR)/rtl8192eu.ko + AUTOLOAD:=$(call AutoProbe,rtl8192eu) +endef + +NOSTDINC_FLAGS = \ + -I$(PKG_BUILD_DIR) \ + -I$(PKG_BUILD_DIR)/include \ + -I$(STAGING_DIR)/usr/include/mac80211-backport \ + -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ + -I$(STAGING_DIR)/usr/include/mac80211 \ + -I$(STAGING_DIR)/usr/include/mac80211/uapi \ + -include backport/autoconf.h \ + -include backport/backport.h + +EXTRA_CFLAGS:= \ + -DRTW_SINGLE_WIPHY \ + -DRTW_USE_CFG80211_STA_EVENT \ + -DCONFIG_IOCTL_CFG80211 \ + -DCONFIG_CONCURRENT_MODE \ + -DBUILD_OPENWRT + +ifeq ($(CONFIG_BIG_ENDIAN),y) +EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN +else +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +endif + +EXTRA_KCONFIG:= \ + CONFIG_RTL8192EU=m \ + USER_MODULE_NAME=rtl8192eu + +MAKE_OPTS:= \ + $(KERNEL_MAKE_FLAGS) \ + M="$(PKG_BUILD_DIR)" \ + NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ + USER_EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + $(EXTRA_KCONFIG) + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + modules +endef + +$(eval $(call KernelPackage,rtl8192eu)) diff --git a/package/kernel/rtl8192eu/patches/001-use-kernel-byteorder.patch b/package/kernel/rtl8192eu/patches/001-use-kernel-byteorder.patch new file mode 100644 index 0000000000..e75a278339 --- /dev/null +++ b/package/kernel/rtl8192eu/patches/001-use-kernel-byteorder.patch @@ -0,0 +1,15 @@ +Fix compile problem when rtw_byteorder.h and asm/byteorder.h gets +included in addition for example indirectly, do not use realtek own copy +of the byteorder headers. + +--- a/include/drv_types.h ++++ b/include/drv_types.h +@@ -25,7 +25,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/package/kernel/rtl8192eu/patches/010-disable-default-build-x86.patch b/package/kernel/rtl8192eu/patches/010-disable-default-build-x86.patch new file mode 100644 index 0000000000..861f241000 --- /dev/null +++ b/package/kernel/rtl8192eu/patches/010-disable-default-build-x86.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -124,7 +124,7 @@ CONFIG_MP_VHT_HW_TX_MODE = n + ###################### Platform Related ####################### + CONFIG_PLATFORM_ARM_RPI = n + CONFIG_PLATFORM_ARM_AARCH64 = n +-CONFIG_PLATFORM_I386_PC = y ++CONFIG_PLATFORM_I386_PC = n + CONFIG_PLATFORM_ANDROID_X86 = n + CONFIG_PLATFORM_ANDROID_INTEL_X86 = n + CONFIG_PLATFORM_JB_X86 = n diff --git a/package/kernel/rtl8192eu/patches/020-remove-repeat-flies.patch b/package/kernel/rtl8192eu/patches/020-remove-repeat-flies.patch new file mode 100644 index 0000000000..51bbd8d3e0 --- /dev/null +++ b/package/kernel/rtl8192eu/patches/020-remove-repeat-flies.patch @@ -0,0 +1,39 @@ +From 9b2b0ec1bc2d31ddf93ed74d63fdfa6044e329a4 Mon Sep 17 00:00:00 2001 +From: Ben Greear +Date: Fri, 9 Nov 2018 16:21:43 -0800 +Subject: [PATCH] Fix build against openwrt backports tree. + +Like breaks builds elsewhere, can fix it up later. + +Signed-off-by: Ben Greear +--- + include/drv_conf.h | 4 +++- + .../{wireless.h => old_unused_rtl_wireless.h} | 0 + include/{autoconf.h => rtl_autoconf.h} | 0 + 3 files changed, 3 insertions(+), 1 deletions(-) + rename include/linux/{wireless.h => old_unused_rtl_wireless.h} (100%) + rename include/{autoconf.h => rtl_autoconf.h} (100%) + +diff --git a/include/drv_conf.h b/include/drv_conf.h +index 0d20a7e..f0a9f88 100644 +--- a/include/drv_conf.h ++++ b/include/drv_conf.h +@@ -14,7 +14,9 @@ + *****************************************************************************/ + #ifndef __DRV_CONF_H__ + #define __DRV_CONF_H__ +-#include "autoconf.h" ++ ++#include ++#include "rtl_autoconf.h" + #include "hal_ic_cfg.h" + #if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) + +diff --git a/include/linux/wireless.h b/include/linux/old_unused_rtl_wireless.h +similarity index 100% +rename from include/linux/wireless.h +rename to include/linux/old_unused_rtl_wireless.h +diff --git a/include/autoconf.h b/include/rtl_autoconf.h +similarity index 100% +rename from include/autoconf.h +rename to include/rtl_autoconf.h diff --git a/package/kernel/rtl8192du/patches/020-wireless-5.8.patch b/package/kernel/rtl8192eu/patches/030-wireless-5.8.patch similarity index 60% rename from package/kernel/rtl8192du/patches/020-wireless-5.8.patch rename to package/kernel/rtl8192eu/patches/030-wireless-5.8.patch index 1c89277008..ea5260c65a 100644 --- a/package/kernel/rtl8192du/patches/020-wireless-5.8.patch +++ b/package/kernel/rtl8192eu/patches/030-wireless-5.8.patch @@ -1,6 +1,6 @@ ---- a/os_dep/ioctl_cfg80211.c -+++ b/os_dep/ioctl_cfg80211.c -@@ -4941,7 +4941,7 @@ exit: +--- a/os_dep/linux/ioctl_cfg80211.c ++++ b/os_dep/linux/ioctl_cfg80211.c +@@ -7484,7 +7484,7 @@ exit: return ret; } @@ -9,12 +9,12 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) struct wireless_dev *wdev, -@@ -5355,7 +5355,7 @@ static struct cfg80211_ops rtw_cfg80211_ops = { +@@ -9948,7 +9948,7 @@ static struct cfg80211_ops rtw_cfg80211_ops = { - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) .mgmt_tx = cfg80211_rtw_mgmt_tx, -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && !defined(BUILD_OPENWRT) .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, - #endif - #elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35)) + #else + .update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register,