[][MAC80211][mt76][Add eBF/iBF certification and calibration with golden]

[Description]
Add eBF certification commands with golden device
Add iBF calibration and verification commands with golden device
Add normal mode bf station record and pfmu tag dump command via debugfs
Fix BW display error in debugfs tmac info dump function

[Release-log]
N/A

Change-Id: I992f52b439cfa467e159dbe54285a902087da5db
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6929902
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/3010-mt76-mt7915-wed-HW-ATF-support-for-mt7986.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/3010-mt76-mt7915-wed-HW-ATF-support-for-mt7986.patch
index b26bd9f..d9f759b 100755
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/3010-mt76-mt7915-wed-HW-ATF-support-for-mt7986.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/3010-mt76-mt7915-wed-HW-ATF-support-for-mt7986.patch
@@ -1,4 +1,4 @@
-From c510cd542b26e25208aed3a07b8a653fd8d36276 Mon Sep 17 00:00:00 2001
+From 829e658c7cfa9b9b0180495b8b791d11be7cc537 Mon Sep 17 00:00:00 2001
 From: Lian Chen <lian.chen@mediatek.com>
 Date: Mon, 7 Nov 2022 14:47:44 +0800
 Subject: [PATCH 3010/3012] mt76: mt7915: wed: HW ATF support for mt7986
@@ -8,15 +8,15 @@
  mt76_connac_mcu.h    |   2 +
  mt7915/debugfs.c     | 405 +++++++++++++++++++++++++++++++++++++++++++
  mt7915/init.c        |  39 +++++
- mt7915/main.c        |  16 ++
+ mt7915/main.c        |  15 ++
  mt7915/mcu.c         | 165 ++++++++++++++++++
  mt7915/mt7915.h      |  68 ++++++++
  mt7915/mtk_debugfs.c | 133 +++++++++++++-
- 7 files changed, 827 insertions(+), 1 deletion(-)
+ 7 files changed, 826 insertions(+), 1 deletion(-)
  mode change 100644 => 100755 mt7915/init.c
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 98b00747..239643b9 100644
+index 98b0074..239643b 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -1159,6 +1159,7 @@ enum {
@@ -36,7 +36,7 @@
  	MCU_EXT_CMD_EFUSE_FREE_BLOCK = 0x4f,
  	MCU_EXT_CMD_TX_POWER_FEATURE_CTRL = 0x58,
 diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
-index 3ef2148b..b178036c 100644
+index 3ef2148..b178036 100644
 --- a/mt7915/debugfs.c
 +++ b/mt7915/debugfs.c
 @@ -12,6 +12,10 @@
@@ -468,7 +468,7 @@
 diff --git a/mt7915/init.c b/mt7915/init.c
 old mode 100644
 new mode 100755
-index e044f503..ef752e10
+index e044f50..ef752e1
 --- a/mt7915/init.c
 +++ b/mt7915/init.c
 @@ -563,10 +563,46 @@ mt7915_init_led_mux(struct mt7915_dev *dev)
@@ -529,29 +529,28 @@
  
  int mt7915_txbf_init(struct mt7915_dev *dev)
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 37852cd0..8965e8c2 100644
+index 7dd3973..c87f04b 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -210,6 +210,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
+@@ -209,6 +209,7 @@ int mt7915_init_vif(struct mt7915_phy *phy, struct ieee80211_vif *vif, bool bf_e
  {
  	struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
- 	struct mt7915_dev *dev = mt7915_hw_dev(hw);
+ 	struct mt7915_dev *dev = phy->dev;
 +	struct wiphy *wiphy = dev->phy.mt76->hw->wiphy;
- 	struct mt7915_phy *phy = mt7915_hw_phy(hw);
  	struct mt76_txq *mtxq;
  	bool ext_phy = phy != &dev->phy;
-@@ -279,6 +280,10 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
+ 	int idx, ret = 0;
+@@ -270,6 +271,9 @@ int mt7915_init_vif(struct mt7915_phy *phy, struct ieee80211_vif *vif, bool bf_e
  	mt7915_mcu_add_sta(dev, vif, NULL, true);
  	rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
  
-+	if (mt7915_is_atf_default_on(wiphy, dev)) {
++	if (mt7915_is_atf_default_on(wiphy, dev))
 +		mt7915_mcu_set_vow_band(dev, mvif);
-+	}
 +
- out:
- 	mutex_unlock(&dev->mt76.mutex);
+ 	return ret;
+ }
  
-@@ -681,6 +686,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+@@ -691,6 +695,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
  	struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
  	struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
  	bool ext_phy = mvif->phy != &dev->phy;
@@ -559,7 +558,7 @@
  #ifdef CONFIG_MTK_VENDOR
  	struct mt7915_phy *phy;
  #endif
-@@ -732,6 +738,16 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+@@ -742,6 +747,16 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
  		mt7915_mcu_set_mimo(phy, 0);
  	}
  #endif
@@ -577,10 +576,10 @@
  }
  
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index b20b48c2..bd63ebed 100644
+index 1164eff..aacc237 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -3519,6 +3519,171 @@ int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band)
+@@ -3533,6 +3533,171 @@ int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band)
  				 &req, sizeof(req), false);
  }
  
@@ -751,9 +750,9 @@
 +
  int mt7915_mcu_set_txbf(struct mt7915_dev *dev, u8 action)
  {
- 	struct {
+ #define MT_BF_PROCESSING	4
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 74b4aec1..f02d1721 100644
+index 3683ef0..b2bcf02 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -135,6 +135,58 @@ struct mt7915_twt_flow {
@@ -823,7 +822,7 @@
  };
  
  struct mt7915_vif_cap {
-@@ -470,6 +523,8 @@ struct mt7915_dev {
+@@ -469,6 +522,8 @@ struct mt7915_dev {
  	} dbg;
  	const struct mt7915_dbg_reg_desc *dbg_reg;
  #endif
@@ -832,7 +831,7 @@
  };
  
  enum {
-@@ -502,6 +557,15 @@ enum mt7915_rdd_cmd {
+@@ -501,6 +556,15 @@ enum mt7915_rdd_cmd {
  	RDD_IRQ_OFF,
  };
  
@@ -860,7 +859,7 @@
  int mt7915_mcu_set_txpower_sku(struct mt7915_phy *phy);
  int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len,
 diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
-index e00570e3..d6f2fe78 100644
+index 919cae4..c8df2d0 100644
 --- a/mt7915/mtk_debugfs.c
 +++ b/mt7915/mtk_debugfs.c
 @@ -1301,7 +1301,6 @@ static EMPTY_QUEUE_INFO_T ple_txcmd_queue_empty_info[] = {