Browse Source

qcacld-3.0: Add INI to enable/disable NAN EHT cap

As per new requirement, add INI parameter to enable/disable NAN
EHT capability.
Host driver checks this INI value to decide whether it need to
send EHT IE capabilities for NAN and NDI VDEV or not.

Change-Id: I056c174cbc9a7ed2cf6318e43ed431e6c6e5ed30
CRs-Fixed: 3657226
Rahul Gusain 1 year ago
parent
commit
995b7ffc4a

+ 2 - 0
components/nan/core/src/nan_main_i.h

@@ -103,6 +103,7 @@ enum nan_disc_state {
  *                      configuration in firmware. It's sent to firmware through
  *                      wmi_vdev_param_enable_disable_nan_config_features
  * @disable_6g_nan: Disable NAN in 6GHz frequency band
+ * @enable_nan_eht_cap: Enable(1)/Disable(0) NAN EHT capability
  */
 struct nan_cfg_params {
 	bool enable;
@@ -116,6 +117,7 @@ struct nan_cfg_params {
 	uint32_t max_ndi;
 	uint32_t nan_feature_config;
 	bool disable_6g_nan;
+	bool enable_nan_eht_cap;
 };
 
 /**

+ 25 - 2
components/nan/dispatcher/inc/cfg_nan.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -295,6 +295,28 @@
 					0, \
 					"Disable NAN Support in 6GHz")
 
+/*
+ * <ini>
+ * g_nan_enable_eht_cap- enable/disable NAN EHT CAP
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enable/disable NAN EHT capability
+ *
+ * Related: None
+ *
+ * Supported Feature: NAN
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_NAN_ENABLE_EHT_CAP CFG_INI_BOOL("g_nan_enable_eht_cap", \
+					     0, \
+					     "Enable NAN EHT CAP")
+
+
 #ifdef WLAN_FEATURE_NAN
 #define CFG_NAN_DISC CFG(CFG_NAN_ENABLE) \
 			CFG(CFG_DISABLE_6G_NAN) \
@@ -313,6 +335,7 @@
 			CFG_NAN_DP \
 			CFG(CFG_NDP_MAX_SESSIONS) \
 			CFG(CFG_NDI_MAX_SUPPORT) \
-			CFG(CFG_NAN_FEATURE_CONFIG)
+			CFG(CFG_NAN_FEATURE_CONFIG) \
+			CFG(CFG_NAN_ENABLE_EHT_CAP)
 
 #endif

+ 16 - 1
components/nan/dispatcher/inc/cfg_nan_api.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -110,6 +110,15 @@ bool cfg_nan_get_support_mp0_discovery(struct wlan_objmgr_psoc *psoc);
  * Return: true on sta roam disable by nan else false
  */
 bool cfg_nan_is_roam_config_disabled(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * cfg_nan_is_eht_cap_enable() - Get NAN EHT capability
+ * @psoc: pointer to psoc object
+ *
+ * Return: Boolean flag indicating whether the NAN EHT capability is
+ * disabled or not
+ */
+bool cfg_nan_is_eht_cap_enable(struct wlan_objmgr_psoc *psoc);
 #else
 static inline
 bool cfg_nan_is_roam_config_disabled(struct wlan_objmgr_psoc *psoc)
@@ -165,6 +174,12 @@ static inline bool cfg_nan_get_support_mp0_discovery(
 	return false;
 }
 
+
+static inline bool cfg_nan_is_eht_cap_enable(struct wlan_objmgr_psoc *psoc)
+{
+	return false;
+}
+
 #endif
 
 #endif

+ 16 - 0
components/nan/dispatcher/inc/wlan_nan_api_i.h

@@ -54,6 +54,16 @@ uint8_t wlan_nan_get_vdev_id_from_bssid(struct wlan_objmgr_pdev *pdev,
  * Return: True if Discovery is active
  */
 bool wlan_nan_is_disc_active(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * wlan_nan_is_eht_capable() - Get NAN EHT capability
+ * @psoc: pointer to psoc object
+ *
+ * Return: Boolean flag indicating whether the NAN EHT capability is
+ * disabled or not
+ */
+bool wlan_nan_is_eht_capable(struct wlan_objmgr_psoc *psoc);
+
 #else
 static inline
 enum nan_datapath_state wlan_nan_get_ndi_state(struct wlan_objmgr_vdev *vdev)
@@ -74,5 +84,11 @@ bool wlan_nan_is_disc_active(struct wlan_objmgr_psoc *psoc)
 {
 	return false;
 }
+
+static inline bool
+wlan_nan_is_eht_capable(struct wlan_objmgr_psoc *psoc)
+{
+	return false;
+}
 #endif /*WLAN_FEATURE_NAN */
 #endif /*_WLAN_NAN_API_I_H_ */

+ 13 - 0
components/nan/dispatcher/src/cfg_nan.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -149,3 +150,15 @@ bool cfg_nan_is_roam_config_disabled(struct wlan_objmgr_psoc *psoc)
 
 	return false;
 }
+
+bool cfg_nan_is_eht_cap_enable(struct wlan_objmgr_psoc *psoc)
+{
+	struct nan_psoc_priv_obj *nan_obj = cfg_nan_get_priv_obj(psoc);
+
+	if (!nan_obj) {
+		nan_err("nan psoc priv object is NULL");
+		return cfg_default(CFG_NAN_ENABLE_EHT_CAP);
+	}
+
+	return nan_obj->cfg_param.enable_nan_eht_cap;
+}

+ 2 - 0
components/nan/dispatcher/src/nan_ucfg_api.c

@@ -65,6 +65,8 @@ static void nan_cfg_init(struct wlan_objmgr_psoc *psoc,
 	nan_obj->cfg_param.nan_feature_config =
 					cfg_get(psoc, CFG_NAN_FEATURE_CONFIG);
 	nan_obj->cfg_param.disable_6g_nan = cfg_get(psoc, CFG_DISABLE_6G_NAN);
+	nan_obj->cfg_param.enable_nan_eht_cap =
+					cfg_get(psoc, CFG_NAN_ENABLE_EHT_CAP);
 }
 
 /**

+ 6 - 0
components/nan/dispatcher/src/wlan_nan_api.c

@@ -23,6 +23,7 @@
 #include "../../core/src/nan_main_i.h"
 #include "wlan_objmgr_vdev_obj.h"
 #include "wlan_nan_api_i.h"
+#include "cfg_nan_api.h"
 
 inline enum nan_datapath_state wlan_nan_get_ndi_state(
 					struct wlan_objmgr_vdev *vdev)
@@ -53,3 +54,8 @@ bool wlan_nan_is_disc_active(struct wlan_objmgr_psoc *psoc)
 {
 	return nan_is_disc_active(psoc);
 }
+
+bool wlan_nan_is_eht_capable(struct wlan_objmgr_psoc *psoc)
+{
+	return cfg_nan_is_eht_cap_enable(psoc);
+}

+ 14 - 3
core/mac/src/pe/lim/lim_utils.c

@@ -84,6 +84,7 @@
 #include "parser_api.h"
 #include "wlan_mlo_mgr_link_switch.h"
 #include "wlan_epcs_api.h"
+#include "wlan_nan_api_i.h"
 
 /** -------------------------------------------------------------
    \fn lim_delete_dialogue_token_list
@@ -6050,6 +6051,7 @@ QDF_STATUS lim_send_ies_per_band(struct mac_context *mac_ctx, uint8_t vdev_id,
 	QDF_STATUS status_ht = QDF_STATUS_SUCCESS;
 	QDF_STATUS status_vht = QDF_STATUS_SUCCESS;
 	QDF_STATUS status_he = QDF_STATUS_SUCCESS;
+	QDF_STATUS status_eht = QDF_STATUS_SUCCESS;
 
 	/*
 	 * Note: Do not use Dot11f VHT structure, since 1 byte present flag in
@@ -6070,12 +6072,21 @@ QDF_STATUS lim_send_ies_per_band(struct mac_context *mac_ctx, uint8_t vdev_id,
 								vdev_id);
 	}
 
-	if (is_dot11mode_support_eht_cap(dot11_mode))
-		status_he = lim_send_eht_caps_ie(mac_ctx, device_mode, vdev_id);
+	if (is_dot11mode_support_eht_cap(dot11_mode)) {
+		if ((device_mode == QDF_NAN_DISC_MODE ||
+		     device_mode == QDF_NDI_MODE) &&
+		    !wlan_nan_is_eht_capable(mac_ctx->psoc))
+			goto end;
 
+		status_eht = lim_send_eht_caps_ie(mac_ctx, device_mode,
+						  vdev_id);
+	}
+
+end:
 	if (QDF_IS_STATUS_SUCCESS(status_ht) &&
 	    QDF_IS_STATUS_SUCCESS(status_vht) &&
-	    QDF_IS_STATUS_SUCCESS(status_he))
+	    QDF_IS_STATUS_SUCCESS(status_he) &&
+	    QDF_IS_STATUS_SUCCESS(status_eht))
 		return QDF_STATUS_SUCCESS;
 
 	return QDF_STATUS_E_FAILURE;