From 7b5adca44d92f2b7a1bbb645355b2a5756d7ebe6 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 27 Dec 2022 14:18:51 +0800 Subject: [PATCH] rtl88x2bu: bump to latest git HEAD Signed-off-by: Tianling Shen (cherry picked from commit 9ecd98c35f6a18af306de9e5738d8dec11196251) --- package/kernel/rtl88x2bu/Makefile | 41 +++++++------------ .../002-use-kernel-wireless-header.patch | 31 ++++++++++++++ ...nge-value-of-vht-enable-and-usb-mode.patch | 6 +-- .../rtl88x2bu/patches/030-wireless-5.8.patch | 18 ++++---- 4 files changed, 58 insertions(+), 38 deletions(-) create mode 100644 package/kernel/rtl88x2bu/patches/002-use-kernel-wireless-header.patch diff --git a/package/kernel/rtl88x2bu/Makefile b/package/kernel/rtl88x2bu/Makefile index 8f468562fb..53720e7666 100644 --- a/package/kernel/rtl88x2bu/Makefile +++ b/package/kernel/rtl88x2bu/Makefile @@ -1,23 +1,19 @@ +# SPDX-License-Identifier: GPL-2.0-only # -# Copyright (C) 2021 ImmortalWrt -# -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# +# Copyright (C) 2021-2022 ImmortalWrt.org include $(TOPDIR)/rules.mk PKG_NAME:=rtl88x2bu PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://github.com/morrownr/88x2bu.git +PKG_SOURCE_URL:=https://github.com/morrownr/88x2bu-20210702.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-11-09 -PKG_SOURCE_VERSION:=47a666315d0a5ff37b53adb48ca21404787565cf -PKG_MIRROR_HASH:=454449d0d11dec7cfc4196899ddbb6cd4851dcc767b7f40e293820952a12b024 +PKG_SOURCE_DATE:=2022-12-21 +PKG_SOURCE_VERSION:=46e266521462a0cc40379debaa77c5fcc0bec258 +PKG_MIRROR_HASH:=bf662d5e1904e49854ea40842168b80b6c36e9a47d0763f9e77bc1080a21c25d -PKG_LICENSE:=GPL-2.0 +PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=LICENSE PKG_BUILD_PARALLEL:=1 @@ -36,7 +32,8 @@ define KernelPackage/rtl88x2bu PROVIDES:=kmod-rtl88x2bu endef -NOSTDINC_FLAGS = \ +NOSTDINC_FLAGS:= \ + $(KERNEL_NOSTDINC_FLAGS) \ -I$(PKG_BUILD_DIR) \ -I$(PKG_BUILD_DIR)/include \ -I$(STAGING_DIR)/usr/include/mac80211-backport \ @@ -46,27 +43,19 @@ NOSTDINC_FLAGS = \ -include backport/autoconf.h \ -include backport/backport.h -EXTRA_CFLAGS:= \ +NOSTDINC_FLAGS+= \ -DRTW_SINGLE_WIPHY \ -DRTW_USE_CFG80211_STA_EVENT \ -DCONFIG_IOCTL_CFG80211 \ -DCONFIG_CONCURRENT_MODE \ -DBUILD_OPENWRT -EXTRA_KCONFIG:= \ - CONFIG_RTL8822BU=m \ - USER_MODULE_NAME=rtl88x2bu - -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_RTL8822BU=m \ + USER_MODULE_NAME=rtl88x2bu \ modules endef diff --git a/package/kernel/rtl88x2bu/patches/002-use-kernel-wireless-header.patch b/package/kernel/rtl88x2bu/patches/002-use-kernel-wireless-header.patch new file mode 100644 index 0000000000..c2c293ac97 --- /dev/null +++ b/package/kernel/rtl88x2bu/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/rtl88x2bu/patches/020-change-value-of-vht-enable-and-usb-mode.patch b/package/kernel/rtl88x2bu/patches/020-change-value-of-vht-enable-and-usb-mode.patch index 2944a514cf..29051db730 100644 --- a/package/kernel/rtl88x2bu/patches/020-change-value-of-vht-enable-and-usb-mode.patch +++ b/package/kernel/rtl88x2bu/patches/020-change-value-of-vht-enable-and-usb-mode.patch @@ -1,6 +1,6 @@ --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c -@@ -309,7 +309,7 @@ int rtw_bfee_rf_number = 0; /*BeamformeeCapRfNum Rf path number, 0 for auto, ot +@@ -317,7 +317,7 @@ int rtw_bfee_rf_number = 0; /*Beamformee #endif /* CONFIG_80211N_HT */ #ifdef CONFIG_80211AC_VHT @@ -8,8 +8,8 @@ +int rtw_vht_enable = 2; /* 0:disable, 1:enable, 2:force auto enable */ module_param(rtw_vht_enable, int, 0644); - int rtw_ampdu_factor = 7; -@@ -392,7 +392,7 @@ int rtw_drv_ant_band_switch = 1; /* 0:OFF , 1:ON, Driver control antenna band sw + int rtw_vht_24g_enable = 1; /* 0:disable, 1:enable */ +@@ -415,7 +415,7 @@ int rtw_drv_ant_band_switch = 1; /* 0:OF int rtw_single_ant_path; /*0:main ant , 1:aux ant , Fixed single antenna path, default main ant*/ /* 0: doesn't switch, 1: switch from usb2.0 to usb 3.0 2: switch from usb3.0 to usb 2.0 */ diff --git a/package/kernel/rtl88x2bu/patches/030-wireless-5.8.patch b/package/kernel/rtl88x2bu/patches/030-wireless-5.8.patch index 0e92f1f845..4164c730b3 100644 --- a/package/kernel/rtl88x2bu/patches/030-wireless-5.8.patch +++ b/package/kernel/rtl88x2bu/patches/030-wireless-5.8.patch @@ -1,29 +1,29 @@ --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c -@@ -437,7 +437,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, +@@ -454,7 +454,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapte #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) if (started) { -- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)) -+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)) || defined(BUILD_OPENWRT) +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) || defined(RHEL8)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) || defined(RHEL8) || defined(BUILD_OPENWRT)) /* --- cfg80211_ch_switch_started_notfiy() --- * A new parameter, bool quiet, is added from Linux kernel v5.11, -@@ -7808,7 +7808,7 @@ exit: +@@ -8331,7 +8331,7 @@ exit: return ret; } --#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) && !defined(BUILD_OPENWRT) +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && !defined(RHEL8)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && !defined(RHEL8) && !defined(BUILD_OPENWRT)) static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) struct wireless_dev *wdev, -@@ -10286,7 +10286,7 @@ static struct cfg80211_ops rtw_cfg80211_ops = { +@@ -10509,7 +10509,7 @@ static struct cfg80211_ops rtw_cfg80211_ #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) +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && !defined(RHEL8)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && !defined(RHEL8) && !defined(BUILD_OPENWRT)) .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, #else .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register,