From 4e0ab656d29d7f838bc49d8d5b78c67f94193cb2 Mon Sep 17 00:00:00 2001 From: Ilan Peer Date: Tue, 8 Sep 2015 12:46:18 +0300 Subject: [PATCH] Move hostapd_csa_in_progress() to hostapd.c Move hostapd_csa_in_progress() to hostapd.{h,c} so it can be used for contexts other than DFS. Signed-off-by: Ilan Peer --- src/ap/dfs.c | 10 ---------- src/ap/hostapd.c | 11 +++++++++++ src/ap/hostapd.h | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 715f19b6a..7273caad3 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -817,16 +817,6 @@ static int hostapd_dfs_start_channel_switch_cac(struct hostapd_iface *iface) } -static int hostapd_csa_in_progress(struct hostapd_iface *iface) -{ - unsigned int i; - for (i = 0; i < iface->num_bss; i++) - if (iface->bss[i]->csa_in_progress) - return 1; - return 0; -} - - static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) { struct hostapd_channel_data *channel; diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index bf16e7492..8036de44e 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -2634,6 +2634,17 @@ void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s) } +int hostapd_csa_in_progress(struct hostapd_iface *iface) +{ + unsigned int i; + + for (i = 0; i < iface->num_bss; i++) + if (iface->bss[i]->csa_in_progress) + return 1; + return 0; +} + + #ifdef NEED_AP_MLME static void free_beacon_data(struct beacon_data *beacon) diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index ffc453303..024d25fcb 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -454,6 +454,7 @@ int hostapd_remove_iface(struct hapd_interfaces *ifaces, char *buf); void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator); void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s); const char * hostapd_state_text(enum hostapd_iface_state s); +int hostapd_csa_in_progress(struct hostapd_iface *iface); int hostapd_switch_channel(struct hostapd_data *hapd, struct csa_settings *settings); void