[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
5b228d80 [MAC80211][WiFi6][mt76][Fix NULL pointer access when setting QoS map]
7d86a237 [MAC80211][WiFi6][mt76][Fix merlin 5g can't receive rx data at two pcie mode]
0ffd8c9d [MAC80211][WiFi6][mt76][Fix runtime change security mode to open issue]
e20ea87d [MAC80211][misc][Separate MT7992 & MT7996 firmware to reduce image size]
0d70c868 [MAC80211][WiFi6][hostapd][Fix failure of BSS-wise QoS-map setting]
ccf5e237 [MAC80211][Rebase Patch][Change QoS-map setting method to callback function]
81505830 [MAC80211][WiFi6][mt76][Change QoS-map setting method to callback function]
53322d00 [MAC80211][Rebase Patch][Add callback function to set QoS map in HW]
c36b2f81 [MAC80211][WiFi6][core][Add callback function to set QoS map in HW]
c544feaf [MAC80211][WiFi7][Misc][Fix build fail because of wifi-scripts package and iw version]
b471f43a [MAC80211][WiFi7][app][convert mwtcl cmd to mt76 internal debug cmd]
dbd53909 [MAC80211][WiFi6][Misc][Fix Cheetah build fail]
8e6f43e2 [MAC80211][WiFi7][misc][use repo to maintain wifi-scripts]
e497c9f7 [MAC80211][WiFi7][misc][Fix legacy non-EHT bss + MLD issue]
56c2223c [MAC80211][WiFi7][app][convert iwpriv/mwctl command with link_id]
8d1960db [MAC80211][WiFi7][misc][Fix wrong path for per-radio antenna config patch]
c587263f [MAC80211][WiFi7][misc][Add per-radio antenna config support]
[Release-log]
Change-Id: I4b068cc1b5717c4927daaeaac04dca6642454c97
diff --git a/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0031-mac80211-mtk-add-callback-function-to-set-QoS-map-in.patch b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0031-mac80211-mtk-add-callback-function-to-set-QoS-map-in.patch
new file mode 100644
index 0000000..8dd492d
--- /dev/null
+++ b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0031-mac80211-mtk-add-callback-function-to-set-QoS-map-in.patch
@@ -0,0 +1,95 @@
+From 843e2b25433dc6c3cbc2ff4a754bef091cabe54b Mon Sep 17 00:00:00 2001
+From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
+Date: Mon, 24 Jun 2024 17:50:08 +0800
+Subject: [PATCH] mac80211: mtk: add callback function to set QoS map in HW
+
+The mapping from IP DSCP to IEEE 802.11 user priority may be customized.
+Therefore, the mapping needs to be passed to HW, so that the QoS type of traffic can be mapped in a consistent manner for both SW and HW paths.
+
+Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
+---
+ include/net/mac80211.h | 3 +++
+ net/mac80211/cfg.c | 2 +-
+ net/mac80211/driver-ops.h | 16 ++++++++++++++++
+ net/mac80211/trace.h | 6 ++++++
+ 4 files changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/include/net/mac80211.h b/include/net/mac80211.h
+index 5c26752..b622c76 100644
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -3982,6 +3982,7 @@ struct ieee80211_prep_tx_info {
+ * disable background CAC/radar detection.
+ * @net_fill_forward_path: Called from .ndo_fill_forward_path in order to
+ * resolve a path for hardware flow offloading
++ * @set_qos_map: Set QoS mapping information to driver.
+ */
+ struct ieee80211_ops {
+ void (*tx)(struct ieee80211_hw *hw,
+@@ -4321,6 +4322,8 @@ struct ieee80211_ops {
+ struct net_device_path_ctx *ctx,
+ struct net_device_path *path);
+ #endif
++ int (*set_qos_map)(struct ieee80211_vif *vif,
++ struct cfg80211_qos_map *qos_map);
+ };
+
+ /**
+diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
+index ffb60a2..80fba54 100644
+--- a/net/mac80211/cfg.c
++++ b/net/mac80211/cfg.c
+@@ -4040,7 +4040,7 @@ static int ieee80211_set_qos_map(struct wiphy *wiphy,
+ if (old_qos_map)
+ kfree_rcu(old_qos_map, rcu_head);
+
+- return 0;
++ return drv_set_qos_map(sdata->local, sdata, qos_map);
+ }
+
+ static int ieee80211_set_ap_chanwidth(struct wiphy *wiphy,
+diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
+index 9e8003f..d4723dc 100644
+--- a/net/mac80211/driver-ops.h
++++ b/net/mac80211/driver-ops.h
+@@ -1525,4 +1525,20 @@ static inline int drv_net_fill_forward_path(struct ieee80211_local *local,
+ }
+ #endif
+
++static inline int drv_set_qos_map(struct ieee80211_local *local,
++ struct ieee80211_sub_if_data *sdata,
++ struct cfg80211_qos_map *qos_map)
++{
++ int ret = -EOPNOTSUPP;
++
++ might_sleep();
++
++ trace_drv_set_qos_map(local, sdata);
++ if (local->ops->set_qos_map)
++ ret = local->ops->set_qos_map(&sdata->vif, qos_map);
++ trace_drv_return_int(local, ret);
++
++ return ret;
++}
++
+ #endif /* __MAC80211_DRIVER_OPS */
+diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
+index d15dadd..c6fc75e 100644
+--- a/net/mac80211/trace.h
++++ b/net/mac80211/trace.h
+@@ -2929,6 +2929,12 @@ TRACE_EVENT(bss_color_bitmap,
+ )
+ );
+
++DEFINE_EVENT(local_sdata_evt, drv_set_qos_map,
++ TP_PROTO(struct ieee80211_local *local,
++ struct ieee80211_sub_if_data *sdata),
++ TP_ARGS(local, sdata)
++);
++
+ #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
+
+ #undef TRACE_INCLUDE_PATH
+--
+2.18.0
+