From patchwork Wed Jan 15 13:47:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 311132 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AAB4C2C007E for ; Thu, 16 Jan 2014 00:48:14 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 84FC09D2C8; Wed, 15 Jan 2014 08:48:11 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9gBdMrp0eY13; Wed, 15 Jan 2014 08:48:11 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id CDEA59D2B9; Wed, 15 Jan 2014 08:48:06 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 67AC99D2B9 for ; Wed, 15 Jan 2014 08:48:05 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GwjOncneRFrR for ; Wed, 15 Jan 2014 08:48:00 -0500 (EST) Received: from mail-gw1-out.broadcom.com (mail-gw1-out.broadcom.com [216.31.210.62]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 44A9D9D2B6 for ; Wed, 15 Jan 2014 08:47:59 -0500 (EST) X-IronPort-AV: E=Sophos;i="4.95,663,1384329600"; d="scan'208";a="9613192" Received: from irvexchcas06.broadcom.com (HELO IRVEXCHCAS06.corp.ad.broadcom.com) ([10.9.208.53]) by mail-gw1-out.broadcom.com with ESMTP; 15 Jan 2014 06:03:16 -0800 Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS06.corp.ad.broadcom.com (10.9.208.53) with Microsoft SMTP Server (TLS) id 14.1.438.0; Wed, 15 Jan 2014 05:47:58 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.1.438.0; Wed, 15 Jan 2014 05:47:58 -0800 Received: from jithu?broadcom.com (lbblr-jithu01.ban.broadcom.com [10.132.24.37]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id B4DD5246FE for ; Wed, 15 Jan 2014 05:47:22 -0800 (PST) Date: Wed, 15 Jan 2014 19:17:19 +0530 From: Jithu Jance To: Subject: [PATCH 1/1] P2P: Use GO's operating channel to do a directed scan during the Join Message-ID: <20140115134719.GA11310@jithu@broadcom.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Use P2P GO's operating channel info to do a directed scan during the Join operation. Signed-hostap: Jithu Jance --- wpa_supplicant/p2p_supplicant.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 1.7.9.5 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(¶ms, 0, sizeof(params));