diff mbox series

[v2,4/5] DFS: enable CSA for background radar detection

Message ID 7ce79af5f29e6eba3daf6c5a6aca245da3e0df93.1646594636.git.lorenzo@kernel.org
State Accepted
Headers show
Series introduce background radar detection support | expand

Commit Message

Lorenzo Bianconi March 6, 2022, 7:34 p.m. UTC
Rely on hostapd_dfs_request_channel_switch in order to enable CSA for
background radar detection switching back to selected channel.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 src/ap/dfs.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 049ab3525..b152dc411 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -1077,6 +1077,8 @@  hostapd_dfs_is_background_event(struct hostapd_iface *iface, int freq)
 static int
 hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
 {
+	u8 current_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf);
+
 	iface->conf->channel = iface->radar_background.channel;
 	iface->freq = iface->radar_background.freq;
 	iface->conf->secondary_channel =
@@ -1087,10 +1089,12 @@  hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
 			iface->radar_background.centr_freq_seg1_idx);
 
 	hostpad_dfs_update_background_chain(iface);
-	hostapd_disable_iface(iface);
-	hostapd_enable_iface(iface);
 
-	return 0;
+	return hostapd_dfs_request_channel_switch(iface, iface->conf->channel,
+						  iface->freq, iface->conf->secondary_channel,
+						  current_vht_oper_chwidth,
+						  hostapd_get_oper_centr_freq_seg0_idx(iface->conf),
+						  hostapd_get_oper_centr_freq_seg1_idx(iface->conf));
 }
 
 int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,