Parcourir la source

qcacld-3.0: Refactor scan cfg items

Refactor following scan CFG items
1. CFG_ENABLE_CONNECTED_SCAN
2. CFG_ENABLE_SNR_MONITORING

Change-Id: I936cc949c2682c5552e639cd2b1635e0dd0235e6
CRs-Fixed: 2405703
Sandeep Puligilla il y a 6 ans
Parent
commit
d78870293b

+ 0 - 47
core/hdd/inc/wlan_hdd_cfg.h

@@ -51,52 +51,6 @@ struct hdd_context;
 #define MAX_CFG_INI_ITEMS   1024
 
 /* Defines for all of the things we read from the configuration (registry). */
-/*
- * <ini>
- * gEnableConnectedScan - Will enable or disable scan in connected state
- * @Min: 0
- * @Max: 1
- * @Default: 1
- *
- * This ini is used to enable or disable the scanning in
- * Connected state
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: External
- *
- * <ini>
- */
-
-#define CFG_ENABLE_CONNECTED_SCAN_NAME        "gEnableConnectedScan"
-#define CFG_ENABLE_CONNECTED_SCAN_MIN         (0)
-#define CFG_ENABLE_CONNECTED_SCAN_MAX         (1)
-#define CFG_ENABLE_CONNECTED_SCAN_DEFAULT     (1)
-
-/*
- * <ini>
- * gEnableSNRMonitoring - Enables SNR Monitoring
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * This ini is used to set default snr monitor
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-
-#define CFG_ENABLE_SNR_MONITORING_NAME              "gEnableSNRMonitoring"
-#define CFG_ENABLE_SNR_MONITORING_MIN               (0)
-#define CFG_ENABLE_SNR_MONITORING_MAX               (1)
-#define CFG_ENABLE_SNR_MONITORING_DEFAULT           (0)
 
 #ifdef CONFIG_DP_TRACE
 /* Max length of gDptraceConfig string. e.g.- "1, 6, 1, 62" */
@@ -153,7 +107,6 @@ struct hdd_config {
 	DECLARE_BITMAP(bExplicitCfg, MAX_CFG_INI_ITEMS);
 
 	/* Config parameters */
-	bool enable_connected_scan;
 	enum hdd_dot11_mode dot11Mode;
 
 #ifdef FEATURE_WLAN_DYNAMIC_CVM

+ 0 - 15
core/hdd/src/wlan_hdd_cfg.c

@@ -49,19 +49,6 @@
 #include "hdd_dp_cfg.h"
 
 struct reg_table_entry g_registry_table[] = {
-	REG_VARIABLE(CFG_ENABLE_CONNECTED_SCAN_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_connected_scan,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_CONNECTED_SCAN_DEFAULT,
-		     CFG_ENABLE_CONNECTED_SCAN_MIN,
-		     CFG_ENABLE_CONNECTED_SCAN_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_SNR_MONITORING_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableSNRMonitoring,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ENABLE_SNR_MONITORING_DEFAULT,
-		     CFG_ENABLE_SNR_MONITORING_MIN,
-		     CFG_ENABLE_SNR_MONITORING_MAX),
 };
 
 
@@ -1397,8 +1384,6 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
 		CSR_STA_ROAM_POLICY_DFS_ENABLED;
 	smeConfig->csrConfig.sta_roam_policy_params.skip_unsafe_channels = 0;
 
-	smeConfig->snr_monitor_enabled = hdd_ctx->config->fEnableSNRMonitoring;
-
 	status = hdd_set_sme_cfgs_related_to_mlme(hdd_ctx, smeConfig);
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		hdd_err("hdd_set_sme_cfgs_related_to_mlme() fail: %d", status);

+ 2 - 3
core/hdd/src/wlan_hdd_main.c

@@ -14507,12 +14507,11 @@ static int hdd_update_dfs_config(struct hdd_context *hdd_ctx)
 static int hdd_update_scan_config(struct hdd_context *hdd_ctx)
 {
 	struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc;
-	struct scan_user_cfg scan_cfg = {0};
-	struct hdd_config *cfg = hdd_ctx->config;
+	struct scan_user_cfg scan_cfg;
 	QDF_STATUS status;
 	uint32_t mcast_mcc_rest_time = 0;
 
-	scan_cfg.is_snr_monitoring_enabled = cfg->fEnableSNRMonitoring;
+	qdf_mem_zero(&scan_cfg, sizeof(scan_cfg));
 	status = ucfg_mlme_get_sta_miracast_mcc_rest_time(hdd_ctx->psoc,
 							  &mcast_mcc_rest_time);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {

+ 8 - 2
core/hdd/src/wlan_hdd_scan.c

@@ -468,6 +468,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 	bool self_recovery;
 	struct wlan_objmgr_vdev *vdev;
 	QDF_STATUS qdf_status;
+	bool enable_connected_scan;
 
 	hdd_enter();
 
@@ -501,10 +502,12 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 		return -EIO;
 	}
 
+	enable_connected_scan = ucfg_scan_is_connected_scan_enabled(
+							hdd_ctx->psoc);
 	if ((eConnectionState_Associated ==
 			WLAN_HDD_GET_STATION_CTX_PTR(adapter)->
 						conn_info.conn_state) &&
-	    (!hdd_ctx->config->enable_connected_scan)) {
+	    (!enable_connected_scan)) {
 		hdd_info("enable_connected_scan is false, Aborting scan");
 		if (wlan_hdd_enqueue_blocked_scan_request(dev, request, source))
 			return -EAGAIN;
@@ -1275,6 +1278,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
 	int ret;
 	bool pno_offload_enabled;
 	uint8_t scan_backoff_multiplier;
+	bool enable_connected_scan;
 
 	hdd_enter();
 
@@ -1302,10 +1306,12 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
+	enable_connected_scan = ucfg_scan_is_connected_scan_enabled(
+							hdd_ctx->psoc);
 	if ((eConnectionState_Associated ==
 				WLAN_HDD_GET_STATION_CTX_PTR(adapter)->
 							conn_info.conn_state) &&
-	    (!hdd_ctx->config->enable_connected_scan)) {
+	    (!enable_connected_scan)) {
 		hdd_info("enable_connected_scan is false, Aborting scan");
 		return -EBUSY;
 	}

+ 0 - 1
core/mac/inc/ani_global.h

@@ -796,7 +796,6 @@ struct mac_context {
 	uint32_t rx_packet_drop_counter;
 	enum auth_tx_ack_status auth_ack_status;
 	uint8_t user_configured_nss;
-	bool snr_monitor_enabled;
 	bool ignore_assoc_disallowed;
 	uint32_t peer_rssi;
 	uint32_t peer_txrate;

+ 0 - 1
core/sme/inc/sme_api.h

@@ -132,7 +132,6 @@
 typedef struct _smeConfigParams {
 	tCsrConfigParam csrConfig;
 	struct rrm_config_param rrmConfig;
-	bool snr_monitor_enabled;
 } tSmeConfigParams, *tpSmeConfigParams;
 
 #ifdef FEATURE_WLAN_TDLS

+ 0 - 3
core/sme/src/common/sme_api.c

@@ -917,8 +917,6 @@ QDF_STATUS sme_update_config(mac_handle_t mac_handle, tpSmeConfigParams
 	if (csr_is_all_session_disconnected(mac))
 		csr_set_global_cfgs(mac);
 
-	mac->snr_monitor_enabled = pSmeConfigParams->snr_monitor_enabled;
-
 	return status;
 }
 
@@ -3236,7 +3234,6 @@ QDF_STATUS sme_get_config_param(mac_handle_t mac_handle,
 		qdf_mem_copy(&pParam->rrmConfig,
 				&mac->rrm.rrmSmeContext.rrmConfig,
 				sizeof(mac->rrm.rrmSmeContext.rrmConfig));
-		pParam->snr_monitor_enabled = mac->snr_monitor_enabled;
 		sme_release_global_lock(&mac->sme);
 	}
 

+ 5 - 2
core/wma/src/wma_features.c

@@ -67,6 +67,7 @@
 #ifdef WLAN_FEATURE_NAN
 #include "target_if_nan.h"
 #endif
+#include "wlan_scan_api.h"
 #include <wlan_crypto_global_api.h>
 
 /**
@@ -5243,6 +5244,7 @@ int wma_chan_info_event_handler(void *handle, uint8_t *event_buf,
 	struct scan_chan_info buf;
 	struct mac_context *mac = NULL;
 	struct lim_channel_status *channel_status;
+	bool snr_monitor_enabled;
 
 	WMA_LOGD("%s: Enter", __func__);
 
@@ -5254,8 +5256,9 @@ int wma_chan_info_event_handler(void *handle, uint8_t *event_buf,
 		return -EINVAL;
 	}
 
-	WMA_LOGD("%s: monitor:%d", __func__, mac->snr_monitor_enabled);
-	if (mac->snr_monitor_enabled && mac->chan_info_cb) {
+	snr_monitor_enabled = wlan_scan_is_snr_monitor_enabled(mac->psoc);
+	WMA_LOGD("%s: monitor:%d", __func__, snr_monitor_enabled);
+	if (snr_monitor_enabled && mac->chan_info_cb) {
 		param_buf =
 			(WMI_CHAN_INFO_EVENTID_param_tlvs *)event_buf;
 		if (!param_buf) {