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

[Description]
e6d9f8b2 [MAC80211][misc][Add Filogic 880 Non-MLO SDK Release. Add missing firmwares]
9def0c8f [MAC80211][WiFi7][ucode][Not to remove or create interface for non-primary MLD link]
c77412af [MAC80211][WiFi7][Misc][Add MLD configuration options]
d0bc5c22 [MAC80211][misc][Add Filogic 880 Non-MLO SDK Release]
01817e1f [mac80211][WiFi7][misc][Fix patch fail]
d6a80bd6 [MAC80211][WiFi6][Misc][Add lpi, duplicate mode and sku index]
0977e5a6 [MAC80211][WiFi6][hostapd][Add txpower vendor command]
2e2eb49f [MAC80211][WiFi6][mt76][Add support for lpi and duplicate mode]
c4856a8a [MAC80211][WiFi6][core][Add sta info flush and send deauth during DFS channel switch]
c586f5f5 [MAC80211][WiFi6][mt76][rebase patches]
fabcdbbd [MAC80211][WiFi6][mt76][Support thermal recal debug command]
1cba3dbf [MAC80211][WiFi6][mt76][Fix the fw version of wm and wa are on contrary]
99500b19 [MAC80211][WiFi6][core][Revert sending deauth frame for DFS channel switch]

[Release-log]

Change-Id: I357f4a5fec68ce0210927e1b4f172fcd3196139d
diff --git a/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0024-mac80211-mtk-add-DFS-CAC-countdown-in-CSA-flow.patch b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0024-mac80211-mtk-add-DFS-CAC-countdown-in-CSA-flow.patch
index 4a2dfea..f2fde36 100644
--- a/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0024-mac80211-mtk-add-DFS-CAC-countdown-in-CSA-flow.patch
+++ b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0024-mac80211-mtk-add-DFS-CAC-countdown-in-CSA-flow.patch
@@ -1,18 +1,20 @@
-From 022bf2702e0dd6f67690ac2860aa465efb4bff07 Mon Sep 17 00:00:00 2001
+From d10310d3eb842ebc449271b45ad2f47634149385 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Wed, 15 Nov 2023 15:05:17 +0800
 Subject: [PATCH] mac80211: mtk: add DFS CAC countdown in CSA flow
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
- include/net/cfg80211.h  | 32 +++++++++++++++++++
- net/mac80211/cfg.c      | 34 +++++++++++++++++++-
- net/mac80211/mlme.c     |  6 +++-
- net/mac80211/util.c     | 11 ++++++-
- net/wireless/chan.c     | 71 +++++++++++++++++++++++++++++++++++++++++
- net/wireless/nl80211.c  |  5 +--
- net/wireless/rdev-ops.h | 17 ++++++++++
- 7 files changed, 171 insertions(+), 5 deletions(-)
+ include/net/cfg80211.h     | 32 +++++++++++++++++
+ net/mac80211/cfg.c         | 45 +++++++++++++++++++++++-
+ net/mac80211/ieee80211_i.h |  2 ++
+ net/mac80211/iface.c       |  2 ++
+ net/mac80211/mlme.c        |  6 +++-
+ net/mac80211/util.c        | 11 +++++-
+ net/wireless/chan.c        | 71 ++++++++++++++++++++++++++++++++++++++
+ net/wireless/nl80211.c     |  5 +--
+ net/wireless/rdev-ops.h    | 17 +++++++++
+ 9 files changed, 186 insertions(+), 5 deletions(-)
 
 diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
 index 03f072f..a443b0d 100644
@@ -65,13 +67,22 @@
   * cfg80211_ch_switch_notify - update wdev channel and notify userspace
   * @dev: the device which switched channels
 diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 56381f8..8a0833b 100644
+index 56381f8..3e6e903 100644
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -3328,6 +3328,28 @@ static int ieee80211_set_after_csa_beacon(struct ieee80211_sub_if_data *sdata,
+@@ -3328,6 +3328,39 @@ static int ieee80211_set_after_csa_beacon(struct ieee80211_sub_if_data *sdata,
  	return 0;
  }
  
++void ieee80211_cac_sta_flush_work(struct work_struct *work)
++{
++	struct ieee80211_sub_if_data *sdata =
++		container_of(work, struct ieee80211_sub_if_data,
++			     cac_sta_flush_work);
++
++	__sta_info_flush(sdata, true);
++}
++
 +static int ieee80211_start_radar_detection_post_csa(struct wiphy *wiphy,
 +						    struct net_device *dev,
 +						    struct cfg80211_chan_def *chandef,
@@ -87,7 +98,9 @@
 +	sdata->smps_mode = IEEE80211_SMPS_OFF;
 +	sdata->needed_rx_chains = local->rx_chains;
 +
++	ieee80211_queue_work(&local->hw, &sdata->cac_sta_flush_work);
++
-+	ieee80211_queue_delayed_work(&sdata->local->hw,
++	ieee80211_queue_delayed_work(&local->hw,
 +				     &sdata->dfs_cac_timer_work,
 +				     msecs_to_jiffies(cac_time_ms));
 +
@@ -97,7 +110,7 @@
  static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
  {
  	struct ieee80211_local *local = sdata->local;
-@@ -3361,6 +3383,11 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
+@@ -3361,6 +3394,11 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
  					&sdata->csa_chandef))
  		return -EINVAL;
  
@@ -109,7 +122,7 @@
  	sdata->vif.csa_active = false;
  
  	err = ieee80211_set_after_csa_beacon(sdata, &changed);
-@@ -4538,7 +4565,11 @@ ieee80211_skip_cac(struct wireless_dev *wdev)
+@@ -4538,7 +4576,11 @@ ieee80211_skip_cac(struct wireless_dev *wdev)
  
  	cancel_delayed_work(&sdata->dfs_cac_timer_work);
  	if (wdev->cac_started) {
@@ -122,7 +135,7 @@
  		cac_time_ms = wdev->cac_time_ms;
  		wdev->cac_start_time = jiffies -
  				       msecs_to_jiffies(cac_time_ms + 1);
-@@ -4630,6 +4661,7 @@ const struct cfg80211_ops mac80211_config_ops = {
+@@ -4630,6 +4672,7 @@ const struct cfg80211_ops mac80211_config_ops = {
  #endif
  	.get_channel = ieee80211_cfg_get_channel,
  	.start_radar_detection = ieee80211_start_radar_detection,
@@ -130,6 +143,46 @@
  	.end_cac = ieee80211_end_cac,
  	.channel_switch = ieee80211_channel_switch,
  	.set_qos_map = ieee80211_set_qos_map,
+diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
+index 2519c14..bb5906d 100644
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -962,6 +962,7 @@ struct ieee80211_sub_if_data {
+ 	struct mac80211_qos_map __rcu *qos_map;
+ 
+ 	struct work_struct csa_finalize_work;
++	struct work_struct cac_sta_flush_work;
+ 	bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */
+ 	struct cfg80211_chan_def csa_chandef;
+ 
+@@ -1812,6 +1813,7 @@ int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
+ void ieee80211_csa_finalize_work(struct work_struct *work);
+ int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
+ 			     struct cfg80211_csa_settings *params);
++void ieee80211_cac_sta_flush_work(struct work_struct *work);
+ 
+ #define IEEE80211_BSS_COLOR_AGEOUT_TIME	10
+ #define IEEE80211_BSS_COLOR_MAX		64
+diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
+index 00b0443..ef32d53 100644
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -463,6 +463,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
+ 	sdata_unlock(sdata);
+ 
+ 	cancel_work_sync(&sdata->csa_finalize_work);
++	cancel_work_sync(&sdata->cac_sta_flush_work);
+ 	cancel_work_sync(&sdata->color_change_finalize_work);
+ 
+ 	cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
+@@ -1749,6 +1750,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
+ 	INIT_WORK(&sdata->work, ieee80211_iface_work);
+ 	INIT_WORK(&sdata->recalc_smps, ieee80211_recalc_smps_work);
+ 	INIT_WORK(&sdata->csa_finalize_work, ieee80211_csa_finalize_work);
++	INIT_WORK(&sdata->cac_sta_flush_work, ieee80211_cac_sta_flush_work);
+ 	INIT_WORK(&sdata->color_change_finalize_work, ieee80211_color_change_finalize_work);
+ 	INIT_LIST_HEAD(&sdata->assigned_chanctx_list);
+ 	INIT_LIST_HEAD(&sdata->reserved_chanctx_list);
 diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
 index 48053e4..e9ec32d 100644
 --- a/net/mac80211/mlme.c
@@ -148,7 +201,7 @@
  				   NL80211_RADAR_CAC_FINISHED,
  				   GFP_KERNEL);
 diff --git a/net/mac80211/util.c b/net/mac80211/util.c
-index 8d36b05..5360fae 100644
+index 26cd627..e07fe73 100644
 --- a/net/mac80211/util.c
 +++ b/net/mac80211/util.c
 @@ -3873,7 +3873,16 @@ void ieee80211_dfs_cac_cancel(struct ieee80211_local *local)
diff --git a/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0025-mac80211-mtk-send-deauth-frame-if-CAC-is-required-du.patch b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0025-mac80211-mtk-send-deauth-frame-if-CAC-is-required-du.patch
new file mode 100644
index 0000000..a74101d
--- /dev/null
+++ b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0025-mac80211-mtk-send-deauth-frame-if-CAC-is-required-du.patch
@@ -0,0 +1,59 @@
+From 08661908d4c2fb5f8d7ca00e0e7e6b33a6ae6e31 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Wed, 27 Dec 2023 14:26:22 +0800
+Subject: [PATCH] mac80211: mtk: send deauth frame if CAC is required during
+ CSA
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ net/mac80211/cfg.c | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
+index 3e6e903..eb73834 100644
+--- a/net/mac80211/cfg.c
++++ b/net/mac80211/cfg.c
+@@ -3361,6 +3361,31 @@ static int ieee80211_start_radar_detection_post_csa(struct wiphy *wiphy,
+ 	return 1;
+ }
+ 
++static void ieee80211_csa_send_deauth(struct ieee80211_sub_if_data *sdata)
++{
++	struct ieee80211_local *local = sdata->local;
++	u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
++	u8 broadcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
++	bool send_deauth;
++
++	send_deauth = !cfg80211_chandef_identical(&sdata->vif.bss_conf.chandef,
++						  &sdata->csa_chandef) &&
++		      !cfg80211_reg_can_beacon_relax(local->hw.wiphy,
++						     &sdata->csa_chandef,
++						     sdata->wdev.iftype);
++	/* broadcast deauth frame if CAC is required */
++	if (!send_deauth)
++		return;
++
++	ieee80211_wake_vif_queues(local, sdata, IEEE80211_QUEUE_STOP_REASON_CSA);
++	ieee80211_send_deauth_disassoc(sdata, broadcast,
++				       sdata->vif.bss_conf.bssid,
++				       IEEE80211_STYPE_DEAUTH,
++				       WLAN_REASON_DEAUTH_LEAVING,
++				       send_deauth, frame_buf);
++	ieee80211_stop_vif_queues(local, sdata, IEEE80211_QUEUE_STOP_REASON_CSA);
++}
++
+ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
+ {
+ 	struct ieee80211_local *local = sdata->local;
+@@ -3371,6 +3396,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
+ 	lockdep_assert_held(&local->mtx);
+ 	lockdep_assert_held(&local->chanctx_mtx);
+ 
++	ieee80211_csa_send_deauth(sdata);
++
+ 	/*
+ 	 * using reservation isn't immediate as it may be deferred until later
+ 	 * with multi-vif. once reservation is complete it will re-schedule the
+-- 
+2.18.0
+
diff --git a/recipes-wifi/linux-mac80211/files/patches/subsys/subsys.inc b/recipes-wifi/linux-mac80211/files/patches/subsys/subsys.inc
index 9bb77d3..d5b5832 100644
--- a/recipes-wifi/linux-mac80211/files/patches/subsys/subsys.inc
+++ b/recipes-wifi/linux-mac80211/files/patches/subsys/subsys.inc
@@ -81,6 +81,7 @@
     file://mtk-0023-mac80211-mtk-avoid-calling-switch_vif_chanctx-when-u.patch \
     file://mtk-0024-mac80211-mtk-ACS-channel-time-is-reset-by-ch_restore.patch \
     file://mtk-0024-mac80211-mtk-add-DFS-CAC-countdown-in-CSA-flow.patch \
+    file://mtk-0025-mac80211-mtk-send-deauth-frame-if-CAC-is-required-du.patch \
     file://mtk-9900-mac80211-mtk-mask-kernel-version-limitation-and-fill.patch \
     file://mtk-9901-mac80211-mtk-add-fill-receive-path-ops-to-get-wed-id.patch \
     file://mtk-9902-mac80211-mtk-add-support-for-letting-drivers-registe.patch \