[PATCH v2 2/4] hostapd: Make chan_switch command per-iface not per-bss
Michal Kazior
michal.kazior
Fri Jun 27 05:19:28 PDT 2014
Currently hostapd data structures aren't ready for multi-channel BSSes
so make the command work now at least with single-channel multi-BSS
channel switching.
Signed-off-by: Michal Kazior <michal.kazior at tieto.com>
---
hostapd/ctrl_iface.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 6265265..6924ad9 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -1252,16 +1252,26 @@ static int hostapd_ctrl_iface_mgmt_tx(struct hostapd_data *hapd, char *cmd)
#endif /* CONFIG_TESTING_OPTIONS */
-static int hostapd_ctrl_iface_chan_switch(struct hostapd_data *hapd, char *pos)
+static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, char *pos)
{
#ifdef NEED_AP_MLME
struct csa_settings settings;
- int ret = hostapd_parse_csa_settings(pos, &settings);
+ int i, ret;
+ ret = hostapd_parse_csa_settings(pos, &settings);
if (ret)
return ret;
- return hostapd_switch_channel(hapd, &settings);
+ for (i = 0; i < iface->num_bss; i++) {
+ ret = hostapd_switch_channel(iface->bss[i], &settings);
+ if (ret) {
+ /* FIXME: What do we do if CSA fails in the middle of
+ * submitting multi-BSS CSA requests? */
+ return ret;
+ }
+ }
+
+ return 0;
#else /* NEED_AP_MLME */
return -1;
#endif /* NEED_AP_MLME */
@@ -1541,7 +1551,7 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
reply_len = -1;
#endif /* CONFIG_TESTING_OPTIONS */
} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) {
- if (hostapd_ctrl_iface_chan_switch(hapd, buf + 12))
+ if (hostapd_ctrl_iface_chan_switch(hapd->iface, buf + 12))
reply_len = -1;
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
--
1.8.5.3
More information about the Hostap
mailing list