P2P: Allow separate P2P group interface use to be disabled
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 29 Oct 2012 13:02:30 +0000 (15:02 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 29 Oct 2012 13:02:30 +0000 (15:02 +0200)
The new p2p_no_group_iface=1 configuration parameter can now be used to
disable the default behavior of adding a separate interface for the P2P
group when driver support for concurrent interfaces is available.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_file.c
wpa_supplicant/p2p_supplicant.c

index eeff2d4..736bf0d 100644 (file)
@@ -3008,6 +3008,7 @@ static const struct global_parse_data global_fields[] = {
        { FUNC(p2p_pref_chan), CFG_CHANGED_P2P_PREF_CHAN },
        { INT(p2p_go_ht40), 0 },
        { INT(p2p_disabled), 0 },
+       { INT(p2p_no_group_iface), 0 },
 #endif /* CONFIG_P2P */
        { FUNC(country), CFG_CHANGED_COUNTRY },
        { INT(bss_max_count), 0 },
index fe29744..fd2a628 100644 (file)
@@ -762,6 +762,17 @@ struct wpa_config {
         * p2p_disabled - Whether P2P operations are disabled for this interface
         */
        int p2p_disabled;
+
+       /**
+        * p2p_no_group_iface - Whether group interfaces can be used
+        *
+        * By default, wpa_supplicant will create a separate interface for P2P
+        * group operations if the driver supports this. This functionality can
+        * be disabled by setting this parameter to 1. In that case, the same
+        * interface that was used for the P2P management operations is used
+        * also for the group operation.
+        */
+       int p2p_no_group_iface;
 };
 
 
index cceb75b..c473891 100644 (file)
@@ -872,6 +872,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
                fprintf(f, "p2p_go_ht40=%u\n", config->p2p_go_ht40);
        if (config->p2p_disabled)
                fprintf(f, "p2p_disabled=%u\n", config->p2p_disabled);
+       if (config->p2p_no_group_iface)
+               fprintf(f, "p2p_no_group_iface=%u\n",
+                       config->p2p_no_group_iface);
 #endif /* CONFIG_P2P */
        if (config->country[0] && config->country[1]) {
                fprintf(f, "country=%c%c\n",
index c4e9176..15b9b85 100644 (file)
@@ -2859,6 +2859,8 @@ void wpas_p2p_deinit_global(struct wpa_global *global)
 
 static int wpas_p2p_create_iface(struct wpa_supplicant *wpa_s)
 {
+       if (wpa_s->conf->p2p_no_group_iface)
+               return 0; /* separate interface disabled per configuration */
        if (wpa_s->drv_flags &
            (WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE |
             WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P))