]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Add wpa_supplicant configuration parameters for P2P2
authorShivani Baranwal <quic_shivbara@quicinc.com>
Sat, 31 Aug 2024 07:55:27 +0000 (13:25 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 1 Nov 2024 21:11:00 +0000 (23:11 +0200)
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_file.c
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/wpa_supplicant.conf

index e2e013fb5529960d8486222f0214b4ec4e3fb5b2..3d1a87a403b157261ad8f3b4618c4bb64dc474a3 100644 (file)
@@ -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 */
index 2128c0a24f4313a29695306faa4df48cf6dab9dc..ab671db3260b028084bcd95b38684c0892988a96 100644 (file)
@@ -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;
 
index e9f93f0421801a4fe584f3aeef1d3bd87df3fbde..f260669d3f5504bb8c48daaa2c50bfbdca376f0d 100644 (file)
@@ -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],
index f9c3596e6822acea566f39d10b84dc77fe24e377..cbc824f72427536eb7b6148ed9b78185ceddf3e8 100644 (file)
@@ -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;
index 9c9fe959f784cba449e186a623b2b7c54a933006..a976a5b6b426d58fa7c6e333a854a1e8a7af2bcc 100644 (file)
@@ -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