Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d51b14c3 authored by Krunal Soni's avatar Krunal Soni Committed by Akash Patel
Browse files

qcacld-3.0: Merge two sme & csr config structure in to one

SME holds config item in tCsrConfigParams structure as well as some of
the same items in tSmeConfigParams which makes tCsrConfigParams super
set of tSmeConfigParams. There are high chances if somebody misses
copying item from tSmeConfigParams to tCsrConfigParams and that will
result in config item not being set correctly.

In order to make it clean and easy, merge both config structure in one.

Change-Id: I8c93d9fae0986cb90b4ed4c4712b1e2b023b4be3
CRs-Fixed: 963752
parent 6d761723
Loading
Loading
Loading
Loading
+23 −20
Original line number Diff line number Diff line
@@ -5543,10 +5543,11 @@ static void hdd_set_fine_time_meas_cap(hdd_context_t *hdd_ctx,

	/* Make sure only supported capabilities are enabled in INI */
	capability &= CFG_FINE_TIME_MEAS_CAPABILITY_MAX;
	sme_config->fine_time_meas_cap = capability;
	sme_config->csrConfig.fine_time_meas_cap = capability;

	hddLog(LOG1, FL("fine time meas capability - INI: %04x Enabled: %04x"),
		config->fine_time_meas_cap, sme_config->fine_time_meas_cap);
		config->fine_time_meas_cap,
		sme_config->csrConfig.fine_time_meas_cap);

	return;
}
@@ -6369,14 +6370,15 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx)
void hdd_set_pno_channel_prediction_config(
		tpSmeConfigParams sme_config, hdd_context_t *hdd_ctx)
{
	sme_config->dual_mac_feature_disable =
	sme_config->csrConfig.dual_mac_feature_disable =
		hdd_ctx->config->dual_mac_feature_disable;
	sme_config->pno_channel_prediction =
	sme_config->csrConfig.pno_channel_prediction =
		hdd_ctx->config->pno_channel_prediction;
	sme_config->top_k_num_of_channels =
	sme_config->csrConfig.top_k_num_of_channels =
		hdd_ctx->config->top_k_num_of_channels;
	sme_config->stationary_thresh = hdd_ctx->config->stationary_thresh;
	sme_config->channel_prediction_full_scan =
	sme_config->csrConfig.stationary_thresh =
		hdd_ctx->config->stationary_thresh;
	sme_config->csrConfig.channel_prediction_full_scan =
		hdd_ctx->config->channel_prediction_full_scan;
}
#endif
@@ -6635,17 +6637,18 @@ CDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)

#ifdef FEATURE_WLAN_SCAN_PNO
	/* Update PNO offoad status */
	smeConfig->pnoOffload = pHddCtx->config->PnoOffload;
	smeConfig->csrConfig.pnoOffload = pHddCtx->config->PnoOffload;
#endif

	/* Update maximum interfaces information */
	smeConfig->max_intf_count = pHddCtx->max_intf_count;
	smeConfig->csrConfig.max_intf_count = pHddCtx->max_intf_count;

	smeConfig->fEnableDebugLog = pHddCtx->config->gEnableDebugLog;
	smeConfig->csrConfig.fEnableDebugLog = pHddCtx->config->gEnableDebugLog;

	smeConfig->enable5gEBT = pHddCtx->config->enable5gEBT;
	smeConfig->csrConfig.enable5gEBT = pHddCtx->config->enable5gEBT;

	smeConfig->enableSelfRecovery = pHddCtx->config->enableSelfRecovery;
	smeConfig->csrConfig.enableSelfRecovery =
			pHddCtx->config->enableSelfRecovery;
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
	smeConfig->csrConfig.isRoamOffloadEnabled =
		pHddCtx->config->isRoamOffloadEnabled;
@@ -6657,25 +6660,25 @@ CDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
	smeConfig->csrConfig.is_sta_connection_in_5gz_enabled =
		pHddCtx->config->is_sta_connection_in_5gz_enabled;

	smeConfig->f_sta_miracast_mcc_rest_time_val =
	smeConfig->csrConfig.f_sta_miracast_mcc_rest_time_val =
		pHddCtx->config->sta_miracast_mcc_rest_time_val;

#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
	smeConfig->sap_channel_avoidance =
	smeConfig->csrConfig.sap_channel_avoidance =
		pHddCtx->config->sap_channel_avoidance;
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */

	smeConfig->f_prefer_non_dfs_on_radar =
	smeConfig->csrConfig.f_prefer_non_dfs_on_radar =
		pHddCtx->config->prefer_non_dfs_on_radar;

	smeConfig->is_ps_enabled = pHddCtx->config->is_ps_enabled;
	smeConfig->csrConfig.is_ps_enabled = pHddCtx->config->is_ps_enabled;
	hdd_set_fine_time_meas_cap(pHddCtx, smeConfig);

	cds_set_multicast_logging(pHddCtx->config->multicast_host_fw_msgs);

	smeConfig->csrConfig.sendDeauthBeforeCon = pConfig->sendDeauthBeforeCon;

	smeConfig->policy_manager_enabled =
	smeConfig->csrConfig.policy_manager_enabled =
			pHddCtx->config->policy_manager_enabled;
	smeConfig->csrConfig.max_scan_count =
			pHddCtx->config->max_scan_count;
@@ -6685,11 +6688,11 @@ CDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
		(pHddCtx->config->dot11p_mode != WLAN_HDD_11P_DISABLED);
	hdd_set_pno_channel_prediction_config(smeConfig, pHddCtx);

	smeConfig->early_stop_scan_enable =
	smeConfig->csrConfig.early_stop_scan_enable =
		pHddCtx->config->early_stop_scan_enable;
	smeConfig->early_stop_scan_min_threshold =
	smeConfig->csrConfig.early_stop_scan_min_threshold =
		pHddCtx->config->early_stop_scan_min_threshold;
	smeConfig->early_stop_scan_max_threshold =
	smeConfig->csrConfig.early_stop_scan_max_threshold =
		pHddCtx->config->early_stop_scan_max_threshold;
	smeConfig->csrConfig.first_scan_bucket_threshold =
		pHddCtx->config->first_scan_bucket_threshold;
+14 −0
Original line number Diff line number Diff line
@@ -1219,6 +1219,20 @@ typedef struct tagCsrConfigParam {
	int8_t early_stop_scan_min_threshold;
	int8_t early_stop_scan_max_threshold;
	int8_t first_scan_bucket_threshold;
	bool pnoOffload;
	uint8_t fEnableDebugLog;
	uint8_t max_intf_count;
	bool enable5gEBT;
	bool enableSelfRecovery;
	uint32_t f_sta_miracast_mcc_rest_time_val;
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
	bool sap_channel_avoidance;
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
	uint8_t f_prefer_non_dfs_on_radar;
	bool is_ps_enabled;
	bool policy_manager_enabled;
	uint32_t fine_time_meas_cap;
	uint32_t dual_mac_feature_disable;
} tCsrConfigParam;

/* Tush */
+2 −35
Original line number Diff line number Diff line
@@ -93,39 +93,6 @@ typedef struct _smeConfigParams {
#if defined WLAN_FEATURE_VOWIFI
	struct rrm_config_param rrmConfig;
#endif
	uint8_t isFastRoamIniFeatureEnabled;
	uint8_t MAWCEnabled;
#if defined FEATURE_WLAN_ESE
	uint8_t isEseIniFeatureEnabled;
#endif
	uint8_t isFastTransitionEnabled;
	uint8_t RoamRssiDiff;
	bool isWESModeEnabled;
	uint8_t isAmsduSupportInAMPDU;
	bool pnoOffload;
	uint8_t fEnableDebugLog;
	uint8_t max_intf_count;
	bool enable5gEBT;
	bool enableSelfRecovery;
	uint32_t f_sta_miracast_mcc_rest_time_val;
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
	bool sap_channel_avoidance;
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
	uint8_t f_prefer_non_dfs_on_radar;
	bool is_ps_enabled;
	bool policy_manager_enabled;
	uint32_t fine_time_meas_cap;
	uint32_t dual_mac_feature_disable;
#ifdef FEATURE_WLAN_SCAN_PNO
	bool pno_channel_prediction;
	uint8_t top_k_num_of_channels;
	uint8_t stationary_thresh;
	uint32_t channel_prediction_full_scan;
#endif
	bool early_stop_scan_enable;
	int8_t early_stop_scan_min_threshold;
	int8_t early_stop_scan_max_threshold;
	int8_t first_scan_bucket_threshold;
} tSmeConfigParams, *tpSmeConfigParams;

#ifdef FEATURE_WLAN_TDLS
@@ -242,11 +209,11 @@ CDF_STATUS sme_update_roam_params(tHalHandle hHal, uint8_t session_id,
		struct roam_ext_params roam_params_src, int update_param);
#ifdef FEATURE_WLAN_SCAN_PNO
void sme_update_roam_pno_channel_prediction_config(
		tHalHandle hal, tpSmeConfigParams sme_config,
		tHalHandle hal, tCsrConfigParam * csr_config,
		uint8_t copy_from_to);
#else
static inline void sme_update_roam_pno_channel_prediction_config(
		tHalHandle hal, tpSmeConfigParams sme_config,
		tHalHandle hal, tCsrConfigParam *csr_config,
		uint8_t copy_from_to)
{}
#endif
+12 −79
Original line number Diff line number Diff line
@@ -1384,47 +1384,6 @@ CDF_STATUS sme_update_config(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams
		CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_ERROR,
			  "Could not pass on WNI_CFG_SCAN_IN_POWERSAVE to CFG");
	}
	pMac->isCoalesingInIBSSAllowed =
		pSmeConfigParams->csrConfig.isCoalesingInIBSSAllowed;

	/* update p2p offload status */
	pMac->pnoOffload = pSmeConfigParams->pnoOffload;

	pMac->fEnableDebugLog = pSmeConfigParams->fEnableDebugLog;

	/* update interface configuration */
	pMac->sme.max_intf_count = pSmeConfigParams->max_intf_count;

	pMac->enable5gEBT = pSmeConfigParams->enable5gEBT;
	pMac->sme.enableSelfRecovery = pSmeConfigParams->enableSelfRecovery;

	pMac->f_sta_miracast_mcc_rest_time_val =
		pSmeConfigParams->f_sta_miracast_mcc_rest_time_val;

#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
	pMac->sap.sap_channel_avoidance =
		pSmeConfigParams->sap_channel_avoidance;
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */

	pMac->f_prefer_non_dfs_on_radar =
		pSmeConfigParams->f_prefer_non_dfs_on_radar;

	pMac->sme.ps_global_info.ps_enabled =
		pSmeConfigParams->is_ps_enabled;

	pMac->policy_manager_enabled = pSmeConfigParams->policy_manager_enabled;
	pMac->fine_time_meas_cap = pSmeConfigParams->fine_time_meas_cap;
	pMac->dual_mac_feature_disable =
				pSmeConfigParams->dual_mac_feature_disable;
	sme_update_roam_pno_channel_prediction_config(pMac, pSmeConfigParams,
			SME_CONFIG_TO_ROAM_CONFIG);
	pMac->roam.configParam.early_stop_scan_enable =
		pSmeConfigParams->early_stop_scan_enable;
	pMac->roam.configParam.early_stop_scan_min_threshold =
		pSmeConfigParams->early_stop_scan_min_threshold;
	pMac->roam.configParam.early_stop_scan_max_threshold =
		pSmeConfigParams->early_stop_scan_max_threshold;

	return status;
}

@@ -4252,32 +4211,6 @@ CDF_STATUS sme_get_config_param(tHalHandle hHal, tSmeConfigParams *pParam)
			sme_release_global_lock(&pMac->sme);
			return status;
		}
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
		pParam->sap_channel_avoidance = pMac->sap.sap_channel_avoidance;
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
		pParam->max_intf_count = pMac->sme.max_intf_count;
		pParam->enableSelfRecovery = pMac->sme.enableSelfRecovery;
		pParam->pnoOffload = pMac->pnoOffload;
		pParam->f_prefer_non_dfs_on_radar =
						pMac->f_prefer_non_dfs_on_radar;
		pParam->policy_manager_enabled = pMac->policy_manager_enabled;
		pParam->fine_time_meas_cap = pMac->fine_time_meas_cap;
		pParam->dual_mac_feature_disable =
						pMac->dual_mac_feature_disable;
		pParam->is_ps_enabled = pMac->sme.ps_global_info.ps_enabled;
		pParam->pnoOffload = pMac->pnoOffload;
		pParam->fEnableDebugLog = pMac->fEnableDebugLog;
		pParam->enable5gEBT = pMac->enable5gEBT;
		pParam->f_sta_miracast_mcc_rest_time_val =
			pMac->f_sta_miracast_mcc_rest_time_val;
		sme_update_roam_pno_channel_prediction_config(pMac, pParam,
				ROAM_CONFIG_TO_SME_CONFIG);
		pParam->early_stop_scan_enable =
			pMac->roam.configParam.early_stop_scan_enable;
		pParam->early_stop_scan_min_threshold =
			pMac->roam.configParam.early_stop_scan_min_threshold;
		pParam->early_stop_scan_max_threshold =
			pMac->roam.configParam.early_stop_scan_max_threshold;
		cdf_mem_copy(&pParam->rrmConfig,
				&pMac->rrm.rrmSmeContext.rrmConfig,
				sizeof(pMac->rrm.rrmSmeContext.rrmConfig));
@@ -6849,7 +6782,7 @@ uint16_t sme_check_concurrent_channel_overlap(tHalHandle hHal, uint16_t sap_ch,
#ifdef FEATURE_WLAN_SCAN_PNO
/**
 * sme_update_roam_pno_channel_prediction_config() - Update PNO config
 * @sme_config:      config from SME context
 * @csr_config:      config from SME context
 * @hal:             Global Hal handle
 * @copy_from_to:    Used to specify the source and destination
 *
@@ -6859,27 +6792,27 @@ uint16_t sme_check_concurrent_channel_overlap(tHalHandle hHal, uint16_t sap_ch,
 * Return: None
 */
void sme_update_roam_pno_channel_prediction_config(
		tHalHandle hal, tpSmeConfigParams sme_config,
		tHalHandle hal, tCsrConfigParam *csr_config,
		uint8_t copy_from_to)
{
	tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
	if (copy_from_to == SME_CONFIG_TO_ROAM_CONFIG) {
		mac_ctx->roam.configParam.pno_channel_prediction =
			sme_config->pno_channel_prediction;
			csr_config->pno_channel_prediction;
		mac_ctx->roam.configParam.top_k_num_of_channels =
			sme_config->top_k_num_of_channels;
			csr_config->top_k_num_of_channels;
		mac_ctx->roam.configParam.stationary_thresh =
			sme_config->stationary_thresh;
			csr_config->stationary_thresh;
		mac_ctx->roam.configParam.channel_prediction_full_scan =
			sme_config->channel_prediction_full_scan;
			csr_config->channel_prediction_full_scan;
	} else if (copy_from_to == ROAM_CONFIG_TO_SME_CONFIG) {
		sme_config->pno_channel_prediction =
		csr_config->pno_channel_prediction =
			mac_ctx->roam.configParam.pno_channel_prediction;
		sme_config->top_k_num_of_channels =
		csr_config->top_k_num_of_channels =
			mac_ctx->roam.configParam.top_k_num_of_channels;
		sme_config->stationary_thresh =
		csr_config->stationary_thresh =
			mac_ctx->roam.configParam.stationary_thresh;
		sme_config->channel_prediction_full_scan =
		csr_config->channel_prediction_full_scan =
			mac_ctx->roam.configParam.channel_prediction_full_scan;
	}

+63 −0
Original line number Diff line number Diff line
@@ -2079,7 +2079,45 @@ CDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac,
			pParam->early_stop_scan_min_threshold;
		pMac->roam.configParam.early_stop_scan_max_threshold =
			pParam->early_stop_scan_max_threshold;
		pMac->isCoalesingInIBSSAllowed =
			pParam->isCoalesingInIBSSAllowed;
		/* update p2p offload status */
		pMac->pnoOffload = pParam->pnoOffload;
		pMac->fEnableDebugLog = pParam->fEnableDebugLog;
		/* update interface configuration */
		pMac->sme.max_intf_count = pParam->max_intf_count;
		pMac->enable5gEBT = pParam->enable5gEBT;
		pMac->sme.enableSelfRecovery = pParam->enableSelfRecovery;
		pMac->f_sta_miracast_mcc_rest_time_val =
			pParam->f_sta_miracast_mcc_rest_time_val;
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
		pMac->sap.sap_channel_avoidance =
			pParam->sap_channel_avoidance;
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
		pMac->f_prefer_non_dfs_on_radar =
			pParam->f_prefer_non_dfs_on_radar;
		pMac->sme.ps_global_info.ps_enabled =
			pParam->is_ps_enabled;
		pMac->policy_manager_enabled = pParam->policy_manager_enabled;
		pMac->fine_time_meas_cap = pParam->fine_time_meas_cap;
		pMac->dual_mac_feature_disable =
			pParam->dual_mac_feature_disable;
		sme_update_roam_pno_channel_prediction_config(pMac, pParam,
				SME_CONFIG_TO_ROAM_CONFIG);
		pMac->roam.configParam.early_stop_scan_enable =
			pParam->early_stop_scan_enable;
		pMac->roam.configParam.early_stop_scan_min_threshold =
			pParam->early_stop_scan_min_threshold;
		pMac->roam.configParam.early_stop_scan_max_threshold =
			pParam->early_stop_scan_max_threshold;
	}
	return status;
@@ -2222,6 +2260,31 @@ CDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
	pParam->max_scan_count = pMac->scan.max_scan_count;
	pParam->first_scan_bucket_threshold =
		pMac->first_scan_bucket_threshold;
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
	pParam->sap_channel_avoidance = pMac->sap.sap_channel_avoidance;
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
	pParam->max_intf_count = pMac->sme.max_intf_count;
	pParam->enableSelfRecovery = pMac->sme.enableSelfRecovery;
	pParam->pnoOffload = pMac->pnoOffload;
	pParam->f_prefer_non_dfs_on_radar =
		pMac->f_prefer_non_dfs_on_radar;
	pParam->policy_manager_enabled = pMac->policy_manager_enabled;
	pParam->fine_time_meas_cap = pMac->fine_time_meas_cap;
	pParam->dual_mac_feature_disable =
		pMac->dual_mac_feature_disable;
	pParam->is_ps_enabled = pMac->sme.ps_global_info.ps_enabled;
	pParam->fEnableDebugLog = pMac->fEnableDebugLog;
	pParam->enable5gEBT = pMac->enable5gEBT;
	pParam->f_sta_miracast_mcc_rest_time_val =
		pMac->f_sta_miracast_mcc_rest_time_val;
	sme_update_roam_pno_channel_prediction_config(pMac, pParam,
			ROAM_CONFIG_TO_SME_CONFIG);
	pParam->early_stop_scan_enable =
		pMac->roam.configParam.early_stop_scan_enable;
	pParam->early_stop_scan_min_threshold =
		pMac->roam.configParam.early_stop_scan_min_threshold;
	pParam->early_stop_scan_max_threshold =
		pMac->roam.configParam.early_stop_scan_max_threshold;
	return CDF_STATUS_SUCCESS;
}