[][MAC80211][WiFi7][misc][fix mt7988-mt7996-mac980211 release build fail]
[Description]
Fix mt7988-mt7996-mac980211 release build fail
[Release-log]
N/A
Change-Id: I4e247202ad308ed70e7ed59f8a21d62fddfbac9f
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8041650
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1001-hostapd-mtk-update-eht-operation-element.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1001-hostapd-mtk-update-eht-operation-element.patch
index e2c6d87..5092a61 100644
--- a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1001-hostapd-mtk-update-eht-operation-element.patch
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1001-hostapd-mtk-update-eht-operation-element.patch
@@ -1,7 +1,7 @@
-From 3b4b9812c97b0b75579829c96a19e8a8cc0bfa7b Mon Sep 17 00:00:00 2001
+From eaf03e5841437d268c929bd8215d8499fbdbfbb0 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Wed, 10 May 2023 13:11:34 +0800
-Subject: [PATCH 1001/1004] hostapd: mtk: update eht operation element
+Subject: [PATCH 1001/1005] hostapd: mtk: update eht operation element
---
src/ap/ieee802_11_eht.c | 6 +++---
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1002-hostapd-mtk-ucode-add-support-for-ucode-to-parse-BW3.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1002-hostapd-mtk-ucode-add-support-for-ucode-to-parse-BW3.patch
index 1b51a28..9c23287 100644
--- a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1002-hostapd-mtk-ucode-add-support-for-ucode-to-parse-BW3.patch
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1002-hostapd-mtk-ucode-add-support-for-ucode-to-parse-BW3.patch
@@ -1,7 +1,7 @@
-From 5ed678c7562b1acf04f1b6c63ab25a5f3043325f Mon Sep 17 00:00:00 2001
+From 5d04c65f6a625dea4b8ff7cfa35311dbfa2e4ae7 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Wed, 30 Aug 2023 04:23:37 +0800
-Subject: [PATCH 1002/1004] hostapd: mtk: ucode: add support for ucode to parse
+Subject: [PATCH 1002/1005] hostapd: mtk: ucode: add support for ucode to parse
BW320MHz info
---
@@ -9,7 +9,7 @@
1 file changed, 4 insertions(+)
diff --git a/src/utils/ucode.c b/src/utils/ucode.c
-index 896ef46..4448738 100644
+index 2beeb9a..122c619 100644
--- a/src/utils/ucode.c
+++ b/src/utils/ucode.c
@@ -85,6 +85,10 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1003-hostapd-mtk-synchronize-bandwidth-in-AP-STA-support.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1003-hostapd-mtk-synchronize-bandwidth-in-AP-STA-support.patch
index 74c685b..c6c6f80 100644
--- a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1003-hostapd-mtk-synchronize-bandwidth-in-AP-STA-support.patch
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1003-hostapd-mtk-synchronize-bandwidth-in-AP-STA-support.patch
@@ -1,61 +1,277 @@
-From 25b1c0f5e4f674ea2b72949bce83c05204d19653 Mon Sep 17 00:00:00 2001
+From 6219efda5b74baf62086236cc7f368f4307b9869 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
-Date: Thu, 24 Aug 2023 16:44:30 +0800
+Date: Mon, 11 Sep 2023 10:16:35 +0800
Subject: [PATCH] hostapd: mtk: synchronize bandwidth in AP/STA support
Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
---
- src/utils/ucode.c | 1 +
- wpa_supplicant/ucode.c | 10 ++++++++++
- 2 files changed, 11 insertions(+)
+ src/ap/ucode.c | 39 ++++++++++++++++++--
+ src/utils/ucode.c | 12 +++++--
+ wpa_supplicant/ucode.c | 82 ++++++++++++++++++++++++++++++++++--------
+ 3 files changed, 115 insertions(+), 18 deletions(-)
+diff --git a/src/ap/ucode.c b/src/ap/ucode.c
+index 7bc797a..a3716ea 100644
+--- a/src/ap/ucode.c
++++ b/src/ap/ucode.c
+@@ -382,6 +382,9 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs)
+ struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
+ int i;
+
++ wpa_printf(MSG_INFO, "ucode: mtk: stop iface for %s in state %s\n",
++ iface->phy, hostapd_state_text(iface->state));
++
+ switch (iface->state) {
+ case HAPD_IFACE_ENABLED:
+ case HAPD_IFACE_DISABLED:
+@@ -420,6 +423,7 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
+ uint64_t intval;
+ int i;
+
++ wpa_printf(MSG_INFO, "ucode: mtk: start iface for %s\n", iface->phy);
+ if (!iface)
+ return NULL;
+
+@@ -442,7 +446,13 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
+ UPDATE_VAL(op_class, "op_class");
+ UPDATE_VAL(hw_mode, "hw_mode");
+ UPDATE_VAL(channel, "channel");
+- UPDATE_VAL(secondary_channel, "sec_channel");
++
++ intval = ucv_int64_get(ucv_object_get(info, "sec_channel", NULL));
++ if (!errno) {
++ conf->secondary_channel = intval;
++ changed = true;
++ }
++
+ if (!changed &&
+ (iface->bss[0]->beacon_set_done ||
+ iface->state == HAPD_IFACE_DFS))
+@@ -490,6 +500,18 @@ out:
+ return ucv_boolean_new(true);
+ }
+
++ wpa_printf(MSG_INFO, "ucode: mtk: updated channel information:\n");
++ wpa_printf(MSG_INFO, " * channel: %d\n", conf->channel);
++ wpa_printf(MSG_INFO, " * op_class: %d\n", conf->op_class);
++ wpa_printf(MSG_INFO, " * secondary channel: %d\n",
++ conf->secondary_channel);
++ wpa_printf(MSG_INFO, " * seg0: %d\n",
++ hostapd_get_oper_centr_freq_seg0_idx(conf));
++ wpa_printf(MSG_INFO, " * seg1: %d\n",
++ hostapd_get_oper_centr_freq_seg0_idx(conf));
++ wpa_printf(MSG_INFO, " * oper_chwidth: %d\n",
++ hostapd_get_oper_chwidth(conf));
++
+ for (i = 0; i < iface->num_bss; i++) {
+ struct hostapd_data *hapd = iface->bss[i];
+ int ret;
+@@ -524,6 +546,7 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ uint64_t intval;
+ int i, ret = 0;
+
++ wpa_printf(MSG_INFO, "ucode: mtk: channel switch for %s\n", iface->phy);
+ if (!iface || ucv_type(info) != UC_OBJECT)
+ return NULL;
+
+@@ -543,7 +566,8 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ if (errno)
+ intval = hostapd_get_oper_chwidth(conf);
+ if (intval)
+- csa.freq_params.bandwidth = 40 << intval;
++ csa.freq_params.bandwidth = 40 <<
++ (intval == CONF_OPER_CHWIDTH_320MHZ ? 3 : intval);
+ else
+ csa.freq_params.bandwidth = csa.freq_params.sec_channel_offset ? 40 : 20;
+
+@@ -554,6 +578,17 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs)
+ if ((intval = ucv_int64_get(ucv_object_get(info, "center_freq2", NULL))) && !errno)
+ csa.freq_params.center_freq2 = intval;
+
++ wpa_printf(MSG_INFO, "ucode: mtk: switch channel information:\n");
++ wpa_printf(MSG_INFO, " * freq is %d\n", csa.freq_params.freq);
++ wpa_printf(MSG_INFO, " * bandwidth is %d\n",
++ csa.freq_params.bandwidth);
++ wpa_printf(MSG_INFO, " * sec_chan_offset is %d\n",
++ csa.freq_params.sec_channel_offset);
++ wpa_printf(MSG_INFO, " * center_freq1 is %d\n",
++ csa.freq_params.center_freq1);
++ wpa_printf(MSG_INFO, " * center_freq2 is %d\n",
++ csa.freq_params.center_freq2);
++
+ for (i = 0; i < iface->num_bss; i++)
+ ret = hostapd_switch_channel(iface->bss[i], &csa);
+
diff --git a/src/utils/ucode.c b/src/utils/ucode.c
-index 44169f0..41c19fb 100644
+index 122c619..0990e7b 100644
--- a/src/utils/ucode.c
+++ b/src/utils/ucode.c
-@@ -115,6 +115,7 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
+@@ -51,6 +51,7 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
+ uc_value_t *freq = uc_fn_arg(0);
+ uc_value_t *sec = uc_fn_arg(1);
+ int width = ucv_uint64_get(uc_fn_arg(2));
++ int bw320_offset = 1;
+ int freq_val, center_idx, center_ofs;
+ enum oper_chan_width chanwidth;
+ enum hostapd_hw_mode hw_mode;
+@@ -88,6 +89,9 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
+ case 9:
+ width = 3;
+ chanwidth = CONF_OPER_CHWIDTH_320MHZ;
++
++ /* bw320_offset is 1 for 320 MHz-1, and 2 for 320 MHz-2 */
++ bw320_offset = ucv_uint64_get(uc_fn_arg(3));
+ break;
+ default:
+ return NULL;
+@@ -119,12 +123,16 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs)
ucv_object_add(ret, "hw_mode_str", ucv_get(ucv_string_new(modestr)));
ucv_object_add(ret, "sec_channel", ucv_int64_new(sec_channel));
ucv_object_add(ret, "frequency", ucv_int64_new(freq_val));
+ ucv_object_add(ret, "oper_chwidth", ucv_int64_new(chanwidth));
- if (!sec_channel)
+- if (!sec_channel)
++ if (chanwidth == CONF_OPER_CHWIDTH_USE_HT && !sec_channel) {
++ ucv_object_add(ret, "center_seg0_idx", ucv_int64_new(channel));
++ ucv_object_add(ret, "center_freq1", ucv_int64_new(freq_val));
return ret;
++ }
+
+ if (freq_val >= 5900)
+- center_ofs = 0;
++ center_ofs = 32 * (1 - bw320_offset);
+ else if (freq_val >= 5745)
+ center_ofs = 20;
+ else
diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c
-index d0a78d1..dbf57fa 100644
+index 55d2258..d8a19b8 100644
--- a/wpa_supplicant/ucode.c
+++ b/wpa_supplicant/ucode.c
-@@ -6,6 +6,7 @@
+@@ -7,6 +7,8 @@
#include "wps_supplicant.h"
#include "bss.h"
#include "ucode.h"
+#include "driver_i.h"
++#include "common/ieee802_11_common.h"
static struct wpa_global *wpa_global;
static uc_resource_type_t *global_type, *iface_type;
-@@ -194,6 +195,9 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+@@ -96,6 +98,8 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+ {
+ const char *state;
+ uc_value_t *val;
++ enum oper_chan_width ch_width;
++ int center_freq1, bw320_offset = 1;
+
+ if (event != EVENT_CH_SWITCH_STARTED)
+ return;
+@@ -114,11 +118,42 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d
+ uc_value_push(ucv_get(val));
+
+ if (event == EVENT_CH_SWITCH_STARTED) {
++ center_freq1 = data->ch_switch.cf1;
++
++ switch (data->ch_switch.ch_width) {
++ case CHAN_WIDTH_80:
++ ch_width = CONF_OPER_CHWIDTH_80MHZ;
++ break;
++ case CHAN_WIDTH_80P80:
++ ch_width = CONF_OPER_CHWIDTH_80P80MHZ;
++ break;
++ case CHAN_WIDTH_160:
++ ch_width = CONF_OPER_CHWIDTH_160MHZ;
++ break;
++ case CHAN_WIDTH_320:
++ ch_width = CONF_OPER_CHWIDTH_320MHZ;
++ break;
++ case CHAN_WIDTH_20_NOHT:
++ case CHAN_WIDTH_20:
++ case CHAN_WIDTH_40:
++ default:
++ ch_width = CONF_OPER_CHWIDTH_USE_HT;
++ break;
++ }
++
++ /* Check bandwidth 320 MHz-2 */
++ if (ch_width == CONF_OPER_CHWIDTH_320MHZ &&
++ (center_freq1 == 6265) || center_freq1 == 6585 ||
++ center_freq1 == 6905)
++ bw320_offset = 2;
++
+ ucv_object_add(val, "csa_count", ucv_int64_new(data->ch_switch.count));
+ ucv_object_add(val, "frequency", ucv_int64_new(data->ch_switch.freq));
+ ucv_object_add(val, "sec_chan_offset", ucv_int64_new(data->ch_switch.ch_offset));
+- ucv_object_add(val, "center_freq1", ucv_int64_new(data->ch_switch.cf1));
++ ucv_object_add(val, "center_freq1", ucv_int64_new(center_freq1));
+ ucv_object_add(val, "center_freq2", ucv_int64_new(data->ch_switch.cf2));
++ ucv_object_add(val, "ch_width", ucv_int64_new(ch_width));
++ ucv_object_add(val, "bw320_offset", ucv_int64_new(bw320_offset));
+ }
+
+ ucv_put(wpa_ucode_call(4));
+@@ -195,6 +230,11 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
struct wpa_supplicant *wpa_s = uc_fn_thisval("wpas.iface");
struct wpa_bss *bss;
uc_value_t *ret, *val;
+ struct wpa_channel_info ci;
+ u8 op_class, channel;
+ enum oper_chan_width ch_width;
++ int center_freq1, bw320_offset = 1, is_24ghz;
++ enum hostapd_hw_mode hw_mode;
if (!wpa_s)
return NULL;
-@@ -222,6 +226,12 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
-
- ucv_object_add(ret, "sec_chan_offset", ucv_int64_new(sec_chan));
- ucv_object_add(ret, "frequency", ucv_int64_new(bss->freq));
+@@ -207,23 +247,37 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
+ bss = wpa_s->current_bss;
+ if (bss) {
+ int sec_chan = 0;
+- const u8 *ie;
+-
+- ie = wpa_bss_get_ie(bss, WLAN_EID_HT_OPERATION);
+- if (ie && ie[1] >= 2) {
+- const struct ieee80211_ht_operation *ht_oper;
+- int sec;
+-
+- ht_oper = (const void *) (ie + 2);
+- sec = ht_oper->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK;
+- if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE)
+- sec_chan = 1;
+- else if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW)
+- sec_chan = -1;
++
++ hw_mode = ieee80211_freq_to_chan(bss->freq, &channel);
++ is_24ghz = hw_mode == HOSTAPD_MODE_IEEE80211G ||
++ hw_mode == HOSTAPD_MODE_IEEE80211B;
+
+ wpa_drv_channel_info(wpa_s, &ci);
-+ ieee80211_chaninfo_to_channel(ci.frequency, ci.chanwidth,
-+ sec_chan, &op_class, &channel);
++ center_freq1 = ci.center_frq1;
++
++ if (bss->freq != center_freq1) {
++ if (is_24ghz)
++ sec_chan = (bss->freq < center_freq1) ? 1 : -1;
++ else
++ sec_chan = (bss->freq / 20) & 1 ? 1 : -1;
++ }
++
++ if (ieee80211_chaninfo_to_channel(ci.frequency, ci.chanwidth,
++ sec_chan, &op_class, &channel))
++ return NULL;
++
+ ch_width = op_class_to_ch_width(op_class);
++ if (ch_width == CONF_OPER_CHWIDTH_320MHZ &&
++ (center_freq1 == 6265) || center_freq1 == 6585 ||
++ center_freq1 == 6905) {
++ /* Bandwidth 320 MHz-2 */
++ bw320_offset = 2;
+ }
+
+ ucv_object_add(ret, "sec_chan_offset", ucv_int64_new(sec_chan));
+ ucv_object_add(ret, "frequency", ucv_int64_new(bss->freq));
+ ucv_object_add(ret, "ch_width", ucv_int64_new(ch_width));
++ ucv_object_add(ret, "bw320_offset", ucv_int64_new(bw320_offset));
}
- return ret;
+ #ifdef CONFIG_MESH
--
2.25.1
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1004-hostapd-mtk-Add-support-for-updating-background-chan.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1004-hostapd-mtk-Add-support-for-updating-background-chan.patch
new file mode 100644
index 0000000..23aa563
--- /dev/null
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1004-hostapd-mtk-Add-support-for-updating-background-chan.patch
@@ -0,0 +1,339 @@
+From 00555b91d4d25c64eb556fe1b8815e522970b130 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Wed, 5 Jul 2023 10:25:01 +0800
+Subject: [PATCH 1004/1005] hostapd: mtk: Add support for updating background
+ channel by driver
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ src/ap/dfs.c | 107 ++++++++++++++++++++++++++++-
+ src/ap/dfs.h | 3 +
+ src/ap/drv_callbacks.c | 22 ++++++
+ src/ap/hostapd.h | 5 ++
+ src/drivers/driver.h | 12 ++++
+ src/drivers/driver_nl80211_event.c | 6 ++
+ src/drivers/nl80211_copy.h | 6 ++
+ 7 files changed, 160 insertions(+), 1 deletion(-)
+
+diff --git a/src/ap/dfs.c b/src/ap/dfs.c
+index 95119a3..008596b 100644
+--- a/src/ap/dfs.c
++++ b/src/ap/dfs.c
+@@ -814,11 +814,14 @@ static int dfs_are_channels_overlapped(struct hostapd_iface *iface, int freq,
+
+ static void dfs_check_background_overlapped(struct hostapd_iface *iface)
+ {
+- int width = hostapd_get_oper_chwidth(iface->conf);
++ int width = iface->radar_background.new_chwidth;
+
+ if (!dfs_use_radar_background(iface))
+ return;
+
++ if (!width)
++ width = hostapd_get_oper_chwidth(iface->conf);
++
+ if (dfs_are_channels_overlapped(iface, iface->radar_background.freq,
+ width, iface->radar_background.centr_freq_seg0_idx,
+ iface->radar_background.centr_freq_seg1_idx))
+@@ -983,6 +986,15 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+ iface->radar_background.temp_ch = 1;
+ return 1;
+ } else if (dfs_use_radar_background(iface)) {
++ /*
++ * AP is going to perform CAC, so reset temp_ch to 0,
++ * when dedicated rx has already started CAC.
++ */
++ if (iface->radar_background.cac_started) {
++ iface->radar_background.temp_ch = 0;
++ return 0;
++ }
++
+ if (iface->dfs_domain == HOSTAPD_DFS_REGION_ETSI)
+ channel_type = DFS_ANY_CHANNEL;
+
+@@ -1116,6 +1128,8 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
+ * ch_switch_notify event is received */
+ wpa_printf(MSG_DEBUG, "DFS waiting channel switch event");
+
++ hostapd_set_oper_chwidth(iface->conf, new_vht_oper_chwidth);
++
+ return 0;
+ }
+
+@@ -1167,6 +1181,9 @@ static void hostpad_dfs_update_background_chain(struct hostapd_iface *iface)
+ iface->radar_background.secondary_channel = sec;
+ iface->radar_background.centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
+ iface->radar_background.centr_freq_seg1_idx = oper_centr_freq_seg1_idx;
++ /* if main channel do not require dfs, then set temp_ch = 1 */
++ if (!hostapd_is_dfs_required(iface))
++ iface->radar_background.temp_ch = 1;
+
+ wpa_printf(MSG_DEBUG,
+ "%s: setting background chain to chan %d (%d MHz)",
+@@ -1189,6 +1206,10 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
+ u8 current_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf);
+ int ret;
+
++ if (iface->radar_background.new_chwidth) {
++ hostapd_set_oper_chwidth(iface->conf, iface->radar_background.new_chwidth);
++ iface->radar_background.new_chwidth = 0;
++ }
+ ret = hostapd_dfs_request_channel_switch(iface, iface->radar_background.channel,
+ iface->radar_background.freq,
+ iface->radar_background.secondary_channel,
+@@ -1211,6 +1232,52 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
+ }
+
+
++static void
++hostapd_dfs_background_expand(struct hostapd_iface *iface, int chan_width)
++{
++ struct hostapd_hw_modes *mode = iface->current_mode;
++ struct hostapd_channel_data *chan;
++ int i, channel, width = channel_width_to_int(chan_width);
++
++ if (iface->conf->channel - iface->radar_background.channel == width / 5)
++ channel = iface->radar_background.channel;
++ else if (iface->radar_background.channel - iface->conf->channel == width / 5)
++ channel = iface->conf->channel;
++ else
++ return;
++
++ for (i = 0; i < mode->num_channels; i++) {
++ chan = &mode->channels[i];
++ if (chan->chan == channel)
++ break;
++ }
++
++ if (i == mode->num_channels || !dfs_is_chan_allowed(chan, width / 10))
++ return;
++
++ switch (chan_width) {
++ case CHAN_WIDTH_20_NOHT:
++ case CHAN_WIDTH_20:
++ iface->radar_background.new_chwidth = CONF_OPER_CHWIDTH_USE_HT;
++ break;
++ case CHAN_WIDTH_40:
++ iface->radar_background.new_chwidth = CONF_OPER_CHWIDTH_80MHZ;
++ break;
++ case CHAN_WIDTH_80:
++ iface->radar_background.new_chwidth = CONF_OPER_CHWIDTH_160MHZ;
++ break;
++ default:
++ return;
++ }
++
++ iface->radar_background.freq = channel * 5 + 5000;
++ iface->radar_background.channel = channel;
++ iface->radar_background.centr_freq_seg0_idx = channel + width / 5 - 2;
++ iface->radar_background.secondary_channel = 1;
++ iface->radar_background.expand_ch = 0;
++}
++
++
+ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+ int ht_enabled, int chan_offset, int chan_width,
+ int cf1, int cf2)
+@@ -1244,6 +1311,10 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+ return 0;
+
+ iface->radar_background.temp_ch = 0;
++
++ if (iface->radar_background.expand_ch)
++ hostapd_dfs_background_expand(iface, chan_width);
++
+ return hostapd_dfs_start_channel_switch_background(iface);
+ }
+
+@@ -1274,6 +1345,8 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+ }
+ } else if (hostapd_dfs_is_background_event(iface, freq)) {
+ iface->radar_background.cac_started = 0;
++ iface->radar_background.temp_ch = 0;
++ iface->radar_background.expand_ch = 0;
+ hostpad_dfs_update_background_chain(iface);
+ }
+
+@@ -1406,6 +1479,9 @@ hostapd_dfs_background_start_channel_switch(struct hostapd_iface *iface,
+ iface->conf->dfs_detect_mode == DFS_DETECT_MODE_ALL_ENABLE)
+ return 0;
+
++ iface->radar_background.temp_ch = 0;
++ iface->radar_background.expand_ch = 0;
++
+ /* Check if CSA in progress */
+ if (hostapd_csa_in_progress(iface))
+ return 0;
+@@ -1640,6 +1716,35 @@ int hostapd_is_dfs_required(struct hostapd_iface *iface)
+ }
+
+
++int hostapd_dfs_background_chan_update(struct hostapd_iface *iface, int freq,
++ int ht_enabled, int chan_offset, int chan_width,
++ int cf1, int cf2, bool expand)
++{
++ switch (chan_width) {
++ case CHAN_WIDTH_80:
++ iface->radar_background.new_chwidth = CONF_OPER_CHWIDTH_80MHZ;
++ break;
++ case CHAN_WIDTH_160:
++ iface->radar_background.new_chwidth = CONF_OPER_CHWIDTH_160MHZ;
++ break;
++ default:
++ iface->radar_background.new_chwidth = CONF_OPER_CHWIDTH_USE_HT;
++ break;
++ };
++
++ iface->radar_background.freq = freq;
++ iface->radar_background.channel = (freq - 5000) / 5;
++ iface->radar_background.centr_freq_seg0_idx = (cf1 - 5000) / 5;
++ iface->radar_background.centr_freq_seg1_idx = cf2 ? (cf2 - 5000) / 5 : 0;
++ if (expand) {
++ iface->radar_background.temp_ch = 1;
++ iface->radar_background.expand_ch = 1;
++ }
++
++ return 0;
++}
++
++
+ int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
+ int ht_enabled, int chan_offset, int chan_width,
+ int cf1, int cf2)
+diff --git a/src/ap/dfs.h b/src/ap/dfs.h
+index 25ba29c..a1a2be5 100644
+--- a/src/ap/dfs.h
++++ b/src/ap/dfs.h
+@@ -30,6 +30,9 @@ int hostapd_dfs_radar_detected(struct hostapd_iface *iface, int freq,
+ int hostapd_dfs_nop_finished(struct hostapd_iface *iface, int freq,
+ int ht_enabled,
+ int chan_offset, int chan_width, int cf1, int cf2);
++int hostapd_dfs_background_chan_update(struct hostapd_iface *iface, int freq,
++ int ht_enabled, int chan_offset, int chan_width,
++ int cf1, int cf2, bool expand);
+ int hostapd_dfs_sta_update_state(struct hostapd_iface *iface, int freq,
+ int ht_enabled, int chan_offset, int chan_width,
+ int cf1, int cf2, u32 state);
+diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
+index f749b33..12419c6 100644
+--- a/src/ap/drv_callbacks.c
++++ b/src/ap/drv_callbacks.c
+@@ -2089,6 +2089,18 @@ static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
+ radar->cf1, radar->cf2);
+ }
+
++
++static void hostapd_event_dfs_background_chan_update(struct hostapd_data *hapd,
++ struct dfs_event *radar, bool expand)
++{
++ wpa_printf(MSG_DEBUG, "DFS background channel %s to %d MHz",
++ expand ? "expand" : "update", radar->freq);
++ hostapd_dfs_background_chan_update(hapd->iface, radar->freq, radar->ht_enabled,
++ radar->chan_offset, radar->chan_width,
++ radar->cf1, radar->cf2, expand);
++}
++
++
+ static void hostapd_event_dfs_sta_cac_skipped(struct hostapd_data *hapd,
+ struct dfs_event *radar)
+ {
+@@ -2428,6 +2440,16 @@ void hostapd_wpa_event(void *ctx, enum wpa_event_type event,
+ break;
+ hostapd_event_dfs_nop_finished(hapd, &data->dfs_event);
+ break;
++ case EVENT_DFS_BACKGROUND_CHAN_UPDATE:
++ if (!data)
++ break;
++ hostapd_event_dfs_background_chan_update(hapd, &data->dfs_event, false);
++ break;
++ case EVENT_DFS_BACKGROUND_CHAN_EXPAND:
++ if (!data)
++ break;
++ hostapd_event_dfs_background_chan_update(hapd, &data->dfs_event, true);
++ break;
+ case EVENT_DFS_STA_CAC_SKIPPED:
+ if (!data)
+ break;
+diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
+index 1849f38..ea8d725 100644
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -602,6 +602,11 @@ struct hostapd_iface {
+ unsigned int temp_ch:1;
+ /* CAC started on radar offchain */
+ unsigned int cac_started:1;
++ /* Main chain should expand its width according to the
++ * current offchain channel after CAC detection on radar offchain.
++ */
++ unsigned int expand_ch:1;
++ int new_chwidth;
+ } radar_background;
+
+ u16 hw_flags;
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index ebc1d27..a9f48a1 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -5842,6 +5842,18 @@ enum wpa_event_type {
+ * The channel in the notification is now marked as usable.
+ */
+ EVENT_DFS_STA_CAC_EXPIRED,
++
++ /**
++ * EVENT_DFS_BACKGROUND_CHAN_UPDATE - Notification that background
++ * channel has been updated.
++ */
++ EVENT_DFS_BACKGROUND_CHAN_UPDATE,
++
++ /**
++ * EVENT_DFS_BACKGROUND_CHAN_EXPAND - Notification that background
++ * channel has been updated and operating channel should expand its width.
++ */
++ EVENT_DFS_BACKGROUND_CHAN_EXPAND,
+ };
+
+
+diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
+index 63d4401..c1a65eb 100644
+--- a/src/drivers/driver_nl80211_event.c
++++ b/src/drivers/driver_nl80211_event.c
+@@ -2514,6 +2514,12 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
+ case NL80211_RADAR_CAC_STARTED:
+ wpa_supplicant_event(drv->ctx, EVENT_DFS_CAC_STARTED, &data);
+ break;
++ case NL80211_RADAR_BACKGROUND_CHAN_UPDATE:
++ wpa_supplicant_event(drv->ctx, EVENT_DFS_BACKGROUND_CHAN_UPDATE, &data);
++ break;
++ case NL80211_RADAR_BACKGROUND_CHAN_EXPAND:
++ wpa_supplicant_event(drv->ctx, EVENT_DFS_BACKGROUND_CHAN_EXPAND, &data);
++ break;
+ case NL80211_RADAR_STA_CAC_SKIPPED:
+ wpa_supplicant_event(drv->ctx, EVENT_DFS_STA_CAC_SKIPPED, &data);
+ break;
+diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
+index 225864b..9b0a817 100644
+--- a/src/drivers/nl80211_copy.h
++++ b/src/drivers/nl80211_copy.h
+@@ -6643,6 +6643,10 @@ enum nl80211_smps_mode {
+ * applicable for ETSI dfs domain where pre-CAC is valid for ever.
+ * @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started,
+ * should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled.
++ * @NL80211_RADAR_BACKGROUND_CHAN_UPDATE: background channel is updated by the
++ * driver.
++ * @NL80211_RADAR_BACKGROUND_CHAN_EXPAND: background channel is updated by the
++ * driver and required to expand main operating channel.
+ * @NL80211_RADAR_STA_CAC_SKIPPED: STA set the DFS state to available
+ * when receiving CSA/assoc resp
+ * @NL80211_RADAR_STA_CAC_EXPIRED: STA set the DFS state to usable
+@@ -6655,6 +6659,8 @@ enum nl80211_radar_event {
+ NL80211_RADAR_NOP_FINISHED,
+ NL80211_RADAR_PRE_CAC_EXPIRED,
+ NL80211_RADAR_CAC_STARTED,
++ NL80211_RADAR_BACKGROUND_CHAN_UPDATE,
++ NL80211_RADAR_BACKGROUND_CHAN_EXPAND,
+ NL80211_RADAR_STA_CAC_SKIPPED,
+ NL80211_RADAR_STA_CAC_EXPIRED,
+ };
+--
+2.18.0
+
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1005-hostapd-mtk-add-zwdfs-mode-ctrl-for-eagle-efem-hwits.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1005-hostapd-mtk-add-zwdfs-mode-ctrl-for-eagle-efem-hwits.patch
new file mode 100644
index 0000000..fcfd0bf
--- /dev/null
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd/patches/mtk-1005-hostapd-mtk-add-zwdfs-mode-ctrl-for-eagle-efem-hwits.patch
@@ -0,0 +1,278 @@
+From 5bcd4472062750b192c98d944b74e07b14ab3af5 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Wed, 2 Aug 2023 19:00:34 +0800
+Subject: [PATCH 1005/1005] hostapd: mtk: add zwdfs mode ctrl for eagle efem
+ hwits
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ hostapd/config_file.c | 2 ++
+ hostapd/ctrl_iface.c | 30 +++++++++++++++++++++++++++
+ src/ap/ap_config.h | 6 ++++++
+ src/ap/ap_drv_ops.c | 14 +++++++++++++
+ src/ap/dfs.c | 6 ++++++
+ src/common/mtk_vendor.h | 12 +++++++++++
+ src/drivers/driver.h | 7 +++++++
+ src/drivers/driver_nl80211.c | 34 +++++++++++++++++++++++++++++++
+ src/drivers/driver_nl80211.h | 1 +
+ src/drivers/driver_nl80211_capa.c | 3 +++
+ 10 files changed, 115 insertions(+)
+
+diff --git a/hostapd/config_file.c b/hostapd/config_file.c
+index 9e3dbb2..a751993 100644
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -3183,6 +3183,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
+ conf->acs_exclude_6ghz_non_psc = atoi(pos);
+ } else if (os_strcmp(buf, "enable_background_radar") == 0) {
+ conf->enable_background_radar = atoi(pos);
++ } else if (os_strcmp(buf, "background_radar_mode") == 0) {
++ conf->background_radar_mode = atoi(pos);
+ } else if (os_strcmp(buf, "min_tx_power") == 0) {
+ int val = atoi(pos);
+
+diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
+index c288352..517ebd6 100644
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
+@@ -4156,6 +4156,33 @@ hostapd_ctrl_iface_dump_amnt(struct hostapd_data *hapd, char *cmd,
+ return pos - buf;
+ }
+
++static int
++hostapd_ctrl_iface_set_background_radar_mode(struct hostapd_data *hapd, char *cmd,
++ char *buf, size_t buflen)
++{
++ struct hostapd_iface *iface = hapd->iface;
++ char *pos, *param;
++
++ param = os_strchr(cmd, ' ');
++ if (!param)
++ return -1;
++ *param++ = '\0';
++
++ pos = os_strstr(param, "mode=");
++ if (!pos)
++ return -1;
++
++ if (os_strncmp(pos + 5, "cert", 4) == 0)
++ iface->conf->background_radar_mode = BACKGROUND_RADAR_CERT_MODE;
++ else if (os_strncmp(pos + 5, "normal", 6) == 0)
++ iface->conf->background_radar_mode = BACKGROUND_RADAR_NORMAL_MODE;
++
++ if (hostapd_drv_background_radar_mode(hapd) < 0)
++ return -1;
++
++ return os_snprintf(buf, buflen, "OK\n");
++}
++
+ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+ char *buf, char *reply,
+ int reply_size,
+@@ -4750,6 +4777,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
+ if (pos)
+ *pos = ' ';
+ reply_len = hostapd_ctrl_iface_set_mu(hapd, buf + 23, reply, reply_size);
++ } else if (os_strncmp(buf, "SET_BACKGROUND_RADAR_MODE", 25) == 0) {
++ reply_len = hostapd_ctrl_iface_set_background_radar_mode(hapd, buf + 25,
++ reply, reply_size);
+ } else {
+ os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
+ reply_len = 16;
+diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
+index 7c0d12a..b6f05e7 100644
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -1025,6 +1025,7 @@ struct hostapd_config {
+ bool hw_mode_set;
+ int acs_exclude_6ghz_non_psc;
+ int enable_background_radar;
++ int background_radar_mode;
+ enum {
+ LONG_PREAMBLE = 0,
+ SHORT_PREAMBLE = 1
+@@ -1218,6 +1219,11 @@ enum three_wire_mode {
+ NUM_THREE_WIRE_MODE - 1
+ };
+
++enum background_radar_mode {
++ BACKGROUND_RADAR_NORMAL_MODE,
++ BACKGROUND_RADAR_CERT_MODE,
++};
++
+ enum dfs_mode {
+ DFS_DETECT_MODE_DISABLE,
+ DFS_DETECT_MODE_AP_ENABLE,
+diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
+index 721bfa0..5b93ea6 100644
+--- a/src/ap/ap_drv_ops.c
++++ b/src/ap/ap_drv_ops.c
+@@ -1257,3 +1257,17 @@ int hostapd_drv_amnt_dump(struct hostapd_data *hapd, u8 amnt_idx, u8 *amnt_dump_
+ return 0;
+ return hapd->driver->amnt_dump(hapd->drv_priv, amnt_idx, amnt_dump_buf);
+ }
++
++int hostapd_drv_background_radar_mode(struct hostapd_data *hapd)
++{
++ if (!hapd->driver || !hapd->driver->background_radar_mode ||
++ !(hapd->iface->drv_flags2 & WPA_DRIVER_RADAR_BACKGROUND) ||
++ !hapd->iface->conf->enable_background_radar)
++ return 0;
++ if (hapd->iconf->background_radar_mode > BACKGROUND_RADAR_CERT_MODE) {
++ wpa_printf(MSG_INFO, "Invalid value for background radar mode\n");
++ return 0;
++ }
++ return hapd->driver->background_radar_mode(hapd->drv_priv,
++ hapd->iconf->background_radar_mode);
++}
+diff --git a/src/ap/dfs.c b/src/ap/dfs.c
+index 008596b..2564168 100644
+--- a/src/ap/dfs.c
++++ b/src/ap/dfs.c
+@@ -983,6 +983,9 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+ if (res < 0)
+ return res;
+
++ if (hostapd_drv_background_radar_mode(iface->bss[0]) < 0)
++ return -1;
++
+ iface->radar_background.temp_ch = 1;
+ return 1;
+ } else if (dfs_use_radar_background(iface)) {
+@@ -1023,6 +1026,9 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
+ iface->radar_background.secondary_channel = sec;
+ iface->radar_background.centr_freq_seg0_idx = cf1;
+ iface->radar_background.centr_freq_seg1_idx = cf2;
++
++ if (hostapd_drv_background_radar_mode(iface->bss[0]) < 0)
++ return -1;
+ }
+
+ return 0;
+diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
+index e140de6..5bc1e04 100644
+--- a/src/common/mtk_vendor.h
++++ b/src/common/mtk_vendor.h
+@@ -16,6 +16,7 @@ enum mtk_nl80211_vendor_subcmds {
+ MTK_NL80211_VENDOR_SUBCMD_3WIRE_CTRL = 0xc8,
+ MTK_NL80211_VENDOR_SUBCMD_IBF_CTRL = 0xc9,
+ MTK_NL80211_VENDOR_SUBCMD_BSS_COLOR_CTRL = 0xca,
++ MTK_NL80211_VENDOR_SUBCMD_BACKGROUND_RADAR_CTRL = 0xcb,
+ };
+
+ enum mtk_vendor_attr_edcca_ctrl {
+@@ -244,6 +245,17 @@ enum mtk_vendor_attr_bss_color_ctrl {
+ NUM_MTK_VENDOR_ATTRS_BSS_COLOR_CTRL - 1
+ };
+
++enum mtk_vendor_attr_background_radar_ctrl {
++ MTK_VENDOR_ATTR_BACKGROUND_RADAR_CTRL_UNSPEC,
++
++ MTK_VENDOR_ATTR_BACKGROUND_RADAR_CTRL_MODE,
++
++ /* keep last */
++ NUM_MTK_VENDOR_ATTRS_BACKGROUND_RADAR_CTRL,
++ MTK_VENDOR_ATTR_BACKGROUND_RADAR_CTRL_MAX =
++ NUM_MTK_VENDOR_ATTRS_BACKGROUND_RADAR_CTRL - 1
++};
++
+ #define CSI_MAX_COUNT 256
+ #define ETH_ALEN 6
+
+diff --git a/src/drivers/driver.h b/src/drivers/driver.h
+index a9f48a1..bc82d28 100644
+--- a/src/drivers/driver.h
++++ b/src/drivers/driver.h
+@@ -5201,6 +5201,13 @@ struct wpa_driver_ops {
+ * @amnt_dump_buf: Buffer to print
+ */
+ int (*amnt_dump)(void *priv, u8 amnt_idx, u8 *amnt_dump_buf);
++
++ /**
++ * background_radar_mode - set background radar mode
++ * @priv: Private driver interface data
++ * @background_radar_mode: background radar mode
++ */
++ int (*background_radar_mode)(void *priv, u8 background_radar_mode);
+ };
+
+ /**
+diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
+index 25e5910..73401fd 100644
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -14723,6 +14723,39 @@ fail:
+ return -ENOBUFS;
+ }
+
++static int nl80211_background_radar_mode(void *priv, const u8 background_radar_mode)
++{
++ struct i802_bss *bss = priv;
++ struct wpa_driver_nl80211_data *drv = bss->drv;
++ /* Prepare nl80211 cmd */
++ struct nl_msg *msg;
++ struct nlattr *data;
++ int ret;
++
++ if (!drv->mtk_background_radar_vendor_cmd_avail) {
++ wpa_printf(MSG_INFO,
++ "nl80211: Driver does not support setting background radar mode");
++ return 0;
++ }
++
++ if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR)) ||
++ nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_MTK) ||
++ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
++ MTK_NL80211_VENDOR_SUBCMD_BACKGROUND_RADAR_CTRL) ||
++ !(data = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA)) ||
++ nla_put_u8(msg, MTK_VENDOR_ATTR_BACKGROUND_RADAR_CTRL_MODE, background_radar_mode)) {
++ nlmsg_free(msg);
++ return -ENOBUFS;
++ }
++ 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 background radar mode. ret=%d (%s) ",
++ ret, strerror(-ret));
++ }
++ return ret;
++}
++
+ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+ .name = "nl80211",
+ .desc = "Linux nl80211/cfg80211",
+@@ -14895,4 +14928,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
+ .ap_trigtype = nl80211_ap_trigtype,
+ .amnt_set = nl80211_amnt_set,
+ .amnt_dump = nl80211_amnt_dump,
++ .background_radar_mode = nl80211_background_radar_mode,
+ };
+diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
+index 0d85adf..74ee9b1 100644
+--- a/src/drivers/driver_nl80211.h
++++ b/src/drivers/driver_nl80211.h
+@@ -210,6 +210,7 @@ struct wpa_driver_nl80211_data {
+ 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;
++ unsigned int mtk_background_radar_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 8c8b84e..90711b4 100644
+--- a/src/drivers/driver_nl80211_capa.c
++++ b/src/drivers/driver_nl80211_capa.c
+@@ -1133,6 +1133,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
+ case MTK_NL80211_VENDOR_SUBCMD_RFEATURE_CTRL:
+ drv->mtk_rfeatures_vendor_cmd_avail = 1;
+ break;
++ case MTK_NL80211_VENDOR_SUBCMD_BACKGROUND_RADAR_CTRL:
++ drv->mtk_background_radar_vendor_cmd_avail = 1;
++ break;
+ }
+ }
+
+--
+2.18.0
+