[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
93c9497 [MAC80211][mt76][Fix mwctl set hostapd_cli cmd]
a737b23 [mac80211][mt76][Fix backports6.1 build fail]
5423240 [MAC80211][hostapd][Fix HOSTAPD_START_FAILED caused by ubus]
b5e1c3b [MAC80211][mt76][5G UNII4 support]
27b4e6a [MAC80211][mt76][Add the MURU definition for test mode]
0d84ee7 [MAC80211][hostapd][Fix STA association failure when co-locating with multiple AP interfaces]
4afd899 [MT76][Fix mt7915 Air-Monitor issue]
[Release-log]
Change-Id: Id48a094923b83de8650eebf6004b498b12a481d6
diff --git a/recipes-wifi/atenl/files/iwpriv.sh b/recipes-wifi/atenl/files/iwpriv.sh
index a84c61e..7046d71 100644
--- a/recipes-wifi/atenl/files/iwpriv.sh
+++ b/recipes-wifi/atenl/files/iwpriv.sh
@@ -1162,7 +1162,8 @@
## Translate to mt76-vendor command
"csi"|"amnt"|"ap_rfeatures"|"ap_wireless"|"mu")
if [ ${is_eagle} == "1" ]; then
- do_cmd "hostapd_cli -i $*"
+ hostapd_cmd="$(echo $* | sed 's/set/raw/')"
+ do_cmd "hostapd_cli -i $hostapd_cmd"
else
do_cmd "mt76-vendor $*"
fi
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
new file mode 100644
index 0000000..e9e12e9
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
@@ -0,0 +1,135 @@
+From 38507640ec424ff6c9c552b0f3c2d068a6192146 Mon Sep 17 00:00:00 2001
+From: Michael Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 28 Apr 2023 10:22:58 +0800
+Subject: [PATCH] hostapd: mtk: avoid setting beacon after wpa_supplicant stop
+ the AP
+
+Add a new variable 'stopped_by_supplicant' to indicate the AP
+interface is currently stopped by co-locating STA interface.
+After the STA interface finishes association with some other APs, it
+will reload the co-locating AP interfaces and marks the
+'stopped_by_supplicant' as 0.
+---
+ hostapd/ctrl_iface.c | 4 ++++
+ src/ap/beacon.c | 5 ++++-
+ src/ap/bss_load.c | 3 ++-
+ src/ap/ctrl_iface_ap.c | 4 +++-
+ src/ap/hostapd.c | 2 ++
+ src/ap/hostapd.h | 1 +
+ 6 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 4c5d494..07c97b5 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -192,11 +192,15 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
+ {
+ struct hostapd_config * (*config_read_cb)(const char *config_fname);
+ struct hostapd_iface *iface = hapd->iface;
++ size_t j;
+
+ config_read_cb = iface->interfaces->config_read_cb;
+ iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
+ reload_opts = txt;
+
++ for (j = 0; j < iface->num_bss; j++)
++ iface->bss[j]->stopped_by_supplicant = 0;
++
+ hostapd_reload_config(iface, 0);
+
+ iface->interfaces->config_read_cb = config_read_cb;
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 51db23a..187e314 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -2125,7 +2125,8 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
+ continue;
+
+ for (i = 0; i < colocated->num_bss; i++) {
+- if (colocated->bss[i] && colocated->bss[i]->started)
++ if (colocated->bss[i] && colocated->bss[i]->started &&
++ !colocated->bss[i]->stopped_by_supplicant)
+ __ieee802_11_set_beacon(colocated->bss[i]);
+ }
+ }
+@@ -2141,6 +2142,7 @@ int ieee802_11_set_beacons(struct hostapd_iface *iface)
+
+ for (i = 0; i < iface->num_bss; i++) {
+ if (iface->bss[i]->started &&
++ !iface->bss[i]->stopped_by_supplicant &&
+ ieee802_11_set_beacon(iface->bss[i]) < 0)
+ ret = -1;
+ }
+@@ -2157,6 +2159,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface)
+
+ for (i = 0; i < iface->num_bss; i++) {
+ if (iface->bss[i]->beacon_set_done && iface->bss[i]->started &&
++ !iface->bss[i]->stopped_by_supplicant &&
+ ieee802_11_set_beacon(iface->bss[i]) < 0)
+ ret = -1;
+ }
+diff --git a/src/ap/bss_load.c b/src/ap/bss_load.c
+index 725d3cd..ae55521 100644
+--- a/src/ap/bss_load.c
++++ b/src/ap/bss_load.c
+@@ -46,7 +46,8 @@ static void update_channel_utilization(void *eloop_data, void *user_data)
+ int err;
+ struct hostapd_iface *iface = hapd->iface;
+
+- if (!(hapd->beacon_set_done && hapd->started))
++ if (!(hapd->beacon_set_done && hapd->started &&
++ !hapd->stopped_by_supplicant))
+ return;
+
+ err = hostapd_drv_get_survey(hapd, hapd->iface->freq);
+diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
+index 2fae590..1ad37c5 100644
+--- a/src/ap/ctrl_iface_ap.c
++++ b/src/ap/ctrl_iface_ap.c
+@@ -951,8 +951,10 @@ int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
+ struct hostapd_iface *iface = hapd->iface;
+ int i;
+
+- for (i = 0; i < iface->num_bss; i++)
++ for (i = 0; i < iface->num_bss; i++){
++ iface->bss[i]->stopped_by_supplicant = 1;
+ hostapd_drv_stop_ap(iface->bss[i]);
++ }
+
+ return 0;
+ }
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index ef0d6db..b2fd9b9 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -477,6 +477,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
+ }
+ hapd->started = 0;
+ hapd->beacon_set_done = 0;
++ hapd->stopped_by_supplicant = 0;
+
+ wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
+ hostapd_ubus_free_bss(hapd);
+@@ -1257,6 +1258,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
+ return -1;
+ }
+ hapd->started = 1;
++ hapd->stopped_by_supplicant = 0;
+
+ if (!first || first == -1) {
+ u8 *addr = hapd->own_addr;
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 093c28a..3b51050 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -190,6 +190,7 @@ struct hostapd_data {
+ unsigned int started:1;
+ unsigned int disabled:1;
+ unsigned int reenable_beacon:1;
++ unsigned int stopped_by_supplicant:1;
+
+ u8 own_addr[ETH_ALEN];
+
+--
+2.25.1
+
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc b/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
index 07bae46..5aaec3e 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
@@ -90,6 +90,7 @@
file://mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
file://mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+ file://mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch \
file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
file://mtk-0100-hostapd-mtk-update-eht-operation-elem.patch \
"
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch b/recipes-wifi/hostapd/files/patches/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
new file mode 100644
index 0000000..e9e12e9
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
@@ -0,0 +1,135 @@
+From 38507640ec424ff6c9c552b0f3c2d068a6192146 Mon Sep 17 00:00:00 2001
+From: Michael Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 28 Apr 2023 10:22:58 +0800
+Subject: [PATCH] hostapd: mtk: avoid setting beacon after wpa_supplicant stop
+ the AP
+
+Add a new variable 'stopped_by_supplicant' to indicate the AP
+interface is currently stopped by co-locating STA interface.
+After the STA interface finishes association with some other APs, it
+will reload the co-locating AP interfaces and marks the
+'stopped_by_supplicant' as 0.
+---
+ hostapd/ctrl_iface.c | 4 ++++
+ src/ap/beacon.c | 5 ++++-
+ src/ap/bss_load.c | 3 ++-
+ src/ap/ctrl_iface_ap.c | 4 +++-
+ src/ap/hostapd.c | 2 ++
+ src/ap/hostapd.h | 1 +
+ 6 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 4c5d494..07c97b5 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -192,11 +192,15 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
+ {
+ struct hostapd_config * (*config_read_cb)(const char *config_fname);
+ struct hostapd_iface *iface = hapd->iface;
++ size_t j;
+
+ config_read_cb = iface->interfaces->config_read_cb;
+ iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
+ reload_opts = txt;
+
++ for (j = 0; j < iface->num_bss; j++)
++ iface->bss[j]->stopped_by_supplicant = 0;
++
+ hostapd_reload_config(iface, 0);
+
+ iface->interfaces->config_read_cb = config_read_cb;
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 51db23a..187e314 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -2125,7 +2125,8 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
+ continue;
+
+ for (i = 0; i < colocated->num_bss; i++) {
+- if (colocated->bss[i] && colocated->bss[i]->started)
++ if (colocated->bss[i] && colocated->bss[i]->started &&
++ !colocated->bss[i]->stopped_by_supplicant)
+ __ieee802_11_set_beacon(colocated->bss[i]);
+ }
+ }
+@@ -2141,6 +2142,7 @@ int ieee802_11_set_beacons(struct hostapd_iface *iface)
+
+ for (i = 0; i < iface->num_bss; i++) {
+ if (iface->bss[i]->started &&
++ !iface->bss[i]->stopped_by_supplicant &&
+ ieee802_11_set_beacon(iface->bss[i]) < 0)
+ ret = -1;
+ }
+@@ -2157,6 +2159,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface)
+
+ for (i = 0; i < iface->num_bss; i++) {
+ if (iface->bss[i]->beacon_set_done && iface->bss[i]->started &&
++ !iface->bss[i]->stopped_by_supplicant &&
+ ieee802_11_set_beacon(iface->bss[i]) < 0)
+ ret = -1;
+ }
+diff --git a/src/ap/bss_load.c b/src/ap/bss_load.c
+index 725d3cd..ae55521 100644
+--- a/src/ap/bss_load.c
++++ b/src/ap/bss_load.c
+@@ -46,7 +46,8 @@ static void update_channel_utilization(void *eloop_data, void *user_data)
+ int err;
+ struct hostapd_iface *iface = hapd->iface;
+
+- if (!(hapd->beacon_set_done && hapd->started))
++ if (!(hapd->beacon_set_done && hapd->started &&
++ !hapd->stopped_by_supplicant))
+ return;
+
+ err = hostapd_drv_get_survey(hapd, hapd->iface->freq);
+diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
+index 2fae590..1ad37c5 100644
+--- a/src/ap/ctrl_iface_ap.c
++++ b/src/ap/ctrl_iface_ap.c
+@@ -951,8 +951,10 @@ int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
+ struct hostapd_iface *iface = hapd->iface;
+ int i;
+
+- for (i = 0; i < iface->num_bss; i++)
++ for (i = 0; i < iface->num_bss; i++){
++ iface->bss[i]->stopped_by_supplicant = 1;
+ hostapd_drv_stop_ap(iface->bss[i]);
++ }
+
+ return 0;
+ }
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index ef0d6db..b2fd9b9 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -477,6 +477,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
+ }
+ hapd->started = 0;
+ hapd->beacon_set_done = 0;
++ hapd->stopped_by_supplicant = 0;
+
+ wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
+ hostapd_ubus_free_bss(hapd);
+@@ -1257,6 +1258,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
+ return -1;
+ }
+ hapd->started = 1;
++ hapd->stopped_by_supplicant = 0;
+
+ if (!first || first == -1) {
+ u8 *addr = hapd->own_addr;
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 093c28a..3b51050 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -190,6 +190,7 @@ struct hostapd_data {
+ unsigned int started:1;
+ unsigned int disabled:1;
+ unsigned int reenable_beacon:1;
++ unsigned int stopped_by_supplicant:1;
+
+ u8 own_addr[ETH_ALEN];
+
+--
+2.25.1
+
diff --git a/recipes-wifi/hostapd/files/patches/patches.inc b/recipes-wifi/hostapd/files/patches/patches.inc
index 523fc4d..d7cc2b2 100644
--- a/recipes-wifi/hostapd/files/patches/patches.inc
+++ b/recipes-wifi/hostapd/files/patches/patches.inc
@@ -90,5 +90,6 @@
file://mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
file://mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+ file://mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch \
file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
"
diff --git a/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-fix-incorrect-HE-TX-GI-report.patch b/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-fix-incorrect-HE-TX-GI-report.patch
index 07733c3..703a3bb 100644
--- a/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-fix-incorrect-HE-TX-GI-report.patch
+++ b/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-fix-incorrect-HE-TX-GI-report.patch
@@ -1,4 +1,4 @@
-From 80765449e32eba36051daeb29824cc011aecd85d Mon Sep 17 00:00:00 2001
+From e04f540b9f4ec973e0d1af2832463f771aefe2c8 Mon Sep 17 00:00:00 2001
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Date: Fri, 24 Mar 2023 18:01:27 +0800
Subject: [PATCH] wifi: mt76: fix incorrect HE TX GI report
@@ -9,12 +9,12 @@
---
mt76.h | 4 ++
mt7915/init.c | 4 ++
- mt7915/mac.c | 60 ++++++++++------
- mt7915/main.c | 7 ++
- mt7915/mcu.c | 183 ++++++++++++++++++++++++++++++++++++++++++++++++
- mt7915/mcu.h | 58 +++++++++++++++
+ mt7915/mac.c | 60 ++++++++++++------
+ mt7915/main.c | 7 +++
+ mt7915/mcu.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++++
+ mt7915/mcu.h | 58 +++++++++++++++++
mt7915/mt7915.h | 6 ++
- 7 files changed, 302 insertions(+), 20 deletions(-)
+ 7 files changed, 280 insertions(+), 20 deletions(-)
diff --git a/mt76.h b/mt76.h
index 183b0fc5..11d49363 100644
@@ -217,10 +217,10 @@
static void mt7915_tx(struct ieee80211_hw *hw,
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 2a5ad033..512a9d5f 100644
+index 2a5ad033..5ee2ee2b 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
-@@ -3752,6 +3752,189 @@ out:
+@@ -3752,6 +3752,167 @@ out:
return ret;
}
@@ -282,7 +282,6 @@
+
+int mt7915_mcu_get_tx_rate_v1(struct mt7915_phy *phy, u16 wcidx)
+{
-+ struct ieee80211_tx_status status = {};
+ struct mt7915_mcu_ra_info_v1 *rate;
+ struct mt7915_dev *dev = phy->dev;
+ struct mt76_phy *mphy = phy->mt76;
@@ -323,16 +322,6 @@
+
+ ret = mt7915_mcu_parse_tx_gi(mphy->dev, rate->mode, rate->gi,
+ rate->bw, &wcid->rate);
-+ if (ret)
-+ goto unlock;
-+
-+ status.sta = wcid_to_sta(wcid);
-+ if (!status.sta) {
-+ ret = -EINVAL;
-+ goto unlock;
-+ }
-+ status.rate = &wcid->rate;
-+ ieee80211_tx_status_ext(mphy->hw, &status);
+unlock:
+ rcu_read_unlock();
+out:
@@ -343,7 +332,6 @@
+
+int mt7915_mcu_get_tx_rate_v2(struct mt7915_phy *phy, u16 wcidx)
+{
-+ struct ieee80211_tx_status status = {};
+ struct mt7915_mcu_ra_info_v2 *rate;
+ struct mt7915_dev *dev = phy->dev;
+ struct mt76_phy *mphy = phy->mt76;
@@ -381,16 +369,6 @@
+
+ ret = mt7915_mcu_parse_tx_gi(mphy->dev, rate->mode, rate->gi,
+ rate->bw, &wcid->rate);
-+ if (ret)
-+ goto unlock;
-+
-+ status.sta = wcid_to_sta(wcid);
-+ if (!status.sta) {
-+ ret = -EINVAL;
-+ goto unlock;
-+ }
-+ status.rate = &wcid->rate;
-+ ieee80211_tx_status_ext(mphy->hw, &status);
+unlock:
+ rcu_read_unlock();
+out:
diff --git a/recipes-wifi/linux-mt76/files/patches/1002-wifi-mt76-mt7915-air-monitor-support.patch b/recipes-wifi/linux-mt76/files/patches/1002-wifi-mt76-mt7915-air-monitor-support.patch
index 7f91f5c..2db295a 100644
--- a/recipes-wifi/linux-mt76/files/patches/1002-wifi-mt76-mt7915-air-monitor-support.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1002-wifi-mt76-mt7915-air-monitor-support.patch
@@ -8,9 +8,9 @@
mt7915/mac.c | 4 +
mt7915/main.c | 3 +
mt7915/mt7915.h | 34 +++++
- mt7915/vendor.c | 359 ++++++++++++++++++++++++++++++++++++++++++++++
+ mt7915/vendor.c | 361 ++++++++++++++++++++++++++++++++++++++++++++++
mt7915/vendor.h | 38 +++++
- 6 files changed, 440 insertions(+)
+ 6 files changed, 442 insertions(+)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 1321445..411911c 100644
@@ -64,7 +64,7 @@
+#ifdef CONFIG_MTK_VENDOR
+#define MT7915_AIR_MONITOR_MAX_ENTRY 16
-+#define MT7915_AIR_MONITOR_MAX_GROUP MT7915_AIR_MONITOR_MAX_ENTRY >> 2
++#define MT7915_AIR_MONITOR_MAX_GROUP MT7915_AIR_MONITOR_MAX_ENTRY >> 1
+
+struct mt7915_air_monitor_group {
+ bool enable;
@@ -117,7 +117,7 @@
index 98fd9c2..b94d787 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
-@@ -430,6 +430,353 @@ out:
+@@ -430,6 +430,355 @@ out:
return err;
}
@@ -265,8 +265,10 @@
+ group = &(amnt_ctrl->group[i]);
+ if (group->used[0] == 0)
+ j = 0;
-+ else
++ else if (group->used[1] == 0)
+ j = 1;
++ else
++ continue;
+
+ group->enable = 1;
+ group->used[j] = 1;
@@ -471,7 +473,7 @@
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
.info = {
-@@ -442,6 +789,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
+@@ -442,6 +791,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.dumpit = mt7915_vendor_csi_ctrl_dump,
.policy = csi_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_CSI_CTRL_MAX,
diff --git a/recipes-wifi/linux-mt76/files/patches/1010-wifi-mt76-testmode-additional-supports.patch b/recipes-wifi/linux-mt76/files/patches/1010-wifi-mt76-testmode-additional-supports.patch
index 476039c..0c8ddf3 100644
--- a/recipes-wifi/linux-mt76/files/patches/1010-wifi-mt76-testmode-additional-supports.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1010-wifi-mt76-testmode-additional-supports.patch
@@ -1,7 +1,7 @@
-From b2dfeaa9eda6e52f2f53ac315fb4b127f6bd714d Mon Sep 17 00:00:00 2001
+From d56368a0d7c5146418b9906ef7b75acf119cf724 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Thu, 21 Apr 2022 15:43:19 +0800
-Subject: [PATCH 1010/1032] wifi: mt76: testmode: additional supports
+Subject: [PATCH] wifi: mt76: testmode: additional supports
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -16,7 +16,7 @@
mt7915/mac.c | 39 +-
mt7915/main.c | 2 +-
mt7915/mcu.c | 19 +-
- mt7915/mcu.h | 28 +-
+ mt7915/mcu.h | 29 +-
mt7915/mmio.c | 2 +
mt7915/mt7915.h | 16 +-
mt7915/regs.h | 3 +
@@ -26,7 +26,7 @@
testmode.h | 75 +++
tools/fields.c | 84 +++-
tx.c | 3 +-
- 20 files changed, 1990 insertions(+), 156 deletions(-)
+ 20 files changed, 1991 insertions(+), 156 deletions(-)
diff --git a/dma.c b/dma.c
index e1b73a1..dc53cc7 100644
@@ -303,7 +303,7 @@
mt7915_init_txpower(dev, &dev->mphy.sband_2g.sband);
mt7915_init_txpower(dev, &dev->mphy.sband_5g.sband);
diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 4554a93..a074608 100644
+index 8c83507..a45e48c 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -607,16 +607,38 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
@@ -375,7 +375,7 @@
#endif
}
-@@ -1467,7 +1490,7 @@ mt7915_mac_restart(struct mt7915_dev *dev)
+@@ -1473,7 +1496,7 @@ mt7915_mac_restart(struct mt7915_dev *dev)
goto out;
/* set the necessary init items */
@@ -398,7 +398,7 @@
mvif->mt76.wmm_idx += 2;
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 8aec083..5f8a615 100644
+index dca7dc8..5302813 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -384,6 +384,11 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -469,7 +469,7 @@
return 0;
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index 6248e4b..11ac2ad 100644
+index 1be6cf3..0020025 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -8,10 +8,15 @@
@@ -488,7 +488,7 @@
};
struct mt7915_mcu_thermal_ctrl {
-@@ -508,6 +513,12 @@ enum {
+@@ -527,6 +532,12 @@ enum {
enum {
MT_BF_SOUNDING_ON = 1,
@@ -501,7 +501,7 @@
MT_BF_TYPE_UPDATE = 20,
MT_BF_MODULE_UPDATE = 25
};
-@@ -756,10 +767,19 @@ struct mt7915_muru {
+@@ -775,10 +786,20 @@ struct mt7915_muru {
#define MURU_OFDMA_SCH_TYPE_UL BIT(1)
/* Common Config */
@@ -518,8 +518,9 @@
+#define MURU_COMM_WMM BIT(3)
+#define MURU_COMM_SPE_IDX BIT(4)
+#define MURU_COMM_PROC_TYPE BIT(5)
-+#define MURU_COMM_SET (MURU_COMM_PPDU_FMT | MURU_COMM_BAND | \
-+ MURU_COMM_WMM | MURU_COMM_SPE_IDX)
++#define MURU_COMM_SET (MURU_COMM_PPDU_FMT | MURU_COMM_SCH_TYPE)
++#define MURU_COMM_SET_TM (MURU_COMM_PPDU_FMT | MURU_COMM_BAND | \
++ MURU_COMM_WMM | MURU_COMM_SPE_IDX)
+
+/* DL&UL User config */
#define MURU_USER_CNT BIT(4)
@@ -546,7 +547,7 @@
[AGG_PCR0] = 0x040,
[AGG_ACR0] = 0x054,
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 9c110b3..cf4af05 100644
+index 811d966..7ef615b 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -328,6 +328,9 @@ struct mt7915_phy {
@@ -615,7 +616,7 @@
(_n) * 4))
#define MT_AGG_PCR0(_band, _n) MT_WF_AGG(_band, (__OFFS(AGG_PCR0) + \
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
-index 4693919..1ed2ea8 100644
+index 4693919..c44f13f 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -9,6 +9,9 @@
@@ -1600,7 +1601,7 @@
+ dl->user_num++;
+ }
+
-+ muru.cfg_comm = cpu_to_le32(MURU_COMM_SET);
++ muru.cfg_comm = cpu_to_le32(MURU_COMM_SET_TM);
+ muru.cfg_dl = cpu_to_le32(MURU_DL_SET);
+
+ return mt7915_tm_set_muru_cfg(phy, &muru);
@@ -3019,5 +3020,5 @@
wake_up(&dev->tx_wait);
--
-2.18.0
+2.39.0
diff --git a/recipes-wifi/linux-mt76/files/patches/1033-wifi-mt76-mt7915-Add-5G-UNII4-support.patch b/recipes-wifi/linux-mt76/files/patches/1033-wifi-mt76-mt7915-Add-5G-UNII4-support.patch
new file mode 100644
index 0000000..2f4390a
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/1033-wifi-mt76-mt7915-Add-5G-UNII4-support.patch
@@ -0,0 +1,24 @@
+From 1b24a353f3304b569dd17d28f9633fbc213651b2 Mon Sep 17 00:00:00 2001
+From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
+Date: Tue, 2 May 2023 15:08:42 +0800
+Subject: [PATCH] wifi: mt76: mt7915: Add 5G UNII4 support.
+
+---
+ mac80211.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/mac80211.c b/mac80211.c
+index 4c88710..8ac1448 100644
+--- a/mac80211.c
++++ b/mac80211.c
+@@ -82,6 +82,7 @@ static const struct ieee80211_channel mt76_channels_5ghz[] = {
+ CHAN5G(165, 5825),
+ CHAN5G(169, 5845),
+ CHAN5G(173, 5865),
++ CHAN5G(177, 5885),
+
+ CHAN5G(184, 4920),
+ CHAN5G(188, 4940),
+--
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches/3009-wifi-mt76-mt7915-enable-PPDU-TxS-to-host-when-wed-en.patch b/recipes-wifi/linux-mt76/files/patches/3009-wifi-mt76-mt7915-enable-PPDU-TxS-to-host-when-wed-en.patch
index ffb0cac..54dff6d 100644
--- a/recipes-wifi/linux-mt76/files/patches/3009-wifi-mt76-mt7915-enable-PPDU-TxS-to-host-when-wed-en.patch
+++ b/recipes-wifi/linux-mt76/files/patches/3009-wifi-mt76-mt7915-enable-PPDU-TxS-to-host-when-wed-en.patch
@@ -1,19 +1,18 @@
-From c7800e4fd168a7b2eba45098ba3bc2bb3772859c Mon Sep 17 00:00:00 2001
+From 769ca30484c3c8a3e84b11d27cf71b77cdb65c0f Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Wed, 18 Jan 2023 11:50:38 +0800
-Subject: [PATCH 3009/3013] wifi: mt76: mt7915: enable PPDU-TxS to host when
- wed enable
+Subject: [PATCH] wifi: mt76: mt7915: enable PPDU-TxS to host when wed enable
Calculate tx bytes and tx retries from PPDU-TxS
---
mt76_connac_mac.c | 2 --
mt7915/init.c | 6 ++++++
mt7915/mmio.c | 21 ---------------------
- tx.c | 14 ++++++++++++++
- 4 files changed, 20 insertions(+), 23 deletions(-)
+ tx.c | 21 +++++++++++++++++++++
+ 4 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
-index abcb9a2..5a5861a 100644
+index abcb9a27..5a5861a8 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -490,8 +490,6 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
@@ -26,7 +25,7 @@
wcid->stats.tx_packets++;
}
diff --git a/mt7915/init.c b/mt7915/init.c
-index 21286a6..6f309d0 100644
+index 21286a6d..6f309d0d 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -503,6 +503,12 @@ mt7915_mac_init_band(struct mt7915_dev *dev, u8 band)
@@ -43,7 +42,7 @@
static void
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index fc9aadb..65ee2af 100644
+index fc9aadb1..65ee2afa 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
@@ -551,7 +551,6 @@ static u32 mt7915_rmw(struct mt76_dev *mdev, u32 offset, u32 mask, u32 val)
@@ -94,7 +93,7 @@
static void mt7915_mmio_wed_release_rx_buf(struct mtk_wed_device *wed)
diff --git a/tx.c b/tx.c
-index a72b777..c3c7eb5 100644
+index 25683c1f..823c8680 100644
--- a/tx.c
+++ b/tx.c
@@ -120,6 +120,7 @@ mt76_tx_status_skb_add(struct mt76_dev *dev, struct mt76_wcid *wcid,
@@ -117,23 +116,25 @@
if (!(info->flags & (IEEE80211_TX_CTL_REQ_TX_STATUS |
IEEE80211_TX_CTL_RATE_CTRL_PROBE)))
return MT_PACKET_ID_NO_SKB;
-@@ -230,6 +236,7 @@ mt76_tx_check_non_aql(struct mt76_dev *dev, struct mt76_wcid *wcid,
- void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *skb,
- struct list_head *free_list)
- {
-+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
- struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb);
- struct ieee80211_tx_status status = {
- .skb = skb,
-@@ -262,6 +269,13 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *
+@@ -260,8 +266,23 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *
+ #endif
+
if (cb->pktid < MT_PACKET_ID_FIRST) {
++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++ struct ieee80211_rate_status rs = {};
++
hw = mt76_tx_status_get_hw(dev, skb);
status.sta = wcid_to_sta(wcid);
+ if (mtk_wed_device_active(&dev->mmio.wed) &&
+ (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)) {
-+ if (status.sta) {
-+ info->status.rates[0].idx = -1;
-+ status.rate = &wcid->rate;
++ info->status.rates[0].idx = -1;
++
++ if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
++ rs.rate_idx = wcid->rate;
++ status.rates = &rs;
++ status.n_rates = 1;
++ } else {
++ status.n_rates = 0;
+ }
+ }
ieee80211_tx_status_ext(hw, &status);
diff --git a/recipes-wifi/linux-mt76/files/patches/9999-mt76-revert-for-backports-5.15-wireless-stack.patch b/recipes-wifi/linux-mt76/files/patches/9999-mt76-revert-for-backports-5.15-wireless-stack.patch
index 996550a..f299d08 100644
--- a/recipes-wifi/linux-mt76/files/patches/9999-mt76-revert-for-backports-5.15-wireless-stack.patch
+++ b/recipes-wifi/linux-mt76/files/patches/9999-mt76-revert-for-backports-5.15-wireless-stack.patch
@@ -1,4 +1,4 @@
-From b63834891daa4a1bf052c6d67cd9c6fa3e67cbfa Mon Sep 17 00:00:00 2001
+From b423b5a658598085c00e78e6a3bfbe2c7671c147 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Wed, 5 Apr 2023 08:29:19 +0800
Subject: [PATCH] mt76: revert for backports-5.15 wireless stack
@@ -18,11 +18,11 @@
mt7915/main.c | 10 +--
mt7915/mcu.c | 166 +++++++++++++++++++++++-----------------------
mt7915/testmode.c | 8 +--
- tx.c | 11 +--
- 15 files changed, 168 insertions(+), 178 deletions(-)
+ tx.c | 26 ++------
+ 15 files changed, 172 insertions(+), 189 deletions(-)
diff --git a/dma.c b/dma.c
-index 7c147c1..2169682 100644
+index 7c147c19..2169682c 100644
--- a/dma.c
+++ b/dma.c
@@ -992,7 +992,7 @@ mt76_dma_init(struct mt76_dev *dev,
@@ -35,10 +35,10 @@
napi_enable(&dev->napi[i]);
}
diff --git a/mac80211.c b/mac80211.c
-index 4dc7627..4c88710 100644
+index 7e663a5c..8ac14486 100644
--- a/mac80211.c
+++ b/mac80211.c
-@@ -1517,7 +1517,7 @@ EXPORT_SYMBOL_GPL(mt76_get_sar_power);
+@@ -1518,7 +1518,7 @@ EXPORT_SYMBOL_GPL(mt76_get_sar_power);
static void
__mt76_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
{
@@ -47,7 +47,7 @@
ieee80211_csa_finish(vif);
}
-@@ -1539,7 +1539,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif)
+@@ -1540,7 +1540,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif)
{
struct mt76_dev *dev = priv;
@@ -57,7 +57,7 @@
dev->csa_complete |= ieee80211_beacon_cntdwn_is_complete(vif);
diff --git a/mt7615/dma.c b/mt7615/dma.c
-index f191443..ec729db 100644
+index f1914431..ec729dbe 100644
--- a/mt7615/dma.c
+++ b/mt7615/dma.c
@@ -281,8 +281,8 @@ int mt7615_dma_init(struct mt7615_dev *dev)
@@ -72,10 +72,10 @@
mt76_poll(dev, MT_WPDMA_GLO_CFG,
diff --git a/mt7615/main.c b/mt7615/main.c
-index ab4c1b4..8fb5b25 100644
+index dadb13f2..2c61c368 100644
--- a/mt7615/main.c
+++ b/mt7615/main.c
-@@ -474,7 +474,7 @@ static int mt7615_config(struct ieee80211_hw *hw, u32 changed)
+@@ -473,7 +473,7 @@ static int mt7615_config(struct ieee80211_hw *hw, u32 changed)
static int
mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -84,7 +84,7 @@
const struct ieee80211_tx_queue_params *params)
{
struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
-@@ -556,7 +556,7 @@ static void mt7615_configure_filter(struct ieee80211_hw *hw,
+@@ -555,7 +555,7 @@ static void mt7615_configure_filter(struct ieee80211_hw *hw,
static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info,
@@ -93,7 +93,7 @@
{
struct mt7615_dev *dev = mt7615_hw_dev(hw);
struct mt7615_phy *phy = mt7615_hw_phy(hw);
-@@ -599,7 +599,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
+@@ -598,7 +598,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
}
if (changed & BSS_CHANGED_ASSOC)
@@ -103,7 +103,7 @@
mt7615_mutex_release(dev);
}
diff --git a/mt7615/mcu.c b/mt7615/mcu.c
-index 4593b2e..39e81d2 100644
+index 4593b2e1..39e81d26 100644
--- a/mt7615/mcu.c
+++ b/mt7615/mcu.c
@@ -353,7 +353,7 @@ out:
@@ -143,7 +143,7 @@
.bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int),
};
diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
-index d406013..703ca73 100644
+index d4060136..703ca736 100644
--- a/mt76_connac_mcu.c
+++ b/mt76_connac_mcu.c
@@ -197,7 +197,7 @@ int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif)
@@ -484,7 +484,7 @@
return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(OFFLOAD), true);
}
diff --git a/mt76x02_mac.c b/mt76x02_mac.c
-index d3f7447..87ea3db 100644
+index d3f74473..87ea3db1 100644
--- a/mt76x02_mac.c
+++ b/mt76x02_mac.c
@@ -404,7 +404,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
@@ -509,7 +509,7 @@
if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
ba_size = 0;
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
-index 079629a..dcd773c 100644
+index 079629a3..dcd773c7 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -1911,8 +1911,8 @@ static ssize_t mt7915_sta_fixed_rate_set(struct file *file,
@@ -524,7 +524,7 @@
field = RATE_PARAM_FIXED;
diff --git a/mt7915/dma.c b/mt7915/dma.c
-index 60138f5..b30e418 100644
+index 4d9ab064..a8d581d1 100644
--- a/mt7915/dma.c
+++ b/mt7915/dma.c
@@ -590,8 +590,8 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
@@ -539,7 +539,7 @@
mt7915_dma_enable(dev, false);
diff --git a/mt7915/init.c b/mt7915/init.c
-index 6f309d0..0ca7e9f 100644
+index 6f309d0d..0ca7e9f5 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -1162,8 +1162,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
@@ -553,7 +553,7 @@
if (band == NL80211_BAND_6GHZ) {
diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 7690cc3..d31f235 100644
+index 596faf00..583bb554 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -882,7 +882,7 @@ mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
@@ -566,10 +566,10 @@
tid = le32_get_bits(txwi[1], MT_TXD1_TID);
diff --git a/mt7915/main.c b/mt7915/main.c
-index 7cc3a99..04c7b99 100644
+index 712f77fc..c51dcd30 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
-@@ -531,7 +531,7 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
+@@ -530,7 +530,7 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
static int
mt7915_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -578,7 +578,7 @@
const struct ieee80211_tx_queue_params *params)
{
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
-@@ -626,7 +626,7 @@ mt7915_update_bss_color(struct ieee80211_hw *hw,
+@@ -625,7 +625,7 @@ mt7915_update_bss_color(struct ieee80211_hw *hw,
static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info,
@@ -587,7 +587,7 @@
{
struct mt7915_phy *phy = mt7915_hw_phy(hw);
struct mt7915_dev *dev = mt7915_hw_dev(hw);
-@@ -646,7 +646,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
+@@ -645,7 +645,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
}
if (changed & BSS_CHANGED_ASSOC)
@@ -596,7 +596,7 @@
if (changed & BSS_CHANGED_ERP_CTS_PROT)
mt7915_mac_enable_rtscts(dev, vif, info->use_cts_prot);
-@@ -1242,10 +1242,10 @@ static int mt7915_sta_set_txpwr(struct ieee80211_hw *hw,
+@@ -1241,10 +1241,10 @@ static int mt7915_sta_set_txpwr(struct ieee80211_hw *hw,
{
struct mt7915_phy *phy = mt7915_hw_phy(hw);
struct mt7915_dev *dev = mt7915_hw_dev(hw);
@@ -610,7 +610,7 @@
mutex_lock(&dev->mt76.mutex);
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 083034e..136dbae 100644
+index 062e8aca..bbd3ce47 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -64,7 +64,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
@@ -1130,7 +1130,7 @@
len = sku_len[SKU_HE_RU242] * 4;
}
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
-index f3b9392..95d3a6d 100644
+index b99bed54..8b9813b4 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -397,12 +397,12 @@ mt7915_tm_entry_add(struct mt7915_phy *phy, u8 aid)
@@ -1151,7 +1151,7 @@
sta->wme = 1;
diff --git a/tx.c b/tx.c
-index c3c7eb5..57f10f4 100644
+index 823c8680..607f494a 100644
--- a/tx.c
+++ b/tx.c
@@ -60,20 +60,15 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
@@ -1178,6 +1178,39 @@
}
hw = mt76_tx_status_get_hw(dev, skb);
+@@ -236,6 +231,7 @@ mt76_tx_check_non_aql(struct mt76_dev *dev, struct mt76_wcid *wcid,
+ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *skb,
+ struct list_head *free_list)
+ {
++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb);
+ struct ieee80211_tx_status status = {
+ .skb = skb,
+@@ -266,21 +262,13 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *
+ #endif
+
+ if (cb->pktid < MT_PACKET_ID_FIRST) {
+- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+- struct ieee80211_rate_status rs = {};
+-
+ hw = mt76_tx_status_get_hw(dev, skb);
+ status.sta = wcid_to_sta(wcid);
+ if (mtk_wed_device_active(&dev->mmio.wed) &&
+ (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)) {
+- info->status.rates[0].idx = -1;
+-
+- if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
+- rs.rate_idx = wcid->rate;
+- status.rates = &rs;
+- status.n_rates = 1;
+- } else {
+- status.n_rates = 0;
++ if (status.sta) {
++ info->status.rates[0].idx = -1;
++ status.rate = &wcid->rate;
+ }
+ }
+ ieee80211_tx_status_ext(hw, &status);
--
2.18.0
diff --git a/recipes-wifi/linux-mt76/files/patches/patches.inc b/recipes-wifi/linux-mt76/files/patches/patches.inc
index 7d597aa..8be30f2 100644
--- a/recipes-wifi/linux-mt76/files/patches/patches.inc
+++ b/recipes-wifi/linux-mt76/files/patches/patches.inc
@@ -40,6 +40,7 @@
file://1030-wifi-mt76-mt7915-Add-vendor-command-attribute-for-RT.patch \
file://1031-wifi-mt76-mt7915-add-vendor-cmd-to-get-available-col.patch \
file://1032-wifi-mt76-mt7915-disable-SW-ACI-by-default.patch \
+ file://1033-wifi-mt76-mt7915-Add-5G-UNII4-support.patch \
file://110-wifi-mt76-ignore-key-disable-commands.patch \
file://3000-wifi-mt76-mt7915-wed-add-wed-tx-support.patch \
file://3001-wifi-mt76-mt7915-wed-add-wds-support-when-wed-is-ena.patch \
diff --git a/recipes-wifi/wireless-regdb/wireless-regdb_2023.02.13.bb b/recipes-wifi/wireless-regdb/wireless-regdb_2023.05.03.bb
similarity index 94%
rename from recipes-wifi/wireless-regdb/wireless-regdb_2023.02.13.bb
rename to recipes-wifi/wireless-regdb/wireless-regdb_2023.05.03.bb
index b4388d9..d23af12 100644
--- a/recipes-wifi/wireless-regdb/wireless-regdb_2023.02.13.bb
+++ b/recipes-wifi/wireless-regdb/wireless-regdb_2023.05.03.bb
@@ -5,7 +5,7 @@
LIC_FILES_CHKSUM = "file://LICENSE;md5=07c4f6dea3845b02a18dc00c8c87699c"
SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz"
-SRC_URI[sha256sum] = "fe81e8a8694dc4753a45087a1c4c7e1b48dee5a59f5f796ce374ea550f0b2e73"
+SRC_URI[sha256sum] = "f254d08ab3765aeae2b856222e11a95d44aef519a6663877c71ef68fae4c8c12"
FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:"
require files/patches/patches.inc
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
new file mode 100644
index 0000000..e9e12e9
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
@@ -0,0 +1,135 @@
+From 38507640ec424ff6c9c552b0f3c2d068a6192146 Mon Sep 17 00:00:00 2001
+From: Michael Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 28 Apr 2023 10:22:58 +0800
+Subject: [PATCH] hostapd: mtk: avoid setting beacon after wpa_supplicant stop
+ the AP
+
+Add a new variable 'stopped_by_supplicant' to indicate the AP
+interface is currently stopped by co-locating STA interface.
+After the STA interface finishes association with some other APs, it
+will reload the co-locating AP interfaces and marks the
+'stopped_by_supplicant' as 0.
+---
+ hostapd/ctrl_iface.c | 4 ++++
+ src/ap/beacon.c | 5 ++++-
+ src/ap/bss_load.c | 3 ++-
+ src/ap/ctrl_iface_ap.c | 4 +++-
+ src/ap/hostapd.c | 2 ++
+ src/ap/hostapd.h | 1 +
+ 6 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 4c5d494..07c97b5 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -192,11 +192,15 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
+ {
+ struct hostapd_config * (*config_read_cb)(const char *config_fname);
+ struct hostapd_iface *iface = hapd->iface;
++ size_t j;
+
+ config_read_cb = iface->interfaces->config_read_cb;
+ iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
+ reload_opts = txt;
+
++ for (j = 0; j < iface->num_bss; j++)
++ iface->bss[j]->stopped_by_supplicant = 0;
++
+ hostapd_reload_config(iface, 0);
+
+ iface->interfaces->config_read_cb = config_read_cb;
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 51db23a..187e314 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -2125,7 +2125,8 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
+ continue;
+
+ for (i = 0; i < colocated->num_bss; i++) {
+- if (colocated->bss[i] && colocated->bss[i]->started)
++ if (colocated->bss[i] && colocated->bss[i]->started &&
++ !colocated->bss[i]->stopped_by_supplicant)
+ __ieee802_11_set_beacon(colocated->bss[i]);
+ }
+ }
+@@ -2141,6 +2142,7 @@ int ieee802_11_set_beacons(struct hostapd_iface *iface)
+
+ for (i = 0; i < iface->num_bss; i++) {
+ if (iface->bss[i]->started &&
++ !iface->bss[i]->stopped_by_supplicant &&
+ ieee802_11_set_beacon(iface->bss[i]) < 0)
+ ret = -1;
+ }
+@@ -2157,6 +2159,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface)
+
+ for (i = 0; i < iface->num_bss; i++) {
+ if (iface->bss[i]->beacon_set_done && iface->bss[i]->started &&
++ !iface->bss[i]->stopped_by_supplicant &&
+ ieee802_11_set_beacon(iface->bss[i]) < 0)
+ ret = -1;
+ }
+diff --git a/src/ap/bss_load.c b/src/ap/bss_load.c
+index 725d3cd..ae55521 100644
+--- a/src/ap/bss_load.c
++++ b/src/ap/bss_load.c
+@@ -46,7 +46,8 @@ static void update_channel_utilization(void *eloop_data, void *user_data)
+ int err;
+ struct hostapd_iface *iface = hapd->iface;
+
+- if (!(hapd->beacon_set_done && hapd->started))
++ if (!(hapd->beacon_set_done && hapd->started &&
++ !hapd->stopped_by_supplicant))
+ return;
+
+ err = hostapd_drv_get_survey(hapd, hapd->iface->freq);
+diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
+index 2fae590..1ad37c5 100644
+--- a/src/ap/ctrl_iface_ap.c
++++ b/src/ap/ctrl_iface_ap.c
+@@ -951,8 +951,10 @@ int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
+ struct hostapd_iface *iface = hapd->iface;
+ int i;
+
+- for (i = 0; i < iface->num_bss; i++)
++ for (i = 0; i < iface->num_bss; i++){
++ iface->bss[i]->stopped_by_supplicant = 1;
+ hostapd_drv_stop_ap(iface->bss[i]);
++ }
+
+ return 0;
+ }
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index ef0d6db..b2fd9b9 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -477,6 +477,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
+ }
+ hapd->started = 0;
+ hapd->beacon_set_done = 0;
++ hapd->stopped_by_supplicant = 0;
+
+ wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
+ hostapd_ubus_free_bss(hapd);
+@@ -1257,6 +1258,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
+ return -1;
+ }
+ hapd->started = 1;
++ hapd->stopped_by_supplicant = 0;
+
+ if (!first || first == -1) {
+ u8 *addr = hapd->own_addr;
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 093c28a..3b51050 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -190,6 +190,7 @@ struct hostapd_data {
+ unsigned int started:1;
+ unsigned int disabled:1;
+ unsigned int reenable_beacon:1;
++ unsigned int stopped_by_supplicant:1;
+
+ u8 own_addr[ETH_ALEN];
+
+--
+2.25.1
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc
index 07bae46..5aaec3e 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc
@@ -90,6 +90,7 @@
file://mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
file://mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+ file://mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch \
file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
file://mtk-0100-hostapd-mtk-update-eht-operation-elem.patch \
"
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
new file mode 100644
index 0000000..e9e12e9
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch
@@ -0,0 +1,135 @@
+From 38507640ec424ff6c9c552b0f3c2d068a6192146 Mon Sep 17 00:00:00 2001
+From: Michael Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 28 Apr 2023 10:22:58 +0800
+Subject: [PATCH] hostapd: mtk: avoid setting beacon after wpa_supplicant stop
+ the AP
+
+Add a new variable 'stopped_by_supplicant' to indicate the AP
+interface is currently stopped by co-locating STA interface.
+After the STA interface finishes association with some other APs, it
+will reload the co-locating AP interfaces and marks the
+'stopped_by_supplicant' as 0.
+---
+ hostapd/ctrl_iface.c | 4 ++++
+ src/ap/beacon.c | 5 ++++-
+ src/ap/bss_load.c | 3 ++-
+ src/ap/ctrl_iface_ap.c | 4 +++-
+ src/ap/hostapd.c | 2 ++
+ src/ap/hostapd.h | 1 +
+ 6 files changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index 4c5d494..07c97b5 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -192,11 +192,15 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
+ {
+ struct hostapd_config * (*config_read_cb)(const char *config_fname);
+ struct hostapd_iface *iface = hapd->iface;
++ size_t j;
+
+ config_read_cb = iface->interfaces->config_read_cb;
+ iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
+ reload_opts = txt;
+
++ for (j = 0; j < iface->num_bss; j++)
++ iface->bss[j]->stopped_by_supplicant = 0;
++
+ hostapd_reload_config(iface, 0);
+
+ iface->interfaces->config_read_cb = config_read_cb;
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 51db23a..187e314 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -2125,7 +2125,8 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
+ continue;
+
+ for (i = 0; i < colocated->num_bss; i++) {
+- if (colocated->bss[i] && colocated->bss[i]->started)
++ if (colocated->bss[i] && colocated->bss[i]->started &&
++ !colocated->bss[i]->stopped_by_supplicant)
+ __ieee802_11_set_beacon(colocated->bss[i]);
+ }
+ }
+@@ -2141,6 +2142,7 @@ int ieee802_11_set_beacons(struct hostapd_iface *iface)
+
+ for (i = 0; i < iface->num_bss; i++) {
+ if (iface->bss[i]->started &&
++ !iface->bss[i]->stopped_by_supplicant &&
+ ieee802_11_set_beacon(iface->bss[i]) < 0)
+ ret = -1;
+ }
+@@ -2157,6 +2159,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface)
+
+ for (i = 0; i < iface->num_bss; i++) {
+ if (iface->bss[i]->beacon_set_done && iface->bss[i]->started &&
++ !iface->bss[i]->stopped_by_supplicant &&
+ ieee802_11_set_beacon(iface->bss[i]) < 0)
+ ret = -1;
+ }
+diff --git a/src/ap/bss_load.c b/src/ap/bss_load.c
+index 725d3cd..ae55521 100644
+--- a/src/ap/bss_load.c
++++ b/src/ap/bss_load.c
+@@ -46,7 +46,8 @@ static void update_channel_utilization(void *eloop_data, void *user_data)
+ int err;
+ struct hostapd_iface *iface = hapd->iface;
+
+- if (!(hapd->beacon_set_done && hapd->started))
++ if (!(hapd->beacon_set_done && hapd->started &&
++ !hapd->stopped_by_supplicant))
+ return;
+
+ err = hostapd_drv_get_survey(hapd, hapd->iface->freq);
+diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
+index 2fae590..1ad37c5 100644
+--- a/src/ap/ctrl_iface_ap.c
++++ b/src/ap/ctrl_iface_ap.c
+@@ -951,8 +951,10 @@ int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
+ struct hostapd_iface *iface = hapd->iface;
+ int i;
+
+- for (i = 0; i < iface->num_bss; i++)
++ for (i = 0; i < iface->num_bss; i++){
++ iface->bss[i]->stopped_by_supplicant = 1;
+ hostapd_drv_stop_ap(iface->bss[i]);
++ }
+
+ return 0;
+ }
+diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
+index ef0d6db..b2fd9b9 100644
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -477,6 +477,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd)
+ }
+ hapd->started = 0;
+ hapd->beacon_set_done = 0;
++ hapd->stopped_by_supplicant = 0;
+
+ wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
+ hostapd_ubus_free_bss(hapd);
+@@ -1257,6 +1258,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
+ return -1;
+ }
+ hapd->started = 1;
++ hapd->stopped_by_supplicant = 0;
+
+ if (!first || first == -1) {
+ u8 *addr = hapd->own_addr;
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 093c28a..3b51050 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -190,6 +190,7 @@ struct hostapd_data {
+ unsigned int started:1;
+ unsigned int disabled:1;
+ unsigned int reenable_beacon:1;
++ unsigned int stopped_by_supplicant:1;
+
+ u8 own_addr[ETH_ALEN];
+
+--
+2.25.1
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches/patches.inc b/recipes-wifi/wpa-supplicant/files/patches/patches.inc
index 523fc4d..d7cc2b2 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/patches.inc
+++ b/recipes-wifi/wpa-supplicant/files/patches/patches.inc
@@ -90,5 +90,6 @@
file://mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
file://mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+ file://mtk-0028-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch \
file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
"