summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-07-02 16:16:54 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-07-02 16:16:54 +0000
commit7104380cc5655cfdfb5a83c6f0e4bd084b530b30 (patch)
treeac853a990c3149b1edcfae04c33ff5ce0cbed489
parentb058f77430efb69649b44f0ee57b62f7f30ac2bb (diff)
parentad9fbe71051ec885fee4f4b3df4cf47b0041adc3 (diff)
downloadwlan-7104380cc5655cfdfb5a83c6f0e4bd084b530b30.tar.gz
Merge "llstats: Use mNumRadioAllocated for real radio stats recevied" into sc-dev am: ad9fbe7105
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/qcom/wlan/+/15123844 Change-Id: I1e6f3fd763af73fd0689322fa35893b17141c860
-rw-r--r--qcwcn/wifi_hal/llstats.cpp13
-rw-r--r--qcwcn/wifi_hal/llstatscommand.h3
2 files changed, 16 insertions, 0 deletions
diff --git a/qcwcn/wifi_hal/llstats.cpp b/qcwcn/wifi_hal/llstats.cpp
index 50b8149..d9e2441 100644
--- a/qcwcn/wifi_hal/llstats.cpp
+++ b/qcwcn/wifi_hal/llstats.cpp
@@ -54,6 +54,7 @@ LLStatsCommand::LLStatsCommand(wifi_handle handle, int id, u32 vendor_id, u32 su
memset(&mHandler, 0,sizeof(mHandler));
mRadioStatsSize = 0;
mNumRadios = 0;
+ mNumRadiosAllocated = 0;
}
LLStatsCommand::~LLStatsCommand()
@@ -863,6 +864,11 @@ wifi_error LLStatsCommand::notifyResponse()
/* Indicate stats to framework only if both radio and iface stats
* are present */
if (mResultsParams.radio_stat && mResultsParams.iface_stat) {
+ if (mNumRadios > mNumRadiosAllocated) {
+ ALOGE("%s: Force reset mNumRadios=%d to allocated=%d",
+ __FUNCTION__, mNumRadios, mNumRadiosAllocated);
+ mNumRadios = mNumRadiosAllocated;
+ }
mHandler.on_link_stats_results(mRequestId,
mResultsParams.iface_stat, mNumRadios,
mResultsParams.radio_stat);
@@ -881,6 +887,11 @@ void LLStatsCommand::clearStats()
if(mResultsParams.radio_stat)
{
wifi_radio_stat *radioStat = mResultsParams.radio_stat;
+ if (mNumRadios > mNumRadiosAllocated) {
+ ALOGE("%s: Force reset mNumRadios=%d to allocated=%d",
+ __FUNCTION__, mNumRadios, mNumRadiosAllocated);
+ mNumRadios = mNumRadiosAllocated;
+ }
for (u8 radio = 0; radio < mNumRadios; radio++) {
if (radioStat->tx_time_per_levels) {
free(radioStat->tx_time_per_levels);
@@ -894,6 +905,7 @@ void LLStatsCommand::clearStats()
mResultsParams.radio_stat = NULL;
mRadioStatsSize = 0;
mNumRadios = 0;
+ mNumRadiosAllocated = 0;
}
if(mResultsParams.iface_stat)
{
@@ -978,6 +990,7 @@ int LLStatsCommand::handleResponse(WifiEvent &reply)
+ mRadioStatsSize);
memset(radioStatsBuf, 0, resultsBufSize);
mRadioStatsSize += resultsBufSize;
+ mNumRadiosAllocated ++;
if (tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_NUM_TX_LEVELS])
radioStatsBuf->num_tx_levels = nla_get_u32(tb_vendor[
diff --git a/qcwcn/wifi_hal/llstatscommand.h b/qcwcn/wifi_hal/llstatscommand.h
index 5d4c480..86b9672 100644
--- a/qcwcn/wifi_hal/llstatscommand.h
+++ b/qcwcn/wifi_hal/llstatscommand.h
@@ -83,7 +83,10 @@ private:
u32 mRadioStatsSize;
+ // mNumRadios is decoded from tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_NUM_RADIOS]
+ // nNumRadiosAllocated is the actual radio stats received.
u8 mNumRadios;
+ u8 mNumRadiosAllocated;
LLStatsCommand(wifi_handle handle, int id, u32 vendor_id, u32 subcmd);