[Refactor and sync wifi from Openwrt]

[Description]
Refactor and sync wifi from Openwrt
1.mt76/mac80211/hostapd

[Release-log]
N/A

diff --git a/recipes-kernel/linux-mt76/files/patches/0012-mt76-mt7915-add-spatial-extension-index-support.patch b/recipes-kernel/linux-mt76/files/patches/0012-mt76-mt7915-add-spatial-extension-index-support.patch
index 45bdef4..7060348 100644
--- a/recipes-kernel/linux-mt76/files/patches/0012-mt76-mt7915-add-spatial-extension-index-support.patch
+++ b/recipes-kernel/linux-mt76/files/patches/0012-mt76-mt7915-add-spatial-extension-index-support.patch
@@ -1,18 +1,18 @@
-From ab47a5638c81b4e79bce84ea0c67cf5e89820e3b Mon Sep 17 00:00:00 2001
+From 7e339b883383bc9a54fddddbe3d56dbadffb5e49 Mon Sep 17 00:00:00 2001
 From: Shayne Chen <shayne.chen@mediatek.com>
 Date: Wed, 13 Jul 2022 10:43:16 +0800
 Subject: [PATCH] mt76: mt7915: add spatial extension index support
 
 Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
 ---
- .../net/wireless/mediatek/mt76/mt76_connac.h  | 11 ++++++++
- .../wireless/mediatek/mt76/mt76_connac_mac.c  | 11 +++++---
+ .../net/wireless/mediatek/mt76/mt76_connac.h  | 11 ++++++++++
+ .../wireless/mediatek/mt76/mt76_connac_mac.c  | 11 +++++++---
  .../wireless/mediatek/mt76/mt76_connac_mcu.h  |  2 +-
  .../net/wireless/mediatek/mt76/mt7915/main.c  |  3 ---
- .../net/wireless/mediatek/mt76/mt7915/mcu.c   | 26 +++++++++++++++++--
+ .../net/wireless/mediatek/mt76/mt7915/mcu.c   | 20 ++++++++++++++++++-
  .../net/wireless/mediatek/mt76/mt7915/mcu.h   |  1 +
- .../wireless/mediatek/mt76/mt7915/testmode.c  |  9 +++----
- 7 files changed, 48 insertions(+), 15 deletions(-)
+ .../wireless/mediatek/mt76/mt7915/testmode.c  |  9 +++------
+ 7 files changed, 43 insertions(+), 14 deletions(-)
 
 diff --git a/mt76_connac.h b/mt76_connac.h
 index 9070162c..5a9c1c97 100644
@@ -93,7 +93,7 @@
  
  	phy->mt76->antenna_mask = tx_ant;
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 6587be2f..03a3c252 100644
+index 6587be2f..c196d453 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -1306,6 +1306,9 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
@@ -106,22 +106,18 @@
  	default:
  		break;
  	}
-@@ -1348,6 +1351,22 @@ int mt7915_mcu_add_smps(struct mt7915_dev *dev, struct ieee80211_vif *vif,
+@@ -1348,6 +1351,18 @@ int mt7915_mcu_add_smps(struct mt7915_dev *dev, struct ieee80211_vif *vif,
  					      RATE_PARAM_MMPS_UPDATE);
  }
  
 +static int
 +mt7915_mcu_set_spe_idx(struct mt7915_dev *dev, struct ieee80211_vif *vif,
-+		       struct ieee80211_sta *sta, bool fixed_rate)
++		       struct ieee80211_sta *sta)
 +{
 +	struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
 +	struct mt76_phy *mphy = mvif->phy->mt76;
 +	u8 spe_idx = mt76_connac_spe_idx(mphy->antenna_mask);
 +
-+	if (!spe_idx && !fixed_rate &&
-+	    mphy->antenna_mask == mphy->hw->wiphy->available_antennas_tx)
-+		spe_idx = 24 + mvif->mt76.band_idx;
-+
 +	return mt7915_mcu_set_fixed_rate_ctrl(dev, vif, sta, &spe_idx,
 +					      RATE_PARAM_SPE_UPDATE);
 +}
@@ -129,25 +125,16 @@
  static int
  mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
  			       struct ieee80211_vif *vif,
-@@ -1393,7 +1412,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
- 	    mask->control[band].he_gi == GENMASK(7, 0) &&
- 	    mask->control[band].he_ltf == GENMASK(7, 0) &&
- 	    nrates != 1)
--		return 0;
-+		return mt7915_mcu_set_spe_idx(dev, vif, sta, false);
- 
- 	/* fixed single rate */
- 	if (nrates == 1) {
-@@ -1433,7 +1452,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
+@@ -1433,7 +1448,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
  			return ret;
  	}
  
 -	return 0;
-+	return mt7915_mcu_set_spe_idx(dev, vif, sta, true);
++	return mt7915_mcu_set_spe_idx(dev, vif, sta);
  }
  
  static void
-@@ -2649,6 +2668,9 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
+@@ -2649,6 +2664,9 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
  	}
  #endif