[rdkb][common][bsp][Refactor and sync wifi from openwrt]

[Description]
5a7bd025 [MAC80211][WiFi6][misc][Add mt7981 default eeprom bin]
0a22f8f4 [MAC80211][WiFi7][misc][fix mt7988-mt7996-mac980211 release build fail]
f59b5dad [MAC80211][WiFi6][mt76][Add additional chain signal info in station dump for merlin]
fada400d [MAC80211][WiFi6/7][mt76][Add HT40- capab when enable ACS]
98e273af [MAC80211][WiFi6/7][app][Add SKU_EN & RSSI ATTR in atenl]
aaa8eb14 [MAC80211][WiFi6][mt76][Add rssi & sku_en in testmode]
eda14aac [MAC80211][core][Remove wrong assignment on the variable "changed" when changing beacon]
8528fc00 [MAC80211][misc][Refactor wed/flowblock/mtk_ppe patches]
000329aa [MAC80211][netifd][Move netifd patch for wifi7 used only]
57bfe0c7 [MAC80211][WiFi6][misc][fix build fail due to mt76 upgration]
fa29bb39 [MAC80211][wifi6/7][mt76][update mt76 Makefile]
56f497ec [MAC80211][netifd][not to cache previous config to avoid wifi down failure]
be9abd4d [MAC80211][WiFi6][misc][fix build fail due to netifd]
af71e303 [MAC80211][WiFi6][mt76][Fix inconsistent BSS group setting of STA for VoW]
3e42972a [MAC80211][WiFi6][mt76][Fix txpower bbp CR]
81a68c03 [MAC80211][wifi7][hostapd][rebase internal hostapd patches]
336300b7 [MAC80211][WiFi6/7][hostapd][MAX 48 mbss 6G 连线概率连不上 ]
6bebc554 [MAC80211][wifi7][core][update for backports v6.5]
55eeab91 [MAC80211][wed][change wed hw tx token to 8K]
19daecfd [MAC80211][wifi7][ucode][Bandwidth Synchronization in AP/STA Mode]
ddf64afb [MAC80211][mt76][add debug log in SER flow]
44611a77 [mac80211][wifi6][mt76][Enhance debug log]

[Release-log]

Change-Id: Ie5aa3a03de56585d8ee90b22fec724adedacb5d9
diff --git a/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-mt7915-rework-init-txpower.patch b/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-mt7915-rework-init-txpower.patch
new file mode 100644
index 0000000..e6ddc58
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-mt7915-rework-init-txpower.patch
@@ -0,0 +1,121 @@
+From 5fe1dd7724e7af4cb508af3147ddc9e1f12d2dc7 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Mon, 31 Jul 2023 11:07:35 +0800
+Subject: [PATCH 5/7] wifi: mt76: mt7915: rework init txpower
+
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+---
+ mt7915/init.c   | 30 ++++++++++++++++++++----------
+ mt7915/mac.c    |  4 ++--
+ mt7915/mt7915.h |  3 +--
+ 3 files changed, 23 insertions(+), 14 deletions(-)
+
+diff --git a/mt7915/init.c b/mt7915/init.c
+index d8fd8d6..0d2587c 100644
+--- a/mt7915/init.c
++++ b/mt7915/init.c
+@@ -275,10 +275,11 @@ static void mt7915_led_set_brightness(struct led_classdev *led_cdev,
+ 		mt7915_led_set_config(led_cdev, 0xff, 0);
+ }
+ 
+-void mt7915_init_txpower(struct mt7915_dev *dev,
+-			 struct ieee80211_supported_band *sband)
++void __mt7915_init_txpower(struct mt7915_phy *phy,
++			   struct ieee80211_supported_band *sband)
+ {
+-	int i, n_chains = hweight16(dev->mphy.chainmask);
++	struct mt7915_dev *dev = phy->dev;
++	int i, n_chains = hweight16(phy->mt76->chainmask);
+ 	int nss_delta = mt76_tx_power_nss_delta(n_chains);
+ 	int pwr_delta = mt7915_eeprom_get_power_delta(dev, sband->band);
+ 	struct mt76_power_limits limits;
+@@ -296,7 +297,7 @@ void mt7915_init_txpower(struct mt7915_dev *dev,
+ 		}
+ 
+ 		target_power += pwr_delta;
+-		target_power = mt76_get_rate_power_limits(&dev->mphy, chan,
++		target_power = mt76_get_rate_power_limits(phy->mt76, chan,
+ 							  &limits,
+ 							  target_power);
+ 		target_power += nss_delta;
+@@ -307,6 +308,19 @@ void mt7915_init_txpower(struct mt7915_dev *dev,
+ 	}
+ }
+ 
++void mt7915_init_txpower(struct mt7915_phy *phy)
++{
++	if (!phy)
++		return;
++
++	if (phy->mt76->cap.has_2ghz)
++		__mt7915_init_txpower(phy, &phy->mt76->sband_2g.sband);
++	if (phy->mt76->cap.has_5ghz)
++		__mt7915_init_txpower(phy, &phy->mt76->sband_5g.sband);
++	if (phy->mt76->cap.has_6ghz)
++		__mt7915_init_txpower(phy, &phy->mt76->sband_6g.sband);
++}
++
+ static void
+ mt7915_regd_notifier(struct wiphy *wiphy,
+ 		     struct regulatory_request *request)
+@@ -322,9 +336,7 @@ mt7915_regd_notifier(struct wiphy *wiphy,
+ 	if (dev->mt76.region == NL80211_DFS_UNSET)
+ 		mt7915_mcu_rdd_background_enable(phy, NULL);
+ 
+-	mt7915_init_txpower(dev, &mphy->sband_2g.sband);
+-	mt7915_init_txpower(dev, &mphy->sband_5g.sband);
+-	mt7915_init_txpower(dev, &mphy->sband_6g.sband);
++	mt7915_init_txpower(phy);
+ 
+ 	mphy->dfs_state = MT_DFS_STATE_UNKNOWN;
+ 	mt7915_dfs_init_radar_detector(phy);
+@@ -445,6 +457,7 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
+ 	mt76_set_stream_caps(phy->mt76, true);
+ 	mt7915_set_stream_vht_txbf_caps(phy);
+ 	mt7915_set_stream_he_caps(phy);
++	mt7915_init_txpower(phy);
+ 
+ 	wiphy->available_antennas_rx = phy->mt76->antenna_mask;
+ 	wiphy->available_antennas_tx = phy->mt76->antenna_mask;
+@@ -708,9 +721,6 @@ static void mt7915_init_work(struct work_struct *work)
+ 
+ 	mt7915_mcu_set_eeprom(dev);
+ 	mt7915_mac_init(dev);
+-	mt7915_init_txpower(dev, &dev->mphy.sband_2g.sband);
+-	mt7915_init_txpower(dev, &dev->mphy.sband_5g.sband);
+-	mt7915_init_txpower(dev, &dev->mphy.sband_6g.sband);
+ 	mt7915_txbf_init(dev);
+ }
+ 
+diff --git a/mt7915/mac.c b/mt7915/mac.c
+index d81fae9..a9bdb65 100644
+--- a/mt7915/mac.c
++++ b/mt7915/mac.c
+@@ -1395,8 +1395,8 @@ mt7915_mac_restart(struct mt7915_dev *dev)
+ 		goto out;
+ 
+ 	mt7915_mac_init(dev);
+-	mt7915_init_txpower(dev, &dev->mphy.sband_2g.sband);
+-	mt7915_init_txpower(dev, &dev->mphy.sband_5g.sband);
++	mt7915_init_txpower(&dev->phy);
++	mt7915_init_txpower(phy2);
+ 	ret = mt7915_txbf_init(dev);
+ 
+ 	if (test_bit(MT76_STATE_RUNNING, &dev->mphy.state)) {
+diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
+index 2c5d929..4293385 100644
+--- a/mt7915/mt7915.h
++++ b/mt7915/mt7915.h
+@@ -430,8 +430,7 @@ void mt7915_dma_cleanup(struct mt7915_dev *dev);
+ int mt7915_dma_reset(struct mt7915_dev *dev, bool force);
+ int mt7915_dma_start(struct mt7915_dev *dev, bool reset, bool wed_reset);
+ int mt7915_txbf_init(struct mt7915_dev *dev);
+-void mt7915_init_txpower(struct mt7915_dev *dev,
+-			 struct ieee80211_supported_band *sband);
++void mt7915_init_txpower(struct mt7915_phy *phy);
+ void mt7915_reset(struct mt7915_dev *dev);
+ int mt7915_run(struct ieee80211_hw *hw);
+ int mt7915_mcu_init(struct mt7915_dev *dev);
+-- 
+2.18.0
+