diff --git a/Makefile b/Makefile index a358f19..423c350 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,10 @@ PKG_RELEASE=2 PKG_LICENSE:=GPLv2 PKG_SOURCE_URL:=https://github.com/RinCat/RTL88x2BU-Linux-Driver -PKG_MIRROR_HASH:=a1b66b5b111f569910469f1b13e9db0385f386644ec1001fd5e6f1086fa6eb74 +PKG_MIRROR_HASH:=4b5f2e5597dad646e0f1cef2e04540216b3f62b07e623e7f738a0bd5815483d1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-02-01 -PKG_SOURCE_VERSION:=7bdc911e1c14cac9448c3b9f68bf5392cc318849 +PKG_SOURCE_DATE:=2024-03-28 +PKG_SOURCE_VERSION:=358f13d1749cac4b314c8fa4187f65dfa7ef1813 PKG_MAINTAINER:=Rin Cat PKG_BUILD_PARALLEL:=1 @@ -49,7 +49,7 @@ define Build/Prepare cd $(TOPDIR); \ REBUILD_PATCHED=0; \ for PATCH in $$PATCHDIR/openwrt_patches/*; do \ - if ! git apply -q -R --check <$$PATCH; then \ + if ! git apply -R --check <$$PATCH >> /dev/null; then \ git apply -v <$$PATCH; \ REBUILD_PATCHED=1; \ fi; \ diff --git a/README.md b/README.md index 932f239..53cf6bc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# rtl88x2bu package for OpenWRT (v23.05.2) +# rtl88x2bu package for OpenWRT (v23.05.3) This package uses [Realtek 88x2BU driver](https://github.com/RinCat/RTL88x2BU-Linux-Driver) by [@RinCat](https://github.com/RinCat) with patches for [OpenWRT](https://openwrt.org/). -I tested it with [TP-Link Archer T3U Nano](https://www.tp-link.com/us/home-networking/usb-adapter/archer-t3u-nano/) and [OpenWRT v23.05.2](https://openwrt.org/releases/23.05/notes-23.05.2). +I tested it with [TP-Link Archer T3U Nano](https://www.tp-link.com/us/home-networking/usb-adapter/archer-t3u-nano/) and [OpenWRT v23.05.3](https://openwrt.org/releases/23.05/notes-23.05.3). **Note:** No need for patching `mac80211.sh` with this package. @@ -75,7 +75,7 @@ git pull ``` git branch -a git tag -git checkout v23.05.2 +git checkout v23.05.3 ``` * Update the feeds: ``` @@ -91,12 +91,12 @@ git clone https://github.com/mirobiala/rtl88x2bu-cl package/kernel/rtl88x2bu-cl cd package/kernel/rtl88x2bu-cl git branch -a git tag -git checkout v1.0.2 +git checkout v1.1.0 cd ../../../ ``` * Download the default config for the **desired** target: ``` -wget https://downloads.openwrt.org/releases/23.05.2/targets//config.buildinfo -O .config +wget https://downloads.openwrt.org/releases/23.05.3/targets//config.buildinfo -O .config ``` * Compile and build the [OpenWRT](https://openwrt.org/) image. ``` diff --git a/openwrt_patches/0002-revert-commit-2b4941a6f16fa1c045cb2f4a8fc09adc64fecd63.patch b/openwrt_patches/0002-revert-commit-2b4941a6f16fa1c045cb2f4a8fc09adc64fecd63.patch new file mode 100644 index 0000000..e6d3f70 --- /dev/null +++ b/openwrt_patches/0002-revert-commit-2b4941a6f16fa1c045cb2f4a8fc09adc64fecd63.patch @@ -0,0 +1,11 @@ +--- a/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc ++++ b/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc +@@ -49,7 +49,7 @@ function __phy_is_fullmac(phyidx) + { + let data = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, 0, { wiphy: phyidx }); + +- return !data.software_iftypes.monitor; ++ return !data.software_iftypes.ap_vlan; + } + + function phy_is_fullmac(phy) diff --git a/patches/0001-fix-OpenWrt-build.patch b/patches/0001-fix-OpenWrt-build.patch index 2e52149..f5fde55 100644 --- a/patches/0001-fix-OpenWrt-build.patch +++ b/patches/0001-fix-OpenWrt-build.patch @@ -1,13 +1,13 @@ From: Miroslav Dimitrov -Date: Mon Sep 18 10:15:35 EEST 2023 +Date: Mon Dec 14 17:22:26 EEST 2023 Subject: [PATCH 1/3] OpenWrt build patch --- Makefile | 32 ++++++++++++++++++++++++++++++-- - include/byteorder/swab.h | 2 +- - os_dep/linux/ioctl_cfg80211.c | 22 +++++++++++----------- - os_dep/linux/os_intfs.c | 2 ++ - 4 files changed, 44 insertions(+), 14 deletions(-) + os_dep/linux/ioctl_cfg80211.c | 25 ++++++++++++++----------- + os_dep/linux/os_intfs.c | 2 ++ + core/mesh/rtw_mesh.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 110 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index e98e3ca..128de80 100644 @@ -66,26 +66,13 @@ index e98e3ca..128de80 100644 ifeq ($(CONFIG_PLATFORM_I386_PC), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -diff --git a/include/byteorder/swab.h b/include/byteorder/swab.h -index a8dd46b..64f1f3d 100644 ---- a/include/byteorder/swab.h -+++ b/include/byteorder/swab.h -@@ -12,7 +12,7 @@ - * more details. - * - *****************************************************************************/ --#ifndef _LINUX_BYTEORDER_SWAB_H -+#if !defined(_UAPI_LINUX_SWAB_H) && !defined(_LINUX_BYTEORDER_SWAB_H) - #define _LINUX_BYTEORDER_SWAB_H - - #if !defined(CONFIG_PLATFORM_MSTAR) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index f7b59a8..ac1e0b2 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -456,7 +456,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, if (started) { - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0)) cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false, 0); -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) @@ -94,7 +81,7 @@ index f7b59a8..ac1e0b2 100644 @@ -481,7 +481,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0)) cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0); -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT)) diff --git a/patches/0003-custom-configuration.patch b/patches/0003-custom-configuration.patch index 72cdd74..7a9767c 100644 --- a/patches/0003-custom-configuration.patch +++ b/patches/0003-custom-configuration.patch @@ -3,11 +3,11 @@ Date: Mon Sep 18 10:15:35 EEST 2023 Subject: [PATCH 3/3] Custom configurations. --- - core/rtw_ap.c | 12 +++++------- - os_dep/linux/os_intfs.c | 10 +++++----- - os_dep/linux/ioctl_cfg80211.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------- + core/rtw_ap.c | 4 +--- + os_dep/linux/os_intfs.c | 18 +++++++++++++----- + os_dep/linux/ioctl_cfg80211.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------ os_dep/linux/rtw_proc.c | 2 ++ - 4 files changed, 95 insertions(+), 31 deletions(-) + 4 files changed, 98 insertions(+), 26 deletions(-) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index ec72564..b2e8cbb 100644 @@ -24,21 +24,6 @@ index ec72564..b2e8cbb 100644 rtw_check_for_vht20(padapter, ie + _BEACON_IE_OFFSET_, pbss_network->IELength - _BEACON_IE_OFFSET_); pmlmepriv->ori_vht_en = 1; pmlmepriv->vhtpriv.vht_option = _TRUE; -@@ -4241,10 +4239,10 @@ void stop_ap_mode(_adapter *padapter) - padapter->netif_up = _FALSE; - /* _rtw_spinlock_free(&pmlmepriv->bcn_update_lock); */ - -- /* reset and init security priv , this can refine with rtw_reset_securitypriv */ -- _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv)); -- padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen; -- padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; -+ // /* reset and init security priv , this can refine with rtw_reset_securitypriv */ -+ // _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv)); -+ // padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen; -+ // padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; - - #ifdef CONFIG_DFS_MASTER - rtw_dfs_rd_en_decision(padapter, self_action, 0); diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 1d50aa5..fa26b29 100644 --- a/os_dep/linux/os_intfs.c @@ -85,6 +70,30 @@ index 1d50aa5..fa26b29 100644 int rtw_bfer_rf_number = 0; /*BeamformerCapRfNum Rf path number, 0 for auto, others for manual*/ int rtw_bfee_rf_number = 0; /*BeamformeeCapRfNum Rf path number, 0 for auto, others for manual*/ +@@ -2194,7 +2196,11 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name) + if (rtnl_lock_needed) + ret = (register_netdev(ndev) == 0) ? _SUCCESS : _FAIL; + else ++#if defined(CONFIG_IOCTL_CFG80211) ++ ret = (cfg80211_register_netdevice(ndev) == 0) ? _SUCCESS : _FAIL; ++#else + ret = (register_netdevice(ndev) == 0) ? _SUCCESS : _FAIL; ++#endif + + if (ret == _SUCCESS) + adapter->registered = 1; +@@ -2243,7 +2249,11 @@ void rtw_os_ndev_unregister(_adapter *adapter) + if (rtnl_lock_needed) + unregister_netdev(netdev); + else ++#if defined(CONFIG_IOCTL_CFG80211) ++ cfg80211_unregister_netdevice(netdev); ++#else + unregister_netdevice(netdev); ++#endif + } + + #if defined(CONFIG_IOCTL_CFG80211) && !defined(RTW_SINGLE_WIPHY) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index f7b59a8..3f9474b 100644 --- a/os_dep/linux/ioctl_cfg80211.c @@ -198,15 +207,6 @@ index f7b59a8..3f9474b 100644 exit: return ret; -@@ -6768,7 +6825,7 @@ static int cfg80211_rtw_del_virtual_intf(struct wiphy *wiphy, - RTW_INFO(FUNC_NDEV_FMT" remove monitor ndev\n", FUNC_NDEV_ARG(ndev)); - } else { - RTW_INFO(FUNC_NDEV_FMT" unregister ndev\n", FUNC_NDEV_ARG(ndev)); -- rtw_os_ndev_unregister(adapter); -+ // rtw_os_ndev_unregister(adapter); - } - } else - #if defined(CONFIG_P2P) && defined(RTW_DEDICATED_P2P_DEVICE) @@ -9973,6 +10030,9 @@ struct ieee80211_iface_limit rtw_limits[] = { { .max = rtw_min(CONFIG_IFACE_NUMBER, CONFIG_LIMITED_AP_NUM),