Browse Source

qcacld-3.0: Set initial dense status in case of dense roaming

In case of dense roam scenario, Host should set initial dense
status if roamable AP count is more than minimum dense AP count.
Current implementation checks for the number of channels in roam
cache list instead of AP count.

Add changes to set the flag if roamable AP count is more than
configured value.

Change-Id: I4d5f7c6c69b1a9a527aace1677050373065af213
CRs-Fixed: 1058211
Kapil Gupta 8 years ago
parent
commit
0a2477b23f

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

@@ -775,6 +775,7 @@ typedef struct tagCsrScanStruct {
 #endif
 	/* This includes all channels on which candidate APs are found */
 	tCsrChannel occupiedChannels[CSR_ROAM_SESSION_MAX];
+	int8_t roam_candidate_count[CSR_ROAM_SESSION_MAX];
 	int8_t inScanResultBestAPRssi;
 	csr_scan_completeCallback callback11dScanDone;
 	bool fcc_constraint;

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

@@ -17343,10 +17343,15 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id,
 		roam_params_dst->traffic_threshold);
 
 	/* Set initial dense roam status */
-	if (req_buf->ConnectedNetwork.ChannelCount >
+	if (mac_ctx->scan.roam_candidate_count[session_id] >
 	    roam_params_dst->dense_min_aps_cnt)
 		roam_params_dst->initial_dense_status = true;
 
+	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
+		 "initial_dense_status:%d, candidate count:%d",
+		 roam_params_dst->initial_dense_status,
+		 mac_ctx->scan.roam_candidate_count[session_id]);
+
 	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")",

+ 19 - 9
core/sme/src/csr/csr_api_scan.c

@@ -1602,10 +1602,11 @@ static bool csr_is_better_bss(tpAniSirGlobal mac_ctx,
 
 /* Add the channel to the occupiedChannels array */
 static void csr_scan_add_to_occupied_channels(tpAniSirGlobal pMac,
-					      tCsrScanResult *pResult,
-					      uint8_t sessionId,
-					      tCsrChannel *occupied_ch,
-					      tDot11fBeaconIEs *pIes)
+					tCsrScanResult *pResult,
+					uint8_t sessionId,
+					tCsrChannel *occupied_ch,
+					tDot11fBeaconIEs *pIes,
+					bool is_init_list)
 {
 	QDF_STATUS status;
 	uint8_t ch;
@@ -1613,9 +1614,15 @@ static void csr_scan_add_to_occupied_channels(tpAniSirGlobal pMac,
 	uint8_t *occupied_ch_lst = occupied_ch->channelList;
 
 	ch = pResult->Result.BssDescriptor.channelId;
-	if (csr_is_channel_present_in_list(occupied_ch_lst, num_occupied_ch, ch)
-	    || !csr_neighbor_roam_connected_profile_match(pMac, sessionId,
-							  pResult, pIes))
+	if (!csr_neighbor_roam_connected_profile_match(pMac,
+						sessionId, pResult, pIes))
+		return;
+
+	if (is_init_list)
+		pMac->scan.roam_candidate_count[sessionId]++;
+
+	if (csr_is_channel_present_in_list(occupied_ch_lst,
+					   num_occupied_ch, ch))
 		return;
 
 	status = csr_add_to_channel_list_front(occupied_ch_lst,
@@ -1658,7 +1665,8 @@ static void csr_scan_add_result(tpAniSirGlobal pMac, tCsrScanResult *pResult,
 		 * "gNeighborScanChannelList" is NOT set in the cfg.ini file
 		 */
 		csr_scan_add_to_occupied_channels(pMac, pResult, sessionId,
-				&pMac->scan.occupiedChannels[sessionId], pIes);
+				&pMac->scan.occupiedChannels[sessionId], pIes,
+				false);
 	}
 }
 
@@ -7021,6 +7029,7 @@ void csr_init_occupied_channels_list(tpAniSirGlobal pMac, uint8_t sessionId)
 
 	/* Empty occupied channels here */
 	pMac->scan.occupiedChannels[sessionId].numChannels = 0;
+	pMac->scan.roam_candidate_count[sessionId] = 0;
 
 	csr_ll_lock(&pMac->scan.scanResultList);
 	pEntry = csr_ll_peek_head(&pMac->scan.scanResultList, LL_ACCESS_NOLOCK);
@@ -7033,7 +7042,8 @@ void csr_init_occupied_channels_list(tpAniSirGlobal pMac, uint8_t sessionId)
 				&pBssDesc->Result.BssDescriptor, &pIes)))
 			continue;
 		csr_scan_add_to_occupied_channels(pMac, pBssDesc, sessionId,
-				&pMac->scan.occupiedChannels[sessionId], pIes);
+				&pMac->scan.occupiedChannels[sessionId], pIes,
+				true);
 		/*
 		 * Free the memory allocated for pIes in
 		 * csr_get_parsed_bss_description_ies

+ 4 - 3
core/wma/src/wma_scan_roam.c

@@ -837,7 +837,7 @@ QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
 	params.dense_min_aps_cnt = roam_params->dense_min_aps_cnt;
 	params.traffic_threshold =
 			roam_params->traffic_threshold;
-	params.initial_dense_status = 0; /* reserved */
+	params.initial_dense_status = roam_params->initial_dense_status;
 
 
 	/*
@@ -903,10 +903,11 @@ QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
 		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"),
+		FL("dense_rssi_thresh_offset=%d, dense_min_aps_cnt=%d, traffic_threshold=%d initial_dense_status=%d"),
 			roam_params->dense_rssi_thresh_offset,
 			roam_params->dense_min_aps_cnt,
-			roam_params->traffic_threshold);
+			roam_params->traffic_threshold,
+			roam_params->initial_dense_status);
 	return status;
 }