aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>2017-03-08 05:13:16 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-09 14:46:30 (GMT)
commit3dcd735c1eea9653692f4dfade8697aedaa04ea5 (patch)
treef5ab99343c56c97882e36d4377a33096fa048c21 /src
parentd0330d57f3d320719c1f8fc8478a6dc5ef613946 (diff)
downloadhostap-3dcd735c1eea9653692f4dfade8697aedaa04ea5.zip
hostap-3dcd735c1eea9653692f4dfade8697aedaa04ea5.tar.gz
hostap-3dcd735c1eea9653692f4dfade8697aedaa04ea5.tar.bz2
DFS: Handle CAC completion event from other radio
When DFS channel state is shared across multiple radios on the system it is possible that a CAC completion event is propagated from other radio to us. When in enabled state, do not proceed with setup completion upon processing CAC completion event with devices where DFS is not offloaded, when in state other than enabled make sure the configured DFS channel is in available state before start the AP. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
Diffstat (limited to 'src')
-rw-r--r--src/ap/dfs.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 47adba7..23f265d 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -747,6 +747,23 @@ int hostapd_handle_dfs(struct hostapd_iface *iface)
}
+static int hostapd_config_dfs_chan_available(struct hostapd_iface *iface)
+{
+ int n_chans, n_chans1, start_chan_idx, start_chan_idx1;
+
+ /* Get the start (first) channel for current configuration */
+ start_chan_idx = dfs_get_start_chan_idx(iface, &start_chan_idx1);
+ if (start_chan_idx < 0)
+ return 0;
+
+ /* Get the number of used channels, depending on width */
+ n_chans = dfs_get_used_n_chans(iface, &n_chans1);
+
+ /* Check if all channels are DFS available */
+ return dfs_check_chans_available(iface, start_chan_idx, n_chans);
+}
+
+
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)
@@ -767,8 +784,21 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
set_dfs_state(iface, freq, ht_enabled, chan_offset,
chan_width, cf1, cf2,
HOSTAPD_CHAN_DFS_AVAILABLE);
- iface->cac_started = 0;
- hostapd_setup_interface_complete(iface, 0);
+ /*
+ * Just mark the channel available when CAC completion
+ * event is received in enabled state. CAC result could
+ * have been propagated from another radio having the
+ * same regulatory configuration. When CAC completion is
+ * received during non-HAPD_IFACE_ENABLED state, make
+ * sure the configured channel is available because this
+ * CAC completion event could have been propagated from
+ * another radio.
+ */
+ if (iface->state != HAPD_IFACE_ENABLED &&
+ hostapd_config_dfs_chan_available(iface)) {
+ hostapd_setup_interface_complete(iface, 0);
+ iface->cac_started = 0;
+ }
}
}