[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
c7470cd7 [MAC80211][misc][Refactor WiFi7 MLO Script change into patch files]
e4aa1c1d [MAC80211][WiFi6][mt76][fix rx filter cr]
75b0445f [MAC80211][WiFi6][mt76][Fix inconsistent QoS mapping between SW and HW for STA IFs]
1ef858e8 [MAC80211][WiFi6][core][Fix inconsistent QoS mapping between AP and AP_VLAN VIFs]
[Release-log]
Change-Id: Ic8bcc0d6031b69788092f644860b98c6c035bfe5
diff --git a/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0032-mac80211-mtk-fix-inconsistent-QoS-mapping-between-AP.patch b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0032-mac80211-mtk-fix-inconsistent-QoS-mapping-between-AP.patch
new file mode 100644
index 0000000..c05b086
--- /dev/null
+++ b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0032-mac80211-mtk-fix-inconsistent-QoS-mapping-between-AP.patch
@@ -0,0 +1,56 @@
+From de4d3e25a555dedd70793d0362b1e501ed1a77f1 Mon Sep 17 00:00:00 2001
+From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
+Date: Tue, 30 Apr 2024 10:28:29 +0800
+Subject: [PATCH] mac80211: mtk: fix inconsistent QoS mapping between AP and
+ AP_VLAN VIFs
+
+Fix inconsistent QoS mapping between AP and AP_VLAN IFs.
+Specifically, when WDS AP IF is connected by a WDS STA, the QoS map of the AP_VLAN VIF is NULL.
+So the QoS types of packets to the WDS STA will be determined using the default mapping rule.
+However, SoftMAC driver uses the QoS map of the AP VIF, which may already be set.
+Therefore, it is possible that the QoS mappings of SW and HW are inconsistent.
+Thus, sync QoS map of AP VIF to that of AP_VLAN VIF.
+
+Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
+---
+ net/mac80211/iface.c | 23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
+index ef32d53..138ad79 100644
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -297,8 +297,29 @@ static int ieee80211_check_concurrent_iface(struct ieee80211_sub_if_data *sdata,
+ * can only add VLANs to enabled APs
+ */
+ if (iftype == NL80211_IFTYPE_AP_VLAN &&
+- nsdata->vif.type == NL80211_IFTYPE_AP)
++ nsdata->vif.type == NL80211_IFTYPE_AP) {
++ struct mac80211_qos_map *old_qos_map, *new_qos_map = NULL;
++
+ sdata->bss = &nsdata->u.ap;
++
++ rcu_read_lock();
++ old_qos_map = rcu_dereference(nsdata->qos_map);
++ if (old_qos_map) {
++ new_qos_map = kzalloc(sizeof(*new_qos_map), GFP_KERNEL);
++ if (!new_qos_map) {
++ rcu_read_unlock();
++ return -ENOMEM;
++ }
++ memcpy(&new_qos_map->qos_map, &old_qos_map->qos_map,
++ sizeof(new_qos_map->qos_map));
++ }
++ rcu_read_unlock();
++
++ old_qos_map = sdata_dereference(sdata->qos_map, sdata);
++ rcu_assign_pointer(sdata->qos_map, new_qos_map);
++ if (old_qos_map)
++ kfree_rcu(old_qos_map, rcu_head);
++ }
+ }
+ }
+
+--
+2.18.0
+
diff --git a/recipes-wifi/linux-mac80211/files/patches/subsys/subsys.inc b/recipes-wifi/linux-mac80211/files/patches/subsys/subsys.inc
index a12060b..54c4208 100644
--- a/recipes-wifi/linux-mac80211/files/patches/subsys/subsys.inc
+++ b/recipes-wifi/linux-mac80211/files/patches/subsys/subsys.inc
@@ -89,6 +89,7 @@
file://mtk-0029-mac80211-mtk-send-4-addr-nullfunc-after-drv_event_ca.patch \
file://mtk-0030-mac80211-mtk-fix-incorrect-VIF-assignment-for-IEEE-8.patch \
file://mtk-0031-mac80211-mtk-add-exported-function-for-SoftMAC-drive.patch \
+ file://mtk-0032-mac80211-mtk-fix-inconsistent-QoS-mapping-between-AP.patch \
file://mtk-9900-mac80211-mtk-mask-kernel-version-limitation-and-fill.patch \
file://mtk-9901-mac80211-mtk-add-fill-receive-path-ops-to-get-wed-id.patch \
file://mtk-9902-mac80211-mtk-add-support-for-letting-drivers-registe.patch \
diff --git a/recipes-wifi/linux-mt76/files/patches/0017-wifi-mt76-mt7915-fix-inconsistent-QoS-mapping-betwee.patch b/recipes-wifi/linux-mt76/files/patches/0017-wifi-mt76-mt7915-fix-inconsistent-QoS-mapping-betwee.patch
index d4d3d2e..88b589a 100644
--- a/recipes-wifi/linux-mt76/files/patches/0017-wifi-mt76-mt7915-fix-inconsistent-QoS-mapping-betwee.patch
+++ b/recipes-wifi/linux-mt76/files/patches/0017-wifi-mt76-mt7915-fix-inconsistent-QoS-mapping-betwee.patch
@@ -1,4 +1,4 @@
-From 9c6e5082d5552ac2cefe5b4857da4b29b0c76685 Mon Sep 17 00:00:00 2001
+From 0a59757ea8e0ea066053cb6b58da3570a4092c09 Mon Sep 17 00:00:00 2001
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Date: Thu, 25 Apr 2024 17:17:13 +0800
Subject: [PATCH] wifi: mt76: mt7915: fix inconsistent QoS mapping between SW
@@ -10,10 +10,10 @@
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
---
mt76_connac_mcu.h | 1 +
- mt7915/main.c | 3 +++
+ mt7915/main.c | 5 +++++
mt7915/mcu.c | 37 +++++++++++++++++++++++++++++++++++++
- mt7915/mt7915.h | 1 +
- 4 files changed, 42 insertions(+)
+ mt7915/mt7915.h | 3 +++
+ 4 files changed, 46 insertions(+)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 1dd8244..0936c1c 100644
@@ -28,21 +28,23 @@
enum {
diff --git a/mt7915/main.c b/mt7915/main.c
-index 5ed84bc..26f9a5a 100644
+index 5ed84bc..c6880ca 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
-@@ -646,6 +646,9 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
- }
- }
+@@ -1697,6 +1697,11 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
-+ if (changed & BSS_CHANGED_QOS)
+ ctx->dev = NULL;
+
++ if (!mvif->qos_map_enabled) {
+ mt7915_mcu_set_qos_map(dev, vif);
++ mvif->qos_map_enabled = true;
++ }
+
- /* ensure that enable txcmd_mode after bss_info */
- if (changed & (BSS_CHANGED_QOS | BSS_CHANGED_BEACON_ENABLED))
- mt7915_mcu_set_tx(dev, vif);
+ return 0;
+ }
+ #endif
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 446c512..3d7fc6d 100644
+index 446c512..64d2710 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -4212,3 +4212,40 @@ int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
@@ -84,13 +86,22 @@
+ rcu_read_unlock();
+
+ return mt76_mcu_send_msg(&dev->mt76, MCU_WA_EXT_CMD(SET_QOS_MAP), &req,
-+ sizeof(req), true);
++ sizeof(req), false);
+}
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 74cd8ca..66d87d7 100644
+index 74cd8ca..c813433 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
-@@ -521,6 +521,7 @@ int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
+@@ -175,6 +175,8 @@ struct mt7915_vif {
+
+ struct ieee80211_tx_queue_params queue_params[IEEE80211_NUM_ACS];
+ struct cfg80211_bitrate_mask bitrate_mask;
++
++ bool qos_map_enabled;
+ };
+
+ /* crash-dump */
+@@ -521,6 +523,7 @@ int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb);
void mt7915_mcu_exit(struct mt7915_dev *dev);
void mt7915_mcu_wmm_pbc_work(struct work_struct *work);
diff --git a/recipes-wifi/linux-mt76/files/patches/0018-wifi-mt76-mt7915-adjust-rx-filter.patch b/recipes-wifi/linux-mt76/files/patches/0018-wifi-mt76-mt7915-adjust-rx-filter.patch
new file mode 100644
index 0000000..7f6406f
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/0018-wifi-mt76-mt7915-adjust-rx-filter.patch
@@ -0,0 +1,58 @@
+From b241c6831557c3141801dc2f87e839269ef7bad1 Mon Sep 17 00:00:00 2001
+From: Howard Hsu <howard-yh.hsu@mediatek.com>
+Date: Fri, 19 Apr 2024 15:43:23 +0800
+Subject: [PATCH] wifi: mt76: mt7915: adjust rx filter
+
+Adjust rx filter setting to drop the packet that we do not need to
+receive.
+
+Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
+Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
+---
+ mt7915/main.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/mt7915/main.c b/mt7915/main.c
+index 26f9a5a..137e09a 100644
+--- a/mt7915/main.c
++++ b/mt7915/main.c
+@@ -489,7 +489,8 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
+ rxfilter |= MT_WF_RFCR_DROP_OTHER_UC;
+ dev->monitor_mask &= ~BIT(band);
+ } else {
+- rxfilter &= ~MT_WF_RFCR_DROP_OTHER_UC;
++ rxfilter &= ~(MT_WF_RFCR_DROP_A2_BSSID |
++ MT_WF_RFCR_DROP_OTHER_UC);
+ dev->monitor_mask |= BIT(band);
+ }
+
+@@ -552,13 +553,14 @@ static void mt7915_configure_filter(struct ieee80211_hw *hw,
+ MT_WF_RFCR_DROP_MCAST |
+ MT_WF_RFCR_DROP_BCAST |
+ MT_WF_RFCR_DROP_DUPLICATE |
+- MT_WF_RFCR_DROP_A2_BSSID |
+ MT_WF_RFCR_DROP_UNWANTED_CTL |
+ MT_WF_RFCR_DROP_STBC_MULTI);
++ phy->rxfilter |= MT_WF_RFCR_DROP_VERSION;
+
+ MT76_FILTER(OTHER_BSS, MT_WF_RFCR_DROP_OTHER_TIM |
+ MT_WF_RFCR_DROP_A3_MAC |
+- MT_WF_RFCR_DROP_A3_BSSID);
++ MT_WF_RFCR_DROP_A3_BSSID |
++ MT_WF_RFCR_DROP_A2_BSSID);
+
+ MT76_FILTER(FCSFAIL, MT_WF_RFCR_DROP_FCSFAIL);
+
+@@ -569,7 +571,8 @@ static void mt7915_configure_filter(struct ieee80211_hw *hw,
+ *total_flags = flags;
+ rxfilter = phy->rxfilter;
+ if (hw->conf.flags & IEEE80211_CONF_MONITOR)
+- rxfilter &= ~MT_WF_RFCR_DROP_OTHER_UC;
++ rxfilter &= ~(MT_WF_RFCR_DROP_A2_BSSID |
++ MT_WF_RFCR_DROP_OTHER_UC);
+ else
+ rxfilter |= MT_WF_RFCR_DROP_OTHER_UC;
+ mt76_wr(dev, MT_WF_RFCR(band), rxfilter);
+--
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches/patches.inc b/recipes-wifi/linux-mt76/files/patches/patches.inc
index a8fea12..4ad84a7 100644
--- a/recipes-wifi/linux-mt76/files/patches/patches.inc
+++ b/recipes-wifi/linux-mt76/files/patches/patches.inc
@@ -18,6 +18,7 @@
file://0016-wifi-mt76-mt7915-add-dummy-HW-offload-of-IEEE-802.11.patch \
file://0016-wifi-mt76-mt7915-fix-rx-filter-setting-for-bfee-func.patch \
file://0017-wifi-mt76-mt7915-fix-inconsistent-QoS-mapping-betwee.patch \
+ file://0018-wifi-mt76-mt7915-adjust-rx-filter.patch \
file://0999-wifi-mt76-mt7915-build-pass-for-Linux-Kernel-5.4-fix.patch \
file://1000-wifi-mt76-mt7915-add-mtk-internal-debug-tools-for-mt.patch \
file://1001-wifi-mt76-mt7915-csi-implement-csi-support.patch \