summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRachit Kankane <rkankane@codeaurora.org>2020-04-01 15:43:21 +0530
committerIsaac Chiou <isaacchiou@google.com>2020-05-27 18:51:28 +0800
commit11a80ee934c01feb209853ecc7e47292854d3efd (patch)
treefcfc77d316a0b2ea026b72a32625b41e7f6abbfc
parent16127b946cfbe2363cd8b4358d307a8526758066 (diff)
downloadqcacld-11a80ee934c01feb209853ecc7e47292854d3efd.tar.gz
qcacld-3.0: Handle LL stats for 2nd radio
With recent code change, LL stats results are returned in the user space context only. To do that, changes were made to buffer the LL stats results received from FW till the time FW completes it. This change is not taking case where FW sends LL stats for multiple radio which is resulting SKB corruption. Bug: 153415344 Change-Id: I49781f1ea9520ad0d9721536be1861d5d8151ea7 CRs-Fixed: 2649207
-rw-r--r--core/hdd/src/wlan_hdd_stats.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c
index 962c630baf..eab69a8065 100644
--- a/core/hdd/src/wlan_hdd_stats.c
+++ b/core/hdd/src/wlan_hdd_stats.c
@@ -983,6 +983,7 @@ static void hdd_process_ll_stats(tSirLLStatsResults *results,
{
struct hdd_ll_stats_priv *priv = hdd_request_priv(request);
struct hdd_ll_stats *stats = NULL;
+ size_t stat_size = 0;
if (!(priv->request_bitmap & results->paramId))
return;
@@ -992,15 +993,15 @@ static void hdd_process_ll_stats(tSirLLStatsResults *results,
if (!stats)
goto exit;
+ stat_size = sizeof(tSirWifiRadioStat) * results->num_radio;
stats->result_param_id = WMI_LINK_STATS_RADIO;
- stats->result = qdf_mem_malloc(sizeof(tSirWifiRadioStat));
+ stats->result = qdf_mem_malloc(stat_size);
if (!stats->result) {
qdf_mem_free(stats);
goto exit;
}
- qdf_mem_copy(stats->result, results->results,
- sizeof(tSirWifiRadioStat));
+ qdf_mem_copy(stats->result, results->results, stat_size);
stats->stats_nradio_npeer.no_of_radios = results->num_radio;
stats->more_data = results->moreResultToFollow;
if (!results->moreResultToFollow)
@@ -1023,12 +1024,30 @@ static void hdd_process_ll_stats(tSirLLStatsResults *results,
priv->request_bitmap &= ~(WMI_LINK_STATS_ALL_PEER);
priv->request_bitmap &= ~stats->result_param_id;
} else if (results->paramId & WMI_LINK_STATS_ALL_PEER) {
+ tpSirWifiPeerStat peer_stat = (tpSirWifiPeerStat)
+ results->results;
+ tpSirWifiPeerInfo peer_info = NULL;
+ u32 num_rate = 0, peers, rates;
+ int i;
stats = qdf_mem_malloc(sizeof(*stats));
if (!stats)
goto exit;
+ peer_info = (tpSirWifiPeerInfo)peer_stat->peerInfo;
+ for (i = 1; i <= peer_stat->numPeers; i++) {
+ num_rate += peer_info->numRate;
+ peer_info = (tpSirWifiPeerInfo)((uint8_t *)
+ peer_info + sizeof(tSirWifiPeerInfo) +
+ (peer_info->numRate *
+ sizeof(tSirWifiRateStat)));
+ }
+
+ peers = sizeof(tSirWifiPeerInfo) * peer_stat->numPeers;
+ rates = sizeof(tSirWifiRateStat) * num_rate;
+ stat_size = sizeof(tSirWifiPeerStat) + peers + rates;
stats->result_param_id = WMI_LINK_STATS_ALL_PEER;
- stats->result = qdf_mem_malloc(sizeof(tSirWifiPeerStat));
+
+ stats->result = qdf_mem_malloc(stat_size);
if (!stats->result) {
qdf_mem_free(stats);
goto exit;