aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-10-10 10:08:23 (GMT)
committerJouni Malinen <j@w1.fi>2012-10-10 10:08:23 (GMT)
commit7a808c7eb70e213164f250645ef65231fc8a1590 (patch)
tree9278d1d50935f5f4c6fc48125ed4ed8c298df89c /wpa_supplicant
parentd86a33853efe9bb3c09c4431fa77673620649c05 (diff)
downloadhostap-7a808c7eb70e213164f250645ef65231fc8a1590.zip
hostap-7a808c7eb70e213164f250645ef65231fc8a1590.tar.gz
hostap-7a808c7eb70e213164f250645ef65231fc8a1590.tar.bz2
P2P: Allow P2P functionality to be disabled per interface
By default, P2P is enabled globally for all virtual interfaces and this makes wpa_supplicant include WSC and P2P IEs in Probe Request frames for all scans even if this is for a non-P2P station connection to speed up device discovery. If an interface is dedicated for non-P2P station mode operations, it is now possible to disable addition of WSC and P2P IEs into Probe Request frames with a per-interface p2p_disabled parameter. This can be set either in the configuration file (p2p_disabled=1) or at run time ("wpa_cli -i wlan0 set p2p_disabled 1"). Unlike the previous mechanism ("wpa_cli p2p_set disabled 1"), the new parameter changes the behavior only for the specified interface while other interfaces continue to follow the global P2P enabled/disabled state. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/config.c1
-rw-r--r--wpa_supplicant/config.h5
-rw-r--r--wpa_supplicant/config_file.c2
-rw-r--r--wpa_supplicant/scan.c3
4 files changed, 10 insertions, 1 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 2b66c01..eeff2d4 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -3007,6 +3007,7 @@ static const struct global_parse_data global_fields[] = {
{ INT(p2p_group_idle), 0 },
{ FUNC(p2p_pref_chan), CFG_CHANGED_P2P_PREF_CHAN },
{ INT(p2p_go_ht40), 0 },
+ { INT(p2p_disabled), 0 },
#endif /* CONFIG_P2P */
{ FUNC(country), CFG_CHANGED_COUNTRY },
{ INT(bss_max_count), 0 },
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 02fc596..fe29744 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -757,6 +757,11 @@ struct wpa_config {
* By default: 0 (disabled)
*/
int p2p_go_ht40;
+
+ /**
+ * p2p_disabled - Whether P2P operations are disabled for this interface
+ */
+ int p2p_disabled;
};
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index bd9c17f..cceb75b 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -870,6 +870,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
}
if (config->p2p_go_ht40)
fprintf(f, "p2p_go_ht40=%u\n", config->p2p_go_ht40);
+ if (config->p2p_disabled)
+ fprintf(f, "p2p_disabled=%u\n", config->p2p_disabled);
#endif /* CONFIG_P2P */
if (config->country[0] && config->country[1]) {
fprintf(f, "country=%c%c\n",
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index ea84615..68bdc59 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -66,7 +66,8 @@ static int wpas_wps_in_use(struct wpa_supplicant *wpa_s,
}
#ifdef CONFIG_P2P
- if (!wpa_s->global->p2p_disabled && wpa_s->global->p2p) {
+ if (!wpa_s->global->p2p_disabled && wpa_s->global->p2p &&
+ !wpa_s->conf->p2p_disabled) {
wpa_s->wps->dev.p2p = 1;
if (!wps) {
wps = 1;