From patchwork Thu Aug 1 10:33:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreenath X-Patchwork-Id: 263958 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 82E362C00B1 for ; Thu, 1 Aug 2013 20:33:52 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B39E517C021; Thu, 1 Aug 2013 06:33: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 lqkdslIUG4ff; Thu, 1 Aug 2013 06:33:48 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DD83B17C007; Thu, 1 Aug 2013 06:33:43 -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 B30C417C007 for ; Thu, 1 Aug 2013 06:33:41 -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 YS3E7ldd9DVD for ; Thu, 1 Aug 2013 06:33:36 -0400 (EDT) Received: from mms1.broadcom.com (mms1.broadcom.com [216.31.210.17]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 5299117C002 for ; Thu, 1 Aug 2013 06:33:36 -0400 (EDT) Received: from [10.9.208.57] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Thu, 01 Aug 2013 03:29:31 -0700 X-Server-Uuid: 06151B78-6688-425E-9DE2-57CB27892261 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, 1 Aug 2013 03:33:20 -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, 1 Aug 2013 03:33:20 -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 2607CF2D72 for ; Thu, 1 Aug 2013 03:33:19 -0700 (PDT) Date: Thu, 1 Aug 2013 16:03:18 +0530 From: "Sreenath Sharma" To: hostap@lists.shmoo.com Subject: [PATCH] P2P: Allow P2P functionality to be disabled per interface Message-ID: <20130801103318.GA9222@sreenath-Precision-M4700> MIME-Version: 1.0 User-Agent: Mutt/1.5.21 (2010-09-15) X-WSS-ID: 7DE4E70131W79377220-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 By default, P2P is initialized for all driver interfaces and this makes P2P getting initialized for non-P2P station interface if the supplicant is started first on this interface. If an interface is dedicated for non-P2P station mode, it is now possible to disable P2P initialization by adding 'p2p_disabled=1' in the configuration file of non-P2P station interface, irrespective of the order in which supplicant is started. Signed-hostap: Sreenath Sharma --- wpa_supplicant/p2p_supplicant.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 2c363ec..82d0e81 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3095,6 +3095,9 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s) unsigned int r; int i; + if (wpa_s->conf->p2p_disabled) + return 0; + if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_CAPABLE)) return 0;