diff --git a/package/ctcgfw/rtl8188eu/Makefile b/package/ctcgfw/rtl8188eu/Makefile new file mode 100644 index 0000000000..c417461389 --- /dev/null +++ b/package/ctcgfw/rtl8188eu/Makefile @@ -0,0 +1,73 @@ +# +# 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:=rtl8188eu +PKG_RELEASE=1 + +PKG_SOURCE_URL:=https://github.com/aircrack-ng/rtl8188eus.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2020-08-01 +PKG_SOURCE_VERSION:=ae1d233fe6a34a321ca1da2202bec34b1a4b41cd +PKG_MIRROR_HASH:=995d021dec4bef7ce5227239b64aee88ea6d1002464bc7a62cc2ed766607ea89 + +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/rtl8188eu + SUBMENU:=Wireless Drivers + TITLE:=Realtek 8188EU(S)/8188ETV support + DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT + FILES:=$(PKG_BUILD_DIR)/rtl8188eu.ko + AUTOLOAD:=$(call AutoProbe,rtl8188eu) +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 + +ifeq ($(CONFIG_BIG_ENDIAN),y) +EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN +else +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +endif + +EXTRA_KCONFIG:= \ + CONFIG_RTL8188EU=m \ + USER_MODULE_NAME=rtl8188eu + +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,rtl8188eu)) diff --git a/package/ctcgfw/rtl8188eu/patches/001-use-kernel-byteorder.patch b/package/ctcgfw/rtl8188eu/patches/001-use-kernel-byteorder.patch new file mode 100644 index 0000000000..187a6788ed --- /dev/null +++ b/package/ctcgfw/rtl8188eu/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 +@@ -24,7 +24,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/package/ctcgfw/rtl8188eu/patches/010-disable-default-build-x86.patch b/package/ctcgfw/rtl8188eu/patches/010-disable-default-build-x86.patch new file mode 100644 index 0000000000..fc8b53f3c2 --- /dev/null +++ b/package/ctcgfw/rtl8188eu/patches/010-disable-default-build-x86.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -91,7 +91,7 @@ CONFIG_RTW_SDIO_PM_KEEP_POWER = y + ###################### MP HW TX MODE FOR VHT ####################### + CONFIG_MP_VHT_HW_TX_MODE = n + ###################### Platform Related ####################### +-CONFIG_PLATFORM_I386_PC = y ++CONFIG_PLATFORM_I386_PC = n + CONFIG_PLATFORM_ARM_RPI = n + CONFIG_PLATFORM_ARM64_RPI = n + CONFIG_PLATFORM_ANDROID_X86 = n diff --git a/package/ctcgfw/rtl8188eu/patches/020-remove-repeat-flies.patch b/package/ctcgfw/rtl8188eu/patches/020-remove-repeat-flies.patch new file mode 100644 index 0000000000..76baf2a24a --- /dev/null +++ b/package/ctcgfw/rtl8188eu/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