[][MAC80211][wifi7][core][update for backports v6.5]

[Description]
Refactor patches on top of backports v6.5 update.

[Release-log]
N/A

Change-Id: I22a8b7f810645c8a940fabf86f3b5bcba8ef4fd9
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7999400
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0001-Revert-mac80211-use-the-new-drop-reasons-infrastruct.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0001-Revert-mac80211-use-the-new-drop-reasons-infrastruct.patch
new file mode 100644
index 0000000..8e924dc
--- /dev/null
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0001-Revert-mac80211-use-the-new-drop-reasons-infrastruct.patch
@@ -0,0 +1,381 @@
+From e6a3cf0e4fd98f36be9352b92d40cfeb79993fc9 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Mon, 21 Aug 2023 14:20:49 +0800
+Subject: [PATCH] Revert mac80211: use the new drop reasons infrastructure
+
+---
+ net/mac80211/drop.h        | 56 --------------------------------------
+ net/mac80211/ieee80211_i.h |  8 +++++-
+ net/mac80211/main.c        | 31 ---------------------
+ net/mac80211/rx.c          | 55 +++++++++++++++++++------------------
+ net/mac80211/wpa.c         | 24 ++++++++--------
+ 5 files changed, 48 insertions(+), 126 deletions(-)
+ delete mode 100644 net/mac80211/drop.h
+
+diff --git a/net/mac80211/drop.h b/net/mac80211/drop.h
+deleted file mode 100644
+index 49dc809..0000000
+--- a/net/mac80211/drop.h
++++ /dev/null
+@@ -1,56 +0,0 @@
+-/* SPDX-License-Identifier: GPL-2.0-only */
+-/*
+- * mac80211 drop reason list
+- *
+- * Copyright (C) 2023 Intel Corporation
+- */
+-
+-#ifndef MAC80211_DROP_H
+-#define MAC80211_DROP_H
+-#include <net/dropreason.h>
+-
+-typedef unsigned int __bitwise ieee80211_rx_result;
+-
+-#define MAC80211_DROP_REASONS_MONITOR(R)	\
+-	R(RX_DROP_M_UNEXPECTED_4ADDR_FRAME)	\
+-	R(RX_DROP_M_BAD_BCN_KEYIDX)		\
+-	R(RX_DROP_M_BAD_MGMT_KEYIDX)		\
+-/* this line for the trailing \ - add before this */
+-
+-#define MAC80211_DROP_REASONS_UNUSABLE(R)	\
+-	R(RX_DROP_U_MIC_FAIL)			\
+-	R(RX_DROP_U_REPLAY)			\
+-	R(RX_DROP_U_BAD_MMIE)			\
+-/* this line for the trailing \ - add before this */
+-
+-/* having two enums allows for checking ieee80211_rx_result use with sparse */
+-enum ___mac80211_drop_reason {
+-/* if we get to the end of handlers with RX_CONTINUE this will be the reason */
+-	___RX_CONTINUE	= SKB_CONSUMED,
+-
+-/* this never gets used as an argument to kfree_skb_reason() */
+-	___RX_QUEUED	= SKB_NOT_DROPPED_YET,
+-
+-#define ENUM(x) ___ ## x,
+-	___RX_DROP_MONITOR = SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR <<
+-		SKB_DROP_REASON_SUBSYS_SHIFT,
+-	MAC80211_DROP_REASONS_MONITOR(ENUM)
+-
+-	___RX_DROP_UNUSABLE = SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE <<
+-		SKB_DROP_REASON_SUBSYS_SHIFT,
+-	MAC80211_DROP_REASONS_UNUSABLE(ENUM)
+-#undef ENUM
+-};
+-
+-enum mac80211_drop_reason {
+-	RX_CONTINUE	 = (__force ieee80211_rx_result)___RX_CONTINUE,
+-	RX_QUEUED	 = (__force ieee80211_rx_result)___RX_QUEUED,
+-	RX_DROP_MONITOR	 = (__force ieee80211_rx_result)___RX_DROP_MONITOR,
+-	RX_DROP_UNUSABLE = (__force ieee80211_rx_result)___RX_DROP_UNUSABLE,
+-#define DEF(x) x = (__force ieee80211_rx_result)___ ## x,
+-	MAC80211_DROP_REASONS_MONITOR(DEF)
+-	MAC80211_DROP_REASONS_UNUSABLE(DEF)
+-#undef DEF
+-};
+-
+-#endif /* MAC80211_DROP_H */
+diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
+index 9fdfd11..7ca2482 100644
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -33,7 +33,6 @@
+ #include "key.h"
+ #include "sta_info.h"
+ #include "debug.h"
+-#include "drop.h"
+ 
+ extern const struct cfg80211_ops mac80211_config_ops;
+ 
+@@ -171,6 +170,13 @@ struct ieee80211_tx_data {
+ 	unsigned int flags;
+ };
+ 
++
++typedef unsigned __bitwise ieee80211_rx_result;
++#define RX_CONTINUE		((__force ieee80211_rx_result) 0u)
++#define RX_DROP_UNUSABLE	((__force ieee80211_rx_result) 1u)
++#define RX_DROP_MONITOR		((__force ieee80211_rx_result) 2u)
++#define RX_QUEUED		((__force ieee80211_rx_result) 3u)
++
+ /**
+  * enum ieee80211_packet_rx_flags - packet RX flags
+  * @IEEE80211_RX_AMSDU: a-MSDU packet
+diff --git a/net/mac80211/main.c b/net/mac80211/main.c
+index c2f25a4..e2f7ae5 100644
+--- a/net/mac80211/main.c
++++ b/net/mac80211/main.c
+@@ -22,7 +22,6 @@
+ #include <linux/bitmap.h>
+ #include <linux/inetdevice.h>
+ #include <net/net_namespace.h>
+-#include <net/dropreason.h>
+ #include <net/cfg80211.h>
+ #include <net/addrconf.h>
+ 
+@@ -1544,28 +1543,6 @@ void ieee80211_free_hw(struct ieee80211_hw *hw)
+ }
+ EXPORT_SYMBOL(ieee80211_free_hw);
+ 
+-static const char * const drop_reasons_monitor[] = {
+-#define V(x)	#x,
+-	[0] = "RX_DROP_MONITOR",
+-	MAC80211_DROP_REASONS_MONITOR(V)
+-};
+-
+-static struct drop_reason_list drop_reason_list_monitor = {
+-	.reasons = drop_reasons_monitor,
+-	.n_reasons = ARRAY_SIZE(drop_reasons_monitor),
+-};
+-
+-static const char * const drop_reasons_unusable[] = {
+-	[0] = "RX_DROP_UNUSABLE",
+-	MAC80211_DROP_REASONS_UNUSABLE(V)
+-#undef V
+-};
+-
+-static struct drop_reason_list drop_reason_list_unusable = {
+-	.reasons = drop_reasons_unusable,
+-	.n_reasons = ARRAY_SIZE(drop_reasons_unusable),
+-};
+-
+ static int __init ieee80211_init(void)
+ {
+ 	struct sk_buff *skb;
+@@ -1583,11 +1560,6 @@ static int __init ieee80211_init(void)
+ 	if (ret)
+ 		goto err_netdev;
+ 
+-	drop_reasons_register_subsys(SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR,
+-				     &drop_reason_list_monitor);
+-	drop_reasons_register_subsys(SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE,
+-				     &drop_reason_list_unusable);
+-
+ 	return 0;
+  err_netdev:
+ 	rc80211_minstrel_exit();
+@@ -1603,9 +1575,6 @@ static void __exit ieee80211_exit(void)
+ 
+ 	ieee80211_iface_exit();
+ 
+-	drop_reasons_unregister_subsys(SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR);
+-	drop_reasons_unregister_subsys(SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE);
+-
+ 	rcu_barrier();
+ }
+ 
+diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
+index 491047d..8ffe90d 100644
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -1828,7 +1828,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
+ 				cfg80211_rx_unexpected_4addr_frame(
+ 					rx->sdata->dev, sta->sta.addr,
+ 					GFP_ATOMIC);
+-			return RX_DROP_M_UNEXPECTED_4ADDR_FRAME;
++			return RX_DROP_MONITOR;
+ 		}
+ 		/*
+ 		 * Update counter and free packet here to avoid
+@@ -1963,7 +1963,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
+ 				cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev,
+ 							     skb->data,
+ 							     skb->len);
+-			return RX_DROP_M_BAD_BCN_KEYIDX;
++			return RX_DROP_MONITOR; /* unexpected BIP keyidx */
+ 		}
+ 
+ 		rx->key = ieee80211_rx_get_bigtk(rx, mmie_keyidx);
+@@ -1977,7 +1977,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
+ 
+ 		if (mmie_keyidx < NUM_DEFAULT_KEYS ||
+ 		    mmie_keyidx >= NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS)
+-			return RX_DROP_M_BAD_MGMT_KEYIDX; /* unexpected BIP keyidx */
++			return RX_DROP_MONITOR; /* unexpected BIP keyidx */
+ 		if (rx->link_sta) {
+ 			if (ieee80211_is_group_privacy_action(skb) &&
+ 			    test_sta_flag(rx->sta, WLAN_STA_MFP))
+@@ -3981,8 +3981,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
+ }
+ 
+ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx,
+-					struct ieee80211_rate *rate,
+-					ieee80211_rx_result reason)
++					struct ieee80211_rate *rate)
+ {
+ 	struct ieee80211_sub_if_data *sdata;
+ 	struct ieee80211_local *local = rx->local;
+@@ -4046,38 +4045,42 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx,
+ 	}
+ 
+  out_free_skb:
+-	kfree_skb_reason(skb, (__force u32)reason);
++	dev_kfree_skb(skb);
+ }
+ 
+ static void ieee80211_rx_handlers_result(struct ieee80211_rx_data *rx,
+ 					 ieee80211_rx_result res)
+ {
+-	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
+-	struct ieee80211_supported_band *sband;
+-	struct ieee80211_rate *rate = NULL;
+-
+-	if (res == RX_QUEUED) {
+-		I802_DEBUG_INC(rx->sdata->local->rx_handlers_queued);
+-		return;
+-	}
+-
+-	if (res != RX_CONTINUE) {
++	switch (res) {
++	case RX_DROP_MONITOR:
+ 		I802_DEBUG_INC(rx->sdata->local->rx_handlers_drop);
+ 		if (rx->sta)
+ 			rx->link_sta->rx_stats.dropped++;
+-	}
++		fallthrough;
++	case RX_CONTINUE: {
++		struct ieee80211_rate *rate = NULL;
++		struct ieee80211_supported_band *sband;
++		struct ieee80211_rx_status *status;
+ 
+-	if (u32_get_bits((__force u32)res, SKB_DROP_REASON_SUBSYS_MASK) ==
+-			SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE) {
+-		kfree_skb_reason(rx->skb, (__force u32)res);
+-		return;
+-	}
++		status = IEEE80211_SKB_RXCB((rx->skb));
+ 
+-	sband = rx->local->hw.wiphy->bands[status->band];
+-	if (status->encoding == RX_ENC_LEGACY)
+-		rate = &sband->bitrates[status->rate_idx];
++		sband = rx->local->hw.wiphy->bands[status->band];
++		if (status->encoding == RX_ENC_LEGACY)
++			rate = &sband->bitrates[status->rate_idx];
+ 
+-	ieee80211_rx_cooked_monitor(rx, rate, res);
++		ieee80211_rx_cooked_monitor(rx, rate);
++		break;
++		}
++	case RX_DROP_UNUSABLE:
++		I802_DEBUG_INC(rx->sdata->local->rx_handlers_drop);
++		if (rx->sta)
++			rx->link_sta->rx_stats.dropped++;
++		dev_kfree_skb(rx->skb);
++		break;
++	case RX_QUEUED:
++		I802_DEBUG_INC(rx->sdata->local->rx_handlers_queued);
++		break;
++	}
+ }
+ 
+ static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx,
+diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
+index 4133496..20f742b 100644
+--- a/net/mac80211/wpa.c
++++ b/net/mac80211/wpa.c
+@@ -550,7 +550,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx,
+ 		if (res < 0 ||
+ 		    (!res && !(status->flag & RX_FLAG_ALLOW_SAME_PN))) {
+ 			key->u.ccmp.replays++;
+-			return RX_DROP_U_REPLAY;
++			return RX_DROP_UNUSABLE;
+ 		}
+ 
+ 		if (!(status->flag & RX_FLAG_DECRYPTED)) {
+@@ -564,7 +564,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx,
+ 				    skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN,
+ 				    data_len,
+ 				    skb->data + skb->len - mic_len))
+-				return RX_DROP_U_MIC_FAIL;
++				return RX_DROP_UNUSABLE;
+ 		}
+ 
+ 		memcpy(key->u.ccmp.rx_pn[queue], pn, IEEE80211_CCMP_PN_LEN);
+@@ -746,7 +746,7 @@ ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx)
+ 		if (res < 0 ||
+ 		    (!res && !(status->flag & RX_FLAG_ALLOW_SAME_PN))) {
+ 			key->u.gcmp.replays++;
+-			return RX_DROP_U_REPLAY;
++			return RX_DROP_UNUSABLE;
+ 		}
+ 
+ 		if (!(status->flag & RX_FLAG_DECRYPTED)) {
+@@ -761,7 +761,7 @@ ieee80211_crypto_gcmp_decrypt(struct ieee80211_rx_data *rx)
+ 				    data_len,
+ 				    skb->data + skb->len -
+ 				    IEEE80211_GCMP_MIC_LEN))
+-				return RX_DROP_U_MIC_FAIL;
++				return RX_DROP_UNUSABLE;
+ 		}
+ 
+ 		memcpy(key->u.gcmp.rx_pn[queue], pn, IEEE80211_GCMP_PN_LEN);
+@@ -930,13 +930,13 @@ ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx)
+ 		(skb->data + skb->len - sizeof(*mmie));
+ 	if (mmie->element_id != WLAN_EID_MMIE ||
+ 	    mmie->length != sizeof(*mmie) - 2)
+-		return RX_DROP_U_BAD_MMIE; /* Invalid MMIE */
++		return RX_DROP_UNUSABLE; /* Invalid MMIE */
+ 
+ 	bip_ipn_swap(ipn, mmie->sequence_number);
+ 
+ 	if (memcmp(ipn, key->u.aes_cmac.rx_pn, 6) <= 0) {
+ 		key->u.aes_cmac.replays++;
+-		return RX_DROP_U_REPLAY;
++		return RX_DROP_UNUSABLE;
+ 	}
+ 
+ 	if (!(status->flag & RX_FLAG_DECRYPTED)) {
+@@ -946,7 +946,7 @@ ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx)
+ 				   skb->data + 24, skb->len - 24, mic);
+ 		if (crypto_memneq(mic, mmie->mic, sizeof(mmie->mic))) {
+ 			key->u.aes_cmac.icverrors++;
+-			return RX_DROP_U_MIC_FAIL;
++			return RX_DROP_UNUSABLE;
+ 		}
+ 	}
+ 
+@@ -986,7 +986,7 @@ ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx)
+ 
+ 	if (memcmp(ipn, key->u.aes_cmac.rx_pn, 6) <= 0) {
+ 		key->u.aes_cmac.replays++;
+-		return RX_DROP_U_REPLAY;
++		return RX_DROP_UNUSABLE;
+ 	}
+ 
+ 	if (!(status->flag & RX_FLAG_DECRYPTED)) {
+@@ -996,7 +996,7 @@ ieee80211_crypto_aes_cmac_256_decrypt(struct ieee80211_rx_data *rx)
+ 				       skb->data + 24, skb->len - 24, mic);
+ 		if (crypto_memneq(mic, mmie->mic, sizeof(mmie->mic))) {
+ 			key->u.aes_cmac.icverrors++;
+-			return RX_DROP_U_MIC_FAIL;
++			return RX_DROP_UNUSABLE;
+ 		}
+ 	}
+ 
+@@ -1079,13 +1079,13 @@ ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx)
+ 		(skb->data + skb->len - sizeof(*mmie));
+ 	if (mmie->element_id != WLAN_EID_MMIE ||
+ 	    mmie->length != sizeof(*mmie) - 2)
+-		return RX_DROP_U_BAD_MMIE; /* Invalid MMIE */
++		return RX_DROP_UNUSABLE; /* Invalid MMIE */
+ 
+ 	bip_ipn_swap(ipn, mmie->sequence_number);
+ 
+ 	if (memcmp(ipn, key->u.aes_gmac.rx_pn, 6) <= 0) {
+ 		key->u.aes_gmac.replays++;
+-		return RX_DROP_U_REPLAY;
++		return RX_DROP_UNUSABLE;
+ 	}
+ 
+ 	if (!(status->flag & RX_FLAG_DECRYPTED)) {
+@@ -1104,7 +1104,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx)
+ 		    crypto_memneq(mic, mmie->mic, sizeof(mmie->mic))) {
+ 			key->u.aes_gmac.icverrors++;
+ 			kfree(mic);
+-			return RX_DROP_U_MIC_FAIL;
++			return RX_DROP_UNUSABLE;
+ 		}
+ 		kfree(mic);
+ 	}
+-- 
+2.39.2
+
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0002-mac80211-support-minimal-EHT-rate-reporting-on-RX.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0002-mac80211-support-minimal-EHT-rate-reporting-on-RX.patch
deleted file mode 100644
index c063f3e..0000000
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0002-mac80211-support-minimal-EHT-rate-reporting-on-RX.patch
+++ /dev/null
@@ -1,192 +0,0 @@
-From 2ff2e76bdbbbe8fa6923c274f276110f86acfb6a Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Mon, 9 Jan 2023 13:07:21 +0200
-Subject: [PATCH 2/9] mac80211: support minimal EHT rate reporting on RX
-
-Add minimal support for RX EHT rate reporting, not yet
-adding (modifying) any radiotap headers, just statistics
-for cfg80211.
-
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- include/net/mac80211.h  | 19 ++++++++++++++++---
- net/mac80211/rx.c       |  9 +++++++++
- net/mac80211/sta_info.c |  9 ++++++++-
- net/mac80211/sta_info.h | 24 ++++++++++++++++++------
- net/mac80211/util.c     | 13 +++++++++++++
- 5 files changed, 64 insertions(+), 10 deletions(-)
-
-diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index 9c59eb8..3388cc7 100644
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -1468,6 +1468,7 @@ enum mac80211_rx_encoding {
- 	RX_ENC_HT,
- 	RX_ENC_VHT,
- 	RX_ENC_HE,
-+	RX_ENC_EHT,
- };
- 
- /**
-@@ -1501,7 +1502,7 @@ enum mac80211_rx_encoding {
-  * @antenna: antenna used
-  * @rate_idx: index of data rate into band's supported rates or MCS index if
-  *	HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT)
-- * @nss: number of streams (VHT and HE only)
-+ * @nss: number of streams (VHT, HE and EHT only)
-  * @flag: %RX_FLAG_\*
-  * @encoding: &enum mac80211_rx_encoding
-  * @bw: &enum rate_info_bw
-@@ -1509,6 +1510,8 @@ enum mac80211_rx_encoding {
-  * @he_ru: HE RU, from &enum nl80211_he_ru_alloc
-  * @he_gi: HE GI, from &enum nl80211_he_gi
-  * @he_dcm: HE DCM value
-+ * @eht.ru: EHT RU, from &enum nl80211_eht_ru_alloc
-+ * @eht.gi: EHT GI, from &enum nl80211_eht_gi
-  * @rx_flags: internal RX flags for mac80211
-  * @ampdu_reference: A-MPDU reference number, must be a different value for
-  *	each A-MPDU but the same for each subframe within one A-MPDU
-@@ -1530,8 +1533,18 @@ struct ieee80211_rx_status {
- 	u32 flag;
- 	u16 freq: 13, freq_offset: 1;
- 	u8 enc_flags;
--	u8 encoding:2, bw:3, he_ru:3;
--	u8 he_gi:2, he_dcm:1;
-+	u8 encoding:3, bw:4;
-+	union {
-+		struct {
-+			u8 he_ru:3;
-+			u8 he_gi:2;
-+			u8 he_dcm:1;
-+		};
-+		struct {
-+			u8 ru:4;
-+			u8 gi:2;
-+		} eht;
-+	};
- 	u8 rate_idx;
- 	u8 nss;
- 	u8 rx_flags;
-diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
-index 46ae9e9..fadf2be 100644
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -5328,6 +5328,15 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
- 				      status->rate_idx, status->nss))
- 				goto drop;
- 			break;
-+		case RX_ENC_EHT:
-+			if (WARN_ONCE(status->rate_idx > 15 ||
-+				      !status->nss ||
-+				      status->nss > 8 ||
-+				      status->eht.gi > NL80211_RATE_INFO_EHT_GI_3_2,
-+				      "Rate marked as an EHT rate but data is invalid: MCS:%d, NSS:%d, GI:%d\n",
-+				      status->rate_idx, status->nss, status->eht.gi))
-+				goto drop;
-+			break;
- 		default:
- 			WARN_ON_ONCE(1);
- 			fallthrough;
-diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
-index a13a8fb..50daa22 100644
---- a/net/mac80211/sta_info.c
-+++ b/net/mac80211/sta_info.c
-@@ -4,7 +4,7 @@
-  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
-- * Copyright (C) 2018-2021 Intel Corporation
-+ * Copyright (C) 2018-2022 Intel Corporation
-  */
- 
- #include <linux/module.h>
-@@ -2384,6 +2384,13 @@ static void sta_stats_decode_rate(struct ieee80211_local *local, u32 rate,
- 		rinfo->he_ru_alloc = STA_STATS_GET(HE_RU, rate);
- 		rinfo->he_dcm = STA_STATS_GET(HE_DCM, rate);
- 		break;
-+	case STA_STATS_RATE_TYPE_EHT:
-+		rinfo->flags = RATE_INFO_FLAGS_EHT_MCS;
-+		rinfo->mcs = STA_STATS_GET(EHT_MCS, rate);
-+		rinfo->nss = STA_STATS_GET(EHT_NSS, rate);
-+		rinfo->eht_gi = STA_STATS_GET(EHT_GI, rate);
-+		rinfo->eht_ru_alloc = STA_STATS_GET(EHT_RU, rate);
-+		break;
- 	}
- }
- 
-diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
-index 759a1a8..ec8dff0 100644
---- a/net/mac80211/sta_info.h
-+++ b/net/mac80211/sta_info.h
-@@ -930,6 +930,7 @@ enum sta_stats_type {
- 	STA_STATS_RATE_TYPE_VHT,
- 	STA_STATS_RATE_TYPE_HE,
- 	STA_STATS_RATE_TYPE_S1G,
-+	STA_STATS_RATE_TYPE_EHT,
- };
- 
- #define STA_STATS_FIELD_HT_MCS		GENMASK( 7,  0)
-@@ -939,12 +940,16 @@ enum sta_stats_type {
- #define STA_STATS_FIELD_VHT_NSS		GENMASK( 7,  4)
- #define STA_STATS_FIELD_HE_MCS		GENMASK( 3,  0)
- #define STA_STATS_FIELD_HE_NSS		GENMASK( 7,  4)
--#define STA_STATS_FIELD_BW		GENMASK(11,  8)
--#define STA_STATS_FIELD_SGI		GENMASK(12, 12)
--#define STA_STATS_FIELD_TYPE		GENMASK(15, 13)
--#define STA_STATS_FIELD_HE_RU		GENMASK(18, 16)
--#define STA_STATS_FIELD_HE_GI		GENMASK(20, 19)
--#define STA_STATS_FIELD_HE_DCM		GENMASK(21, 21)
-+#define STA_STATS_FIELD_EHT_MCS		GENMASK( 3,  0)
-+#define STA_STATS_FIELD_EHT_NSS		GENMASK( 7,  4)
-+#define STA_STATS_FIELD_BW		GENMASK(12,  8)
-+#define STA_STATS_FIELD_SGI		GENMASK(13, 13)
-+#define STA_STATS_FIELD_TYPE		GENMASK(16, 14)
-+#define STA_STATS_FIELD_HE_RU		GENMASK(19, 17)
-+#define STA_STATS_FIELD_HE_GI		GENMASK(21, 20)
-+#define STA_STATS_FIELD_HE_DCM		GENMASK(22, 22)
-+#define STA_STATS_FIELD_EHT_RU		GENMASK(20, 17)
-+#define STA_STATS_FIELD_EHT_GI		GENMASK(22, 21)
- 
- #define STA_STATS_FIELD(_n, _v)		FIELD_PREP(STA_STATS_FIELD_ ## _n, _v)
- #define STA_STATS_GET(_n, _v)		FIELD_GET(STA_STATS_FIELD_ ## _n, _v)
-@@ -983,6 +988,13 @@ static inline u32 sta_stats_encode_rate(struct ieee80211_rx_status *s)
- 		r |= STA_STATS_FIELD(HE_RU, s->he_ru);
- 		r |= STA_STATS_FIELD(HE_DCM, s->he_dcm);
- 		break;
-+	case RX_ENC_EHT:
-+		r |= STA_STATS_FIELD(TYPE, STA_STATS_RATE_TYPE_EHT);
-+		r |= STA_STATS_FIELD(EHT_NSS, s->nss);
-+		r |= STA_STATS_FIELD(EHT_MCS, s->rate_idx);
-+		r |= STA_STATS_FIELD(EHT_GI, s->eht.gi);
-+		r |= STA_STATS_FIELD(EHT_RU, s->eht.ru);
-+		break;
- 	default:
- 		WARN_ON(1);
- 		return STA_STATS_RATE_INVALID;
-diff --git a/net/mac80211/util.c b/net/mac80211/util.c
-index 83f6c56..5a6c091 100644
---- a/net/mac80211/util.c
-+++ b/net/mac80211/util.c
-@@ -3900,6 +3900,19 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
- 
- 	/* Fill cfg80211 rate info */
- 	switch (status->encoding) {
-+	case RX_ENC_EHT:
-+		ri.flags |= RATE_INFO_FLAGS_EHT_MCS;
-+		ri.mcs = status->rate_idx;
-+		ri.nss = status->nss;
-+		ri.eht_ru_alloc = status->eht.ru;
-+		if (status->enc_flags & RX_ENC_FLAG_SHORT_GI)
-+			ri.flags |= RATE_INFO_FLAGS_SHORT_GI;
-+		/* TODO/FIXME: is this right? handle other PPDUs */
-+		if (status->flag & RX_FLAG_MACTIME_PLCP_START) {
-+			mpdu_offset += 2;
-+			ts += 36;
-+		}
-+		break;
- 	case RX_ENC_HE:
- 		ri.flags |= RATE_INFO_FLAGS_HE_MCS;
- 		ri.mcs = status->rate_idx;
--- 
-2.39.2
-
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0003-cfg80211-Update-Transition-Disable-policy-during-por.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0003-cfg80211-Update-Transition-Disable-policy-during-por.patch
deleted file mode 100644
index a3f6dda..0000000
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0003-cfg80211-Update-Transition-Disable-policy-during-por.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-From e0756f54dea42f1833e40ddfb0deb5d0b8e6dda4 Mon Sep 17 00:00:00 2001
-From: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
-Date: Wed, 7 Sep 2022 18:14:48 +0530
-Subject: [PATCH 3/9] cfg80211: Update Transition Disable policy during port
- authorization
-
-In case of 4way handshake offload, transition disable policy
-updated by the AP during EAPOL 3/4 is not updated to the upper layer.
-This results in mismatch between transition disable policy
-between the upper layer and the driver. This patch addresses this
-issue by updating transition disable policy as part of port
-authorization indication.
-
-Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c  |  2 +-
- include/net/cfg80211.h                               |  4 +++-
- include/uapi/linux/nl80211.h                         |  3 +++
- net/wireless/core.h                                  |  5 ++++-
- net/wireless/nl80211.c                               |  8 +++++++-
- net/wireless/nl80211.h                               |  3 ++-
- net/wireless/sme.c                                   | 12 ++++++++----
- net/wireless/util.c                                  |  4 +++-
- 8 files changed, 31 insertions(+), 10 deletions(-)
-
-diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-index ea8409e..bddc0af 100644
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -6005,7 +6005,7 @@ done:
- 	brcmf_dbg(CONN, "Report roaming result\n");
- 
- 	if (profile->use_fwsup == BRCMF_PROFILE_FWSUP_1X && profile->is_ft) {
--		cfg80211_port_authorized(ndev, profile->bssid, GFP_KERNEL);
-+		cfg80211_port_authorized(ndev, profile->bssid, NULL, 0, GFP_KERNEL);
- 		brcmf_dbg(CONN, "Report port authorized\n");
- 	}
- 
-diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
-index 803949b..9420086 100644
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -7717,6 +7717,8 @@ void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info,
-  *
-  * @dev: network device
-  * @bssid: the BSSID of the AP
-+ * @td_bitmap: transition disable policy
-+ * @td_bitmap_len: Length of transition disable policy
-  * @gfp: allocation flags
-  *
-  * This function should be called by a driver that supports 4 way handshake
-@@ -7727,7 +7729,7 @@ void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info,
-  * indicate the 802.11 association.
-  */
- void cfg80211_port_authorized(struct net_device *dev, const u8 *bssid,
--			      gfp_t gfp);
-+			      const u8* td_bitmap, u8 td_bitmap_len, gfp_t gfp);
- 
- /**
-  * cfg80211_disconnected - notify cfg80211 that connection was dropped
-diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
-index c32e761..c14a91b 100644
---- a/include/uapi/linux/nl80211.h
-+++ b/include/uapi/linux/nl80211.h
-@@ -2749,6 +2749,8 @@ enum nl80211_commands {
-  *	When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the ack RX
-  *	timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
-  *	the incoming frame RX timestamp.
-+ * @NL80211_ATTR_TD_BITMAP: Transition Disable bitmap, for subsequent
-+ *	(re)associations.
-  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
-  * @NL80211_ATTR_MAX: highest attribute number currently defined
-  * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -3276,6 +3278,7 @@ enum nl80211_attrs {
- 
- 	NL80211_ATTR_TX_HW_TIMESTAMP,
- 	NL80211_ATTR_RX_HW_TIMESTAMP,
-+	NL80211_ATTR_TD_BITMAP,
- 
- 	/* add attributes here, update the policy in nl80211.c */
- 
-diff --git a/net/wireless/core.h b/net/wireless/core.h
-index f4d3b83..382455c 100644
---- a/net/wireless/core.h
-+++ b/net/wireless/core.h
-@@ -271,6 +271,8 @@ struct cfg80211_event {
- 		} ij;
- 		struct {
- 			u8 bssid[ETH_ALEN];
-+			const u8 *td_bitmap;
-+			u8 td_bitmap_len;
- 		} pa;
- 	};
- };
-@@ -409,7 +411,8 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
- 			bool wextev);
- void __cfg80211_roamed(struct wireless_dev *wdev,
- 		       struct cfg80211_roam_info *info);
--void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid);
-+void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid,
-+				const u8 *td_bitmap, u8 td_bitmap_len);
- int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
- 			      struct wireless_dev *wdev);
- void cfg80211_autodisconnect_wk(struct work_struct *work);
-diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index 777c141..6a97e52 100644
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -17936,7 +17936,8 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
- }
- 
- void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev,
--				  struct net_device *netdev, const u8 *bssid)
-+				  struct net_device *netdev, const u8 *bssid,
-+				  const u8 *td_bitmap, u8 td_bitmap_len)
- {
- 	struct sk_buff *msg;
- 	void *hdr;
-@@ -17956,6 +17957,11 @@ void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev,
- 	    nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid))
- 		goto nla_put_failure;
- 
-+	if ((td_bitmap_len > 0) && td_bitmap)
-+		if (nla_put(msg, NL80211_ATTR_TD_BITMAP,
-+			    td_bitmap_len, td_bitmap))
-+			goto nla_put_failure;
-+
- 	genlmsg_end(msg, hdr);
- 
- 	genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
-diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
-index 855d540..ba9457e 100644
---- a/net/wireless/nl80211.h
-+++ b/net/wireless/nl80211.h
-@@ -83,7 +83,8 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
- 			 struct net_device *netdev,
- 			 struct cfg80211_roam_info *info, gfp_t gfp);
- void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev,
--				  struct net_device *netdev, const u8 *bssid);
-+				  struct net_device *netdev, const u8 *bssid,
-+				  const u8 *td_bitmap, u8 td_bitmap_len);
- void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
- 			       struct net_device *netdev, u16 reason,
- 			       const u8 *ie, size_t ie_len, bool from_ap);
-diff --git a/net/wireless/sme.c b/net/wireless/sme.c
-index 05e4f29..1ee4408 100644
---- a/net/wireless/sme.c
-+++ b/net/wireless/sme.c
-@@ -1266,7 +1266,8 @@ out:
- }
- EXPORT_SYMBOL(cfg80211_roamed);
- 
--void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid)
-+void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid,
-+					const u8 *td_bitmap, u8 td_bitmap_len)
- {
- 	ASSERT_WDEV_LOCK(wdev);
- 
-@@ -1279,11 +1280,11 @@ void __cfg80211_port_authorized(struct wireless_dev *wdev, const u8 *bssid)
- 		return;
- 
- 	nl80211_send_port_authorized(wiphy_to_rdev(wdev->wiphy), wdev->netdev,
--				     bssid);
-+				     bssid, td_bitmap, td_bitmap_len);
- }
- 
- void cfg80211_port_authorized(struct net_device *dev, const u8 *bssid,
--			      gfp_t gfp)
-+			      const u8 *td_bitmap, u8 td_bitmap_len, gfp_t gfp)
- {
- 	struct wireless_dev *wdev = dev->ieee80211_ptr;
- 	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
-@@ -1293,12 +1294,15 @@ void cfg80211_port_authorized(struct net_device *dev, const u8 *bssid,
- 	if (WARN_ON(!bssid))
- 		return;
- 
--	ev = kzalloc(sizeof(*ev), gfp);
-+	ev = kzalloc(sizeof(*ev) + td_bitmap_len, gfp);
- 	if (!ev)
- 		return;
- 
- 	ev->type = EVENT_PORT_AUTHORIZED;
- 	memcpy(ev->pa.bssid, bssid, ETH_ALEN);
-+	ev->pa.td_bitmap = ((u8 *)ev) + sizeof(*ev);
-+	ev->pa.td_bitmap_len = td_bitmap_len;
-+	memcpy((void *)ev->pa.td_bitmap, td_bitmap, td_bitmap_len);
- 
- 	/*
- 	 * Use the wdev event list so that if there are pending
-diff --git a/net/wireless/util.c b/net/wireless/util.c
-index 769f8fe..fdc140e 100644
---- a/net/wireless/util.c
-+++ b/net/wireless/util.c
-@@ -1057,7 +1057,9 @@ void cfg80211_process_wdev_events(struct wireless_dev *wdev)
- 			__cfg80211_leave(wiphy_to_rdev(wdev->wiphy), wdev);
- 			break;
- 		case EVENT_PORT_AUTHORIZED:
--			__cfg80211_port_authorized(wdev, ev->pa.bssid);
-+			__cfg80211_port_authorized(wdev, ev->pa.bssid,
-+						   ev->pa.td_bitmap,
-+						   ev->pa.td_bitmap_len);
- 			break;
- 		}
- 		wdev_unlock(wdev);
--- 
-2.39.2
-
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0004-wifi-mac80211-mlme-handle-EHT-channel-puncturing.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0004-wifi-mac80211-mlme-handle-EHT-channel-puncturing.patch
deleted file mode 100644
index d455dd0..0000000
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0004-wifi-mac80211-mlme-handle-EHT-channel-puncturing.patch
+++ /dev/null
@@ -1,400 +0,0 @@
-From 67ce530e39e0372f11006c5695f682e71152f7b7 Mon Sep 17 00:00:00 2001
-From: Johannes Berg <johannes.berg@intel.com>
-Date: Fri, 27 Jan 2023 12:39:31 +0100
-Subject: [PATCH 4/9] wifi: mac80211: mlme: handle EHT channel puncturing
-
-Handle the Puncturing info received from the AP in the
-EHT Operation element in beacons.
-
-If the info is invalid:
- - during association: disable EHT connection for the AP
- - after association: disconnect
-
-This commit includes many (internal) bugfixes and spec
-updates various people.
-
-Co-developed-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
-Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
-Link: https://lore.kernel.org/r/20230127123930.4fbc74582331.I3547481d49f958389f59dfeba3fcc75e72b0aa6e@changeid
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- include/net/mac80211.h     |   5 +-
- net/mac80211/cfg.c         |   2 +-
- net/mac80211/chan.c        |   2 +-
- net/mac80211/ieee80211_i.h |   2 +-
- net/mac80211/mlme.c        | 224 ++++++++++++++++++++++++++++++++++++-
- 5 files changed, 228 insertions(+), 7 deletions(-)
-
-diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index 3388cc7..8fb38c9 100644
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -340,7 +340,7 @@ struct ieee80211_vif_chanctx_switch {
-  * @BSS_CHANGED_FILS_DISCOVERY: FILS discovery status changed.
-  * @BSS_CHANGED_UNSOL_BCAST_PROBE_RESP: Unsolicited broadcast probe response
-  *	status changed.
-- *
-+ * @BSS_CHANGED_EHT_PUNCTURING: The channel puncturing bitmap changed.
-  */
- enum ieee80211_bss_change {
- 	BSS_CHANGED_ASSOC		= 1<<0,
-@@ -375,6 +375,7 @@ enum ieee80211_bss_change {
- 	BSS_CHANGED_HE_BSS_COLOR	= 1<<29,
- 	BSS_CHANGED_FILS_DISCOVERY      = 1<<30,
- 	BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = 1<<31,
-+	BSS_CHANGED_EHT_PUNCTURING	= BIT_ULL(32),
- 
- 	/* when adding here, make sure to change ieee80211_reconfig */
- };
-@@ -640,6 +641,7 @@ struct ieee80211_fils_discovery {
-  * @tx_pwr_env_num: number of @tx_pwr_env.
-  * @pwr_reduction: power constraint of BSS.
-  * @eht_support: does this BSS support EHT
-+ * @eht_puncturing: bitmap to indicate which channels are punctured in this BSS
-  * @csa_active: marks whether a channel switch is going on. Internally it is
-  *	write-protected by sdata_lock and local->mtx so holding either is fine
-  *	for read access.
-@@ -739,6 +741,7 @@ struct ieee80211_bss_conf {
- 	u8 tx_pwr_env_num;
- 	u8 pwr_reduction;
- 	bool eht_support;
-+	u16 eht_puncturing;
- 
- 	bool csa_active;
- 	bool mu_mimo_owner;
-diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 7a5e459..5bb43de 100644
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -4181,7 +4181,7 @@ static int ieee80211_set_ap_chanwidth(struct wiphy *wiphy,
- 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- 	struct ieee80211_link_data *link;
- 	int ret;
--	u32 changed = 0;
-+	u64 changed = 0;
- 
- 	link = sdata_dereference(sdata->link[link_id], sdata);
- 
-diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
-index e72cf07..dbc34fb 100644
---- a/net/mac80211/chan.c
-+++ b/net/mac80211/chan.c
-@@ -1916,7 +1916,7 @@ int ieee80211_link_use_reserved_context(struct ieee80211_link_data *link)
- 
- int ieee80211_link_change_bandwidth(struct ieee80211_link_data *link,
- 				    const struct cfg80211_chan_def *chandef,
--				    u32 *changed)
-+				    u64 *changed)
- {
- 	struct ieee80211_sub_if_data *sdata = link->sdata;
- 	struct ieee80211_bss_conf *link_conf = link->conf;
-diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
-index a4fab9a..04128d5 100644
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -2487,7 +2487,7 @@ int ieee80211_link_unreserve_chanctx(struct ieee80211_link_data *link);
- int __must_check
- ieee80211_link_change_bandwidth(struct ieee80211_link_data *link,
- 				const struct cfg80211_chan_def *chandef,
--				u32 *changed);
-+				u64 *changed);
- void ieee80211_link_release_channel(struct ieee80211_link_data *link);
- void ieee80211_link_vlan_copy_chanctx(struct ieee80211_link_data *link);
- void ieee80211_link_copy_chanctx_to_vlans(struct ieee80211_link_data *link,
-diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
-index 0125b3e..8c69fd6 100644
---- a/net/mac80211/mlme.c
-+++ b/net/mac80211/mlme.c
-@@ -8,7 +8,7 @@
-  * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
-- * Copyright (C) 2018 - 2022 Intel Corporation
-+ * Copyright (C) 2018 - 2023 Intel Corporation
-  */
- 
- #include <linux/delay.h>
-@@ -88,6 +88,141 @@ MODULE_PARM_DESC(probe_wait_ms,
-  */
- #define IEEE80211_SIGNAL_AVE_MIN_COUNT	4
- 
-+struct ieee80211_per_bw_puncturing_values {
-+	u8 len;
-+	const u16 *valid_values;
-+};
-+
-+static const u16 puncturing_values_80mhz[] = {
-+	0x8, 0x4, 0x2, 0x1
-+};
-+
-+static const u16 puncturing_values_160mhz[] = {
-+	 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1, 0xc0, 0x30, 0xc, 0x3
-+};
-+
-+static const u16 puncturing_values_320mhz[] = {
-+	0xc000, 0x3000, 0xc00, 0x300, 0xc0, 0x30, 0xc, 0x3, 0xf000, 0xf00,
-+	0xf0, 0xf, 0xfc00, 0xf300, 0xf0c0, 0xf030, 0xf00c, 0xf003, 0xc00f,
-+	0x300f, 0xc0f, 0x30f, 0xcf, 0x3f
-+};
-+
-+#define IEEE80211_PER_BW_VALID_PUNCTURING_VALUES(_bw) \
-+	{ \
-+		.len = ARRAY_SIZE(puncturing_values_ ## _bw ## mhz), \
-+		.valid_values = puncturing_values_ ## _bw ## mhz \
-+	}
-+
-+static const struct ieee80211_per_bw_puncturing_values per_bw_puncturing[] = {
-+	IEEE80211_PER_BW_VALID_PUNCTURING_VALUES(80),
-+	IEEE80211_PER_BW_VALID_PUNCTURING_VALUES(160),
-+	IEEE80211_PER_BW_VALID_PUNCTURING_VALUES(320)
-+};
-+
-+static bool ieee80211_valid_disable_subchannel_bitmap(u16 *bitmap,
-+						      enum nl80211_chan_width bw)
-+{
-+	u32 idx, i;
-+
-+	switch (bw) {
-+	case NL80211_CHAN_WIDTH_80:
-+		idx = 0;
-+		break;
-+	case NL80211_CHAN_WIDTH_160:
-+		idx = 1;
-+		break;
-+	case NL80211_CHAN_WIDTH_320:
-+		idx = 2;
-+		break;
-+	default:
-+		*bitmap = 0;
-+		break;
-+	}
-+
-+	if (!*bitmap)
-+		return true;
-+
-+	for (i = 0; i < per_bw_puncturing[idx].len; i++)
-+		if (per_bw_puncturing[idx].valid_values[i] == *bitmap)
-+			return true;
-+
-+	return false;
-+}
-+
-+/*
-+ * Extract from the given disabled subchannel bitmap (raw format
-+ * from the EHT Operation Element) the bits for the subchannel
-+ * we're using right now.
-+ */
-+static u16
-+ieee80211_extract_dis_subch_bmap(const struct ieee80211_eht_operation *eht_oper,
-+				 struct cfg80211_chan_def *chandef, u16 bitmap)
-+{
-+	struct ieee80211_eht_operation_info *info = (void *)eht_oper->optional;
-+	struct cfg80211_chan_def ap_chandef = *chandef;
-+	u32 ap_center_freq, local_center_freq;
-+	u32 ap_bw, local_bw;
-+	int ap_start_freq, local_start_freq;
-+	u16 shift, mask;
-+
-+	if (!(eht_oper->params & IEEE80211_EHT_OPER_INFO_PRESENT) ||
-+	    !(eht_oper->params &
-+	      IEEE80211_EHT_OPER_DISABLED_SUBCHANNEL_BITMAP_PRESENT))
-+		return 0;
-+
-+	/* set 160/320 supported to get the full AP definition */
-+	ieee80211_chandef_eht_oper(eht_oper, true, true, &ap_chandef);
-+	ap_center_freq = ap_chandef.center_freq1;
-+	ap_bw = 20 * BIT(u8_get_bits(info->control,
-+				     IEEE80211_EHT_OPER_CHAN_WIDTH));
-+	ap_start_freq = ap_center_freq - ap_bw / 2;
-+	local_center_freq = chandef->center_freq1;
-+	local_bw = 20 * BIT(ieee80211_chan_width_to_rx_bw(chandef->width));
-+	local_start_freq = local_center_freq - local_bw / 2;
-+	shift = (local_start_freq - ap_start_freq) / 20;
-+	mask = BIT(local_bw / 20) - 1;
-+
-+	return (bitmap >> shift) & mask;
-+}
-+
-+/*
-+ * Handle the puncturing bitmap, possibly downgrading bandwidth to get a
-+ * valid bitmap.
-+ */
-+static void
-+ieee80211_handle_puncturing_bitmap(struct ieee80211_link_data *link,
-+				   const struct ieee80211_eht_operation *eht_oper,
-+				   u16 bitmap, u64 *changed)
-+{
-+	struct cfg80211_chan_def *chandef = &link->conf->chandef;
-+	u16 extracted;
-+	u64 _changed = 0;
-+
-+	if (!changed)
-+		changed = &_changed;
-+
-+	while (chandef->width > NL80211_CHAN_WIDTH_40) {
-+		extracted =
-+			ieee80211_extract_dis_subch_bmap(eht_oper, chandef,
-+							 bitmap);
-+
-+		if (ieee80211_valid_disable_subchannel_bitmap(&bitmap,
-+							      chandef->width))
-+			break;
-+		link->u.mgd.conn_flags |=
-+			ieee80211_chandef_downgrade(chandef);
-+		*changed |= BSS_CHANGED_BANDWIDTH;
-+	}
-+
-+	if (chandef->width <= NL80211_CHAN_WIDTH_40)
-+		extracted = 0;
-+
-+	if (link->conf->eht_puncturing != extracted) {
-+		link->conf->eht_puncturing = extracted;
-+		*changed |= BSS_CHANGED_EHT_PUNCTURING;
-+	}
-+}
-+
- /*
-  * We can have multiple work items (and connection probing)
-  * scheduling this timer, but we need to take care to only
-@@ -413,7 +548,7 @@ static int ieee80211_config_bw(struct ieee80211_link_data *link,
- 			       const struct ieee80211_he_operation *he_oper,
- 			       const struct ieee80211_eht_operation *eht_oper,
- 			       const struct ieee80211_s1g_oper_ie *s1g_oper,
--			       const u8 *bssid, u32 *changed)
-+			       const u8 *bssid, u64 *changed)
- {
- 	struct ieee80211_sub_if_data *sdata = link->sdata;
- 	struct ieee80211_local *local = sdata->local;
-@@ -4111,6 +4246,7 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link,
- 							    link_sta);
- 
- 			bss_conf->eht_support = link_sta->pub->eht_cap.has_eht;
-+			*changed |= BSS_CHANGED_EHT_PUNCTURING;
- 		} else {
- 			bss_conf->eht_support = false;
- 		}
-@@ -5423,6 +5559,45 @@ static bool ieee80211_rx_our_beacon(const u8 *tx_bssid,
- 	return ether_addr_equal(tx_bssid, bss->transmitted_bss->bssid);
- }
- 
-+static bool ieee80211_config_puncturing(struct ieee80211_link_data *link,
-+					const struct ieee80211_eht_operation *eht_oper,
-+					u64 *changed)
-+{
-+	u16 bitmap = 0, extracted;
-+
-+	if ((eht_oper->params & IEEE80211_EHT_OPER_INFO_PRESENT) &&
-+	    (eht_oper->params &
-+	     IEEE80211_EHT_OPER_DISABLED_SUBCHANNEL_BITMAP_PRESENT)) {
-+		const struct ieee80211_eht_operation_info *info =
-+			(void *)eht_oper->optional;
-+		const u8 *disable_subchannel_bitmap = info->optional;
-+
-+		bitmap = get_unaligned_le16(disable_subchannel_bitmap);
-+	}
-+
-+	extracted = ieee80211_extract_dis_subch_bmap(eht_oper,
-+						     &link->conf->chandef,
-+						     bitmap);
-+
-+	/* accept if there are no changes */
-+	if (!(*changed & BSS_CHANGED_BANDWIDTH) &&
-+	    extracted == link->conf->eht_puncturing)
-+		return true;
-+
-+	if (!ieee80211_valid_disable_subchannel_bitmap(&bitmap,
-+						       link->conf->chandef.width)) {
-+		link_info(link,
-+			  "Got an invalid disable subchannel bitmap from AP %pM: bitmap = 0x%x, bw = 0x%x. disconnect\n",
-+			  link->u.mgd.bssid,
-+			  bitmap,
-+			  link->conf->chandef.width);
-+		return false;
-+	}
-+
-+	ieee80211_handle_puncturing_bitmap(link, eht_oper, bitmap, changed);
-+	return true;
-+}
-+
- static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link,
- 				     struct ieee80211_hdr *hdr, size_t len,
- 				     struct ieee80211_rx_status *rx_status)
-@@ -5439,7 +5614,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link,
- 	struct ieee80211_channel *chan;
- 	struct link_sta_info *link_sta;
- 	struct sta_info *sta;
--	u32 changed = 0;
-+	u64 changed = 0;
- 	bool erp_valid;
- 	u8 erp_value = 0;
- 	u32 ncrc = 0;
-@@ -5731,6 +5906,21 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link,
- 					       elems->pwr_constr_elem,
- 					       elems->cisco_dtpc_elem);
- 
-+	if (elems->eht_operation &&
-+	    !(link->u.mgd.conn_flags & IEEE80211_CONN_DISABLE_EHT)) {
-+		if (!ieee80211_config_puncturing(link, elems->eht_operation,
-+						 &changed)) {
-+			ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
-+					       WLAN_REASON_DEAUTH_LEAVING,
-+					       true, deauth_buf);
-+			ieee80211_report_disconnect(sdata, deauth_buf,
-+						    sizeof(deauth_buf), true,
-+						    WLAN_REASON_DEAUTH_LEAVING,
-+						    false);
-+			goto free;
-+		}
-+	}
-+
- 	ieee80211_link_info_change_notify(sdata, link, changed);
- free:
- 	kfree(elems);
-@@ -6832,9 +7022,12 @@ ieee80211_setup_assoc_link(struct ieee80211_sub_if_data *sdata,
- 		ieee80211_apply_htcap_overrides(sdata, &sta_ht_cap);
- 	}
- 
-+	link->conf->eht_puncturing = 0;
-+
- 	rcu_read_lock();
- 	beacon_ies = rcu_dereference(cbss->beacon_ies);
- 	if (beacon_ies) {
-+		const struct ieee80211_eht_operation *eht_oper;
- 		const struct element *elem;
- 		u8 dtim_count = 0;
- 
-@@ -6863,6 +7056,31 @@ ieee80211_setup_assoc_link(struct ieee80211_sub_if_data *sdata,
- 			link->conf->ema_ap = true;
- 		else
- 			link->conf->ema_ap = false;
-+
-+		elem = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_OPERATION,
-+					      beacon_ies->data, beacon_ies->len);
-+		eht_oper = (const void *)(elem->data + 1);
-+
-+		if (elem &&
-+		    ieee80211_eht_oper_size_ok((const void *)(elem->data + 1),
-+					       elem->datalen - 1) &&
-+		    (eht_oper->params & IEEE80211_EHT_OPER_INFO_PRESENT) &&
-+		    (eht_oper->params & IEEE80211_EHT_OPER_DISABLED_SUBCHANNEL_BITMAP_PRESENT)) {
-+			const struct ieee80211_eht_operation_info *info =
-+				(void *)eht_oper->optional;
-+			const u8 *disable_subchannel_bitmap = info->optional;
-+			u16 bitmap;
-+
-+			bitmap = get_unaligned_le16(disable_subchannel_bitmap);
-+			if (ieee80211_valid_disable_subchannel_bitmap(&bitmap,
-+								      link->conf->chandef.width))
-+				ieee80211_handle_puncturing_bitmap(link,
-+								   eht_oper,
-+								   bitmap,
-+								   NULL);
-+			else
-+				conn_flags |= IEEE80211_CONN_DISABLE_EHT;
-+		}
- 	}
- 	rcu_read_unlock();
- 
--- 
-2.39.2
-
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0005-wifi-cfg80211-move-puncturing-bitmap-validation-from.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0005-wifi-cfg80211-move-puncturing-bitmap-validation-from.patch
deleted file mode 100644
index 2a7cd07..0000000
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0005-wifi-cfg80211-move-puncturing-bitmap-validation-from.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-From 40e52a97b1bc7b280198cb63e11663d784bd48c8 Mon Sep 17 00:00:00 2001
-From: Aloka Dixit <quic_alokad@quicinc.com>
-Date: Mon, 30 Jan 2023 16:12:24 -0800
-Subject: [PATCH 5/9] wifi: cfg80211: move puncturing bitmap validation from
- mac80211
-
-- Move ieee80211_valid_disable_subchannel_bitmap() from mlme.c to
-  chan.c, rename it as cfg80211_valid_disable_subchannel_bitmap()
-  and export it.
-- Modify the prototype to include struct cfg80211_chan_def instead
-  of only bandwidth to support a check which returns false if the
-  primary channel is punctured.
-
-Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
-Link: https://lore.kernel.org/r/20230131001227.25014-2-quic_alokad@quicinc.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- include/net/cfg80211.h | 12 +++++++
- net/mac80211/mlme.c    | 73 ++++--------------------------------------
- net/wireless/chan.c    | 69 +++++++++++++++++++++++++++++++++++++++
- 3 files changed, 87 insertions(+), 67 deletions(-)
-
-diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
-index 9420086..d532612 100644
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -8948,4 +8948,16 @@ static inline int cfg80211_color_change_notify(struct net_device *dev)
- 					 0, 0);
- }
- 
-+/**
-+ * cfg80211_valid_disable_subchannel_bitmap - validate puncturing bitmap
-+ * @bitmap: bitmap to be validated
-+ * @chandef: channel definition
-+ *
-+ * Validate the puncturing bitmap.
-+ *
-+ * Return: %true if the bitmap is valid. %false otherwise.
-+ */
-+bool cfg80211_valid_disable_subchannel_bitmap(u16 *bitmap,
-+					      const struct cfg80211_chan_def *chandef);
-+
- #endif /* __NET_CFG80211_H */
-diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
-index 8c69fd6..2716ae0 100644
---- a/net/mac80211/mlme.c
-+++ b/net/mac80211/mlme.c
-@@ -88,67 +88,6 @@ MODULE_PARM_DESC(probe_wait_ms,
-  */
- #define IEEE80211_SIGNAL_AVE_MIN_COUNT	4
- 
--struct ieee80211_per_bw_puncturing_values {
--	u8 len;
--	const u16 *valid_values;
--};
--
--static const u16 puncturing_values_80mhz[] = {
--	0x8, 0x4, 0x2, 0x1
--};
--
--static const u16 puncturing_values_160mhz[] = {
--	 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1, 0xc0, 0x30, 0xc, 0x3
--};
--
--static const u16 puncturing_values_320mhz[] = {
--	0xc000, 0x3000, 0xc00, 0x300, 0xc0, 0x30, 0xc, 0x3, 0xf000, 0xf00,
--	0xf0, 0xf, 0xfc00, 0xf300, 0xf0c0, 0xf030, 0xf00c, 0xf003, 0xc00f,
--	0x300f, 0xc0f, 0x30f, 0xcf, 0x3f
--};
--
--#define IEEE80211_PER_BW_VALID_PUNCTURING_VALUES(_bw) \
--	{ \
--		.len = ARRAY_SIZE(puncturing_values_ ## _bw ## mhz), \
--		.valid_values = puncturing_values_ ## _bw ## mhz \
--	}
--
--static const struct ieee80211_per_bw_puncturing_values per_bw_puncturing[] = {
--	IEEE80211_PER_BW_VALID_PUNCTURING_VALUES(80),
--	IEEE80211_PER_BW_VALID_PUNCTURING_VALUES(160),
--	IEEE80211_PER_BW_VALID_PUNCTURING_VALUES(320)
--};
--
--static bool ieee80211_valid_disable_subchannel_bitmap(u16 *bitmap,
--						      enum nl80211_chan_width bw)
--{
--	u32 idx, i;
--
--	switch (bw) {
--	case NL80211_CHAN_WIDTH_80:
--		idx = 0;
--		break;
--	case NL80211_CHAN_WIDTH_160:
--		idx = 1;
--		break;
--	case NL80211_CHAN_WIDTH_320:
--		idx = 2;
--		break;
--	default:
--		*bitmap = 0;
--		break;
--	}
--
--	if (!*bitmap)
--		return true;
--
--	for (i = 0; i < per_bw_puncturing[idx].len; i++)
--		if (per_bw_puncturing[idx].valid_values[i] == *bitmap)
--			return true;
--
--	return false;
--}
--
- /*
-  * Extract from the given disabled subchannel bitmap (raw format
-  * from the EHT Operation Element) the bits for the subchannel
-@@ -206,8 +145,8 @@ ieee80211_handle_puncturing_bitmap(struct ieee80211_link_data *link,
- 			ieee80211_extract_dis_subch_bmap(eht_oper, chandef,
- 							 bitmap);
- 
--		if (ieee80211_valid_disable_subchannel_bitmap(&bitmap,
--							      chandef->width))
-+		if (cfg80211_valid_disable_subchannel_bitmap(&bitmap,
-+							     chandef))
- 			break;
- 		link->u.mgd.conn_flags |=
- 			ieee80211_chandef_downgrade(chandef);
-@@ -5584,8 +5523,8 @@ static bool ieee80211_config_puncturing(struct ieee80211_link_data *link,
- 	    extracted == link->conf->eht_puncturing)
- 		return true;
- 
--	if (!ieee80211_valid_disable_subchannel_bitmap(&bitmap,
--						       link->conf->chandef.width)) {
-+	if (!cfg80211_valid_disable_subchannel_bitmap(&bitmap,
-+						      &link->conf->chandef)) {
- 		link_info(link,
- 			  "Got an invalid disable subchannel bitmap from AP %pM: bitmap = 0x%x, bw = 0x%x. disconnect\n",
- 			  link->u.mgd.bssid,
-@@ -7072,8 +7011,8 @@ ieee80211_setup_assoc_link(struct ieee80211_sub_if_data *sdata,
- 			u16 bitmap;
- 
- 			bitmap = get_unaligned_le16(disable_subchannel_bitmap);
--			if (ieee80211_valid_disable_subchannel_bitmap(&bitmap,
--								      link->conf->chandef.width))
-+			if (cfg80211_valid_disable_subchannel_bitmap(&bitmap,
-+								     &link->conf->chandef))
- 				ieee80211_handle_puncturing_bitmap(link,
- 								   eht_oper,
- 								   bitmap,
-diff --git a/net/wireless/chan.c b/net/wireless/chan.c
-index 29b5c2f..d5ed976 100644
---- a/net/wireless/chan.c
-+++ b/net/wireless/chan.c
-@@ -1460,3 +1460,72 @@ struct cfg80211_chan_def *wdev_chandef(struct wireless_dev *wdev,
- 	}
- }
- EXPORT_SYMBOL(wdev_chandef);
-+
-+struct cfg80211_per_bw_puncturing_values {
-+	u8 len;
-+	const u16 *valid_values;
-+};
-+
-+static const u16 puncturing_values_80mhz[] = {
-+	0x8, 0x4, 0x2, 0x1
-+};
-+
-+static const u16 puncturing_values_160mhz[] = {
-+	 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1, 0xc0, 0x30, 0xc, 0x3
-+};
-+
-+static const u16 puncturing_values_320mhz[] = {
-+	0xc000, 0x3000, 0xc00, 0x300, 0xc0, 0x30, 0xc, 0x3, 0xf000, 0xf00,
-+	0xf0, 0xf, 0xfc00, 0xf300, 0xf0c0, 0xf030, 0xf00c, 0xf003, 0xc00f,
-+	0x300f, 0xc0f, 0x30f, 0xcf, 0x3f
-+};
-+
-+#define CFG80211_PER_BW_VALID_PUNCTURING_VALUES(_bw) \
-+	{ \
-+		.len = ARRAY_SIZE(puncturing_values_ ## _bw ## mhz), \
-+		.valid_values = puncturing_values_ ## _bw ## mhz \
-+	}
-+
-+static const struct cfg80211_per_bw_puncturing_values per_bw_puncturing[] = {
-+	CFG80211_PER_BW_VALID_PUNCTURING_VALUES(80),
-+	CFG80211_PER_BW_VALID_PUNCTURING_VALUES(160),
-+	CFG80211_PER_BW_VALID_PUNCTURING_VALUES(320)
-+};
-+
-+bool cfg80211_valid_disable_subchannel_bitmap(u16 *bitmap,
-+					      const struct cfg80211_chan_def *chandef)
-+{
-+	u32 idx, i, start_freq;
-+
-+	switch (chandef->width) {
-+	case NL80211_CHAN_WIDTH_80:
-+		idx = 0;
-+		start_freq = chandef->center_freq1 - 40;
-+		break;
-+	case NL80211_CHAN_WIDTH_160:
-+		idx = 1;
-+		start_freq = chandef->center_freq1 - 80;
-+		break;
-+	case NL80211_CHAN_WIDTH_320:
-+		idx = 2;
-+		start_freq = chandef->center_freq1 - 160;
-+		break;
-+	default:
-+		*bitmap = 0;
-+		break;
-+	}
-+
-+	if (!*bitmap)
-+		return true;
-+
-+	/* check if primary channel is punctured */
-+	if (*bitmap & (u16)BIT((chandef->chan->center_freq - start_freq) / 20))
-+		return false;
-+
-+	for (i = 0; i < per_bw_puncturing[idx].len; i++)
-+		if (per_bw_puncturing[idx].valid_values[i] == *bitmap)
-+			return true;
-+
-+	return false;
-+}
-+EXPORT_SYMBOL(cfg80211_valid_disable_subchannel_bitmap);
--- 
-2.39.2
-
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0006-wifi-nl80211-validate-and-configure-puncturing-bitma.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0006-wifi-nl80211-validate-and-configure-puncturing-bitma.patch
deleted file mode 100644
index 75fe1bb..0000000
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0006-wifi-nl80211-validate-and-configure-puncturing-bitma.patch
+++ /dev/null
@@ -1,178 +0,0 @@
-From 63bd8cc91635ad129587df0227be49074538b36e Mon Sep 17 00:00:00 2001
-From: Aloka Dixit <quic_alokad@quicinc.com>
-Date: Mon, 30 Jan 2023 16:12:25 -0800
-Subject: [PATCH 6/9] wifi: nl80211: validate and configure puncturing bitmap
-
-- New feature flag, NL80211_EXT_FEATURE_PUNCT, to advertise
-  driver support for preamble puncturing in AP mode.
-- New attribute, NL80211_ATTR_PUNCT_BITMAP, to receive a puncturing
-  bitmap from the userspace during AP bring up (NL80211_CMD_START_AP)
-  and channel switch (NL80211_CMD_CHANNEL_SWITCH) operations. Each bit
-  corresponds to a 20 MHz channel in the operating bandwidth, lowest
-  bit for the lowest channel. Bit set to 1 indicates that the channel
-  is punctured. Higher 16 bits are reserved.
-- New members added to structures cfg80211_ap_settings and
-  cfg80211_csa_settings to propagate the bitmap to the driver after
-  validation.
-
-Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
-Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
-Link: https://lore.kernel.org/r/20230131001227.25014-3-quic_alokad@quicinc.com
-[move validation against 0xffff into policy]
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- include/net/cfg80211.h       |  8 ++++++++
- include/uapi/linux/nl80211.h | 11 +++++++++++
- net/wireless/nl80211.c       | 32 ++++++++++++++++++++++++++++++++
- 3 files changed, 51 insertions(+)
-
-diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
-index d532612..9c65eda 100644
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -1327,6 +1327,9 @@ struct cfg80211_unsol_bcast_probe_resp {
-  * @fils_discovery: FILS discovery transmission parameters
-  * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
-  * @mbssid_config: AP settings for multiple bssid
-+ * @punct_bitmap: Preamble puncturing bitmap. Each bit represents
-+ *	a 20 MHz channel, lowest bit corresponding to the lowest channel.
-+ *	Bit set to 1 indicates that the channel is punctured.
-  */
- struct cfg80211_ap_settings {
- 	struct cfg80211_chan_def chandef;
-@@ -1361,6 +1364,7 @@ struct cfg80211_ap_settings {
- 	struct cfg80211_fils_discovery fils_discovery;
- 	struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
- 	struct cfg80211_mbssid_config mbssid_config;
-+	u16 punct_bitmap;
- };
- 
- /**
-@@ -1378,6 +1382,9 @@ struct cfg80211_ap_settings {
-  * @radar_required: whether radar detection is required on the new channel
-  * @block_tx: whether transmissions should be blocked while changing
-  * @count: number of beacons until switch
-+ * @punct_bitmap: Preamble puncturing bitmap. Each bit represents
-+ *	a 20 MHz channel, lowest bit corresponding to the lowest channel.
-+ *	Bit set to 1 indicates that the channel is punctured.
-  */
- struct cfg80211_csa_settings {
- 	struct cfg80211_chan_def chandef;
-@@ -1390,6 +1397,7 @@ struct cfg80211_csa_settings {
- 	bool radar_required;
- 	bool block_tx;
- 	u8 count;
-+	u16 punct_bitmap;
- };
- 
- /**
-diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
-index c14a91b..173aef8 100644
---- a/include/uapi/linux/nl80211.h
-+++ b/include/uapi/linux/nl80211.h
-@@ -2751,6 +2751,12 @@ enum nl80211_commands {
-  *	the incoming frame RX timestamp.
-  * @NL80211_ATTR_TD_BITMAP: Transition Disable bitmap, for subsequent
-  *	(re)associations.
-+ *
-+ * @NL80211_ATTR_PUNCT_BITMAP: (u32) Preamble puncturing bitmap, lowest
-+ *	bit corresponds to the lowest 20 MHz channel. Each bit set to 1
-+ *	indicates that the sub-channel is punctured. Higher 16 bits are
-+ *	reserved.
-+ *
-  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
-  * @NL80211_ATTR_MAX: highest attribute number currently defined
-  * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -3280,6 +3286,8 @@ enum nl80211_attrs {
- 	NL80211_ATTR_RX_HW_TIMESTAMP,
- 	NL80211_ATTR_TD_BITMAP,
- 
-+	NL80211_ATTR_PUNCT_BITMAP,
-+
- 	/* add attributes here, update the policy in nl80211.c */
- 
- 	__NL80211_ATTR_AFTER_LAST,
-@@ -6294,6 +6302,8 @@ enum nl80211_feature_flags {
-  *	might apply, e.g. no scans in progress, no offchannel operations
-  *	in progress, and no active connections.
-  *
-+ * @NL80211_EXT_FEATURE_PUNCT: Driver supports preamble puncturing in AP mode.
-+ *
-  * @NUM_NL80211_EXT_FEATURES: number of extended features.
-  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
-  */
-@@ -6362,6 +6372,7 @@ enum nl80211_ext_feature_index {
- 	NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
- 	NL80211_EXT_FEATURE_RADAR_BACKGROUND,
- 	NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
-+	NL80211_EXT_FEATURE_PUNCT,
- 
- 	/* add new features before the definition below */
- 	NUM_NL80211_EXT_FEATURES,
-diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index 6a97e52..4cc095d 100644
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -799,6 +799,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
- 	[NL80211_ATTR_MLD_ADDR] = NLA_POLICY_EXACT_LEN(ETH_ALEN),
- 	[NL80211_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG },
- 	[NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT },
-+	[NL80211_ATTR_PUNCT_BITMAP] = NLA_POLICY_RANGE(NLA_U8, 0, 0xffff),
- };
- 
- /* policy for the key attributes */
-@@ -3167,6 +3168,21 @@ static bool nl80211_can_set_dev_channel(struct wireless_dev *wdev)
- 		wdev->iftype == NL80211_IFTYPE_P2P_GO;
- }
- 
-+static int nl80211_parse_punct_bitmap(struct cfg80211_registered_device *rdev,
-+				      struct genl_info *info,
-+				      const struct cfg80211_chan_def *chandef,
-+				      u16 *punct_bitmap)
-+{
-+	if (!wiphy_ext_feature_isset(&rdev->wiphy, NL80211_EXT_FEATURE_PUNCT))
-+		return -EINVAL;
-+
-+	*punct_bitmap = nla_get_u32(info->attrs[NL80211_ATTR_PUNCT_BITMAP]);
-+	if (!cfg80211_valid_disable_subchannel_bitmap(punct_bitmap, chandef))
-+		return -EINVAL;
-+
-+	return 0;
-+}
-+
- int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
- 			  struct genl_info *info,
- 			  struct cfg80211_chan_def *chandef)
-@@ -5912,6 +5928,14 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
- 		goto out;
- 	}
- 
-+	if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) {
-+		err = nl80211_parse_punct_bitmap(rdev, info,
-+						 &params->chandef,
-+						 &params->punct_bitmap);
-+		if (err)
-+			goto out;
-+	}
-+
- 	if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &params->chandef,
- 					   wdev->iftype)) {
- 		err = -EINVAL;
-@@ -10050,6 +10074,14 @@ skip_beacons:
- 	if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX])
- 		params.block_tx = true;
- 
-+	if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) {
-+		err = nl80211_parse_punct_bitmap(rdev, info,
-+						 &params.chandef,
-+						 &params.punct_bitmap);
-+		if (err)
-+			goto free;
-+	}
-+
- 	wdev_lock(wdev);
- 	err = rdev_channel_switch(rdev, dev, &params);
- 	wdev_unlock(wdev);
--- 
-2.39.2
-
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0007-wifi-cfg80211-include-puncturing-bitmap-in-channel-s.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0007-wifi-cfg80211-include-puncturing-bitmap-in-channel-s.patch
deleted file mode 100644
index 73498f0..0000000
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0007-wifi-cfg80211-include-puncturing-bitmap-in-channel-s.patch
+++ /dev/null
@@ -1,282 +0,0 @@
-From a0306fbf2adb7074815390d6adbe58fb72533556 Mon Sep 17 00:00:00 2001
-From: Aloka Dixit <quic_alokad@quicinc.com>
-Date: Mon, 30 Jan 2023 16:12:26 -0800
-Subject: [PATCH 7/9] wifi: cfg80211: include puncturing bitmap in channel
- switch events
-
-Add puncturing bitmap in channel switch notifications
-and corresponding trace functions.
-
-Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
-Link: https://lore.kernel.org/r/20230131001227.25014-4-quic_alokad@quicinc.com
-[fix qtnfmac]
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- drivers/net/wireless/ath/ath6kl/cfg80211.c    |  2 +-
- drivers/net/wireless/marvell/mwifiex/11h.c    |  2 +-
- .../net/wireless/quantenna/qtnfmac/event.c    |  2 +-
- include/net/cfg80211.h                        |  6 +++--
- net/mac80211/cfg.c                            |  5 ++--
- net/mac80211/mlme.c                           |  4 ++--
- net/wireless/nl80211.c                        | 20 ++++++++++------
- net/wireless/trace.h                          | 24 ++++++++++++-------
- 8 files changed, 41 insertions(+), 24 deletions(-)
-
-diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
-index 07de0bd..576c449 100644
---- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
-+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
-@@ -1119,7 +1119,7 @@ void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
- 					NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT);
- 
- 	mutex_lock(&vif->wdev.mtx);
--	cfg80211_ch_switch_notify(vif->ndev, &chandef, 0);
-+	cfg80211_ch_switch_notify(vif->ndev, &chandef, 0, 0);
- 	mutex_unlock(&vif->wdev.mtx);
- }
- 
-diff --git a/drivers/net/wireless/marvell/mwifiex/11h.c b/drivers/net/wireless/marvell/mwifiex/11h.c
-index 6a9d7bc..b0c40a7 100644
---- a/drivers/net/wireless/marvell/mwifiex/11h.c
-+++ b/drivers/net/wireless/marvell/mwifiex/11h.c
-@@ -292,6 +292,6 @@ void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work)
- 	mwifiex_dbg(priv->adapter, MSG,
- 		    "indicating channel switch completion to kernel\n");
- 	mutex_lock(&priv->wdev.mtx);
--	cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef, 0);
-+	cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef, 0, 0);
- 	mutex_unlock(&priv->wdev.mtx);
- }
-diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c
-index 4fafe37..0e336ff 100644
---- a/drivers/net/wireless/quantenna/qtnfmac/event.c
-+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c
-@@ -478,7 +478,7 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac,
- 			continue;
- 
- 		mutex_lock(&vif->wdev.mtx);
--		cfg80211_ch_switch_notify(vif->netdev, &chandef, 0);
-+		cfg80211_ch_switch_notify(vif->netdev, &chandef, 0, 0);
- 		mutex_unlock(&vif->wdev.mtx);
- 	}
- 
-diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
-index 9c65eda..8d72357 100644
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -8322,13 +8322,14 @@ bool cfg80211_reg_can_beacon_relax(struct wiphy *wiphy,
-  * @dev: the device which switched channels
-  * @chandef: the new channel definition
-  * @link_id: the link ID for MLO, must be 0 for non-MLO
-+ * @punct_bitmap: the new puncturing bitmap
-  *
-  * Caller must acquire wdev_lock, therefore must only be called from sleepable
-  * driver context!
-  */
- void cfg80211_ch_switch_notify(struct net_device *dev,
- 			       struct cfg80211_chan_def *chandef,
--			       unsigned int link_id);
-+			       unsigned int link_id, u16 punct_bitmap);
- 
- /*
-  * cfg80211_ch_switch_started_notify - notify channel switch start
-@@ -8337,6 +8338,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
-  * @link_id: the link ID for MLO, must be 0 for non-MLO
-  * @count: the number of TBTTs until the channel switch happens
-  * @quiet: whether or not immediate quiet was requested by the AP
-+ * @punct_bitmap: the future puncturing bitmap
-  *
-  * Inform the userspace about the channel switch that has just
-  * started, so that it can take appropriate actions (eg. starting
-@@ -8345,7 +8347,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
- void cfg80211_ch_switch_started_notify(struct net_device *dev,
- 				       struct cfg80211_chan_def *chandef,
- 				       unsigned int link_id, u8 count,
--				       bool quiet);
-+				       bool quiet, u16 punct_bitmap);
- 
- /**
-  * ieee80211_operating_class_to_band - convert operating class to band
-diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 5bb43de..17d1e71 100644
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -3597,7 +3597,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
- 	if (err)
- 		return err;
- 
--	cfg80211_ch_switch_notify(sdata->dev, &sdata->deflink.csa_chandef, 0);
-+	cfg80211_ch_switch_notify(sdata->dev, &sdata->deflink.csa_chandef, 0,
-+				  0);
- 
- 	return 0;
- }
-@@ -3869,7 +3870,7 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
- 
- 	cfg80211_ch_switch_started_notify(sdata->dev,
- 					  &sdata->deflink.csa_chandef, 0,
--					  params->count, params->block_tx);
-+					  params->count, params->block_tx, 0);
- 
- 	if (changed) {
- 		ieee80211_link_info_change_notify(sdata, &sdata->deflink,
-diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
-index 2716ae0..d63434b 100644
---- a/net/mac80211/mlme.c
-+++ b/net/mac80211/mlme.c
-@@ -1778,7 +1778,7 @@ static void ieee80211_chswitch_post_beacon(struct ieee80211_link_data *link)
- 		return;
- 	}
- 
--	cfg80211_ch_switch_notify(sdata->dev, &link->reserved_chandef, 0);
-+	cfg80211_ch_switch_notify(sdata->dev, &link->reserved_chandef, 0, 0);
- }
- 
- void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success)
-@@ -1988,7 +1988,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link,
- 	mutex_unlock(&local->mtx);
- 
- 	cfg80211_ch_switch_started_notify(sdata->dev, &csa_ie.chandef, 0,
--					  csa_ie.count, csa_ie.mode);
-+					  csa_ie.count, csa_ie.mode, 0);
- 
- 	if (local->ops->channel_switch) {
- 		/* use driver's channel switch callback */
-diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index 4cc095d..f3b2fc4 100644
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -18973,7 +18973,7 @@ static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev,
- 				     struct cfg80211_chan_def *chandef,
- 				     gfp_t gfp,
- 				     enum nl80211_commands notif,
--				     u8 count, bool quiet)
-+				     u8 count, bool quiet, u16 punct_bitmap)
- {
- 	struct wireless_dev *wdev = netdev->ieee80211_ptr;
- 	struct sk_buff *msg;
-@@ -19007,6 +19007,9 @@ static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev,
- 			goto nla_put_failure;
- 	}
- 
-+	if (nla_put_u32(msg, NL80211_ATTR_PUNCT_BITMAP, punct_bitmap))
-+		goto nla_put_failure;
-+
- 	genlmsg_end(msg, hdr);
- 
- 	genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
-@@ -19019,7 +19022,7 @@ static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev,
- 
- void cfg80211_ch_switch_notify(struct net_device *dev,
- 			       struct cfg80211_chan_def *chandef,
--			       unsigned int link_id)
-+			       unsigned int link_id, u16 punct_bitmap)
- {
- 	struct wireless_dev *wdev = dev->ieee80211_ptr;
- 	struct wiphy *wiphy = wdev->wiphy;
-@@ -19028,7 +19031,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
- 	ASSERT_WDEV_LOCK(wdev);
- 	WARN_INVALID_LINK_ID(wdev, link_id);
- 
--	trace_cfg80211_ch_switch_notify(dev, chandef, link_id);
-+	trace_cfg80211_ch_switch_notify(dev, chandef, link_id, punct_bitmap);
- 
- 	switch (wdev->iftype) {
- 	case NL80211_IFTYPE_STATION:
-@@ -19056,14 +19059,15 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
- 	cfg80211_sched_dfs_chan_update(rdev);
- 
- 	nl80211_ch_switch_notify(rdev, dev, link_id, chandef, GFP_KERNEL,
--				 NL80211_CMD_CH_SWITCH_NOTIFY, 0, false);
-+				 NL80211_CMD_CH_SWITCH_NOTIFY, 0, false,
-+				 punct_bitmap);
- }
- EXPORT_SYMBOL(cfg80211_ch_switch_notify);
- 
- void cfg80211_ch_switch_started_notify(struct net_device *dev,
- 				       struct cfg80211_chan_def *chandef,
- 				       unsigned int link_id, u8 count,
--				       bool quiet)
-+				       bool quiet, u16 punct_bitmap)
- {
- 	struct wireless_dev *wdev = dev->ieee80211_ptr;
- 	struct wiphy *wiphy = wdev->wiphy;
-@@ -19072,11 +19076,13 @@ void cfg80211_ch_switch_started_notify(struct net_device *dev,
- 	ASSERT_WDEV_LOCK(wdev);
- 	WARN_INVALID_LINK_ID(wdev, link_id);
- 
--	trace_cfg80211_ch_switch_started_notify(dev, chandef, link_id);
-+	trace_cfg80211_ch_switch_started_notify(dev, chandef, link_id,
-+						punct_bitmap);
-+
- 
- 	nl80211_ch_switch_notify(rdev, dev, link_id, chandef, GFP_KERNEL,
- 				 NL80211_CMD_CH_SWITCH_STARTED_NOTIFY,
--				 count, quiet);
-+				 count, quiet, punct_bitmap);
- }
- EXPORT_SYMBOL(cfg80211_ch_switch_started_notify);
- 
-diff --git a/net/wireless/trace.h b/net/wireless/trace.h
-index 8e7c00f..4a7d0ae 100644
---- a/net/wireless/trace.h
-+++ b/net/wireless/trace.h
-@@ -3245,39 +3245,47 @@ TRACE_EVENT(cfg80211_chandef_dfs_required,
- TRACE_EVENT(cfg80211_ch_switch_notify,
- 	TP_PROTO(struct net_device *netdev,
- 		 struct cfg80211_chan_def *chandef,
--		 unsigned int link_id),
--	TP_ARGS(netdev, chandef, link_id),
-+		 unsigned int link_id,
-+		 u16 punct_bitmap),
-+	TP_ARGS(netdev, chandef, link_id, punct_bitmap),
- 	TP_STRUCT__entry(
- 		NETDEV_ENTRY
- 		CHAN_DEF_ENTRY
- 		__field(unsigned int, link_id)
-+		__field(u16, punct_bitmap)
- 	),
- 	TP_fast_assign(
- 		NETDEV_ASSIGN;
- 		CHAN_DEF_ASSIGN(chandef);
- 		__entry->link_id = link_id;
-+		__entry->punct_bitmap = punct_bitmap;
- 	),
--	TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d",
--		  NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id)
-+	TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d, punct_bitmap:%u",
-+		  NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id,
-+		  __entry->punct_bitmap)
- );
- 
- TRACE_EVENT(cfg80211_ch_switch_started_notify,
- 	TP_PROTO(struct net_device *netdev,
- 		 struct cfg80211_chan_def *chandef,
--		 unsigned int link_id),
--	TP_ARGS(netdev, chandef, link_id),
-+		 unsigned int link_id,
-+		 u16 punct_bitmap),
-+	TP_ARGS(netdev, chandef, link_id, punct_bitmap),
- 	TP_STRUCT__entry(
- 		NETDEV_ENTRY
- 		CHAN_DEF_ENTRY
- 		__field(unsigned int, link_id)
-+		__field(u16, punct_bitmap)
- 	),
- 	TP_fast_assign(
- 		NETDEV_ASSIGN;
- 		CHAN_DEF_ASSIGN(chandef);
- 		__entry->link_id = link_id;
-+		__entry->punct_bitmap = punct_bitmap;
- 	),
--	TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d",
--		  NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id)
-+	TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d, punct_bitmap:%u",
-+		  NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id,
-+		  __entry->punct_bitmap)
- );
- 
- TRACE_EVENT(cfg80211_radar_event,
--- 
-2.39.2
-
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0008-wifi-mac80211-configure-puncturing-bitmap.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0008-wifi-mac80211-configure-puncturing-bitmap.patch
deleted file mode 100644
index 80c4b61..0000000
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0008-wifi-mac80211-configure-puncturing-bitmap.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From b5bdd1f773d65d640844f4b8a3e63c25057f1b46 Mon Sep 17 00:00:00 2001
-From: Aloka Dixit <quic_alokad@quicinc.com>
-Date: Mon, 30 Jan 2023 16:12:27 -0800
-Subject: [PATCH 8/9] wifi: mac80211: configure puncturing bitmap
-
-- Configure the bitmap in link_conf and notify the driver.
-- Modify 'change' in ieee80211_start_ap() from u32 to u64 to support
-BSS_CHANGED_EHT_PUNCTURING.
-- Propagate the bitmap in channel switch events to userspace.
-
-Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
-Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
-Link: https://lore.kernel.org/r/20230131001227.25014-5-quic_alokad@quicinc.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- include/net/mac80211.h |  3 +++
- net/mac80211/cfg.c     | 22 +++++++++++++++++++---
- 2 files changed, 22 insertions(+), 3 deletions(-)
-
-diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index 8fb38c9..c4ff6a3 100644
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -645,6 +645,7 @@ struct ieee80211_fils_discovery {
-  * @csa_active: marks whether a channel switch is going on. Internally it is
-  *	write-protected by sdata_lock and local->mtx so holding either is fine
-  *	for read access.
-+ * @csa_punct_bitmap: new puncturing bitmap for channel switch
-  * @mu_mimo_owner: indicates interface owns MU-MIMO capability
-  * @chanctx_conf: The channel context this interface is assigned to, or %NULL
-  *	when it is not assigned. This pointer is RCU-protected due to the TX
-@@ -744,6 +745,8 @@ struct ieee80211_bss_conf {
- 	u16 eht_puncturing;
- 
- 	bool csa_active;
-+	u16 csa_punct_bitmap;
-+
- 	bool mu_mimo_owner;
- 	struct ieee80211_chanctx_conf __rcu *chanctx_conf;
- 
-diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 17d1e71..6defc1d 100644
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -1220,7 +1220,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
- 	struct ieee80211_local *local = sdata->local;
- 	struct beacon_data *old;
- 	struct ieee80211_sub_if_data *vlan;
--	u32 changed = BSS_CHANGED_BEACON_INT |
-+	u64 changed = BSS_CHANGED_BEACON_INT |
- 		      BSS_CHANGED_BEACON_ENABLED |
- 		      BSS_CHANGED_BEACON |
- 		      BSS_CHANGED_P2P_PS |
-@@ -1307,6 +1307,11 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
- 				IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO;
- 	}
- 
-+	if (params->eht_cap) {
-+		link_conf->eht_puncturing = params->punct_bitmap;
-+		changed |= BSS_CHANGED_EHT_PUNCTURING;
-+	}
-+
- 	if (sdata->vif.type == NL80211_IFTYPE_AP &&
- 	    params->mbssid_config.tx_wdev) {
- 		err = ieee80211_set_ap_mbssid_options(sdata,
-@@ -3556,6 +3561,12 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
- 	lockdep_assert_held(&local->mtx);
- 	lockdep_assert_held(&local->chanctx_mtx);
- 
-+	if (sdata->vif.bss_conf.eht_puncturing != sdata->vif.bss_conf.csa_punct_bitmap) {
-+		sdata->vif.bss_conf.eht_puncturing =
-+					sdata->vif.bss_conf.csa_punct_bitmap;
-+		changed |= BSS_CHANGED_EHT_PUNCTURING;
-+	}
-+
- 	/*
- 	 * using reservation isn't immediate as it may be deferred until later
- 	 * with multi-vif. once reservation is complete it will re-schedule the
-@@ -3598,7 +3609,7 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
- 		return err;
- 
- 	cfg80211_ch_switch_notify(sdata->dev, &sdata->deflink.csa_chandef, 0,
--				  0);
-+				  sdata->vif.bss_conf.eht_puncturing);
- 
- 	return 0;
- }
-@@ -3860,9 +3871,13 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
- 		goto out;
- 	}
- 
-+	if (params->punct_bitmap && !sdata->vif.bss_conf.eht_support)
-+		goto out;
-+
- 	sdata->deflink.csa_chandef = params->chandef;
- 	sdata->deflink.csa_block_tx = params->block_tx;
- 	sdata->vif.bss_conf.csa_active = true;
-+	sdata->vif.bss_conf.csa_punct_bitmap = params->punct_bitmap;
- 
- 	if (sdata->deflink.csa_block_tx)
- 		ieee80211_stop_vif_queues(local, sdata,
-@@ -3870,7 +3885,8 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
- 
- 	cfg80211_ch_switch_started_notify(sdata->dev,
- 					  &sdata->deflink.csa_chandef, 0,
--					  params->count, params->block_tx, 0);
-+					  params->count, params->block_tx,
-+					  sdata->vif.bss_conf.csa_punct_bitmap);
- 
- 	if (changed) {
- 		ieee80211_link_info_change_notify(sdata, &sdata->deflink,
--- 
-2.39.2
-
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0009-wifi-mac80211-add-EHT-MU-MIMO-related-flags-in-ieee8.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0009-wifi-mac80211-add-EHT-MU-MIMO-related-flags-in-ieee8.patch
deleted file mode 100644
index 74c0d07..0000000
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/bp-0009-wifi-mac80211-add-EHT-MU-MIMO-related-flags-in-ieee8.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 4244ed072fedc6f391ddad20fbc70bbb9dfb7c2c Mon Sep 17 00:00:00 2001
-From: Ryder Lee <ryder.lee@mediatek.com>
-Date: Sat, 18 Feb 2023 01:48:59 +0800
-Subject: [PATCH 9/9] wifi: mac80211: add EHT MU-MIMO related flags in
- ieee80211_bss_conf
-
-Similar to VHT/HE. This is utilized to pass MU-MIMO configurations
-from user space (i.e. hostapd) to driver.
-
-Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
-Link: https://lore.kernel.org/r/8d9966c4c1e77cb1ade77d42bdc49905609192e9.1676628065.git.ryder.lee@mediatek.com
-[move into combined if statement, reset on !eht]
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- include/net/mac80211.h |  9 +++++++++
- net/mac80211/cfg.c     | 16 ++++++++++++++++
- 2 files changed, 25 insertions(+)
-
-diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index c4ff6a3..24d2a66 100644
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -676,6 +676,12 @@ struct ieee80211_fils_discovery {
-  * @he_full_ul_mumimo: does this BSS support the reception (AP) or transmission
-  *	(non-AP STA) of an HE TB PPDU on an RU that spans the entire PPDU
-  *	bandwidth
-+ * @eht_su_beamformer: in AP-mode, does this BSS enable operation as an EHT SU
-+ *	beamformer
-+ * @eht_su_beamformee: in AP-mode, does this BSS enable operation as an EHT SU
-+ *	beamformee
-+ * @eht_mu_beamformer: in AP-mode, does this BSS enable operation as an EHT MU
-+ *	beamformer
-  */
- struct ieee80211_bss_conf {
- 	const u8 *bssid;
-@@ -764,6 +770,9 @@ struct ieee80211_bss_conf {
- 	bool he_su_beamformee;
- 	bool he_mu_beamformer;
- 	bool he_full_ul_mumimo;
-+	bool eht_su_beamformer;
-+	bool eht_su_beamformee;
-+	bool eht_mu_beamformer;
- };
- 
- /**
-diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 6defc1d..49760bf 100644
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -1310,6 +1310,22 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
- 	if (params->eht_cap) {
- 		link_conf->eht_puncturing = params->punct_bitmap;
- 		changed |= BSS_CHANGED_EHT_PUNCTURING;
-+
-+		link_conf->eht_su_beamformer =
-+			params->eht_cap->fixed.phy_cap_info[0] &
-+				IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMER;
-+		link_conf->eht_su_beamformee =
-+			params->eht_cap->fixed.phy_cap_info[0] &
-+				IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE;
-+		link_conf->eht_mu_beamformer =
-+			params->eht_cap->fixed.phy_cap_info[7] &
-+				(IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ |
-+				 IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_160MHZ |
-+				 IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_320MHZ);
-+	} else {
-+		link_conf->eht_su_beamformer = false;
-+		link_conf->eht_su_beamformee = false;
-+		link_conf->eht_mu_beamformer = false;
- 	}
- 
- 	if (sdata->vif.type == NL80211_IFTYPE_AP &&
--- 
-2.39.2
-
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0001-mac80211-mtk-do-not-setup-twt-when-twt-responder-is-.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0001-mac80211-mtk-do-not-setup-twt-when-twt-responder-is-.patch
index c75457d..c52c759 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0001-mac80211-mtk-do-not-setup-twt-when-twt-responder-is-.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0001-mac80211-mtk-do-not-setup-twt-when-twt-responder-is-.patch
@@ -1,7 +1,7 @@
-From 635092a3fd448ecca927e72882f05dc52bb1d21b Mon Sep 17 00:00:00 2001
+From 5369b107bbb17d2152f7690f3fc91a135f05a88c Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Tue, 18 Jan 2022 20:29:44 +0800
-Subject: [PATCH 01/14] mac80211: mtk: do not setup twt when twt responder is
+Subject: [PATCH 01/21] mac80211: mtk: do not setup twt when twt responder is
  false
 
 ---
@@ -9,10 +9,10 @@
  1 file changed, 3 insertions(+)
 
 diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
-index fadf2be..54dcaf6 100644
+index 8ffe90d..56abe67 100644
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -3400,6 +3400,9 @@ ieee80211_process_rx_twt_action(struct ieee80211_rx_data *rx)
+@@ -3416,6 +3416,9 @@ ieee80211_process_rx_twt_action(struct ieee80211_rx_data *rx)
  	if (sdata->vif.type != NL80211_IFTYPE_AP)
  		return false;
  
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0002-cfg80211-mtk-extend-CAC-time-for-weather-radar-chann.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0002-cfg80211-mtk-extend-CAC-time-for-weather-radar-chann.patch
index e3288e4..2a60dc4 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0002-cfg80211-mtk-extend-CAC-time-for-weather-radar-chann.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0002-cfg80211-mtk-extend-CAC-time-for-weather-radar-chann.patch
@@ -1,7 +1,8 @@
-From a1d6921a833c7d85170cb54145bfcf98d7f11283 Mon Sep 17 00:00:00 2001
+From 9b4ed2d99cc24c50bef088ee2bc48047d4e17c97 Mon Sep 17 00:00:00 2001
 From: Shayne Chen <shayne.chen@mediatek.com>
 Date: Tue, 29 Mar 2022 16:06:30 +0800
-Subject: [PATCH] cfg80211: mtk: extend CAC time for weather radar channels
+Subject: [PATCH 02/21] cfg80211: mtk: extend CAC time for weather radar
+ channels
 
 Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -12,7 +13,7 @@
  3 files changed, 11 insertions(+)
 
 diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
-index 98a2971..28c0a5f 100644
+index 3e0a190..32df498 100644
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
 @@ -149,6 +149,7 @@ enum ieee80211_channel_flags {
@@ -24,7 +25,7 @@
  
  /**
 diff --git a/net/wireless/chan.c b/net/wireless/chan.c
-index d5ed976..62f0169 100644
+index d5ed976..caa5acc 100644
 --- a/net/wireless/chan.c
 +++ b/net/wireless/chan.c
 @@ -931,6 +931,13 @@ static unsigned int cfg80211_get_chans_dfs_cac_time(struct wiphy *wiphy,
@@ -42,10 +43,10 @@
  			dfs_cac_ms = c->dfs_cac_ms;
  	}
 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index f3b2fc4..215a603 100644
+index 6d62c81..3ec073a 100644
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -9817,6 +9817,9 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
+@@ -9992,6 +9992,9 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
  	if (WARN_ON(!cac_time_ms))
  		cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
  
@@ -56,5 +57,5 @@
  	if (!err) {
  		wdev->links[0].ap.chandef = chandef;
 -- 
-2.18.0
+2.39.2
 
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0003-mac80211-mtk-it-s-invalid-case-when-frag_threshold-i.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0003-mac80211-mtk-it-s-invalid-case-when-frag_threshold-i.patch
index b31ba64..a68441f 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0003-mac80211-mtk-it-s-invalid-case-when-frag_threshold-i.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0003-mac80211-mtk-it-s-invalid-case-when-frag_threshold-i.patch
@@ -1,7 +1,7 @@
-From efac6783560b2859f49f0a5d3dceff0e388431cf Mon Sep 17 00:00:00 2001
+From 395e1cebc680455965b24fe771efaae400439acc Mon Sep 17 00:00:00 2001
 From: Bo Jiao <Bo.Jiao@mediatek.com>
 Date: Fri, 1 Apr 2022 09:15:21 +0800
-Subject: [PATCH 03/14] mac80211: mtk: it's invalid case when frag_threshold is
+Subject: [PATCH 03/21] mac80211: mtk: it's invalid case when frag_threshold is
  greater than 2346
 
 Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
@@ -10,10 +10,10 @@
  1 file changed, 3 insertions(+)
 
 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index 0430bbe..c5620f3 100644
+index 3ec073a..e0ee534 100644
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -3614,6 +3614,9 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
+@@ -3650,6 +3650,9 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
  			goto out;
  		}
  
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0004-mac80211-mtk-airtime_flags-depends-on-NL80211_EXT_FE.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0004-mac80211-mtk-airtime_flags-depends-on-NL80211_EXT_FE.patch
index 5a81d9b..5eb6ee7 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0004-mac80211-mtk-airtime_flags-depends-on-NL80211_EXT_FE.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0004-mac80211-mtk-airtime_flags-depends-on-NL80211_EXT_FE.patch
@@ -1,7 +1,7 @@
-From f88d59e107e1d962ebf77be9e1d0b35b188c8185 Mon Sep 17 00:00:00 2001
+From 7b34ccae1fef44bc222e9ff6313fa6c57f962b92 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Wed, 19 Oct 2022 13:42:43 +0800
-Subject: [PATCH 04/14] mac80211: mtk: airtime_flags depends on
+Subject: [PATCH 04/21] mac80211: mtk: airtime_flags depends on
  NL80211_EXT_FEATURE
 
 Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
@@ -10,10 +10,10 @@
  1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/net/mac80211/main.c b/net/mac80211/main.c
-index dfb9f4b..06d111d 100644
+index e2f7ae5..0188e6a 100644
 --- a/net/mac80211/main.c
 +++ b/net/mac80211/main.c
-@@ -797,8 +797,9 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
+@@ -798,8 +798,9 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
  			IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H;
  		atomic_set(&local->aql_ac_pending_airtime[i], 0);
  	}
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0005-mac80211-mtk-add-support-for-runtime-set-inband-disc.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0005-mac80211-mtk-add-support-for-runtime-set-inband-disc.patch
index 0bbbfe0..0b9a066 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0005-mac80211-mtk-add-support-for-runtime-set-inband-disc.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0005-mac80211-mtk-add-support-for-runtime-set-inband-disc.patch
@@ -1,7 +1,7 @@
-From 5deaaa36bfeb7a68bbcce8770011ef49be6a6991 Mon Sep 17 00:00:00 2001
+From ba1bea91d88b2e8fb3c429e8811f7422348bed55 Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Wed, 19 Oct 2022 13:45:42 +0800
-Subject: [PATCH 05/14] mac80211: mtk: add support for runtime set inband
+Subject: [PATCH 05/21] mac80211: mtk: add support for runtime set inband
  discovery
 
 Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
@@ -9,15 +9,15 @@
  include/net/cfg80211.h       |  1 +
  include/net/mac80211.h       |  1 +
  include/uapi/linux/nl80211.h |  1 +
- net/mac80211/cfg.c           | 33 ++++++++++++++++++++++++++++++++-
- net/wireless/nl80211.c       | 31 +++++++++++++++++++++++++++----
- 5 files changed, 62 insertions(+), 5 deletions(-)
+ net/mac80211/cfg.c           | 32 +++++++++++++++++++++++++++++++-
+ net/wireless/nl80211.c       | 33 ++++++++++++++++++++++++++++-----
+ 5 files changed, 62 insertions(+), 6 deletions(-)
 
 diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
-index 8d72357..450de58 100644
+index 32df498..7ba5fe9 100644
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -1268,6 +1268,7 @@ struct cfg80211_fils_discovery {
+@@ -1306,6 +1306,7 @@ struct cfg80211_fils_discovery {
  	u32 max_interval;
  	size_t tmpl_len;
  	const u8 *tmpl;
@@ -26,7 +26,7 @@
  
  /**
 diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index 24d2a66..09fad2b 100644
+index 2e5b5c6..96e4ec9 100644
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
 @@ -526,6 +526,7 @@ struct ieee80211_ftm_responder_params {
@@ -38,10 +38,10 @@
  
  /**
 diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
-index 173aef8..bd26a06 100644
+index 88eb85c..72ef4d9 100644
 --- a/include/uapi/linux/nl80211.h
 +++ b/include/uapi/linux/nl80211.h
-@@ -7513,6 +7513,7 @@ enum nl80211_fils_discovery_attributes {
+@@ -7619,6 +7619,7 @@ enum nl80211_fils_discovery_attributes {
  	NL80211_FILS_DISCOVERY_ATTR_INT_MIN,
  	NL80211_FILS_DISCOVERY_ATTR_INT_MAX,
  	NL80211_FILS_DISCOVERY_ATTR_TMPL,
@@ -50,10 +50,10 @@
  	/* keep last */
  	__NL80211_FILS_DISCOVERY_ATTR_LAST,
 diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 49760bf..97f7905 100644
+index d1b6d5c..a78ee52 100644
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -984,6 +984,7 @@ static int ieee80211_set_fils_discovery(struct ieee80211_sub_if_data *sdata,
+@@ -990,6 +990,7 @@ static int ieee80211_set_fils_discovery(struct ieee80211_sub_if_data *sdata,
  	fd = &link_conf->fils_discovery;
  	fd->min_interval = params->min_interval;
  	fd->max_interval = params->max_interval;
@@ -61,21 +61,23 @@
  
  	old = sdata_dereference(link->u.ap.fils_discovery, sdata);
  	new = kzalloc(sizeof(*new) + params->tmpl_len, GFP_KERNEL);
-@@ -1466,6 +1467,9 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
+@@ -1513,9 +1514,11 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
  	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  	struct ieee80211_link_data *link;
  	struct beacon_data *old;
 +	struct cfg80211_ap_settings *ap_params;
 +	struct ieee80211_supported_band *sband;
-+	u32 changed;
++	u64 changed = 0;
  	int err;
  	struct ieee80211_bss_conf *link_conf;
+-	u64 changed = 0;
  
-@@ -1497,7 +1501,34 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
- 		err |= BSS_CHANGED_HE_BSS_COLOR;
+ 	sdata_assert_lock(sdata);
+ 
+@@ -1546,6 +1549,33 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
+ 		changed |= BSS_CHANGED_HE_BSS_COLOR;
  	}
  
--	ieee80211_link_info_change_notify(sdata, link, err);
 +	changed = err;
 +
 +	sband = ieee80211_get_sband(sdata);
@@ -103,12 +105,11 @@
 +		}
 +	}
 +
-+	ieee80211_bss_info_change_notify(sdata, changed);
+ 	ieee80211_link_info_change_notify(sdata, link, changed);
  	return 0;
  }
- 
 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index c5620f3..95676d9 100644
+index e0ee534..ff8afa5 100644
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
 @@ -423,6 +423,7 @@ nl80211_fils_discovery_policy[NL80211_FILS_DISCOVERY_ATTR_MAX + 1] = {
@@ -119,7 +120,7 @@
  };
  
  static const struct nla_policy
-@@ -5605,6 +5606,8 @@ static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev,
+@@ -5692,6 +5693,8 @@ static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev,
  	fd->tmpl = nla_data(tb[NL80211_FILS_DISCOVERY_ATTR_TMPL]);
  	fd->min_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_ATTR_INT_MIN]);
  	fd->max_interval = nla_get_u32(tb[NL80211_FILS_DISCOVERY_ATTR_INT_MAX]);
@@ -128,7 +129,7 @@
  
  	return 0;
  }
-@@ -6092,7 +6095,8 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info)
+@@ -6224,7 +6227,8 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info)
  	unsigned int link_id = nl80211_link_id(info->attrs);
  	struct net_device *dev = info->user_ptr[1];
  	struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -138,15 +139,15 @@
  	int err;
  
  	if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
-@@ -6105,16 +6109,35 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info)
+@@ -6237,17 +6241,36 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info)
  	if (!wdev->links[link_id].ap.beacon_interval)
  		return -EINVAL;
  
--	err = nl80211_parse_beacon(rdev, info->attrs, &params);
+-	err = nl80211_parse_beacon(rdev, info->attrs, &params, info->extack);
 +	memset(&ap_params, 0, sizeof(ap_params));
 +	params = &ap_params.beacon;
 +
-+	err = nl80211_parse_beacon(rdev, info->attrs, params);
++	err = nl80211_parse_beacon(rdev, info->attrs, params, info->extack);
  	if (err)
  		goto out;
  
@@ -173,7 +174,9 @@
  
  out:
 -	kfree(params.mbssid_ies);
+-	kfree(params.rnr_ies);
 +	kfree(params->mbssid_ies);
++	kfree(params->rnr_ies);
  	return err;
  }
  
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0006-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0006-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch
index 4072a92..b2408ad 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0006-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0006-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch
@@ -1,8 +1,8 @@
-From dc8caecd0c7f5dfd542ba08f98605a7d6849e110 Mon Sep 17 00:00:00 2001
+From cbb9327b27651e375f72783e9c2453a2474f3ad3 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Thu, 22 Sep 2022 14:27:41 +0800
-Subject: [PATCH] cfg80211: mtk: implement DFS status show, cac and nop skip
- command via debugfs
+Subject: [PATCH 06/21] cfg80211: mtk: implement DFS status show, cac and nop
+ skip command via debugfs
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
@@ -16,23 +16,23 @@
  7 files changed, 360 insertions(+), 7 deletions(-)
 
 diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
-index 450de58..ddd63e7 100644
+index 7ba5fe9..cd0ec8a 100644
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -4647,6 +4647,7 @@ struct cfg80211_ops {
- 				    struct link_station_parameters *params);
- 	int	(*del_link_station)(struct wiphy *wiphy, struct net_device *dev,
+@@ -4768,6 +4768,7 @@ struct cfg80211_ops {
  				    struct link_station_del_parameters *params);
+ 	int	(*set_hw_timestamp)(struct wiphy *wiphy, struct net_device *dev,
+ 				    struct cfg80211_set_hw_timestamp *hwts);
 +	void	(*skip_cac)(struct wireless_dev *wdev);
  };
  
  /*
 diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 97f7905..36a2c8d 100644
+index a78ee52..8033b2f 100644
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -4962,6 +4962,25 @@ ieee80211_del_link_station(struct wiphy *wiphy, struct net_device *dev,
- 	return ret;
+@@ -5049,6 +5049,25 @@ static int ieee80211_set_hw_timestamp(struct wiphy *wiphy,
+ 	return local->ops->set_hw_timestamp(&local->hw, &sdata->vif, hwts);
  }
  
 +static void
@@ -57,14 +57,14 @@
  const struct cfg80211_ops mac80211_config_ops = {
  	.add_virtual_intf = ieee80211_add_iface,
  	.del_virtual_intf = ieee80211_del_iface,
-@@ -5072,4 +5091,5 @@ const struct cfg80211_ops mac80211_config_ops = {
- 	.add_link_station = ieee80211_add_link_station,
+@@ -5161,4 +5180,5 @@ const struct cfg80211_ops mac80211_config_ops = {
  	.mod_link_station = ieee80211_mod_link_station,
  	.del_link_station = ieee80211_del_link_station,
+ 	.set_hw_timestamp = ieee80211_set_hw_timestamp,
 +	.skip_cac = ieee80211_skip_cac,
  };
 diff --git a/net/wireless/core.h b/net/wireless/core.h
-index 382455c..c9d7712 100644
+index 70fc2e6..ea1b6ff 100644
 --- a/net/wireless/core.h
 +++ b/net/wireless/core.h
 @@ -86,6 +86,9 @@ struct cfg80211_registered_device {
@@ -410,10 +410,10 @@
 +	DEBUGFS_ADD(dfs_available_reset, 0600);
  }
 diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
-index 5a63dba..57b9bde 100644
+index 8b87bc9..e3cbfc0 100644
 --- a/net/wireless/mlme.c
 +++ b/net/wireless/mlme.c
-@@ -1030,13 +1030,16 @@ __cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
+@@ -1054,13 +1054,16 @@ __cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
  		queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk);
  		cfg80211_sched_dfs_chan_update(rdev);
  		wdev = rdev->background_radar_wdev;
@@ -430,7 +430,7 @@
  		break;
  	default:
  		return;
-@@ -1056,6 +1059,7 @@ cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
+@@ -1080,6 +1083,7 @@ cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
  					chandef, event);
  	wiphy_unlock(&rdev->wiphy);
  }
@@ -438,7 +438,7 @@
  
  void cfg80211_background_cac_done_wk(struct work_struct *work)
  {
-@@ -1117,8 +1121,10 @@ cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rde
+@@ -1141,8 +1145,10 @@ cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rde
  	if (!cac_time_ms)
  		cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
  
@@ -450,13 +450,14 @@
  	__cfg80211_background_cac_event(rdev, wdev, chandef,
  					NL80211_RADAR_CAC_STARTED);
 diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
-index ca29892..ce83152 100644
+index 72c1282..5a4854c 100644
 --- a/net/wireless/rdev-ops.h
 +++ b/net/wireless/rdev-ops.h
-@@ -1494,4 +1494,18 @@ rdev_del_link_station(struct cfg80211_registered_device *rdev,
+@@ -1524,4 +1524,18 @@ rdev_set_hw_timestamp(struct cfg80211_registered_device *rdev,
+ 
  	return ret;
  }
- 
++
 +static inline int
 +rdev_skip_cac(struct cfg80211_registered_device *rdev,
 +	      struct wireless_dev *wdev)
@@ -470,14 +471,13 @@
 +
 +	return 0;
 +}
-+
  #endif /* __CFG80211_RDEV_OPS */
 diff --git a/net/wireless/trace.h b/net/wireless/trace.h
-index 4a7d0ae..4d44c55 100644
+index fc955a9..01dcfd3 100644
 --- a/net/wireless/trace.h
 +++ b/net/wireless/trace.h
-@@ -3909,6 +3909,18 @@ TRACE_EVENT(rdev_del_link_station,
- 		  __entry->link_id)
+@@ -3981,6 +3981,18 @@ TRACE_EVENT(cfg80211_links_removed,
+ 		  __entry->link_mask)
  );
  
 +TRACE_EVENT(rdev_skip_cac,
@@ -496,5 +496,5 @@
  
  #undef TRACE_INCLUDE_PATH
 -- 
-2.18.0
+2.39.2
 
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0007-mac80211-mtk-Set-TWT-Information-Frame-Disabled-bit-.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0007-mac80211-mtk-Set-TWT-Information-Frame-Disabled-bit-.patch
index 0b33292..5276b39 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0007-mac80211-mtk-Set-TWT-Information-Frame-Disabled-bit-.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0007-mac80211-mtk-Set-TWT-Information-Frame-Disabled-bit-.patch
@@ -1,7 +1,7 @@
-From f6619b6ecec6122b107fa3c3c9bb0e2a4ceaba87 Mon Sep 17 00:00:00 2001
+From c1fac970b782b1d6786f3ec59abc995d84374ceb Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Tue, 4 Oct 2022 10:47:05 +0800
-Subject: [PATCH 07/14] mac80211: mtk: Set TWT Information Frame Disabled bit
+Subject: [PATCH 07/21] mac80211: mtk: Set TWT Information Frame Disabled bit
  as 1.
 
 This modification means that current implementation do not support twt information frame.
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0008-mac80211-mtk-check-the-control-channel-before-downgr.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0008-mac80211-mtk-check-the-control-channel-before-downgr.patch
index 685e0b7..6c614fe 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0008-mac80211-mtk-check-the-control-channel-before-downgr.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0008-mac80211-mtk-check-the-control-channel-before-downgr.patch
@@ -1,7 +1,7 @@
-From 74dec28f086c6d919d936fb159bfb3fada5f4ca7 Mon Sep 17 00:00:00 2001
+From cc5889f25d7d72cf4ecbaefbe885ad654d50e730 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 16 Dec 2022 03:31:06 +0800
-Subject: [PATCH 08/14] mac80211: mtk: check the control channel before
+Subject: [PATCH 08/21] mac80211: mtk: check the control channel before
  downgrading the bandwidth
 
 ---
@@ -9,11 +9,11 @@
  1 file changed, 23 insertions(+)
 
 diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
-index d63434b..72d153f 100644
+index f93eb38..86f762d 100644
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
-@@ -4657,6 +4657,26 @@ ieee80211_verify_sta_he_mcs_support(struct ieee80211_sub_if_data *sdata,
- 	return false;
+@@ -4791,6 +4791,26 @@ ieee80211_verify_sta_eht_mcs_support(struct ieee80211_sub_if_data *sdata,
+ 	return true;
  }
  
 +static bool ieee80211_check_same_ctrl_channel(struct ieee80211_sub_if_data *sdata,
@@ -39,7 +39,7 @@
  static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
  				  struct ieee80211_link_data *link,
  				  struct cfg80211_bss *cbss,
-@@ -4883,6 +4903,9 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
+@@ -5033,6 +5053,9 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
  	    chandef.width == NL80211_CHAN_WIDTH_10)
  		goto out;
  
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0009-mac80211-mtk-fix-tx-amsdu-aggregation.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0009-mac80211-mtk-fix-tx-amsdu-aggregation.patch
index fd2295f..a505811 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0009-mac80211-mtk-fix-tx-amsdu-aggregation.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0009-mac80211-mtk-fix-tx-amsdu-aggregation.patch
@@ -1,7 +1,7 @@
-From e12f4ecc226a21580958bcbb2f418ae979e49a36 Mon Sep 17 00:00:00 2001
+From 3a7bbbffc4870e413856f3f3d7e54066117d13ed Mon Sep 17 00:00:00 2001
 From: TomLiu <tomml.liu@mediatek.com>
 Date: Wed, 14 Dec 2022 00:26:50 -0800
-Subject: [PATCH 09/14] mac80211: mtk: fix tx amsdu aggregation
+Subject: [PATCH 09/21] mac80211: mtk: fix tx amsdu aggregation
 
 ---
  include/net/mac80211.h | 7 +++++++
@@ -9,10 +9,10 @@
  2 files changed, 11 insertions(+), 2 deletions(-)
 
 diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index 09fad2b..bd257ce 100644
+index 96e4ec9..eb229aa 100644
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -2905,6 +2905,13 @@ static inline void _ieee80211_hw_set(struct ieee80211_hw *hw,
+@@ -2921,6 +2921,13 @@ static inline void _ieee80211_hw_set(struct ieee80211_hw *hw,
  }
  #define ieee80211_hw_set(hw, flg)	_ieee80211_hw_set(hw, IEEE80211_HW_##flg)
  
@@ -27,7 +27,7 @@
   * struct ieee80211_scan_request - hw scan request
   *
 diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
-index 6597607..752ad09 100644
+index b6b7726..80cd642 100644
 --- a/net/mac80211/agg-tx.c
 +++ b/net/mac80211/agg-tx.c
 @@ -66,7 +66,8 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0010-mac80211-mtk-add-fill-receive-path-ops-to-get-wed-id.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0010-mac80211-mtk-add-fill-receive-path-ops-to-get-wed-id.patch
index a160e14..d121c4f 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0010-mac80211-mtk-add-fill-receive-path-ops-to-get-wed-id.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0010-mac80211-mtk-add-fill-receive-path-ops-to-get-wed-id.patch
@@ -1,7 +1,7 @@
-From ea115965135f78dc8993f1a73a0600fb5b83cdf7 Mon Sep 17 00:00:00 2001
+From 66fbfef0e7ae77359c9609aeec93a31463af59b4 Mon Sep 17 00:00:00 2001
 From: Sujuan Chen <sujuan.chen@mediatek.com>
 Date: Wed, 18 May 2022 15:10:22 +0800
-Subject: [PATCH 10/14] mac80211: mtk: add fill receive path ops to get wed idx
+Subject: [PATCH 10/21] mac80211: mtk: add fill receive path ops to get wed idx
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
@@ -12,10 +12,10 @@
  4 files changed, 50 insertions(+)
 
 diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index bd257ce..9208a8d 100644
+index eb229aa..2c282e6 100644
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -4226,6 +4226,8 @@ struct ieee80211_prep_tx_info {
+@@ -4255,6 +4255,8 @@ struct ieee80211_prep_tx_info {
   *	disable background CAC/radar detection.
   * @net_fill_forward_path: Called from .ndo_fill_forward_path in order to
   *	resolve a path for hardware flow offloading
@@ -24,7 +24,7 @@
   * @change_vif_links: Change the valid links on an interface, note that while
   *	removing the old link information is still valid (link_conf pointer),
   *	but may immediately disappear after the function returns. The old or
-@@ -4591,6 +4593,9 @@ struct ieee80211_ops {
+@@ -4631,6 +4633,9 @@ struct ieee80211_ops {
  				     struct ieee80211_sta *sta,
  				     struct net_device_path_ctx *ctx,
  				     struct net_device_path *path);
@@ -35,10 +35,10 @@
  				struct ieee80211_vif *vif,
  				u16 old_links, u16 new_links,
 diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
-index 37f428e..b076658 100644
+index 650d8d1..d187206 100644
 --- a/net/mac80211/driver-ops.h
 +++ b/net/mac80211/driver-ops.h
-@@ -1485,6 +1485,19 @@ static inline int drv_net_fill_forward_path(struct ieee80211_local *local,
+@@ -1519,6 +1519,19 @@ static inline int drv_net_fill_forward_path(struct ieee80211_local *local,
  	return ret;
  }
  
@@ -59,10 +59,10 @@
  				   struct ieee80211_sub_if_data *sdata,
  				   struct net_device *dev,
 diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
-index a18f80d..b82065c 100644
+index be586bc..b8dfd32 100644
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -936,6 +936,28 @@ out:
+@@ -930,6 +930,28 @@ out:
  	return ret;
  }
  
@@ -91,7 +91,7 @@
  static const struct net_device_ops ieee80211_dataif_8023_ops = {
  	.ndo_open		= ieee80211_open,
  	.ndo_stop		= ieee80211_stop,
-@@ -945,6 +967,7 @@ static const struct net_device_ops ieee80211_dataif_8023_ops = {
+@@ -939,6 +961,7 @@ static const struct net_device_ops ieee80211_dataif_8023_ops = {
  	.ndo_set_mac_address	= ieee80211_change_mac,
  	.ndo_get_stats64	= ieee80211_get_stats64,
  	.ndo_fill_forward_path	= ieee80211_netdev_fill_forward_path,
@@ -100,10 +100,10 @@
  };
  
 diff --git a/net/mac80211/util.c b/net/mac80211/util.c
-index 5a6c091..f6a2561 100644
+index 8a6917c..3650dcd 100644
 --- a/net/mac80211/util.c
 +++ b/net/mac80211/util.c
-@@ -888,6 +888,15 @@ struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif)
+@@ -868,6 +868,15 @@ struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif)
  }
  EXPORT_SYMBOL_GPL(ieee80211_vif_to_wdev);
  
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0011-mac80211-mtk-fix-build-error-on-Linux-Kernel-5.4.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0011-mac80211-mtk-fix-build-error-on-Linux-Kernel-5.4.patch
index 17a5248..a75e19c 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0011-mac80211-mtk-fix-build-error-on-Linux-Kernel-5.4.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0011-mac80211-mtk-fix-build-error-on-Linux-Kernel-5.4.patch
@@ -1,17 +1,17 @@
-From ecf81145d85cc3d991d360d283b83a0e91ecf1da Mon Sep 17 00:00:00 2001
+From d0528e1e6fffdb620314bb7934cdab4971e02e77 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Tue, 13 Dec 2022 09:04:49 +0800
-Subject: [PATCH 11/14] mac80211: mtk: fix build error on Linux Kernel 5.4
+Subject: [PATCH 11/21] mac80211: mtk: fix build error on Linux Kernel 5.4
 
 ---
- include/linux/ieee80211.h          | 8 +++-----
- net/mac80211/rc80211_minstrel_ht.c | 2 ++
- net/mac80211/wpa.c                 | 4 ++--
- net/wireless/nl80211.c             | 4 ++++
- 4 files changed, 11 insertions(+), 7 deletions(-)
+ include/linux/ieee80211.h          |  8 +++-----
+ net/mac80211/rc80211_minstrel_ht.c |  2 ++
+ net/mac80211/wpa.c                 |  4 ++--
+ net/wireless/nl80211.c             | 12 +++++-------
+ 4 files changed, 12 insertions(+), 14 deletions(-)
 
 diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
-index d15816f..00d381e 100644
+index 4b99809..7aaae32 100644
 --- a/include/linux/ieee80211.h
 +++ b/include/linux/ieee80211.h
 @@ -310,11 +310,9 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
@@ -30,7 +30,7 @@
  	u8 addr4[ETH_ALEN];
  } __packed __aligned(2);
 diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
-index 33001ec..277fec9 100644
+index e916130..c09147f 100644
 --- a/net/mac80211/rc80211_minstrel_ht.c
 +++ b/net/mac80211/rc80211_minstrel_ht.c
 @@ -10,7 +10,9 @@
@@ -66,10 +66,32 @@
  
  
 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index 95676d9..6f1d60a 100644
+index ff8afa5..0ed3f51 100644
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -16457,9 +16457,11 @@ static const struct genl_ops nl80211_ops[] = {
+@@ -461,11 +461,6 @@ nl80211_sta_wme_policy[NL80211_STA_WME_MAX + 1] = {
+ 	[NL80211_STA_WME_MAX_SP] = { .type = NLA_U8 },
+ };
+ 
+-static struct netlink_range_validation nl80211_punct_bitmap_range = {
+-	.min = 0,
+-	.max = 0xffff,
+-};
+-
+ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
+ 	[0] = { .strict_start_type = NL80211_ATTR_HE_OBSS_PD },
+ 	[NL80211_ATTR_WIPHY] = { .type = NLA_U32 },
+@@ -805,8 +800,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
+ 	[NL80211_ATTR_MLD_ADDR] = NLA_POLICY_EXACT_LEN(ETH_ALEN),
+ 	[NL80211_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG },
+ 	[NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT },
+-	[NL80211_ATTR_PUNCT_BITMAP] =
+-		NLA_POLICY_FULL_RANGE(NLA_U32, &nl80211_punct_bitmap_range),
++	[NL80211_ATTR_PUNCT_BITMAP] = NLA_POLICY_RANGE(NLA_U8, 0, 0xffff),
+ 
+ 	[NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS] = { .type = NLA_U16 },
+ 	[NL80211_ATTR_HW_TIMESTAMP_ENABLED] = { .type = NLA_FLAG },
+@@ -16687,9 +16681,11 @@ static const struct genl_ops nl80211_ops[] = {
  		/* can be retrieved by unprivileged users */
  		.internal_flags = IFLAGS(NL80211_FLAG_NEED_WIPHY),
  	},
@@ -81,7 +103,7 @@
  	{
  		.cmd = NL80211_CMD_SET_WIPHY,
  		.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
-@@ -17296,8 +17298,10 @@ static struct genl_family nl80211_fam __genl_ro_after_init = {
+@@ -17534,8 +17530,10 @@ static struct genl_family nl80211_fam __genl_ro_after_init = {
  	.module = THIS_MODULE,
  	.ops = nl80211_ops,
  	.n_ops = ARRAY_SIZE(nl80211_ops),
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0012-mac80211-mtk-track-obss-color-bitmap.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0012-mac80211-mtk-track-obss-color-bitmap.patch
index 607670c..31811d3 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0012-mac80211-mtk-track-obss-color-bitmap.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0012-mac80211-mtk-track-obss-color-bitmap.patch
@@ -1,7 +1,7 @@
-From a7b0e17e0dafe6cfe58f88465006cd0c9e7c3217 Mon Sep 17 00:00:00 2001
+From 529ea5156b39398b24801eabcb3f1531ca53d3ca Mon Sep 17 00:00:00 2001
 From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 Date: Mon, 13 Mar 2023 05:23:37 +0800
-Subject: [PATCH 12/14] mac80211: mtk: track obss color bitmap
+Subject: [PATCH 12/21] mac80211: mtk: track obss color bitmap
 
 Track OBSS BSS color when receive their beacon.
 
@@ -9,17 +9,16 @@
 echo 1 > /sys/kernel/debug/tracing/events/mac80211/bss_color_bitmap/enable
 echo 1 > /sys/kernel/debug/tracing/events/mac80211/bss_color_collision/enable
 ---
- include/net/mac80211.h |  5 +++--
- net/mac80211/cfg.c     |  4 ++--
- net/mac80211/rx.c      |  9 +++++++--
+ include/net/mac80211.h |  1 +
+ net/mac80211/rx.c      |  6 +++++-
  net/mac80211/trace.h   | 21 +++++++++++++++++++++
- 4 files changed, 33 insertions(+), 6 deletions(-)
+ 3 files changed, 27 insertions(+), 1 deletion(-)
 
 diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index 9208a8d..299425a 100644
+index 2c282e6..b90e828 100644
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -741,6 +741,7 @@ struct ieee80211_bss_conf {
+@@ -744,6 +744,7 @@ struct ieee80211_bss_conf {
  	} he_oper;
  	struct ieee80211_he_obss_pd he_obss_pd;
  	struct cfg80211_he_bss_color he_bss_color;
@@ -27,72 +26,30 @@
  	struct ieee80211_fils_discovery fils_discovery;
  	u32 unsol_bcast_probe_resp_interval;
  	struct cfg80211_bitrate_mask beacon_tx_rate;
-@@ -7269,7 +7270,7 @@ ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw,
- 					  struct ieee80211_vif *vif);
- 
- /**
-- * ieeee80211_obss_color_collision_notify - notify userland about a BSS color
-+ * ieee80211_obss_color_collision_notify - notify userland about a BSS color
-  * collision.
-  *
-  * @vif: &struct ieee80211_vif pointer from the add_interface callback.
-@@ -7278,7 +7279,7 @@ ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw,
-  * @gfp: allocation flags
-  */
- void
--ieeee80211_obss_color_collision_notify(struct ieee80211_vif *vif,
-+ieee80211_obss_color_collision_notify(struct ieee80211_vif *vif,
- 				       u64 color_bitmap, gfp_t gfp);
- 
- /**
-diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 36a2c8d..0ecc026 100644
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -4750,7 +4750,7 @@ void ieee80211_color_change_finish(struct ieee80211_vif *vif)
- EXPORT_SYMBOL_GPL(ieee80211_color_change_finish);
- 
- void
--ieeee80211_obss_color_collision_notify(struct ieee80211_vif *vif,
-+ieee80211_obss_color_collision_notify(struct ieee80211_vif *vif,
- 				       u64 color_bitmap, gfp_t gfp)
- {
- 	struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
-@@ -4770,7 +4770,7 @@ ieeee80211_obss_color_collision_notify(struct ieee80211_vif *vif,
- 				     &link->color_collision_detect_work,
- 				     msecs_to_jiffies(500));
- }
--EXPORT_SYMBOL_GPL(ieeee80211_obss_color_collision_notify);
-+EXPORT_SYMBOL_GPL(ieee80211_obss_color_collision_notify);
- 
- static int
- ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev,
 diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
-index 54dcaf6..0048c22 100644
+index 56abe67..cf41b93 100644
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -3338,9 +3338,14 @@ ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx)
+@@ -3349,9 +3349,13 @@ ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx)
  
  		color = le32_get_bits(he_oper->he_oper_params,
  				      IEEE80211_HE_OPERATION_BSS_COLOR_MASK);
 +
 +		bss_conf->used_color_bitmap |= BIT_ULL(color);
 +
-+		trace_bss_color_bitmap(color, bss_conf->used_color_bitmap);
-+
++		// trace_bss_color_bitmap(color, bss_conf->used_color_bitmap);
  		if (color == bss_conf->he_bss_color.color)
--			ieeee80211_obss_color_collision_notify(&rx->sdata->vif,
--							       BIT_ULL(color),
-+			ieee80211_obss_color_collision_notify(&rx->sdata->vif,
-+							       bss_conf->used_color_bitmap,
- 							       GFP_ATOMIC);
+ 			ieee80211_obss_color_collision_notify(&rx->sdata->vif,
+-							      BIT_ULL(color),
++							      bss_conf->used_color_bitmap,
+ 							      GFP_ATOMIC);
  	}
  }
 diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
-index de5d69f..cad6597 100644
+index b8c53b4..814aed6 100644
 --- a/net/mac80211/trace.h
 +++ b/net/mac80211/trace.h
-@@ -3058,6 +3058,27 @@ TRACE_EVENT(stop_queue,
+@@ -3060,6 +3060,27 @@ TRACE_EVENT(stop_queue,
  	)
  );
  
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0013-mac80211-mtk-ageout-color-bitmap.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0013-mac80211-mtk-ageout-color-bitmap.patch
index 34e1f5c..4531d85 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0013-mac80211-mtk-ageout-color-bitmap.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0013-mac80211-mtk-ageout-color-bitmap.patch
@@ -1,7 +1,7 @@
-From dd1fc5e8ea8df5f6a5e0b87957872053d13b3278 Mon Sep 17 00:00:00 2001
+From 31b5d2289d106c9d0f55ea501182080ca1d52a72 Mon Sep 17 00:00:00 2001
 From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 Date: Mon, 13 Mar 2023 05:36:59 +0800
-Subject: [PATCH] mac80211: mtk: ageout color bitmap
+Subject: [PATCH 13/21] mac80211: mtk: ageout color bitmap
 
 Adding a periodic work which runs once per second to check BSS color.
 OBSS BSS Color will be ageout if not seen for 10 seconds.
@@ -11,14 +11,14 @@
  net/mac80211/ieee80211_i.h |  5 +++++
  net/mac80211/iface.c       |  5 +++++
  net/mac80211/link.c        |  2 ++
- net/mac80211/rx.c          |  3 ++-
- 6 files changed, 45 insertions(+), 1 deletion(-)
+ net/mac80211/rx.c          |  1 +
+ 6 files changed, 44 insertions(+)
 
 diff --git a/include/net/mac80211.h b/include/net/mac80211.h
-index 299425a..b4f156e 100644
+index b90e828..6ff6d3a 100644
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -742,6 +742,7 @@ struct ieee80211_bss_conf {
+@@ -745,6 +745,7 @@ struct ieee80211_bss_conf {
  	struct ieee80211_he_obss_pd he_obss_pd;
  	struct cfg80211_he_bss_color he_bss_color;
  	u64 used_color_bitmap;
@@ -27,10 +27,10 @@
  	u32 unsol_bcast_probe_resp_interval;
  	struct cfg80211_bitrate_mask beacon_tx_rate;
 diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 0ecc026..3c83024 100644
+index 8033b2f..177409d 100644
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -4817,6 +4817,36 @@ out:
+@@ -4881,6 +4881,36 @@ out:
  	return err;
  }
  
@@ -68,10 +68,10 @@
  ieee80211_set_radar_background(struct wiphy *wiphy,
  			       struct cfg80211_chan_def *chandef)
 diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
-index 04128d5..bf2c51e 100644
+index 7ca2482..1fa9641 100644
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -989,6 +989,7 @@ struct ieee80211_link_data {
+@@ -996,6 +996,7 @@ struct ieee80211_link_data {
  
  	struct work_struct color_change_finalize_work;
  	struct delayed_work color_collision_detect_work;
@@ -79,7 +79,7 @@
  	u64 color_bitmap;
  
  	/* context reservation -- protected with chanctx_mtx */
-@@ -1932,9 +1933,13 @@ void ieee80211_csa_finalize_work(struct work_struct *work);
+@@ -1993,9 +1994,13 @@ 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);
  
@@ -94,7 +94,7 @@
  /* interface handling */
  #define MAC80211_SUPPORTED_FEATURES_TX	(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \
 diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
-index b82065c..6a300ab 100644
+index b8dfd32..e5b5e74 100644
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
 @@ -541,6 +541,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
@@ -105,7 +105,7 @@
  
  	if (sdata->wdev.cac_started) {
  		chandef = sdata->vif.bss_conf.chandef;
-@@ -1470,6 +1471,10 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
+@@ -1474,6 +1475,10 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
  
  	set_bit(SDATA_STATE_RUNNING, &sdata->state);
  
@@ -117,10 +117,10 @@
   err_del_interface:
  	drv_remove_interface(local, sdata);
 diff --git a/net/mac80211/link.c b/net/mac80211/link.c
-index a1b3031..7d4cdfb 100644
+index 6148208..2f64b69 100644
 --- a/net/mac80211/link.c
 +++ b/net/mac80211/link.c
-@@ -45,6 +45,8 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata,
+@@ -47,6 +47,8 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata,
  	INIT_LIST_HEAD(&link->reserved_chanctx_list);
  	INIT_DELAYED_WORK(&link->dfs_cac_timer_work,
  			  ieee80211_dfs_cac_timer_work);
@@ -130,20 +130,17 @@
  	if (!deflink) {
  		switch (sdata->vif.type) {
 diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
-index 0048c22..6b0fb01 100644
+index cf41b93..e245f31 100644
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -3340,8 +3340,9 @@ ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx)
+@@ -3351,6 +3351,7 @@ ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx)
  				      IEEE80211_HE_OPERATION_BSS_COLOR_MASK);
  
  		bss_conf->used_color_bitmap |= BIT_ULL(color);
 +		bss_conf->color_last_seen[color] = jiffies;
  
--		trace_bss_color_bitmap(color, bss_conf->used_color_bitmap);
-+		/* trace_bss_color_bitmap(color, bss_conf->used_color_bitmap); */
- 
+ 		// trace_bss_color_bitmap(color, bss_conf->used_color_bitmap);
  		if (color == bss_conf->he_bss_color.color)
- 			ieee80211_obss_color_collision_notify(&rx->sdata->vif,
 -- 
 2.39.2
 
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0014-mac80211-mtk-update-max_bssid_indicator-based-on-rea.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0014-mac80211-mtk-update-max_bssid_indicator-based-on-rea.patch
index 205d30d..8d2b34d 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0014-mac80211-mtk-update-max_bssid_indicator-based-on-rea.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0014-mac80211-mtk-update-max_bssid_indicator-based-on-rea.patch
@@ -1,7 +1,7 @@
-From 869bb0c749acc325ea6ecbf7513a90159d426602 Mon Sep 17 00:00:00 2001
+From 928dff74ea4777892a48de4d9a8e1385bf4cab81 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 14 Apr 2023 05:05:17 +0800
-Subject: [PATCH 14/14] mac80211: mtk: update max_bssid_indicator based on real
+Subject: [PATCH 14/21] mac80211: mtk: update max_bssid_indicator based on real
  BSS numbers
 
 ---
@@ -9,12 +9,12 @@
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 3c83024..d5ffa64 100644
+index 177409d..9724258 100644
 --- a/net/mac80211/cfg.c
 +++ b/net/mac80211/cfg.c
-@@ -1152,8 +1152,7 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
- 		pos += struct_size(new->mbssid_ies, elem, mbssid->cnt);
- 		ieee80211_copy_mbssid_beacon(pos, new->mbssid_ies, mbssid);
+@@ -1194,8 +1194,7 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
+ 			ieee80211_copy_rnr_beacon(pos, new->rnr_ies, rnr);
+ 		}
  		/* update bssid_indicator */
 -		link_conf->bssid_indicator =
 -			ilog2(__roundup_pow_of_two(mbssid->cnt + 1));
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0015-mac80211-support-configurable-addba-resp-time.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0015-support-configurable-addba-resp-time.patch
similarity index 80%
rename from autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0015-mac80211-support-configurable-addba-resp-time.patch
rename to autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0015-support-configurable-addba-resp-time.patch
index 759d36b..de32d4e 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0015-mac80211-support-configurable-addba-resp-time.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0015-support-configurable-addba-resp-time.patch
@@ -1,14 +1,14 @@
-From 0236a4a01f3f3ed932ab326de0deef6911519dab Mon Sep 17 00:00:00 2001
+From 41a81ced950b4f97331f964b8ad67b773b5dcd7a Mon Sep 17 00:00:00 2001
 From: Lian Chen <lian.chen@mediatek.com>
 Date: Wed, 7 Jun 2023 15:30:34 +0800
-Subject: [PATCH] support configurable addba resp time.
+Subject: [PATCH 15/21] support configurable addba resp time.
 
 ---
  net/mac80211/agg-tx.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
 
 diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
-index 6992c1f..ad0c0d6 100644
+index 80cd642..7f66e69 100644
 --- a/net/mac80211/agg-tx.c
 +++ b/net/mac80211/agg-tx.c
 @@ -16,10 +16,16 @@
@@ -28,8 +28,8 @@
  /**
   * DOC: TX A-MPDU aggregation
   *
-@@ -460,7 +466,7 @@ static void ieee80211_send_addba_with_timeout(struct sta_info *sta,
- 	u16 buf_size;
+@@ -466,7 +472,7 @@ static void ieee80211_send_addba_with_timeout(struct sta_info *sta,
+ 	lockdep_assert_held(&sta->ampdu_mlme.mtx);
  
  	/* activate the timer for the recipient's addBA response */
 -	mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL);
@@ -38,5 +38,5 @@
  	       sta->sta.addr, tid);
  
 -- 
-2.18.0
+2.39.2
 
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0016-mac80211-mtk-add-sta-assisted-DFS-state-update-mecha.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0016-mac80211-mtk-add-sta-assisted-DFS-state-update-mecha.patch
index f14111c..945a5bd 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0016-mac80211-mtk-add-sta-assisted-DFS-state-update-mecha.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0016-mac80211-mtk-add-sta-assisted-DFS-state-update-mecha.patch
@@ -1,7 +1,8 @@
-From e545285e24de95d0d620bb7e9c97abba39e363b9 Mon Sep 17 00:00:00 2001
+From e2aa2e712fbebfbbb2338debd632d83157d72e92 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 14:25:24 +0800
-Subject: [PATCH] mac80211: mtk: add sta-assisted DFS state update mechanism
+Subject: [PATCH 16/21] mac80211: mtk: add sta-assisted DFS state update
+ mechanism
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
@@ -12,10 +13,10 @@
  4 files changed, 92 insertions(+)
 
 diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
-index 84564bd..06d1567 100644
+index cd0ec8a..2c51c3e 100644
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -8180,6 +8180,20 @@ void cfg80211_cac_event(struct net_device *netdev,
+@@ -8430,6 +8430,20 @@ void cfg80211_cac_event(struct net_device *netdev,
  			const struct cfg80211_chan_def *chandef,
  			enum nl80211_radar_event event, gfp_t gfp);
  
@@ -37,10 +38,10 @@
   * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
   * @wiphy: the wiphy
 diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
-index bd26a06..e453d64 100644
+index 72ef4d9..60c6f79 100644
 --- a/include/uapi/linux/nl80211.h
 +++ b/include/uapi/linux/nl80211.h
-@@ -6565,6 +6565,10 @@ enum nl80211_smps_mode {
+@@ -6671,6 +6671,10 @@ enum nl80211_smps_mode {
   *	applicable for ETSI dfs domain where pre-CAC is valid for ever.
   * @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started,
   *	should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled.
@@ -51,7 +52,7 @@
   */
  enum nl80211_radar_event {
  	NL80211_RADAR_DETECTED,
-@@ -6573,6 +6577,8 @@ enum nl80211_radar_event {
+@@ -6679,6 +6683,8 @@ enum nl80211_radar_event {
  	NL80211_RADAR_NOP_FINISHED,
  	NL80211_RADAR_PRE_CAC_EXPIRED,
  	NL80211_RADAR_CAC_STARTED,
@@ -61,10 +62,10 @@
  
  /**
 diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
-index 72d153f..5a3dd31 100644
+index 86f762d..df39a8b 100644
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
-@@ -1987,6 +1987,11 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link,
+@@ -1981,6 +1981,11 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link,
  					  IEEE80211_QUEUE_STOP_REASON_CSA);
  	mutex_unlock(&local->mtx);
  
@@ -73,13 +74,13 @@
 +				      &link->csa_chandef,
 +				      sdata->vif.cfg.assoc);
 +
- 	cfg80211_ch_switch_started_notify(sdata->dev, &csa_ie.chandef, 0,
- 					  csa_ie.count, csa_ie.mode, 0);
- 
-@@ -3072,6 +3077,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
+ 	cfg80211_ch_switch_started_notify(sdata->dev, &csa_ie.chandef,
+ 					  link->link_id, csa_ie.count,
+ 					  csa_ie.mode, 0);
+@@ -3066,6 +3071,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
  	       sizeof(sdata->vif.bss_conf.tx_pwr_env));
  
- 	ieee80211_vif_set_links(sdata, 0);
+ 	ieee80211_vif_set_links(sdata, 0, 0);
 +
 +	cfg80211_sta_update_dfs_state(&sdata->wdev,
 +				      &sdata->vif.bss_conf.chandef,
@@ -87,7 +88,7 @@
  }
  
  static void ieee80211_reset_ap_probe(struct ieee80211_sub_if_data *sdata)
-@@ -5276,6 +5285,9 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
+@@ -5445,6 +5454,9 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
  		event.u.mlme.status = MLME_SUCCESS;
  		drv_event_callback(sdata->local, sdata, &event);
  		sdata_info(sdata, "associated\n");
@@ -98,7 +99,7 @@
  		info.success = 1;
  	}
 diff --git a/net/wireless/chan.c b/net/wireless/chan.c
-index fef0ba5..13276bc 100644
+index caa5acc..a7e597d 100644
 --- a/net/wireless/chan.c
 +++ b/net/wireless/chan.c
 @@ -14,6 +14,7 @@
@@ -109,7 +110,7 @@
  
  static bool cfg80211_valid_60g_freq(u32 freq)
  {
-@@ -1436,6 +1437,65 @@ bool cfg80211_any_usable_channels(struct wiphy *wiphy,
+@@ -1437,6 +1438,65 @@ bool cfg80211_any_usable_channels(struct wiphy *wiphy,
  }
  EXPORT_SYMBOL(cfg80211_any_usable_channels);
  
@@ -176,5 +177,5 @@
  				       unsigned int link_id)
  {
 -- 
-2.18.0
+2.39.2
 
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0017-nl80211-mtk-Mark-DFS-channel-as-available-for-CSA.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0017-nl80211-mtk-Mark-DFS-channel-as-available-for-CSA.patch
index cdc6290..92686c5 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0017-nl80211-mtk-Mark-DFS-channel-as-available-for-CSA.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0017-nl80211-mtk-Mark-DFS-channel-as-available-for-CSA.patch
@@ -1,17 +1,17 @@
-From 4c78e6469da8de9c4584d029231938063545b031 Mon Sep 17 00:00:00 2001
+From 532a2d6aacdd960d8f9f046f5862cae740b160b5 Mon Sep 17 00:00:00 2001
 From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
 Date: Fri, 17 Mar 2023 17:36:01 +0800
-Subject: [PATCH] nl80211: mtk: Mark DFS channel as available for CSA.
+Subject: [PATCH 17/21] nl80211: mtk: Mark DFS channel as available for CSA.
 
 ---
  net/wireless/nl80211.c | 5 +++++
  1 file changed, 5 insertions(+)
 
 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index af43c22..53f32c6 100644
+index 0ed3f51..d8e4d0f 100644
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -10079,6 +10079,11 @@ skip_beacons:
+@@ -10250,6 +10250,11 @@ skip_beacons:
  	if (err)
  		goto free;
  
@@ -24,5 +24,5 @@
  					   wdev->iftype)) {
  		err = -EINVAL;
 -- 
-2.18.0
+2.39.2
 
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0018-cfg80211-mtk-fix-early-return-in-cfg80211_stop_backg.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0018-cfg80211-mtk-fix-early-return-in-cfg80211_stop_backg.patch
index d57273b..810054d 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0018-cfg80211-mtk-fix-early-return-in-cfg80211_stop_backg.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0018-cfg80211-mtk-fix-early-return-in-cfg80211_stop_backg.patch
@@ -1,7 +1,7 @@
-From 435bf8765d44b694b86a400fb128fcf6d72b8aa6 Mon Sep 17 00:00:00 2001
+From ca445932b19fb346ea7cb33a5d23d94f979a2603 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Thu, 27 Jul 2023 10:25:59 +0800
-Subject: [PATCH 18/19] cfg80211: mtk: fix early return in
+Subject: [PATCH 18/21] cfg80211: mtk: fix early return in
  cfg80211_stop_background_radar_detection
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -10,10 +10,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
-index 57b9bde..c2cf8aa 100644
+index e3cbfc0..d345c72 100644
 --- a/net/wireless/mlme.c
 +++ b/net/wireless/mlme.c
-@@ -1145,9 +1145,9 @@ void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev)
+@@ -1169,9 +1169,9 @@ void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev)
  		return;
  
  	rdev_set_radar_background(rdev, NULL);
@@ -25,5 +25,5 @@
 +	rdev->background_radar_wdev = NULL; /* Release offchain ownership */
  }
 -- 
-2.18.0
+2.39.2
 
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0019-cfg80211-mtk-add-background-radar-stop-when-backgrou.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0019-cfg80211-mtk-add-background-radar-stop-when-backgrou.patch
index 66d4d10..a07ea82 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0019-cfg80211-mtk-add-background-radar-stop-when-backgrou.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0019-cfg80211-mtk-add-background-radar-stop-when-backgrou.patch
@@ -1,7 +1,7 @@
-From 818c8f1d1a9ff9e5423ed0927b052692c282fdf4 Mon Sep 17 00:00:00 2001
+From a97cd11f1654844ed431aa359eca83fa844883c0 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Thu, 27 Jul 2023 10:27:04 +0800
-Subject: [PATCH 19/19] cfg80211: mtk: add background radar stop when
+Subject: [PATCH 19/21] cfg80211: mtk: add background radar stop when
  background channel is overlapped with operating channel
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -10,10 +10,10 @@
  1 file changed, 4 insertions(+)
 
 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index 53f32c6..ab61f8f 100644
+index d8e4d0f..4692480 100644
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -9852,6 +9852,10 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
+@@ -10021,6 +10021,10 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
  		wdev->cac_started = true;
  		wdev->cac_start_time = jiffies;
  		wdev->cac_time_ms = cac_time_ms;
@@ -25,5 +25,5 @@
  unlock:
  	wiphy_unlock(wiphy);
 -- 
-2.18.0
+2.39.2
 
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0020-mac80211-mtk-avoid-kernel-warning-of-check_flush_dep.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0020-mac80211-mtk-avoid-kernel-warning-of-check_flush_dep.patch
index cc72cf9..3ac2f2c 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0020-mac80211-mtk-avoid-kernel-warning-of-check_flush_dep.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0020-mac80211-mtk-avoid-kernel-warning-of-check_flush_dep.patch
@@ -1,7 +1,7 @@
-From 6e6ceea486d4bd12a2d4118905d8fc0ba5eec6f6 Mon Sep 17 00:00:00 2001
+From f386c3a87f050489992ca66b8b17e970dc4a1ec1 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Thu, 3 Aug 2023 07:17:44 +0800
-Subject: [PATCH 1/7] mac80211: mtk: avoid kernel warning of
+Subject: [PATCH 20/21] mac80211: mtk: avoid kernel warning of
  check_flush_dependency
 
 ---
@@ -9,10 +9,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/net/mac80211/main.c b/net/mac80211/main.c
-index 06d111d..8965fff 100644
+index 0188e6a..ba133fa 100644
 --- a/net/mac80211/main.c
 +++ b/net/mac80211/main.c
-@@ -1276,7 +1276,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
+@@ -1291,7 +1291,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
  		hw->queues = IEEE80211_MAX_QUEUES;
  
  	local->workqueue =
@@ -22,5 +22,5 @@
  		result = -ENOMEM;
  		goto fail_workqueue;
 -- 
-2.18.0
+2.39.2
 
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0021-mac80211-mtk-avoid-calling-switch_vif_chanctx-when-u.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0021-mac80211-mtk-avoid-calling-switch_vif_chanctx-when-u.patch
index d9fcacf..11bc559 100644
--- a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0021-mac80211-mtk-avoid-calling-switch_vif_chanctx-when-u.patch
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0021-mac80211-mtk-avoid-calling-switch_vif_chanctx-when-u.patch
@@ -1,7 +1,7 @@
-From d5104c3407f3f1d476d072a8242ba40cc96ae566 Mon Sep 17 00:00:00 2001
+From 244189a8c4412ac16301678a7683f4eb2545d657 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 7 Aug 2023 19:00:53 +0800
-Subject: [PATCH] mac80211: mtk: avoid calling switch_vif_chanctx when
+Subject: [PATCH 21/21] mac80211: mtk: avoid calling switch_vif_chanctx when
  use_chanctx is false
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -10,10 +10,10 @@
  1 file changed, 8 insertions(+), 6 deletions(-)
 
 diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
-index dbc34fb..f9d1a8a 100644
+index 6895275..96f1ad0 100644
 --- a/net/mac80211/chan.c
 +++ b/net/mac80211/chan.c
-@@ -1280,13 +1280,15 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link)
+@@ -1304,13 +1304,15 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link)
  	list_del(&link->reserved_chanctx_list);
  	link->reserved_chanctx = NULL;
  
@@ -36,5 +36,5 @@
  
  	list_move(&link->assigned_chanctx_list, &new_ctx->assigned_links);
 -- 
-2.18.0
+2.39.2