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
This commit is contained in:
Paul Zhang 2019-04-19 16:40:24 +08:00 • committed by nshrivas
commit 2f7892359f

View file

@ -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);
}