From: Vinay Gannevaram Date: Mon, 28 Apr 2025 17:54:22 +0000 (+0530) Subject: P2P2: Enable P2P2 and PCC only for SME non-offload drivers by default X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20310fdab8b5788a02f61f64c2fd2c6f47669705;p=thirdparty%2Fhostap.git P2P2: Enable P2P2 and PCC only for SME non-offload drivers by default Enable P2P2 and PCC support by default for SME non-offload drivers. Other drivers will enable support for P2P2 and PCC from the driver capabilities. This is needed to avoid enabling P2P2 functionality for SME-in-driver cases where the driver is not actually capable of all the needed functionality and there is no explicit driver capability indication to determine this. Signed-off-by: Vinay Gannevaram --- diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index d367eed3f..670366848 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -1463,11 +1463,11 @@ static void qca_nl80211_get_features(struct wpa_driver_nl80211_data *drv) if (check_feature(QCA_WLAN_VENDOR_FEATURE_NAN_USD_OFFLOAD, &info)) drv->capa.flags2 |= WPA_DRIVER_FLAGS2_NAN_OFFLOAD; - if (!check_feature(QCA_WLAN_VENDOR_FEATURE_P2P_V2, &info)) - drv->capa.flags2 &= ~WPA_DRIVER_FLAGS2_P2P_FEATURE_V2; + if (check_feature(QCA_WLAN_VENDOR_FEATURE_P2P_V2, &info)) + drv->capa.flags2 |= WPA_DRIVER_FLAGS2_P2P_FEATURE_V2; - if (!check_feature(QCA_WLAN_VENDOR_FEATURE_PCC_MODE, &info)) - drv->capa.flags2 &= ~WPA_DRIVER_FLAGS2_P2P_FEATURE_PCC_MODE; + if (check_feature(QCA_WLAN_VENDOR_FEATURE_PCC_MODE, &info)) + drv->capa.flags2 |= WPA_DRIVER_FLAGS2_P2P_FEATURE_PCC_MODE; os_free(info.flags); } @@ -1590,10 +1590,12 @@ int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv) drv->capa.flags &= ~WPA_DRIVER_FLAGS_EAPOL_TX_STATUS; /* Enable P2P2 and PCC mode capabilities by default for the drivers - * which can't explicitly indicate whether these capabilities are - * supported. */ - drv->capa.flags2 |= WPA_DRIVER_FLAGS2_P2P_FEATURE_V2; - drv->capa.flags2 |= WPA_DRIVER_FLAGS2_P2P_FEATURE_PCC_MODE; + * for which SME runs in wpa_supplicant + */ + if (drv->capa.flags & WPA_DRIVER_FLAGS_SME) { + drv->capa.flags2 |= WPA_DRIVER_FLAGS2_P2P_FEATURE_V2; + drv->capa.flags2 |= WPA_DRIVER_FLAGS2_P2P_FEATURE_PCC_MODE; + } #ifdef CONFIG_DRIVER_NL80211_QCA if (!(info.capa->flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD))