Patchwork P2P: Allow P2P functionality to be disabled per interface

login
register
mail settings
Submitter Sreenath
Date Aug. 1, 2013, 10:33 a.m.
Message ID <20130801103318.GA9222@sreenath-Precision-M4700>
Download mbox | patch
Permalink /patch/263958/
State Accepted
Commit f2b3f4de49606a6e21c46fb6d85e262ad3ce88a7
Headers show

Comments

Sreenath - Aug. 1, 2013, 10:33 a.m.
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 <sreenats@broadcom.com>
---
 wpa_supplicant/p2p_supplicant.c |    3 +++
 1 file changed, 3 insertions(+)
Jouni Malinen - Aug. 31, 2013, 9 a.m.
On Thu, Aug 01, 2013 at 04:03:18PM +0530, Sreenath Sharma wrote:
> 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.

Thanks, applied.

Patch

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;