From: Shivani Baranwal Date: Sat, 31 Aug 2024 07:55:27 +0000 (+0530) Subject: P2P2: Add wpa_supplicant configuration parameters for P2P2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ea2c336dd0867f4432e943bf8725f7a0dfe0351;p=thirdparty%2Fhostap.git P2P2: Add wpa_supplicant configuration parameters for P2P2 Signed-off-by: Shivani Baranwal --- diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index e2e013fb5..3d1a87a40 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -5496,6 +5496,15 @@ static const struct global_parse_data global_fields[] = { { FUNC(p2p_device_persistent_mac_addr), 0 }, { INT(p2p_interface_random_mac_addr), 0 }, { INT(p2p_6ghz_disable), 0 }, + { INT_RANGE(p2p_pairing_setup, 0, 1), 0 }, + { INT_RANGE(p2p_pairing_cache, 0, 1), 0 }, + { INT_RANGE(p2p_pairing_verification, 0, 1), 0 }, + { INT(p2p_bootstrap_methods), 0 }, + { INT(p2p_pasn_type), 0 }, + { INT(p2p_comeback_after), 0 }, + { INT_RANGE(p2p_twt_power_mgmt, 0, 1), 0 }, + { INT_RANGE(p2p_chan_switch_req_enable, 0, 1), 0 }, + { INT(p2p_reg_info), 0 }, { INT(dik_cipher), 0}, { BIN(dik), 0 }, #endif /* CONFIG_P2P */ diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index 2128c0a24..ab671db32 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -899,6 +899,15 @@ struct wpa_config { int p2p_optimize_listen_chan; int p2p_6ghz_disable; + bool p2p_pairing_setup; + bool p2p_pairing_cache; + bool p2p_pairing_verification; + int p2p_bootstrap_methods; + int p2p_pasn_type; + int p2p_comeback_after; + bool p2p_twt_power_mgmt; + bool p2p_chan_switch_req_enable; + int p2p_reg_info; struct wpabuf *wps_vendor_ext_m1; diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index e9f93f042..f260669d3 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -1376,6 +1376,30 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) if (config->p2p_6ghz_disable) fprintf(f, "p2p_6ghz_disable=%d\n", config->p2p_6ghz_disable); + if (config->p2p_pairing_setup) + fprintf(f, "p2p_pairing_setup=%d\n", config->p2p_pairing_setup); + if (config->p2p_pairing_cache) + fprintf(f, "p2p_pairing_cache=%d\n", config->p2p_pairing_cache); + if (config->p2p_pairing_verification) + fprintf(f, "p2p_pairing_verification=%d\n", + config->p2p_pairing_verification); + if (config->p2p_bootstrap_methods) + fprintf(f, "p2p_bootstrap_methods=%d\n", + config->p2p_bootstrap_methods); + if (config->p2p_pasn_type) + fprintf(f, "p2p_pasn_type=%d\n", config->p2p_pasn_type); + if (config->p2p_comeback_after) + fprintf(f, "p2p_comeback_after=%d\n", + config->p2p_comeback_after); + if (config->p2p_twt_power_mgmt) + fprintf(f, "p2p_twt_power_mgmt=%d\n", + config->p2p_twt_power_mgmt); + if (config->p2p_chan_switch_req_enable) + fprintf(f, "p2p_chan_switch_req_enable=%d\n", + config->p2p_chan_switch_req_enable); + if (config->p2p_reg_info) + fprintf(f, "p2p_reg_info=%d\n", config->p2p_reg_info); + if (WPA_GET_BE32(config->ip_addr_go)) fprintf(f, "ip_addr_go=%u.%u.%u.%u\n", config->ip_addr_go[0], config->ip_addr_go[1], diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index f9c3596e6..cbc824f72 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -5645,6 +5645,20 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s) "P2P: Failed to update configuration"); } + p2p.pairing_config.enable_pairing_setup = + wpa_s->conf->p2p_pairing_setup; + p2p.pairing_config.enable_pairing_cache = + wpa_s->conf->p2p_pairing_cache; + p2p.pairing_config.enable_pairing_verification = + wpa_s->conf->p2p_pairing_verification; + p2p.pairing_config.bootstrap_methods = + wpa_s->conf->p2p_bootstrap_methods; + p2p.pairing_config.pasn_type = wpa_s->conf->p2p_pasn_type; + p2p.comeback_after = wpa_s->conf->p2p_comeback_after; + p2p.reg_info = wpa_s->conf->p2p_reg_info; + p2p.twt_power_mgmt = wpa_s->conf->p2p_twt_power_mgmt; + p2p.chan_switch_req_enable = wpa_s->conf->p2p_chan_switch_req_enable; + global->p2p = p2p_init(&p2p); if (global->p2p == NULL) return -1; diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf index 9c9fe959f..a976a5b6b 100644 --- a/wpa_supplicant/wpa_supplicant.conf +++ b/wpa_supplicant/wpa_supplicant.conf @@ -401,6 +401,50 @@ fast_reauth=1 # it from taking 100% of radio resources. The default value is 500 ms. #p2p_search_delay=500 +# Enable/disable P2P pairing setup +#p2p_pairing_setup=0 + +# Enable/disable P2P pairing cache for verification +#p2p_pairing_cache=0 + +# Enable/disable P2P pairing verification with cached NIK/NPK +#p2p_pairing_verification=0 + +# Supported P2P bootstrapping method bitmap +# b0: whether opportunistic bootstrapping is supported +# b1: whether PIN display is supported +# b2: whether passphrase display is supported +# b3: whether QR Code display is supported +# b4: whether NFC tag is supported +# b5: whether keypad (PIN only) is supported +# b6: whether keypad (passphrase) is supported +# b7: whether QR Code scan is supported +# b8: whether NFC reader is supported +# b14: whether service managed bootstrapping is supported +# b15: whether bootstrapping handshakes skipped is supported +#p2p_bootstrap_methods=0 + +# Bitmap of supported PASN types +# B0: whether DH Group 19 with unauthenticated PASN is supported +# B1: whether DH Group 19 with authenticated PASN is supported +# B2: whether DH Group 20 with unauthenticated PASN is supported +# B3: whether DH Group 20 authenticated PASN is supported +#p2p_pasn_type=0 + +# Bootstrap request for unauthorized peer is asked to come back after +# this many TUs. +#p2p_comeback_after=977 + +# Enable/disable TWT based power management for P2P +#p2p_twt_power_mgmt=0 + +# Enable/disable P2P client channel switch request +#p2p_chan_switch_req_enable=0 + +# Regulatory info encoding for operation in 6 GHz band +# As defined in Table E-12 and E-13 of IEEE P802.11-REVme/D7.0. +#p2p_reg_info=0 + # Opportunistic Key Caching (also known as Proactive Key Caching) default # This parameter can be used to set the default behavior for the # proactive_key_caching parameter. By default, OKC is disabled unless enabled