From 2f7892359f55cdc039a7e8ee44e7989bdfbc77a2 Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Fri, 19 Apr 2019 16:40:24 +0800 Subject: [PATCH] qcacld-3.0: Save whole channel and tx power to cfg Currently, the function csr_save_tx_power_to_cfg does not update the max_tx_power_24/5 length before it copies the max_tx_power_24/5 data. Then the channel and tx power info is not complete. Change-Id: I99e4def6678b68e192f421d03ca7768b341dfbab CRs-Fixed: 2437214 --- core/sme/src/csr/csr_api_scan.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 4735bb36135d..ac7d589cfb78 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -1512,7 +1512,7 @@ static void csr_save_tx_power_to_cfg(struct mac_context *mac, tListElem *pEntry; uint32_t cbLen = 0, dataLen, tmp_len; struct csr_channel_powerinfo *ch_set; - uint32_t idx; + uint32_t idx, count = 0; tSirMacChanInfo *ch_pwr_set; uint8_t *p_buf = NULL; @@ -1569,6 +1569,7 @@ static void csr_save_tx_power_to_cfg(struct mac_context *mac, ch_pwr_set->maxTxPower); cbLen += sizeof(tSirMacChanInfo); ch_pwr_set++; + count++; } } else { if (cbLen >= dataLen) { @@ -1592,17 +1593,22 @@ static void csr_save_tx_power_to_cfg(struct mac_context *mac, mac->mlme_cfg->power.max_tx_power); cbLen += sizeof(tSirMacChanInfo); ch_pwr_set++; + count++; } pEntry = csr_ll_next(pList, pEntry, LL_ACCESS_LOCK); } - if (band == BAND_2G) + if (band == BAND_2G) { + mac->mlme_cfg->power.max_tx_power_24.len = 3 * count; qdf_mem_copy(mac->mlme_cfg->power.max_tx_power_24.data, (uint8_t *)p_buf, mac->mlme_cfg->power.max_tx_power_24.len); - if (band == BAND_5G) + } + if (band == BAND_5G) { + mac->mlme_cfg->power.max_tx_power_5.len = 3 * count; qdf_mem_copy(mac->mlme_cfg->power.max_tx_power_5.data, (uint8_t *)p_buf, mac->mlme_cfg->power.max_tx_power_5.len); + } qdf_mem_free(p_buf); }