From c62b63d7f7dbb31cf6626855d10180b9e62ce165 Mon Sep 17 00:00:00 2001 From: kensun Date: Wed, 28 Jul 2021 06:40:31 +0000 Subject: WifiHal: populate llstats peer info with correct offset llstats peerinfo has varying wifi rate stats. Since llstats is a linear buffer with interface and peer stats, we should include wifi rate stats length while computing offset of next peer Bug: 191419302 Test: Regression Test Change-Id: Icc0395cf290268f4c2c96031389fae36ac48d47c --- qcwcn/wifi_hal/llstats.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qcwcn/wifi_hal') diff --git a/qcwcn/wifi_hal/llstats.cpp b/qcwcn/wifi_hal/llstats.cpp index d9e2441..8e827e2 100644 --- a/qcwcn/wifi_hal/llstats.cpp +++ b/qcwcn/wifi_hal/llstats.cpp @@ -1188,6 +1188,7 @@ int LLStatsCommand::handleResponse(WifiEvent &reply) status = WIFI_ERROR_INVALID_ARGS; goto cleanup; } + num_rates = 0; for (peerInfo = (struct nlattr *) nla_data(tb_vendor[ QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO]), rem = nla_len(tb_vendor[ @@ -1199,7 +1200,8 @@ int LLStatsCommand::handleResponse(WifiEvent &reply) QCA_WLAN_VENDOR_ATTR_LL_STATS_MAX+ 1]; pPeerStats = (wifi_peer_info *) ( (u8 *)pIfaceStat->peer_info - + (i++ * sizeof(wifi_peer_info))); + + (i++ * sizeof(wifi_peer_info)) + + (num_rates * sizeof(wifi_rate_stat))); nla_parse(tb2, QCA_WLAN_VENDOR_ATTR_LL_STATS_MAX, (struct nlattr *) nla_data(peerInfo), nla_len(peerInfo), NULL); @@ -1208,6 +1210,7 @@ int LLStatsCommand::handleResponse(WifiEvent &reply) { goto cleanup; } + num_rates += pPeerStats->num_rate; } } -- cgit v1.2.3