Parcourir la source

qcacld-3.0: Add support for dense roam params

qcacld-2.0 to qcacld-3.0 propagation

In High dense environment roaming should be triggered early
at dense RSSI threshold which provide better throughput result.
Add support for dense roaming parameters to read from ini file
and send to FW with other roaming parameters

CRs-Fixed: 953579
Change-Id: Ia63bfdd1248b4507d988b019f07164a7c75566af
Gupta, Kapil il y a 9 ans
Parent
commit
c68ad460fc

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

@@ -2895,6 +2895,38 @@ enum dot11p_mode {
 #define CFG_ENABLE_M2M_LIMITATION_DEFAULT      (1)
 #endif /* QCA_WIFI_3_0_EMU */
 
+/*
+ * Dense traffic threshold
+ * traffic threshold required for dense roam scan
+ * not used currently
+ */
+#define CFG_ROAM_DENSE_TRAFFIC_THRESHOLD         "gtraffic_threshold"
+#define CFG_ROAM_DENSE_TRAFFIC_THRESHOLD_MIN     (0)
+#define CFG_ROAM_DENSE_TRAFFIC_THRESHOLD_MAX     (100)
+#define CFG_ROAM_DENSE_TRAFFIC_THRESHOLD_DEFAULT (0)
+
+/*
+ * Dense Roam RSSI Threshold diff
+ * offset value from normal RSSI threshold to dense RSSI threshold
+ * Fw will optimize roaming based on new RSSI threshold once it detects
+ * dense enviournment.
+ */
+#define CFG_ROAM_DENSE_RSSI_THRE_OFFSET         "groam_dense_rssi_thresh_offset"
+#define CFG_ROAM_DENSE_RSSI_THRE_OFFSET_MIN     (0)
+#define CFG_ROAM_DENSE_RSSI_THRE_OFFSET_MAX     (20)
+#define CFG_ROAM_DENSE_RSSI_THRE_OFFSET_DEFAULT (0)
+
+/*
+ * Dense Roam Min APs
+ * minimum number of AP required for dense roam
+ * FW will consider environment as dense once it detects #APs
+ * operating is more than CFG_ROAM_DENSE_MIN_APS.
+ */
+#define CFG_ROAM_DENSE_MIN_APS         "groam_dense_min_aps"
+#define CFG_ROAM_DENSE_MIN_APS_MIN     (1)
+#define CFG_ROAM_DENSE_MIN_APS_MAX     (5)
+#define CFG_ROAM_DENSE_MIN_APS_DEFAULT (1)
+
 /*---------------------------------------------------------------------------
    Type declarations
    -------------------------------------------------------------------------*/
@@ -3482,6 +3514,9 @@ struct hdd_config {
 #ifdef QCA_WIFI_3_0_EMU
 	bool enable_m2m_limitation;
 #endif
+	uint32_t roam_dense_traffic_thresh;
+	uint32_t roam_dense_rssi_thresh_offset;
+	uint32_t roam_dense_min_aps;
 };
 
 #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

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

@@ -3684,6 +3684,27 @@ REG_TABLE_ENTRY g_registry_table[] = {
 		CFG_ENABLE_M2M_LIMITATION_MAX),
 #endif
 
+	REG_VARIABLE(CFG_ROAM_DENSE_TRAFFIC_THRESHOLD, WLAN_PARAM_Integer,
+		struct hdd_config, roam_dense_traffic_thresh,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_ROAM_DENSE_TRAFFIC_THRESHOLD_DEFAULT,
+		CFG_ROAM_DENSE_TRAFFIC_THRESHOLD_MIN,
+		CFG_ROAM_DENSE_TRAFFIC_THRESHOLD_MAX),
+
+	REG_VARIABLE(CFG_ROAM_DENSE_RSSI_THRE_OFFSET, WLAN_PARAM_Integer,
+		struct hdd_config, roam_dense_rssi_thresh_offset,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_ROAM_DENSE_RSSI_THRE_OFFSET_DEFAULT,
+		CFG_ROAM_DENSE_RSSI_THRE_OFFSET_MIN,
+		CFG_ROAM_DENSE_RSSI_THRE_OFFSET_MAX),
+
+	REG_VARIABLE(CFG_ROAM_DENSE_MIN_APS, WLAN_PARAM_Integer,
+		struct hdd_config, roam_dense_min_aps,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_ROAM_DENSE_MIN_APS_DEFAULT,
+		CFG_ROAM_DENSE_MIN_APS_MIN,
+		CFG_ROAM_DENSE_MIN_APS_MAX),
+
 };
 
 
@@ -5263,6 +5284,15 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
 		CFG_ENABLE_LFR_SUBNET_DETECTION,
 		pHddCtx->config->enable_lfr_subnet_detection);
 #endif
+	hdd_info("Name = [%s] Value = [%u]",
+		CFG_ROAM_DENSE_TRAFFIC_THRESHOLD,
+		pHddCtx->config->roam_dense_traffic_thresh);
+	hdd_info("Name = [%s] Value = [%u]",
+		CFG_ROAM_DENSE_RSSI_THRE_OFFSET,
+		pHddCtx->config->roam_dense_rssi_thresh_offset);
+	hdd_info("Name = [%s] Value = [%u]",
+		CFG_ROAM_DENSE_MIN_APS,
+		pHddCtx->config->roam_dense_min_aps);
 }
 
 
@@ -6698,6 +6728,14 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
 		pHddCtx->config->early_stop_scan_max_threshold;
 	smeConfig->csrConfig.first_scan_bucket_threshold =
 		pHddCtx->config->first_scan_bucket_threshold;
+
+	smeConfig->csrConfig.roam_dense_rssi_thresh_offset =
+			pHddCtx->config->roam_dense_rssi_thresh_offset;
+	smeConfig->csrConfig.roam_dense_min_aps =
+			pHddCtx->config->roam_dense_min_aps;
+	smeConfig->csrConfig.roam_dense_traffic_thresh =
+			pHddCtx->config->roam_dense_traffic_thresh;
+
 	status = sme_update_config(pHddCtx->hHal, smeConfig);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		hddLog(LOGE, "sme_update_config() return failure %d",

+ 4 - 0
core/mac/inc/sir_api.h

@@ -2916,6 +2916,10 @@ struct roam_ext_params {
 	int rssi_diff;
 	int good_rssi_roam;
 	bool is_5g_pref_enabled;
+	int dense_rssi_thresh_offset;
+	int dense_min_aps_cnt;
+	int initial_dense_status;
+	int traffic_threshold;
 };
 
 typedef struct sSirRoamOffloadScanReq {

+ 3 - 0
core/sme/inc/csr_api.h

@@ -1217,6 +1217,9 @@ typedef struct tagCsrConfigParam {
 	bool policy_manager_enabled;
 	uint32_t fine_time_meas_cap;
 	uint32_t dual_mac_feature_disable;
+	uint32_t roam_dense_traffic_thresh;
+	uint32_t roam_dense_rssi_thresh_offset;
+	uint32_t roam_dense_min_aps;
 } tCsrConfigParam;
 
 /* Tush */

+ 21 - 1
core/sme/src/csr/csr_api_roam.c

@@ -2069,6 +2069,13 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac,
 		pMac->isCoalesingInIBSSAllowed =
 			pParam->isCoalesingInIBSSAllowed;
 
+		pMac->roam.configParam.roam_params.dense_rssi_thresh_offset =
+			pParam->roam_dense_rssi_thresh_offset;
+		pMac->roam.configParam.roam_params.dense_min_aps_cnt =
+			pParam->roam_dense_min_aps;
+		pMac->roam.configParam.roam_params.traffic_threshold =
+			pParam->roam_dense_traffic_thresh;
+
 		/* update p2p offload status */
 		pMac->pnoOffload = pParam->pnoOffload;
 
@@ -2105,8 +2112,8 @@ QDF_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;
-	}
 
+	}
 	return status;
 }
 
@@ -2238,6 +2245,13 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
 	pParam->enable_dot11p = pMac->enable_dot11p;
 	csr_set_channels(pMac, pParam);
 	pParam->obssEnabled = cfg_params->obssEnabled;
+	pParam->roam_dense_rssi_thresh_offset =
+			cfg_params->roam_params.dense_rssi_thresh_offset;
+	pParam->roam_dense_min_aps =
+			cfg_params->roam_params.dense_min_aps_cnt;
+	pParam->roam_dense_traffic_thresh =
+			cfg_params->roam_params.traffic_threshold;
+
 	pParam->conc_custom_rule1 = cfg_params->conc_custom_rule1;
 	pParam->conc_custom_rule2 = cfg_params->conc_custom_rule2;
 	pParam->is_sta_connection_in_5gz_enabled =
@@ -17046,6 +17060,12 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id,
 		roam_params_dst->max_drop_rssi_5g,
 		req_buf->RoamRssiDiff, roam_params_dst->alert_rssi_threshold);
 
+	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
+		"dense_rssi_thresh_offset: %d, dense_min_aps_cnt:%d, traffic_threshold:%d",
+		roam_params_dst->dense_rssi_thresh_offset,
+		roam_params_dst->dense_min_aps_cnt,
+		roam_params_dst->traffic_threshold);
+
 	for (i = 0; i < roam_params_dst->num_bssid_avoid_list; i++) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
 			"Blacklist Bssid: ("MAC_ADDRESS_STR")",

+ 12 - 0
core/wma/src/wma_scan_roam.c

@@ -804,6 +804,13 @@ QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
 	params.hi_rssi_scan_rssi_delta = hirssi_scan_delta;
 	params.hi_rssi_scan_rssi_ub = hirssi_upper_bound & 0x00000ff;
 	params.raise_rssi_thresh_5g = roam_params->raise_rssi_thresh_5g;
+	params.dense_rssi_thresh_offset =
+			 roam_params->dense_rssi_thresh_offset;
+	params.dense_min_aps_cnt = roam_params->dense_min_aps_cnt;
+	params.traffic_threshold =
+			roam_params->traffic_threshold;
+	params.initial_dense_status = 0; /* reserved */
+
 
 	/*
 	 * The current Noise floor in firmware is -96dBm. Penalty/Boost
@@ -862,6 +869,11 @@ QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
 	WMA_LOGI(
 		FL("hirssi_scan max_count=%d, delta=%d, hirssi_upper_bound=%d"),
 		hirssi_scan_max_count, hirssi_scan_delta, hirssi_upper_bound);
+	WMA_LOGI(
+		FL("dense_rssi_thresh_offset=%d, dense_min_aps_cnt=%d, traffic_threshold=%d"),
+			roam_params->dense_rssi_thresh_offset,
+			roam_params->dense_min_aps_cnt,
+			roam_params->traffic_threshold);
 	return status;
 }