From patchwork Tue Mar 6 05:03:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 144840 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 DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id E0248B6EEC for ; Tue, 6 Mar 2012 16:04:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DD9949D25F; Tue, 6 Mar 2012 00:04:17 -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 W0nXs1SRxz0p; Tue, 6 Mar 2012 00:04:17 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 8866E9D252; Tue, 6 Mar 2012 00:04:00 -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 E3FCE9D251 for ; Tue, 6 Mar 2012 00:03:59 -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 I0DIuB1ekxUT for ; Tue, 6 Mar 2012 00:03:56 -0500 (EST) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 041A39D252 for ; Tue, 6 Mar 2012 00:03:55 -0500 (EST) Received: by wicr5 with SMTP id r5so3706198wic.17 for ; Mon, 05 Mar 2012 21:03:55 -0800 (PST) Received-SPF: pass (google.com: domain of jithujance@gmail.com designates 10.216.138.17 as permitted sender) client-ip=10.216.138.17; Authentication-Results: mr.google.com; spf=pass (google.com: domain of jithujance@gmail.com designates 10.216.138.17 as permitted sender) smtp.mail=jithujance@gmail.com; dkim=pass header.i=jithujance@gmail.com Received: from mr.google.com ([10.216.138.17]) by 10.216.138.17 with SMTP id z17mr7432713wei.18.1331010235172 (num_hops = 1); Mon, 05 Mar 2012 21:03:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.138.17 with SMTP id z17mr5944511wei.18.1331010235118; Mon, 05 Mar 2012 21:03:55 -0800 (PST) Received: by 10.180.107.137 with HTTP; Mon, 5 Mar 2012 21:03:55 -0800 (PST) Date: Tue, 6 Mar 2012 10:33:55 +0530 Message-ID: Subject: Re: [RFC 2/4] P2P: Handling single channel concurrency From: Jithu Jance To: hostap@lists.shmoo.com X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Single channel concurrency Patch [2/4] This patch handles the case where a p2p join fails due to a freq conflict with the existing STA connection. [PATCH] If P2P Join fails due to frequency conflict, indicate via appropriate reason code. Signed-hostap: Jithu Jance --- wpa_supplicant/p2p_supplicant.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) @@ -2644,6 +2645,14 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s, wpa_printf(MSG_DEBUG, "P2P: Target GO operating frequency " "from P2P peer table: %d MHz", freq); } + + if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT) && + ((shared_freq = wpa_drv_shared_freq(wpa_s)) > 0) && (shared_freq != freq)) { + wpa_msg(wpa_s->parent, MSG_INFO, + P2P_EVENT_GROUP_FORMATION_FAILURE "reason=FREQ_CONFLICT"); + return; + } + bss = wpa_bss_get_bssid(wpa_s, wpa_s->pending_join_iface_addr); if (bss) { freq = bss->freq; diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 486a551..b870c4e 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -2609,6 +2609,7 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s, struct wpa_bss *bss; int freq; u8 iface_addr[ETH_ALEN]; + int shared_freq = 0; eloop_cancel_timeout(wpas_p2p_join_scan, wpa_s, NULL);