From patchwork Thu Sep 12 12:49:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreenath X-Patchwork-Id: 274550 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 373522C03A8 for ; Thu, 12 Sep 2013 22:49:57 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2E30D9C1B3; Thu, 12 Sep 2013 08:49:54 -0400 (EDT) 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 EyTYaHaL7Oef; Thu, 12 Sep 2013 08:49:53 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 7CBE79C1AB; Thu, 12 Sep 2013 08:49:49 -0400 (EDT) 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 B79B19C1AB for ; Thu, 12 Sep 2013 08:49:48 -0400 (EDT) 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 Y1-Bk5klJ7nu for ; Thu, 12 Sep 2013 08:49:43 -0400 (EDT) Received: from mms2.broadcom.com (mms2.broadcom.com [216.31.210.18]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 787139C1A8 for ; Thu, 12 Sep 2013 08:49:43 -0400 (EDT) Received: from [10.9.208.57] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Thu, 12 Sep 2013 05:43:10 -0700 X-Server-Uuid: 4500596E-606A-40F9-852D-14843D8201B2 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Thu, 12 Sep 2013 05:49:32 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.1.438.0; Thu, 12 Sep 2013 05:49:32 -0700 Received: from sreenath-Precision-M4700 (sreenats-linux.ban.broadcom.com [10.132.21.138]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id DDEA41A48 for ; Thu, 12 Sep 2013 05:49:31 -0700 (PDT) Date: Thu, 12 Sep 2013 18:19:30 +0530 From: "Sreenath Sharma" To: hostap@lists.shmoo.com Subject: [PATCH] P2P: Fix for multi channel concurrency Message-ID: <20130912124930.GA29850@sreenath-Precision-M4700> MIME-Version: 1.0 User-Agent: Mutt/1.5.21 (2010-09-15) X-WSS-ID: 7E2F69541R090052149-01-01 Content-Disposition: inline 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 In case of GO-NEGOTIATION, the connected STA channel is set as the forced frequency even though the device is multi channel concurrent capable. This will cause only that channel getting added in the channel list of GO-NEGOTIATION request packet. So if both the peers try to force their receptive STA channels and if both are different, there will be failure - "no common channel" (7). Ideally in case of multi channel concurrency, the connected STA channel should not be set as forced channel and should only be set as preferred channel. This will cause full channel list getting updated in the GO-NEGOTIATION request packet, so that there can be channel intersection if the peer's proposed channel is different. This is a regression from commit 0d08efa447a5c5fb20bbed18a2ced36a8afe9221. Signed-hostap: Sreenath Sharma --- wpa_supplicant/p2p_supplicant.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 9338ad5..c6b3c8e 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3964,14 +3964,14 @@ static int wpas_p2p_setup_freqs(struct wpa_supplicant *wpa_s, int freq, if (!p2p_supported_freq(wpa_s->global->p2p, freqs[i])) continue; - wpa_printf(MSG_DEBUG, "P2P: Try to force us to use frequency (%u MHz) which is already in use", - *force_freq); - *force_freq = freqs[i]; - - if (*pref_freq == 0 && num < wpa_s->num_multichan_concurrent) { - wpa_printf(MSG_DEBUG, "P2P: Try to prefer a frequency we are already using"); - *pref_freq = *force_freq; - } + if (num < wpa_s->num_multichan_concurrent) { + wpa_printf(MSG_DEBUG, "P2P: Try to prefer a frequency we are already using"); + *pref_freq = freqs[i]; + } else { + wpa_printf(MSG_DEBUG, "P2P: Try to force us to use frequency (%u MHz) which is already in use", + *force_freq); + *force_freq = freqs[i]; + } break; }