diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-03 03:10:14 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-03 03:10:14 +0000 |
commit | 2622ebced11ac82b9cb010cb1897e1d658b7f81a (patch) | |
tree | ac853a990c3149b1edcfae04c33ff5ce0cbed489 | |
parent | caee3aafe00681f9f194834c8c4f6fabe4b2c04d (diff) | |
parent | ad9fbe71051ec885fee4f4b3df4cf47b0041adc3 (diff) | |
download | wlan-2622ebced11ac82b9cb010cb1897e1d658b7f81a.tar.gz |
Snap for 7519874 from ad9fbe71051ec885fee4f4b3df4cf47b0041adc3 to sc-release
Change-Id: I3add9fb8b211742aa41e5b768d6272a8455a1c4e
-rw-r--r-- | qcwcn/wifi_hal/llstats.cpp | 13 | ||||
-rw-r--r-- | qcwcn/wifi_hal/llstatscommand.h | 3 |
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); |