[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
ac60b1ff [MAC80211][misc][Add Filogic 880/860/830/820/630 Release Information]
7eb946a0 [MAC80211][WiFi7][hostapd][sync hostapd patches]
91638fc9 [MAC80211][WiFi7][mac80211][sync backports code]
8e45746b [MAC80211][WiFi7][mt76][sync mt76 patches]
1c564afa [MAC80211][WiFi7][mt76][Add Eagle BE19000 ifem default bin]
[Release-log]
Change-Id: I1d4218d3b1211700acb5937fe310cbd0bf219968
diff --git a/recipes-wifi/linux-mt76/files/patches-3.x/0113-wifi-mt76-mt7996-Fix-get_txpower-wrong-result-in-sin.patch b/recipes-wifi/linux-mt76/files/patches-3.x/0113-wifi-mt76-mt7996-Fix-get_txpower-wrong-result-in-sin.patch
new file mode 100644
index 0000000..7b9c302
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/0113-wifi-mt76-mt7996-Fix-get_txpower-wrong-result-in-sin.patch
@@ -0,0 +1,66 @@
+From 4449a5a89e46ab7ce56ca6313fda11c6767dde8d 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 113/116] wifi: 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.
+
+CR-Id: WCNCR00259302
+Change-Id: I306897ded276b0e5aee191339f18f0f25ca322f2
+---
+ mt7996/main.c | 28 +++++++++++++++++++++++++++-
+ 1 file changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/mt7996/main.c b/mt7996/main.c
+index e37f0c013..7abee0c57 100644
+--- a/mt7996/main.c
++++ b/mt7996/main.c
+@@ -975,6 +975,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,
+@@ -2635,7 +2661,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.39.2
+