]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Enable CSA for background radar detection
authorLorenzo Bianconi <lorenzo@kernel.org>
Sun, 6 Mar 2022 19:34:13 +0000 (20:34 +0100)
committerJouni Malinen <j@w1.fi>
Sun, 13 Mar 2022 19:15:48 +0000 (21:15 +0200)
Rely on hostapd_dfs_request_channel_switch() to enable CSA for
background radar detection switching back to the selected channel.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
src/ap/dfs.c

index a58ad2dab3617e26264092ceaa53b2479d71fb0e..91ea8c354e41a704186a3d4dfd1c98d9f55fc50a 100644 (file)
@@ -1090,6 +1090,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 =
@@ -1100,10 +1102,12 @@ hostapd_dfs_start_channel_switch_background(struct hostapd_iface *iface)
                iface->conf, 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));
 }