Ver código fonte

qcacld-3.0: Calculate max rx_clear_count in case of wide band scan

In case of wide band scan, FW sends cca_busy_subband_info tlvs
via WMI_CHAN_INFO_EVENTID, which contains value of rx_clear_count
for each 20 MHz freq space.

Instead of doing average host should use max rx_clear_count for
each 20 MHz freq space to calculate channel load more accurately.

Fix is to calculate max rx_clear_count coming via above
tlvs and update same to cp stats component.

Change-Id: Ie9c472156bec11f5325aec407c40b70a12aa5871
CRs-Fixed: 3601484
Abhinav Kumar 1 ano atrás
pai
commit
fca34ab0c7
1 arquivos alterados com 8 adições e 7 exclusões
  1. 8 7
      core/wma/src/wma_features.c

+ 8 - 7
core/wma/src/wma_features.c

@@ -5269,18 +5269,19 @@ wma_update_sacn_channel_info_buf(wmi_unified_t wmi_handle,
 }
 
 static void
-wma_get_scan_rx_clear_count_average(wmi_cca_busy_subband_info *cca_info,
-				    uint32_t num_tlvs, uint32_t *rx_clear_count)
+wma_get_scan_max_rx_clear_count(wmi_cca_busy_subband_info *cca_info,
+				uint32_t num_tlvs, uint32_t *rx_clear_count)
 {
-	uint32_t i, total_rx_clear_count = 0;
+	uint32_t i, max_rx_clear_count = 0;
 
 	for (i = 0; i < num_tlvs && i < MAX_WIDE_BAND_SCAN_CHAN; i++) {
-		total_rx_clear_count += cca_info->rx_clear_count;
+		if (max_rx_clear_count < cca_info->rx_clear_count)
+			max_rx_clear_count = cca_info->rx_clear_count;
 		cca_info++;
 	}
 
-	*rx_clear_count = total_rx_clear_count / num_tlvs;
-	wma_debug("average rx_clear_count : %d", *rx_clear_count);
+	*rx_clear_count = max_rx_clear_count;
+	wma_debug("max rx_clear_count : %d", *rx_clear_count);
 }
 
 int wma_chan_info_event_handler(void *handle, uint8_t *event_buf, uint32_t len)
@@ -5353,7 +5354,7 @@ int wma_chan_info_event_handler(void *handle, uint8_t *event_buf, uint32_t len)
 	channel_status->noise_floor = event->noise_floor;
 
 	if (is_cca_busy_info && num_tlvs)
-		wma_get_scan_rx_clear_count_average(cca_info, num_tlvs,
+		wma_get_scan_max_rx_clear_count(cca_info, num_tlvs,
 					&channel_status->rx_clear_count);
 	else
 		channel_status->rx_clear_count = event->rx_clear_count;