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

[Description]
ced8594f [MAC80211][WiFi6][Misc][Fix the MT76 WiFi6 Makefile]
7221999e [MAC80211][WiFi7][Misc][Correct the MAC80211 WiFi7 Makefile.]
9d87794a [MAC80211][WiFi7][Misc][Correct the MT76 WiFi7 Makefile.]
ff24e1b2 [openwrt-24][Mac80211][Fix patch conflict with upstream openwrt]
3a6c13e2 [mac80211][misc][fix patch fail due to openwrt update]
05763faa [MAC80211][WiFi7][misc][fix patch failed of wifi-scripts]
f34fd014 [mac80211][misc][fix patch fail due to openwrt update]
f6796660 [openwrt-24][Release][Fix build fail of Wi-Fi7 MT76]
7076d96c [MAC80211][WiFi7][Misc][Fix release build fail because of mt76 version upgradation]
1f748b17 [mac80211][misc][fix patch fail due to openwrt update]
95ba6722 [mac80211][misc][fix patch fail due to openwrt update]
17680d7f [MAC80211][WiFi7][misc][Rename eeprom of eFEM variants]
b97cefa1 [MAC80211][WiFi7][app][Add Griffin support for atenl/iwpriv]
6de718a4 [MAC80211][WiFi7][misc][fix wifi-scripts patch failed]
9f1ace86 [MAC80211][WiFi7][misc][fix hostapd Makefile patch]
e4d0d28e [MAC80211][Misc][Add MT7990 Firmware OpenWrt config]
f3a8a8f7 [MAC80211][Release][Fix build fail of Wi-Fi6 MT76]
dabe8eae [openwrt-24][common][bsp][Fix line ending]
6d438a9d [openwrt-24][common][bsp][Use zstd to compress rootfs debug symbols for unified autobuild]
c268e47e [openwrt][common][bsp][Change SMC ID of wdt nonrst reg of reset-boot-count to 0x570]
c6819fbc [openwrt-24][Release][Update release note for Filogic 880 alpha release]
6897b4de [openwrt-24][common][bsp][Adjust unified autobuild for internal build detection]
fb9b9762 [MAC80211][WiFi6/7][app][Add ext eeprom write back cmd support]
d42b42a3 [openwrt-24][common][bsp][Add kernel6.6 Filogic880 BE19000/BE14000]
3806f047 [MAC80211][misc][Add Bpi-R4 support]
ddbda753 [MAC80211][WiFi7][Misc][Fix build fail because of mt76 version upgradation]
90959b08 [MAC80211][WiFi6][mt76][Rebase mt76 pathes]
728a3362 [MAC80211][WiFi6][mt76][Refactor Qos Map]
b46277b5 [MAC80211][WiFi6][mt76][Fix add ba issue on tid not equal to zero]
c084ee8b [MAC80211][WiFi7][mt76][split mt76 Makefile patch]
bbaec094 [MAC80211][Release][Update Filogic 830/820/630 firmware]
5ce2eece [MAC80211][wifi6][MT76][Fix build fail]
5ac1121f [MAC80211][wifi6][MT76][Fix mt76 version to 2024-07-13]
485f92b1 [MAC80211][WiFi7][misc][synchronize PP bitmap when association]
84db8818 [MAC80211][WiFi6/7][app][Add ATETXNSS in iwpriv wrapper]
cc5a4605 [MAC80211][WiFi7][mt76][fix patch failed of Makefile]

[Release-log]

Change-Id: I06704c04c4b5571af4ffd189d636c1fc9f0567fd
diff --git a/recipes-wifi/linux-mt76/files/patches-3.x/0091-mtk-mt76-rework-connac-helpers.patch b/recipes-wifi/linux-mt76/files/patches-3.x/0091-mtk-mt76-rework-connac-helpers.patch
new file mode 100644
index 0000000..b1e017c
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/0091-mtk-mt76-rework-connac-helpers.patch
@@ -0,0 +1,174 @@
+From 2e58003c154277e36f759a53975c61cbecb9af02 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Mon, 11 Dec 2023 18:45:00 +0800
+Subject: [PATCH 091/223] mtk: mt76: rework connac helpers
+
+Rework connac helpers related to rate and phymode.
+This is a preliminary patch to add MLO support for mt7996 chipsets.
+
+Co-developed-by: Bo Jiao <Bo.Jiao@mediatek.com>
+Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+---
+ mt76_connac.h     |  2 +-
+ mt76_connac_mac.c | 17 ++++++++---------
+ mt76_connac_mcu.c |  6 +++---
+ mt76_connac_mcu.h |  2 +-
+ mt7925/main.c     |  2 +-
+ mt7996/main.c     |  2 +-
+ mt7996/mcu.c      |  2 +-
+ 7 files changed, 16 insertions(+), 17 deletions(-)
+
+diff --git a/mt76_connac.h b/mt76_connac.h
+index 445d0f0a..f7766a98 100644
+--- a/mt76_connac.h
++++ b/mt76_connac.h
+@@ -427,7 +427,7 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
+ 				 struct ieee80211_key_conf *key, int pid,
+ 				 enum mt76_txq_id qid, u32 changed);
+ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
+-				 struct ieee80211_vif *vif,
++				 struct ieee80211_bss_conf *conf,
+ 				 bool beacon, bool mcast);
+ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
+ 			       __le32 *txs_data);
+diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
+index a72551ba..e58570c2 100644
+--- a/mt76_connac_mac.c
++++ b/mt76_connac_mac.c
+@@ -291,12 +291,11 @@ EXPORT_SYMBOL_GPL(mt76_connac_init_tx_queues);
+ })
+ 
+ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
+-				 struct ieee80211_vif *vif,
++				 struct ieee80211_bss_conf *conf,
+ 				 bool beacon, bool mcast)
+ {
+-	struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
+-	struct cfg80211_chan_def *chandef = mvif->ctx ?
+-					    &mvif->ctx->def : &mphy->chandef;
++	struct ieee80211_vif *vif = conf->vif;
++	struct cfg80211_chan_def *chandef = &mphy->chandef;
+ 	u8 nss = 0, mode = 0, band = chandef->chan->band;
+ 	int rateidx = 0, mcast_rate;
+ 	int offset = 0;
+@@ -305,14 +304,14 @@ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
+ 		goto legacy;
+ 
+ 	if (is_mt7921(mphy->dev)) {
+-		rateidx = ffs(vif->bss_conf.basic_rates) - 1;
++		rateidx = ffs(conf->basic_rates) - 1;
+ 		goto legacy;
+ 	}
+ 
+ 	if (beacon) {
+ 		struct cfg80211_bitrate_mask *mask;
+ 
+-		mask = &vif->bss_conf.beacon_tx_rate;
++		mask = &conf->beacon_tx_rate;
+ 
+ 		__bitrate_mask_check(he_mcs, HE_SU);
+ 		__bitrate_mask_check(vht_mcs, VHT);
+@@ -324,11 +323,11 @@ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
+ 		}
+ 	}
+ 
+-	mcast_rate = vif->bss_conf.mcast_rate[band];
++	mcast_rate = conf->mcast_rate[band];
+ 	if (mcast && mcast_rate > 0)
+ 		rateidx = mcast_rate - 1;
+ 	else
+-		rateidx = ffs(vif->bss_conf.basic_rates) - 1;
++		rateidx = ffs(conf->basic_rates) - 1;
+ 
+ legacy:
+ 	if (band != NL80211_BAND_2GHZ)
+@@ -581,7 +580,7 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
+ 		struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ 		bool multicast = ieee80211_is_data(hdr->frame_control) &&
+ 				 is_multicast_ether_addr(hdr->addr1);
+-		u16 rate = mt76_connac2_mac_tx_rate_val(mphy, vif, beacon,
++		u16 rate = mt76_connac2_mac_tx_rate_val(mphy, &vif->bss_conf, beacon,
+ 							multicast);
+ 		u32 val = MT_TXD6_FIXED_BW;
+ 
+diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
+index 0c89222b..e4e6c0d3 100644
+--- a/mt76_connac_mcu.c
++++ b/mt76_connac_mcu.c
+@@ -1368,7 +1368,7 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
+ }
+ EXPORT_SYMBOL_GPL(mt76_connac_get_phy_mode);
+ 
+-u8 mt76_connac_get_phy_mode_ext(struct mt76_phy *phy, struct ieee80211_vif *vif,
++u8 mt76_connac_get_phy_mode_ext(struct mt76_phy *phy, struct ieee80211_bss_conf *conf,
+ 				enum nl80211_band band)
+ {
+ 	const struct ieee80211_sta_eht_cap *eht_cap;
+@@ -1379,9 +1379,9 @@ u8 mt76_connac_get_phy_mode_ext(struct mt76_phy *phy, struct ieee80211_vif *vif,
+ 		mode |= PHY_MODE_AX_6G;
+ 
+ 	sband = phy->hw->wiphy->bands[band];
+-	eht_cap = ieee80211_get_eht_iftype_cap(sband, vif->type);
++	eht_cap = ieee80211_get_eht_iftype_cap(sband, conf->vif->type);
+ 
+-	if (!eht_cap || !eht_cap->has_eht || !vif->bss_conf.eht_support)
++	if (!eht_cap || !eht_cap->has_eht || !conf->eht_support)
+ 		return mode;
+ 
+ 	switch (band) {
+diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
+index ff8a314c..1dcd1696 100644
+--- a/mt76_connac_mcu.h
++++ b/mt76_connac_mcu.h
+@@ -2041,7 +2041,7 @@ mt76_connac_get_eht_phy_cap(struct mt76_phy *phy, struct ieee80211_vif *vif);
+ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
+ 			    enum nl80211_band band,
+ 			    struct ieee80211_link_sta *sta);
+-u8 mt76_connac_get_phy_mode_ext(struct mt76_phy *phy, struct ieee80211_vif *vif,
++u8 mt76_connac_get_phy_mode_ext(struct mt76_phy *phy, struct ieee80211_bss_conf *conf,
+ 				enum nl80211_band band);
+ 
+ int mt76_connac_mcu_add_key(struct mt76_dev *dev, struct ieee80211_vif *vif,
+diff --git a/mt7925/main.c b/mt7925/main.c
+index 791c8b00..147b71e7 100644
+--- a/mt7925/main.c
++++ b/mt7925/main.c
+@@ -806,7 +806,7 @@ mt7925_get_rates_table(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ 	u16 rate;
+ 	u8 i, idx, ht;
+ 
+-	rate = mt76_connac2_mac_tx_rate_val(mphy, vif, beacon, mcast);
++	rate = mt76_connac2_mac_tx_rate_val(mphy, &vif->bss_conf, beacon, mcast);
+ 	ht = FIELD_GET(MT_TX_RATE_MODE, rate) > MT_PHY_TYPE_OFDM;
+ 
+ 	if (beacon && ht) {
+diff --git a/mt7996/main.c b/mt7996/main.c
+index cadfee9f..68234032 100644
+--- a/mt7996/main.c
++++ b/mt7996/main.c
+@@ -802,7 +802,7 @@ mt7996_get_rates_table(struct ieee80211_hw *hw, struct ieee80211_bss_conf *conf,
+ 	u16 rate;
+ 	u8 i, idx;
+ 
+-	rate = mt76_connac2_mac_tx_rate_val(mphy, conf->vif, beacon, mcast);
++	rate = mt76_connac2_mac_tx_rate_val(mphy, conf, beacon, mcast);
+ 
+ 	if (beacon) {
+ 		struct mt7996_phy *phy = mphy->priv;
+diff --git a/mt7996/mcu.c b/mt7996/mcu.c
+index 7b77cab2..edaf8814 100644
+--- a/mt7996/mcu.c
++++ b/mt7996/mcu.c
+@@ -1224,7 +1224,7 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *conf,
+ 	bss->dtim_period = conf->dtim_period;
+ 	bss->phymode = mt76_connac_get_phy_mode(phy, vif,
+ 						chandef->chan->band, NULL);
+-	bss->phymode_ext = mt76_connac_get_phy_mode_ext(phy, vif,
++	bss->phymode_ext = mt76_connac_get_phy_mode_ext(phy, conf,
+ 							chandef->chan->band);
+ 
+ 	return 0;
+-- 
+2.45.2
+