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

[Description]
d34487c3 [MAC80211][WiFi6][mt76][Add mt7981 mt7916 mt7915 fw_wm_info support]
327eaf76 [MAC80211][wifi7][Release][Update WiFi7 Filogic680/660 Firmware]
fa03d7ea [MAC80211][WiFi6][hostapd][Fix 2/6G channel switch fail issue]
c0bf67d9 [MAC80211][misc][Add Filogic 880 Non-MLO SDK Release]
e5d03217 [MAC80211][WiFi6][Rebase Patches][Refactor set_offchan_ctrl]
6cad79ae [MAC80211][WiFi6][hostapd][Add support for DFS channel switch with CSA sent]
cde50012 [MAC80211][WiFi6][core][Add DFS channel CSA flow]
0142fd16 [MAC80211][WiFi6][mt76][Add post channel switch callback for DFS channel switch support]
cb3f4c58 [MAC80211][WiFi6][mt76][Update Connac2 CSI Feature]
1b66ac4c [MAC80211][WiFi6][mt76][Refactor precal loading and binfile mode to align upstream]
0ece467b [MAC80211][WiFi6][mt76][Fix scs feature calltrace issue]
1dca03f1 [MAC80211][WiFi6/7][Misc][Change group mgmt cipher setting to align group cipher]
0aa52762 [MAC80211][WiFi6][mt76][Fix muru_onoff as all enabled by default]
c3e5f505 [MAC80211][WiFi6][hostapd][Fix mu_onoff was overwritten with unexpected values]
7090eabe [MAC80211][WiFi6/7][core][Add tx_burst option in wireless configuration file for Kite]
669d3071 [MAC80211][WiFi6][mt76][rebase patches]
c5d6b3e7 [mac80211][mt76][Fix patch fail]
55ef4059 [MAC80211][WiFi6][mt76][Fix TxS ACK is incorrectly reported]
e166eae1 [MAC80211][WiFi6][Misc][Add Filogic 820 Build]
118ffd7e [mac80211][wifi6][mt76][Fix crash caused by per-BSS counter updating]
68015098 [MAC80211][WiFi7][mt76][Add Eagle 2adie TBTC default bin]
eae6e8c0 [MAC80211][WiFi7][mt76][Add Eagle 2adie TBTC support in mt76 Makefile]
cccc8eb9 [MAC80211[WiFi6][hostapd][Fix wds AP interface adding issue]
173fe3b0 [MAC80211][WiFi6][mt76][Add scs feature for connac2 mt76]
1b8af8d9 [MAC80211][WiFi6][mt76][rebase patches]
6dc40325 [MAC80211][WiFi7][misc][fix hostapd udebug init fail]
aa4b39ae [[mt76][csi][mt7915][mt7986] update csi feature]
7d458da2 [MAC80211][WiFi6][hostapd][Auto Channel Selection channel time issue]
f0b5502f [MAC80211][WiFi7][misc][fix build error]
b63c9cf6 [MAC80211][WiFi6/7][misc][fix ucode and backport 6.5 patch fail]
ce056dc7 [mac80211][wifi6][mt76][Add variant support for Cheetah MT76]
c5ae3f9c [MAC80211][WiFi6/7][Misc][Add country setting consistent check before enable AP.]
d57d9c5a [mac80211][misc][wifi6/7][Update libubox to the latest version]
be7dbf21 [mac80211][misc][wifi7][Revert libubox to 20230523 to prevent build fail]
ae9b4428 [MAC80211][WiFi6][mt76][Add cal free data support]
52fd5d80 [MAC80211][WiFi7][Misc][Adjust MU EDCA timer in mac80211.sh]
66c649de [mac80211][hostapd][netifd][Revert udebug for build pass]
136c7f11 [MAC80211][hostapd][wifi7][Fix build fail]
8911e727 [MAC80211][WiFi6][hostapd][Auto Channel Selection issue and patch sync]
75161456 [MAC80211][WiFi7][mt76][Fix issue for testmode bit in eagle defaut bin]
4dc2d646 [MAC80211][WiFi6][mt76][Fix cheetah 5G ibf issue]
d4561158 [MAC80211][WiFi6][Misc][Add Filogic 820 Build]
2e5a1997 [MAC80211][WiFi6][hostapd][Backport hostapd ACS patches and some ACS fixes]
b0305b6e [MAC80211][WiFi6/7][Misc][Add 6g band default enable mbo IE]

[Release-log]

Change-Id: I872b422c1fc56ebd3a1cff3252cb403a2015eabe
diff --git a/recipes-wifi/linux-mt76/files/patches/1043-wifi-mt76-testmode-add-cheetah-support.patch b/recipes-wifi/linux-mt76/files/patches/1043-wifi-mt76-testmode-add-cheetah-support.patch
new file mode 100644
index 0000000..6aef19c
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/1043-wifi-mt76-testmode-add-cheetah-support.patch
@@ -0,0 +1,142 @@
+From 5186827e8a40a71363aa2c7cc3aef1fafae3665f Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Tue, 31 Oct 2023 16:29:13 +0800
+Subject: [PATCH 55/76] wifi: mt76: testmode: add cheetah support
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ mt7915/eeprom.c   |  3 +--
+ mt7915/eeprom.h   | 12 ++++++++++++
+ mt7915/mcu.c      | 21 +++++++++++++++++++--
+ mt7915/testmode.c |  9 +++++----
+ 4 files changed, 37 insertions(+), 8 deletions(-)
+
+diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
+index b96776d..c8ea1d9 100644
+--- a/mt7915/eeprom.c
++++ b/mt7915/eeprom.c
+@@ -39,8 +39,7 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev)
+ 	if (!dev->flash_mode || !val)
+ 		return 0;
+ 
+-	size = mt7915_get_cal_group_size(dev) +
+-	       (is_mt7915(&dev->mt76) ? MT_EE_CAL_DPD_SIZE_V1 : MT_EE_CAL_DPD_SIZE_V2);
++	size = mt7915_get_cal_group_size(dev) + mt7915_get_cal_dpd_size(dev);
+ 
+ 	dev->cal = devm_kzalloc(mdev->dev, size, GFP_KERNEL);
+ 	if (!dev->cal)
+diff --git a/mt7915/eeprom.h b/mt7915/eeprom.h
+index a1ab05a..99101f9 100644
+--- a/mt7915/eeprom.h
++++ b/mt7915/eeprom.h
+@@ -52,6 +52,7 @@ enum mt7915_eeprom_field {
+ #define MT_EE_CAL_GROUP_SIZE_7916_6G		(94 * MT_EE_CAL_UNIT + 16)
+ #define MT_EE_CAL_DPD_SIZE_V1			(54 * MT_EE_CAL_UNIT)
+ #define MT_EE_CAL_DPD_SIZE_V2			(300 * MT_EE_CAL_UNIT)
++#define MT_EE_CAL_DPD_SIZE_V2_7981		(102 * MT_EE_CAL_UNIT)	/* no 6g dpd data */
+ 
+ #define MT_EE_WIFI_CONF0_TX_PATH		GENMASK(2, 0)
+ #define MT_EE_WIFI_CONF0_BAND_SEL		GENMASK(7, 6)
+@@ -192,6 +193,17 @@ mt7915_get_cal_group_size(struct mt7915_dev *dev)
+ 	}
+ }
+ 
++static inline u32
++mt7915_get_cal_dpd_size(struct mt7915_dev *dev)
++{
++	if (is_mt7915(&dev->mt76))
++		return MT_EE_CAL_DPD_SIZE_V1;
++	else if (is_mt7981(&dev->mt76))
++		return MT_EE_CAL_DPD_SIZE_V2_7981;
++	else
++		return MT_EE_CAL_DPD_SIZE_V2;
++}
++
+ extern const u8 mt7915_sku_group_len[MAX_SKU_RATE_GROUP_NUM];
+ 
+ #endif
+diff --git a/mt7915/mcu.c b/mt7915/mcu.c
+index ac015ab..2b41feb 100644
+--- a/mt7915/mcu.c
++++ b/mt7915/mcu.c
+@@ -3040,13 +3040,30 @@ static int mt7915_dpd_freq_idx(struct mt7915_dev *dev, u16 freq, u8 bw)
+ 		/* 5G BW160 */
+ 		5250, 5570, 5815
+ 	};
++	const u16 freq_list_v2_7981[] = {
++		/* 5G BW20 */
++		5180, 5200, 5220, 5240,
++		5260, 5280, 5300, 5320,
++		5500, 5520, 5540, 5560,
++		5580, 5600, 5620, 5640,
++		5660, 5680, 5700, 5720,
++		5745, 5765, 5785, 5805,
++		5825, 5845, 5865, 5885,
++		/* 5G BW160 */
++		5250, 5570, 5815
++	};
+ 	const u16 *freq_list = freq_list_v1;
+ 	int n_freqs = ARRAY_SIZE(freq_list_v1);
+ 	int idx;
+ 
+ 	if (!is_mt7915(&dev->mt76)) {
+-		freq_list = freq_list_v2;
+-		n_freqs = ARRAY_SIZE(freq_list_v2);
++		if (is_mt7981(&dev->mt76)) {
++			freq_list = freq_list_v2_7981;
++			n_freqs = ARRAY_SIZE(freq_list_v2_7981);
++		} else {
++			freq_list = freq_list_v2;
++			n_freqs = ARRAY_SIZE(freq_list_v2);
++		}
+ 	}
+ 
+ 	if (freq < 4000) {
+diff --git a/mt7915/testmode.c b/mt7915/testmode.c
+index faf6014..ecd6271 100644
+--- a/mt7915/testmode.c
++++ b/mt7915/testmode.c
+@@ -2151,7 +2151,7 @@ mt7915_tm_group_prek(struct mt7915_phy *phy, enum mt76_testmode_state state)
+ 	eeprom = mdev->eeprom.data;
+ 	dev->cur_prek_offset = 0;
+ 	group_size = mt7915_get_cal_group_size(dev);
+-	dpd_size = is_mt7915(&dev->mt76) ? MT_EE_CAL_DPD_SIZE_V1 : MT_EE_CAL_DPD_SIZE_V2;
++	dpd_size = mt7915_get_cal_dpd_size(dev);
+ 	size = group_size + dpd_size;
+ 	offs = is_mt7915(&dev->mt76) ? MT_EE_DO_PRE_CAL : MT_EE_DO_PRE_CAL_V2;
+ 
+@@ -2233,11 +2233,11 @@ mt7915_tm_dpd_prek(struct mt7915_phy *phy, enum mt76_testmode_state state)
+ 	eeprom = mdev->eeprom.data;
+ 	dev->cur_prek_offset = 0;
+ 	group_size = mt7915_get_cal_group_size(dev);
++	dpd_size = mt7915_get_cal_dpd_size(dev);
+ 	dev->dpd_chan_num_2g = hweight32(DPD_2G_CH_BW20_BITMAP_0);
+ 	if (is_mt7915(&dev->mt76)) {
+ 		dev->dpd_chan_num_5g = hweight32(DPD_5G_CH_BW20_BITMAP_7915_0);
+ 		dev->dpd_chan_num_6g = 0;
+-		dpd_size = MT_EE_CAL_DPD_SIZE_V1;
+ 		offs = MT_EE_DO_PRE_CAL;
+ 	} else {
+ 		dev->dpd_chan_num_5g = hweight32(DPD_5G_CH_BW20_BITMAP_0) +
+@@ -2246,7 +2246,8 @@ mt7915_tm_dpd_prek(struct mt7915_phy *phy, enum mt76_testmode_state state)
+ 		dev->dpd_chan_num_6g = hweight32(DPD_6G_CH_BW20_BITMAP_0) +
+ 				       hweight32(DPD_6G_CH_BW20_BITMAP_1) +
+ 				       ARRAY_SIZE(bw160_6g_freq);
+-		dpd_size = MT_EE_CAL_DPD_SIZE_V2;
++		if (is_mt7981(&dev->mt76))
++			dev->dpd_chan_num_6g = 0;
+ 		offs = MT_EE_DO_PRE_CAL_V2;
+ 	}
+ 	size = group_size + dpd_size;
+@@ -2711,7 +2712,7 @@ mt7915_tm_dump_precal(struct mt76_phy *mphy, struct sk_buff *msg, int flag, int
+ 	}
+ 
+ 	group_size = mt7915_get_cal_group_size(dev);
+-	dpd_size = is_mt7915(&dev->mt76) ? MT_EE_CAL_DPD_SIZE_V1 : MT_EE_CAL_DPD_SIZE_V2;
++	dpd_size = mt7915_get_cal_dpd_size(dev);
+ 	dpd_per_chan_size = is_mt7915(&dev->mt76) ? 2 : 3;
+ 	total_size = group_size + dpd_size;
+ 	pre_cal = dev->cal;
+-- 
+2.18.0
+