Skip to content

Commit

Permalink
Update to OpenWRT-23.05.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mirobiala authored May 30, 2024
1 parent aadfa9a commit baa6c23
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 57 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <dev@rincat.ch>
PKG_BUILD_PARALLEL:=1

Expand Down Expand Up @@ -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; \
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -75,7 +75,7 @@ git pull
```
git branch -a
git tag
git checkout v23.05.2
git checkout v23.05.3
```
* Update the feeds:
```
Expand All @@ -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/<target>/config.buildinfo -O .config
wget https://downloads.openwrt.org/releases/23.05.3/targets/<target>/config.buildinfo -O .config
```
* Compile and build the [OpenWRT](https://openwrt.org/) image.
```
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
27 changes: 7 additions & 20 deletions patches/0001-fix-OpenWrt-build.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
From: Miroslav Dimitrov <mirobiala@gmail.com>
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
Expand Down Expand Up @@ -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))
Expand All @@ -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))
Expand Down
56 changes: 28 additions & 28 deletions patches/0003-custom-configuration.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit baa6c23

Please sign in to comment.