qcacld-3.0: Reorganize HT caps from hdd_update_config_dat API
Reorganizing HT caps from hdd_update_config_dat API before refactoring it. Change-Id: I3ec667873952f1a4f2ce8414960b7d936fc93d90 CRs-Fixed: 1069659
This commit is contained in:
@@ -6161,29 +6161,23 @@ QDF_STATUS hdd_hex_string_to_u16_array(char *str,
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hdd_update_config_dat() - scan the string and convery to u8 array
|
* hdd_update_ht_cap_in_cfg() - to update HT cap in global CFG
|
||||||
* @str: the pointer to the string
|
* @hdd_ctx: pointer to hdd context
|
||||||
* @intArray: the pointer of buffer to store the u8 value
|
|
||||||
* @len: size of the buffer
|
|
||||||
*
|
*
|
||||||
* Return: QDF_STATUS_SUCCESS if the configuration could be updated corectly,
|
* This API will update the HT config in CFG after taking intersection
|
||||||
* otherwise QDF_STATUS_E_INVAL
|
* of INI and firmware capabilities provided reading CFG
|
||||||
|
*
|
||||||
|
* Return: true or false
|
||||||
*/
|
*/
|
||||||
bool hdd_update_config_dat(hdd_context_t *pHddCtx)
|
static bool hdd_update_ht_cap_in_cfg(hdd_context_t *pHddCtx)
|
||||||
{
|
{
|
||||||
bool fStatus = true;
|
bool fStatus = true;
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
uint16_t val16;
|
uint16_t val16;
|
||||||
|
|
||||||
struct hdd_config *pConfig = pHddCtx->config;
|
struct hdd_config *pConfig = pHddCtx->config;
|
||||||
tSirMacHTCapabilityInfo *phtCapInfo;
|
tSirMacHTCapabilityInfo *phtCapInfo;
|
||||||
|
|
||||||
/*
|
|
||||||
* During the initialization both 2G and 5G capabilities should be same.
|
|
||||||
* So read 5G HT capablity and update 2G and 5G capablities.
|
|
||||||
*/
|
|
||||||
if (sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO,
|
if (sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO,
|
||||||
&val) ==
|
&val) ==
|
||||||
QDF_STATUS_E_FAILURE) {
|
QDF_STATUS_E_FAILURE) {
|
||||||
@@ -6206,6 +6200,44 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx)
|
|||||||
fStatus = false;
|
fStatus = false;
|
||||||
hdd_err("Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
|
hdd_err("Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
|
||||||
}
|
}
|
||||||
|
sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, &val);
|
||||||
|
val16 = (uint16_t) val;
|
||||||
|
phtCapInfo = (tSirMacHTCapabilityInfo *) &val16;
|
||||||
|
phtCapInfo->rxSTBC = pConfig->enableRxSTBC;
|
||||||
|
phtCapInfo->advCodingCap = pConfig->enableRxLDPC;
|
||||||
|
val = val16;
|
||||||
|
if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, val)
|
||||||
|
== QDF_STATUS_E_FAILURE) {
|
||||||
|
fStatus = false;
|
||||||
|
hddLog(LOGE, "Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
|
||||||
|
}
|
||||||
|
|
||||||
|
return fStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hdd_update_config_dat() - scan the string and convery to u8 array
|
||||||
|
* @str: the pointer to the string
|
||||||
|
* @intArray: the pointer of buffer to store the u8 value
|
||||||
|
* @len: size of the buffer
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS_SUCCESS if the configuration could be updated corectly,
|
||||||
|
* otherwise QDF_STATUS_E_INVAL
|
||||||
|
*/
|
||||||
|
bool hdd_update_config_dat(hdd_context_t *pHddCtx)
|
||||||
|
{
|
||||||
|
bool fStatus = true;
|
||||||
|
uint32_t val;
|
||||||
|
struct hdd_config *pConfig = pHddCtx->config;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* During the initialization both 2G and 5G capabilities should be same.
|
||||||
|
* So read 5G HT capablity and update 2G and 5G capablities.
|
||||||
|
*/
|
||||||
|
if (!hdd_update_ht_cap_in_cfg(pHddCtx)) {
|
||||||
|
fStatus = false;
|
||||||
|
hddLog(LOGE, "Could not set HT CAP in cfg");
|
||||||
|
}
|
||||||
|
|
||||||
if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_FIXED_RATE, pConfig->TxRate)
|
if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_FIXED_RATE, pConfig->TxRate)
|
||||||
== QDF_STATUS_E_FAILURE) {
|
== QDF_STATUS_E_FAILURE) {
|
||||||
@@ -6600,17 +6632,6 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, &val);
|
|
||||||
val16 = (uint16_t) val;
|
|
||||||
phtCapInfo = (tSirMacHTCapabilityInfo *) &val16;
|
|
||||||
phtCapInfo->rxSTBC = pConfig->enableRxSTBC;
|
|
||||||
phtCapInfo->advCodingCap = pConfig->enableRxLDPC;
|
|
||||||
val = val16;
|
|
||||||
if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, val)
|
|
||||||
== QDF_STATUS_E_FAILURE) {
|
|
||||||
fStatus = false;
|
|
||||||
hddLog(LOGE, "Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_RXSTBC,
|
if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_RXSTBC,
|
||||||
pConfig->enableRxSTBC) == QDF_STATUS_E_FAILURE) {
|
pConfig->enableRxSTBC) == QDF_STATUS_E_FAILURE) {
|
||||||
|
Reference in New Issue
Block a user