[RFC PATCH 5/5] hostapd: DFS for channel switch in repeater mode

Sergey Matyukevich <[email protected]>
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
In repeater mode remote AP may request channel switch to a new channel.
Check if DFS is required for the new channel before proceeding with
normal AP operations. Start CAC procedure if radar detection is
required and channel is not yet marked as available.

Signed-off-by: Sergey Matyukevich <[email protected]>
---
 src/ap/drv_callbacks.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index fdd845573..6575eaa9f 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -906,6 +906,13 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
 	} else if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) {
 		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED
 			"freq=%d dfs=%d", freq, is_dfs);
+	} else if (is_dfs) {
+		if (hostapd_is_dfs_required(hapd->iface) &&
+		    !hostapd_is_dfs_chan_available(hapd->iface) &&
+		    !hapd->iface->cac_started) {
+			hostapd_disable_iface(hapd->iface);
+			hostapd_enable_iface(hapd->iface);
+		}
 	}
 
 	for (i = 0; i < hapd->iface->num_bss; i++)
-- 
2.11.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.