diff mbox

[1/1] P2P: Use GO's operating channel to do a directed scan during the Join

Message ID 20140115134719.GA11310@jithu@broadcom.com
State Accepted
Headers show

Commit Message

Jithu Jance Jan. 15, 2014, 1:47 p.m. UTC
Use P2P GO's operating channel info to do a directed scan
during the Join operation.

Signed-hostap: Jithu Jance <jithu@broadcom.com>
---
 wpa_supplicant/p2p_supplicant.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--
1.7.9.5

Comments

Jouni Malinen Jan. 17, 2014, 10:35 a.m. UTC | #1
On Wed, Jan 15, 2014 at 07:17:19PM +0530, Jithu Jance wrote:
> Use P2P GO's operating channel info to do a directed scan
> during the Join operation.

Thanks, applied with some cleanup.
diff mbox

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 7d5667c..8c25970 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -4239,6 +4239,16 @@  static void wpas_p2p_join_scan_req(struct wpa_supplicant *wpa_s, int freq,
 	struct wpabuf *wps_ie, *ies;
 	size_t ielen;
 	int freqs[2] = { 0, 0 };
+	int oper_freq;
+
+	if (!freq) {
+		/*
+		 * If Freq is not provided, check the operating freq of the GO and
+		 * do a directed scan
+		 */
+		freq = ((oper_freq = p2p_get_oper_freq(wpa_s->global->p2p,
+				wpa_s->pending_join_iface_addr)) == -1) ? 0 : oper_freq;
+	}

 	os_memset(&params, 0, sizeof(params));