Browse Source

qcacld-3.0: Update correct vdev_id for the peers in peer_ll_stats

Currently in wma_unified_link_peer_stats_event_handler, the host
updates peer's rx_mpdu value by querying dp_peer stats, using
peer mac address and vdev_id sent by firmware.

In case of MLO connection, the dp_peer stats query fails for
partner link peer, since the vdev_id sent by firmware is for
assoc link. So, the rx_mpdu value for partner link peer is not
updated. To fix this issue, update correct vdev_id for the peer.

Change-Id: I5f45f1cba6399c6ab810d3d94272d035259317a8
CRs-Fixed: 3438061
Aditya Kodukula 2 years ago
parent
commit
177a026707
1 changed files with 11 additions and 6 deletions
  1. 11 6
      core/wma/src/wma_utils.c

+ 11 - 6
core/wma/src/wma_utils.c

@@ -1672,7 +1672,7 @@ static int wma_unified_link_peer_stats_event_handler(void *handle,
 	wmi_peer_link_stats *peer_stats, *temp_peer_stats;
 	wmi_rate_stats *rate_stats;
 	tSirLLStatsResults *link_stats_results;
-	uint8_t *results, *t_peer_stats, *t_rate_stats;
+	uint8_t *results, *t_peer_stats, *t_rate_stats, *peer_mac;
 	uint32_t count, rate_cnt;
 	uint32_t total_num_rates = 0;
 	uint32_t next_res_offset, next_peer_offset, next_rate_offset;
@@ -1683,7 +1683,7 @@ static int wma_unified_link_peer_stats_event_handler(void *handle,
 	struct cdp_peer_stats *dp_stats;
 	void *dp_soc = cds_get_context(QDF_MODULE_ID_SOC);
 	QDF_STATUS status;
-	uint8_t mcs_index;
+	uint8_t mcs_index, vdev_id;
 
 	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
 
@@ -1798,10 +1798,15 @@ static int wma_unified_link_peer_stats_event_handler(void *handle,
 			     t_peer_stats + next_peer_offset, peer_info_size);
 		next_res_offset += peer_info_size;
 
-		status = cdp_host_get_peer_stats(dp_soc,
-				       link_stats_results->ifaceId,
-				       (uint8_t *)&peer_stats->peer_mac_address,
-				       dp_stats);
+		peer_mac = (uint8_t *)&peer_stats->peer_mac_address;
+		status = cdp_peer_get_vdevid(dp_soc, peer_mac, &vdev_id);
+		if (!QDF_IS_STATUS_SUCCESS(status)) {
+			wma_err("Unable to find peer ["QDF_MAC_ADDR_FMT"]",
+				QDF_MAC_ADDR_REF(peer_mac));
+			return -EINVAL;
+		}
+		status = cdp_host_get_peer_stats(dp_soc, vdev_id,
+						 peer_mac, dp_stats);
 
 		/* Copy rate stats associated with this peer */
 		for (count = 0; count < peer_stats->num_rates; count++) {