[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/0117-mtk-mt76-mt7996-Fix-get_txpower-wrong-result-in-sing.patch b/recipes-wifi/linux-mt76/files/patches-3.x/0117-mtk-mt76-mt7996-Fix-get_txpower-wrong-result-in-sing.patch
new file mode 100644
index 0000000..082b6a7
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/0117-mtk-mt76-mt7996-Fix-get_txpower-wrong-result-in-sing.patch
@@ -0,0 +1,64 @@
+From cae948de0db9841b932562c2283331155ff182f0 Mon Sep 17 00:00:00 2001
+From: Allen Ye <allen.ye@mediatek.com>
+Date: Mon, 8 Apr 2024 16:56:09 +0800
+Subject: [PATCH 117/199] mtk: mt76: mt7996: Fix get_txpower wrong result in
+ single wiphy and legacy mode
+
+Fix get_txpower wrong result in single wiphy and legacy mode.
+ieee80211_hw is get from wiphy0, so we need to get correct phy from vif.
+
+Temporarily use link 0 bss due to mac80211 didn't pass link id here.
+
+---
+ mt7996/main.c | 28 +++++++++++++++++++++++++++-
+ 1 file changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/mt7996/main.c b/mt7996/main.c
+index 155318b3..7e56f4b0 100644
+--- a/mt7996/main.c
++++ b/mt7996/main.c
+@@ -982,6 +982,32 @@ out:
+ mutex_unlock(&dev->mt76.mutex);
+ }
+
++int mt7996_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
++ int *dbm)
++{
++ struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
++ struct mt7996_bss_conf *mconf;
++ struct mt7996_dev *dev = mt7996_hw_dev(hw);
++ struct mt76_phy *mphy;
++ int delta;
++
++ mutex_lock(&dev->mt76.mutex);
++ mconf = mconf_dereference_protected(mvif, mvif->master_link_id);
++ if (!mconf || !mconf->phy) {
++ *dbm = 0;
++ goto out;
++ }
++
++ mphy = mconf->phy->mt76;
++
++ delta = mt76_tx_power_nss_delta(hweight16(mphy->chainmask));
++
++ *dbm = DIV_ROUND_UP(mphy->txpower_cur + delta, 2);
++out:
++ mutex_unlock(&dev->mt76.mutex);
++ return 0;
++}
++
+ static void
+ mt7996_channel_switch_beacon(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+@@ -2669,7 +2695,7 @@ const struct ieee80211_ops mt7996_ops = {
+ .hw_scan = mt7996_hw_scan,
+ .cancel_hw_scan = mt7996_cancel_hw_scan,
+ .release_buffered_frames = mt76_release_buffered_frames,
+- .get_txpower = mt76_get_txpower,
++ .get_txpower = mt7996_get_txpower,
+ .channel_switch_beacon = mt7996_channel_switch_beacon,
+ .get_stats = mt7996_get_stats,
+ .get_et_sset_count = mt7996_get_et_sset_count,
+--
+2.18.0
+