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

[Description]
7da4329 [MAC80211][Rebase Patches][Fix git am issue]
1d75dad [MAC80211][hostapd][Fix setting the wrong seg0 index for 5G center 159 BW40]
8c541d9 [MAC80211][core][Add DFS available state reset cmd in debugfs]
7fa5a10 [MAC80211][Rebase patches]
4c891af [MAC80211][mt76][Fix incorrect HE TX GI report]
e70a1aa [MAC80211][hostapd][Add EHT to auto ht]
6784d34 [MAC80211][mt76][Add EHT40+/EHT40-/HE40+/HE40- support by uci command]

[Release-log]

Change-Id: I80f004d60a62a0bb6cded72d2533f83ac63c5f6e
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
index 7eed335..edab139 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
@@ -1,7 +1,7 @@
-From 450d63689a1b93a96432d32e7b74f88b5bb37041 Mon Sep 17 00:00:00 2001
+From 6e4d4d6feafd223615cddf334b6c3beb6e5191cc Mon Sep 17 00:00:00 2001
 From: "howard.hsu" <howard-yh.hsu@mediatek.com>
 Date: Wed, 19 Jan 2022 19:18:07 +0800
-Subject: [PATCH 01/26] hostapd: mtk: Add neighbor report and BSS Termination
+Subject: [PATCH 01/29] hostapd: mtk: Add neighbor report and BSS Termination
  for MBO certification
 
 1. Add hostapd_neighbor_count() and hostapd_neighbor_insert_buffer ()
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
index a49167c..b4ce65c 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
@@ -1,7 +1,7 @@
-From cf8954130bda13e31691be744fff1b123b8230cd Mon Sep 17 00:00:00 2001
+From 1320c3e6d39c08371da1a80ffa1ae3ecb711c742 Mon Sep 17 00:00:00 2001
 From: Shayne Chen <shayne.chen@mediatek.com>
 Date: Tue, 20 Sep 2022 19:33:45 +0800
-Subject: [PATCH 02/26] hostapd: mtk: print sae groups by hostapd ctrl
+Subject: [PATCH 02/29] hostapd: mtk: print sae groups by hostapd ctrl
 
 ---
  hostapd/ctrl_iface.c | 13 +++++++++++++
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
index d472d99..8a2ed4d 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
@@ -1,7 +1,7 @@
-From 24ca60c0a250fc1d81e83f9120344c896c776b7f Mon Sep 17 00:00:00 2001
+From 11a3a8dcba0e17a032bf8445c6bb50835cbe8e85 Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Tue, 31 May 2022 21:15:54 +0800
-Subject: [PATCH 03/26] hostapd: mtk: add support for runtime set in-band
+Subject: [PATCH 03/29] hostapd: mtk: add support for runtime set in-band
  discovery
 
 Usage:
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
index 9eae1e3..0490689 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
@@ -1,7 +1,7 @@
-From 5cc1b09fbaad9cf3fda3821071b0262e8c2d0694 Mon Sep 17 00:00:00 2001
+From f05288a19fe295685de4cb419c31f4bd11a774df Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 15:04:57 +0800
-Subject: [PATCH 04/26] hostapd: mtk: Add mtk_vendor.h
+Subject: [PATCH 04/29] hostapd: mtk: Add mtk_vendor.h
 
 ---
  src/common/mtk_vendor.h | 195 ++++++++++++++++++++++++++++++++++++++++
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
index 7d4800f..ade6b9d 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
@@ -1,7 +1,7 @@
-From 3a2644fea08e4c7cd521a86da8c905447b891d70 Mon Sep 17 00:00:00 2001
+From c69f15f922f2095b6f36a5bbd5186e4ff5e44021 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 16:31:34 +0800
-Subject: [PATCH 05/26] hostapd: mtk: Support EDCCA hostapd configuration
+Subject: [PATCH 05/29] hostapd: mtk: Support EDCCA hostapd configuration
 
 edcca_enable and edcca_compensation and implement edcca related handlers.
 ---
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
index dbe0ee1..026b4fd 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
@@ -1,7 +1,7 @@
-From eb4bba013fd102ddd957aa62b675225940557d0b Mon Sep 17 00:00:00 2001
+From f27bf939f8e2815e2f65790e538fba3bfc46a9c3 Mon Sep 17 00:00:00 2001
 From: TomLiu <tomml.liu@mediatek.com>
 Date: Tue, 9 Aug 2022 10:23:44 -0700
-Subject: [PATCH 06/26] hostapd: mtk: Add hostapd MU SET/GET control
+Subject: [PATCH 06/29] hostapd: mtk: Add hostapd MU SET/GET control
 
 ---
  hostapd/config_file.c             |   9 +++
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
index f9e3ae8..b8d1836 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
@@ -1,7 +1,7 @@
-From 832bf1797fd010987700dc5bec920971f5df40e0 Mon Sep 17 00:00:00 2001
+From 94c7af6787585f1d063ce90c33208aa7e4f5730e Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Fri, 2 Sep 2022 01:03:23 +0800
-Subject: [PATCH 07/26] hostapd: mtk: Add three wire PTA ctrl hostapd vendor
+Subject: [PATCH 07/29] hostapd: mtk: Add three wire PTA ctrl hostapd vendor
  command
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
index 16ab828..acefdee 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
@@ -1,7 +1,7 @@
-From 45063f1f4f2abd5d0f4c76bcf98bd3247ec95ec1 Mon Sep 17 00:00:00 2001
+From a75dc659e600dc2d6f7eda2dc9886747b6c55254 Mon Sep 17 00:00:00 2001
 From: mtk27835 <shurong.wen@mediatek.com>
 Date: Wed, 7 Sep 2022 14:41:51 -0700
-Subject: [PATCH 08/26] hostapd: mtk: Add hostapd iBF control
+Subject: [PATCH 08/29] hostapd: mtk: Add hostapd iBF control
 
 Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
 ---
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
index 203aca1..d96423d 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
@@ -1,7 +1,7 @@
-From c57b2012ebc907db832b3de6e674f46fc078c240 Mon Sep 17 00:00:00 2001
+From 0c960d33f909f8c119d533cc57b1585d77e319e1 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Thu, 22 Sep 2022 16:08:09 +0800
-Subject: [PATCH 09/26] hostapd: mtk: Do not include HE capab IE if associated
+Subject: [PATCH 09/29] hostapd: mtk: Do not include HE capab IE if associated
  sta's HE capab IE is invalid
 
 ---
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
index f073a07..ffe0426 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
@@ -1,7 +1,7 @@
-From 4e6af76a87117ab480ce34c8ba3b9dd0330f3d63 Mon Sep 17 00:00:00 2001
+From f57c471059e4e9909b7fc6cbd351343cd2628e2c Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 14:55:49 +0800
-Subject: [PATCH 10/26] hostapd: mtk: Add DFS detection mode
+Subject: [PATCH 10/29] hostapd: mtk: Add DFS detection mode
 
 Add DFS detection mode for testing radar detection rate.
 If DFS detection mode is on, AP will not switch channels when receiving
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
index 4d18017..187f804 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
@@ -1,7 +1,7 @@
-From 110f0b441b55a9e418eea9ac00929a936b859bd4 Mon Sep 17 00:00:00 2001
+From 43e5bfa91c67528eb2a37071e0e4a6f32807ad8f Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 14:56:55 +0800
-Subject: [PATCH 11/26] hostapd: mtk: Add DFS offchan channel switch
+Subject: [PATCH 11/29] hostapd: mtk: Add DFS offchan channel switch
 
 Add DFS background chain channel switch command for testing purpose.
 This feature is implemented via hostapd_cli command.
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
index fd2a8d0..53936b2 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
@@ -1,7 +1,7 @@
-From 7674ca39e15bb1a2f20530f08574d1289a235cc6 Mon Sep 17 00:00:00 2001
+From 8dee72b3608710a9cb6e9694c3d6535be000e104 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 16 Dec 2022 03:57:11 +0800
-Subject: [PATCH 12/26] hostapd: mtk: Add amsdu set get ctrl
+Subject: [PATCH 12/29] hostapd: mtk: Add amsdu set get ctrl
 
 ---
  hostapd/config_file.c             |   9 +++
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
index 841f428..094e102 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
@@ -1,7 +1,7 @@
-From f74cf37f72e76e073f2f0f409e294ce35df34e29 Mon Sep 17 00:00:00 2001
+From 858e23d3ff04d156a6391168d2554796962b294c Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Thu, 12 Jan 2023 15:18:19 +0800
-Subject: [PATCH 13/26] hostapd: mtk: Add he_ldpc configuration
+Subject: [PATCH 13/29] hostapd: mtk: Add he_ldpc configuration
 
 ---
  hostapd/config_file.c        | 2 ++
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
index cc198b8..abca258 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
@@ -1,7 +1,7 @@
-From 702447202b9f41d7a7c9d39d6fbc4cbeadf17edc Mon Sep 17 00:00:00 2001
+From d45d0c40a81b1196b0dc4cc8da08fe736f04022f Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Tue, 17 Jan 2023 13:25:18 +0800
-Subject: [PATCH 14/26] hostapd: mtk: Add the broadcast destination address of
+Subject: [PATCH 14/29] hostapd: mtk: Add the broadcast destination address of
  Probe Response frame on 6 GHz
 
 According to IEEE 802.11ax 26.17.2.3.2,
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
index 4b3ab3c..a74780c 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
@@ -1,7 +1,7 @@
-From 2e6d38464b60a08b60b1e542416b5ed908ed99bb Mon Sep 17 00:00:00 2001
+From a0cc42414bd6abd0342f2fd06c09650c366c959c Mon Sep 17 00:00:00 2001
 From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
 Date: Tue, 24 Jan 2023 19:06:44 +0800
-Subject: [PATCH 15/26] hostapd: mtk: Add vendor command attribute for RTS BW
+Subject: [PATCH 15/29] hostapd: mtk: Add vendor command attribute for RTS BW
  signaling.
 
 Signed-off-by: himanshu.goyal <himanshu.goyal@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
index 36a6223..30cc7eb 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
@@ -1,7 +1,7 @@
-From b7362c50e5cf97ece5bd061ce641f0b7463359c1 Mon Sep 17 00:00:00 2001
+From 08a909a1a06a2231fda12b34aad68c6361c45e6b Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Mon, 13 Feb 2023 11:03:53 +0800
-Subject: [PATCH 16/26] hostapd: mtk: 6G band does not require DFS
+Subject: [PATCH 16/29] hostapd: mtk: 6G band does not require DFS
 
 ---
  src/ap/dfs.c | 1 +
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
index 695f183..81e22a2 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
@@ -1,7 +1,7 @@
-From 3fdf945a5225a9d213e1402e654d73eac12e6c01 Mon Sep 17 00:00:00 2001
+From 4c7054d6a1d7e373d93b6abf309c41c0151e523f Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 11:01:18 +0800
-Subject: [PATCH 17/26] hostapd: mtk: Fix sending wrong VHT operation IE in CSA
+Subject: [PATCH 17/29] hostapd: mtk: Fix sending wrong VHT operation IE in CSA
  while using ZWDFS
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
index 2170031..059ded9 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
@@ -1,7 +1,7 @@
-From 026fd770c9cd3a4c1e655660a901f9d805736441 Mon Sep 17 00:00:00 2001
+From d851c49cd0afb0e86676670f8b49170bb0386cba Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 10:51:47 +0800
-Subject: [PATCH 18/26] hostapd: mtk: Add sta-assisted DFS state update
+Subject: [PATCH 18/29] hostapd: mtk: Add sta-assisted DFS state update
  mechanism
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
index 217012f..f89da87 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
@@ -1,19 +1,19 @@
-From ce95a0389d632148e7f201bf57fcc30ee81be5b8 Mon Sep 17 00:00:00 2001
+From 0aa1200534c41279f5f05e1919040a86f003ca0a Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 16:58:20 +0800
-Subject: [PATCH 19/26] hostapd: mtk: Fix auto ht issue when switching to DFS
+Subject: [PATCH 19/29] hostapd: mtk: Fix auto ht issue when switching to DFS
  channel
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
- hostapd/ctrl_iface.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
+ hostapd/ctrl_iface.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 61c9e80..c33b7a4 100644
+index 61c9e80..06cbea1 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2698,6 +2698,12 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2698,6 +2698,13 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
  		break;
  	}
  
@@ -21,12 +21,13 @@
 +		settings.freq_params.ht_enabled = iface->conf->ieee80211n;
 +		settings.freq_params.vht_enabled = iface->conf->ieee80211ac;
 +		settings.freq_params.he_enabled = iface->conf->ieee80211ax;
++		settings.freq_params.eht_enabled = iface->conf->ieee80211be;
 +	}
 +
  	if (settings.freq_params.center_freq1)
  		dfs_range += hostapd_is_dfs_overlap(
  			iface, bandwidth, settings.freq_params.center_freq1);
-@@ -2735,12 +2741,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2735,12 +2742,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
  		return 0;
  	}
  
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
index 26fece5..5b14a77 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
@@ -1,7 +1,7 @@
-From bf2a83d9d233474798d20514694a83bd3a021a66 Mon Sep 17 00:00:00 2001
+From c229d874452a61f58b65473d26b89c64b4693908 Mon Sep 17 00:00:00 2001
 From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
-Date: Fri, 3 Mar 2023 12:45:42 +0800
-Subject: [PATCH 20/26] hostapd: mtk: Mark DFS channel as available for CSA.
+Date: Sat, 29 Apr 2023 06:57:36 +0800
+Subject: [PATCH 20/29] hostapd: mtk: Mark DFS channel as available for CSA.
 
 ---
  hostapd/ctrl_iface.c   | 10 ++++++++++
@@ -10,11 +10,11 @@
  3 files changed, 12 insertions(+), 1 deletion(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index c33b7a4..9ba6992 100644
+index 06cbea1..7b59bb5 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2704,6 +2704,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
- 		settings.freq_params.he_enabled = iface->conf->ieee80211ax;
+@@ -2705,6 +2705,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ 		settings.freq_params.eht_enabled = iface->conf->ieee80211be;
  	}
  
 +	if (settings.freq_params.radar_background) {
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
index 408ae4d..c9b8ea9 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
@@ -1,7 +1,7 @@
-From 0198a92b05ae90ad11d3e4e182027db691072152 Mon Sep 17 00:00:00 2001
+From bed7e913c79fcd0f2d7d686b7d1da0ec8bf4d23f Mon Sep 17 00:00:00 2001
 From: mtk20656 <chank.chen@mediatek.com>
 Date: Thu, 2 Mar 2023 10:51:43 +0800
-Subject: [PATCH 21/26] hostapd: mtk: add 11v_mbss and ema support for hostapd
+Subject: [PATCH 21/29] hostapd: mtk: add 11v_mbss and ema support for hostapd
 
 Signed-off-by: mtk20656 <chank.chen@mediatek.com>
 ---
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
index 4a53c32..544ab11 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
@@ -1,7 +1,7 @@
-From 3446ad9e725f3adb993c18466bd16e95ff696eda Mon Sep 17 00:00:00 2001
+From 93880afd007b74cb7b56f9711bb0ab07b9858ac1 Mon Sep 17 00:00:00 2001
 From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 Date: Thu, 26 Jan 2023 09:16:00 +0800
-Subject: [PATCH 22/26] hostapd: mtk: Add available color bitmap
+Subject: [PATCH 22/29] hostapd: mtk: Add available color bitmap
 
 Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 ---
@@ -17,10 +17,10 @@
  9 files changed, 192 insertions(+), 1 deletion(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 9ba6992..e1e9270 100644
+index 7b59bb5..78179aa 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -3645,6 +3645,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
+@@ -3646,6 +3646,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
  	return ret;
  }
  
@@ -97,7 +97,7 @@
  
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
-@@ -4212,6 +4282,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4213,6 +4283,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_set_offchan_ctrl(hapd, buf + 16, reply, reply_size);
  	} else if (os_strncmp(buf, "GET_AMSDU", 9) == 0) {
  		reply_len = hostapd_ctrl_iface_get_amsdu(hapd, reply, reply_size);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
index 3c96137..5df63b2 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
@@ -1,7 +1,7 @@
-From 4e3cade1a84ea8bb29b8fba7bbbe34997b6cc035 Mon Sep 17 00:00:00 2001
+From a2d6ad8b3330feca1ea3f7fc8539a964145371a9 Mon Sep 17 00:00:00 2001
 From: Michael Lee <michael-cy.lee@mediatek.com>
 Date: Wed, 22 Mar 2023 13:59:29 +0800
-Subject: [PATCH 23/26] hostapd: mtk: Add channel information for hostapd
+Subject: [PATCH 23/29] hostapd: mtk: Add channel information for hostapd
  reload
 
 Add center channel, operating class, and bandwidth into the UPDATE
@@ -15,7 +15,7 @@
  2 files changed, 25 insertions(+), 3 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index e1e9270..4c5d494 100644
+index 78179aa..87448e7 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
 @@ -170,6 +170,17 @@ static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
index 8e43095..57e8b9b 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
@@ -1,7 +1,7 @@
-From f9d768d2a7ee7196a67eddf64f30e188f53b9785 Mon Sep 17 00:00:00 2001
+From 87dbbd2f6e02272e2ceee1e30dce60828bf0cc1c Mon Sep 17 00:00:00 2001
 From: Amit Khatri <amit.khatri@mediatek.com>
 Date: Thu, 23 Mar 2023 14:26:46 +0800
-Subject: [PATCH 24/26] hostapd: mtk: Add support for masking EHT capabilities.
+Subject: [PATCH 24/29] hostapd: mtk: Add support for masking EHT capabilities.
 
 If STA want to disable EHT mode connection.
 STA can set
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
index b4feae8..5eb131b 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
@@ -1,7 +1,7 @@
-From 0f3ddbd24b04d74fe2f0f617da0c63eedd1bb639 Mon Sep 17 00:00:00 2001
+From 2d97fca26e0c3cd46d1c21cc18d6adc68be60f52 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Mar 2023 16:08:30 +0800
-Subject: [PATCH 25/26] hostapd: mtk: Fix ZWDFS issue in BW 160
+Subject: [PATCH 25/29] hostapd: mtk: Fix ZWDFS issue in BW 160
 
 When background radar is enabled and bandwidth is set to 160, AP will
 fail to startup due to the lack of non-DFS channel.
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
index bd8ac27..5872b47 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
@@ -1,7 +1,7 @@
-From 28b26529a2cd7d187df6c0b9a95f6d7d0751c205 Mon Sep 17 00:00:00 2001
+From 4c6d148fea7cd1ea380a792d83d2dabe61e9c869 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 17 Mar 2023 16:17:14 +0800
-Subject: [PATCH 26/26] hostapd: mtk: Add vendor for CAPI certification
+Subject: [PATCH 26/29] hostapd: mtk: Add vendor for CAPI certification
  commands
 
 ---
@@ -16,7 +16,7 @@
  8 files changed, 332 insertions(+), 30 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 4c5d494..f338d0f 100644
+index 87448e7..b0323e7 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
 @@ -38,6 +38,7 @@
@@ -27,7 +27,7 @@
  #include "crypto/tls.h"
  #include "drivers/driver.h"
  #include "eapol_auth/eapol_auth_sm.h"
-@@ -3726,6 +3727,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
+@@ -3727,6 +3728,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
  	return pos - buf;
  }
  
@@ -124,7 +124,7 @@
  
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
-@@ -4297,6 +4388,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4298,6 +4389,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_get_bss_color(hapd, reply, reply_size);
  	} else if (os_strncmp(buf, "AVAL_COLOR_BMP", 14) == 0) {
  		reply_len = hostapd_ctrl_iface_get_aval_color_bmp(hapd, reply, reply_size);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
similarity index 97%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
index 59a0bc5..eb17c61 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
@@ -1,7 +1,8 @@
-From 8496882339b6e9dc550b491693b8029fc88ac191 Mon Sep 17 00:00:00 2001
+From 11fefdfadbc5bbdf0fcb4d890ea24906a286db43 Mon Sep 17 00:00:00 2001
 From: mtk23888 <dipanshu.mittal@mediatek.com>
 Date: Tue, 4 Apr 2023 13:06:41 +0800
-Subject: [PATCH] Air Monitor support in hostapd by vendor NL
+Subject: [PATCH 27/29] hostapd: mtk: Air Monitor support in hostapd by vendor
+ NL
 
 Signed-off-by: mtk23888 <dipanshu.mittal@mediatek.com>
 ---
@@ -17,10 +18,10 @@
  9 files changed, 352 insertions(+)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index f338d0f..7f91cb6 100644
+index b0323e7..056583c 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -3765,6 +3765,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
+@@ -3766,6 +3766,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
  
  	if (hostapd_drv_ap_wireless(hapd, (u8) sub_cmd, atoi(value)) != 0)
  		return -1;
@@ -65,7 +66,7 @@
  
  	return os_snprintf(buf, buflen, "OK\n");
  }
-@@ -3818,6 +3856,75 @@ exit:
+@@ -3819,6 +3857,75 @@ exit:
  	return os_snprintf(buf, buflen, "OK\n");
  }
  
@@ -141,7 +142,7 @@
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
  					      int reply_size,
-@@ -4392,6 +4499,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4393,6 +4500,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_ap_wireless(hapd, buf + 12, reply, reply_size);
  	} else if (os_strncmp(buf, "ap_rfeatures ", 13) == 0) {
  		reply_len = hostapd_ctrl_iface_ap_rfeatures(hapd, buf + 13, reply, reply_size);
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
similarity index 84%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
index 5775bb7..05f6dc8 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
@@ -1,7 +1,7 @@
-From ab881e5e91f15eac1b7a33bd6eb7a9882d911ae4 Mon Sep 17 00:00:00 2001
+From 38a7f0f985e33f24f0da234966f560e7136868cf Mon Sep 17 00:00:00 2001
 From: Michael Lee <michael-cy.lee@mediatek.com>
 Date: Wed, 19 Apr 2023 17:18:33 +0800
-Subject: [PATCH] hostapd: mtk: Fix scan result updating issue
+Subject: [PATCH 28/29] hostapd: mtk: Fix scan result updating issue
 
 There are no HT capability and operation in beacon of AP operating in
 NOHT.
@@ -12,7 +12,7 @@
  1 file changed, 4 insertions(+)
 
 diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
-index 01ddb13..d765f32 100644
+index 01ddb13..4e711cf 100644
 --- a/wpa_supplicant/bss.c
 +++ b/wpa_supplicant/bss.c
 @@ -306,8 +306,12 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
@@ -29,5 +29,5 @@
  	calculate_update_time(fetch_time, src->age, &dst->last_update);
  }
 -- 
-2.25.1
+2.18.0
 
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
new file mode 100644
index 0000000..c2ef3f7
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
@@ -0,0 +1,28 @@
+From 1814fca214ecf2a876734af789906e2316172ba8 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Thu, 30 Mar 2023 17:03:03 +0800
+Subject: [PATCH 29/29] hostapd: mtk: Fix setting wrong seg0 index for 5G
+ center chan 159 BW40
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/ap/ap_config.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
+index 51476b8..ae22a2f 100644
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -1275,7 +1275,8 @@ hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf,
+ #ifdef CONFIG_IEEE80211BE
+ 	if (conf->ieee80211be)
+ 		conf->eht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
+-	if (center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
++	if (is_6ghz_op_class(conf->op_class) &&
++	    center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
+ 		oper_centr_freq_seg0_idx +=
+ 			conf->channel > oper_centr_freq_seg0_idx ? 16 : -16;
+ #endif /* CONFIG_IEEE80211BE */
+-- 
+2.18.0
+
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc b/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
index f5475c8..07bae46 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
@@ -88,7 +88,8 @@
     file://mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch \
     file://mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch \
     file://mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
-    file://mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch \
-    file://mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+    file://mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
+    file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+    file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
     file://mtk-0100-hostapd-mtk-update-eht-operation-elem.patch \
     "
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch b/recipes-wifi/hostapd/files/patches/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
index 7eed335..edab139 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
@@ -1,7 +1,7 @@
-From 450d63689a1b93a96432d32e7b74f88b5bb37041 Mon Sep 17 00:00:00 2001
+From 6e4d4d6feafd223615cddf334b6c3beb6e5191cc Mon Sep 17 00:00:00 2001
 From: "howard.hsu" <howard-yh.hsu@mediatek.com>
 Date: Wed, 19 Jan 2022 19:18:07 +0800
-Subject: [PATCH 01/26] hostapd: mtk: Add neighbor report and BSS Termination
+Subject: [PATCH 01/29] hostapd: mtk: Add neighbor report and BSS Termination
  for MBO certification
 
 1. Add hostapd_neighbor_count() and hostapd_neighbor_insert_buffer ()
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch b/recipes-wifi/hostapd/files/patches/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
index a49167c..b4ce65c 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
@@ -1,7 +1,7 @@
-From cf8954130bda13e31691be744fff1b123b8230cd Mon Sep 17 00:00:00 2001
+From 1320c3e6d39c08371da1a80ffa1ae3ecb711c742 Mon Sep 17 00:00:00 2001
 From: Shayne Chen <shayne.chen@mediatek.com>
 Date: Tue, 20 Sep 2022 19:33:45 +0800
-Subject: [PATCH 02/26] hostapd: mtk: print sae groups by hostapd ctrl
+Subject: [PATCH 02/29] hostapd: mtk: print sae groups by hostapd ctrl
 
 ---
  hostapd/ctrl_iface.c | 13 +++++++++++++
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch b/recipes-wifi/hostapd/files/patches/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
index d472d99..8a2ed4d 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
@@ -1,7 +1,7 @@
-From 24ca60c0a250fc1d81e83f9120344c896c776b7f Mon Sep 17 00:00:00 2001
+From 11a3a8dcba0e17a032bf8445c6bb50835cbe8e85 Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Tue, 31 May 2022 21:15:54 +0800
-Subject: [PATCH 03/26] hostapd: mtk: add support for runtime set in-band
+Subject: [PATCH 03/29] hostapd: mtk: add support for runtime set in-band
  discovery
 
 Usage:
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch b/recipes-wifi/hostapd/files/patches/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
index 9eae1e3..0490689 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
@@ -1,7 +1,7 @@
-From 5cc1b09fbaad9cf3fda3821071b0262e8c2d0694 Mon Sep 17 00:00:00 2001
+From f05288a19fe295685de4cb419c31f4bd11a774df Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 15:04:57 +0800
-Subject: [PATCH 04/26] hostapd: mtk: Add mtk_vendor.h
+Subject: [PATCH 04/29] hostapd: mtk: Add mtk_vendor.h
 
 ---
  src/common/mtk_vendor.h | 195 ++++++++++++++++++++++++++++++++++++++++
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch b/recipes-wifi/hostapd/files/patches/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
index 7d4800f..ade6b9d 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
@@ -1,7 +1,7 @@
-From 3a2644fea08e4c7cd521a86da8c905447b891d70 Mon Sep 17 00:00:00 2001
+From c69f15f922f2095b6f36a5bbd5186e4ff5e44021 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 16:31:34 +0800
-Subject: [PATCH 05/26] hostapd: mtk: Support EDCCA hostapd configuration
+Subject: [PATCH 05/29] hostapd: mtk: Support EDCCA hostapd configuration
 
 edcca_enable and edcca_compensation and implement edcca related handlers.
 ---
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch b/recipes-wifi/hostapd/files/patches/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
index dbe0ee1..026b4fd 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
@@ -1,7 +1,7 @@
-From eb4bba013fd102ddd957aa62b675225940557d0b Mon Sep 17 00:00:00 2001
+From f27bf939f8e2815e2f65790e538fba3bfc46a9c3 Mon Sep 17 00:00:00 2001
 From: TomLiu <tomml.liu@mediatek.com>
 Date: Tue, 9 Aug 2022 10:23:44 -0700
-Subject: [PATCH 06/26] hostapd: mtk: Add hostapd MU SET/GET control
+Subject: [PATCH 06/29] hostapd: mtk: Add hostapd MU SET/GET control
 
 ---
  hostapd/config_file.c             |   9 +++
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch b/recipes-wifi/hostapd/files/patches/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
index f9e3ae8..b8d1836 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
@@ -1,7 +1,7 @@
-From 832bf1797fd010987700dc5bec920971f5df40e0 Mon Sep 17 00:00:00 2001
+From 94c7af6787585f1d063ce90c33208aa7e4f5730e Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Fri, 2 Sep 2022 01:03:23 +0800
-Subject: [PATCH 07/26] hostapd: mtk: Add three wire PTA ctrl hostapd vendor
+Subject: [PATCH 07/29] hostapd: mtk: Add three wire PTA ctrl hostapd vendor
  command
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch b/recipes-wifi/hostapd/files/patches/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
index 16ab828..acefdee 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
@@ -1,7 +1,7 @@
-From 45063f1f4f2abd5d0f4c76bcf98bd3247ec95ec1 Mon Sep 17 00:00:00 2001
+From a75dc659e600dc2d6f7eda2dc9886747b6c55254 Mon Sep 17 00:00:00 2001
 From: mtk27835 <shurong.wen@mediatek.com>
 Date: Wed, 7 Sep 2022 14:41:51 -0700
-Subject: [PATCH 08/26] hostapd: mtk: Add hostapd iBF control
+Subject: [PATCH 08/29] hostapd: mtk: Add hostapd iBF control
 
 Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
 ---
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch b/recipes-wifi/hostapd/files/patches/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
index 203aca1..d96423d 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
@@ -1,7 +1,7 @@
-From c57b2012ebc907db832b3de6e674f46fc078c240 Mon Sep 17 00:00:00 2001
+From 0c960d33f909f8c119d533cc57b1585d77e319e1 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Thu, 22 Sep 2022 16:08:09 +0800
-Subject: [PATCH 09/26] hostapd: mtk: Do not include HE capab IE if associated
+Subject: [PATCH 09/29] hostapd: mtk: Do not include HE capab IE if associated
  sta's HE capab IE is invalid
 
 ---
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch b/recipes-wifi/hostapd/files/patches/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
index f073a07..ffe0426 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
@@ -1,7 +1,7 @@
-From 4e6af76a87117ab480ce34c8ba3b9dd0330f3d63 Mon Sep 17 00:00:00 2001
+From f57c471059e4e9909b7fc6cbd351343cd2628e2c Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 14:55:49 +0800
-Subject: [PATCH 10/26] hostapd: mtk: Add DFS detection mode
+Subject: [PATCH 10/29] hostapd: mtk: Add DFS detection mode
 
 Add DFS detection mode for testing radar detection rate.
 If DFS detection mode is on, AP will not switch channels when receiving
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch b/recipes-wifi/hostapd/files/patches/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
index 4d18017..187f804 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
@@ -1,7 +1,7 @@
-From 110f0b441b55a9e418eea9ac00929a936b859bd4 Mon Sep 17 00:00:00 2001
+From 43e5bfa91c67528eb2a37071e0e4a6f32807ad8f Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 14:56:55 +0800
-Subject: [PATCH 11/26] hostapd: mtk: Add DFS offchan channel switch
+Subject: [PATCH 11/29] hostapd: mtk: Add DFS offchan channel switch
 
 Add DFS background chain channel switch command for testing purpose.
 This feature is implemented via hostapd_cli command.
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch b/recipes-wifi/hostapd/files/patches/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
index fd2a8d0..53936b2 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
@@ -1,7 +1,7 @@
-From 7674ca39e15bb1a2f20530f08574d1289a235cc6 Mon Sep 17 00:00:00 2001
+From 8dee72b3608710a9cb6e9694c3d6535be000e104 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 16 Dec 2022 03:57:11 +0800
-Subject: [PATCH 12/26] hostapd: mtk: Add amsdu set get ctrl
+Subject: [PATCH 12/29] hostapd: mtk: Add amsdu set get ctrl
 
 ---
  hostapd/config_file.c             |   9 +++
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch b/recipes-wifi/hostapd/files/patches/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
index 841f428..094e102 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
@@ -1,7 +1,7 @@
-From f74cf37f72e76e073f2f0f409e294ce35df34e29 Mon Sep 17 00:00:00 2001
+From 858e23d3ff04d156a6391168d2554796962b294c Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Thu, 12 Jan 2023 15:18:19 +0800
-Subject: [PATCH 13/26] hostapd: mtk: Add he_ldpc configuration
+Subject: [PATCH 13/29] hostapd: mtk: Add he_ldpc configuration
 
 ---
  hostapd/config_file.c        | 2 ++
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch b/recipes-wifi/hostapd/files/patches/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
index cc198b8..abca258 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
@@ -1,7 +1,7 @@
-From 702447202b9f41d7a7c9d39d6fbc4cbeadf17edc Mon Sep 17 00:00:00 2001
+From d45d0c40a81b1196b0dc4cc8da08fe736f04022f Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Tue, 17 Jan 2023 13:25:18 +0800
-Subject: [PATCH 14/26] hostapd: mtk: Add the broadcast destination address of
+Subject: [PATCH 14/29] hostapd: mtk: Add the broadcast destination address of
  Probe Response frame on 6 GHz
 
 According to IEEE 802.11ax 26.17.2.3.2,
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch b/recipes-wifi/hostapd/files/patches/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
index 4b3ab3c..a74780c 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
@@ -1,7 +1,7 @@
-From 2e6d38464b60a08b60b1e542416b5ed908ed99bb Mon Sep 17 00:00:00 2001
+From a0cc42414bd6abd0342f2fd06c09650c366c959c Mon Sep 17 00:00:00 2001
 From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
 Date: Tue, 24 Jan 2023 19:06:44 +0800
-Subject: [PATCH 15/26] hostapd: mtk: Add vendor command attribute for RTS BW
+Subject: [PATCH 15/29] hostapd: mtk: Add vendor command attribute for RTS BW
  signaling.
 
 Signed-off-by: himanshu.goyal <himanshu.goyal@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch b/recipes-wifi/hostapd/files/patches/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
index 36a6223..30cc7eb 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
@@ -1,7 +1,7 @@
-From b7362c50e5cf97ece5bd061ce641f0b7463359c1 Mon Sep 17 00:00:00 2001
+From 08a909a1a06a2231fda12b34aad68c6361c45e6b Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Mon, 13 Feb 2023 11:03:53 +0800
-Subject: [PATCH 16/26] hostapd: mtk: 6G band does not require DFS
+Subject: [PATCH 16/29] hostapd: mtk: 6G band does not require DFS
 
 ---
  src/ap/dfs.c | 1 +
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch b/recipes-wifi/hostapd/files/patches/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
index 695f183..81e22a2 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
@@ -1,7 +1,7 @@
-From 3fdf945a5225a9d213e1402e654d73eac12e6c01 Mon Sep 17 00:00:00 2001
+From 4c7054d6a1d7e373d93b6abf309c41c0151e523f Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 11:01:18 +0800
-Subject: [PATCH 17/26] hostapd: mtk: Fix sending wrong VHT operation IE in CSA
+Subject: [PATCH 17/29] hostapd: mtk: Fix sending wrong VHT operation IE in CSA
  while using ZWDFS
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch b/recipes-wifi/hostapd/files/patches/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
index 2170031..059ded9 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
@@ -1,7 +1,7 @@
-From 026fd770c9cd3a4c1e655660a901f9d805736441 Mon Sep 17 00:00:00 2001
+From d851c49cd0afb0e86676670f8b49170bb0386cba Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 10:51:47 +0800
-Subject: [PATCH 18/26] hostapd: mtk: Add sta-assisted DFS state update
+Subject: [PATCH 18/29] hostapd: mtk: Add sta-assisted DFS state update
  mechanism
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch b/recipes-wifi/hostapd/files/patches/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
index 217012f..f89da87 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
@@ -1,19 +1,19 @@
-From ce95a0389d632148e7f201bf57fcc30ee81be5b8 Mon Sep 17 00:00:00 2001
+From 0aa1200534c41279f5f05e1919040a86f003ca0a Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 16:58:20 +0800
-Subject: [PATCH 19/26] hostapd: mtk: Fix auto ht issue when switching to DFS
+Subject: [PATCH 19/29] hostapd: mtk: Fix auto ht issue when switching to DFS
  channel
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
- hostapd/ctrl_iface.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
+ hostapd/ctrl_iface.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 61c9e80..c33b7a4 100644
+index 61c9e80..06cbea1 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2698,6 +2698,12 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2698,6 +2698,13 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
  		break;
  	}
  
@@ -21,12 +21,13 @@
 +		settings.freq_params.ht_enabled = iface->conf->ieee80211n;
 +		settings.freq_params.vht_enabled = iface->conf->ieee80211ac;
 +		settings.freq_params.he_enabled = iface->conf->ieee80211ax;
++		settings.freq_params.eht_enabled = iface->conf->ieee80211be;
 +	}
 +
  	if (settings.freq_params.center_freq1)
  		dfs_range += hostapd_is_dfs_overlap(
  			iface, bandwidth, settings.freq_params.center_freq1);
-@@ -2735,12 +2741,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2735,12 +2742,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
  		return 0;
  	}
  
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch b/recipes-wifi/hostapd/files/patches/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
index 26fece5..5b14a77 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
@@ -1,7 +1,7 @@
-From bf2a83d9d233474798d20514694a83bd3a021a66 Mon Sep 17 00:00:00 2001
+From c229d874452a61f58b65473d26b89c64b4693908 Mon Sep 17 00:00:00 2001
 From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
-Date: Fri, 3 Mar 2023 12:45:42 +0800
-Subject: [PATCH 20/26] hostapd: mtk: Mark DFS channel as available for CSA.
+Date: Sat, 29 Apr 2023 06:57:36 +0800
+Subject: [PATCH 20/29] hostapd: mtk: Mark DFS channel as available for CSA.
 
 ---
  hostapd/ctrl_iface.c   | 10 ++++++++++
@@ -10,11 +10,11 @@
  3 files changed, 12 insertions(+), 1 deletion(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index c33b7a4..9ba6992 100644
+index 06cbea1..7b59bb5 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2704,6 +2704,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
- 		settings.freq_params.he_enabled = iface->conf->ieee80211ax;
+@@ -2705,6 +2705,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ 		settings.freq_params.eht_enabled = iface->conf->ieee80211be;
  	}
  
 +	if (settings.freq_params.radar_background) {
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch b/recipes-wifi/hostapd/files/patches/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
index 408ae4d..c9b8ea9 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
@@ -1,7 +1,7 @@
-From 0198a92b05ae90ad11d3e4e182027db691072152 Mon Sep 17 00:00:00 2001
+From bed7e913c79fcd0f2d7d686b7d1da0ec8bf4d23f Mon Sep 17 00:00:00 2001
 From: mtk20656 <chank.chen@mediatek.com>
 Date: Thu, 2 Mar 2023 10:51:43 +0800
-Subject: [PATCH 21/26] hostapd: mtk: add 11v_mbss and ema support for hostapd
+Subject: [PATCH 21/29] hostapd: mtk: add 11v_mbss and ema support for hostapd
 
 Signed-off-by: mtk20656 <chank.chen@mediatek.com>
 ---
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch b/recipes-wifi/hostapd/files/patches/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
index 4a53c32..544ab11 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
@@ -1,7 +1,7 @@
-From 3446ad9e725f3adb993c18466bd16e95ff696eda Mon Sep 17 00:00:00 2001
+From 93880afd007b74cb7b56f9711bb0ab07b9858ac1 Mon Sep 17 00:00:00 2001
 From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 Date: Thu, 26 Jan 2023 09:16:00 +0800
-Subject: [PATCH 22/26] hostapd: mtk: Add available color bitmap
+Subject: [PATCH 22/29] hostapd: mtk: Add available color bitmap
 
 Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 ---
@@ -17,10 +17,10 @@
  9 files changed, 192 insertions(+), 1 deletion(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 9ba6992..e1e9270 100644
+index 7b59bb5..78179aa 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -3645,6 +3645,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
+@@ -3646,6 +3646,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
  	return ret;
  }
  
@@ -97,7 +97,7 @@
  
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
-@@ -4212,6 +4282,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4213,6 +4283,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_set_offchan_ctrl(hapd, buf + 16, reply, reply_size);
  	} else if (os_strncmp(buf, "GET_AMSDU", 9) == 0) {
  		reply_len = hostapd_ctrl_iface_get_amsdu(hapd, reply, reply_size);
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch b/recipes-wifi/hostapd/files/patches/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
index 3c96137..5df63b2 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
@@ -1,7 +1,7 @@
-From 4e3cade1a84ea8bb29b8fba7bbbe34997b6cc035 Mon Sep 17 00:00:00 2001
+From a2d6ad8b3330feca1ea3f7fc8539a964145371a9 Mon Sep 17 00:00:00 2001
 From: Michael Lee <michael-cy.lee@mediatek.com>
 Date: Wed, 22 Mar 2023 13:59:29 +0800
-Subject: [PATCH 23/26] hostapd: mtk: Add channel information for hostapd
+Subject: [PATCH 23/29] hostapd: mtk: Add channel information for hostapd
  reload
 
 Add center channel, operating class, and bandwidth into the UPDATE
@@ -15,7 +15,7 @@
  2 files changed, 25 insertions(+), 3 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index e1e9270..4c5d494 100644
+index 78179aa..87448e7 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
 @@ -170,6 +170,17 @@ static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch b/recipes-wifi/hostapd/files/patches/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
index 8e43095..57e8b9b 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
@@ -1,7 +1,7 @@
-From f9d768d2a7ee7196a67eddf64f30e188f53b9785 Mon Sep 17 00:00:00 2001
+From 87dbbd2f6e02272e2ceee1e30dce60828bf0cc1c Mon Sep 17 00:00:00 2001
 From: Amit Khatri <amit.khatri@mediatek.com>
 Date: Thu, 23 Mar 2023 14:26:46 +0800
-Subject: [PATCH 24/26] hostapd: mtk: Add support for masking EHT capabilities.
+Subject: [PATCH 24/29] hostapd: mtk: Add support for masking EHT capabilities.
 
 If STA want to disable EHT mode connection.
 STA can set
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch b/recipes-wifi/hostapd/files/patches/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
index b4feae8..5eb131b 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
@@ -1,7 +1,7 @@
-From 0f3ddbd24b04d74fe2f0f617da0c63eedd1bb639 Mon Sep 17 00:00:00 2001
+From 2d97fca26e0c3cd46d1c21cc18d6adc68be60f52 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Mar 2023 16:08:30 +0800
-Subject: [PATCH 25/26] hostapd: mtk: Fix ZWDFS issue in BW 160
+Subject: [PATCH 25/29] hostapd: mtk: Fix ZWDFS issue in BW 160
 
 When background radar is enabled and bandwidth is set to 160, AP will
 fail to startup due to the lack of non-DFS channel.
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch b/recipes-wifi/hostapd/files/patches/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
index bd8ac27..5872b47 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
@@ -1,7 +1,7 @@
-From 28b26529a2cd7d187df6c0b9a95f6d7d0751c205 Mon Sep 17 00:00:00 2001
+From 4c6d148fea7cd1ea380a792d83d2dabe61e9c869 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 17 Mar 2023 16:17:14 +0800
-Subject: [PATCH 26/26] hostapd: mtk: Add vendor for CAPI certification
+Subject: [PATCH 26/29] hostapd: mtk: Add vendor for CAPI certification
  commands
 
 ---
@@ -16,7 +16,7 @@
  8 files changed, 332 insertions(+), 30 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 4c5d494..f338d0f 100644
+index 87448e7..b0323e7 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
 @@ -38,6 +38,7 @@
@@ -27,7 +27,7 @@
  #include "crypto/tls.h"
  #include "drivers/driver.h"
  #include "eapol_auth/eapol_auth_sm.h"
-@@ -3726,6 +3727,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
+@@ -3727,6 +3728,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
  	return pos - buf;
  }
  
@@ -124,7 +124,7 @@
  
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
-@@ -4297,6 +4388,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4298,6 +4389,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_get_bss_color(hapd, reply, reply_size);
  	} else if (os_strncmp(buf, "AVAL_COLOR_BMP", 14) == 0) {
  		reply_len = hostapd_ctrl_iface_get_aval_color_bmp(hapd, reply, reply_size);
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch b/recipes-wifi/hostapd/files/patches/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
deleted file mode 100644
index 59a0bc5..0000000
--- a/recipes-wifi/hostapd/files/patches/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
+++ /dev/null
@@ -1,506 +0,0 @@
-From 8496882339b6e9dc550b491693b8029fc88ac191 Mon Sep 17 00:00:00 2001
-From: mtk23888 <dipanshu.mittal@mediatek.com>
-Date: Tue, 4 Apr 2023 13:06:41 +0800
-Subject: [PATCH] Air Monitor support in hostapd by vendor NL
-
-Signed-off-by: mtk23888 <dipanshu.mittal@mediatek.com>
----
- hostapd/ctrl_iface.c              | 113 +++++++++++++++++++
- hostapd/hostapd_cli.c             |  15 +++
- src/ap/ap_drv_ops.c               |  14 +++
- src/ap/ap_drv_ops.h               |   3 +
- src/common/mtk_vendor.h           |   8 ++
- src/drivers/driver.h              |  16 +++
- src/drivers/driver_nl80211.c      | 180 ++++++++++++++++++++++++++++++
- src/drivers/driver_nl80211.h      |   1 +
- src/drivers/driver_nl80211_capa.c |   2 +
- 9 files changed, 352 insertions(+)
-
-diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index f338d0f..7f91cb6 100644
---- a/hostapd/ctrl_iface.c
-+++ b/hostapd/ctrl_iface.c
-@@ -3765,6 +3765,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
- 
- 	if (hostapd_drv_ap_wireless(hapd, (u8) sub_cmd, atoi(value)) != 0)
- 		return -1;
-+	return os_snprintf(buf, buflen, "OK\n");
-+}
-+
-+static int
-+hostapd_ctrl_iface_set_amnt(struct hostapd_data *hapd, char *cmd,
-+					char *buf, size_t buflen)
-+{
-+	char *tmp, sta_mac[ETH_ALEN] = {0};
-+	int amnt_idx = 0;
-+
-+	tmp = strtok_r(cmd, " ", &cmd);
-+
-+	if (!tmp) {
-+		wpa_printf(MSG_ERROR, "Error in command format\n");
-+		return -1;
-+	}
-+
-+	amnt_idx = strtol(tmp, &tmp, 10);
-+
-+	if (amnt_idx < 0 || amnt_idx > 15) {
-+		wpa_printf(MSG_ERROR, "Wrong AMNT index %d\n", amnt_idx);
-+		return -1;
-+	}
-+
-+	if (!cmd) {
-+		wpa_printf(MSG_ERROR, "Error in command format\n");
-+		return -1;
-+	}
-+
-+	if (hwaddr_aton(cmd, sta_mac) < 0) {
-+		wpa_printf(MSG_ERROR, "station mac is not right.\n");
-+		return -1;
-+	}
-+
-+	if (hostapd_drv_amnt_set(hapd, amnt_idx, sta_mac)) {
-+		wpa_printf(MSG_ERROR, "Not able to set amnt index\n");
-+		return -1;
-+	}
- 
- 	return os_snprintf(buf, buflen, "OK\n");
- }
-@@ -3818,6 +3856,75 @@ exit:
- 	return os_snprintf(buf, buflen, "OK\n");
- }
- 
-+static int
-+hostapd_ctrl_iface_dump_amnt(struct hostapd_data *hapd, char *cmd,
-+				char *buf, size_t buflen)
-+{
-+	char *tmp;
-+	int amnt_idx = 0, ret = 0;
-+	struct amnt_resp_data *resp_buf;
-+	char *pos, *end;
-+	struct amnt_data *res;
-+
-+	pos = buf;
-+	end = buf + buflen;
-+
-+	tmp = strtok_r(cmd, " ", &cmd);
-+
-+	if (!tmp) {
-+		wpa_printf(MSG_ERROR, "Error in command format\n");
-+		return -1;
-+	}
-+
-+	amnt_idx = strtoul(tmp, &tmp, 0);
-+
-+	if ((amnt_idx < 0 || amnt_idx > 15) && amnt_idx != 0xff) {
-+		wpa_printf(MSG_ERROR, "Wrong AMNT index\n");
-+		return -1;
-+	}
-+
-+	if (amnt_idx == 0xff)
-+		resp_buf = (struct amnt_resp_data *) os_zalloc(AIR_MONITOR_MAX_ENTRY
-+							* sizeof(struct amnt_data) + 1);
-+	else
-+		resp_buf = (struct amnt_resp_data *) os_zalloc(sizeof(struct amnt_data) + 1);
-+
-+	if (resp_buf == NULL) {
-+		wpa_printf(MSG_ERROR, "Error in memory allocation\n");
-+		return -1;
-+	}
-+
-+	if (hostapd_drv_amnt_dump(hapd, amnt_idx, (u8 *)resp_buf)) {
-+		wpa_printf(MSG_ERROR, "Not able to set amnt index\n");
-+		os_free(resp_buf);
-+		return -1;
-+	}
-+
-+	for (int i = 0; i < resp_buf->sta_num && i < AIR_MONITOR_MAX_ENTRY; i++) {
-+		res = &resp_buf->resp_data[i];
-+		ret = os_snprintf(pos, end - pos,
-+				"[hostapd_cli] amnt_idx: %d, addr="MACSTR
-+				", rssi=%d/%d/%d/%d, last_seen=%u\n",
-+				res->idx,
-+				MAC2STR(res->addr), res->rssi[0],
-+				res->rssi[1], res->rssi[2],
-+				res->rssi[3], res->last_seen);
-+		if (os_snprintf_error(end - pos, ret)) {
-+			os_free(resp_buf);
-+			return 0;
-+		}
-+		pos = pos + ret;
-+	}
-+
-+	os_free(resp_buf);
-+
-+	if (pos == buf)
-+		return os_snprintf(buf, buflen, "Index %d is not monitored\n",
-+				amnt_idx);
-+	else
-+		return pos - buf;
-+}
-+
- static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
- 					      char *buf, char *reply,
- 					      int reply_size,
-@@ -4392,6 +4499,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
- 		reply_len = hostapd_ctrl_iface_ap_wireless(hapd, buf + 12, reply, reply_size);
- 	} else if (os_strncmp(buf, "ap_rfeatures ", 13) == 0) {
- 		reply_len = hostapd_ctrl_iface_ap_rfeatures(hapd, buf + 13, reply, reply_size);
-+	} else if (os_strncmp(buf, "SET_AMNT", 8) == 0) {
-+		reply_len = hostapd_ctrl_iface_set_amnt(hapd, buf+9,
-+							reply, reply_size);
-+	} else if (os_strncmp(buf, "DUMP_AMNT", 9) == 0) {
-+		reply_len = hostapd_ctrl_iface_dump_amnt(hapd, buf+10,
-+							reply, reply_size);
- 	} else {
- 		os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
- 		reply_len = 16;
-diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index aad7aa5..0c4a176 100644
---- a/hostapd/hostapd_cli.c
-+++ b/hostapd/hostapd_cli.c
-@@ -1613,6 +1613,17 @@ static int hostapd_cli_cmd_get_amsdu(struct wpa_ctrl *ctrl, int argc,
- 	return hostapd_cli_cmd(ctrl, "GET_AMSDU", 0, NULL, NULL);
- }
- 
-+static int hostapd_cli_cmd_set_amnt(struct wpa_ctrl *ctrl, int argc,
-+					   char *argv[])
-+{
-+	return hostapd_cli_cmd(ctrl, "SET_AMNT", 2, argc, argv);
-+}
-+
-+static int hostapd_cli_cmd_dump_amnt(struct wpa_ctrl *ctrl, int argc,
-+					   char *argv[])
-+{
-+	return hostapd_cli_cmd(ctrl, "DUMP_AMNT", 1, argc, argv);
-+}
- 
- struct hostapd_cli_cmd {
- 	const char *cmd;
-@@ -1823,6 +1834,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
- 	  " = show iBF state (enabled/disabled)"},
- 	{ "get_amsdu", hostapd_cli_cmd_get_amsdu, NULL,
- 		" = show AMSDU state"},
-+	{ "set_amnt", hostapd_cli_cmd_set_amnt, NULL,
-+		" = Set Station index and mac to monitor"},
-+	{ "dump_amnt", hostapd_cli_cmd_dump_amnt, NULL,
-+		" = Dump RSSI of monitoring Station"},
- 	{ NULL, NULL, NULL, NULL }
- };
- 
-diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 52d0fff..eafa588 100644
---- a/src/ap/ap_drv_ops.c
-+++ b/src/ap/ap_drv_ops.c
-@@ -1121,3 +1121,17 @@ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type)
- 		return 0;
- 	return hapd->driver->ap_trigtype(hapd->drv_priv, enable, type);
- }
-+
-+int hostapd_drv_amnt_set(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_sta_mac)
-+{
-+	if (!hapd->driver || !hapd->driver->amnt_set)
-+		return 0;
-+	return hapd->driver->amnt_set(hapd->drv_priv, amnt_idx, amnt_sta_mac);
-+}
-+
-+int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_buf)
-+{
-+	if (!hapd->driver || !hapd->driver->amnt_dump)
-+		return 0;
-+	return hapd->driver->amnt_dump(hapd->drv_priv, amnt_idx, amnt_dump_buf);
-+}
-diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 659c3f8..28f2a4d 100644
---- a/src/ap/ap_drv_ops.h
-+++ b/src/ap/ap_drv_ops.h
-@@ -155,6 +155,9 @@ int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int val
- int hostapd_drv_ap_rfeatures(struct hostapd_data *hapd, u8 sub_vendor_id, int value);
- int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type);
- 
-+int hostapd_drv_amnt_set(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_sta_mac);
-+int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_buf);
-+
- #include "drivers/driver.h"
- 
- int hostapd_drv_wnm_oper(struct hostapd_data *hapd,
-diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 32438af..74f467c 100644
---- a/src/common/mtk_vendor.h
-+++ b/src/common/mtk_vendor.h
-@@ -256,10 +256,18 @@ struct csi_data {
- 	u16 rx_idx;
- };
- 
-+#define AIR_MONITOR_MAX_ENTRY 16
-+
- struct amnt_data {
- 	u8 idx;
- 	u8 addr[ETH_ALEN];
- 	s8 rssi[4];
- 	u32 last_seen;
- };
-+
-+struct amnt_resp_data {
-+	u8 sta_num;
-+	struct amnt_data resp_data[0];
-+};
-+
- #endif /* MTK_VENDOR_H */
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 6a46832..1444cbe 100644
---- a/src/drivers/driver.h
-+++ b/src/drivers/driver.h
-@@ -4809,6 +4809,22 @@ struct wpa_driver_ops {
- 	* @type: trigger type
- 	*/
- 	int (*ap_trigtype)(void *priv, u8 enable, u8 type);
-+
-+	/**
-+	* amnt_set - add/delete station from monitoring
-+	* @priv: Private driver interface data
-+	* @amnt_idx: Monitor Index
-+	* @amnt_sta_mac: station mac address
-+	*/
-+	int (*amnt_set)(void *priv, u8 amnt_idx, u8 *amnt_sta_mac);
-+
-+	/**
-+	* amnt_dump - Dump particular/ all station
-+	* @priv: Private driver interface data
-+	* @amnt_idx: Monitor Index
-+	* @amnt_dump_buf: Buffer to print
-+	*/
-+	int (*amnt_dump)(void *priv, u8 amnt_idx, u8 *amnt_dump_buf);
- };
- 
- /**
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 7fae013..0470079 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -125,6 +125,19 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
- 	[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 },
- };
- 
-+static struct nla_policy
-+amnt_ctrl_policy[NUM_MTK_VENDOR_ATTRS_AMNT_CTRL] = {
-+	[MTK_VENDOR_ATTR_AMNT_CTRL_SET] = {.type = NLA_NESTED },
-+	[MTK_VENDOR_ATTR_AMNT_CTRL_DUMP] = { .type = NLA_NESTED },
-+};
-+
-+static struct nla_policy
-+amnt_dump_policy[NUM_MTK_VENDOR_ATTRS_AMNT_DUMP] = {
-+	[MTK_VENDOR_ATTR_AMNT_DUMP_INDEX] = {.type = NLA_U8 },
-+	[MTK_VENDOR_ATTR_AMNT_DUMP_LEN] = { .type = NLA_U8 },
-+	[MTK_VENDOR_ATTR_AMNT_DUMP_RESULT] = { .type = NLA_NESTED },
-+};
-+
- static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
- {
- 	struct nl_sock *handle;
-@@ -13196,6 +13209,171 @@ fail:
- 	return -ENOBUFS;
- }
- 
-+static int
-+nl80211_amnt_set(void *priv, u8 amnt_idx, u8 *amnt_sta_mac)
-+{
-+	struct i802_bss *bss = priv;
-+	struct wpa_driver_nl80211_data *drv = bss->drv;
-+	struct nl_msg *msg;
-+	struct nlattr *data;
-+	void *tb1;
-+	int ret;
-+
-+	if (!drv->mtk_amnt_vendor_cmd_avail) {
-+		wpa_printf(MSG_ERROR,
-+			"nl80211: Driver does not support air monitor");
-+		return 0;
-+	}
-+
-+	msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR);
-+	if (!msg)
-+		goto fail;
-+
-+	if (nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
-+			nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
-+			MTK_NL80211_VENDOR_SUBCMD_AMNT_CTRL))
-+		goto fail;
-+
-+	data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA | NLA_F_NESTED);
-+	if (!data)
-+		goto fail;
-+
-+	tb1 = nla_nest_start(msg, MTK_VENDOR_ATTR_AMNT_CTRL_SET);
-+	if (!tb1)
-+		goto fail;
-+
-+	nla_put_u8(msg, MTK_VENDOR_ATTR_AMNT_SET_INDEX, amnt_idx);
-+
-+	nla_put(msg, MTK_VENDOR_ATTR_AMNT_SET_MACADDR, ETH_ALEN, amnt_sta_mac);
-+
-+	nla_nest_end(msg, tb1);
-+	nla_nest_end(msg, data);
-+
-+	ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
-+
-+	if (ret)
-+		wpa_printf(MSG_ERROR, "Failed to set air monitor. ret=%d (%s)",
-+			ret, strerror(-ret));
-+
-+	return ret;
-+
-+fail:
-+	nlmsg_free(msg);
-+	return -ENOBUFS;
-+
-+}
-+
-+static int
-+mt76_amnt_dump_cb(struct nl_msg *msg, void *arg)
-+{
-+	struct nlattr *tb[NL80211_ATTR_MAX + 1];
-+	struct nlattr *tb1[NUM_MTK_VENDOR_ATTRS_AMNT_CTRL];
-+	struct nlattr *tb2[NUM_MTK_VENDOR_ATTRS_AMNT_DUMP];
-+	struct nlattr *attr, *cur, *data;
-+	struct amnt_data *res;
-+	int len = 0, rem;
-+	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
-+	struct amnt_resp_data *amnt_dump = (struct amnt_resp_data *)arg;
-+
-+	nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
-+		genlmsg_attrlen(gnlh, 0), NULL);
-+
-+	attr = tb[NL80211_ATTR_VENDOR_DATA];
-+	if (!attr)
-+		return NL_SKIP;
-+
-+	nla_parse_nested(tb1, MTK_VENDOR_ATTR_AMNT_CTRL_MAX,
-+			attr, amnt_ctrl_policy);
-+
-+	if (!tb1[MTK_VENDOR_ATTR_AMNT_CTRL_DUMP])
-+		return NL_SKIP;
-+
-+	nla_parse_nested(tb2, NUM_MTK_VENDOR_ATTRS_AMNT_DUMP,
-+			tb1[MTK_VENDOR_ATTR_AMNT_CTRL_DUMP], amnt_dump_policy);
-+
-+	if (!tb2[MTK_VENDOR_ATTR_AMNT_DUMP_LEN])
-+		return NL_SKIP;
-+
-+	len = nla_get_u8(tb2[MTK_VENDOR_ATTR_AMNT_DUMP_LEN]);
-+	if (!len)
-+		return 0;
-+
-+	if (!tb2[MTK_VENDOR_ATTR_AMNT_DUMP_RESULT])
-+		return NL_SKIP;
-+
-+	data = tb2[MTK_VENDOR_ATTR_AMNT_DUMP_RESULT];
-+
-+	nla_for_each_nested(cur, data, rem) {
-+		if (amnt_dump->sta_num >= AIR_MONITOR_MAX_ENTRY)
-+			return NL_SKIP;
-+		res = (struct amnt_data *) nla_data(cur);
-+		wpa_printf(MSG_ERROR, "[vendor] amnt_idx: %d, "
-+			"addr="MACSTR", "
-+			"rssi=%d/%d/%d/%d, last_seen=%u\n",
-+			res->idx,
-+			MAC2STR(res->addr),
-+			res->rssi[0], res->rssi[1], res->rssi[2],
-+			res->rssi[3], res->last_seen);
-+		os_memcpy(&amnt_dump->resp_data[amnt_dump->sta_num], res,
-+			sizeof(struct amnt_data));
-+		amnt_dump->sta_num++;
-+	}
-+	return 0;
-+}
-+
-+static int
-+nl80211_amnt_dump(void *priv, u8 amnt_idx, u8 *dump_buf)
-+{
-+	struct i802_bss *bss = priv;
-+	struct wpa_driver_nl80211_data *drv = bss->drv;
-+	struct nl_msg *msg;
-+	struct nlattr *data;
-+	void *tb1;
-+	int ret;
-+
-+	if (!drv->mtk_amnt_vendor_cmd_avail) {
-+		wpa_printf(MSG_INFO,
-+			"nl80211: Driver does not support air monitor");
-+		return 0;
-+	}
-+
-+	msg = nl80211_drv_msg(drv, NLM_F_DUMP, NL80211_CMD_VENDOR);
-+	if (!msg)
-+		goto fail;
-+
-+	if (nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
-+			nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
-+			MTK_NL80211_VENDOR_SUBCMD_AMNT_CTRL))
-+		goto fail;
-+
-+	data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA | NLA_F_NESTED);
-+	if (!data)
-+		goto fail;
-+
-+	tb1 = nla_nest_start(msg, MTK_VENDOR_ATTR_AMNT_CTRL_DUMP
-+			| NLA_F_NESTED);
-+	if (!tb1)
-+		goto fail;
-+
-+	nla_put_u8(msg, MTK_VENDOR_ATTR_AMNT_DUMP_INDEX, amnt_idx);
-+
-+	nla_nest_end(msg, tb1);
-+	nla_nest_end(msg, data);
-+
-+	ret = send_and_recv_msgs(drv, msg, mt76_amnt_dump_cb,
-+				dump_buf, NULL, NULL);
-+
-+	if (ret)
-+		wpa_printf(MSG_ERROR, "Failed to Dump air monitor. ret=%d (%s)"
-+			, ret, strerror(-ret));
-+
-+	return ret;
-+
-+fail:
-+	nlmsg_free(msg);
-+	return -ENOBUFS;
-+}
-+
- const struct wpa_driver_ops wpa_driver_nl80211_ops = {
- 	.name = "nl80211",
- 	.desc = "Linux nl80211/cfg80211",
-@@ -13356,4 +13534,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
- 	.ap_wireless = nl80211_ap_wireless,
- 	.ap_rfeatures = nl80211_ap_rfeatures,
- 	.ap_trigtype = nl80211_ap_trigtype,
-+	.amnt_set = nl80211_amnt_set,
-+	.amnt_dump = nl80211_amnt_dump,
- };
-diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 7a03446..7dd88e7 100644
---- a/src/drivers/driver_nl80211.h
-+++ b/src/drivers/driver_nl80211.h
-@@ -188,6 +188,7 @@ struct wpa_driver_nl80211_data {
- 	unsigned int mtk_wireless_vendor_cmd_avail:1;
- 	unsigned int mtk_bss_color_vendor_cmd_avail:1;
- 	unsigned int mtk_rfeatures_vendor_cmd_avail:1;
-+	unsigned int mtk_amnt_vendor_cmd_avail:1;
- 
- 	u64 vendor_scan_cookie;
- 	u64 remain_on_chan_cookie;
-diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 6f4d029..5c1a35d 100644
---- a/src/drivers/driver_nl80211_capa.c
-+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1094,6 +1094,8 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
- 					break;
- 				case MTK_NL80211_VENDOR_SUBCMD_BSS_COLOR_CTRL :
- 					drv->mtk_bss_color_vendor_cmd_avail = 1;
-+				case MTK_NL80211_VENDOR_SUBCMD_AMNT_CTRL:
-+					drv->mtk_amnt_vendor_cmd_avail = 1;
- 					break;
- 				case MTK_NL80211_VENDOR_SUBCMD_RFEATURE_CTRL:
- 					drv->mtk_rfeatures_vendor_cmd_avail = 1;
--- 
-2.18.0
-
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch b/recipes-wifi/hostapd/files/patches/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
similarity index 97%
copy from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
copy to recipes-wifi/hostapd/files/patches/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
index 59a0bc5..eb17c61 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
@@ -1,7 +1,8 @@
-From 8496882339b6e9dc550b491693b8029fc88ac191 Mon Sep 17 00:00:00 2001
+From 11fefdfadbc5bbdf0fcb4d890ea24906a286db43 Mon Sep 17 00:00:00 2001
 From: mtk23888 <dipanshu.mittal@mediatek.com>
 Date: Tue, 4 Apr 2023 13:06:41 +0800
-Subject: [PATCH] Air Monitor support in hostapd by vendor NL
+Subject: [PATCH 27/29] hostapd: mtk: Air Monitor support in hostapd by vendor
+ NL
 
 Signed-off-by: mtk23888 <dipanshu.mittal@mediatek.com>
 ---
@@ -17,10 +18,10 @@
  9 files changed, 352 insertions(+)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index f338d0f..7f91cb6 100644
+index b0323e7..056583c 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -3765,6 +3765,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
+@@ -3766,6 +3766,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
  
  	if (hostapd_drv_ap_wireless(hapd, (u8) sub_cmd, atoi(value)) != 0)
  		return -1;
@@ -65,7 +66,7 @@
  
  	return os_snprintf(buf, buflen, "OK\n");
  }
-@@ -3818,6 +3856,75 @@ exit:
+@@ -3819,6 +3857,75 @@ exit:
  	return os_snprintf(buf, buflen, "OK\n");
  }
  
@@ -141,7 +142,7 @@
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
  					      int reply_size,
-@@ -4392,6 +4499,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4393,6 +4500,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_ap_wireless(hapd, buf + 12, reply, reply_size);
  	} else if (os_strncmp(buf, "ap_rfeatures ", 13) == 0) {
  		reply_len = hostapd_ctrl_iface_ap_rfeatures(hapd, buf + 13, reply, reply_size);
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch b/recipes-wifi/hostapd/files/patches/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
similarity index 84%
rename from recipes-wifi/hostapd/files/patches/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch
rename to recipes-wifi/hostapd/files/patches/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
index 5775bb7..05f6dc8 100644
--- a/recipes-wifi/hostapd/files/patches/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch
+++ b/recipes-wifi/hostapd/files/patches/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
@@ -1,7 +1,7 @@
-From ab881e5e91f15eac1b7a33bd6eb7a9882d911ae4 Mon Sep 17 00:00:00 2001
+From 38a7f0f985e33f24f0da234966f560e7136868cf Mon Sep 17 00:00:00 2001
 From: Michael Lee <michael-cy.lee@mediatek.com>
 Date: Wed, 19 Apr 2023 17:18:33 +0800
-Subject: [PATCH] hostapd: mtk: Fix scan result updating issue
+Subject: [PATCH 28/29] hostapd: mtk: Fix scan result updating issue
 
 There are no HT capability and operation in beacon of AP operating in
 NOHT.
@@ -12,7 +12,7 @@
  1 file changed, 4 insertions(+)
 
 diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
-index 01ddb13..d765f32 100644
+index 01ddb13..4e711cf 100644
 --- a/wpa_supplicant/bss.c
 +++ b/wpa_supplicant/bss.c
 @@ -306,8 +306,12 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
@@ -29,5 +29,5 @@
  	calculate_update_time(fetch_time, src->age, &dst->last_update);
  }
 -- 
-2.25.1
+2.18.0
 
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch b/recipes-wifi/hostapd/files/patches/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
new file mode 100644
index 0000000..c2ef3f7
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
@@ -0,0 +1,28 @@
+From 1814fca214ecf2a876734af789906e2316172ba8 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Thu, 30 Mar 2023 17:03:03 +0800
+Subject: [PATCH 29/29] hostapd: mtk: Fix setting wrong seg0 index for 5G
+ center chan 159 BW40
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/ap/ap_config.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
+index 51476b8..ae22a2f 100644
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -1275,7 +1275,8 @@ hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf,
+ #ifdef CONFIG_IEEE80211BE
+ 	if (conf->ieee80211be)
+ 		conf->eht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
+-	if (center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
++	if (is_6ghz_op_class(conf->op_class) &&
++	    center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
+ 		oper_centr_freq_seg0_idx +=
+ 			conf->channel > oper_centr_freq_seg0_idx ? 16 : -16;
+ #endif /* CONFIG_IEEE80211BE */
+-- 
+2.18.0
+
diff --git a/recipes-wifi/hostapd/files/patches/patches.inc b/recipes-wifi/hostapd/files/patches/patches.inc
index addbce2..523fc4d 100644
--- a/recipes-wifi/hostapd/files/patches/patches.inc
+++ b/recipes-wifi/hostapd/files/patches/patches.inc
@@ -88,6 +88,7 @@
     file://mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch \
     file://mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch \
     file://mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
-    file://mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch \
-    file://mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+    file://mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
+    file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+    file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
     "
diff --git a/recipes-wifi/linux-mac80211/files/patches-6.x/subsys/mtk-0006-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch b/recipes-wifi/linux-mac80211/files/patches-6.x/subsys/mtk-0006-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch
index 300a6f8..4072a92 100644
--- a/recipes-wifi/linux-mac80211/files/patches-6.x/subsys/mtk-0006-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch
+++ b/recipes-wifi/linux-mac80211/files/patches-6.x/subsys/mtk-0006-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch
@@ -1,19 +1,19 @@
-From 5d3d13bfb9074bd384f1f079b1064496f79e5b91 Mon Sep 17 00:00:00 2001
+From dc8caecd0c7f5dfd542ba08f98605a7d6849e110 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 06/14] cfg80211: mtk: implement DFS status show, cac and nop
- skip command via debugfs
+Subject: [PATCH] cfg80211: mtk: implement DFS status show, cac and nop skip
+ command via debugfs
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
  include/net/cfg80211.h  |   1 +
  net/mac80211/cfg.c      |  20 +++
  net/wireless/core.h     |   3 +
- net/wireless/debugfs.c  | 271 ++++++++++++++++++++++++++++++++++++++--
+ net/wireless/debugfs.c  | 311 +++++++++++++++++++++++++++++++++++++++-
  net/wireless/mlme.c     |   6 +
- net/wireless/rdev-ops.h |  14 +++
+ net/wireless/rdev-ops.h |  14 ++
  net/wireless/trace.h    |  12 ++
- 7 files changed, 320 insertions(+), 7 deletions(-)
+ 7 files changed, 360 insertions(+), 7 deletions(-)
 
 diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
 index 450de58..ddd63e7 100644
@@ -78,7 +78,7 @@
  	struct work_struct background_cac_abort_wk;
  
 diff --git a/net/wireless/debugfs.c b/net/wireless/debugfs.c
-index 0878b16..f5f23d0 100644
+index 0878b16..a228a14 100644
 --- a/net/wireless/debugfs.c
 +++ b/net/wireless/debugfs.c
 @@ -9,6 +9,7 @@
@@ -89,7 +89,7 @@
  
  #define DEBUGFS_READONLY_FILE(name, buflen, fmt, value...)		\
  static ssize_t name## _read(struct file *file, char __user *userbuf,	\
-@@ -96,16 +97,272 @@ static const struct file_operations ht40allow_map_ops = {
+@@ -96,16 +97,312 @@ static const struct file_operations ht40allow_map_ops = {
  	.llseek = default_llseek,
  };
  
@@ -348,6 +348,45 @@
 +DEFINE_DEBUGFS_ATTRIBUTE(dfs_skip_cac_ops, NULL,
 +			 dfs_cac_skip, "0x%08llx\n");
 +
++static int
++dfs_available_reset(void *data, u64 val)
++{
++	struct wiphy *wiphy = data;
++	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
++	bool en = !!val;
++	enum nl80211_band band;
++	struct ieee80211_supported_band *sband;
++	struct ieee80211_channel *chan;
++	int i;
++
++	if (!en)
++		return 0;
++
++	for (band = 0; band < NUM_NL80211_BANDS; band++) {
++		sband = wiphy->bands[band];
++		if (!sband)
++			continue;
++		for (i = 0; i < sband->n_channels; i++) {
++			chan = &sband->channels[i];
++
++			if (!(chan->flags & IEEE80211_CHAN_RADAR))
++				continue;
++
++			if (chan->dfs_state == NL80211_DFS_AVAILABLE) {
++				chan->dfs_state = NL80211_DFS_USABLE;
++				chan->dfs_state_entered = jiffies;
++			}
++		}
++	}
++
++	cfg80211_sched_dfs_chan_update(rdev);
++
++	return 0;
++}
++
++DEFINE_DEBUGFS_ATTRIBUTE(dfs_available_reset_ops, NULL,
++			 dfs_available_reset, "0x%08llx\n");
++
 +#define DEBUGFS_ADD(name, chmod)						\
 +	debugfs_create_file(#name, chmod, phyd, &rdev->wiphy, &name## _ops)
  
@@ -368,6 +407,7 @@
 +	DEBUGFS_ADD(dfs_status, 0444);
 +	DEBUGFS_ADD(dfs_skip_nop, 0600);
 +	DEBUGFS_ADD(dfs_skip_cac, 0600);
++	DEBUGFS_ADD(dfs_available_reset, 0600);
  }
 diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
 index 5a63dba..57b9bde 100644
@@ -456,5 +496,5 @@
  
  #undef TRACE_INCLUDE_PATH
 -- 
-2.39.2
+2.18.0
 
diff --git a/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0009-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0009-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch
index 5d3bf21..b872374 100644
--- a/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0009-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch
+++ b/recipes-wifi/linux-mac80211/files/patches/subsys/mtk-0009-cfg80211-mtk-implement-DFS-status-show-cac-and-nop-s.patch
@@ -1,19 +1,19 @@
-From cce15ccadd8a06d42a3ed73c89f2b495ff65e5de Mon Sep 17 00:00:00 2001
+From cc87cfb17dfe07759d56dc3cd2fe05477cf3daa4 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 09/17] cfg80211: mtk: implement DFS status show, cac and nop
- skip command via debugfs
+Subject: [PATCH] cfg80211: mtk: implement DFS status show, cac and nop skip
+ command via debugfs
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
  include/net/cfg80211.h  |   1 +
  net/mac80211/cfg.c      |  19 +++
  net/wireless/core.h     |   3 +
- net/wireless/debugfs.c  | 270 ++++++++++++++++++++++++++++++++++++++--
+ net/wireless/debugfs.c  | 310 +++++++++++++++++++++++++++++++++++++++-
  net/wireless/mlme.c     |   6 +
- net/wireless/rdev-ops.h |  14 +++
+ net/wireless/rdev-ops.h |  14 ++
  net/wireless/trace.h    |  12 ++
- 7 files changed, 318 insertions(+), 7 deletions(-)
+ 7 files changed, 358 insertions(+), 7 deletions(-)
 
 diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
 index ae2af09..b97ddbd 100644
@@ -77,7 +77,7 @@
  	struct work_struct background_cac_abort_wk;
  
 diff --git a/net/wireless/debugfs.c b/net/wireless/debugfs.c
-index 0878b16..d3a0aae 100644
+index 0878b16..0637ed4 100644
 --- a/net/wireless/debugfs.c
 +++ b/net/wireless/debugfs.c
 @@ -9,6 +9,7 @@
@@ -88,7 +88,7 @@
  
  #define DEBUGFS_READONLY_FILE(name, buflen, fmt, value...)		\
  static ssize_t name## _read(struct file *file, char __user *userbuf,	\
-@@ -96,16 +97,271 @@ static const struct file_operations ht40allow_map_ops = {
+@@ -96,16 +97,311 @@ static const struct file_operations ht40allow_map_ops = {
  	.llseek = default_llseek,
  };
  
@@ -346,6 +346,45 @@
 +DEFINE_DEBUGFS_ATTRIBUTE(dfs_skip_cac_ops, NULL,
 +			 dfs_cac_skip, "0x%08llx\n");
 +
++static int
++dfs_available_reset(void *data, u64 val)
++{
++	struct wiphy *wiphy = data;
++	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
++	bool en = !!val;
++	enum nl80211_band band;
++	struct ieee80211_supported_band *sband;
++	struct ieee80211_channel *chan;
++	int i;
++
++	if (!en)
++		return 0;
++
++	for (band = 0; band < NUM_NL80211_BANDS; band++) {
++		sband = wiphy->bands[band];
++		if (!sband)
++			continue;
++		for (i = 0; i < sband->n_channels; i++) {
++			chan = &sband->channels[i];
++
++			if (!(chan->flags & IEEE80211_CHAN_RADAR))
++				continue;
++
++			if (chan->dfs_state == NL80211_DFS_AVAILABLE) {
++				chan->dfs_state = NL80211_DFS_USABLE;
++				chan->dfs_state_entered = jiffies;
++			}
++		}
++	}
++
++	cfg80211_sched_dfs_chan_update(rdev);
++
++	return 0;
++}
++
++DEFINE_DEBUGFS_ATTRIBUTE(dfs_available_reset_ops, NULL,
++			 dfs_available_reset, "0x%08llx\n");
++
 +#define DEBUGFS_ADD(name, chmod)						\
 +	debugfs_create_file(#name, chmod, phyd, &rdev->wiphy, &name## _ops)
  
@@ -366,6 +405,7 @@
 +	DEBUGFS_ADD(dfs_status, 0444);
 +	DEBUGFS_ADD(dfs_skip_nop, 0600);
 +	DEBUGFS_ADD(dfs_skip_cac, 0600);
++	DEBUGFS_ADD(dfs_available_reset, 0600);
  }
 diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
 index 00370ca..205c1bc 100644
diff --git a/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-fix-incorrect-HE-TX-GI-report.patch b/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-fix-incorrect-HE-TX-GI-report.patch
index 3a0e69c..07733c3 100644
--- a/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-fix-incorrect-HE-TX-GI-report.patch
+++ b/recipes-wifi/linux-mt76/files/patches/0005-wifi-mt76-fix-incorrect-HE-TX-GI-report.patch
@@ -1,7 +1,7 @@
-From 4edd13ceb916e12acbd91011268e192b867fd747 Mon Sep 17 00:00:00 2001
+From 80765449e32eba36051daeb29824cc011aecd85d Mon Sep 17 00:00:00 2001
 From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
 Date: Fri, 24 Mar 2023 18:01:27 +0800
-Subject: [PATCH 5/5] wifi: mt76: fix incorrect HE TX GI report
+Subject: [PATCH] wifi: mt76: fix incorrect HE TX GI report
 
 Change GI reporting source from static capability to rate-tuning module.
 
@@ -9,15 +9,15 @@
 ---
  mt76.h          |   4 ++
  mt7915/init.c   |   4 ++
- mt7915/mac.c    |  54 ++++++++++++++---------
- mt7915/main.c   |   7 +++
- mt7915/mcu.c    | 114 ++++++++++++++++++++++++++++++++++++++++++++++++
- mt7915/mcu.h    |  39 +++++++++++++++++
- mt7915/mt7915.h |   6 +++
- 7 files changed, 208 insertions(+), 20 deletions(-)
+ mt7915/mac.c    |  60 ++++++++++------
+ mt7915/main.c   |   7 ++
+ mt7915/mcu.c    | 183 ++++++++++++++++++++++++++++++++++++++++++++++++
+ mt7915/mcu.h    |  58 +++++++++++++++
+ mt7915/mt7915.h |   6 ++
+ 7 files changed, 302 insertions(+), 20 deletions(-)
 
 diff --git a/mt76.h b/mt76.h
-index 183b0fc..11d4936 100644
+index 183b0fc5..11d49363 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -254,12 +254,16 @@ struct mt76_queue_ops {
@@ -38,7 +38,7 @@
  	MT_PHY_TYPE_HE_EXT_SU,
  	MT_PHY_TYPE_HE_TB,
 diff --git a/mt7915/init.c b/mt7915/init.c
-index b88c382..611a82b 100644
+index b88c3827..611a82b6 100644
 --- a/mt7915/init.c
 +++ b/mt7915/init.c
 @@ -644,6 +644,8 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy)
@@ -60,7 +60,7 @@
  	INIT_DELAYED_WORK(&dev->mphy.mac_work, mt7915_mac_work);
  	INIT_LIST_HEAD(&dev->sta_rc_list);
 diff --git a/mt7915/mac.c b/mt7915/mac.c
-index f1fdcfd..d052036 100644
+index f1fdcfde..8e30070b 100644
 --- a/mt7915/mac.c
 +++ b/mt7915/mac.c
 @@ -177,15 +177,7 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev)
@@ -124,7 +124,27 @@
  			continue;
  		}
  
-@@ -2016,6 +2004,27 @@ static void mt7915_mac_severe_check(struct mt7915_phy *phy)
+@@ -1055,6 +1043,7 @@ mt7915_mac_tx_free_v0(struct mt7915_dev *dev, void *data, int len)
+ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data)
+ {
+ 	struct mt7915_sta *msta = NULL;
++	struct mt7915_phy *phy;
+ 	struct mt76_wcid *wcid;
+ 	__le32 *txs_data = data;
+ 	u16 wcidx;
+@@ -1090,6 +1079,11 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data)
+ 		list_add_tail(&msta->poll_list, &dev->sta_poll_list);
+ 	spin_unlock_bh(&dev->sta_poll_lock);
+ 
++	phy = msta->vif->phy;
++	spin_lock_bh(&phy->stats_lock);
++	if (list_empty(&msta->stats_list))
++		list_add_tail(&msta->stats_list, &phy->stats_list);
++	spin_unlock_bh(&phy->stats_lock);
+ out:
+ 	rcu_read_unlock();
+ }
+@@ -2016,6 +2010,27 @@ static void mt7915_mac_severe_check(struct mt7915_phy *phy)
  	phy->trb_ts = trb;
  }
  
@@ -152,7 +172,7 @@
  void mt7915_mac_sta_rc_work(struct work_struct *work)
  {
  	struct mt7915_dev *dev = container_of(work, struct mt7915_dev, rc_work);
-@@ -2071,6 +2080,11 @@ void mt7915_mac_work(struct work_struct *work)
+@@ -2071,6 +2086,11 @@ void mt7915_mac_work(struct work_struct *work)
  		mt7915_mac_severe_check(phy);
  	}
  
@@ -165,7 +185,7 @@
  
  	mt76_tx_status_check(mphy->dev, false);
 diff --git a/mt7915/main.c b/mt7915/main.c
-index ea1d4e6..870b7b2 100644
+index ea1d4e6a..870b7b23 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -684,6 +684,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -197,20 +217,17 @@
  
  static void mt7915_tx(struct ieee80211_hw *hw,
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 2a5ad03..a9f8a88 100644
+index 2a5ad033..512a9d5f 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -3752,6 +3752,120 @@ out:
+@@ -3752,6 +3752,189 @@ out:
  	return ret;
  }
  
 +static int
-+mt7915_mcu_parse_tx_gi(struct mt7915_mcu_ra_info *mcu_rate,
-+			 struct rate_info *rate)
++mt7915_mcu_parse_tx_gi(struct mt76_dev *dev, u8 mode, u8 gi, u8 bw,
++                       struct rate_info *rate)
 +{
-+	u8 mode = mcu_rate->mode;
-+	u8 gi = mcu_rate->gi;
-+
 +	/* Legacy drivers only use 3 bits for PHY mode. For backward
 +	 * compatibility, HE and newer PHY mode indices are remapped
 +	 * to the extended bits.
@@ -232,21 +249,23 @@
 +	case MT_PHY_TYPE_HE_EXT_SU:
 +	case MT_PHY_TYPE_HE_TB:
 +	case MT_PHY_TYPE_HE_MU:
-+		switch (mcu_rate->bw) {
-+		case MCU_PHY_BW_20:
-+			gi = u8_get_bits(gi, HE_GI_BW_20);
-+			break;
-+		case MCU_PHY_BW_40:
-+			gi = u8_get_bits(gi, HE_GI_BW_40);
-+			break;
-+		case MCU_PHY_BW_80:
-+			gi = u8_get_bits(gi, HE_GI_BW_80);
-+			break;
-+		case MCU_PHY_BW_160:
-+			gi = u8_get_bits(gi, HE_GI_BW_160);
-+			break;
-+		default:
-+			return -EINVAL;
++		if (!is_mt7915(dev)) {
++			switch (bw) {
++			case MCU_PHY_BW_20:
++				gi = u8_get_bits(gi, HE_GI_BW_20);
++				break;
++			case MCU_PHY_BW_40:
++				gi = u8_get_bits(gi, HE_GI_BW_40);
++				break;
++			case MCU_PHY_BW_80:
++				gi = u8_get_bits(gi, HE_GI_BW_80);
++				break;
++			case MCU_PHY_BW_160:
++				gi = u8_get_bits(gi, HE_GI_BW_160);
++				break;
++			default:
++				return -EINVAL;
++			}
 +		}
 +
 +		if (gi > NL80211_RATE_INFO_HE_GI_3_2)
@@ -261,17 +280,78 @@
 +	return 0;
 +}
 +
-+int mt7915_mcu_get_tx_rate(struct mt7915_phy *phy, u16 wcidx)
++int mt7915_mcu_get_tx_rate_v1(struct mt7915_phy *phy, u16 wcidx)
 +{
 +	struct ieee80211_tx_status status = {};
++	struct mt7915_mcu_ra_info_v1 *rate;
 +	struct mt7915_dev *dev = phy->dev;
 +	struct mt76_phy *mphy = phy->mt76;
-+	struct mt7915_mcu_ra_info *rate;
 +	struct mt76_wcid *wcid;
 +	struct sk_buff *skb;
 +	int ret;
 +
 +	struct {
++		__le32 category;
++		u8 wcidx_lo;
++		u8 band;
++		u8 wcidx_hi;
++		u8 rsv[5];
++	} req = {
++		.category = cpu_to_le32(MCU_GET_TX_RATE),
++		.wcidx_lo = to_wcid_lo(wcidx),
++		.band = mphy->band_idx,
++		.wcidx_hi = to_wcid_hi(wcidx)
++	};
++
++	ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_EXT_QUERY(GET_TX_STAT),
++                                        &req, sizeof(req), true, &skb);
++	if (ret)
++		return ret;
++
++	rate = (struct mt7915_mcu_ra_info_v1 *)skb->data;
++	if ((rate->wcidx_hi << 8 | rate->wcidx_lo) != wcidx) {
++		ret = -EINVAL;
++		goto out;
++	}
++
++	rcu_read_lock();
++	wcid = rcu_dereference(dev->mt76.wcid[wcidx]);
++	if (!wcid) {
++		ret = -EINVAL;
++		goto unlock;
++	}
++
++	ret = mt7915_mcu_parse_tx_gi(mphy->dev, rate->mode, rate->gi,
++                                     rate->bw, &wcid->rate);
++	if (ret)
++		goto unlock;
++
++	status.sta = wcid_to_sta(wcid);
++	if (!status.sta) {
++		ret = -EINVAL;
++		goto unlock;
++	}
++	status.rate = &wcid->rate;
++	ieee80211_tx_status_ext(mphy->hw, &status);
++unlock:
++	rcu_read_unlock();
++out:
++	dev_kfree_skb(skb);
++
++	return ret;
++}
++
++int mt7915_mcu_get_tx_rate_v2(struct mt7915_phy *phy, u16 wcidx)
++{
++	struct ieee80211_tx_status status = {};
++	struct mt7915_mcu_ra_info_v2 *rate;
++	struct mt7915_dev *dev = phy->dev;
++	struct mt76_phy *mphy = phy->mt76;
++	struct mt76_wcid *wcid;
++	struct sk_buff *skb;
++	int ret;
++
++	struct {
 +		u8 category;
 +		u8 band;
 +		__le16 wcidx;
@@ -286,7 +366,7 @@
 +	if (ret)
 +		return ret;
 +
-+	rate = (struct mt7915_mcu_ra_info *)skb->data;
++	rate = (struct mt7915_mcu_ra_info_v2 *)skb->data;
 +	if (le16_to_cpu(rate->wcidx) != wcidx) {
 +		ret = -EINVAL;
 +		goto out;
@@ -299,7 +379,8 @@
 +		goto unlock;
 +	}
 +
-+	ret = mt7915_mcu_parse_tx_gi(rate, &wcid->rate);
++	ret = mt7915_mcu_parse_tx_gi(mphy->dev, rate->mode, rate->gi,
++                                     rate->bw, &wcid->rate);
 +	if (ret)
 +		goto unlock;
 +
@@ -318,14 +399,22 @@
 +	return ret;
 +}
 +
++int mt7915_mcu_get_tx_rate(struct mt7915_phy *phy, u16 wcidx)
++{
++	if (is_mt7915(&phy->dev->mt76))
++		return mt7915_mcu_get_tx_rate_v1(phy, wcidx);
++	else
++		return mt7915_mcu_get_tx_rate_v2(phy, wcidx);
++}
++
  int mt7915_mcu_update_bss_color(struct mt7915_dev *dev, struct ieee80211_vif *vif,
  				struct cfg80211_he_bss_color *he_bss_color)
  {
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index 1592b5d..3429e24 100644
+index 1592b5d6..aebacc7d 100644
 --- a/mt7915/mcu.h
 +++ b/mt7915/mcu.h
-@@ -152,6 +152,42 @@ struct mt7915_mcu_eeprom_info {
+@@ -152,6 +152,61 @@ struct mt7915_mcu_eeprom_info {
  	u8 data[16];
  } __packed;
  
@@ -346,7 +435,26 @@
 +#define HE_GI_BW_80	GENMASK(5, 4)
 +#define HE_GI_BW_160	GENMASK(7, 6)
 +
++struct mt7915_mcu_ra_info_v1 {
++	u8 wcidx_lo;
++	u8 band;
++	u8 wcidx_hi;
++	u8 rsv1[46];
++
++	u8 mode;
++	u8 flags;
++	u8 stbc;
++	u8 gi;
++	u8 bw;
++	u8 ldpc;
++	u8 mcs;
++	u8 nss;
++	u8 ltf;
++
++	u8 rsv2[8];
++};
++
-+struct mt7915_mcu_ra_info {
++struct mt7915_mcu_ra_info_v2 {
 +	u8 category;
 +	u8 rsv1;
 +	__le16 num;
@@ -368,7 +476,7 @@
  struct mt7915_mcu_phy_rx_info {
  	u8 category;
  	u8 rate;
-@@ -527,4 +563,7 @@ mt7915_get_power_bound(struct mt7915_phy *phy, s8 txpower)
+@@ -527,4 +582,7 @@ mt7915_get_power_bound(struct mt7915_phy *phy, s8 txpower)
  	return txpower;
  }
  
@@ -377,7 +485,7 @@
 +};
  #endif
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 376256d..81246f3 100644
+index 6c401080..891d21ea 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -131,6 +131,7 @@ struct mt7915_sta {
diff --git a/recipes-wifi/linux-mt76/files/patches/3007-wifi-mt76-mt7915-add-wa-command-to-get-tx-msdu-count.patch b/recipes-wifi/linux-mt76/files/patches/3007-wifi-mt76-mt7915-add-wa-command-to-get-tx-msdu-count.patch
index a5b4890..1e06935 100644
--- a/recipes-wifi/linux-mt76/files/patches/3007-wifi-mt76-mt7915-add-wa-command-to-get-tx-msdu-count.patch
+++ b/recipes-wifi/linux-mt76/files/patches/3007-wifi-mt76-mt7915-add-wa-command-to-get-tx-msdu-count.patch
@@ -1,8 +1,7 @@
-From 3fe0d851df3cf107c3427116018e655ef817d9e8 Mon Sep 17 00:00:00 2001
+From 4f1290c149c6cc3ef2f2623ca09f23fe9bb4c133 Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Wed, 18 Jan 2023 16:37:22 +0800
-Subject: [PATCH 3007/3013] wifi: mt76: mt7915: add wa command to get tx msdu
- count
+Subject: [PATCH] wifi: mt76: mt7915: add wa command to get tx msdu count
 
 ---
  mt76.h             |  2 +-
@@ -16,7 +15,7 @@
  8 files changed, 79 insertions(+), 12 deletions(-)
 
 diff --git a/mt76.h b/mt76.h
-index a215d2f..c7bd147 100644
+index a215d2f1..c7bd147f 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -288,7 +288,7 @@ struct mt76_sta_stats {
@@ -29,7 +28,7 @@
  	u32 tx_failed;
  	/* WED RX */
 diff --git a/mt76_connac2_mac.h b/mt76_connac2_mac.h
-index f33171b..101e760 100644
+index f33171bc..101e7602 100644
 --- a/mt76_connac2_mac.h
 +++ b/mt76_connac2_mac.h
 @@ -164,6 +164,7 @@ enum {
@@ -41,7 +40,7 @@
  
  /* RXD DW1 */
 diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
-index 8d316d3..1816bcb 100644
+index 8d316d3a..1816bcbc 100644
 --- a/mt76_connac_mac.c
 +++ b/mt76_connac_mac.c
 @@ -491,7 +491,9 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
@@ -68,7 +67,7 @@
  			le32_get_bits(txs_data[6], MT_TXS6_MPDU_FAIL_CNT);
  		stats->tx_retries +=
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 8e559ef..dd7ee32 100644
+index 8e559efb..dd7ee32f 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -1000,6 +1000,7 @@ enum {
@@ -80,10 +79,10 @@
  	MCU_EXT_EVENT_MURU_CTRL = 0x9f,
  	MCU_EXT_EVENT_CSI_REPORT = 0xc2,
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 779d038..64709e1 100644
+index da49e318..6714f635 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -1118,9 +1118,6 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
+@@ -1117,9 +1117,6 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
  		sinfo->tx_bytes = msta->wcid.stats.tx_bytes;
  		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BYTES64);
  
@@ -93,7 +92,7 @@
  		sinfo->tx_failed = msta->wcid.stats.tx_failed;
  		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_FAILED);
  
-@@ -1136,6 +1133,11 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
+@@ -1135,6 +1132,11 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
  		}
  	}
  
@@ -106,7 +105,7 @@
  	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL);
  
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 35ea3fc..fd72eba 100644
+index b5d1e637..29b2486c 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -169,7 +169,9 @@ mt7915_mcu_parse_response(struct mt76_dev *mdev, int cmd,
@@ -137,7 +136,7 @@
  		mt7915_mcu_rx_unsolicited_event(dev, skb);
  	else
  		mt76_mcu_rx_event(&dev->mt76, skb);
-@@ -4172,7 +4175,7 @@ int mt7915_mcu_get_tx_rate(struct mt7915_phy *phy, u16 wcidx)
+@@ -4272,7 +4275,7 @@ int mt7915_mcu_get_tx_rate_v2(struct mt7915_phy *phy, u16 wcidx)
  	};
  
  	ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_EXT_QUERY(GET_TX_STAT),
@@ -146,8 +145,8 @@
  	if (ret)
  		return ret;
  
-@@ -4208,6 +4211,53 @@ out:
- 	return ret;
+@@ -4316,6 +4319,53 @@ int mt7915_mcu_get_tx_rate(struct mt7915_phy *phy, u16 wcidx)
+ 		return mt7915_mcu_get_tx_rate_v2(phy, wcidx);
  }
  
 +int mt7915_mcu_get_tx_stat_wa(struct mt7915_dev *dev, u16 wlan_idx)
@@ -201,10 +200,10 @@
  				struct cfg80211_he_bss_color *he_bss_color)
  {
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index bd0ccb5..f91f4bc 100644
+index d3cbe160..a7098427 100644
 --- a/mt7915/mcu.h
 +++ b/mt7915/mcu.h
-@@ -328,6 +328,17 @@ enum {
+@@ -347,6 +347,17 @@ enum {
  	MCU_WA_PARAM_RED_SETTING = 0x40,
  };
  
@@ -223,7 +222,7 @@
  	MCU_MMPS_STATIC,
  	MCU_MMPS_DYNAMIC,
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 81970ef..943253c 100644
+index 8a1be2db..28a2416c 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -722,6 +722,7 @@ int mt7915_mcu_set_thermal_protect(struct mt7915_phy *phy);
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
index 7eed335..edab139 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
@@ -1,7 +1,7 @@
-From 450d63689a1b93a96432d32e7b74f88b5bb37041 Mon Sep 17 00:00:00 2001
+From 6e4d4d6feafd223615cddf334b6c3beb6e5191cc Mon Sep 17 00:00:00 2001
 From: "howard.hsu" <howard-yh.hsu@mediatek.com>
 Date: Wed, 19 Jan 2022 19:18:07 +0800
-Subject: [PATCH 01/26] hostapd: mtk: Add neighbor report and BSS Termination
+Subject: [PATCH 01/29] hostapd: mtk: Add neighbor report and BSS Termination
  for MBO certification
 
 1. Add hostapd_neighbor_count() and hostapd_neighbor_insert_buffer ()
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
index a49167c..b4ce65c 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
@@ -1,7 +1,7 @@
-From cf8954130bda13e31691be744fff1b123b8230cd Mon Sep 17 00:00:00 2001
+From 1320c3e6d39c08371da1a80ffa1ae3ecb711c742 Mon Sep 17 00:00:00 2001
 From: Shayne Chen <shayne.chen@mediatek.com>
 Date: Tue, 20 Sep 2022 19:33:45 +0800
-Subject: [PATCH 02/26] hostapd: mtk: print sae groups by hostapd ctrl
+Subject: [PATCH 02/29] hostapd: mtk: print sae groups by hostapd ctrl
 
 ---
  hostapd/ctrl_iface.c | 13 +++++++++++++
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
index d472d99..8a2ed4d 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
@@ -1,7 +1,7 @@
-From 24ca60c0a250fc1d81e83f9120344c896c776b7f Mon Sep 17 00:00:00 2001
+From 11a3a8dcba0e17a032bf8445c6bb50835cbe8e85 Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Tue, 31 May 2022 21:15:54 +0800
-Subject: [PATCH 03/26] hostapd: mtk: add support for runtime set in-band
+Subject: [PATCH 03/29] hostapd: mtk: add support for runtime set in-band
  discovery
 
 Usage:
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
index 9eae1e3..0490689 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
@@ -1,7 +1,7 @@
-From 5cc1b09fbaad9cf3fda3821071b0262e8c2d0694 Mon Sep 17 00:00:00 2001
+From f05288a19fe295685de4cb419c31f4bd11a774df Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 15:04:57 +0800
-Subject: [PATCH 04/26] hostapd: mtk: Add mtk_vendor.h
+Subject: [PATCH 04/29] hostapd: mtk: Add mtk_vendor.h
 
 ---
  src/common/mtk_vendor.h | 195 ++++++++++++++++++++++++++++++++++++++++
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
index 7d4800f..ade6b9d 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
@@ -1,7 +1,7 @@
-From 3a2644fea08e4c7cd521a86da8c905447b891d70 Mon Sep 17 00:00:00 2001
+From c69f15f922f2095b6f36a5bbd5186e4ff5e44021 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 16:31:34 +0800
-Subject: [PATCH 05/26] hostapd: mtk: Support EDCCA hostapd configuration
+Subject: [PATCH 05/29] hostapd: mtk: Support EDCCA hostapd configuration
 
 edcca_enable and edcca_compensation and implement edcca related handlers.
 ---
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
index dbe0ee1..026b4fd 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
@@ -1,7 +1,7 @@
-From eb4bba013fd102ddd957aa62b675225940557d0b Mon Sep 17 00:00:00 2001
+From f27bf939f8e2815e2f65790e538fba3bfc46a9c3 Mon Sep 17 00:00:00 2001
 From: TomLiu <tomml.liu@mediatek.com>
 Date: Tue, 9 Aug 2022 10:23:44 -0700
-Subject: [PATCH 06/26] hostapd: mtk: Add hostapd MU SET/GET control
+Subject: [PATCH 06/29] hostapd: mtk: Add hostapd MU SET/GET control
 
 ---
  hostapd/config_file.c             |   9 +++
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
index f9e3ae8..b8d1836 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
@@ -1,7 +1,7 @@
-From 832bf1797fd010987700dc5bec920971f5df40e0 Mon Sep 17 00:00:00 2001
+From 94c7af6787585f1d063ce90c33208aa7e4f5730e Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Fri, 2 Sep 2022 01:03:23 +0800
-Subject: [PATCH 07/26] hostapd: mtk: Add three wire PTA ctrl hostapd vendor
+Subject: [PATCH 07/29] hostapd: mtk: Add three wire PTA ctrl hostapd vendor
  command
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
index 16ab828..acefdee 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
@@ -1,7 +1,7 @@
-From 45063f1f4f2abd5d0f4c76bcf98bd3247ec95ec1 Mon Sep 17 00:00:00 2001
+From a75dc659e600dc2d6f7eda2dc9886747b6c55254 Mon Sep 17 00:00:00 2001
 From: mtk27835 <shurong.wen@mediatek.com>
 Date: Wed, 7 Sep 2022 14:41:51 -0700
-Subject: [PATCH 08/26] hostapd: mtk: Add hostapd iBF control
+Subject: [PATCH 08/29] hostapd: mtk: Add hostapd iBF control
 
 Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
 ---
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
index 203aca1..d96423d 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
@@ -1,7 +1,7 @@
-From c57b2012ebc907db832b3de6e674f46fc078c240 Mon Sep 17 00:00:00 2001
+From 0c960d33f909f8c119d533cc57b1585d77e319e1 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Thu, 22 Sep 2022 16:08:09 +0800
-Subject: [PATCH 09/26] hostapd: mtk: Do not include HE capab IE if associated
+Subject: [PATCH 09/29] hostapd: mtk: Do not include HE capab IE if associated
  sta's HE capab IE is invalid
 
 ---
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
index f073a07..ffe0426 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
@@ -1,7 +1,7 @@
-From 4e6af76a87117ab480ce34c8ba3b9dd0330f3d63 Mon Sep 17 00:00:00 2001
+From f57c471059e4e9909b7fc6cbd351343cd2628e2c Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 14:55:49 +0800
-Subject: [PATCH 10/26] hostapd: mtk: Add DFS detection mode
+Subject: [PATCH 10/29] hostapd: mtk: Add DFS detection mode
 
 Add DFS detection mode for testing radar detection rate.
 If DFS detection mode is on, AP will not switch channels when receiving
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
index 4d18017..187f804 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
@@ -1,7 +1,7 @@
-From 110f0b441b55a9e418eea9ac00929a936b859bd4 Mon Sep 17 00:00:00 2001
+From 43e5bfa91c67528eb2a37071e0e4a6f32807ad8f Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 14:56:55 +0800
-Subject: [PATCH 11/26] hostapd: mtk: Add DFS offchan channel switch
+Subject: [PATCH 11/29] hostapd: mtk: Add DFS offchan channel switch
 
 Add DFS background chain channel switch command for testing purpose.
 This feature is implemented via hostapd_cli command.
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
index fd2a8d0..53936b2 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
@@ -1,7 +1,7 @@
-From 7674ca39e15bb1a2f20530f08574d1289a235cc6 Mon Sep 17 00:00:00 2001
+From 8dee72b3608710a9cb6e9694c3d6535be000e104 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 16 Dec 2022 03:57:11 +0800
-Subject: [PATCH 12/26] hostapd: mtk: Add amsdu set get ctrl
+Subject: [PATCH 12/29] hostapd: mtk: Add amsdu set get ctrl
 
 ---
  hostapd/config_file.c             |   9 +++
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
index 841f428..094e102 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
@@ -1,7 +1,7 @@
-From f74cf37f72e76e073f2f0f409e294ce35df34e29 Mon Sep 17 00:00:00 2001
+From 858e23d3ff04d156a6391168d2554796962b294c Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Thu, 12 Jan 2023 15:18:19 +0800
-Subject: [PATCH 13/26] hostapd: mtk: Add he_ldpc configuration
+Subject: [PATCH 13/29] hostapd: mtk: Add he_ldpc configuration
 
 ---
  hostapd/config_file.c        | 2 ++
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
index cc198b8..abca258 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
@@ -1,7 +1,7 @@
-From 702447202b9f41d7a7c9d39d6fbc4cbeadf17edc Mon Sep 17 00:00:00 2001
+From d45d0c40a81b1196b0dc4cc8da08fe736f04022f Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Tue, 17 Jan 2023 13:25:18 +0800
-Subject: [PATCH 14/26] hostapd: mtk: Add the broadcast destination address of
+Subject: [PATCH 14/29] hostapd: mtk: Add the broadcast destination address of
  Probe Response frame on 6 GHz
 
 According to IEEE 802.11ax 26.17.2.3.2,
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
index 4b3ab3c..a74780c 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
@@ -1,7 +1,7 @@
-From 2e6d38464b60a08b60b1e542416b5ed908ed99bb Mon Sep 17 00:00:00 2001
+From a0cc42414bd6abd0342f2fd06c09650c366c959c Mon Sep 17 00:00:00 2001
 From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
 Date: Tue, 24 Jan 2023 19:06:44 +0800
-Subject: [PATCH 15/26] hostapd: mtk: Add vendor command attribute for RTS BW
+Subject: [PATCH 15/29] hostapd: mtk: Add vendor command attribute for RTS BW
  signaling.
 
 Signed-off-by: himanshu.goyal <himanshu.goyal@mediatek.com>
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
index 36a6223..30cc7eb 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
@@ -1,7 +1,7 @@
-From b7362c50e5cf97ece5bd061ce641f0b7463359c1 Mon Sep 17 00:00:00 2001
+From 08a909a1a06a2231fda12b34aad68c6361c45e6b Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Mon, 13 Feb 2023 11:03:53 +0800
-Subject: [PATCH 16/26] hostapd: mtk: 6G band does not require DFS
+Subject: [PATCH 16/29] hostapd: mtk: 6G band does not require DFS
 
 ---
  src/ap/dfs.c | 1 +
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
index 695f183..81e22a2 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
@@ -1,7 +1,7 @@
-From 3fdf945a5225a9d213e1402e654d73eac12e6c01 Mon Sep 17 00:00:00 2001
+From 4c7054d6a1d7e373d93b6abf309c41c0151e523f Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 11:01:18 +0800
-Subject: [PATCH 17/26] hostapd: mtk: Fix sending wrong VHT operation IE in CSA
+Subject: [PATCH 17/29] hostapd: mtk: Fix sending wrong VHT operation IE in CSA
  while using ZWDFS
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
index 2170031..059ded9 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
@@ -1,7 +1,7 @@
-From 026fd770c9cd3a4c1e655660a901f9d805736441 Mon Sep 17 00:00:00 2001
+From d851c49cd0afb0e86676670f8b49170bb0386cba Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 10:51:47 +0800
-Subject: [PATCH 18/26] hostapd: mtk: Add sta-assisted DFS state update
+Subject: [PATCH 18/29] hostapd: mtk: Add sta-assisted DFS state update
  mechanism
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
index 217012f..f89da87 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
@@ -1,19 +1,19 @@
-From ce95a0389d632148e7f201bf57fcc30ee81be5b8 Mon Sep 17 00:00:00 2001
+From 0aa1200534c41279f5f05e1919040a86f003ca0a Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 16:58:20 +0800
-Subject: [PATCH 19/26] hostapd: mtk: Fix auto ht issue when switching to DFS
+Subject: [PATCH 19/29] hostapd: mtk: Fix auto ht issue when switching to DFS
  channel
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
- hostapd/ctrl_iface.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
+ hostapd/ctrl_iface.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 61c9e80..c33b7a4 100644
+index 61c9e80..06cbea1 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2698,6 +2698,12 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2698,6 +2698,13 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
  		break;
  	}
  
@@ -21,12 +21,13 @@
 +		settings.freq_params.ht_enabled = iface->conf->ieee80211n;
 +		settings.freq_params.vht_enabled = iface->conf->ieee80211ac;
 +		settings.freq_params.he_enabled = iface->conf->ieee80211ax;
++		settings.freq_params.eht_enabled = iface->conf->ieee80211be;
 +	}
 +
  	if (settings.freq_params.center_freq1)
  		dfs_range += hostapd_is_dfs_overlap(
  			iface, bandwidth, settings.freq_params.center_freq1);
-@@ -2735,12 +2741,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2735,12 +2742,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
  		return 0;
  	}
  
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
index 26fece5..5b14a77 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
@@ -1,7 +1,7 @@
-From bf2a83d9d233474798d20514694a83bd3a021a66 Mon Sep 17 00:00:00 2001
+From c229d874452a61f58b65473d26b89c64b4693908 Mon Sep 17 00:00:00 2001
 From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
-Date: Fri, 3 Mar 2023 12:45:42 +0800
-Subject: [PATCH 20/26] hostapd: mtk: Mark DFS channel as available for CSA.
+Date: Sat, 29 Apr 2023 06:57:36 +0800
+Subject: [PATCH 20/29] hostapd: mtk: Mark DFS channel as available for CSA.
 
 ---
  hostapd/ctrl_iface.c   | 10 ++++++++++
@@ -10,11 +10,11 @@
  3 files changed, 12 insertions(+), 1 deletion(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index c33b7a4..9ba6992 100644
+index 06cbea1..7b59bb5 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2704,6 +2704,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
- 		settings.freq_params.he_enabled = iface->conf->ieee80211ax;
+@@ -2705,6 +2705,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ 		settings.freq_params.eht_enabled = iface->conf->ieee80211be;
  	}
  
 +	if (settings.freq_params.radar_background) {
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
index 408ae4d..c9b8ea9 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
@@ -1,7 +1,7 @@
-From 0198a92b05ae90ad11d3e4e182027db691072152 Mon Sep 17 00:00:00 2001
+From bed7e913c79fcd0f2d7d686b7d1da0ec8bf4d23f Mon Sep 17 00:00:00 2001
 From: mtk20656 <chank.chen@mediatek.com>
 Date: Thu, 2 Mar 2023 10:51:43 +0800
-Subject: [PATCH 21/26] hostapd: mtk: add 11v_mbss and ema support for hostapd
+Subject: [PATCH 21/29] hostapd: mtk: add 11v_mbss and ema support for hostapd
 
 Signed-off-by: mtk20656 <chank.chen@mediatek.com>
 ---
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
index 4a53c32..544ab11 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
@@ -1,7 +1,7 @@
-From 3446ad9e725f3adb993c18466bd16e95ff696eda Mon Sep 17 00:00:00 2001
+From 93880afd007b74cb7b56f9711bb0ab07b9858ac1 Mon Sep 17 00:00:00 2001
 From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 Date: Thu, 26 Jan 2023 09:16:00 +0800
-Subject: [PATCH 22/26] hostapd: mtk: Add available color bitmap
+Subject: [PATCH 22/29] hostapd: mtk: Add available color bitmap
 
 Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 ---
@@ -17,10 +17,10 @@
  9 files changed, 192 insertions(+), 1 deletion(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 9ba6992..e1e9270 100644
+index 7b59bb5..78179aa 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -3645,6 +3645,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
+@@ -3646,6 +3646,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
  	return ret;
  }
  
@@ -97,7 +97,7 @@
  
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
-@@ -4212,6 +4282,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4213,6 +4283,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_set_offchan_ctrl(hapd, buf + 16, reply, reply_size);
  	} else if (os_strncmp(buf, "GET_AMSDU", 9) == 0) {
  		reply_len = hostapd_ctrl_iface_get_amsdu(hapd, reply, reply_size);
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
index 3c96137..5df63b2 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
@@ -1,7 +1,7 @@
-From 4e3cade1a84ea8bb29b8fba7bbbe34997b6cc035 Mon Sep 17 00:00:00 2001
+From a2d6ad8b3330feca1ea3f7fc8539a964145371a9 Mon Sep 17 00:00:00 2001
 From: Michael Lee <michael-cy.lee@mediatek.com>
 Date: Wed, 22 Mar 2023 13:59:29 +0800
-Subject: [PATCH 23/26] hostapd: mtk: Add channel information for hostapd
+Subject: [PATCH 23/29] hostapd: mtk: Add channel information for hostapd
  reload
 
 Add center channel, operating class, and bandwidth into the UPDATE
@@ -15,7 +15,7 @@
  2 files changed, 25 insertions(+), 3 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index e1e9270..4c5d494 100644
+index 78179aa..87448e7 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
 @@ -170,6 +170,17 @@ static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
index 8e43095..57e8b9b 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
@@ -1,7 +1,7 @@
-From f9d768d2a7ee7196a67eddf64f30e188f53b9785 Mon Sep 17 00:00:00 2001
+From 87dbbd2f6e02272e2ceee1e30dce60828bf0cc1c Mon Sep 17 00:00:00 2001
 From: Amit Khatri <amit.khatri@mediatek.com>
 Date: Thu, 23 Mar 2023 14:26:46 +0800
-Subject: [PATCH 24/26] hostapd: mtk: Add support for masking EHT capabilities.
+Subject: [PATCH 24/29] hostapd: mtk: Add support for masking EHT capabilities.
 
 If STA want to disable EHT mode connection.
 STA can set
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
index b4feae8..5eb131b 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
@@ -1,7 +1,7 @@
-From 0f3ddbd24b04d74fe2f0f617da0c63eedd1bb639 Mon Sep 17 00:00:00 2001
+From 2d97fca26e0c3cd46d1c21cc18d6adc68be60f52 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Mar 2023 16:08:30 +0800
-Subject: [PATCH 25/26] hostapd: mtk: Fix ZWDFS issue in BW 160
+Subject: [PATCH 25/29] hostapd: mtk: Fix ZWDFS issue in BW 160
 
 When background radar is enabled and bandwidth is set to 160, AP will
 fail to startup due to the lack of non-DFS channel.
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
index bd8ac27..5872b47 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
@@ -1,7 +1,7 @@
-From 28b26529a2cd7d187df6c0b9a95f6d7d0751c205 Mon Sep 17 00:00:00 2001
+From 4c6d148fea7cd1ea380a792d83d2dabe61e9c869 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 17 Mar 2023 16:17:14 +0800
-Subject: [PATCH 26/26] hostapd: mtk: Add vendor for CAPI certification
+Subject: [PATCH 26/29] hostapd: mtk: Add vendor for CAPI certification
  commands
 
 ---
@@ -16,7 +16,7 @@
  8 files changed, 332 insertions(+), 30 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 4c5d494..f338d0f 100644
+index 87448e7..b0323e7 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
 @@ -38,6 +38,7 @@
@@ -27,7 +27,7 @@
  #include "crypto/tls.h"
  #include "drivers/driver.h"
  #include "eapol_auth/eapol_auth_sm.h"
-@@ -3726,6 +3727,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
+@@ -3727,6 +3728,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
  	return pos - buf;
  }
  
@@ -124,7 +124,7 @@
  
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
-@@ -4297,6 +4388,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4298,6 +4389,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_get_bss_color(hapd, reply, reply_size);
  	} else if (os_strncmp(buf, "AVAL_COLOR_BMP", 14) == 0) {
  		reply_len = hostapd_ctrl_iface_get_aval_color_bmp(hapd, reply, reply_size);
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
similarity index 97%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
index 59a0bc5..eb17c61 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
@@ -1,7 +1,8 @@
-From 8496882339b6e9dc550b491693b8029fc88ac191 Mon Sep 17 00:00:00 2001
+From 11fefdfadbc5bbdf0fcb4d890ea24906a286db43 Mon Sep 17 00:00:00 2001
 From: mtk23888 <dipanshu.mittal@mediatek.com>
 Date: Tue, 4 Apr 2023 13:06:41 +0800
-Subject: [PATCH] Air Monitor support in hostapd by vendor NL
+Subject: [PATCH 27/29] hostapd: mtk: Air Monitor support in hostapd by vendor
+ NL
 
 Signed-off-by: mtk23888 <dipanshu.mittal@mediatek.com>
 ---
@@ -17,10 +18,10 @@
  9 files changed, 352 insertions(+)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index f338d0f..7f91cb6 100644
+index b0323e7..056583c 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -3765,6 +3765,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
+@@ -3766,6 +3766,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
  
  	if (hostapd_drv_ap_wireless(hapd, (u8) sub_cmd, atoi(value)) != 0)
  		return -1;
@@ -65,7 +66,7 @@
  
  	return os_snprintf(buf, buflen, "OK\n");
  }
-@@ -3818,6 +3856,75 @@ exit:
+@@ -3819,6 +3857,75 @@ exit:
  	return os_snprintf(buf, buflen, "OK\n");
  }
  
@@ -141,7 +142,7 @@
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
  					      int reply_size,
-@@ -4392,6 +4499,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4393,6 +4500,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_ap_wireless(hapd, buf + 12, reply, reply_size);
  	} else if (os_strncmp(buf, "ap_rfeatures ", 13) == 0) {
  		reply_len = hostapd_ctrl_iface_ap_rfeatures(hapd, buf + 13, reply, reply_size);
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
similarity index 84%
rename from recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch
rename to recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
index 5775bb7..05f6dc8 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
@@ -1,7 +1,7 @@
-From ab881e5e91f15eac1b7a33bd6eb7a9882d911ae4 Mon Sep 17 00:00:00 2001
+From 38a7f0f985e33f24f0da234966f560e7136868cf Mon Sep 17 00:00:00 2001
 From: Michael Lee <michael-cy.lee@mediatek.com>
 Date: Wed, 19 Apr 2023 17:18:33 +0800
-Subject: [PATCH] hostapd: mtk: Fix scan result updating issue
+Subject: [PATCH 28/29] hostapd: mtk: Fix scan result updating issue
 
 There are no HT capability and operation in beacon of AP operating in
 NOHT.
@@ -12,7 +12,7 @@
  1 file changed, 4 insertions(+)
 
 diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
-index 01ddb13..d765f32 100644
+index 01ddb13..4e711cf 100644
 --- a/wpa_supplicant/bss.c
 +++ b/wpa_supplicant/bss.c
 @@ -306,8 +306,12 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
@@ -29,5 +29,5 @@
  	calculate_update_time(fetch_time, src->age, &dst->last_update);
  }
 -- 
-2.25.1
+2.18.0
 
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
new file mode 100644
index 0000000..c2ef3f7
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
@@ -0,0 +1,28 @@
+From 1814fca214ecf2a876734af789906e2316172ba8 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Thu, 30 Mar 2023 17:03:03 +0800
+Subject: [PATCH 29/29] hostapd: mtk: Fix setting wrong seg0 index for 5G
+ center chan 159 BW40
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/ap/ap_config.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
+index 51476b8..ae22a2f 100644
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -1275,7 +1275,8 @@ hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf,
+ #ifdef CONFIG_IEEE80211BE
+ 	if (conf->ieee80211be)
+ 		conf->eht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
+-	if (center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
++	if (is_6ghz_op_class(conf->op_class) &&
++	    center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
+ 		oper_centr_freq_seg0_idx +=
+ 			conf->channel > oper_centr_freq_seg0_idx ? 16 : -16;
+ #endif /* CONFIG_IEEE80211BE */
+-- 
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc
index f5475c8..07bae46 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc
+++ b/recipes-wifi/wpa-supplicant/files/patches-2.10.3/patches.inc
@@ -88,7 +88,8 @@
     file://mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch \
     file://mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch \
     file://mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
-    file://mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch \
-    file://mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+    file://mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
+    file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+    file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
     file://mtk-0100-hostapd-mtk-update-eht-operation-elem.patch \
     "
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
index 7eed335..edab139 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0001-hostapd-mtk-Add-neighbor-report-and-BSS-Termination-.patch
@@ -1,7 +1,7 @@
-From 450d63689a1b93a96432d32e7b74f88b5bb37041 Mon Sep 17 00:00:00 2001
+From 6e4d4d6feafd223615cddf334b6c3beb6e5191cc Mon Sep 17 00:00:00 2001
 From: "howard.hsu" <howard-yh.hsu@mediatek.com>
 Date: Wed, 19 Jan 2022 19:18:07 +0800
-Subject: [PATCH 01/26] hostapd: mtk: Add neighbor report and BSS Termination
+Subject: [PATCH 01/29] hostapd: mtk: Add neighbor report and BSS Termination
  for MBO certification
 
 1. Add hostapd_neighbor_count() and hostapd_neighbor_insert_buffer ()
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
index a49167c..b4ce65c 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0002-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
@@ -1,7 +1,7 @@
-From cf8954130bda13e31691be744fff1b123b8230cd Mon Sep 17 00:00:00 2001
+From 1320c3e6d39c08371da1a80ffa1ae3ecb711c742 Mon Sep 17 00:00:00 2001
 From: Shayne Chen <shayne.chen@mediatek.com>
 Date: Tue, 20 Sep 2022 19:33:45 +0800
-Subject: [PATCH 02/26] hostapd: mtk: print sae groups by hostapd ctrl
+Subject: [PATCH 02/29] hostapd: mtk: print sae groups by hostapd ctrl
 
 ---
  hostapd/ctrl_iface.c | 13 +++++++++++++
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
index d472d99..8a2ed4d 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0003-hostapd-mtk-add-support-for-runtime-set-in-band-disc.patch
@@ -1,7 +1,7 @@
-From 24ca60c0a250fc1d81e83f9120344c896c776b7f Mon Sep 17 00:00:00 2001
+From 11a3a8dcba0e17a032bf8445c6bb50835cbe8e85 Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Tue, 31 May 2022 21:15:54 +0800
-Subject: [PATCH 03/26] hostapd: mtk: add support for runtime set in-band
+Subject: [PATCH 03/29] hostapd: mtk: add support for runtime set in-band
  discovery
 
 Usage:
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
index 9eae1e3..0490689 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0004-hostapd-mtk-Add-mtk_vendor.h.patch
@@ -1,7 +1,7 @@
-From 5cc1b09fbaad9cf3fda3821071b0262e8c2d0694 Mon Sep 17 00:00:00 2001
+From f05288a19fe295685de4cb419c31f4bd11a774df Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 15:04:57 +0800
-Subject: [PATCH 04/26] hostapd: mtk: Add mtk_vendor.h
+Subject: [PATCH 04/29] hostapd: mtk: Add mtk_vendor.h
 
 ---
  src/common/mtk_vendor.h | 195 ++++++++++++++++++++++++++++++++++++++++
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
index 7d4800f..ade6b9d 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0005-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
@@ -1,7 +1,7 @@
-From 3a2644fea08e4c7cd521a86da8c905447b891d70 Mon Sep 17 00:00:00 2001
+From c69f15f922f2095b6f36a5bbd5186e4ff5e44021 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 16:31:34 +0800
-Subject: [PATCH 05/26] hostapd: mtk: Support EDCCA hostapd configuration
+Subject: [PATCH 05/29] hostapd: mtk: Support EDCCA hostapd configuration
 
 edcca_enable and edcca_compensation and implement edcca related handlers.
 ---
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
index dbe0ee1..026b4fd 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0006-hostapd-mtk-Add-hostapd-MU-SET-GET-control.patch
@@ -1,7 +1,7 @@
-From eb4bba013fd102ddd957aa62b675225940557d0b Mon Sep 17 00:00:00 2001
+From f27bf939f8e2815e2f65790e538fba3bfc46a9c3 Mon Sep 17 00:00:00 2001
 From: TomLiu <tomml.liu@mediatek.com>
 Date: Tue, 9 Aug 2022 10:23:44 -0700
-Subject: [PATCH 06/26] hostapd: mtk: Add hostapd MU SET/GET control
+Subject: [PATCH 06/29] hostapd: mtk: Add hostapd MU SET/GET control
 
 ---
  hostapd/config_file.c             |   9 +++
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
index f9e3ae8..b8d1836 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0007-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-c.patch
@@ -1,7 +1,7 @@
-From 832bf1797fd010987700dc5bec920971f5df40e0 Mon Sep 17 00:00:00 2001
+From 94c7af6787585f1d063ce90c33208aa7e4f5730e Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Fri, 2 Sep 2022 01:03:23 +0800
-Subject: [PATCH 07/26] hostapd: mtk: Add three wire PTA ctrl hostapd vendor
+Subject: [PATCH 07/29] hostapd: mtk: Add three wire PTA ctrl hostapd vendor
  command
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
index 16ab828..acefdee 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0008-hostapd-mtk-Add-hostapd-iBF-control.patch
@@ -1,7 +1,7 @@
-From 45063f1f4f2abd5d0f4c76bcf98bd3247ec95ec1 Mon Sep 17 00:00:00 2001
+From a75dc659e600dc2d6f7eda2dc9886747b6c55254 Mon Sep 17 00:00:00 2001
 From: mtk27835 <shurong.wen@mediatek.com>
 Date: Wed, 7 Sep 2022 14:41:51 -0700
-Subject: [PATCH 08/26] hostapd: mtk: Add hostapd iBF control
+Subject: [PATCH 08/29] hostapd: mtk: Add hostapd iBF control
 
 Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
 ---
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
index 203aca1..d96423d 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0009-hostapd-mtk-Do-not-include-HE-capab-IE-if-associated.patch
@@ -1,7 +1,7 @@
-From c57b2012ebc907db832b3de6e674f46fc078c240 Mon Sep 17 00:00:00 2001
+From 0c960d33f909f8c119d533cc57b1585d77e319e1 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Thu, 22 Sep 2022 16:08:09 +0800
-Subject: [PATCH 09/26] hostapd: mtk: Do not include HE capab IE if associated
+Subject: [PATCH 09/29] hostapd: mtk: Do not include HE capab IE if associated
  sta's HE capab IE is invalid
 
 ---
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
index f073a07..ffe0426 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0010-hostapd-mtk-Add-DFS-detection-mode.patch
@@ -1,7 +1,7 @@
-From 4e6af76a87117ab480ce34c8ba3b9dd0330f3d63 Mon Sep 17 00:00:00 2001
+From f57c471059e4e9909b7fc6cbd351343cd2628e2c Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 14:55:49 +0800
-Subject: [PATCH 10/26] hostapd: mtk: Add DFS detection mode
+Subject: [PATCH 10/29] hostapd: mtk: Add DFS detection mode
 
 Add DFS detection mode for testing radar detection rate.
 If DFS detection mode is on, AP will not switch channels when receiving
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
index 4d18017..187f804 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0011-hostapd-mtk-Add-DFS-offchan-channel-switch.patch
@@ -1,7 +1,7 @@
-From 110f0b441b55a9e418eea9ac00929a936b859bd4 Mon Sep 17 00:00:00 2001
+From 43e5bfa91c67528eb2a37071e0e4a6f32807ad8f Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 14:56:55 +0800
-Subject: [PATCH 11/26] hostapd: mtk: Add DFS offchan channel switch
+Subject: [PATCH 11/29] hostapd: mtk: Add DFS offchan channel switch
 
 Add DFS background chain channel switch command for testing purpose.
 This feature is implemented via hostapd_cli command.
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
index fd2a8d0..53936b2 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0012-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
@@ -1,7 +1,7 @@
-From 7674ca39e15bb1a2f20530f08574d1289a235cc6 Mon Sep 17 00:00:00 2001
+From 8dee72b3608710a9cb6e9694c3d6535be000e104 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 16 Dec 2022 03:57:11 +0800
-Subject: [PATCH 12/26] hostapd: mtk: Add amsdu set get ctrl
+Subject: [PATCH 12/29] hostapd: mtk: Add amsdu set get ctrl
 
 ---
  hostapd/config_file.c             |   9 +++
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
index 841f428..094e102 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0013-hostapd-mtk-Add-he_ldpc-configuration.patch
@@ -1,7 +1,7 @@
-From f74cf37f72e76e073f2f0f409e294ce35df34e29 Mon Sep 17 00:00:00 2001
+From 858e23d3ff04d156a6391168d2554796962b294c Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Thu, 12 Jan 2023 15:18:19 +0800
-Subject: [PATCH 13/26] hostapd: mtk: Add he_ldpc configuration
+Subject: [PATCH 13/29] hostapd: mtk: Add he_ldpc configuration
 
 ---
  hostapd/config_file.c        | 2 ++
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
index cc198b8..abca258 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0014-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
@@ -1,7 +1,7 @@
-From 702447202b9f41d7a7c9d39d6fbc4cbeadf17edc Mon Sep 17 00:00:00 2001
+From d45d0c40a81b1196b0dc4cc8da08fe736f04022f Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Tue, 17 Jan 2023 13:25:18 +0800
-Subject: [PATCH 14/26] hostapd: mtk: Add the broadcast destination address of
+Subject: [PATCH 14/29] hostapd: mtk: Add the broadcast destination address of
  Probe Response frame on 6 GHz
 
 According to IEEE 802.11ax 26.17.2.3.2,
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
index 4b3ab3c..a74780c 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0015-hostapd-mtk-Add-vendor-command-attribute-for-RTS-BW-.patch
@@ -1,7 +1,7 @@
-From 2e6d38464b60a08b60b1e542416b5ed908ed99bb Mon Sep 17 00:00:00 2001
+From a0cc42414bd6abd0342f2fd06c09650c366c959c Mon Sep 17 00:00:00 2001
 From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
 Date: Tue, 24 Jan 2023 19:06:44 +0800
-Subject: [PATCH 15/26] hostapd: mtk: Add vendor command attribute for RTS BW
+Subject: [PATCH 15/29] hostapd: mtk: Add vendor command attribute for RTS BW
  signaling.
 
 Signed-off-by: himanshu.goyal <himanshu.goyal@mediatek.com>
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
index 36a6223..30cc7eb 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0016-hostapd-mtk-6G-band-does-not-require-DFS.patch
@@ -1,7 +1,7 @@
-From b7362c50e5cf97ece5bd061ce641f0b7463359c1 Mon Sep 17 00:00:00 2001
+From 08a909a1a06a2231fda12b34aad68c6361c45e6b Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Mon, 13 Feb 2023 11:03:53 +0800
-Subject: [PATCH 16/26] hostapd: mtk: 6G band does not require DFS
+Subject: [PATCH 16/29] hostapd: mtk: 6G band does not require DFS
 
 ---
  src/ap/dfs.c | 1 +
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
index 695f183..81e22a2 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0017-hostapd-mtk-Fix-sending-wrong-VHT-operation-IE-in-CS.patch
@@ -1,7 +1,7 @@
-From 3fdf945a5225a9d213e1402e654d73eac12e6c01 Mon Sep 17 00:00:00 2001
+From 4c7054d6a1d7e373d93b6abf309c41c0151e523f Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 11:01:18 +0800
-Subject: [PATCH 17/26] hostapd: mtk: Fix sending wrong VHT operation IE in CSA
+Subject: [PATCH 17/29] hostapd: mtk: Fix sending wrong VHT operation IE in CSA
  while using ZWDFS
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
index 2170031..059ded9 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0018-hostapd-mtk-Add-sta-assisted-DFS-state-update-mechan.patch
@@ -1,7 +1,7 @@
-From 026fd770c9cd3a4c1e655660a901f9d805736441 Mon Sep 17 00:00:00 2001
+From d851c49cd0afb0e86676670f8b49170bb0386cba Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 10:51:47 +0800
-Subject: [PATCH 18/26] hostapd: mtk: Add sta-assisted DFS state update
+Subject: [PATCH 18/29] hostapd: mtk: Add sta-assisted DFS state update
  mechanism
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
index 217012f..f89da87 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0019-hostapd-mtk-Fix-auto-ht-issue-when-switching-to-DFS-.patch
@@ -1,19 +1,19 @@
-From ce95a0389d632148e7f201bf57fcc30ee81be5b8 Mon Sep 17 00:00:00 2001
+From 0aa1200534c41279f5f05e1919040a86f003ca0a Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Feb 2023 16:58:20 +0800
-Subject: [PATCH 19/26] hostapd: mtk: Fix auto ht issue when switching to DFS
+Subject: [PATCH 19/29] hostapd: mtk: Fix auto ht issue when switching to DFS
  channel
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
- hostapd/ctrl_iface.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
+ hostapd/ctrl_iface.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 61c9e80..c33b7a4 100644
+index 61c9e80..06cbea1 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2698,6 +2698,12 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2698,6 +2698,13 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
  		break;
  	}
  
@@ -21,12 +21,13 @@
 +		settings.freq_params.ht_enabled = iface->conf->ieee80211n;
 +		settings.freq_params.vht_enabled = iface->conf->ieee80211ac;
 +		settings.freq_params.he_enabled = iface->conf->ieee80211ax;
++		settings.freq_params.eht_enabled = iface->conf->ieee80211be;
 +	}
 +
  	if (settings.freq_params.center_freq1)
  		dfs_range += hostapd_is_dfs_overlap(
  			iface, bandwidth, settings.freq_params.center_freq1);
-@@ -2735,12 +2741,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+@@ -2735,12 +2742,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
  		return 0;
  	}
  
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
index 26fece5..5b14a77 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0020-hostapd-mtk-Mark-DFS-channel-as-available-for-CSA.patch
@@ -1,7 +1,7 @@
-From bf2a83d9d233474798d20514694a83bd3a021a66 Mon Sep 17 00:00:00 2001
+From c229d874452a61f58b65473d26b89c64b4693908 Mon Sep 17 00:00:00 2001
 From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
-Date: Fri, 3 Mar 2023 12:45:42 +0800
-Subject: [PATCH 20/26] hostapd: mtk: Mark DFS channel as available for CSA.
+Date: Sat, 29 Apr 2023 06:57:36 +0800
+Subject: [PATCH 20/29] hostapd: mtk: Mark DFS channel as available for CSA.
 
 ---
  hostapd/ctrl_iface.c   | 10 ++++++++++
@@ -10,11 +10,11 @@
  3 files changed, 12 insertions(+), 1 deletion(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index c33b7a4..9ba6992 100644
+index 06cbea1..7b59bb5 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -2704,6 +2704,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
- 		settings.freq_params.he_enabled = iface->conf->ieee80211ax;
+@@ -2705,6 +2705,16 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
+ 		settings.freq_params.eht_enabled = iface->conf->ieee80211be;
  	}
  
 +	if (settings.freq_params.radar_background) {
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
index 408ae4d..c9b8ea9 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0021-hostapd-mtk-add-11v_mbss-and-ema-support-for-hostapd.patch
@@ -1,7 +1,7 @@
-From 0198a92b05ae90ad11d3e4e182027db691072152 Mon Sep 17 00:00:00 2001
+From bed7e913c79fcd0f2d7d686b7d1da0ec8bf4d23f Mon Sep 17 00:00:00 2001
 From: mtk20656 <chank.chen@mediatek.com>
 Date: Thu, 2 Mar 2023 10:51:43 +0800
-Subject: [PATCH 21/26] hostapd: mtk: add 11v_mbss and ema support for hostapd
+Subject: [PATCH 21/29] hostapd: mtk: add 11v_mbss and ema support for hostapd
 
 Signed-off-by: mtk20656 <chank.chen@mediatek.com>
 ---
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
index 4a53c32..544ab11 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0022-hostapd-mtk-Add-available-color-bitmap.patch
@@ -1,7 +1,7 @@
-From 3446ad9e725f3adb993c18466bd16e95ff696eda Mon Sep 17 00:00:00 2001
+From 93880afd007b74cb7b56f9711bb0ab07b9858ac1 Mon Sep 17 00:00:00 2001
 From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 Date: Thu, 26 Jan 2023 09:16:00 +0800
-Subject: [PATCH 22/26] hostapd: mtk: Add available color bitmap
+Subject: [PATCH 22/29] hostapd: mtk: Add available color bitmap
 
 Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
 ---
@@ -17,10 +17,10 @@
  9 files changed, 192 insertions(+), 1 deletion(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 9ba6992..e1e9270 100644
+index 7b59bb5..78179aa 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -3645,6 +3645,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
+@@ -3646,6 +3646,76 @@ hostapd_ctrl_iface_get_amsdu(struct hostapd_data *hapd, char *buf,
  	return ret;
  }
  
@@ -97,7 +97,7 @@
  
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
-@@ -4212,6 +4282,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4213,6 +4283,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_set_offchan_ctrl(hapd, buf + 16, reply, reply_size);
  	} else if (os_strncmp(buf, "GET_AMSDU", 9) == 0) {
  		reply_len = hostapd_ctrl_iface_get_amsdu(hapd, reply, reply_size);
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
index 3c96137..5df63b2 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0023-hostapd-mtk-Add-channel-information-for-hostapd-relo.patch
@@ -1,7 +1,7 @@
-From 4e3cade1a84ea8bb29b8fba7bbbe34997b6cc035 Mon Sep 17 00:00:00 2001
+From a2d6ad8b3330feca1ea3f7fc8539a964145371a9 Mon Sep 17 00:00:00 2001
 From: Michael Lee <michael-cy.lee@mediatek.com>
 Date: Wed, 22 Mar 2023 13:59:29 +0800
-Subject: [PATCH 23/26] hostapd: mtk: Add channel information for hostapd
+Subject: [PATCH 23/29] hostapd: mtk: Add channel information for hostapd
  reload
 
 Add center channel, operating class, and bandwidth into the UPDATE
@@ -15,7 +15,7 @@
  2 files changed, 25 insertions(+), 3 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index e1e9270..4c5d494 100644
+index 78179aa..87448e7 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
 @@ -170,6 +170,17 @@ static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
index 8e43095..57e8b9b 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch
@@ -1,7 +1,7 @@
-From f9d768d2a7ee7196a67eddf64f30e188f53b9785 Mon Sep 17 00:00:00 2001
+From 87dbbd2f6e02272e2ceee1e30dce60828bf0cc1c Mon Sep 17 00:00:00 2001
 From: Amit Khatri <amit.khatri@mediatek.com>
 Date: Thu, 23 Mar 2023 14:26:46 +0800
-Subject: [PATCH 24/26] hostapd: mtk: Add support for masking EHT capabilities.
+Subject: [PATCH 24/29] hostapd: mtk: Add support for masking EHT capabilities.
 
 If STA want to disable EHT mode connection.
 STA can set
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
index b4feae8..5eb131b 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch
@@ -1,7 +1,7 @@
-From 0f3ddbd24b04d74fe2f0f617da0c63eedd1bb639 Mon Sep 17 00:00:00 2001
+From 2d97fca26e0c3cd46d1c21cc18d6adc68be60f52 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Mon, 20 Mar 2023 16:08:30 +0800
-Subject: [PATCH 25/26] hostapd: mtk: Fix ZWDFS issue in BW 160
+Subject: [PATCH 25/29] hostapd: mtk: Fix ZWDFS issue in BW 160
 
 When background radar is enabled and bandwidth is set to 160, AP will
 fail to startup due to the lack of non-DFS channel.
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
index bd8ac27..5872b47 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch
@@ -1,7 +1,7 @@
-From 28b26529a2cd7d187df6c0b9a95f6d7d0751c205 Mon Sep 17 00:00:00 2001
+From 4c6d148fea7cd1ea380a792d83d2dabe61e9c869 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 17 Mar 2023 16:17:14 +0800
-Subject: [PATCH 26/26] hostapd: mtk: Add vendor for CAPI certification
+Subject: [PATCH 26/29] hostapd: mtk: Add vendor for CAPI certification
  commands
 
 ---
@@ -16,7 +16,7 @@
  8 files changed, 332 insertions(+), 30 deletions(-)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 4c5d494..f338d0f 100644
+index 87448e7..b0323e7 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
 @@ -38,6 +38,7 @@
@@ -27,7 +27,7 @@
  #include "crypto/tls.h"
  #include "drivers/driver.h"
  #include "eapol_auth/eapol_auth_sm.h"
-@@ -3726,6 +3727,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
+@@ -3727,6 +3728,96 @@ hostapd_ctrl_iface_get_aval_color_bmp(struct hostapd_data *hapd, char *buf,
  	return pos - buf;
  }
  
@@ -124,7 +124,7 @@
  
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
-@@ -4297,6 +4388,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4298,6 +4389,10 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_get_bss_color(hapd, reply, reply_size);
  	} else if (os_strncmp(buf, "AVAL_COLOR_BMP", 14) == 0) {
  		reply_len = hostapd_ctrl_iface_get_aval_color_bmp(hapd, reply, reply_size);
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
deleted file mode 100644
index 59a0bc5..0000000
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
+++ /dev/null
@@ -1,506 +0,0 @@
-From 8496882339b6e9dc550b491693b8029fc88ac191 Mon Sep 17 00:00:00 2001
-From: mtk23888 <dipanshu.mittal@mediatek.com>
-Date: Tue, 4 Apr 2023 13:06:41 +0800
-Subject: [PATCH] Air Monitor support in hostapd by vendor NL
-
-Signed-off-by: mtk23888 <dipanshu.mittal@mediatek.com>
----
- hostapd/ctrl_iface.c              | 113 +++++++++++++++++++
- hostapd/hostapd_cli.c             |  15 +++
- src/ap/ap_drv_ops.c               |  14 +++
- src/ap/ap_drv_ops.h               |   3 +
- src/common/mtk_vendor.h           |   8 ++
- src/drivers/driver.h              |  16 +++
- src/drivers/driver_nl80211.c      | 180 ++++++++++++++++++++++++++++++
- src/drivers/driver_nl80211.h      |   1 +
- src/drivers/driver_nl80211_capa.c |   2 +
- 9 files changed, 352 insertions(+)
-
-diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index f338d0f..7f91cb6 100644
---- a/hostapd/ctrl_iface.c
-+++ b/hostapd/ctrl_iface.c
-@@ -3765,6 +3765,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
- 
- 	if (hostapd_drv_ap_wireless(hapd, (u8) sub_cmd, atoi(value)) != 0)
- 		return -1;
-+	return os_snprintf(buf, buflen, "OK\n");
-+}
-+
-+static int
-+hostapd_ctrl_iface_set_amnt(struct hostapd_data *hapd, char *cmd,
-+					char *buf, size_t buflen)
-+{
-+	char *tmp, sta_mac[ETH_ALEN] = {0};
-+	int amnt_idx = 0;
-+
-+	tmp = strtok_r(cmd, " ", &cmd);
-+
-+	if (!tmp) {
-+		wpa_printf(MSG_ERROR, "Error in command format\n");
-+		return -1;
-+	}
-+
-+	amnt_idx = strtol(tmp, &tmp, 10);
-+
-+	if (amnt_idx < 0 || amnt_idx > 15) {
-+		wpa_printf(MSG_ERROR, "Wrong AMNT index %d\n", amnt_idx);
-+		return -1;
-+	}
-+
-+	if (!cmd) {
-+		wpa_printf(MSG_ERROR, "Error in command format\n");
-+		return -1;
-+	}
-+
-+	if (hwaddr_aton(cmd, sta_mac) < 0) {
-+		wpa_printf(MSG_ERROR, "station mac is not right.\n");
-+		return -1;
-+	}
-+
-+	if (hostapd_drv_amnt_set(hapd, amnt_idx, sta_mac)) {
-+		wpa_printf(MSG_ERROR, "Not able to set amnt index\n");
-+		return -1;
-+	}
- 
- 	return os_snprintf(buf, buflen, "OK\n");
- }
-@@ -3818,6 +3856,75 @@ exit:
- 	return os_snprintf(buf, buflen, "OK\n");
- }
- 
-+static int
-+hostapd_ctrl_iface_dump_amnt(struct hostapd_data *hapd, char *cmd,
-+				char *buf, size_t buflen)
-+{
-+	char *tmp;
-+	int amnt_idx = 0, ret = 0;
-+	struct amnt_resp_data *resp_buf;
-+	char *pos, *end;
-+	struct amnt_data *res;
-+
-+	pos = buf;
-+	end = buf + buflen;
-+
-+	tmp = strtok_r(cmd, " ", &cmd);
-+
-+	if (!tmp) {
-+		wpa_printf(MSG_ERROR, "Error in command format\n");
-+		return -1;
-+	}
-+
-+	amnt_idx = strtoul(tmp, &tmp, 0);
-+
-+	if ((amnt_idx < 0 || amnt_idx > 15) && amnt_idx != 0xff) {
-+		wpa_printf(MSG_ERROR, "Wrong AMNT index\n");
-+		return -1;
-+	}
-+
-+	if (amnt_idx == 0xff)
-+		resp_buf = (struct amnt_resp_data *) os_zalloc(AIR_MONITOR_MAX_ENTRY
-+							* sizeof(struct amnt_data) + 1);
-+	else
-+		resp_buf = (struct amnt_resp_data *) os_zalloc(sizeof(struct amnt_data) + 1);
-+
-+	if (resp_buf == NULL) {
-+		wpa_printf(MSG_ERROR, "Error in memory allocation\n");
-+		return -1;
-+	}
-+
-+	if (hostapd_drv_amnt_dump(hapd, amnt_idx, (u8 *)resp_buf)) {
-+		wpa_printf(MSG_ERROR, "Not able to set amnt index\n");
-+		os_free(resp_buf);
-+		return -1;
-+	}
-+
-+	for (int i = 0; i < resp_buf->sta_num && i < AIR_MONITOR_MAX_ENTRY; i++) {
-+		res = &resp_buf->resp_data[i];
-+		ret = os_snprintf(pos, end - pos,
-+				"[hostapd_cli] amnt_idx: %d, addr="MACSTR
-+				", rssi=%d/%d/%d/%d, last_seen=%u\n",
-+				res->idx,
-+				MAC2STR(res->addr), res->rssi[0],
-+				res->rssi[1], res->rssi[2],
-+				res->rssi[3], res->last_seen);
-+		if (os_snprintf_error(end - pos, ret)) {
-+			os_free(resp_buf);
-+			return 0;
-+		}
-+		pos = pos + ret;
-+	}
-+
-+	os_free(resp_buf);
-+
-+	if (pos == buf)
-+		return os_snprintf(buf, buflen, "Index %d is not monitored\n",
-+				amnt_idx);
-+	else
-+		return pos - buf;
-+}
-+
- static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
- 					      char *buf, char *reply,
- 					      int reply_size,
-@@ -4392,6 +4499,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
- 		reply_len = hostapd_ctrl_iface_ap_wireless(hapd, buf + 12, reply, reply_size);
- 	} else if (os_strncmp(buf, "ap_rfeatures ", 13) == 0) {
- 		reply_len = hostapd_ctrl_iface_ap_rfeatures(hapd, buf + 13, reply, reply_size);
-+	} else if (os_strncmp(buf, "SET_AMNT", 8) == 0) {
-+		reply_len = hostapd_ctrl_iface_set_amnt(hapd, buf+9,
-+							reply, reply_size);
-+	} else if (os_strncmp(buf, "DUMP_AMNT", 9) == 0) {
-+		reply_len = hostapd_ctrl_iface_dump_amnt(hapd, buf+10,
-+							reply, reply_size);
- 	} else {
- 		os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
- 		reply_len = 16;
-diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index aad7aa5..0c4a176 100644
---- a/hostapd/hostapd_cli.c
-+++ b/hostapd/hostapd_cli.c
-@@ -1613,6 +1613,17 @@ static int hostapd_cli_cmd_get_amsdu(struct wpa_ctrl *ctrl, int argc,
- 	return hostapd_cli_cmd(ctrl, "GET_AMSDU", 0, NULL, NULL);
- }
- 
-+static int hostapd_cli_cmd_set_amnt(struct wpa_ctrl *ctrl, int argc,
-+					   char *argv[])
-+{
-+	return hostapd_cli_cmd(ctrl, "SET_AMNT", 2, argc, argv);
-+}
-+
-+static int hostapd_cli_cmd_dump_amnt(struct wpa_ctrl *ctrl, int argc,
-+					   char *argv[])
-+{
-+	return hostapd_cli_cmd(ctrl, "DUMP_AMNT", 1, argc, argv);
-+}
- 
- struct hostapd_cli_cmd {
- 	const char *cmd;
-@@ -1823,6 +1834,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
- 	  " = show iBF state (enabled/disabled)"},
- 	{ "get_amsdu", hostapd_cli_cmd_get_amsdu, NULL,
- 		" = show AMSDU state"},
-+	{ "set_amnt", hostapd_cli_cmd_set_amnt, NULL,
-+		" = Set Station index and mac to monitor"},
-+	{ "dump_amnt", hostapd_cli_cmd_dump_amnt, NULL,
-+		" = Dump RSSI of monitoring Station"},
- 	{ NULL, NULL, NULL, NULL }
- };
- 
-diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 52d0fff..eafa588 100644
---- a/src/ap/ap_drv_ops.c
-+++ b/src/ap/ap_drv_ops.c
-@@ -1121,3 +1121,17 @@ int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type)
- 		return 0;
- 	return hapd->driver->ap_trigtype(hapd->drv_priv, enable, type);
- }
-+
-+int hostapd_drv_amnt_set(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_sta_mac)
-+{
-+	if (!hapd->driver || !hapd->driver->amnt_set)
-+		return 0;
-+	return hapd->driver->amnt_set(hapd->drv_priv, amnt_idx, amnt_sta_mac);
-+}
-+
-+int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_buf)
-+{
-+	if (!hapd->driver || !hapd->driver->amnt_dump)
-+		return 0;
-+	return hapd->driver->amnt_dump(hapd->drv_priv, amnt_idx, amnt_dump_buf);
-+}
-diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 659c3f8..28f2a4d 100644
---- a/src/ap/ap_drv_ops.h
-+++ b/src/ap/ap_drv_ops.h
-@@ -155,6 +155,9 @@ int hostapd_drv_ap_wireless(struct hostapd_data *hapd, u8 sub_vendor_id, int val
- int hostapd_drv_ap_rfeatures(struct hostapd_data *hapd, u8 sub_vendor_id, int value);
- int hostapd_drv_ap_trig_type(struct hostapd_data *hapd, u8 enable, u8 type);
- 
-+int hostapd_drv_amnt_set(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_sta_mac);
-+int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_buf);
-+
- #include "drivers/driver.h"
- 
- int hostapd_drv_wnm_oper(struct hostapd_data *hapd,
-diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 32438af..74f467c 100644
---- a/src/common/mtk_vendor.h
-+++ b/src/common/mtk_vendor.h
-@@ -256,10 +256,18 @@ struct csi_data {
- 	u16 rx_idx;
- };
- 
-+#define AIR_MONITOR_MAX_ENTRY 16
-+
- struct amnt_data {
- 	u8 idx;
- 	u8 addr[ETH_ALEN];
- 	s8 rssi[4];
- 	u32 last_seen;
- };
-+
-+struct amnt_resp_data {
-+	u8 sta_num;
-+	struct amnt_data resp_data[0];
-+};
-+
- #endif /* MTK_VENDOR_H */
-diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index 6a46832..1444cbe 100644
---- a/src/drivers/driver.h
-+++ b/src/drivers/driver.h
-@@ -4809,6 +4809,22 @@ struct wpa_driver_ops {
- 	* @type: trigger type
- 	*/
- 	int (*ap_trigtype)(void *priv, u8 enable, u8 type);
-+
-+	/**
-+	* amnt_set - add/delete station from monitoring
-+	* @priv: Private driver interface data
-+	* @amnt_idx: Monitor Index
-+	* @amnt_sta_mac: station mac address
-+	*/
-+	int (*amnt_set)(void *priv, u8 amnt_idx, u8 *amnt_sta_mac);
-+
-+	/**
-+	* amnt_dump - Dump particular/ all station
-+	* @priv: Private driver interface data
-+	* @amnt_idx: Monitor Index
-+	* @amnt_dump_buf: Buffer to print
-+	*/
-+	int (*amnt_dump)(void *priv, u8 amnt_idx, u8 *amnt_dump_buf);
- };
- 
- /**
-diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 7fae013..0470079 100644
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -125,6 +125,19 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
- 	[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 },
- };
- 
-+static struct nla_policy
-+amnt_ctrl_policy[NUM_MTK_VENDOR_ATTRS_AMNT_CTRL] = {
-+	[MTK_VENDOR_ATTR_AMNT_CTRL_SET] = {.type = NLA_NESTED },
-+	[MTK_VENDOR_ATTR_AMNT_CTRL_DUMP] = { .type = NLA_NESTED },
-+};
-+
-+static struct nla_policy
-+amnt_dump_policy[NUM_MTK_VENDOR_ATTRS_AMNT_DUMP] = {
-+	[MTK_VENDOR_ATTR_AMNT_DUMP_INDEX] = {.type = NLA_U8 },
-+	[MTK_VENDOR_ATTR_AMNT_DUMP_LEN] = { .type = NLA_U8 },
-+	[MTK_VENDOR_ATTR_AMNT_DUMP_RESULT] = { .type = NLA_NESTED },
-+};
-+
- static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
- {
- 	struct nl_sock *handle;
-@@ -13196,6 +13209,171 @@ fail:
- 	return -ENOBUFS;
- }
- 
-+static int
-+nl80211_amnt_set(void *priv, u8 amnt_idx, u8 *amnt_sta_mac)
-+{
-+	struct i802_bss *bss = priv;
-+	struct wpa_driver_nl80211_data *drv = bss->drv;
-+	struct nl_msg *msg;
-+	struct nlattr *data;
-+	void *tb1;
-+	int ret;
-+
-+	if (!drv->mtk_amnt_vendor_cmd_avail) {
-+		wpa_printf(MSG_ERROR,
-+			"nl80211: Driver does not support air monitor");
-+		return 0;
-+	}
-+
-+	msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR);
-+	if (!msg)
-+		goto fail;
-+
-+	if (nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
-+			nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
-+			MTK_NL80211_VENDOR_SUBCMD_AMNT_CTRL))
-+		goto fail;
-+
-+	data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA | NLA_F_NESTED);
-+	if (!data)
-+		goto fail;
-+
-+	tb1 = nla_nest_start(msg, MTK_VENDOR_ATTR_AMNT_CTRL_SET);
-+	if (!tb1)
-+		goto fail;
-+
-+	nla_put_u8(msg, MTK_VENDOR_ATTR_AMNT_SET_INDEX, amnt_idx);
-+
-+	nla_put(msg, MTK_VENDOR_ATTR_AMNT_SET_MACADDR, ETH_ALEN, amnt_sta_mac);
-+
-+	nla_nest_end(msg, tb1);
-+	nla_nest_end(msg, data);
-+
-+	ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
-+
-+	if (ret)
-+		wpa_printf(MSG_ERROR, "Failed to set air monitor. ret=%d (%s)",
-+			ret, strerror(-ret));
-+
-+	return ret;
-+
-+fail:
-+	nlmsg_free(msg);
-+	return -ENOBUFS;
-+
-+}
-+
-+static int
-+mt76_amnt_dump_cb(struct nl_msg *msg, void *arg)
-+{
-+	struct nlattr *tb[NL80211_ATTR_MAX + 1];
-+	struct nlattr *tb1[NUM_MTK_VENDOR_ATTRS_AMNT_CTRL];
-+	struct nlattr *tb2[NUM_MTK_VENDOR_ATTRS_AMNT_DUMP];
-+	struct nlattr *attr, *cur, *data;
-+	struct amnt_data *res;
-+	int len = 0, rem;
-+	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
-+	struct amnt_resp_data *amnt_dump = (struct amnt_resp_data *)arg;
-+
-+	nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
-+		genlmsg_attrlen(gnlh, 0), NULL);
-+
-+	attr = tb[NL80211_ATTR_VENDOR_DATA];
-+	if (!attr)
-+		return NL_SKIP;
-+
-+	nla_parse_nested(tb1, MTK_VENDOR_ATTR_AMNT_CTRL_MAX,
-+			attr, amnt_ctrl_policy);
-+
-+	if (!tb1[MTK_VENDOR_ATTR_AMNT_CTRL_DUMP])
-+		return NL_SKIP;
-+
-+	nla_parse_nested(tb2, NUM_MTK_VENDOR_ATTRS_AMNT_DUMP,
-+			tb1[MTK_VENDOR_ATTR_AMNT_CTRL_DUMP], amnt_dump_policy);
-+
-+	if (!tb2[MTK_VENDOR_ATTR_AMNT_DUMP_LEN])
-+		return NL_SKIP;
-+
-+	len = nla_get_u8(tb2[MTK_VENDOR_ATTR_AMNT_DUMP_LEN]);
-+	if (!len)
-+		return 0;
-+
-+	if (!tb2[MTK_VENDOR_ATTR_AMNT_DUMP_RESULT])
-+		return NL_SKIP;
-+
-+	data = tb2[MTK_VENDOR_ATTR_AMNT_DUMP_RESULT];
-+
-+	nla_for_each_nested(cur, data, rem) {
-+		if (amnt_dump->sta_num >= AIR_MONITOR_MAX_ENTRY)
-+			return NL_SKIP;
-+		res = (struct amnt_data *) nla_data(cur);
-+		wpa_printf(MSG_ERROR, "[vendor] amnt_idx: %d, "
-+			"addr="MACSTR", "
-+			"rssi=%d/%d/%d/%d, last_seen=%u\n",
-+			res->idx,
-+			MAC2STR(res->addr),
-+			res->rssi[0], res->rssi[1], res->rssi[2],
-+			res->rssi[3], res->last_seen);
-+		os_memcpy(&amnt_dump->resp_data[amnt_dump->sta_num], res,
-+			sizeof(struct amnt_data));
-+		amnt_dump->sta_num++;
-+	}
-+	return 0;
-+}
-+
-+static int
-+nl80211_amnt_dump(void *priv, u8 amnt_idx, u8 *dump_buf)
-+{
-+	struct i802_bss *bss = priv;
-+	struct wpa_driver_nl80211_data *drv = bss->drv;
-+	struct nl_msg *msg;
-+	struct nlattr *data;
-+	void *tb1;
-+	int ret;
-+
-+	if (!drv->mtk_amnt_vendor_cmd_avail) {
-+		wpa_printf(MSG_INFO,
-+			"nl80211: Driver does not support air monitor");
-+		return 0;
-+	}
-+
-+	msg = nl80211_drv_msg(drv, NLM_F_DUMP, NL80211_CMD_VENDOR);
-+	if (!msg)
-+		goto fail;
-+
-+	if (nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
-+			nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
-+			MTK_NL80211_VENDOR_SUBCMD_AMNT_CTRL))
-+		goto fail;
-+
-+	data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA | NLA_F_NESTED);
-+	if (!data)
-+		goto fail;
-+
-+	tb1 = nla_nest_start(msg, MTK_VENDOR_ATTR_AMNT_CTRL_DUMP
-+			| NLA_F_NESTED);
-+	if (!tb1)
-+		goto fail;
-+
-+	nla_put_u8(msg, MTK_VENDOR_ATTR_AMNT_DUMP_INDEX, amnt_idx);
-+
-+	nla_nest_end(msg, tb1);
-+	nla_nest_end(msg, data);
-+
-+	ret = send_and_recv_msgs(drv, msg, mt76_amnt_dump_cb,
-+				dump_buf, NULL, NULL);
-+
-+	if (ret)
-+		wpa_printf(MSG_ERROR, "Failed to Dump air monitor. ret=%d (%s)"
-+			, ret, strerror(-ret));
-+
-+	return ret;
-+
-+fail:
-+	nlmsg_free(msg);
-+	return -ENOBUFS;
-+}
-+
- const struct wpa_driver_ops wpa_driver_nl80211_ops = {
- 	.name = "nl80211",
- 	.desc = "Linux nl80211/cfg80211",
-@@ -13356,4 +13534,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
- 	.ap_wireless = nl80211_ap_wireless,
- 	.ap_rfeatures = nl80211_ap_rfeatures,
- 	.ap_trigtype = nl80211_ap_trigtype,
-+	.amnt_set = nl80211_amnt_set,
-+	.amnt_dump = nl80211_amnt_dump,
- };
-diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 7a03446..7dd88e7 100644
---- a/src/drivers/driver_nl80211.h
-+++ b/src/drivers/driver_nl80211.h
-@@ -188,6 +188,7 @@ struct wpa_driver_nl80211_data {
- 	unsigned int mtk_wireless_vendor_cmd_avail:1;
- 	unsigned int mtk_bss_color_vendor_cmd_avail:1;
- 	unsigned int mtk_rfeatures_vendor_cmd_avail:1;
-+	unsigned int mtk_amnt_vendor_cmd_avail:1;
- 
- 	u64 vendor_scan_cookie;
- 	u64 remain_on_chan_cookie;
-diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 6f4d029..5c1a35d 100644
---- a/src/drivers/driver_nl80211_capa.c
-+++ b/src/drivers/driver_nl80211_capa.c
-@@ -1094,6 +1094,8 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
- 					break;
- 				case MTK_NL80211_VENDOR_SUBCMD_BSS_COLOR_CTRL :
- 					drv->mtk_bss_color_vendor_cmd_avail = 1;
-+				case MTK_NL80211_VENDOR_SUBCMD_AMNT_CTRL:
-+					drv->mtk_amnt_vendor_cmd_avail = 1;
- 					break;
- 				case MTK_NL80211_VENDOR_SUBCMD_RFEATURE_CTRL:
- 					drv->mtk_rfeatures_vendor_cmd_avail = 1;
--- 
-2.18.0
-
diff --git a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
similarity index 97%
copy from recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
copy to recipes-wifi/wpa-supplicant/files/patches/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
index 59a0bc5..eb17c61 100644
--- a/recipes-wifi/wpa-supplicant/files/patches-2.10.3/mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch
@@ -1,7 +1,8 @@
-From 8496882339b6e9dc550b491693b8029fc88ac191 Mon Sep 17 00:00:00 2001
+From 11fefdfadbc5bbdf0fcb4d890ea24906a286db43 Mon Sep 17 00:00:00 2001
 From: mtk23888 <dipanshu.mittal@mediatek.com>
 Date: Tue, 4 Apr 2023 13:06:41 +0800
-Subject: [PATCH] Air Monitor support in hostapd by vendor NL
+Subject: [PATCH 27/29] hostapd: mtk: Air Monitor support in hostapd by vendor
+ NL
 
 Signed-off-by: mtk23888 <dipanshu.mittal@mediatek.com>
 ---
@@ -17,10 +18,10 @@
  9 files changed, 352 insertions(+)
 
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index f338d0f..7f91cb6 100644
+index b0323e7..056583c 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
-@@ -3765,6 +3765,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
+@@ -3766,6 +3766,44 @@ hostapd_ctrl_iface_ap_wireless(struct hostapd_data *hapd, char *cmd,
  
  	if (hostapd_drv_ap_wireless(hapd, (u8) sub_cmd, atoi(value)) != 0)
  		return -1;
@@ -65,7 +66,7 @@
  
  	return os_snprintf(buf, buflen, "OK\n");
  }
-@@ -3818,6 +3856,75 @@ exit:
+@@ -3819,6 +3857,75 @@ exit:
  	return os_snprintf(buf, buflen, "OK\n");
  }
  
@@ -141,7 +142,7 @@
  static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  					      char *buf, char *reply,
  					      int reply_size,
-@@ -4392,6 +4499,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+@@ -4393,6 +4500,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
  		reply_len = hostapd_ctrl_iface_ap_wireless(hapd, buf + 12, reply, reply_size);
  	} else if (os_strncmp(buf, "ap_rfeatures ", 13) == 0) {
  		reply_len = hostapd_ctrl_iface_ap_rfeatures(hapd, buf + 13, reply, reply_size);
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
similarity index 84%
rename from recipes-wifi/wpa-supplicant/files/patches/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch
rename to recipes-wifi/wpa-supplicant/files/patches/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
index 5775bb7..05f6dc8 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch
@@ -1,7 +1,7 @@
-From ab881e5e91f15eac1b7a33bd6eb7a9882d911ae4 Mon Sep 17 00:00:00 2001
+From 38a7f0f985e33f24f0da234966f560e7136868cf Mon Sep 17 00:00:00 2001
 From: Michael Lee <michael-cy.lee@mediatek.com>
 Date: Wed, 19 Apr 2023 17:18:33 +0800
-Subject: [PATCH] hostapd: mtk: Fix scan result updating issue
+Subject: [PATCH 28/29] hostapd: mtk: Fix scan result updating issue
 
 There are no HT capability and operation in beacon of AP operating in
 NOHT.
@@ -12,7 +12,7 @@
  1 file changed, 4 insertions(+)
 
 diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
-index 01ddb13..d765f32 100644
+index 01ddb13..4e711cf 100644
 --- a/wpa_supplicant/bss.c
 +++ b/wpa_supplicant/bss.c
 @@ -306,8 +306,12 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
@@ -29,5 +29,5 @@
  	calculate_update_time(fetch_time, src->age, &dst->last_update);
  }
 -- 
-2.25.1
+2.18.0
 
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
new file mode 100644
index 0000000..c2ef3f7
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch
@@ -0,0 +1,28 @@
+From 1814fca214ecf2a876734af789906e2316172ba8 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Thu, 30 Mar 2023 17:03:03 +0800
+Subject: [PATCH 29/29] hostapd: mtk: Fix setting wrong seg0 index for 5G
+ center chan 159 BW40
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/ap/ap_config.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
+index 51476b8..ae22a2f 100644
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -1275,7 +1275,8 @@ hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf,
+ #ifdef CONFIG_IEEE80211BE
+ 	if (conf->ieee80211be)
+ 		conf->eht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
+-	if (center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
++	if (is_6ghz_op_class(conf->op_class) &&
++	    center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
+ 		oper_centr_freq_seg0_idx +=
+ 			conf->channel > oper_centr_freq_seg0_idx ? 16 : -16;
+ #endif /* CONFIG_IEEE80211BE */
+-- 
+2.18.0
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches/patches.inc b/recipes-wifi/wpa-supplicant/files/patches/patches.inc
index addbce2..523fc4d 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/patches.inc
+++ b/recipes-wifi/wpa-supplicant/files/patches/patches.inc
@@ -88,6 +88,7 @@
     file://mtk-0024-hostapd-mtk-Add-support-for-masking-EHT-capabilities.patch \
     file://mtk-0025-hostapd-mtk-Fix-ZWDFS-issue-in-BW-160.patch \
     file://mtk-0026-hostapd-mtk-Add-vendor-for-CAPI-certification-comman.patch \
-    file://mtk-0027-hostapd-mtk-Add-support-for-air-monitor-from-vendor-NL.patch \
-    file://mtk-0027-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+    file://mtk-0027-hostapd-mtk-Air-Monitor-support-in-hostapd-by-vendor.patch \
+    file://mtk-0028-hostapd-mtk-Fix-scan-result-updating-issue.patch \
+    file://mtk-0029-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
     "