[][MAC80211][WiFi6][hostapd][Fix DFS radar trigger issue during first setup CAC]
[Description]
Fix the DFS radar trigger issue during the CAC of the first setup.
For the CAC of the first setup, once radar is detected, it should enter
hostapd_dfs_start_channel_switch_cac for interface re-setup.
However, for DFS channel switch cases (interface is already setup), it should directly perform channel switch via hostapd_dfs_request_channel_switch.
Therefore, only clear the cac_started flag once the interface is already setup.
[Release-log]
N/A
Change-Id: Idfb46cdd7f9c229de1e1f45863a72bc29e7db823
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8636930
diff --git a/autobuild_mac80211_release/package/network/services/hostapd/patches/mtk-0047-hostapd-mtk-add-support-for-channel-switching-to-dfs.patch b/autobuild_mac80211_release/package/network/services/hostapd/patches/mtk-0047-hostapd-mtk-add-support-for-channel-switching-to-dfs.patch
index 82b66f4..4e24ba6 100644
--- a/autobuild_mac80211_release/package/network/services/hostapd/patches/mtk-0047-hostapd-mtk-add-support-for-channel-switching-to-dfs.patch
+++ b/autobuild_mac80211_release/package/network/services/hostapd/patches/mtk-0047-hostapd-mtk-add-support-for-channel-switching-to-dfs.patch
@@ -1,19 +1,19 @@
-From 018d87d5b9b53b3e630032bf2cb7e6eaeae09d71 Mon Sep 17 00:00:00 2001
+From 22adaf9edb6e4e60dbe5c7cc8366c08b8141571f Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Wed, 15 Nov 2023 15:06:00 +0800
-Subject: [PATCH 47/49] hostapd: mtk: add support for channel switching to dfs
- with csa sent
+Subject: [PATCH] hostapd: mtk: add support for channel switching to dfs with
+ csa sent
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
hostapd/ctrl_iface.c | 26 ++------------------------
src/ap/beacon.c | 5 +++++
- src/ap/dfs.c | 16 ++++++++++++----
+ src/ap/dfs.c | 18 ++++++++++++++----
src/ap/ieee802_11.c | 5 +++++
- 4 files changed, 24 insertions(+), 28 deletions(-)
+ 4 files changed, 26 insertions(+), 28 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index b521a08..0afa6a2 100644
+index b0117e5..96b593a 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -2747,7 +2747,6 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
@@ -73,7 +73,7 @@
if (ieee802_11_build_ap_params(hapd, ¶ms) < 0)
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
-index 80d3605..012050c 100644
+index 80d3605..d490032 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -1255,10 +1255,10 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
@@ -90,21 +90,23 @@
/*
* When background radar is enabled but the CAC completion
-@@ -1272,6 +1272,13 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
+@@ -1272,6 +1272,15 @@ 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;
hostpad_dfs_update_background_chain(iface);
+ } else {
+ int i;
+
-+ iface->cac_started = 0;
++ /* If interface is already setup, clear cac_started flag to avoid re-setup */
++ if (iface->state == HAPD_IFACE_ENABLED)
++ iface->cac_started = 0;
+ /* Clear all CSA flags once channel switch to DFS channel fails */
+ for (i = 0; i < iface->num_bss; i++)
+ iface->bss[i]->csa_in_progress = 0;
}
return 0;
-@@ -1646,7 +1653,8 @@ int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
+@@ -1646,7 +1655,8 @@ int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
} else {
/* This is called when the driver indicates that an offloaded
* DFS has started CAC. */