]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Allow group to be added for P2P2 as autonomous GO
authorShivani Baranwal <quic_shivbara@quicinc.com>
Wed, 3 Jul 2024 16:41:26 +0000 (22:11 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 24 Oct 2024 09:21:29 +0000 (12:21 +0300)
Add a "p2p2" parameter for P2P_GROUP_ADD to allow a group to be added
specifically for P2P2.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
wpa_supplicant/ctrl_iface.c
wpa_supplicant/dbus/dbus_new_handlers_p2p.c
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/p2p_supplicant.h

index 56be854edb1d660af4847328277e6b9a27a1804f..0ccccde016f9cb78e35faedb62795a7165d3d51d 100644 (file)
@@ -7212,6 +7212,7 @@ static int p2p_ctrl_group_add_persistent(struct wpa_supplicant *wpa_s,
 static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
 {
        int freq = 0, persistent = 0, group_id = -1;
+       bool p2p2 = false;
        bool allow_6ghz = false;
        int vht = wpa_s->conf->p2p_go_vht;
        int ht40 = wpa_s->conf->p2p_go_ht40 || vht;
@@ -7248,6 +7249,8 @@ static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
                        persistent = 1;
                } else if (os_strcmp(token, "allow_6ghz") == 0) {
                        allow_6ghz = true;
+               } else if (os_strcmp(token, "p2p2") == 0) {
+                       p2p2 = true;
                } else if (os_strncmp(token, "go_bssid=", 9) == 0) {
                        if (hwaddr_aton(token + 9, go_bssid_buf))
                                return -1;
@@ -7299,7 +7302,7 @@ static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
                                                     go_bssid);
 
        return wpas_p2p_group_add(wpa_s, persistent, freq, freq2, ht40, vht,
-                                 max_oper_chwidth, he, edmg, allow_6ghz);
+                                 max_oper_chwidth, he, edmg, allow_6ghz, p2p2);
 }
 
 
index 0d2250cfccb5ab88d37c5c6f8aea6437dec52570..06cc92f4a6db34ef8651c9a1d173c7892f70c215 100644 (file)
@@ -486,7 +486,7 @@ DBusMessage * wpas_dbus_handler_p2p_group_add(DBusMessage *message,
                }
        } else if (wpas_p2p_group_add(wpa_s, persistent_group, freq, freq2,
                                      ht40, vht, max_oper_chwidth, he, edmg,
-                                     allow_6ghz))
+                                     allow_6ghz, wpa_s->p2p2))
                goto inv_args;
 
 out:
index 97c45c34c28f62e7405702ec903ee05234e187cc..13e4b4d71171c42154eb7021f1d3dd1f4f3c4197 100644 (file)
@@ -4958,7 +4958,8 @@ static void wpas_p2ps_prov_complete(void *ctx, enum p2p_status_code status,
                                        0);
                        } else if (response_done) {
                                wpas_p2p_group_add(wpa_s, 1, freq,
-                                                  0, 0, 0, 0, 0, 0, false);
+                                                  0, 0, 0, 0, 0, 0, false,
+                                                  wpa_s->p2p2);
                        }
 
                        if (passwd_id == DEV_PW_P2PS_DEFAULT) {
@@ -5082,7 +5083,8 @@ static int wpas_prov_disc_resp_cb(void *ctx)
                        NULL, NULL, 0);
        } else {
                wpas_p2p_group_add(wpa_s, 1, freq, 0, 0, 0, 0, 0, 0,
-                                  is_p2p_allow_6ghz(wpa_s->global->p2p));
+                                  is_p2p_allow_6ghz(wpa_s->global->p2p),
+                                  wpa_s->p2p2);
        }
 
        return 1;
@@ -7379,7 +7381,7 @@ wpas_p2p_get_group_iface(struct wpa_supplicant *wpa_s, int addr_allocated,
 int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group,
                       int freq, int vht_center_freq2, int ht40, int vht,
                       int max_oper_chwidth, int he, int edmg,
-                      bool allow_6ghz)
+                      bool allow_6ghz, bool p2p2)
 {
        struct p2p_go_neg_results params;
        int selected_freq = 0;
@@ -7391,6 +7393,7 @@ int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group,
 
        os_free(wpa_s->global->add_psk);
        wpa_s->global->add_psk = NULL;
+       wpa_s->p2p2 = p2p2;
 
        /* Make sure we are not running find during connection establishment */
        wpa_printf(MSG_DEBUG, "P2P: Stop any on-going P2P FIND");
index e5d5d60fa478146b688acc5e47570ece3f663f75..0c7081821a9245b3f06627af96aebfa99388538d 100644 (file)
@@ -45,7 +45,8 @@ int wpas_p2p_handle_frequency_conflicts(struct wpa_supplicant *wpa_s,
                                           int freq, struct wpa_ssid *ssid);
 int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group,
                       int freq, int vht_center_freq2, int ht40, int vht,
-                      int max_oper_chwidth, int he, int edmg, bool allow_6ghz);
+                      int max_oper_chwidth, int he, int edmg, bool allow_6ghz,
+                      bool p2p2);
 int wpas_p2p_group_add_persistent(struct wpa_supplicant *wpa_s,
                                  struct wpa_ssid *ssid, int addr_allocated,
                                  int force_freq, int neg_freq,