diff --git a/Kbuild b/Kbuild index 88535b1972..ceb2273407 100644 --- a/Kbuild +++ b/Kbuild @@ -3298,6 +3298,12 @@ ifeq ($(findstring yes, $(found)), yes) ccflags-y += -DCFG80211_EXTERNAL_AUTH_MLO_SUPPORT endif + +found = $(shell if grep -qF "NL80211_EXT_FEATURE_SECURE_NAN" $(srctree)/include/uapi/linux/nl80211.h; then echo "yes"; else echo "no"; fi;) +ifeq ($(findstring yes, $(found)), yes) +ccflags-y += -DCFG80211_EXT_FEATURE_SECURE_NAN +endif + ifeq (qca_cld3, $(WLAN_WEAR_CHIPSET)) ccflags-y += -DWLAN_WEAR_CHIPSET endif diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index f360acb198..a896bffbed 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -19594,6 +19594,24 @@ static void wlan_hdd_set_nan_supported_bands(struct wiphy *wiphy) } #endif +#if defined(WLAN_FEATURE_NAN) && defined(WLAN_EXT_FEATURE_SECURE_NAN) +/** + * wlan_hdd_set_nan_secure_mode - Populate Secure NAN supported by driver + * @wiphy: wiphy + * + * Return: void + */ +static void wlan_hdd_set_nan_secure_mode(struct wiphy *wiphy) +{ + if (sme_is_feature_supported_by_fw(SECURE_NAN)) + wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_SECURE_NAN); +} +#else +static void wlan_hdd_set_nan_secure_mode(struct wiphy *wiphy) +{ +} +#endif + /** * wlan_hdd_update_akm_suit_info() - Populate akm suits supported by driver * @wiphy: wiphy @@ -20184,6 +20202,7 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx) wlan_hdd_set_mlo_wiphy_ext_feature(wiphy, hdd_ctx); wlan_hdd_set_ext_kek_kck_support(wiphy); wlan_hdd_set_32bytes_kck_support(wiphy); + wlan_hdd_set_nan_secure_mode(wiphy); } /** diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index b4913cc1e2..a95ed8da52 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -86,6 +86,7 @@ typedef enum { * RTT - indicate RTT * DOT11AX - indicate 11ax * DOT11BE - indicate 11be + * SECURE_NAN - indicate NAN Pairing protocol * WOW - indicate WOW * WLAN_ROAM_SCAN_OFFLOAD - indicate Roam scan offload * WLAN_PERIODIC_TX_PTRN - indicate WLAN_PERIODIC_TX_PTRN @@ -116,6 +117,9 @@ enum cap_bitmap { DOT11AX = 13, #ifdef WLAN_FEATURE_11BE DOT11BE = 14, +#endif +#ifdef WLAN_FEATURE_NAN + SECURE_NAN = 15, #endif WOW = 22, WLAN_ROAM_SCAN_OFFLOAD = 23, diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 15af6a931b..5468f80613 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -5182,6 +5182,38 @@ static inline void wma_get_dynamic_vdev_macaddr_support( } #endif +#ifdef WLAN_FEATURE_NAN +/** + * wma_nan_set_pairing_feature() - set feature bit for Secure NAN if max + * pairing session has non-zero value. + * + * Return: none + */ +static void wma_nan_set_pairing_feature(void) +{ + tp_wma_handle wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + struct target_psoc_info *tgt_hdl; + struct wlan_objmgr_psoc *psoc; + + if (!wma_handle) { + wma_err("wma handle is null"); + return; + } + + psoc = wma_handle->psoc; + tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); + if (!tgt_hdl) { + wma_err("tgt_hdl is null"); + return; + } + + if (tgt_hdl->info.service_ext2_param.max_nan_pairing_sessions) { + wma_set_fw_wlan_feat_caps(SECURE_NAN); + wma_debug("Secure NAN is enabled"); + } +} +#endif /* WLAN_FEATURE_NAN */ + /** * wma_update_target_services() - update target services from wma handle * @wmi_handle: Unified wmi handle @@ -5274,6 +5306,7 @@ static inline void wma_update_target_services(struct wmi_unified *wmi_handle, #ifdef WLAN_FEATURE_NAN if (wmi_service_enabled(wmi_handle, wmi_service_nan)) g_fw_wlan_feat_caps |= (1 << NAN); + wma_nan_set_pairing_feature(); #endif /* WLAN_FEATURE_NAN */ if (wmi_service_enabled(wmi_handle, wmi_service_rtt))