aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2014-06-27 12:19:28 (GMT)
committerJouni Malinen <j@w1.fi>2014-06-28 08:06:44 (GMT)
commitccac7c61cfe2ec01f2cfd0762aa1415e4d73e1c0 (patch)
treed29efcdd72a5403310b7e5c33f44ba73a77af899 /hostapd
parent6782b6846b97fa9fd3587bd9a7bafbb29eb1e946 (diff)
downloadhostap-ccac7c61cfe2ec01f2cfd0762aa1415e4d73e1c0.zip
hostap-ccac7c61cfe2ec01f2cfd0762aa1415e4d73e1c0.tar.gz
hostap-ccac7c61cfe2ec01f2cfd0762aa1415e4d73e1c0.tar.bz2
hostapd: Make chan_switch command per-interface not per-BSS
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@tieto.com>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/ctrl_iface.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 6265265..9ce7829 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -1252,16 +1252,28 @@ 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 ret;
+ unsigned int i;
+ 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) {
+ /* FIX: 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 +1553,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,