qcacld-3.0: Optimize logs during start bss
Instead of print each frequency in separate line, print all the frequencies in one shot in csr_save_to_channel_power2_g_5_g. Change-Id: I9bca0a94b702626e247bd63f3aa3a617597351a0 CRs-Fixed: 3128543
This commit is contained in:

committed by
Madan Koyyalamudi

parent
e398b7e48d
commit
5e8af21ed8
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -147,6 +148,14 @@ static void csr_purge_channel_power(struct mac_context *mac,
|
|||||||
csr_ll_unlock(pChannelList);
|
csr_ll_unlock(pChannelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define FREQ_SIZE 4
|
||||||
|
#define SPACE_SIZE 2
|
||||||
|
#define SIZEOFNULL 1
|
||||||
|
#define BUF24GHZSIZE (NUM_24GHZ_CHANNELS * (\
|
||||||
|
FREQ_SIZE + SPACE_SIZE) + SIZEOFNULL)
|
||||||
|
#define BUF5GHZSIZE (NUM_5GHZ_CHANNELS * (\
|
||||||
|
FREQ_SIZE + SPACE_SIZE) + SIZEOFNULL)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Save the channelList into the ultimate storage as the final stage of channel
|
* Save the channelList into the ultimate storage as the final stage of channel
|
||||||
* Input: pCountryInfo -- the country code (e.g. "USI"), channel list, and power
|
* Input: pCountryInfo -- the country code (e.g. "USI"), channel list, and power
|
||||||
@@ -158,41 +167,53 @@ QDF_STATUS csr_save_to_channel_power2_g_5_g(struct mac_context *mac,
|
|||||||
{
|
{
|
||||||
uint32_t i = tableSize / sizeof(struct pwr_channel_info);
|
uint32_t i = tableSize / sizeof(struct pwr_channel_info);
|
||||||
struct pwr_channel_info *pChannelInfo;
|
struct pwr_channel_info *pChannelInfo;
|
||||||
struct csr_channel_powerinfo *pChannelSet;
|
struct csr_channel_powerinfo *pchannelset;
|
||||||
bool f2GHzInfoFound = false;
|
bool f2GHzInfoFound = false;
|
||||||
bool f2GListPurged = false, f5GListPurged = false;
|
bool f2GListPurged = false, f5GListPurged = false;
|
||||||
|
uint8_t *buf24ghz = qdf_mem_malloc(BUF24GHZSIZE);
|
||||||
|
uint8_t *buf5ghz = qdf_mem_malloc(BUF5GHZSIZE);
|
||||||
|
uint32_t size24ghz = 0, size5ghz = 0;
|
||||||
|
|
||||||
|
if (!buf24ghz || !buf5ghz) {
|
||||||
|
if (buf24ghz)
|
||||||
|
qdf_mem_free(buf24ghz);
|
||||||
|
if (buf5ghz)
|
||||||
|
qdf_mem_free(buf5ghz);
|
||||||
|
return QDF_STATUS_E_NOMEM;
|
||||||
|
}
|
||||||
pChannelInfo = channelTable;
|
pChannelInfo = channelTable;
|
||||||
/* atleast 3 bytes have to be remaining -- from "countryString" */
|
/* atleast 3 bytes have to be remaining -- from "countryString" */
|
||||||
while (i--) {
|
while (i--) {
|
||||||
pChannelSet = qdf_mem_malloc(sizeof(struct csr_channel_powerinfo));
|
pchannelset = qdf_mem_malloc(sizeof(struct csr_channel_powerinfo));
|
||||||
if (!pChannelSet) {
|
if (!pchannelset) {
|
||||||
pChannelInfo++;
|
pChannelInfo++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
pChannelSet->first_chan_freq = pChannelInfo->first_freq;
|
pchannelset->first_chan_freq = pChannelInfo->first_freq;
|
||||||
pChannelSet->numChannels = pChannelInfo->num_chan;
|
pchannelset->numChannels = pChannelInfo->num_chan;
|
||||||
/*
|
/*
|
||||||
* Now set the inter-channel offset based on the frequency band
|
* Now set the inter-channel offset based on the frequency band
|
||||||
* the channel set lies in
|
* the channel set lies in
|
||||||
*/
|
*/
|
||||||
if (WLAN_REG_IS_24GHZ_CH_FREQ(pChannelSet->first_chan_freq) &&
|
if (WLAN_REG_IS_24GHZ_CH_FREQ(pchannelset->first_chan_freq) &&
|
||||||
(pChannelSet->first_chan_freq + 5 * (pChannelSet->numChannels - 1) <=
|
(pchannelset->first_chan_freq + 5 * (pchannelset->numChannels - 1) <=
|
||||||
WLAN_REG_MAX_24GHZ_CHAN_FREQ)) {
|
WLAN_REG_MAX_24GHZ_CHAN_FREQ)) {
|
||||||
pChannelSet->interChannelOffset = 5;
|
pchannelset->interChannelOffset = 5;
|
||||||
f2GHzInfoFound = true;
|
f2GHzInfoFound = true;
|
||||||
} else if (WLAN_REG_IS_5GHZ_CH_FREQ(pChannelSet->first_chan_freq) &&
|
} else if (WLAN_REG_IS_5GHZ_CH_FREQ(pchannelset->first_chan_freq) &&
|
||||||
(pChannelSet->first_chan_freq + 20 * (pChannelSet->numChannels - 1) <=
|
(pchannelset->first_chan_freq + 20 * (pchannelset->numChannels - 1) <=
|
||||||
WLAN_REG_MAX_5GHZ_CHAN_FREQ)) {
|
WLAN_REG_MAX_5GHZ_CHAN_FREQ)) {
|
||||||
pChannelSet->interChannelOffset = 20;
|
pchannelset->interChannelOffset = 20;
|
||||||
f2GHzInfoFound = false;
|
f2GHzInfoFound = false;
|
||||||
} else {
|
} else {
|
||||||
sme_warn("Invalid Channel freq %d Present in Country IE",
|
sme_warn("Invalid Channel freq %d Present in Country IE",
|
||||||
pChannelSet->first_chan_freq);
|
pchannelset->first_chan_freq);
|
||||||
qdf_mem_free(pChannelSet);
|
qdf_mem_free(pchannelset);
|
||||||
|
qdf_mem_free(buf24ghz);
|
||||||
|
qdf_mem_free(buf5ghz);
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
pChannelSet->txPower = pChannelInfo->max_tx_pwr;
|
pchannelset->txPower = pChannelInfo->max_tx_pwr;
|
||||||
if (f2GHzInfoFound) {
|
if (f2GHzInfoFound) {
|
||||||
if (!f2GListPurged) {
|
if (!f2GListPurged) {
|
||||||
/* purge previous results if found new */
|
/* purge previous results if found new */
|
||||||
@@ -205,13 +226,14 @@ QDF_STATUS csr_save_to_channel_power2_g_5_g(struct mac_context *mac,
|
|||||||
/* add to the list of 2.4 GHz channel sets */
|
/* add to the list of 2.4 GHz channel sets */
|
||||||
csr_ll_insert_tail(&mac->scan.
|
csr_ll_insert_tail(&mac->scan.
|
||||||
channelPowerInfoList24,
|
channelPowerInfoList24,
|
||||||
&pChannelSet->link,
|
&pchannelset->link,
|
||||||
LL_ACCESS_LOCK);
|
LL_ACCESS_LOCK);
|
||||||
} else {
|
} else {
|
||||||
sme_debug(
|
size24ghz += qdf_scnprintf(
|
||||||
"Adding 11B/G ch in 11A. 1st ch freq %d",
|
buf24ghz + size24ghz,
|
||||||
pChannelSet->first_chan_freq);
|
BUF24GHZSIZE - size24ghz, " %d",
|
||||||
qdf_mem_free(pChannelSet);
|
pchannelset->first_chan_freq);
|
||||||
|
qdf_mem_free(pchannelset);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* 5GHz info found */
|
/* 5GHz info found */
|
||||||
@@ -226,20 +248,26 @@ QDF_STATUS csr_save_to_channel_power2_g_5_g(struct mac_context *mac,
|
|||||||
/* add to the list of 5GHz channel sets */
|
/* add to the list of 5GHz channel sets */
|
||||||
csr_ll_insert_tail(&mac->scan.
|
csr_ll_insert_tail(&mac->scan.
|
||||||
channelPowerInfoList5G,
|
channelPowerInfoList5G,
|
||||||
&pChannelSet->link,
|
&pchannelset->link,
|
||||||
LL_ACCESS_LOCK);
|
LL_ACCESS_LOCK);
|
||||||
} else {
|
} else {
|
||||||
sme_debug(
|
size5ghz += qdf_scnprintf(
|
||||||
"Adding 11A ch in B/G. 1st ch freq %d",
|
buf5ghz + size5ghz,
|
||||||
pChannelSet->first_chan_freq);
|
BUF5GHZSIZE - size5ghz, " %d",
|
||||||
qdf_mem_free(pChannelSet);
|
pchannelset->first_chan_freq);
|
||||||
|
qdf_mem_free(pchannelset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pChannelInfo++; /* move to next entry */
|
pChannelInfo++; /* move to next entry */
|
||||||
}
|
}
|
||||||
|
if (size24ghz)
|
||||||
|
sme_nofl_debug("Adding 11B/G ch in 11A:%s", buf24ghz);
|
||||||
|
qdf_mem_free(buf24ghz);
|
||||||
|
if (size5ghz)
|
||||||
|
sme_nofl_debug("Adding 11A ch in B/G:%s", buf5ghz);
|
||||||
|
qdf_mem_free(buf5ghz);
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void csr_apply_power2_current(struct mac_context *mac)
|
void csr_apply_power2_current(struct mac_context *mac)
|
||||||
{
|
{
|
||||||
sme_debug("Updating Cfg with power settings");
|
sme_debug("Updating Cfg with power settings");
|
||||||
|
Reference in New Issue
Block a user