Patchwork [RFC,3/3] hostapd: Make multi-bss dfs work

login
register
mail settings
Submitter Michal Kazior
Date March 18, 2014, 1:55 p.m.
Message ID <1395150910-20595-4-git-send-email-michal.kazior@tieto.com>
Download mbox | patch
Permalink /patch/331434/
State Superseded
Headers show

Comments

Michal Kazior - March 18, 2014, 1:55 p.m.
Submit CSA request for all BSSes in an interface.  It doesn't make much
sense to do that per-BSS because that would break hostapd as it
currently is.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 src/ap/dfs.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Patch

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 9e8389f..25ceebc 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -747,8 +747,7 @@  static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
 	u8 vht_oper_centr_freq_seg1_idx;
 	int skip_radar = 1;
 	struct csa_settings csa_settings;
-	struct hostapd_data *hapd = iface->bss[0];
-	int err = 1;
+	int i, err = 1;
 
 	wpa_printf(MSG_DEBUG, "%s called (CAC active: %s, CSA active: %s)",
 		   __func__, iface->cac_started ? "yes" : "no",
@@ -826,7 +825,12 @@  static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
 		return err;
 	}
 
-	err = hostapd_switch_channel(hapd, &csa_settings);
+	for (i = 0; i < iface->num_bss; i++) {
+		err = hostapd_switch_channel(iface->bss[i], &csa_settings);
+		if (err)
+			break;
+	}
+
 	if (err) {
 		wpa_printf(MSG_WARNING, "DFS failed to schedule CSA (%d) - trying fallback",
 			   err);