[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-mt76/files/patches-3.x/0138-mtk-mt76-mt7996-trigger-channel-calibration-for-DFS-.patch b/recipes-wifi/linux-mt76/files/patches-3.x/0138-mtk-mt76-mt7996-trigger-channel-calibration-for-DFS-.patch
new file mode 100644
index 0000000..6160525
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/0138-mtk-mt76-mt7996-trigger-channel-calibration-for-DFS-.patch
@@ -0,0 +1,135 @@
+From 29f282a0ca7e594da0b23db9429c0588408a708e Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Fri, 17 May 2024 14:49:50 +0800
+Subject: [PATCH 138/199] mtk: mt76: mt7996: trigger channel calibration for
+ DFS link after sta is associated
+
+Trigger channel calibration (set channel with switch reason = NORMAL)
+for DFS link after STA is associated.
+Without this patch, 5G link might have high PER during T.P. test
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ mt7996/main.c | 15 +++++++++++----
+ mt7996/mcu.c | 7 ++++---
+ mt7996/mt7996.h | 2 +-
+ mt7996/testmode.c | 4 ++--
+ 4 files changed, 18 insertions(+), 10 deletions(-)
+
+diff --git a/mt7996/main.c b/mt7996/main.c
+index c7ec01f2..40418f7e 100644
+--- a/mt7996/main.c
++++ b/mt7996/main.c
+@@ -82,12 +82,12 @@ int mt7996_run(struct ieee80211_hw *hw)
+ if (ret)
+ goto out;
+
+- ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_RX_PATH);
++ ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_RX_PATH, false);
+ if (ret)
+ goto out;
+
+ /* set a parking channel */
+- ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH);
++ ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH, false);
+ if (ret)
+ goto out;
+
+@@ -554,11 +554,11 @@ static int __mt7996_set_channel(struct mt7996_phy *phy,
+ goto out;
+ }
+
+- ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH);
++ ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH, false);
+ if (ret)
+ goto out;
+
+- ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_RX_PATH);
++ ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_RX_PATH, false);
+ if (ret)
+ goto out;
+
+@@ -2732,6 +2732,13 @@ mt7996_event_callback(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ next_time = min(next_time,
+ MT7996_MAX_BEACON_LOSS *
+ conf->beacon_int);
++
++ /* trigger calibration for DFS link */
++ if (!cfg80211_reg_can_beacon(hw->wiphy,
++ &mconf->chanctx->chandef,
++ NL80211_IFTYPE_AP))
++ mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH,
++ true);
+ }
+
+ ieee80211_queue_delayed_work(hw, &mvif->beacon_mon_work,
+diff --git a/mt7996/mcu.c b/mt7996/mcu.c
+index 48ff11d9..3a950a90 100644
+--- a/mt7996/mcu.c
++++ b/mt7996/mcu.c
+@@ -4397,7 +4397,7 @@ int mt7996_mcu_rdd_background_enable(struct mt7996_phy *phy,
+ 0, region);
+ }
+
+-int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag)
++int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag, bool sta)
+ {
+ static const u8 ch_band[] = {
+ [NL80211_BAND_2GHZ] = 0,
+@@ -4408,6 +4408,8 @@ int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag)
+ struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
+ int freq1 = chandef->center_freq1;
+ u8 band_idx = phy->mt76->band_idx;
++ enum nl80211_iftype iftype = sta ? NL80211_IFTYPE_STATION :
++ NL80211_IFTYPE_AP;
+ struct {
+ /* fixed field */
+ u8 __rsv[4];
+@@ -4448,8 +4450,7 @@ int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag)
+ phy->mt76->hw->conf.flags & IEEE80211_CONF_IDLE ||
+ phy->scan_chan)
+ req.switch_reason = CH_SWITCH_SCAN_BYPASS_DPD;
+- else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef,
+- NL80211_IFTYPE_AP))
++ else if (!cfg80211_reg_can_beacon(phy->mt76->hw->wiphy, chandef, iftype))
+ req.switch_reason = CH_SWITCH_DFS;
+ else
+ req.switch_reason = CH_SWITCH_NORMAL;
+diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h
+index cb35a927..259845a1 100644
+--- a/mt7996/mt7996.h
++++ b/mt7996/mt7996.h
+@@ -1054,7 +1054,7 @@ int mt7996_mcu_add_rate_ctrl(struct mt7996_dev *dev,
+ int mt7996_mcu_add_mld_sta(struct mt7996_dev *dev, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta, unsigned long add);
+ int mt7996_set_channel(struct mt7996_phy *phy, struct cfg80211_chan_def *chandef);
+-int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag);
++int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag, bool sta);
+ int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct mt7996_bss_conf *mconf);
+ int mt7996_mcu_set_fixed_rate_ctrl(struct mt7996_dev *dev,
+ void *data, u16 version);
+diff --git a/mt7996/testmode.c b/mt7996/testmode.c
+index 0565ebc9..8b35d125 100644
+--- a/mt7996/testmode.c
++++ b/mt7996/testmode.c
+@@ -544,7 +544,7 @@ mt7996_tm_dpd_prek_send_req(struct mt7996_phy *phy, struct mt7996_tm_req *req,
+
+ /* set channel switch reason */
+ mphy->hw->conf.flags |= IEEE80211_CONF_OFFCHANNEL;
+- mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH);
++ mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH, false);
+
+ ret = mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(TESTMODE_CTRL), req,
+ sizeof(*req), false);
+@@ -558,7 +558,7 @@ out:
+ mphy->hw->conf.flags &= ~IEEE80211_CONF_OFFCHANNEL;
+ memcpy(chandef, &chandef_backup, sizeof(struct cfg80211_chan_def));
+ memcpy(chandef->chan, &chan_backup, sizeof(struct ieee80211_channel));
+- mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH);
++ mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_SWITCH, false);
+
+ return ret;
+ }
+--
+2.18.0
+