]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Indication on whether P2P2 is used with P2P_INVITE
authorShivani Baranwal <quic_shivbara@quicinc.com>
Mon, 1 Jul 2024 19:11:48 +0000 (00:41 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 13 Oct 2024 18:41:53 +0000 (21:41 +0300)
Add a new parameter "p2p2" to the P2P_INVITE control interface
command. This can be used to indicate that the operation is for a P2P2
group.

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 03ee107c37443b5437e9c3189ab43e51c369647d..074d28a173620137b6bb42fe83029b7580bc295e 100644 (file)
@@ -7075,6 +7075,7 @@ static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd)
        int ht40, vht, he, max_oper_chwidth, chwidth = 0, freq2 = 0;
        int edmg;
        bool allow_6ghz;
+       bool p2p2;
 
        id = atoi(cmd);
        pos = os_strstr(cmd, " peer=");
@@ -7131,9 +7132,11 @@ static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd)
        if (allow_6ghz && chwidth == 40)
                max_oper_chwidth = CONF_OPER_CHWIDTH_40MHZ_6GHZ;
 
+       p2p2 = os_strstr(cmd, " p2p2") != NULL;
+
        return wpas_p2p_invite(wpa_s, _peer, ssid, NULL, freq, freq2, ht40, vht,
                               max_oper_chwidth, pref_freq, he, edmg,
-                              allow_6ghz);
+                              allow_6ghz, p2p2);
 }
 
 
index 65bd478c1f61b2e38d7b237320316ff3773e94d2..c3bd04b64fe284ae45f6991adf0cf59436704550 100644 (file)
@@ -866,7 +866,7 @@ DBusMessage * wpas_dbus_handler_p2p_invite(DBusMessage *message,
                        goto err;
 
                if (wpas_p2p_invite(wpa_s, peer_addr, ssid, NULL, 0, 0, 0, 0, 0,
-                                   0, 0, 0, false) < 0) {
+                                   0, 0, 0, false, false) < 0) {
                        reply = wpas_dbus_error_unknown_error(
                                message,
                                "Failed to reinvoke a persistent group");
index 7b00c88c1dcdf303069c3da35d0d6de4ff1f15e2..faee2f0a9a6f79d431bc58c3209c07d581b61c89 100644 (file)
@@ -8060,7 +8060,7 @@ int wpas_p2p_reject(struct wpa_supplicant *wpa_s, const u8 *addr)
 int wpas_p2p_invite(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
                    struct wpa_ssid *ssid, const u8 *go_dev_addr, int freq,
                    int vht_center_freq2, int ht40, int vht, int max_chwidth,
-                   int pref_freq, int he, int edmg, bool allow_6ghz)
+                   int pref_freq, int he, int edmg, bool allow_6ghz, bool p2p2)
 {
        enum p2p_invite_role role;
        u8 *bssid = NULL;
@@ -8086,6 +8086,7 @@ int wpas_p2p_invite(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
        wpa_s->p2p_go_max_oper_chwidth = max_chwidth;
        wpa_s->p2p_go_vht_center_freq2 = vht_center_freq2;
        wpa_s->p2p_go_edmg = !!edmg;
+       wpa_s->p2p2 = p2p2;
        if (ssid->mode == WPAS_MODE_P2P_GO) {
                role = P2P_INVITE_ROLE_GO;
                if (peer_addr == NULL) {
index 7a07ab0b6a62d49e1f12f77da939ced640028774..d874429162c62293533a981c08ca476f8fafeae5 100644 (file)
@@ -122,7 +122,8 @@ int wpas_p2p_reject(struct wpa_supplicant *wpa_s, const u8 *addr);
 int wpas_p2p_invite(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
                    struct wpa_ssid *ssid, const u8 *go_dev_addr, int freq,
                    int vht_center_freq2, int ht40, int vht, int max_chwidth,
-                   int pref_freq, int he, int edmg, bool allow_6ghz);
+                   int pref_freq, int he, int edmg, bool allow_6ghz,
+                   bool p2p2);
 int wpas_p2p_invite_group(struct wpa_supplicant *wpa_s, const char *ifname,
                          const u8 *peer_addr, const u8 *go_dev_addr,
                          bool allow_6ghz);