[PATCH 12/26] wpa_supplicant: Trigger channel selection correctly during CSA

Ilan Peer ilan.peer
Tue Sep 8 02:46:19 PDT 2015


From: Andrei Otcheretianski <andrei.otcheretianski at intel.com>

Don't consider moving GO's to a new channel if one of them is in the middle of
CSA. In addition, call wpas_p2p_update_channel_list() after EVENT_CH_SWITCH
is handled.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 wpa_supplicant/events.c         |  2 ++
 wpa_supplicant/p2p_supplicant.c | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 0777a56..ce812ba 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3462,6 +3462,8 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 				  data->ch_switch.ch_width,
 				  data->ch_switch.cf1,
 				  data->ch_switch.cf2);
+
+		wpas_p2p_update_channel_list(wpa_s, WPAS_P2P_CHANNEL_UPDATE_CS);
 		break;
 #ifdef NEED_AP_MLME
 	case EVENT_DFS_RADAR_DETECTED:
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 810f257..e7b6c56 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -8664,6 +8664,13 @@ static void wpas_p2p_move_go(void *eloop_ctx, void *timeout_ctx)
 
 	wpas_p2p_go_update_common_freqs(wpa_s);
 
+	/* don't move go in the middle of csa */
+	if (hostapd_csa_in_progress(wpa_s->ap_iface)) {
+		wpa_printf(MSG_DEBUG,
+			   "P2P: CSA is in progress - not moving GO");
+		return;
+	}
+
 	/*
 	 * First, try a channel switch flow. If it is not supported or fails,
 	 * take down the GO and bring it up again.
@@ -8774,6 +8781,16 @@ static void wpas_p2p_consider_moving_one_go(struct wpa_supplicant *wpa_s,
 		return;
 	}
 
+	/*
+	 * Don't consider moving GO if it is in the middle  of a CSA. When the
+	 * CSA is finished this flow should be retriggered.
+	 */
+	if (hostapd_csa_in_progress(wpa_s->ap_iface)) {
+		wpa_dbg(wpa_s, MSG_DEBUG,
+			"Not initiating a GO frequency change - CSA is in progress");
+		return;
+	}
+
 	if (invalid_freq && !wpas_p2p_disallowed_freq(wpa_s->global, freq))
 		timeout = P2P_GO_FREQ_CHANGE_TIME;
 	else
-- 
1.9.1




More information about the Hostap mailing list