diff --git a/package/kernel/rtl8189es/Makefile b/package/kernel/rtl8189es/Makefile index 5ff7bb36a0..c41a4241f9 100644 --- a/package/kernel/rtl8189es/Makefile +++ b/package/kernel/rtl8189es/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only # -# Copyright (C) 2021 ImmortalWrt.org +# Copyright (C) 2021-2022 ImmortalWrt.org include $(TOPDIR)/rules.mk @@ -9,9 +9,9 @@ PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_URL:=https://github.com/jwrdegoede/rtl8189ES_linux.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-03-28 -PKG_SOURCE_VERSION:=39c17661136da48f8e9c644194dce6a7f5076896 -PKG_MIRROR_HASH:=9f4f5aeb0bcfc13ef8376a6c2037f325d6e5434dd57c9d00859afd9e70d1fff1 +PKG_SOURCE_DATE:=2022-10-30 +PKG_SOURCE_VERSION:=e58bd86c9d9408c648b1246a0dd76b16856ec172 +PKG_MIRROR_HASH:=1e4acfd7d1f1f2490b6778068f97e7a63b81575dffd98c93e84cecb287e2c7ad PKG_MAINTAINER:=Hauke Mehrtens PKG_BUILD_PARALLEL:=1 @@ -29,7 +29,7 @@ define KernelPackage/rtl8189es AUTOLOAD:=$(call AutoProbe,rtl8189es) endef -NOSTDINC_FLAGS = \ +NOSTDINC_FLAGS:= \ -I$(PKG_BUILD_DIR) \ -I$(PKG_BUILD_DIR)/include \ -I$(STAGING_DIR)/usr/include/mac80211-backport \ @@ -39,26 +39,18 @@ NOSTDINC_FLAGS = \ -include backport/autoconf.h \ -include backport/backport.h -EXTRA_KCONFIG:= \ - CONFIG_RTL8189ES=m \ - USER_MODULE_NAME=rtl8189es - -EXTRA_CFLAGS:= \ +NOSTDINC_FLAGS+= \ -DRTW_SINGLE_WIPHY \ -DRTW_USE_CFG80211_STA_EVENT \ -DCONFIG_IOCTL_CFG80211 \ -DBUILD_OPENWRT -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) \ + +$(KERNEL_MAKE) $(PKG_JOBS) \ + M="$(PKG_BUILD_DIR)" \ + NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ + CONFIG_RTL8189ES=m \ + USER_MODULE_NAME=rtl8189es \ modules endef diff --git a/package/kernel/rtl8189es/patches/001-use-kernel-byteorder.patch b/package/kernel/rtl8189es/patches/001-use-kernel-byteorder.patch deleted file mode 100644 index 9e4d3d1999..0000000000 --- a/package/kernel/rtl8189es/patches/001-use-kernel-byteorder.patch +++ /dev/null @@ -1,15 +0,0 @@ -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 -@@ -29,7 +29,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include diff --git a/package/kernel/rtl8189es/patches/002-use-kernel-wireless-header.patch b/package/kernel/rtl8189es/patches/002-use-kernel-wireless-header.patch new file mode 100644 index 0000000000..c2c293ac97 --- /dev/null +++ b/package/kernel/rtl8189es/patches/002-use-kernel-wireless-header.patch @@ -0,0 +1,31 @@ +Fix wireless.h to use linux kernel header files +including uapi version of wireless.h + +--- a/include/linux/wireless.h ++++ b/include/linux/wireless.h +@@ -18,16 +18,17 @@ + + /***************************** INCLUDES *****************************/ + +-#if 0 ++#if 1 + #include /* for __u* and __s* typedefs */ + #include /* for "struct sockaddr" et al */ + #include /* for IFNAMSIZ and co... */ ++ #include ++ #include + #else + #define __user + /* typedef uint16_t __u16; */ + #include /* for "struct sockaddr" et al */ + #include /* for IFNAMSIZ and co... */ +-#endif + + /****************************** TYPES ******************************/ + #ifdef CONFIG_COMPAT +@@ -84,4 +85,5 @@ struct iwreq { + union iwreq_data u; + }; + ++#endif + #endif /* _LINUX_WIRELESS_H */ diff --git a/package/kernel/rtl8189es/patches/010-remove-repeat-flies.patch b/package/kernel/rtl8189es/patches/010-remove-repeat-flies.patch index b017b641f5..67cfa1d87a 100644 --- a/package/kernel/rtl8189es/patches/010-remove-repeat-flies.patch +++ b/package/kernel/rtl8189es/patches/010-remove-repeat-flies.patch @@ -18,8 +18,8 @@ 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 -@@ -19,7 +19,9 @@ - ******************************************************************************/ +@@ -14,7 +14,9 @@ + *****************************************************************************/ #ifndef __DRV_CONF_H__ #define __DRV_CONF_H__ -#include "autoconf.h" @@ -28,7 +28,7 @@ index 0d20a7e..f0a9f88 100644 +#include "rtl_autoconf.h" #include "hal_ic_cfg.h" - #if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) + #define CONFIG_RSSI_PRIORITY diff --git a/include/linux/wireless.h b/include/linux/old_unused_rtl_wireless.h similarity index 100% rename from include/linux/wireless.h diff --git a/package/kernel/rtl8189es/patches/020-wireless-5.8.patch b/package/kernel/rtl8189es/patches/020-wireless-5.8.patch index 1cebf1ac91..bd30870678 100644 --- a/package/kernel/rtl8189es/patches/020-wireless-5.8.patch +++ b/package/kernel/rtl8189es/patches/020-wireless-5.8.patch @@ -1,29 +1,110 @@ --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c -@@ -5569,7 +5569,7 @@ static void cfg80211_rtw_mgmt_frame_regi - #else - struct net_device *ndev, - #endif --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) || defined(BUILD_OPENWRT) - struct mgmt_frame_regs *upd) - #else - u16 frame_type, bool reg) -@@ -5579,7 +5579,7 @@ static void cfg80211_rtw_mgmt_frame_regi - struct net_device *ndev = wdev_to_ndev(wdev); - #endif - _adapter *adapter; --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) || defined(BUILD_OPENWRT) - u16 frame_type = BIT(upd->global_stypes << 4); - bool reg = false; - #endif -@@ -6510,7 +6510,7 @@ static struct cfg80211_ops rtw_cfg80211_ - .action = cfg80211_rtw_mgmt_tx, - #endif - --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) || defined(BUILD_OPENWRT) - .update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register, - #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) - .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, +@@ -438,7 +438,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapte + ret = rtw_chbw_to_cfg80211_chan_def(wiphy, &chdef, ch, bw, offset, ht); + if (ret != _SUCCESS) + goto exit; +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2) || defined(BUILD_OPENWRT)) + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); + #else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); +@@ -1112,7 +1112,7 @@ check_bss: + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)) + roam_info.links[0].bssid = cur_network->network.MacAddress; + #else + roam_info.bssid = cur_network->network.MacAddress; +@@ -1679,7 +1679,7 @@ exit: + } + + static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + ,int link_id + #endif + , u8 key_index +@@ -1826,7 +1826,7 @@ addkey_end: + } + + static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + ,int link_id + #endif + , u8 keyid +@@ -1994,7 +1994,7 @@ exit: + } + + static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + int link_id, + #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) +@@ -2018,7 +2018,7 @@ static int cfg80211_rtw_del_key(struct w + + static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, + struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + int link_id, + #endif + u8 key_index +@@ -2070,7 +2070,7 @@ static int cfg80211_rtw_set_default_key( + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)) + int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy, + struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + int link_id, + #endif + u8 key_index) +@@ -5158,7 +5158,7 @@ static int cfg80211_rtw_change_beacon(st + + return ret; + } +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2) || defined(BUILD_OPENWRT)) + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) + #else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) +@@ -7609,7 +7609,7 @@ static void cfg80211_rtw_mgmt_frame_regi + #else + struct net_device *ndev, + #endif +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) || defined(BUILD_OPENWRT)) + struct mgmt_frame_regs *upd) + #else + u16 frame_type, bool reg) +@@ -7619,7 +7619,7 @@ static void cfg80211_rtw_mgmt_frame_regi + struct net_device *ndev = wdev_to_ndev(wdev); + #endif + _adapter *adapter; +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) || defined(BUILD_OPENWRT)) + u16 frame_type = BIT(upd->global_stypes << 4); + bool reg = false; + #endif +@@ -10047,7 +10047,7 @@ static struct cfg80211_ops rtw_cfg80211_ + #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) + .action = cfg80211_rtw_mgmt_tx, + #endif +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) || defined(BUILD_OPENWRT)) + .update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register, + #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, +@@ -10261,7 +10261,7 @@ void rtw_wdev_unregister(struct wireless + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) +- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2) || defined(BUILD_OPENWRT)) + if (wdev->connected) { + #else + if (wdev->current_bss) {