From ca8303135cbba241cc1b1c15005065166251a91e Mon Sep 17 00:00:00 2001 From: Shivani Baranwal Date: Mon, 14 Jul 2025 12:21:24 +0530 Subject: [PATCH] P2P2: Set P2P mode to the driver on P2P GO device Set the P2P mode (R1 only, R2 only, or PCC) to the driver when bringing up the P2P GO. Signed-off-by: Shivani Baranwal --- src/drivers/driver.h | 5 +++++ src/drivers/driver_nl80211.c | 3 +++ wpa_supplicant/ap.c | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 0a0532353..d943062fe 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -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 { diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 1a2134437..eb279cda8 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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; diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index de18a68f0..2d2278c87 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -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) -- 2.47.3