]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Set P2P mode to the driver on P2P GO device
authorShivani Baranwal <shivani.baranwal@oss.qualcomm.com>
Mon, 14 Jul 2025 06:51:24 +0000 (12:21 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 12 Aug 2025 12:48:26 +0000 (15:48 +0300)
Set the P2P mode (R1 only, R2 only, or PCC) to the driver when bringing
up the P2P GO.

Signed-off-by: Shivani Baranwal <shivani.baranwal@oss.qualcomm.com>
src/drivers/driver.h
src/drivers/driver_nl80211.c
wpa_supplicant/ap.c

index 0a053235320cc64eb4dec19bf18c3c622a5a4bd9..d943062feb41537a6303d150a0fc8f152f61f730 100644 (file)
@@ -1423,6 +1423,11 @@ struct wpa_driver_associate_params {
         * bssid_filter_count - Number of allowed BSSIDs
         */
        unsigned int bssid_filter_count;
+
+       /**
+        * p2p_mode - P2P R1 only, P2P R2 only, or PCC mode
+        */
+       enum wpa_p2p_mode p2p_mode;
 };
 
 enum hide_ssid {
index 1a2134437923c03d952543bbc6689a1ca5e8dc63..eb279cda88575d86b8a02d93c40ba22b8a4d0dbc 100644 (file)
@@ -6596,6 +6596,9 @@ static int wpa_driver_nl80211_ap(struct wpa_driver_nl80211_data *drv,
                wpa_printf(MSG_DEBUG, "nl80211: Setup AP operations for P2P "
                           "group (GO)");
                nlmode = NL80211_IFTYPE_P2P_GO;
+#ifdef CONFIG_DRIVER_NL80211_QCA
+               nl80211_set_p2p_mode(drv->first_bss, params->p2p_mode);
+#endif /* CONFIG_DRIVER_NL80211_QCA */
        } else
                nlmode = NL80211_IFTYPE_AP;
 
index de18a68f0ba823a2e0bafc711857d9f55b18b987..2d2278c87f45d00972fef8922c628d62bda93fbe 100644 (file)
@@ -1039,8 +1039,10 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
 
 #ifdef CONFIG_P2P
        if (ssid->mode == WPAS_MODE_P2P_GO ||
-           ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION)
+           ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION) {
                params.p2p = 1;
+               params.p2p_mode = wpa_s->p2p_mode;
+       }
 #endif /* CONFIG_P2P */
 
        if (wpa_s->p2pdev->set_ap_uapsd)