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

[Description]
535edd63 [MAC80211][mt76][update debug patch]
326a55a3 [MAC80211][Rebase Patches][mt76 build fail]
bb5dace6 [MAC80211][wed][fix ind cmd int fail after ser]
d5ecd7f9 [mac80211][mt76][Fix WFDMA setting]
cbc895ac [MAC80211][misc][Fix condiction of check default bin]
1bc12c1f [MAC80211][misc][Add omcproxy package for IGMP feature]
dff3e670 [mac80211][Rebase][rebase to the latest codebase]
ffdcb6aa [MAC80211][Rebase Patches][update internal patches based on mt76-2023-06-22-29cfabbb]
136f0006 [MAC80211][hostapd][Add EDCCA BW_160 support]
c74da51a [MAC80211][misc][Fix mac address issues]

[Release-log]

Change-Id: I4fc2286827638fc5fa4b7a714c624ebf05f5e3d0
diff --git a/recipes-wifi/linux-mt76/files/patches/1025-wifi-mt76-mt7915-amsdu-set-and-get-control.patch b/recipes-wifi/linux-mt76/files/patches/1025-wifi-mt76-mt7915-amsdu-set-and-get-control.patch
new file mode 100644
index 0000000..731ee05
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/1025-wifi-mt76-mt7915-amsdu-set-and-get-control.patch
@@ -0,0 +1,139 @@
+From 7815bd8d3b07c67262190fb085ad123e3b402d63 Mon Sep 17 00:00:00 2001
+From: TomLiu <tomml.liu@mediatek.com>
+Date: Wed, 14 Dec 2022 00:44:07 -0800
+Subject: [PATCH 1025/1031] wifi: mt76: mt7915: amsdu set and get control
+
+---
+ mt7915/mac.c    |  7 +++++++
+ mt7915/mt7915.h |  1 +
+ mt7915/vendor.c | 30 ++++++++++++++++++++++++++++++
+ mt7915/vendor.h | 12 ++++++++++++
+ 4 files changed, 50 insertions(+)
+
+diff --git a/mt7915/mac.c b/mt7915/mac.c
+index 4dfbc0c..436fc31 100644
+--- a/mt7915/mac.c
++++ b/mt7915/mac.c
+@@ -2032,6 +2032,13 @@ static void mt7915_mac_sta_stats_work(struct mt7915_phy *phy)
+ 	spin_unlock_bh(&phy->stats_lock);
+ }
+ 
++void mt7915_set_wireless_amsdu(struct ieee80211_hw *hw, u8 en) {
++	if (en)
++		ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU);
++	else
++		ieee80211_hw_clear(hw, SUPPORTS_AMSDU_IN_AMPDU);
++}
++
+ #ifdef CONFIG_MTK_VENDOR
+ void mt7915_capi_sta_rc_work(void *data, struct ieee80211_sta *sta)
+ {
+diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
+index 7584d1f..10c1cba 100644
+--- a/mt7915/mt7915.h
++++ b/mt7915/mt7915.h
+@@ -682,6 +682,7 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
+ 			 bool pci, int *irq);
+ 
+ #ifdef CONFIG_MTK_VENDOR
++void mt7915_set_wireless_amsdu(struct ieee80211_hw *hw, u8 en);
+ void mt7915_capi_sta_rc_work(void *data, struct ieee80211_sta *sta);
+ void mt7915_set_wireless_vif(void *data, u8 *mac, struct ieee80211_vif *vif);
+ void mt7915_mcu_set_rfeature_starec(void *data, struct mt7915_dev *dev,
+diff --git a/mt7915/vendor.c b/mt7915/vendor.c
+index b661ea4..0105d2f 100644
+--- a/mt7915/vendor.c
++++ b/mt7915/vendor.c
+@@ -30,10 +30,16 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
+ 	[MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA] = {.type = NLA_U8 },
+ 	[MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO] = {.type = NLA_U8 },
+ 	[MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE] = {.type = NLA_U16 },
++	[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU] = {.type = NLA_U8 },
+ 	[MTK_VENDOR_ATTR_WIRELESS_CTRL_MU_EDCA] = {.type = NLA_U8 },
+ 	[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 },
+ };
+ 
++static const struct nla_policy
++wireless_dump_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP] = {
++	[MTK_VENDOR_ATTR_WIRELESS_DUMP_AMSDU] = { .type = NLA_U8 },
++};
++
+ static const struct nla_policy
+ mu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_MU_CTRL] = {
+ 	[MTK_VENDOR_ATTR_MU_CTRL_ONOFF] = {.type = NLA_U8 },
+@@ -985,11 +991,34 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
+ 		val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT]);
+ 		mt7915_mcu_set_cfg(phy, CFGINFO_CERT_CFG, val8); /* Cert Enable for OMI */
+ 		mt7915_mcu_set_bypass_smthint(phy, val8); /* Cert bypass smooth interpolation */
++	} else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU]) {
++		val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU]);
++		mt7915_set_wireless_amsdu(hw, val8);
+ 	}
+ 
+ 	return 0;
+ }
+ 
++static int
++mt7915_vendor_wireless_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
++			     struct sk_buff *skb, const void *data, int data_len,
++			     unsigned long *storage)
++{
++	struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
++	int len = 0;
++
++	if (*storage == 1)
++		return -ENOENT;
++	*storage = 1;
++
++	if (nla_put_u8(skb,
++	    MTK_VENDOR_ATTR_WIRELESS_DUMP_AMSDU, ieee80211_hw_check(hw, SUPPORTS_AMSDU_IN_AMPDU)))
++		return -ENOMEM;
++	len += 2;
++
++	return len;
++}
++
+ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
+ 				  struct wireless_dev *wdev,
+ 				  const void *data,
+@@ -1288,6 +1317,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
+ 		.flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
+ 			WIPHY_VENDOR_CMD_NEED_RUNNING,
+ 		.doit = mt7915_vendor_wireless_ctrl,
++		.dumpit = mt7915_vendor_wireless_ctrl_dump,
+ 		.policy = wireless_ctrl_policy,
+ 		.maxattr = MTK_VENDOR_ATTR_WIRELESS_CTRL_MAX,
+ 	},
+diff --git a/mt7915/vendor.h b/mt7915/vendor.h
+index a6309a3..33c75dc 100644
+--- a/mt7915/vendor.h
++++ b/mt7915/vendor.h
+@@ -74,6 +74,7 @@ enum mtk_vendor_attr_wireless_ctrl {
+ 	MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA,
+ 	MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE,
+ 	MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO,
++	MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU,
+ 	MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT = 9,
+ 
+ 	MTK_VENDOR_ATTR_WIRELESS_CTRL_MU_EDCA, /* reserve */
+@@ -83,6 +84,17 @@ enum mtk_vendor_attr_wireless_ctrl {
+ 		NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL - 1
+ };
+ 
++enum mtk_vendor_attr_wireless_dump {
++	MTK_VENDOR_ATTR_WIRELESS_DUMP_UNSPEC,
++
++	MTK_VENDOR_ATTR_WIRELESS_DUMP_AMSDU,
++
++	/* keep last */
++	NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP,
++	MTK_VENDOR_ATTR_WIRELESS_DUMP_MAX =
++		NUM_MTK_VENDOR_ATTRS_WIRELESS_DUMP - 1
++};
++
+ enum mtk_vendor_attr_mu_ctrl {
+ 	MTK_VENDOR_ATTR_MU_CTRL_UNSPEC,
+ 
+-- 
+2.18.0
+