qcacld-3.0: Update for converged NAN config params
Update driver to use NAN config params based converged CFG
component. Cleanup hdd config references to nan ini params.
Change-Id: I5af85d68ee53ad557e64523f7a1719e328536926
CRs-fixed: 2290360
diff --git a/Kbuild b/Kbuild
index bfd1122..ce0e1d0 100644
--- a/Kbuild
+++ b/Kbuild
@@ -1195,6 +1195,7 @@
$(NAN_CORE_DIR)/nan_api.o \
$(NAN_CORE_DIR)/nan_utils.o \
$(NAN_UCFG_DIR)/nan_ucfg_api.o \
+ $(NAN_UCFG_DIR)/cfg_nan.o \
$(NAN_TGT_DIR)/target_if_nan.o \
$(NAN_OS_IF_DIR)/os_if_nan.o
endif
diff --git a/components/cfg/cfg_all.h b/components/cfg/cfg_all.h
index ff668b6..ffe29c9 100644
--- a/components/cfg/cfg_all.h
+++ b/components/cfg/cfg_all.h
@@ -31,7 +31,14 @@
#define CFG_TDLS_ALL
#endif
+#ifdef WLAN_FEATURE_NAN_CONVERGENCE
+#include "cfg_nan.h"
+#else
+#define CFG_NAN_ALL
+#endif
+
#define CFG_ALL \
CFG_CONVERGED_ALL \
CFG_P2P_ALL \
- CFG_TDLS_ALL
+ CFG_TDLS_ALL \
+ CFG_NAN_ALL
diff --git a/components/pmo/core/inc/wlan_pmo_wow.h b/components/pmo/core/inc/wlan_pmo_wow.h
index ecc2d24..b3a0189 100644
--- a/components/pmo/core/inc/wlan_pmo_wow.h
+++ b/components/pmo/core/inc/wlan_pmo_wow.h
@@ -634,38 +634,6 @@
}
#endif
-#ifdef WLAN_FEATURE_NAN
-/**
- * pmo_is_nan_enabled() - check if NaN is enabled
- * @vdev: objmgr vdev handle
- *
- * WoW is needed if LPASS or NaN feature is enabled in INI because
- * target can't wake up itself if its put in PDEV suspend when LPASS
- * or NaN features are supported
- *
- * Return: true if NaN is enabled else false
- */
-static inline
-bool pmo_core_is_nan_enabled(struct wlan_objmgr_vdev *vdev)
-{
- bool nan_enable;
- struct pmo_vdev_priv_obj *vdev_ctx;
-
- vdev_ctx = pmo_vdev_get_priv(vdev);
- qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock);
- nan_enable = vdev_ctx->pmo_psoc_ctx->psoc_cfg.nan_enable;
- qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock);
-
- return nan_enable;
-}
-#else
-static inline
-bool pmo_core_is_nan_enabled(struct wlan_objmgr_vdev *vdev)
-{
- return false;
-}
-#endif
-
/**
* pmo_get_event_bitmap_idx() - get indices for extended wow bitmaps
* @event: wow event
diff --git a/components/pmo/core/src/wlan_pmo_wow.c b/components/pmo/core/src/wlan_pmo_wow.c
index b783a61..fd4f5bb 100644
--- a/components/pmo/core/src/wlan_pmo_wow.c
+++ b/components/pmo/core/src/wlan_pmo_wow.c
@@ -26,6 +26,7 @@
#include <wlan_scan_ucfg_api.h>
#include "wlan_pmo_static_config.h"
#include "wlan_reg_services_api.h"
+#include "cfg_nan_api.h"
void pmo_set_wow_event_bitmap(WOW_WAKE_EVENT_TYPE event,
uint32_t wow_bitmap_size,
@@ -315,7 +316,7 @@
} else if (pmo_core_is_lpass_enabled(vdev)) {
pmo_debug("LPASS is enabled, enabling WoW");
is_wow_applicable = true;
- } else if (pmo_core_is_nan_enabled(vdev)) {
+ } else if (cfg_nan_get_enable(psoc)) {
pmo_debug("NAN is enabled, enabling WoW");
is_wow_applicable = true;
} else if (pmo_core_get_vdev_op_mode(vdev) == QDF_NDI_MODE) {
diff --git a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h
index 9790491..c6a4b9b 100644
--- a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h
+++ b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h
@@ -278,7 +278,6 @@
* @deauth_enable: true when wake up on deauth is enabled else false
* @disassoc_enable: true when wake up on disassoc is enabled else false
* @bmiss_enable: true when wake up on bmiss is enabled else false
- * @nan_enable: true when nan is enabled else false
* @lpass_enable: true when lpass is enabled else false
* @sta_dynamic_dtim: station dynamic DTIM value
* @sta_mod_dtim: station modulated DTIM value
@@ -305,7 +304,6 @@
bool deauth_enable;
bool disassoc_enable;
bool bmiss_enable;
- bool nan_enable;
bool lpass_enable;
uint8_t sta_dynamic_dtim;
uint8_t sta_mod_dtim;
diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h
index 69212d0..28c697e 100644
--- a/core/cds/inc/cds_config.h
+++ b/core/cds/inc/cds_config.h
@@ -92,7 +92,6 @@
* @tx_flow_stop_queue_th: Threshold to stop queue in percentage
* @tx_flow_start_queue_offset: Start queue offset in percentage
* @is_lpass_enabled: Indicate whether LPASS is enabled or not
- * @is_nan_enabled: Indicate whether NAN is enabled or not
* @bool apf_packet_filter_enable; Indicate apf filter enabled or not
* @tx_chain_mask_cck: Tx chain mask enabled or not
* @self_gen_frm_pwr: Self gen from power
@@ -150,9 +149,6 @@
#ifdef WLAN_FEATURE_LPSS
bool is_lpass_enabled;
#endif
-#ifdef WLAN_FEATURE_NAN
- bool is_nan_enabled;
-#endif
bool apf_packet_filter_enable;
bool tx_chain_mask_cck;
uint16_t self_gen_frm_pwr;
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 7ed8fcb..5a33b56 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -7489,18 +7489,6 @@
#define CFG_ENABLE_LPASS_SUPPORT_MAX (1)
#endif
-/*
- * NaN feature support configuration
- * gEnableNanSupport = 0 means NaN is not supported
- * gEnableNanSupport = 1 means NaN is supported
- */
-#ifdef WLAN_FEATURE_NAN
-#define CFG_ENABLE_NAN_SUPPORT "gEnableNanSupport"
-#define CFG_ENABLE_NAN_SUPPORT_DEFAULT (0)
-#define CFG_ENABLE_NAN_SUPPORT_MIN (0)
-#define CFG_ENABLE_NAN_SUPPORT_MAX (1)
-#endif
-
#define CFG_ENABLE_SELF_RECOVERY "gEnableSelfRecovery"
#define CFG_ENABLE_SELF_RECOVERY_MIN (0)
#define CFG_ENABLE_SELF_RECOVERY_MAX (1)
@@ -8588,26 +8576,6 @@
#define CFG_IGNORE_PEER_HT_MODE_MAX (1)
#define CFG_IGNORE_PEER_HT_MODE_DEFAULT (0)
-#ifdef WLAN_FEATURE_NAN_DATAPATH
-/*
- * Enable NaN data path feature. NaN data path enables
- * NaN supported devices to exchange data over traditional
- * TCP/UDP network stack.
- */
-#define CFG_ENABLE_NAN_DATAPATH_NAME "genable_nan_datapath"
-#define CFG_ENABLE_NAN_DATAPATH_MIN (0)
-#define CFG_ENABLE_NAN_DATAPATH_MAX (1)
-#define CFG_ENABLE_NAN_DATAPATH_DEFAULT (0)
-
-/*
- * NAN channel on which NAN data interface to start
- */
-#define CFG_ENABLE_NAN_NDI_CHANNEL_NAME "gnan_datapath_ndi_channel"
-#define CFG_ENABLE_NAN_NDI_CHANNEL_MIN (6)
-#define CFG_ENABLE_NAN_NDI_CHANNEL_MAX (149)
-#define CFG_ENABLE_NAN_NDI_CHANNEL_DEFAULT (6)
-#endif
-
/*
* Enable/Disable to initiate BUG report in case of fatal event
* Default: Enable
@@ -11540,30 +11508,6 @@
#define CFG_ROAM_NUM_DISALLOWED_APS_MAX (8)
#define CFG_ROAM_NUM_DISALLOWED_APS_DEFAULT (3)
-
-/*
- * <ini>
- * gEnableNDIMacRandomization - When enabled this will randomize NDI Mac
- * @Min: 0
- * @Max: 1
- * @Default: 1
- *
- * When enabled this will randomize NDI Mac
- *
- *
- * Related: None
- *
- * Supported Feature: NAN
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_RANDOMIZE_NDI_MAC_NAME "gEnableNDIMacRandomization"
-#define CFG_RANDOMIZE_NDI_MAC_MIN (0)
-#define CFG_RANDOMIZE_NDI_MAC_MAX (1)
-#define CFG_RANDOMIZE_NDI_MAC_DEFAULT (1)
-
/*
* <ini>
* gEnableLPRx - Enable/Disable LPRx
@@ -14477,9 +14421,6 @@
#ifdef WLAN_FEATURE_LPSS
bool enable_lpass_support;
#endif
-#ifdef WLAN_FEATURE_NAN
- bool enable_nan_support;
-#endif
bool enableSelfRecovery;
#ifdef FEATURE_WLAN_FORCE_SAP_SCC
uint8_t SapSccChanAvoidance;
@@ -14640,10 +14581,6 @@
bool acs_support_for_dfs_ltecoex;
bool bug_report_for_no_scan_results;
bool bug_on_reinit_failure;
-#ifdef WLAN_FEATURE_NAN_DATAPATH
- bool enable_nan_datapath;
- uint8_t nan_datapath_ndi_channel;
-#endif
uint32_t iface_change_wait_time;
/* parameter to control GTX */
uint32_t tgt_gtx_usr_cfg;
@@ -14765,7 +14702,6 @@
uint8_t lower_brssi_thresh;
bool enable_dtim_1chrx;
int8_t rssi_thresh_offset_5g;
- bool is_ndi_mac_randomized;
uint32_t scan_11d_interval;
bool chan_switch_hostapd_rate_enabled;
bool is_bssid_hint_priority;
diff --git a/core/hdd/inc/wlan_hdd_nan.h b/core/hdd/inc/wlan_hdd_nan.h
index 2550571..50b376e 100644
--- a/core/hdd/inc/wlan_hdd_nan.h
+++ b/core/hdd/inc/wlan_hdd_nan.h
@@ -37,31 +37,6 @@
int data_len);
bool wlan_hdd_nan_is_supported(void);
-/**
- * hdd_nan_populate_cds_config() - Populate NAN cds configuration
- * @cds_cfg: CDS Configuration
- * @hdd_ctx: Pointer to hdd context
- *
- * Return: none
- */
-static inline void hdd_nan_populate_cds_config(struct cds_config_info *cds_cfg,
- struct hdd_context *hdd_ctx)
-{
- cds_cfg->is_nan_enabled = hdd_ctx->config->enable_nan_support;
-}
-
-/**
- * hdd_nan_populate_pmo_config() - Populate NAN pmo configuration
- * @pmo_cfg: PMO Configuration
- * @hdd_ctx: Pointer to hdd context
- *
- * Return: none
- */
-static inline void hdd_nan_populate_pmo_config(struct pmo_psoc_cfg *pmo_cfg,
- struct hdd_context *hdd_ctx)
-{
- pmo_cfg->nan_enable = hdd_ctx->config->enable_nan_support;
-}
/**
* wlan_hdd_cfg80211_nan_callback() - cfg80211 NAN event handler
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 1f202b4..40285a4 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -2977,15 +2977,6 @@
CFG_ENABLE_LPASS_SUPPORT_MAX),
#endif
-#ifdef WLAN_FEATURE_NAN
- REG_VARIABLE(CFG_ENABLE_NAN_SUPPORT, WLAN_PARAM_Integer,
- struct hdd_config, enable_nan_support,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_ENABLE_NAN_SUPPORT_DEFAULT,
- CFG_ENABLE_NAN_SUPPORT_MIN,
- CFG_ENABLE_NAN_SUPPORT_MAX),
-#endif
-
REG_VARIABLE(CFG_ENABLE_SELF_RECOVERY, WLAN_PARAM_Integer,
struct hdd_config, enableSelfRecovery,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -3781,22 +3772,6 @@
VAR_FLAGS_OPTIONAL,
(void *) CFG_ENABLE_TX_SCHED_WRR_BK_DEFAULT),
-#ifdef WLAN_FEATURE_NAN_DATAPATH
- REG_VARIABLE(CFG_ENABLE_NAN_DATAPATH_NAME, WLAN_PARAM_Integer,
- struct hdd_config, enable_nan_datapath,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_ENABLE_NAN_DATAPATH_DEFAULT,
- CFG_ENABLE_NAN_DATAPATH_MIN,
- CFG_ENABLE_NAN_DATAPATH_MAX),
-
- REG_VARIABLE(CFG_ENABLE_NAN_NDI_CHANNEL_NAME, WLAN_PARAM_Integer,
- struct hdd_config, nan_datapath_ndi_channel,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_ENABLE_NAN_NDI_CHANNEL_DEFAULT,
- CFG_ENABLE_NAN_NDI_CHANNEL_MIN,
- CFG_ENABLE_NAN_NDI_CHANNEL_MAX),
-#endif
-
REG_VARIABLE(CFG_CREATE_BUG_REPORT_FOR_SCAN, WLAN_PARAM_Integer,
struct hdd_config, bug_report_for_no_scan_results,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -4646,13 +4621,6 @@
CFG_DTIM_1CHRX_ENABLE_MIN,
CFG_DTIM_1CHRX_ENABLE_MAX),
- REG_VARIABLE(CFG_RANDOMIZE_NDI_MAC_NAME, WLAN_PARAM_Integer,
- struct hdd_config, is_ndi_mac_randomized,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_RANDOMIZE_NDI_MAC_DEFAULT,
- CFG_RANDOMIZE_NDI_MAC_MIN,
- CFG_RANDOMIZE_NDI_MAC_MAX),
-
REG_VARIABLE(CFG_SCAN_11D_INTERVAL_NAME, WLAN_PARAM_Integer,
struct hdd_config, scan_11d_interval,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -6962,7 +6930,6 @@
hdd_debug("Name = [%s] Value = [%u]",
CFG_SAP_MAX_INACTIVITY_OVERRIDE_NAME,
hdd_ctx->config->sap_max_inactivity_override);
- hdd_ndp_print_ini_config(hdd_ctx);
hdd_debug("Name = [%s] Value = [%s]",
CFG_RM_CAPABILITY_NAME,
hdd_ctx->config->rm_capability);
@@ -7058,9 +7025,6 @@
CFG_DTIM_1CHRX_ENABLE_NAME,
hdd_ctx->config->enable_dtim_1chrx);
hdd_debug("Name = [%s] value = [%u]",
- CFG_RANDOMIZE_NDI_MAC_NAME,
- hdd_ctx->config->is_ndi_mac_randomized);
- hdd_debug("Name = [%s] value = [%u]",
CFG_DOT11P_MODE_NAME,
hdd_ctx->config->dot11p_mode);
hdd_debug("Name = [%s] value = [%u]",
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 2f1ed52..6e86046 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -9513,7 +9513,6 @@
hdd_ra_populate_cds_config(cds_cfg, hdd_ctx);
hdd_txrx_populate_cds_config(cds_cfg, hdd_ctx);
- hdd_nan_populate_cds_config(cds_cfg, hdd_ctx);
hdd_lpass_populate_cds_config(cds_cfg, hdd_ctx);
cds_init_ini_config(cds_cfg);
return 0;
@@ -13380,7 +13379,6 @@
hdd_ctx->config->auto_pwr_save_fail_mode;
hdd_ra_populate_pmo_config(&psoc_cfg, hdd_ctx);
- hdd_nan_populate_pmo_config(&psoc_cfg, hdd_ctx);
hdd_lpass_populate_pmo_config(&psoc_cfg, hdd_ctx);
status = ucfg_pmo_update_psoc_config(hdd_ctx->hdd_psoc, &psoc_cfg);
diff --git a/core/hdd/src/wlan_hdd_nan.c b/core/hdd/src/wlan_hdd_nan.c
index eb64605..7125683 100644
--- a/core/hdd/src/wlan_hdd_nan.c
+++ b/core/hdd/src/wlan_hdd_nan.c
@@ -32,6 +32,7 @@
#include "wlan_hdd_main.h"
#include "wlan_hdd_nan.h"
#include <qca_vendor.h>
+#include "cfg_nan_api.h"
/**
* __wlan_hdd_cfg80211_nan_request() - cfg80211 NAN request handler
@@ -68,7 +69,7 @@
return -EPERM;
}
- if (!hdd_ctx->config->enable_nan_support) {
+ if (!cfg_nan_get_enable(hdd_ctx->hdd_psoc)) {
hdd_err("NaN support is not enabled in INI");
return -EPERM;
}
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c
index 7b892bd..fa8cfd8 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.c
+++ b/core/hdd/src/wlan_hdd_nan_datapath.c
@@ -36,20 +36,7 @@
#include "os_if_nan.h"
#include "wlan_nan_api.h"
#include "nan_public_structs.h"
-
-/**
- * hdd_ndp_print_ini_config()- Print nan datapath specific INI configuration
- * @hdd_ctx: handle to hdd context
- *
- * Return: None
- */
-void hdd_ndp_print_ini_config(struct hdd_context *hdd_ctx)
-{
- hdd_debug("Name = [%s] Value = [%u]", CFG_ENABLE_NAN_DATAPATH_NAME,
- hdd_ctx->config->enable_nan_datapath);
- hdd_debug("Name = [%s] Value = [%u]", CFG_ENABLE_NAN_NDI_CHANNEL_NAME,
- hdd_ctx->config->nan_datapath_ndi_channel);
-}
+#include "cfg_nan_api.h"
/**
* hdd_nan_datapath_target_config() - Configure NAN datapath features
@@ -62,15 +49,15 @@
* Return: None
*/
void hdd_nan_datapath_target_config(struct hdd_context *hdd_ctx,
- struct wma_tgt_cfg *cfg)
+ struct wma_tgt_cfg *tgt_cfg)
{
hdd_ctx->nan_datapath_enabled =
- hdd_ctx->config->enable_nan_datapath &&
- cfg->nan_datapath_enabled;
- hdd_debug("final: %d, host: %d, fw: %d",
+ cfg_nan_get_datapath_enable(hdd_ctx->hdd_psoc) &&
+ tgt_cfg->nan_datapath_enabled;
+ hdd_debug("NAN Datapath Enable: %d (Host: %d FW: %d)",
hdd_ctx->nan_datapath_enabled,
- hdd_ctx->config->enable_nan_datapath,
- cfg->nan_datapath_enabled);
+ cfg_nan_get_datapath_enable(hdd_ctx->hdd_psoc),
+ tgt_cfg->nan_datapath_enabled);
}
/**
@@ -485,7 +472,7 @@
return -EINVAL;
}
- if (hdd_ctx->config->is_ndi_mac_randomized) {
+ if (cfg_nan_get_ndi_mac_randomize(hdd_ctx->hdd_psoc)) {
if (hdd_get_random_nan_mac_addr(hdd_ctx, &random_ndi_mac)) {
hdd_err("get random mac address failed");
return -EFAULT;
@@ -524,7 +511,7 @@
return -EINVAL;
}
- op_channel = hdd_ctx->config->nan_datapath_ndi_channel;
+ op_channel = cfg_nan_get_ndi_channel(hdd_ctx->hdd_psoc);
adapter = hdd_get_adapter_by_iface_name(hdd_ctx, iface_name);
if (!adapter) {
hdd_err("adapter is null");
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.h b/core/hdd/src/wlan_hdd_nan_datapath.h
index 8958361..8504d8a 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.h
+++ b/core/hdd/src/wlan_hdd_nan_datapath.h
@@ -49,7 +49,6 @@
#endif /* WLAN_FEATURE_NAN_DATAPATH */
#ifdef WLAN_FEATURE_NAN_DATAPATH
-void hdd_ndp_print_ini_config(struct hdd_context *hdd_ctx);
void hdd_nan_datapath_target_config(struct hdd_context *hdd_ctx,
struct wma_tgt_cfg *cfg);
void hdd_ndp_event_handler(struct hdd_adapter *adapter,
@@ -61,9 +60,6 @@
int hdd_init_nan_data_mode(struct hdd_adapter *adapter);
void hdd_ndp_session_end_handler(struct hdd_adapter *adapter);
#else
-static inline void hdd_ndp_print_ini_config(struct hdd_context *hdd_ctx)
-{
-}
static inline void hdd_nan_datapath_target_config(struct hdd_context *hdd_ctx,
struct wma_tgt_cfg *cfg)
{
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index b57caa3..9226cf6 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -89,6 +89,7 @@
#include "target_if_green_ap.h"
#include "service_ready_param.h"
#include "wlan_cp_stats_mc_ucfg_api.h"
+#include "cfg_nan_api.h"
#define WMA_LOG_COMPLETION_TIMER 3000 /* 3 seconds */
#define WMI_TLV_HEADROOM 128
@@ -1814,7 +1815,7 @@
static void wma_set_nan_enable(tp_wma_handle wma_handle,
struct cds_config_info *cds_cfg)
{
- wma_handle->is_nan_enabled = cds_cfg->is_nan_enabled;
+ wma_handle->is_nan_enabled = cfg_nan_get_enable(wma_handle->psoc);
}
#else
static void wma_set_nan_enable(tp_wma_handle wma_handle,