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

[Description]
bb1ab020 [MAC80211][WiFi6][mt76][Fix STA channel switch reason during auth/assoc for DFS channel]
e1340c0f [MAC80211][WiFi6][core][Fix STA channel switch reason during auth/assoc for DFS channel]
cf503970 [MAC80211][WiFi7][misc][Remove testmode default eeprom bin]
b37abd10 [MAC80211][WiFi6/7][Misc][Fix build fail because of mt76 version upgradation]
b7b7f0c4 [MAC80211][WiFi6][core][Fix build fail]
8097da40 [MAC80211][wifi6][MT76][Rebase mt76 to 2024-03-18]
c0f79602 [MAC80211][WiFi7][app][Add ibf ver2 command support in iwpriv wrapper]
36839dc7 [MAC80211][WiFi6][core][Sync wifi7 cert SQC fix to wifi6]
159f6fc1 [MAC82011][Wifi6][MT76][Fix power on sequence]
0e60d7d6 [MAC80211][wifi6][MT76][Add adie id and version in debugfs]
0dfc6240 [MAC80211][WiFi6][core][Refactor STA CSA paring flow]
d2f1ea53 [MAC80211][mt76][fix issue that when one phy is scanning and another phy occur packet loss]
eae6a6c1 [MAC80211][WED][Fix Eagle mlo tx T.P too low issue]
4c3ca8f0 [MAC80211][WiFi6][mt76][Fix HE Phy cap IE for station mode]
602ca651 [MAC80211][WiFi6][mt76][Add ZWDFS foolproof mechanism during radar trigger & detection]
df0ebcec [MAC80211][WiFi7][misc][Add WiFi7 MLO autobuild folder]
e318c6da [mac80211][wifi6][mt76][Remove unnecessary register settings]
c6a3c4c3 [MAC80211][WiFi6][mt76][Add background radar hw cap checking mechanism]
c25db7a0 [MAC80211][WiFi6][Misc][Fix default /etc/config/wireless setting and backport wpa_supp patch of CVE-2023-52160]
839f446d [MAC80211][WiFi6][Rebase Patches][Fix patch fail]
66194787 [MAC80211][wifi6][mt76][Add per-band token limits and debugfs]
85e8e415 [MAC80211][WiFi6][Misc][Change default WiFi 5GHz setting to BW160 expect for MT7915]
64256fee [MAC80211][WED][Fix kite RX T.P ~0 due to sync upstream]
6be2154a [MAC80211][WiFi6][core][fix AP mgmt not encrypted in WDS mode with PMF on]
92223c79 [MAC80211][mt76][sync SER patch.]
0c7cec54 [MAC80211][WiFi7][MT76][Sync internal patches to release build]
421f7b74 [MAC80211][WiFi6][mt76][Refactor backaward patch due to wed sync to upstream]
0471b20c [MAC80211][WED][Refactor and sync wed patches from upstream]
e0ab6314 [mac80211][wifi6][mt76][Fix unusual Tx/Rx airtime duration values]
632ed0a5 [MAC80211][WiFi7][core][Sync to backports-6.6.15]

[Release-log]

Change-Id: I8731a065c32a92b78d3cb8ac6fc292f493d1be65
diff --git a/recipes-wifi/linux-mac80211/files/patches-6.x/build/060-no_local_ssb_bcma.patch b/recipes-wifi/linux-mac80211/files/patches-6.x/build/060-no_local_ssb_bcma.patch
index 451d0b7..2a0f9ed 100644
--- a/recipes-wifi/linux-mac80211/files/patches-6.x/build/060-no_local_ssb_bcma.patch
+++ b/recipes-wifi/linux-mac80211/files/patches-6.x/build/060-no_local_ssb_bcma.patch
@@ -1,6 +1,6 @@
 --- a/local-symbols
 +++ b/local-symbols
-@@ -491,43 +491,6 @@ USB_VL600=
+@@ -493,43 +493,6 @@ USB_VL600=
  USB_NET_CH9200=
  USB_NET_AQC111=
  USB_RTL8153_ECM=
@@ -171,7 +171,7 @@
  	depends on CORDIC
 --- a/Kconfig.local
 +++ b/Kconfig.local
-@@ -1477,117 +1477,6 @@ config BACKPORTED_USB_NET_AQC111
+@@ -1483,117 +1483,6 @@ config BACKPORTED_USB_NET_AQC111
  config BACKPORTED_USB_RTL8153_ECM
  	tristate
  	default USB_RTL8153_ECM
diff --git a/recipes-wifi/linux-mac80211/files/patches-6.x/build/080-resv_start_op.patch b/recipes-wifi/linux-mac80211/files/patches-6.x/build/080-resv_start_op.patch
index 802a0e3..bbd9018 100644
--- a/recipes-wifi/linux-mac80211/files/patches-6.x/build/080-resv_start_op.patch
+++ b/recipes-wifi/linux-mac80211/files/patches-6.x/build/080-resv_start_op.patch
@@ -12,7 +12,7 @@
  };
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -17509,7 +17509,9 @@ static struct genl_family nl80211_fam __
+@@ -17551,7 +17551,9 @@ static struct genl_family nl80211_fam __
  	.n_ops = ARRAY_SIZE(nl80211_ops),
  	.small_ops = nl80211_small_ops,
  	.n_small_ops = ARRAY_SIZE(nl80211_small_ops),
diff --git a/recipes-wifi/linux-mac80211/files/patches-6.x/build/210-revert-split-op.patch b/recipes-wifi/linux-mac80211/files/patches-6.x/build/210-revert-split-op.patch
index a1fae5e..4f1f8a7 100644
--- a/recipes-wifi/linux-mac80211/files/patches-6.x/build/210-revert-split-op.patch
+++ b/recipes-wifi/linux-mac80211/files/patches-6.x/build/210-revert-split-op.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -16400,8 +16400,7 @@ static u32 nl80211_internal_flags[] = {
+@@ -16442,8 +16442,7 @@ static u32 nl80211_internal_flags[] = {
  #undef SELECTOR
  };
  
@@ -10,7 +10,7 @@
  			    struct genl_info *info)
  {
  	struct cfg80211_registered_device *rdev = NULL;
-@@ -16502,8 +16501,7 @@ out_unlock:
+@@ -16544,8 +16543,7 @@ out_unlock:
  	return err;
  }
  
diff --git a/recipes-wifi/linux-mac80211/files/patches-6.x/build/230-backport_genl_info_userhdr.patch b/recipes-wifi/linux-mac80211/files/patches-6.x/build/230-backport_genl_info_userhdr.patch
new file mode 100644
index 0000000..38f86dc
--- /dev/null
+++ b/recipes-wifi/linux-mac80211/files/patches-6.x/build/230-backport_genl_info_userhdr.patch
@@ -0,0 +1,32 @@
+--- a/backport-include/net/genetlink.h
++++ b/backport-include/net/genetlink.h
+@@ -3,6 +3,7 @@
+ #include_next <net/genetlink.h>
+ #include <linux/version.h>
+ 
++#if LINUX_VERSION_IS_LESS(4,12,0)
+ static inline void __bp_genl_info_userhdr_set(struct genl_info *info,
+ 					      void *userhdr)
+ {
+@@ -14,7 +15,6 @@ static inline void *__bp_genl_info_userh
+ 	return info->userhdr;
+ }
+ 
+-#if LINUX_VERSION_IS_LESS(4,12,0)
+ #define GENL_SET_ERR_MSG(info, msg) NL_SET_ERR_MSG(genl_info_extack(info), msg)
+ 
+ static inline int genl_err_attr(struct genl_info *info, int err,
+@@ -44,11 +44,13 @@ static inline struct netlink_ext_ack *ge
+ #endif
+ }
+ 
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ /* this gets put in place of info->userhdr, since we use that above */
+ static inline void *genl_info_userhdr(struct genl_info *info)
+ {
+ 	return (u8 *)info->genlhdr + GENL_HDRLEN;
+ }
++#endif
+ 
+ #if LINUX_VERSION_IS_LESS(4,10,0)
+ #define __genl_ro_after_init
diff --git a/recipes-wifi/linux-mac80211/files/patches-6.x/build/240-backport_genl_split_ops.patch b/recipes-wifi/linux-mac80211/files/patches-6.x/build/240-backport_genl_split_ops.patch
new file mode 100644
index 0000000..b22804c
--- /dev/null
+++ b/recipes-wifi/linux-mac80211/files/patches-6.x/build/240-backport_genl_split_ops.patch
@@ -0,0 +1,32 @@
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -16442,8 +16442,14 @@ static u32 nl80211_internal_flags[] = {
+ #undef SELECTOR
+ };
+ 
++#if LINUX_VERSION_IS_LESS(6,2,0)
+ static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb,
+ 			    struct genl_info *info)
++#else
++static int nl80211_pre_doit(const struct genl_split_ops *ops,
++			    struct sk_buff *skb,
++			    struct genl_info *info)
++#endif
+ {
+ 	struct cfg80211_registered_device *rdev = NULL;
+ 	struct wireless_dev *wdev = NULL;
+@@ -16543,8 +16549,14 @@ out_unlock:
+ 	return err;
+ }
+ 
++#if LINUX_VERSION_IS_LESS(6,2,0)
+ static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
+ 			      struct genl_info *info)
++#else
++static void nl80211_post_doit(const struct genl_split_ops *ops,
++			      struct sk_buff *skb,
++			      struct genl_info *info)
++#endif
+ {
+ 	u32 internal_flags = nl80211_internal_flags[ops->internal_flags];
+ 
diff --git a/recipes-wifi/linux-mac80211/files/patches-6.x/build/250-backport_iwlwifi_thermal.patch b/recipes-wifi/linux-mac80211/files/patches-6.x/build/250-backport_iwlwifi_thermal.patch
new file mode 100644
index 0000000..631fdd7
--- /dev/null
+++ b/recipes-wifi/linux-mac80211/files/patches-6.x/build/250-backport_iwlwifi_thermal.patch
@@ -0,0 +1,160 @@
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+@@ -531,7 +531,11 @@ struct iwl_mvm_tt_mgmt {
+  * @tzone: thermal zone device data
+ */
+ struct iwl_mvm_thermal_device {
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 	s16 temp_trips[IWL_MAX_DTS_TRIPS];
++#else
++	struct thermal_trip trips[IWL_MAX_DTS_TRIPS];
++#endif
+ 	u8 fw_trips_index[IWL_MAX_DTS_TRIPS];
+ 	struct thermal_zone_device *tzone;
+ };
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+@@ -573,6 +573,7 @@ int iwl_mvm_send_temp_report_ths_cmd(str
+ 	 * and uncompressed, the FW should get it compressed and sorted
+ 	 */
+ 
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 	/* compress temp_trips to cmd array, remove uninitialized values*/
+ 	for (i = 0; i < IWL_MAX_DTS_TRIPS; i++) {
+ 		if (mvm->tz_device.temp_trips[i] != S16_MIN) {
+@@ -580,6 +581,15 @@ int iwl_mvm_send_temp_report_ths_cmd(str
+ 				cpu_to_le16(mvm->tz_device.temp_trips[i]);
+ 		}
+ 	}
++#else
++	/* compress trips to cmd array, remove uninitialized values*/
++	for (i = 0; i < IWL_MAX_DTS_TRIPS; i++) {
++		if (mvm->tz_device.trips[i].temperature != INT_MIN) {
++			cmd.thresholds[idx++] =
++				cpu_to_le16((s16)(mvm->tz_device.trips[i].temperature / 1000));
++		}
++	}
++#endif
+ 	cmd.num_temps = cpu_to_le32(idx);
+ 
+ 	if (!idx)
+@@ -593,8 +603,13 @@ int iwl_mvm_send_temp_report_ths_cmd(str
+ 	 */
+ 	for (i = 0; i < idx; i++) {
+ 		for (j = 0; j < IWL_MAX_DTS_TRIPS; j++) {
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 			if (le16_to_cpu(cmd.thresholds[i]) ==
+ 				mvm->tz_device.temp_trips[j])
++#else
++			if ((int)(le16_to_cpu(cmd.thresholds[i]) * 1000) ==
++				mvm->tz_device.trips[j].temperature)
++#endif
+ 				mvm->tz_device.fw_trips_index[i] = j;
+ 		}
+ 	}
+@@ -638,6 +653,7 @@ out:
+ 	return ret;
+ }
+ 
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ static int iwl_mvm_tzone_get_trip_temp(struct thermal_zone_device *device,
+ 				       int trip, int *temp)
+ {
+@@ -661,14 +677,19 @@ static int iwl_mvm_tzone_get_trip_type(s
+ 
+ 	return 0;
+ }
++#endif
+ 
+ static int iwl_mvm_tzone_set_trip_temp(struct thermal_zone_device *device,
+ 				       int trip, int temp)
+ {
+ 	struct iwl_mvm *mvm = thermal_zone_device_priv(device);
+ 	struct iwl_mvm_thermal_device *tzone;
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 	int i, ret;
+ 	s16 temperature;
++#else
++	int ret;
++#endif
+ 
+ 	mutex_lock(&mvm->mutex);
+ 
+@@ -678,17 +699,21 @@ static int iwl_mvm_tzone_set_trip_temp(s
+ 		goto out;
+ 	}
+ 
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 	if (trip < 0 || trip >= IWL_MAX_DTS_TRIPS) {
+ 		ret = -EINVAL;
+ 		goto out;
+ 	}
++#endif
+ 
+ 	if ((temp / 1000) > S16_MAX) {
+ 		ret = -EINVAL;
+ 		goto out;
+ 	}
+ 
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 	temperature = (s16)(temp / 1000);
++#endif
+ 	tzone = &mvm->tz_device;
+ 
+ 	if (!tzone) {
+@@ -696,6 +721,7 @@ static int iwl_mvm_tzone_set_trip_temp(s
+ 		goto out;
+ 	}
+ 
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 	/* no updates*/
+ 	if (tzone->temp_trips[trip] == temperature) {
+ 		ret = 0;
+@@ -711,6 +737,7 @@ static int iwl_mvm_tzone_set_trip_temp(s
+ 	}
+ 
+ 	tzone->temp_trips[trip] = temperature;
++#endif
+ 
+ 	ret = iwl_mvm_send_temp_report_ths_cmd(mvm);
+ out:
+@@ -720,8 +747,10 @@ out:
+ 
+ static  struct thermal_zone_device_ops tzone_ops = {
+ 	.get_temp = iwl_mvm_tzone_get_temp,
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 	.get_trip_temp = iwl_mvm_tzone_get_trip_temp,
+ 	.get_trip_type = iwl_mvm_tzone_get_trip_type,
++#endif
+ 	.set_trip_temp = iwl_mvm_tzone_set_trip_temp,
+ };
+ 
+@@ -743,7 +772,12 @@ static void iwl_mvm_thermal_zone_registe
+ 	BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH);
+ 
+ 	sprintf(name, "iwlwifi_%u", atomic_inc_return(&counter) & 0xFF);
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 	mvm->tz_device.tzone = thermal_zone_device_register(name,
++#else
++	mvm->tz_device.tzone = thermal_zone_device_register_with_trips(name,
++							mvm->tz_device.trips,
++#endif
+ 							IWL_MAX_DTS_TRIPS,
+ 							IWL_WRITABLE_TRIPS_MSK,
+ 							mvm, &tzone_ops,
+@@ -766,8 +800,15 @@ static void iwl_mvm_thermal_zone_registe
+ 	/* 0 is a valid temperature,
+ 	 * so initialize the array with S16_MIN which invalid temperature
+ 	 */
++#if LINUX_VERSION_IS_LESS(6,6,0)
+ 	for (i = 0 ; i < IWL_MAX_DTS_TRIPS; i++)
+ 		mvm->tz_device.temp_trips[i] = S16_MIN;
++#else
++	for (i = 0 ; i < IWL_MAX_DTS_TRIPS; i++) {
++		mvm->tz_device.trips[i].temperature = INT_MIN;
++		mvm->tz_device.trips[i].type = THERMAL_TRIP_PASSIVE;
++	}
++#endif
+ }
+ 
+ static int iwl_mvm_tcool_get_max_state(struct thermal_cooling_device *cdev,
diff --git a/recipes-wifi/linux-mac80211/files/patches-6.x/build/build.inc b/recipes-wifi/linux-mac80211/files/patches-6.x/build/build.inc
index 5a294e9..40fef68 100644
--- a/recipes-wifi/linux-mac80211/files/patches-6.x/build/build.inc
+++ b/recipes-wifi/linux-mac80211/files/patches-6.x/build/build.inc
@@ -17,4 +17,7 @@
     file://200-Revert-wifi-iwlwifi-Use-generic-thermal_zone_get_tri.patch \
     file://210-revert-split-op.patch \
     file://220-list-don-t-backport-list_count_nodes.patch \
+    file://230-backport_genl_info_userhdr.patch \
+    file://240-backport_genl_split_ops.patch \
+    file://250-backport_iwlwifi_thermal.patch \
     "