diff options
-rw-r--r-- | wpa_supplicant/config.c | 1 | ||||
-rw-r--r-- | wpa_supplicant/config.h | 4 | ||||
-rw-r--r-- | wpa_supplicant/config_file.c | 3 | ||||
-rw-r--r-- | wpa_supplicant/scan.c | 3 |
4 files changed, 10 insertions, 1 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 69eb7d0..c89fb39 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -2968,6 +2968,7 @@ static const struct global_parse_data global_fields[] = { { INT_RANGE(p2p_intra_bss, 0, 1), CFG_CHANGED_P2P_INTRA_BSS }, { INT(p2p_group_idle), 0 }, { FUNC(p2p_pref_chan), CFG_CHANGED_P2P_PREF_CHAN }, + { INT(p2p_disabled), 0 }, #endif /* CONFIG_P2P */ #ifdef ANDROID_P2P { STR_RANGE(prioritize, 0, 32), CFG_CHANGED_IFACE_PRIORITY }, diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index eb7dbf0..31e7a9a 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -743,6 +743,10 @@ struct wpa_config { */ int p2p_conc_mode; #endif + /* + * 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 cbece8e..9bb01b4 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -852,6 +852,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) } fprintf(f, "\n"); } + + 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 2b468fb..66fd60d 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; |