|
@@ -65,6 +65,7 @@
|
|
|
#include <wlan_mlme_api.h>
|
|
|
#include <../../core/src/vdev_mgr_ops.h>
|
|
|
#include "cdp_txrx_misc.h"
|
|
|
+#include <cdp_txrx_host_stats.h>
|
|
|
|
|
|
|
|
|
|
|
@@ -1612,6 +1613,10 @@ static int wma_unified_link_peer_stats_event_handler(void *handle,
|
|
|
size_t link_stats_results_size;
|
|
|
bool excess_data = false;
|
|
|
uint32_t buf_len = 0;
|
|
|
+ struct cdp_peer_stats *dp_stats;
|
|
|
+ void *dp_soc = cds_get_context(QDF_MODULE_ID_SOC);
|
|
|
+ QDF_STATUS status;
|
|
|
+ uint8_t mcs_index;
|
|
|
|
|
|
struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
|
|
|
|
|
@@ -1709,6 +1714,12 @@ static int wma_unified_link_peer_stats_event_handler(void *handle,
|
|
|
|
|
|
qdf_mem_copy(link_stats_results->results,
|
|
|
&fixed_param->num_peers, peer_stats_size);
|
|
|
+ dp_stats = qdf_mem_malloc(sizeof(*dp_stats));
|
|
|
+ if (!dp_stats) {
|
|
|
+ WMA_LOGE("dp stats allocation failed");
|
|
|
+ qdf_mem_free(link_stats_results);
|
|
|
+ return -ENOMEM;
|
|
|
+ }
|
|
|
|
|
|
results = (uint8_t *) link_stats_results->results;
|
|
|
t_peer_stats = (uint8_t *) peer_stats;
|
|
@@ -1721,8 +1732,21 @@ 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);
|
|
|
+
|
|
|
|
|
|
for (count = 0; count < peer_stats->num_rates; count++) {
|
|
|
+ mcs_index = RATE_STAT_GET_MCS_INDEX(rate_stats->rate);
|
|
|
+ if (QDF_IS_STATUS_SUCCESS(status)) {
|
|
|
+ if (rate_stats->rate && mcs_index < MAX_MCS)
|
|
|
+ rate_stats->rx_mpdu =
|
|
|
+ dp_stats->rx.rx_mpdu_cnt[mcs_index];
|
|
|
+ else
|
|
|
+ rate_stats->rx_mpdu = 0;
|
|
|
+ }
|
|
|
rate_stats++;
|
|
|
|
|
|
qdf_mem_copy(results + next_res_offset,
|
|
@@ -1735,6 +1759,7 @@ static int wma_unified_link_peer_stats_event_handler(void *handle,
|
|
|
peer_stats++;
|
|
|
}
|
|
|
|
|
|
+ qdf_mem_free(dp_stats);
|
|
|
|
|
|
* vdev_id/ifacId in link_stats_results will be
|
|
|
* used to retrieve the correct HDD context
|