[][MAC80211][mt76][refactor internal patches]

[Description]
Fix patch fails and build errors for rebasing the internal patches to
the latest mt76 codebase.

[Release-log]
N/A

Change-Id: I23d60090954fa9869a0e0222e3e045cc6d195271
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6144109
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1002-mt76-mt7915-csi-implement-csi-support.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1002-mt76-mt7915-csi-implement-csi-support.patch
index 44dc578..0b7a3be 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1002-mt76-mt7915-csi-implement-csi-support.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1002-mt76-mt7915-csi-implement-csi-support.patch
@@ -1,27 +1,27 @@
-From fac076082992f4e6bf576b44778ad6d5c37d9abd Mon Sep 17 00:00:00 2001
+From 776a9607718423c9cf52c08bc137d08820f1e2d1 Mon Sep 17 00:00:00 2001
 From: Bo Jiao <Bo.Jiao@mediatek.com>
 Date: Mon, 6 Jun 2022 20:13:02 +0800
-Subject: [PATCH 1002/1007] mt76: mt7915: csi: implement csi support
+Subject: [PATCH 1002/1008] mt76: mt7915: csi: implement csi support
 
 ---
- mt76_connac_mcu.h |   2 +
- mt7915/Makefile   |   4 +-
- mt7915/init.c     |  39 ++++
- mt7915/mcu.c      | 111 ++++++++++++
- mt7915/mcu.h      |  76 ++++++++
- mt7915/mt7915.h   |  20 ++
- mt7915/vendor.c   | 452 ++++++++++++++++++++++++++++++++++++++++++++++
- mt7915/vendor.h   |  60 ++++++
+ .../wireless/mediatek/mt76/mt76_connac_mcu.h  |   2 +
+ .../wireless/mediatek/mt76/mt7915/Makefile    |   4 +-
+ .../net/wireless/mediatek/mt76/mt7915/init.c  |  39 ++
+ .../net/wireless/mediatek/mt76/mt7915/mcu.c   | 111 +++++
+ .../net/wireless/mediatek/mt76/mt7915/mcu.h   |  76 +++
+ .../wireless/mediatek/mt76/mt7915/mt7915.h    |  20 +
+ .../wireless/mediatek/mt76/mt7915/vendor.c    | 452 ++++++++++++++++++
+ .../wireless/mediatek/mt76/mt7915/vendor.h    |  60 +++
  8 files changed, 762 insertions(+), 2 deletions(-)
- mode change 100755 => 100644 mt7915/mcu.c
- create mode 100644 mt7915/vendor.c
- create mode 100644 mt7915/vendor.h
+ mode change 100755 => 100644 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+ create mode 100644 drivers/net/wireless/mediatek/mt76/mt7915/vendor.c
+ create mode 100644 drivers/net/wireless/mediatek/mt76/mt7915/vendor.h
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 03134066..96591a8c 100644
+index 333d3a04..b25807a3 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
-@@ -820,6 +820,7 @@ enum {
+@@ -971,6 +971,7 @@ enum {
  	MCU_EXT_EVENT_CSA_NOTIFY = 0x4f,
  	MCU_EXT_EVENT_BCC_NOTIFY = 0x75,
  	MCU_EXT_EVENT_MURU_CTRL = 0x9f,
@@ -29,7 +29,7 @@
  };
  
  enum {
-@@ -990,6 +991,7 @@ enum {
+@@ -1141,6 +1142,7 @@ enum {
  	MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
  	MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac,
  	MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
@@ -55,10 +55,10 @@
  mt7915e-$(CONFIG_MT7986_WMAC) += soc.o
 \ No newline at end of file
 diff --git a/mt7915/init.c b/mt7915/init.c
-index 66884be0..258bb20a 100644
+index 8554c9dc..fa9568ca 100644
 --- a/mt7915/init.c
 +++ b/mt7915/init.c
-@@ -541,6 +541,12 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy)
+@@ -542,6 +542,12 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy)
  	/* init wiphy according to mphy and phy */
  	mt7915_init_wiphy(mphy->hw);
  
@@ -71,7 +71,7 @@
  	ret = mt76_register_phy(mphy, true, mt76_rates,
  				ARRAY_SIZE(mt76_rates));
  	if (ret)
-@@ -1030,6 +1036,25 @@ void mt7915_set_stream_he_caps(struct mt7915_phy *phy)
+@@ -1032,6 +1038,25 @@ void mt7915_set_stream_he_caps(struct mt7915_phy *phy)
  	}
  }
  
@@ -97,7 +97,7 @@
  static void mt7915_unregister_ext_phy(struct mt7915_dev *dev)
  {
  	struct mt7915_phy *phy = mt7915_ext_phy(dev);
-@@ -1038,6 +1063,10 @@ static void mt7915_unregister_ext_phy(struct mt7915_dev *dev)
+@@ -1040,6 +1065,10 @@ static void mt7915_unregister_ext_phy(struct mt7915_dev *dev)
  	if (!phy)
  		return;
  
@@ -108,7 +108,7 @@
  	mt7915_unregister_thermal(phy);
  	mt76_unregister_phy(mphy);
  	ieee80211_free_hw(mphy->hw);
-@@ -1050,6 +1079,10 @@ static void mt7915_stop_hardware(struct mt7915_dev *dev)
+@@ -1052,6 +1081,10 @@ static void mt7915_stop_hardware(struct mt7915_dev *dev)
  	mt7915_dma_cleanup(dev);
  	tasklet_disable(&dev->irq_tasklet);
  
@@ -119,7 +119,7 @@
  	if (is_mt7986(&dev->mt76))
  		mt7986_wmac_disable(dev);
  }
-@@ -1090,6 +1123,12 @@ int mt7915_register_device(struct mt7915_dev *dev)
+@@ -1092,6 +1125,12 @@ int mt7915_register_device(struct mt7915_dev *dev)
  	dev->mt76.test_ops = &mt7915_testmode_ops;
  #endif
  
@@ -135,10 +135,10 @@
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
 old mode 100755
 new mode 100644
-index 6ec321e1..18b05b2e
+index e4c5b40c..5e87db13
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -89,6 +89,10 @@ struct mt7915_fw_region {
+@@ -32,6 +32,10 @@
  #define HE_PHY(p, c)			u8_get_bits(c, IEEE80211_HE_PHY_##p)
  #define HE_MAC(m, c)			u8_get_bits(c, IEEE80211_HE_MAC_##m)
  
@@ -149,7 +149,7 @@
  static u8
  mt7915_mcu_get_sta_nss(u16 mcs_map)
  {
-@@ -453,6 +457,11 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
+@@ -351,6 +355,11 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
  	case MCU_EXT_EVENT_FW_LOG_2_HOST:
  		mt7915_mcu_rx_log_message(dev, skb);
  		break;
@@ -161,7 +161,7 @@
  	case MCU_EXT_EVENT_BCC_NOTIFY:
  		mt7915_mcu_rx_bcc_notify(dev, skb);
  		break;
-@@ -3737,6 +3746,108 @@ int mt7915_mcu_twt_agrt_update(struct mt7915_dev *dev,
+@@ -3444,6 +3453,108 @@ int mt7915_mcu_twt_agrt_update(struct mt7915_dev *dev,
  				 &req, sizeof(req), true);
  }
  
@@ -188,15 +188,15 @@
 +static int
 +mt7915_mcu_report_csi(struct mt7915_dev *dev, struct sk_buff *skb)
 +{
-+	struct mt7915_mcu_rxd *rxd = (struct mt7915_mcu_rxd *)skb->data;
++	struct mt76_connac2_mcu_rxd *rxd = (struct mt76_connac2_mcu_rxd *)skb->data;
 +	struct mt7915_phy *phy = &dev->phy;
 +	struct mt7915_mcu_csi_report *cr;
 +	struct csi_data *csi;
 +	int len, i;
 +
-+	skb_pull(skb, sizeof(struct mt7915_mcu_rxd));
++	skb_pull(skb, sizeof(struct mt76_connac2_mcu_rxd));
 +
-+	len = le16_to_cpu(rxd->len) - sizeof(struct mt7915_mcu_rxd) + 24;
++	len = le16_to_cpu(rxd->len) - sizeof(struct mt76_connac2_mcu_rxd) + 24;
 +	if (len < sizeof(*cr))
 +		return -EINVAL;
 +
@@ -271,10 +271,10 @@
  int mt7915_dbg_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3, bool wait_resp)
  {
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index 2f7007fd..cb854b28 100644
+index b2c51bfb..ec8887b5 100644
 --- a/mt7915/mcu.h
 +++ b/mt7915/mcu.h
-@@ -513,4 +513,80 @@ enum {
+@@ -476,4 +476,80 @@ enum {
  					 sizeof(struct bss_info_bcn_cont) + \
  					 sizeof(struct bss_info_inband_discovery))
  
@@ -356,10 +356,10 @@
 +
  #endif
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 001a6015..ff957425 100644
+index 2bc0e915..bab44e13 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -277,6 +277,20 @@ struct mt7915_phy {
+@@ -276,6 +276,20 @@ struct mt7915_phy {
  		u8 spe_idx;
  	} test;
  #endif
@@ -380,7 +380,7 @@
  };
  
  struct mt7915_dev {
-@@ -630,6 +644,12 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+@@ -614,6 +628,12 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
  			    struct ieee80211_sta *sta, struct dentry *dir);
  #endif
  
@@ -918,5 +918,5 @@
 +
 +#endif
 -- 
-2.18.0
+2.25.1