[PATCH v2 3/4] hostapd: Perform multi-BSS CSA for DFS properly

Michal Kazior michal.kazior
Fri Jun 27 05:19:29 PDT 2014


Currently hostapd data structures aren't ready for multi-channel BSSes
so make DFS work now at least with single-channel multi-BSS channel
switching.

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

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 9190ff6..c2d1940 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -774,8 +774,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",
@@ -853,7 +852,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);
-- 
1.8.5.3




More information about the Hostap mailing list