[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
3a2eef0b [MAC80211][Release][Update release note for Filogic 880/860 MLO Beta release]
cfbd2411 [MAC80211][Release][Filogic 880/860 MLO Beta release]
6c180e3f [MAC80211][WiFi7][misc][Add Eagle BE14000 efem default bin]
a55f34db [MAC80211][Release][Prepare for Filogic 880/860 release]
5b45ebca [MAC80211][WiFi7][hostapd][Add puncture bitmap to ucode]
95bbea73 [MAC80211][WiFi6][mt76][Add PID to only report data-frame TX rate]
b15ced26 [MAC80211][WiFi6][hostapd][Fix DFS channel selection issue]
d59133cb [MAC80211][WiFi6][mt76][Fix pse info not correct information]
3921b4b2 [MAC80211][WiFi6][mt76][Fix incomplete QoS-map setting to FW]
4e7690c7 [MAC80211][WiFi6/7][app][Change ATECHANNEL mapping cmd]
eb37af90 [MAC80211][WiFi7][app][Add support for per-packet bw & primary selection]
0ea82adf [MAC80211][WiFi6][core][Fix DFS CAC issue after CSA]
[Release-log]
Change-Id: I9bec97ec1b2e1c49ed43a812a07a5b21fcbb70a6
diff --git a/recipes-wifi/linux-mac80211/files/patches-6.x/subsys/0043-mtk-mac80211-Add-cert-mode-to-disable-ba-timeout.patch b/recipes-wifi/linux-mac80211/files/patches-6.x/subsys/0043-mtk-mac80211-Add-cert-mode-to-disable-ba-timeout.patch
new file mode 100644
index 0000000..612ed69
--- /dev/null
+++ b/recipes-wifi/linux-mac80211/files/patches-6.x/subsys/0043-mtk-mac80211-Add-cert-mode-to-disable-ba-timeout.patch
@@ -0,0 +1,124 @@
+From 1519b6ddc0a4256bddcaaeb8fc43db7fd7c6ee8f Mon Sep 17 00:00:00 2001
+From: "Allen.Ye" <allen.ye@mediatek.com>
+Date: Thu, 9 Nov 2023 11:37:37 +0800
+Subject: [PATCH 43/89] mtk: mac80211: Add cert mode to disable ba timeout
+
+Add a switch of certification mode in debugfs as cert_mode. In the case
+we use it to disable BA timeout from STA to prevent crashing STA.
+
+Signed-off-by: Allen.Ye <allen.ye@mediatek.com>
+
+Move the variable 'cert_mode' from ieee80211_local to ieee80211_hw
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ include/net/mac80211.h | 6 ++++++
+ net/mac80211/agg-tx.c | 5 ++++-
+ net/mac80211/debugfs.c | 49 ++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 59 insertions(+), 1 deletion(-)
+
+diff --git a/include/net/mac80211.h b/include/net/mac80211.h
+index 215d499..98678c8 100644
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -3059,8 +3059,14 @@ struct ieee80211_hw {
+ u32 max_mtu;
+ const s8 *tx_power_levels;
+ u8 max_txpwr_levels_idx;
++ bool cert_mode;
+ };
+
++static inline bool ieee80211_is_cert_mode(struct ieee80211_hw *hw)
++{
++ return hw->cert_mode;
++}
++
+ static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw,
+ enum ieee80211_hw_flags flg)
+ {
+diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
+index 0abc77b..2f351a7 100644
+--- a/net/mac80211/agg-tx.c
++++ b/net/mac80211/agg-tx.c
+@@ -1092,7 +1092,10 @@ next:
+ tid_tx->timeout =
+ le16_to_cpu(mgmt->u.action.u.addba_resp.timeout);
+
+- if (tid_tx->timeout) {
++ /* In the case of certification env, testbed STA cannot accept frequent DelBA.
++ * Therefore, we remove the session timer check here to avoid crashing testbed STA.
++ */
++ if (tid_tx->timeout && !ieee80211_is_cert_mode(&local->hw)) {
+ mod_timer(&tid_tx->session_timer,
+ TU_TO_EXP_TIME(tid_tx->timeout));
+ tid_tx->last_tx = jiffies;
+diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
+index ce8eb40..376abfc 100644
+--- a/net/mac80211/debugfs.c
++++ b/net/mac80211/debugfs.c
+@@ -450,6 +450,54 @@ static const struct file_operations reset_ops = {
+ };
+ #endif
+
++static ssize_t cert_mode_read(struct file *file,
++ char __user *user_buf,
++ size_t count,
++ loff_t *ppos)
++{
++ struct ieee80211_local *local = file->private_data;
++ char buf[32];
++ int len = 0;
++
++ len = scnprintf(buf, sizeof(buf), "cert_mode: %d\n",
++ local->hw.cert_mode);
++
++ return simple_read_from_buffer(user_buf, count, ppos,
++ buf, len);
++}
++
++static ssize_t cert_mode_write(struct file *file,
++ const char __user *user_buf,
++ size_t count,
++ loff_t *ppos)
++{
++ struct ieee80211_local *local = file->private_data;
++ char buf[16];
++
++ if (count >= sizeof(buf))
++ return -EINVAL;
++
++ if (copy_from_user(buf, user_buf, count))
++ return -EFAULT;
++
++ if (count && buf[count - 1] == '\n')
++ buf[count - 1] = '\0';
++ else
++ buf[count] = '\0';
++
++ if (kstrtobool(buf, &local->hw.cert_mode))
++ return -EINVAL;
++
++ return count;
++}
++
++static const struct file_operations cert_mode_ops = {
++ .write = cert_mode_write,
++ .read = cert_mode_read,
++ .open = simple_open,
++ .llseek = noop_llseek,
++};
++
+ static const char *hw_flag_names[] = {
+ #define FLAG(F) [IEEE80211_HW_##F] = #F
+ FLAG(HAS_RATE_CONTROL),
+@@ -683,6 +731,7 @@ void debugfs_hw_add(struct ieee80211_local *local)
+ debugfs_create_u32("aql_threshold", 0600,
+ phyd, &local->aql_threshold);
+
++ DEBUGFS_ADD_MODE(cert_mode, 0644);
+ statsd = debugfs_create_dir("statistics", phyd);
+
+ #ifdef CPTCFG_MAC80211_DEBUG_COUNTERS
+--
+2.18.0
+