[PATCH 08/14] wpa_supplicant: Trigger channel selection correctly during CSA

Ilan Peer ilan.peer
Mon May 19 00:07:10 PDT 2014


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         |    4 ++++
 wpa_supplicant/p2p_supplicant.c |   17 +++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 205337c..9fc64f6 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3141,6 +3141,10 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 				  data->ch_switch.ch_width,
 				  data->ch_switch.cf1,
 				  data->ch_switch.cf2);
+
+#ifdef CONFIG_P2P
+		wpas_p2p_update_channel_list(wpa_s, WPAS_P2P_CHANNEL_UPDATE_CS);
+#endif
 		break;
 #endif /* CONFIG_AP */
 	case EVENT_RX_MGMT: {
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 7d5f98c..22ba344 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -8280,6 +8280,13 @@ static void wpas_p2p_move_go(void *eloop_ctx, void *timeout_ctx)
 	if (!wpa_s->ap_iface || !wpa_s->current_ssid)
 		return;
 
+	/* Do not move a GO in the middle of csa */
+	if (wpa_s->ap_iface->csa_in_progress) {
+		wpa_printf(MSG_DEBUG,
+			   "P2P: CSA in progress - not moving GO");
+		return;
+	}
+
 	wpas_p2p_go_update_common_freqs(wpa_s);
 
 	/*
@@ -8385,6 +8392,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 (wpa_s->ap_iface->csa_in_progress) {
+		wpa_dbg(wpa_s, MSG_DEBUG,
+			"Not initiating a GO frequency change - CSA is in progress");
+		return;
+	}
+
 	if (invalid_freq)
 		timeout = P2P_GO_FREQ_CHANGE_TIME;
 	if (policy_move)
-- 
1.7.10.4




More information about the Hostap mailing list