diff --git a/Kbuild b/Kbuild index 6aa304bfec40..a2a5e909182b 100644 --- a/Kbuild +++ b/Kbuild @@ -283,11 +283,6 @@ MAC_INC := -I$(WLAN_ROOT)/$(MAC_INC_DIR) \ -I$(WLAN_ROOT)/$(MAC_SRC_DIR)/pe/lim \ -I$(WLAN_ROOT)/$(MAC_SRC_DIR)/pe/nan -MAC_CFG_OBJS := $(MAC_SRC_DIR)/cfg/cfg_api.o \ - $(MAC_SRC_DIR)/cfg/cfg_param_name.o \ - $(MAC_SRC_DIR)/cfg/cfg_proc_msg.o \ - $(MAC_SRC_DIR)/cfg/cfg_send_msg.o - MAC_DPH_OBJS := $(MAC_SRC_DIR)/dph/dph_hash_table.o MAC_LIM_OBJS := $(MAC_SRC_DIR)/pe/lim/lim_aid_mgmt.o \ diff --git a/core/mac/src/cfg/cfg_api.c b/core/mac/src/cfg/cfg_api.c deleted file mode 100644 index 18ae1845b246..000000000000 --- a/core/mac/src/cfg/cfg_api.c +++ /dev/null @@ -1,833 +0,0 @@ -/* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * - * This file contains the source code for CFG API functions. - * - * Author: Kevin Nguyen - * Date: 04/09/02 - * History:- - * 04/09/02 Created. - * -------------------------------------------------------------------- - */ - -#include "cds_api.h" -#include "cfg_priv.h" -#include "wma_types.h" -#include "cfg_api.h" - -/* --------------------------------------------------------------------- */ -/* Static Variables */ -/* ---------------------------------------------------------------------- */ -static tCfgCtl __g_cfg_entry[CFG_PARAM_MAX_NUM]; -static uint8_t __g_s_buffer[CFG_MAX_STR_LEN]; -static uint32_t __g_param_list[WNI_CFG_MAX_PARAM_NUM + - WNI_CFG_GET_PER_STA_STAT_RSP_NUM]; - -static void notify(struct mac_context *, uint16_t, uint32_t); - -typedef enum { - eRF_BAND_UNKNOWN = 0, - eRF_BAND_2_4_GHZ = 1, - eRF_BAND_5_GHZ = 2 -} eRfBandMode; - -extern cfgstatic_string cfg_static_string[CFG_MAX_STATIC_STRING]; -extern cgstatic cfg_static[CFG_PARAM_MAX_NUM]; - -/* --------------------------------------------------------------------- */ -uint32_t cfg_need_restart(struct mac_context *mac, uint16_t cfgId) -{ - if (!mac->cfg.gCfgEntry) { - pe_err("gCfgEntry is NULL"); - return 0; - } - return !!(mac->cfg.gCfgEntry[cfgId].control & CFG_CTL_RESTART); -} - -static void cfg_get_strindex(struct mac_context *mac, uint16_t cfgId) -{ - uint16_t i = 0; - - for (i = 0; i < CFG_MAX_STATIC_STRING; i++) { - if (cfgId == cfg_static_string[i].cfgId) - break; - } - if (i == CFG_MAX_STATIC_STRING) { - pe_warn("Entry not found for cfg id: %d", cfgId); - cfg_static[cfgId].pStrData = NULL; - return; - } - cfg_static[cfgId].pStrData = &cfg_static_string[i]; -} -/* --------------------------------------------------------------------- */ -uint32_t cfg_need_reload(struct mac_context *mac, uint16_t cfgId) -{ - if (!mac->cfg.gCfgEntry) { - pe_err("gCfgEntry is NULL"); - return 0; - } - return !!(mac->cfg.gCfgEntry[cfgId].control & CFG_CTL_RELOAD); -} - -/* --------------------------------------------------------------------- */ -QDF_STATUS cfg_init(struct mac_context *mac) -{ - uint16_t i = 0; - uint16_t combined_buff_size = 0; - uint32_t max_i_count = 0; - uint32_t max_s_count = 0; - cfgstatic_string *str_cfg; - - mac->cfg.gSBuffer = __g_s_buffer; - mac->cfg.gCfgEntry = __g_cfg_entry; - mac->cfg.gParamList = __g_param_list; - - for (i = 0; i < CFG_PARAM_MAX_NUM; i++) { - if (!(cfg_static[i].control & CFG_CTL_INT)) { - cfg_get_strindex(mac, i); - } else { - cfg_static[i].pStrData = NULL; - } - } - - for (i = 0; i < CFG_PARAM_MAX_NUM ; i++) { - if (cfg_static[i].control & CFG_CTL_INT) { - max_i_count++; - } else { - str_cfg = (cfgstatic_string *)cfg_static[i].pStrData; - if (str_cfg == NULL) { - pe_warn("pStrCfg is NULL for CfigID: %d", i); - continue; - } - /* + 2 to include len field and max len field */ - max_s_count += str_cfg->maxLen + 2; - } - } - - mac->cfg.gCfgMaxIBufSize = max_i_count; - mac->cfg.gCfgMaxSBufSize = max_s_count; - - /* Allocate a combined memory */ - combined_buff_size = max_s_count + (3 * sizeof(uint32_t) * max_i_count); - - pe_debug("Size of cfg I buffer: %d S buffer: %d", - max_i_count, max_s_count); - - pe_debug("Allocation for cfg buffers: %d bytes", combined_buff_size); - - if (combined_buff_size > 4 * PAGE_SIZE) { - pe_err("Mem alloc request too big"); - return QDF_STATUS_E_NOMEM; - } - /* at this point mac->cfg.gCfgSBuf starts */ - mac->cfg.gCfgSBuf = qdf_mem_malloc(combined_buff_size); - if (!mac->cfg.gCfgSBuf) - return QDF_STATUS_E_NOMEM; - - /* at offset max_s_count, mac->cfg.gCfgIBuf starts */ - mac->cfg.gCfgIBuf = (uint32_t *)&mac->cfg.gCfgSBuf[max_s_count]; - /* after max_i_count integers, mac->cfg.gCfgIBufMin starts */ - mac->cfg.gCfgIBufMin = &mac->cfg.gCfgIBuf[max_i_count]; - /* after max_i_count integers, mac->cfg.gCfgIBufMax starts */ - mac->cfg.gCfgIBufMax = &mac->cfg.gCfgIBufMin[max_i_count]; - - return QDF_STATUS_SUCCESS; -} - -/* ---------------------------------------------------------------------- */ -void cfg_de_init(struct mac_context *mac) -{ - qdf_mem_free(mac->cfg.gCfgSBuf); - mac->cfg.gCfgIBufMin = NULL; - mac->cfg.gCfgIBufMax = NULL; - mac->cfg.gCfgIBuf = NULL; - mac->cfg.gCfgSBuf = NULL; - mac->cfg.gSBuffer = NULL; - mac->cfg.gCfgEntry = NULL; - mac->cfg.gParamList = NULL; -} - -/* --------------------------------------------------------------------- */ -/** - * cfg_check_valid() - * - * FUNCTION: - * This function is called to check if a parameter is valid - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: - * - * @param cfgId: 16-bit CFG parameter ID - * - * @return QDF_STATUS_SUCCESS: request completed successfully - * @return QDF_STATUS_E_INVAL: invalid CFG parameter ID - */ -QDF_STATUS cfg_check_valid(struct mac_context *mac, uint16_t cfgId, - uint32_t *index) -{ - uint32_t control; - - if (cfgId >= CFG_PARAM_MAX_NUM) { - pe_warn("Invalid cfg id: %d", cfgId); - return QDF_STATUS_E_INVAL; - } - if (!mac->cfg.gCfgEntry) { - pe_warn("gCfgEntry is NULL"); - return QDF_STATUS_E_INVAL; - } - - control = mac->cfg.gCfgEntry[cfgId].control; - - /* Check if parameter is valid */ - if ((control & CFG_CTL_VALID) == 0) { - pe_warn("Not valid cfg id: %d", cfgId); - return QDF_STATUS_E_INVAL; - } - - *index = control & CFG_BUF_INDX_MASK; - - if (*index >= mac->cfg.gCfgMaxSBufSize) { - pe_warn("cfg index out of bounds: %d", *index); - return QDF_STATUS_E_INVAL; - } - - return QDF_STATUS_SUCCESS; - -} /*** end cfg_check_valid() ***/ - -/* --------------------------------------------------------------------- */ -/** - * cfg_set_int() - * - * FUNCTION: - * This function is called to update an integer parameter. - * - * LOGIC: - * - * ASSUMPTIONS: - * - Range checking is performed by the calling function. In case this - * function call is being triggered by a request from host, then host - * is responsible for performing range checking before sending the - * request. - * - * - Host RW permission checking should already be done prior to calling - * this function by the message processing function. - * - * NOTE: - * - * @param cfgId: 16-bit CFG parameter ID - * @param value: 32-bit unsigned value - * - * @return QDF_STATUS_SUCCESS: request completed successfully - * @return QDF_STATUS_E_INVAL: invalid CFG parameter ID - */ - -QDF_STATUS cfg_set_int(struct mac_context *mac, uint16_t cfgId, uint32_t value) -{ - uint32_t index; - uint32_t control; - uint32_t mask; - QDF_STATUS status; - - status = cfg_check_valid(mac, cfgId, &index); - - if (QDF_STATUS_SUCCESS != status) - return status; - - if ((mac->cfg.gCfgIBufMin[index] > value) || - (mac->cfg.gCfgIBufMax[index] < value)) { - pe_warn("Value: %d out of range: [%d,%d] cfg id: %d, %s", - value, mac->cfg.gCfgIBufMin[index], - mac->cfg.gCfgIBufMax[index], cfgId, - cfg_get_string(cfgId)); - return QDF_STATUS_E_INVAL; - } else { - /* Write integer value */ - mac->cfg.gCfgIBuf[index] = value; - - control = mac->cfg.gCfgEntry[cfgId].control; - /* Update hardware if necessary */ - mask = control & CFG_CTL_NTF_MASK; - if ((mask & CFG_CTL_NTF_HW) != 0) - pe_debug("CFG notify HW not supported!!!"); - /* notify other modules if necessary */ - if ((mask & CFG_CTL_NTF_MASK) != 0) - notify(mac, cfgId, mask); - } - return status; -} /*** end cfg_set_int ***/ - -/* --------------------------------------------------------------------- */ -/** - * wlan_cfg_get_int() - * - * FUNCTION: - * This function is called to read an integer parameter. - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: - * - * @param cfgId: 16-bit CFG parameter ID - * @param pVal: address where parameter value will be written - * - * @return QDF_STATUS_SUCCESS: request completed successfully - * @return QDF_STATUS_E_INVAL: invalid CFG parameter ID - */ - -QDF_STATUS wlan_cfg_get_int(struct mac_context *mac, uint16_t cfgId, - uint32_t *pValue) -{ - uint32_t index; - QDF_STATUS status; - - status = cfg_check_valid(mac, cfgId, &index); - - if (QDF_STATUS_SUCCESS != status) - return status; - - /* Get integer value */ - *pValue = mac->cfg.gCfgIBuf[index]; - - return QDF_STATUS_SUCCESS; -} /*** end wlan_cfg_get_int() ***/ - -/* --------------------------------------------------------------------- */ -/** - * cfg_set_str() - * - * FUNCTION: - * This function is called to set a string parameter. - * - * LOGIC: - * This function invokes the cfg_set_str_notify function passing the notify - * bool value set to true. This basically means that HAL needs to be - * notified. This is true in the case of non-integrated SOC's or Libra/Volans. - * In the case of Prima the cfg_set_str_notify is invoked with the bool value - * set to false. - * - * ASSUMPTIONS: - * - always notify has to be called - * - * NOTE: - * - * @param cfgId: 16-bit CFG parameter ID - * @param pStr: address of string data - * @param len: string length - * - * @return QDF_STATUS_SUCCESS: request completed successfully - * @return QDF_STATUS_E_INVAL: invalid CFG parameter ID - * @return QDF_STATUS_E_INVAL: invalid CFG parameter length - * - */ - -QDF_STATUS cfg_set_str(struct mac_context *mac, uint16_t cfgId, uint8_t *pStr, - uint32_t length) -{ - return cfg_set_str_notify(mac, cfgId, pStr, length, true); -} - -/* --------------------------------------------------------------------- */ -/** - * cfg_set_str_notify() - * - * FUNCTION: - * This function is called to set a string parameter. - * - * LOGIC: - * - * ASSUMPTIONS: - * - No length checking will be performed. Should be done by calling - * module. - * - Host RW permission should be checked prior to calling this - * function. - * - * NOTE: - * - * @param cfgId: 16-bit CFG parameter ID - * @param pStr: address of string data - * @param len: string length - * @param notifyMod. notify respective Module - * - * @return QDF_STATUS_SUCCESS: request completed successfully - * @return QDF_STATUS_E_INVAL: invalid CFG parameter ID - * @return QDF_STATUS_E_INVAL: invalid CFG parameter length - * - */ - -QDF_STATUS cfg_set_str_notify(struct mac_context *mac, uint16_t cfgId, - uint8_t *pStr, uint32_t length, - int notifyMod) -{ - uint8_t *pDst, *pDstEnd; - uint32_t index, paramLen, mask; - uint32_t control; - QDF_STATUS status; - - status = cfg_check_valid(mac, cfgId, &index); - - if (QDF_STATUS_SUCCESS != status) - return status; - - pDst = &mac->cfg.gCfgSBuf[index]; - paramLen = *pDst++; - control = mac->cfg.gCfgEntry[cfgId].control; - if (length > paramLen) { - pe_warn("Invalid length: %d (>%d) cfg id: %d", - length, paramLen, cfgId); - return QDF_STATUS_E_INVAL; - } else { - *pDst++ = (uint8_t) length; - pDstEnd = pDst + length; - while (pDst < pDstEnd) { - *pDst++ = *pStr++; - } - if (notifyMod) { - /* Update hardware if necessary */ - mask = control & CFG_CTL_NTF_MASK; - if ((mask & CFG_CTL_NTF_HW) != 0) { - pe_debug("CFG notify HW not supported!"); - } - /* notify other modules if necessary */ - if ((mask & CFG_CTL_NTF_MASK) != 0) { - notify(mac, cfgId, mask); - } - } - } - return QDF_STATUS_SUCCESS; -} /*** end cfg_set_str_notify() ***/ - -/* --------------------------------------------------------------------- */ -/** - * wlan_cfg_get_str() - * - * FUNCTION: - * This function is called to get a string parameter. - * - * LOGIC: - * - * ASSUMPTIONS: - * - Host RW permission should be checked prior to calling this - * function. - * - * NOTE: - * - * @param cfgId: 16-bit CFG parameter ID - * @param pBuf: address of string buffer - * @param pLen: address of max buffer length - * actual length will be returned at this address - * - * @return QDF_STATUS_SUCCESS: request completed successfully - * @return QDF_STATUS_E_INVAL: invalid CFG parameter ID - * @return QDF_STATUS_E_INVAL: invalid CFG parameter length - * - */ - -QDF_STATUS wlan_cfg_get_str(struct mac_context *mac, uint16_t cfgId, - uint8_t *pBuf, uint32_t *pLength) -{ - uint8_t *pSrc, *pSrcEnd; - uint32_t index; - QDF_STATUS status; - - status = cfg_check_valid(mac, cfgId, &index); - - if (QDF_STATUS_SUCCESS != status) - return status; - - /* Get string */ - pSrc = &mac->cfg.gCfgSBuf[index]; - pSrc++; /* skip over max length */ - if (*pLength < *pSrc) { - pe_warn("Invalid length: %d (<%d) cfg id: %d", - *pLength, *pSrc, cfgId); - return QDF_STATUS_E_INVAL; - } else { - *pLength = *pSrc++; /* save parameter length */ - pSrcEnd = pSrc + *pLength; - while (pSrc < pSrcEnd) - *pBuf++ = *pSrc++; - } - return QDF_STATUS_SUCCESS; -} /*** end wlan_cfg_get_str() ***/ - -/* --------------------------------------------------------------------- */ -/** - * wlan_cfg_get_str_max_len() - * - * FUNCTION: - * This function is called to get a string maximum length. - * - * LOGIC: - * - * ASSUMPTIONS: - * - Host RW permission should be checked prior to calling this - * function. - * - * NOTE: - * - * @param cfgId: 16-bit CFG parameter ID - * @param pLen: maximum length will be returned at this address - * - * @return QDF_STATUS_SUCCESS: request completed successfully - * @return QDF_STATUS_E_INVAL: invalid CFG parameter ID - * - */ - -QDF_STATUS wlan_cfg_get_str_max_len(struct mac_context *mac, uint16_t cfgId, - uint32_t *pLength) -{ - uint32_t index; - QDF_STATUS status; - - status = cfg_check_valid(mac, cfgId, &index); - - if (QDF_STATUS_SUCCESS != status) - return status; - - *pLength = mac->cfg.gCfgSBuf[index]; - - return status; -} /*** end wlan_cfg_get_str_max_len() ***/ - -/* --------------------------------------------------------------------- */ -/** - * wlan_cfg_get_str_len() - * - * FUNCTION: - * This function is called to get a string length. - * - * LOGIC: - * - * ASSUMPTIONS: - * - Host RW permission should be checked prior to calling this - * function. - * - * NOTE: - * - * @param cfgId: 16-bit CFG parameter ID - * @param pLen: current length will be returned at this address - * - * @return QDF_STATUS_SUCCESS: request completed successfully - * @return QDF_STATUS_E_INVAL: invalid CFG parameter ID - * - */ - -QDF_STATUS wlan_cfg_get_str_len(struct mac_context *mac, uint16_t cfgId, - uint32_t *pLength) -{ - uint32_t index; - QDF_STATUS status; - - status = cfg_check_valid(mac, cfgId, &index); - - if (QDF_STATUS_SUCCESS != status) - return status; - - *pLength = mac->cfg.gCfgSBuf[index + 1]; - - return status; - -} /*** end wlan_cfg_get_str_len() ***/ - -/** - * cfg_get_dot11d_transmit_power() - regulatory max transmit power - * @pMac: pointer to mac data - * @channel: channel number - * - * Return: int8_t - power - */ -static int8_t -cfg_get_dot11d_transmit_power(struct mac_context *pMac, uint8_t channel) -{ - uint32_t cfg_length = 0; - int8_t max_tx_pwr = 0; - uint8_t *country_info = NULL; - uint8_t count = 0; - uint8_t first_channel; - uint8_t maxChannels; - - if (WLAN_REG_IS_5GHZ_CH(channel)) - cfg_length = pMac->mlme_cfg->power.max_tx_power_5.len; - else if (WLAN_REG_IS_24GHZ_CH(channel)) - cfg_length = pMac->mlme_cfg->power.max_tx_power_24.len; - else - return max_tx_pwr; - - country_info = qdf_mem_malloc(cfg_length); - if (!country_info) - goto error; - - if (WLAN_REG_IS_5GHZ_CH(channel)) { - qdf_mem_copy(country_info, - pMac->mlme_cfg->power.max_tx_power_5.data, - cfg_length); - } else if (WLAN_REG_IS_24GHZ_CH(channel)) { - qdf_mem_copy(country_info, - pMac->mlme_cfg->power.max_tx_power_24.data, - cfg_length); - } - - /* Identify the channel and maxtxpower */ - while (count <= (cfg_length - (sizeof(tSirMacChanInfo)))) { - first_channel = country_info[count++]; - maxChannels = country_info[count++]; - max_tx_pwr = country_info[count++]; - - if ((channel >= first_channel) && - (channel < (first_channel + maxChannels))) { - break; - } - } - -error: - if (country_info) - qdf_mem_free(country_info); - - return max_tx_pwr; -} - -/**---------------------------------------------------------------------- - \fn cfg_get_regulatory_max_transmit_power - - \brief Gets regulatory tx power on the current channel. - - \param mac - \param channel - \param rfBand - -----------------------------------------------------------------------*/ -int8_t cfg_get_regulatory_max_transmit_power(struct mac_context *mac, - uint8_t channel) -{ - return cfg_get_dot11d_transmit_power(mac, channel); -} - -/* --------------------------------------------------------------------- */ -/** - * cfg_get_capability_info - * - * FUNCTION: - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: - * - * @param None - * @return None - */ - -QDF_STATUS cfg_get_capability_info(struct mac_context *mac, uint16_t *pCap, - struct pe_session *pe_session) -{ - uint32_t val = 0; - tpSirMacCapabilityInfo pCapInfo; - - *pCap = 0; - pCapInfo = (tpSirMacCapabilityInfo) pCap; - - if (LIM_IS_IBSS_ROLE(pe_session)) - pCapInfo->ibss = 1; /* IBSS bit */ - else if (LIM_IS_AP_ROLE(pe_session) || - LIM_IS_STA_ROLE(pe_session)) - pCapInfo->ess = 1; /* ESS bit */ - else if (LIM_IS_P2P_DEVICE_ROLE(pe_session) || - LIM_IS_NDI_ROLE(pe_session)) { - pCapInfo->ess = 0; - pCapInfo->ibss = 0; - } else - pe_warn("can't get capability, role is UNKNOWN!!"); - - if (LIM_IS_AP_ROLE(pe_session)) { - val = pe_session->privacy; - } else { - /* PRIVACY bit */ - val = mac->mlme_cfg->wep_params.is_privacy_enabled; - } - if (val) - pCapInfo->privacy = 1; - - /* Short preamble bit */ - if (mac->mlme_cfg->ht_caps.short_preamble) - pCapInfo->shortPreamble = - mac->mlme_cfg->ht_caps.short_preamble; - - /* PBCC bit */ - pCapInfo->pbcc = 0; - - /* Channel agility bit */ - pCapInfo->channelAgility = 0; - /* If STA/AP operating in 11B mode, don't set rest of the - * capability info bits. - */ - if (pe_session->dot11mode == WNI_CFG_DOT11_MODE_11B) - return QDF_STATUS_SUCCESS; - - /* Short slot time bit */ - if (LIM_IS_AP_ROLE(pe_session)) { - pCapInfo->shortSlotTime = pe_session->shortSlotTimeSupported; - } else { - /* When in STA mode, we need to check if short slot is - * enabled as well as check if the current operating - * mode is short slot time and then decide whether to - * enable short slot or not. It is safe to check both - * cfg values to determine short slot value in this - * funcn since this funcn is always used after assoc - * when these cfg values are already set based on - * peer's capability. Even in case of IBSS, its value - * is set to correct value either in delBSS as part of - * deleting the previous IBSS or in start BSS as part - * of coalescing - */ - if (mac->mlme_cfg->feature_flags.enable_short_slot_time_11g) { - pCapInfo->shortSlotTime = - pe_session->shortSlotTimeSupported; - } - } - - /* Spectrum Management bit */ - if (!LIM_IS_IBSS_ROLE(pe_session) && pe_session->lim11hEnable) { - if (mac->mlme_cfg->gen.enabled_11h) - pCapInfo->spectrumMgt = 1; - } - /* QoS bit */ - if (mac->mlme_cfg->wmm_params.qos_enabled) - pCapInfo->qos = 1; - - /* APSD bit */ - if (mac->mlme_cfg->scoring.apsd_enabled) - pCapInfo->apsd = 1; - - pCapInfo->rrm = mac->rrm.rrmSmeContext.rrmConfig.rrm_enabled; - pe_debug("RRM: %d", pCapInfo->rrm); - /* DSSS-OFDM */ - /* FIXME : no config defined yet. */ - - /* Block ack bit */ - val = mac->mlme_cfg->feature_flags.enable_block_ack; - pCapInfo->delayedBA = - (uint16_t) ((val >> WNI_CFG_BLOCK_ACK_ENABLED_DELAYED) & 1); - pCapInfo->immediateBA = - (uint16_t) ((val >> WNI_CFG_BLOCK_ACK_ENABLED_IMMEDIATE) & 1); - - return QDF_STATUS_SUCCESS; -} - -/* -------------------------------------------------------------------- */ -/** - * cfg_set_capability_info - * - * FUNCTION: - * This function is called on BP based on the capabilities - * received in SME_JOIN/REASSOC_REQ message. - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: 1. ESS/IBSS capabilities are based on system role. - * 2. Since PBCC, Channel agility and Extended capabilities - * are not supported, they're not set at CFG - * - * @param mac Pointer to global MAC structure - * @param caps 16-bit Capability Info field - * @return None - */ - -void cfg_set_capability_info(struct mac_context *mac, uint16_t caps) -{ -} - -/* --------------------------------------------------------------------- */ -/** - * cfg_cleanup() - * - * FUNCTION: - * CFG cleanup function. - * - * LOGIC: - * - * ASSUMPTIONS: - * None. - * - * NOTE: - * This function must be called during system shutdown. - * - * @param None - * - * @return None. - * - */ - -void cfg_cleanup(struct mac_context *mac) -{ - /* Set status to not-ready */ - mac->cfg.gCfgStatus = CFG_INCOMPLETE; - -} /*** end CfgCleanup() ***/ - -/* --------------------------------------------------------------------- */ -/** - * notify() - * - * FUNCTION: - * This function is called to notify other modules of parameter update. - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: - * - * @param cfgId: configuration parameter ID - * @param mask: notification mask - * - * @return None. - * - */ - -static void notify(struct mac_context *mac, uint16_t cfgId, uint32_t ntfMask) -{ - - struct scheduler_msg mmhMsg = {0}; - - mmhMsg.type = SIR_CFG_PARAM_UPDATE_IND; - mmhMsg.bodyval = (uint32_t) cfgId; - mmhMsg.bodyptr = NULL; - - if ((ntfMask & CFG_CTL_NTF_SCH) != 0) - sch_post_message(mac, &mmhMsg); - - if ((ntfMask & CFG_CTL_NTF_LIM) != 0) - lim_post_msg_api(mac, &mmhMsg); - - if ((ntfMask & CFG_CTL_NTF_TARGET) != 0) - wma_post_ctrl_msg(mac, &mmhMsg); - - /* notify ARQ */ - -} /*** end notify() ***/ - diff --git a/core/mac/src/cfg/cfg_def.h b/core/mac/src/cfg/cfg_def.h deleted file mode 100644 index e521c6be8509..000000000000 --- a/core/mac/src/cfg/cfg_def.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2011-2012, 2014, 2017 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * - * This is the private header file for CFG module. - * - * Author: Kevin Nguyen - * Date: 03/20/02 - * History:- - * 03/20/02 Created. - * -------------------------------------------------------------------- - * - */ - -#ifndef __CFGDEF_H -#define __CFGDEF_H - -/* - * CFG Control Flag definitions - */ -#define CFG_CTL_VALID 0x00010000 -#define CFG_CTL_RE 0x00020000 -#define CFG_CTL_WE 0x00040000 -#define CFG_CTL_INT 0x00080000 -#define CFG_CTL_SAVE 0x00100000 -#define CFG_CTL_RESTART 0x00200000 -#define CFG_CTL_RELOAD 0x00400000 -#define CFG_CTL_NTF_PHY 0x00800000 -#define CFG_CTL_NTF_MAC 0x01000000 -#define CFG_CTL_NTF_LOG 0x02000000 -#define CFG_CTL_NTF_TARGET 0x04000000 -#define CFG_CTL_NTF_DPH 0x08000000 -#define CFG_CTL_NTF_ARQ 0x10000000 -#define CFG_CTL_NTF_SCH 0x20000000 -#define CFG_CTL_NTF_LIM 0x40000000 -#define CFG_CTL_NTF_HDD 0x80000000 -#define CFG_CTL_NTF_MASK 0xFFE00000 - -#define CFG_CTL_NTF_TFP CFG_CTL_NTF_MAC -#define CFG_CTL_NTF_RHP CFG_CTL_NTF_MAC -#define CFG_CTL_NTF_RFP CFG_CTL_NTF_MAC -#define CFG_CTL_NTF_SP CFG_CTL_NTF_MAC -#define CFG_CTL_NTF_HW (CFG_CTL_NTF_MAC | CFG_CTL_NTF_PHY) - -#define CFG_BUF_INDX_MASK 0x00000fff - -#endif /* __CFGDEF_H */ diff --git a/core/mac/src/cfg/cfg_param_name.c b/core/mac/src/cfg/cfg_param_name.c deleted file mode 100644 index 15efd65495ed..000000000000 --- a/core/mac/src/cfg/cfg_param_name.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * DO NOT EDIT - This file is generated automatically - */ - -/* - * IMPORTANT: This file is for system that supports STA mode ONLY. - */ -#include "cfg_priv.h" - -/** - * cfg_get_string() - return string conversion of HE WNI CFG - * @cfg_id: Config ID. - * - * This utility function helps log string conversion of WNI config ID. - * - * Return: string conversion of the HE WNI config ID, if match found; - * "Invalid" otherwise. - */ -const char *cfg_get_string(uint16_t cfg_id) -{ - switch (cfg_id) { - default: - break; - CASE_RETURN_STRING(WNI_CFG_VALID_CHANNEL_LIST); - CASE_RETURN_STRING(WNI_CFG_COUNTRY_CODE); - } - - return "invalid"; -} diff --git a/core/mac/src/cfg/cfg_priv.h b/core/mac/src/cfg/cfg_priv.h deleted file mode 100644 index 5a41f950fbf9..000000000000 --- a/core/mac/src/cfg/cfg_priv.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2011-2015, 2018 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * - * This is the private header file for CFG module. - * - * Author: Kevin Nguyen - * Date: 03/20/02 - * History:- - * 03/20/02 Created. - * -------------------------------------------------------------------- - * - */ - -#ifndef __CFGPRIV_H -#define __CFGPRIV_H - -#include -#include -#include -#include -#include -#include -#include -#include "cfg_def.h" - -#include - -/*--------------------------------------------------------------------*/ -/* CFG miscellaneous definition */ -/*--------------------------------------------------------------------*/ - -/* Function index bit mask */ -#define CFG_FUNC_INDX_MASK 0x7f -#define CFG_GET_FUNC_INDX(val) (val & CFG_FUNC_INDX_MASK) - -/* Macro to convert return code to debug string index */ -#define CFG_GET_DBG_INDX(val) (val - eCFG_SUCCESS - 1) - -/*--------------------------------------------------------------------*/ -/* Binary header structure */ -/*--------------------------------------------------------------------*/ -typedef struct sCfgBinHdr { - uint32_t hdrInfo; - uint32_t controlSize; - uint32_t iBufSize; - uint32_t sBufSize; -} tCfgBinHdr, *tpCfgBinHdr; - -/*--------------------------------------------------------------------*/ -/* Polaris HW counter access structure */ -/*--------------------------------------------------------------------*/ - -#define CFG_STAT_CNT_LO_MASK 0x0000ffff -#define CFG_STAT_CNT_HI_MASK 0xffff0000 -#define CFG_STAT_CNT_HI_INCR 0x00010000 - -/*--------------------------------------------------------------------*/ -/* CFG function prototypes */ -/*--------------------------------------------------------------------*/ - -extern void cfg_send_host_msg(struct mac_context *, uint16_t, uint32_t, uint32_t, - uint32_t *, uint32_t, uint32_t *); - -#endif /* __CFGPRIV_H */ diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c deleted file mode 100644 index 977028f25800..000000000000 --- a/core/mac/src/cfg/cfg_proc_msg.c +++ /dev/null @@ -1,595 +0,0 @@ -/* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file contains CFG functions for processing host messages. - */ -#include "cds_api.h" -#include "ani_global.h" -#include "cfg_priv.h" -#include "wma_types.h" -#include "lim_trace.h" - -cgstatic cfg_static[CFG_PARAM_MAX_NUM] = { - {WNI_CFG_VALID_CHANNEL_LIST, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART | - CFG_CTL_NTF_LIM, - 0, 1, 1}, - {WNI_CFG_COUNTRY_CODE, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_NTF_SCH, - 0, 0, 0}, - {WNI_CFG_REMOVE_TIME_SYNC_CMD, - CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, - WNI_CFG_REMOVE_TIME_SYNC_CMD_STAMIN, - WNI_CFG_REMOVE_TIME_SYNC_CMD_STAMAX, - WNI_CFG_REMOVE_TIME_SYNC_CMD_STADEF}, -}; - - -cfgstatic_string cfg_static_string[CFG_MAX_STATIC_STRING] = { - {WNI_CFG_VALID_CHANNEL_LIST, - WNI_CFG_VALID_CHANNEL_LIST_LEN, - 55, - {36, 40, 44, 48, 52, 56, 60, 64, 1, 6, 11, 34, 38, 42, 46, 2, 3, 4, - 5, 7, 8, 9, 10, 12, 13, 14, 100, 104, 108, 112, 116, 120, 124, 128, - 132, 136, 140, 149, 151, 153, 155, 157, 159, 161, 50, 54, 58, 62, 240, - 242, 244, 246, 248, 250, 252} }, - {WNI_CFG_COUNTRY_CODE, - WNI_CFG_COUNTRY_CODE_LEN, - 0, - {0} }, -}; - -/*--------------------------------------------------------------------*/ -/* Static function prototypes */ -/*--------------------------------------------------------------------*/ -static void proc_dnld_rsp(struct mac_context *, uint16_t, uint32_t *); -static void proc_get_req(struct mac_context *, uint16_t, uint32_t *); - -static uint8_t check_param(struct mac_context *, uint16_t, uint32_t, uint32_t, - uint32_t *); -/*--------------------------------------------------------------------*/ -/* Module global variables */ -/*--------------------------------------------------------------------*/ - -/* CFG function table */ -void (*g_cfg_func[])(struct mac_context *, uint16_t, uint32_t *) = { - proc_dnld_rsp, proc_get_req -}; - -/**--------------------------------------------------------------------- - * cfg_process_mb_msg() - * - ***FUNCTION: - * CFG mailbox message processing function. - * - ***LOGIC: - * - ***ASSUMPTIONS: - * None. - * - ***NOTE: - * - * @param pMsg Message pointer - * - * @return None. - * - */ -void cfg_process_mb_msg(struct mac_context *mac, tSirMbMsg *pMsg) -{ - uint16_t index; - uint16_t len; - uint32_t *pParam; - - /* Use type[7:0] as index to function table */ - index = CFG_GET_FUNC_INDX(pMsg->type); - - if (index >= QDF_ARRAY_SIZE(g_cfg_func)) { - qdf_mem_free(pMsg); - return; - } - len = pMsg->msgLen - WNI_CFG_MB_HDR_LEN; - pParam = ((uint32_t *) pMsg) + 1; - - /* Call processing function */ - g_cfg_func[index] (mac, len, pParam); - - /* Free up buffer */ - qdf_mem_free(pMsg); - -} /*** end cfg_process_mb_msg() ***/ - -/**--------------------------------------------------------------------- - * proc_dnld_rsp() - * - * FUNCTION: - * This function processes CFG_DNLD_RSP message from host. - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: - * - * @param length: message length - * @param pParam: parameter list pointer - * - * @return None - * - */ -static void proc_dnld_rsp(struct mac_context *mac, uint16_t length, uint32_t *pParam) -{ - int32_t i; - - uint32_t expLen, retVal, bufStart, bufEnd; - uint32_t *pSrc, *pDst, *pDstEnd; - uint32_t strSize, j; - uint8_t pStr[CFG_MAX_STR_LEN]; - tpCfgBinHdr pHdr; - struct scheduler_msg mmhMsg = {0}; - - /* First Dword must contain the AP or STA magic dword */ - pe_debug("CFG size: %d bytes MAGIC dword is: 0x%x", - length, sir_read_u32_n((uint8_t *) pParam)); - - /* if the string is not correct, return failure */ - if (*pParam == CFG_STA_MAGIC_DWORD) { - } - - else { - pe_warn("Invalid magic dword: 0x%x", - sir_read_u32_n((uint8_t *) pParam)); - retVal = WNI_CFG_INVALID_LEN; - goto end; - } - - pParam++; - length -= 4; - - /* Parse the Cfg header */ - pHdr = (tpCfgBinHdr) pParam; - pParam += (sizeof(tCfgBinHdr) >> 2); - pe_debug("CFG hdr totParams: %d intParams: %d strBufSize: %d/%d", - pHdr->controlSize, pHdr->iBufSize, pHdr->sBufSize, - mac->cfg.gCfgMaxSBufSize); - - if (pHdr->sBufSize > (UINT_MAX - - (((CFG_PARAM_MAX_NUM + 3 * mac->cfg.gCfgMaxIBufSize) << 2) + - sizeof(tCfgBinHdr)))) { - pe_warn("Invalid sBufSize coming from fw: %d", pHdr->sBufSize); - retVal = WNI_CFG_INVALID_LEN; - goto end; - } - expLen = - ((CFG_PARAM_MAX_NUM + 3 * mac->cfg.gCfgMaxIBufSize) << 2) + - pHdr->sBufSize + sizeof(tCfgBinHdr); - - if (length != expLen) { - pe_warn(" DNLD_RSP invalid length: %d (exp: %d)", length, - expLen); - retVal = WNI_CFG_INVALID_LEN; - goto end; - } - - if (pHdr->controlSize != CFG_PARAM_MAX_NUM) { - pe_warn(" Total parameter count mismatch"); - retVal = WNI_CFG_INVALID_LEN; - goto end; - } - - if (pHdr->iBufSize != mac->cfg.gCfgMaxIBufSize) { - pe_warn(" Integer parameter count mismatch"); - retVal = WNI_CFG_INVALID_LEN; - goto end; - } - /* Copy control array */ - pDst = (uint32_t *) mac->cfg.gCfgEntry; - pDstEnd = pDst + CFG_PARAM_MAX_NUM; - pSrc = pParam; - while (pDst < pDstEnd) { - *pDst++ = *pSrc++; - } - /* Copy default values */ - pDst = mac->cfg.gCfgIBuf; - pDstEnd = pDst + mac->cfg.gCfgMaxIBufSize; - while (pDst < pDstEnd) { - *pDst++ = *pSrc++; - } - - /* Copy min values */ - pDst = mac->cfg.gCfgIBufMin; - pDstEnd = pDst + mac->cfg.gCfgMaxIBufSize; - while (pDst < pDstEnd) { - *pDst++ = *pSrc++; - } - - /* Copy max values */ - pDst = mac->cfg.gCfgIBufMax; - pDstEnd = pDst + mac->cfg.gCfgMaxIBufSize; - while (pDst < pDstEnd) { - *pDst++ = *pSrc++; - } - - for (i = 0; i < mac->cfg.gCfgMaxIBufSize; i++) - if (mac->cfg.gCfgIBuf[i] < mac->cfg.gCfgIBufMin[i] || - mac->cfg.gCfgIBuf[i] > mac->cfg.gCfgIBufMax[i]) { - pe_debug("cfg id: %d Invalid def value: %d min: %d max: %d", - i, mac->cfg.gCfgIBuf[i], - mac->cfg.gCfgIBufMin[i], - mac->cfg.gCfgIBufMax[i]); - } - /* Calculate max string buffer lengths for all string parameters */ - bufEnd = mac->cfg.gCfgMaxSBufSize; - for (i = CFG_PARAM_MAX_NUM - 1; i >= 0; i--) { - if ((mac->cfg.gCfgEntry[i].control & CFG_CTL_INT) != 0) - continue; - - if ((mac->cfg.gCfgEntry[i].control & CFG_CTL_VALID) == 0) - continue; - - bufStart = mac->cfg.gCfgEntry[i].control & CFG_BUF_INDX_MASK; - mac->cfg.gCfgSBuf[bufStart] = - (uint8_t) (bufEnd - bufStart - 2); - - pe_debug("id: %d max: %d bufStart: %d bufEnd: %d", i, - mac->cfg.gCfgSBuf[bufStart], bufStart, bufEnd); - bufEnd = bufStart; - } - - /* Initialize string defaults */ - strSize = pHdr->sBufSize; - while (strSize) { - uint32_t paramId, paramLen, paramLenCeil4; - - if (strSize < 4) { - pe_warn("parsing str defaults, rem: %d bytes", - strSize); - retVal = WNI_CFG_INVALID_LEN; - goto end; - } - paramId = *pSrc >> 16; - paramLen = *pSrc & 0xff; - pSrc++; - strSize -= 4; - - paramLenCeil4 = ((paramLen + 3) >> 2); - if (strSize < paramLenCeil4 << 2) { - pe_warn("parsing str defaults, rem: %d bytes", - strSize); - pe_warn("param id: %d len: %d bytes", - paramId, paramLen); - retVal = WNI_CFG_INVALID_LEN; - goto end; - } - for (j = 0; j < paramLenCeil4; j++) { - pStr[4 * j] = (uint8_t) (*pSrc >> 24) & 0xff; - pStr[4 * j + 1] = (uint8_t) (*pSrc >> 16) & 0xff; - pStr[4 * j + 2] = (uint8_t) (*pSrc >> 8) & 0xff; - pStr[4 * j + 3] = (uint8_t) (*pSrc) & 0xff; - - pSrc++; - strSize -= 4; - } - - pe_debug("set str id: %d len: %d", paramId, paramLen); - - if (cfg_set_str(mac, (uint16_t) paramId, pStr, paramLen) != - QDF_STATUS_SUCCESS) { - pe_warn("setting str default param %d len %d", - paramId, paramLen); - retVal = WNI_CFG_INVALID_LEN; - goto end; - } - } - - /* Set status to READY */ - mac->cfg.gCfgStatus = CFG_SUCCESS; - retVal = WNI_CFG_SUCCESS; - pe_debug(" Completed successfully"); - -end: - - if (retVal != WNI_CFG_SUCCESS) - mac->cfg.gCfgStatus = CFG_FAILURE; - - /* Send response message to host */ - mac->cfg.gParamList[WNI_CFG_DNLD_CNF_RES] = retVal; - cfg_send_host_msg(mac, WNI_CFG_DNLD_CNF, WNI_CFG_DNLD_CNF_LEN, - WNI_CFG_DNLD_CNF_NUM, mac->cfg.gParamList, 0, 0); - - /* notify WMA that the config has downloaded */ - mmhMsg.type = SIR_CFG_DOWNLOAD_COMPLETE_IND; - mmhMsg.bodyptr = NULL; - mmhMsg.bodyval = 0; - - MTRACE(mac_trace_msg_tx(mac, NO_SESSION, mmhMsg.type)); - if (wma_post_ctrl_msg(mac, &mmhMsg) != QDF_STATUS_SUCCESS) { - pe_err("WMAPostMsgApi failed!"); - } - -} /*** end procDnldRsp() ***/ - -/**--------------------------------------------------------------------- - * proc_get_req() - * - * FUNCTION: - * This function processes CFG_GET_REQ message from host. - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: - * For every parameter ID specified on the list, CFG will send a separate - * CFG_GET_RSP back to host. - * - * @param length: message length - * @param pParam: parameter list pointer - * - * @return None - * - */ -static void proc_get_req(struct mac_context *mac, uint16_t length, uint32_t *pParam) -{ - uint16_t cfgId, i; - uint32_t value, valueLen, result; - uint32_t *pValue; - - pe_debug("Rcvd cfg get request %d bytes", length); - for (i = 0; i < length / 4; i++) - pe_debug("[%2d] 0x%08x", i, pParam[i]); - - if (!mac->cfg.gCfgStatus) { - cfgId = (uint16_t) sir_read_u32_n((uint8_t *) pParam); - pe_debug("CFG not ready, param %d", cfgId); - mac->cfg.gParamList[WNI_CFG_GET_RSP_RES] = - WNI_CFG_NOT_READY; - mac->cfg.gParamList[WNI_CFG_GET_RSP_PID] = cfgId; - mac->cfg.gParamList[WNI_CFG_GET_RSP_PLEN] = 0; - cfg_send_host_msg(mac, WNI_CFG_GET_RSP, - WNI_CFG_GET_RSP_PARTIAL_LEN, WNI_CFG_GET_RSP_NUM, - mac->cfg.gParamList, 0, 0); - } else { - /* Process all parameter ID's on the list */ - while (length >= sizeof(uint32_t)) { - cfgId = (uint16_t) *pParam++; - pValue = 0; - valueLen = 0; - - pe_debug("Cfg get param %d", cfgId); - /* Check for valid parameter ID, etc... */ - if (check_param - (mac, cfgId, CFG_CTL_RE, WNI_CFG_WO_PARAM, - &result)) { - if ((mac->cfg.gCfgEntry[cfgId]. - control & CFG_CTL_INT) != 0) { - /* Get integer parameter */ - result = - (wlan_cfg_get_int(mac, cfgId, &value) - == - QDF_STATUS_SUCCESS ? WNI_CFG_SUCCESS : - WNI_CFG_OTHER_ERROR); - pValue = &value; - valueLen = sizeof(uint32_t); - } else { - /* Get string parameter */ - valueLen = sizeof(mac->cfg.gSBuffer); - result = - (wlan_cfg_get_str - (mac, cfgId, mac->cfg.gSBuffer, - &valueLen) - == QDF_STATUS_SUCCESS ? WNI_CFG_SUCCESS : - WNI_CFG_OTHER_ERROR); - pValue = - (uint32_t *) mac->cfg.gSBuffer; - } - } else { - pe_warn("Check param failed, param %d", - cfgId); - result = WNI_CFG_INVALID_LEN; - } - - /* Send response message to host */ - mac->cfg.gParamList[WNI_CFG_GET_RSP_RES] = result; - mac->cfg.gParamList[WNI_CFG_GET_RSP_PID] = cfgId; - mac->cfg.gParamList[WNI_CFG_GET_RSP_PLEN] = valueLen; - - /* We need to round up buffer length to word-increment */ - valueLen = (((valueLen + 3) >> 2) << 2); - cfg_send_host_msg(mac, WNI_CFG_GET_RSP, - WNI_CFG_GET_RSP_PARTIAL_LEN + valueLen, - WNI_CFG_GET_RSP_NUM, - mac->cfg.gParamList, valueLen, pValue); - - /* Decrement length */ - length -= sizeof(uint32_t); - } - } - -} /*** end procGetReq() ***/ - -/**--------------------------------------------------------------------- - * check_param() - * - * FUNCTION: - * This function is called to perform various check on a parameter. - * - * LOGIC: - * - If cfgId is out of bound or parameter is not valid, result - * WNI_CFG_INVALID_PID is returned at address specified in pResult. - * - * - If specified 'flag' is not set in the parameter control entry, - * 'failedResult' is returned at address specified in pResult. - * - * ASSUMPTIONS: - * Since this function is used internally, 'pResult' is always valid. - * - * NOTE: - * - * @param None - * - * @return true: Parameter is valid and matches checked condition \n - * @return false: Parameter either is not valid or does not match - * checked condition. - * - */ -static uint8_t -check_param(struct mac_context *mac, uint16_t cfgId, uint32_t flag, - uint32_t failedResult, uint32_t *pResult) -{ - /* Check if parameter ID is out of bound */ - if (cfgId >= CFG_PARAM_MAX_NUM) { - pe_warn("Invalid param id: %d", cfgId); - *pResult = WNI_CFG_INVALID_PID; - } else { - /* Check if parameter is valid */ - if ((mac->cfg.gCfgEntry[cfgId].control & CFG_CTL_VALID) == 0) { - pe_warn("Param id: %d not valid", cfgId); - *pResult = WNI_CFG_INVALID_PID; - } else { - /* Check control field against flag */ - if ((mac->cfg.gCfgEntry[cfgId].control & flag) == 0) { - pe_debug("Param id: %d wrong permissions: %x", - cfgId, - mac->cfg.gCfgEntry[cfgId].control); - *pResult = failedResult; - } else - return true; - } - } - return false; - -} /*** cfgParamCheck() ***/ - -/**--------------------------------------------------------------------- - * process_cfg_download_req() - * - * FUNCTION: This function does the Cfg Download and is invoked - * only in the case of Prima or the Integrated SOC - * solutions. Not applicable to Volans or Libra - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: - * - * @param mac: Pointer to Mac Structure - * - * @return None - * - */ - -void -process_cfg_download_req(struct mac_context *mac) -{ - int32_t i; - uint32_t index; - uint8_t *pDstTest, *pSrcTest; - uint8_t len; - cfgstatic_string * pStrCfg; - uint32_t bufStart, bufEnd; - uint32_t retVal; - uint32_t iCount = 0; - uint32_t sCount = 0; - - for (i = 0; i < CFG_PARAM_MAX_NUM ; i++) { - if ((cfg_static[i].control & CFG_CTL_VALID) != 0) { - if (!(cfg_static[i].control & CFG_CTL_INT)) { - pStrCfg = (cfgstatic_string*)cfg_static[i]. - pStrData; - if (pStrCfg == NULL) { - pe_err("pStrCfg is NULL for CfigID : %d", - i); - continue; - } - index = sCount & CFG_BUF_INDX_MASK; - sCount += pStrCfg->maxLen + 1 + 1; - } else { - index = iCount & CFG_BUF_INDX_MASK; - iCount++; - } - } else { - index = 0; - } - mac->cfg.gCfgEntry[i].control = cfg_static[i].control | index; - } - - /*Fill the SBUF wih maxLength*/ - bufEnd = mac->cfg.gCfgMaxSBufSize; - for (i = CFG_PARAM_MAX_NUM - 1; i >= 0; i--) { - if ((mac->cfg.gCfgEntry[i].control & CFG_CTL_INT) != 0) - continue; - - if ((mac->cfg.gCfgEntry[i].control & CFG_CTL_VALID) == 0) - continue; - - bufStart = mac->cfg.gCfgEntry[i].control & CFG_BUF_INDX_MASK; - mac->cfg.gCfgSBuf[bufStart] = (uint8_t)(bufEnd - bufStart - 2); - - pe_debug("id: %d max: %d bufStart: %d bufEnd: %d", - i, mac->cfg.gCfgSBuf[bufStart], - bufStart, bufEnd); - bufEnd = bufStart; - } - - for (i = 0; i < CFG_PARAM_MAX_NUM ; i++) { - index = mac->cfg.gCfgEntry[i].control & CFG_BUF_INDX_MASK; - - if ((mac->cfg.gCfgEntry[i].control & CFG_CTL_INT) != 0) { - mac->cfg.gCfgIBufMin[index] = cfg_static[i].cfgIMin; - mac->cfg.gCfgIBufMax[index] = cfg_static[i].cfgIMax; - mac->cfg.gCfgIBuf[index] = cfg_static[i].cfgIVal; - } else { - uint8_t maxSavedLen; - - if ((mac->cfg.gCfgEntry[i].control & CFG_CTL_VALID) == 0) - continue; - if (index >= mac->cfg.gCfgMaxSBufSize) { - pe_debug("No space id:%d BufSize:%d index:%d", - i, mac->cfg.gCfgMaxSBufSize, index); - continue; - } - - pDstTest = &mac->cfg.gCfgSBuf[index]; - pStrCfg = (cfgstatic_string*)cfg_static[i].pStrData; - pSrcTest = pStrCfg->data; - if ((pDstTest == NULL) || (pStrCfg == NULL) || - (pSrcTest == NULL)) - continue; - maxSavedLen = *pDstTest; - len = pStrCfg->length; - if (len > maxSavedLen) - continue; - *pDstTest++ = pStrCfg->maxLen; - *pDstTest++ = len; - while (len) { - *pDstTest++ = *pSrcTest++; - len--; - } - } - } - - /* Set status to READY */ - mac->cfg.gCfgStatus = CFG_SUCCESS; - retVal = WNI_CFG_SUCCESS; - pe_debug(" Completed successfully"); - - mac->cfg.gParamList[WNI_CFG_DNLD_CNF_RES] = retVal; - -} /*** end ProcessDownloadReq() ***/ diff --git a/core/mac/src/cfg/cfg_send_msg.c b/core/mac/src/cfg/cfg_send_msg.c deleted file mode 100644 index f0e2f49ade31..000000000000 --- a/core/mac/src/cfg/cfg_send_msg.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2012, 2014-2018 The Linux Foundation. All rights reserved. - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file contains the source code for composing and sending messages - * to host. - * - * Author: Kevin Nguyen - * Date: 04/09/02 - * History:- - * 04/09/02 Created. - * -------------------------------------------------------------------- - */ -#include "cds_api.h" -#include "cfg_priv.h" -#include "lim_trace.h" - -/*--------------------------------------------------------------------*/ -/* ATTENTION: The functions contained in this module are to be used */ -/* by CFG module ONLY. */ -/*--------------------------------------------------------------------*/ - -/**--------------------------------------------------------------------- - * cfg_send_host_msg() - * - * FUNCTION: - * Send CNF/RSP to host. - * - * LOGIC: - * Please see Configuration & Statistic Collection Micro-Architecture - * specification for details. - * - * ASSUMPTIONS: - * - * NOTE: - * - * @param msgType: message type - * @param msgLen: message length - * @param paramNum: number of parameters - * @param pParamList: pointer to parameter list - * @param dataLen: data length - * @param pData: pointer to additional data - * - * @return None. - * - */ -void -cfg_send_host_msg(struct mac_context *mac, uint16_t msgType, uint32_t msgLen, - uint32_t paramNum, uint32_t *pParamList, uint32_t dataLen, - uint32_t *pData) -{ - uint32_t *pMsg, *pEnd; - struct scheduler_msg mmhMsg = {0}; - - if ((paramNum > 0) && (NULL == pParamList)) { - pe_err("pParamList NULL when paramNum greater than 0!"); - return; - } - if ((dataLen > 0) && (NULL == pData)) { - pe_err("pData NULL when dataLen greater than 0!"); - return; - } - pMsg = qdf_mem_malloc(msgLen); - if (!pMsg) - return; - - /* Fill in message details */ - mmhMsg.type = msgType; - mmhMsg.bodyptr = pMsg; - mmhMsg.bodyval = 0; - ((tSirMbMsg *) pMsg)->type = msgType; - ((tSirMbMsg *) pMsg)->msgLen = (uint16_t) msgLen; - - switch (msgType) { - case WNI_CFG_GET_RSP: - case WNI_CFG_PARAM_UPDATE_IND: - case WNI_CFG_DNLD_REQ: - case WNI_CFG_DNLD_CNF: - case WNI_CFG_SET_CNF: - /* Fill in parameters */ - pMsg++; - if (NULL != pParamList) { - pEnd = pMsg + paramNum; - while (pMsg < pEnd) { - *pMsg++ = *pParamList++; - } - } - /* Copy data if there is any */ - if (NULL != pData) { - pEnd = pMsg + (dataLen >> 2); - while (pMsg < pEnd) { - *pMsg++ = *pData++; - } - } - break; - - default: - pe_warn("Unknown msg: %d!", (int)msgType); - qdf_mem_free(pMsg); - return; - } - - /* Ship it */ - MTRACE(mac_trace_msg_tx(mac, NO_SESSION, mmhMsg.type)); - sys_process_mmh_msg(mac, &mmhMsg); - -} /*** end cfg_send_host_msg() ***/ diff --git a/core/mac/src/include/utils_api.h b/core/mac/src/include/utils_api.h index b2ceea99e96d..2b237fad29fd 100644 --- a/core/mac/src/include/utils_api.h +++ b/core/mac/src/include/utils_api.h @@ -25,9 +25,6 @@ #include "sys_wrapper.h" #include "wlan_vdev_mlme_api.h" -QDF_STATUS cfg_init(struct mac_context *); -void cfg_de_init(struct mac_context *); - /** * sir_swap_u16() * diff --git a/core/mac/src/pe/include/sch_api.h b/core/mac/src/pe/include/sch_api.h index e202ef923b98..decd90d9aad1 100644 --- a/core/mac/src/pe/include/sch_api.h +++ b/core/mac/src/pe/include/sch_api.h @@ -52,10 +52,6 @@ void sch_edca_profile_update(struct mac_context *mac, QDF_STATUS sch_set_fixed_beacon_fields(struct mac_context *mac, struct pe_session *pe_session); -/* / Process the scheduler messages */ -void sch_process_message(struct mac_context *mac, - struct scheduler_msg *pSchMsg); - /** * sch_process_pre_beacon_ind() - Process the PreBeacon Indication from the Lim * @mac: pointer to mac structure @@ -68,10 +64,6 @@ QDF_STATUS sch_process_pre_beacon_ind(struct mac_context *mac, struct scheduler_msg *msg, enum sir_bcn_update_reason reason); -/* / Post a message to the scheduler message queue */ -QDF_STATUS sch_post_message(struct mac_context *mac, - struct scheduler_msg *pMsg); - void sch_beacon_process(struct mac_context *mac, uint8_t *pRxPacketInfo, struct pe_session *pe_session); diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index eaf9d8d037a0..c0299478af9f 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -32,7 +32,6 @@ #include "wni_api.h" #include "sir_common.h" #include "sir_debug.h" -#include "cfg_api.h" #include "sch_api.h" #include "utils_api.h" @@ -959,14 +958,7 @@ QDF_STATUS pe_mc_process_handler(struct scheduler_msg *msg) if (ANI_DRIVER_TYPE(mac_ctx) == QDF_DRIVER_TYPE_MFG) return QDF_STATUS_SUCCESS; - /* - * If the Message to be handled is for CFG Module call the CFG Msg - * Handler and for all the other cases post it to LIM - */ - if (SIR_CFG_PARAM_UPDATE_IND != msg->type && IS_CFG_MSG(msg->type)) - cfg_process_mb_msg(mac_ctx, msg->bodyptr); - else - lim_message_processor(mac_ctx, msg); + lim_message_processor(mac_ctx, msg); return QDF_STATUS_SUCCESS; } diff --git a/core/mac/src/pe/sch/sch_api.c b/core/mac/src/pe/sch/sch_api.c index 5c1cbc19134d..3fc6cddce450 100644 --- a/core/mac/src/pe/sch/sch_api.c +++ b/core/mac/src/pe/sch/sch_api.c @@ -36,8 +36,6 @@ #include "sir_mac_prop_exts.h" #include "sir_common.h" -#include "cfg_api.h" - #include "lim_api.h" #include "sch_api.h" @@ -48,34 +46,6 @@ #include "wma_types.h" -/* -------------------------------------------------------------------- */ -/* */ -/* Static Variables */ -/* */ -/* -------------------------------------------------------------------- */ -/** - * sch_post_message - * - * FUNCTION: - * Post the beacon message to the scheduler message queue - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: - * - * @param pMsg pointer to message - * @return None - */ - -QDF_STATUS sch_post_message(struct mac_context *mac, struct scheduler_msg *pMsg) -{ - sch_process_message(mac, pMsg); - - return QDF_STATUS_SUCCESS; -} - QDF_STATUS sch_send_beacon_req(struct mac_context *mac, uint8_t *beaconPayload, uint16_t size, struct pe_session *pe_session, enum sir_bcn_update_reason reason) diff --git a/core/mac/src/pe/sch/sch_message.c b/core/mac/src/pe/sch/sch_message.c index 7fe199f57cfb..ee36cf67cd89 100644 --- a/core/mac/src/pe/sch/sch_message.c +++ b/core/mac/src/pe/sch/sch_message.c @@ -21,7 +21,6 @@ #include "wni_cfg.h" #include "ani_global.h" -#include "cfg_api.h" #include "lim_api.h" #include "lim_send_messages.h" @@ -90,39 +89,6 @@ void sch_edca_profile_update_all(struct mac_context *pmac) } } -/* -------------------------------------------------------------------- */ -/** - * sch_process_message - * - * FUNCTION: - * - * LOGIC: - * - * ASSUMPTIONS: - * - * NOTE: - * - * @param None - * @return None - */ - -void sch_process_message(struct mac_context *mac, struct scheduler_msg *pSchMsg) -{ - switch (pSchMsg->type) { - case SIR_CFG_PARAM_UPDATE_IND: - switch (pSchMsg->bodyval) { - default: - pe_err("Cfg param %d indication not handled", - pSchMsg->bodyval); - } - break; - - default: - pe_err("Unknown message in schMsgQ type %d", pSchMsg->type); - } - -} - /** * sch_get_params() - get the local or broadcast parameters based on the profile * sepcified in the config params are delivered in this order: BE, BK, VI, VO diff --git a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c index 5600564146c0..a55201dbbc50 100644 --- a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c +++ b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -29,7 +29,6 @@ * */ /* Standard include files */ -#include "cfg_api.h" /* cfg_cleanup */ #include "lim_api.h" /* lim_cleanup */ #include "sir_types.h" #include "sys_entry_func.h" @@ -93,7 +92,6 @@ QDF_STATUS mac_stop(mac_handle_t mac_handle) struct mac_context *mac = MAC_CONTEXT(mac_handle); pe_stop(mac); - cfg_cleanup(mac); return QDF_STATUS_SUCCESS; } @@ -141,12 +139,6 @@ QDF_STATUS mac_open(struct wlan_objmgr_psoc *psoc, mac_handle_t *mac_handle, if (cds_cfg->driver_type) mac->gDriverType = QDF_DRIVER_TYPE_MFG; - status = cfg_init(mac); - if (QDF_IS_STATUS_ERROR(status)) { - pe_err("failed to init legacy CFG; status:%u", status); - goto release_psoc_ref; - } - sys_init_globals(mac); /* FW: 0 to 2047 and Host: 2048 to 4095 */ @@ -157,14 +149,11 @@ QDF_STATUS mac_open(struct wlan_objmgr_psoc *psoc, mac_handle_t *mac_handle, status = pe_open(mac, cds_cfg); if (QDF_IS_STATUS_ERROR(status)) { pe_err("failed to open PE; status:%u", status); - goto deinit_cfg; + goto release_psoc_ref; } return QDF_STATUS_SUCCESS; -deinit_cfg: - cfg_de_init(mac); - release_psoc_ref: wlan_objmgr_psoc_release_ref(psoc, WLAN_LEGACY_MAC_ID); @@ -184,9 +173,6 @@ QDF_STATUS mac_close(mac_handle_t mac_handle) pe_close(mac); - /* Call routine to free-up all CFG data structures */ - cfg_de_init(mac); - if (mac->pdev) { wlan_objmgr_pdev_release_ref(mac->pdev, WLAN_LEGACY_MAC_ID); mac->pdev = NULL; diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index a20c1c067149..e78977e07a09 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -595,12 +595,6 @@ QDF_STATUS sme_set_ese_beacon_request(mac_handle_t mac_handle, const tCsrEseBeaconReq *pEseBcnReq); QDF_STATUS sme_set_plm_request(mac_handle_t mac_handle, tpSirPlmReq pPlm); #endif /*FEATURE_WLAN_ESE */ -QDF_STATUS sme_cfg_set_int(mac_handle_t mac_handle, uint16_t cfg_id, - uint32_t value); -QDF_STATUS sme_cfg_get_int(mac_handle_t mac_handle, uint16_t cfg_id, - uint32_t *cfg_value); -QDF_STATUS sme_cfg_get_str(mac_handle_t mac_handle, uint16_t cfg_id, - uint8_t *str, uint32_t *length); QDF_STATUS sme_get_modify_profile_fields(mac_handle_t mac_handle, uint8_t sessionId, tCsrRoamModifyProfileFields * diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 93128827023c..092db00219f3 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -42,7 +42,6 @@ #include "sap_api.h" #include "mac_trace.h" #include "cds_regdomain.h" -#include "cfg_api.h" #include "sme_power_save_api.h" #include "wma.h" #include "sch_api.h" @@ -3240,74 +3239,6 @@ QDF_STATUS sme_get_config_param(mac_handle_t mac_handle, return status; } -/** - * sme_cfg_set_int() - Sets the cfg parameter value. - * @mac_handle: Opaque handle to the global MAC context. - * @cfg_id: Configuration parameter ID. - * @value: value to be saved in the cfg parameter. - * - * This function sets the string value in cfg parameter. - * - * Return: QDF_STATUS - */ -QDF_STATUS sme_cfg_set_int(mac_handle_t mac_handle, uint16_t cfg_id, - uint32_t value) -{ - struct mac_context *pmac = MAC_CONTEXT(mac_handle); - QDF_STATUS status = QDF_STATUS_SUCCESS; - - if (QDF_STATUS_SUCCESS != cfg_set_int(pmac, cfg_id, value)) - status = QDF_STATUS_E_FAILURE; - - return status; -} - -/** - * sme_cfg_get_int() - Gets the cfg parameter value. - * @mac_handle: Opaque handle to the global MAC context. - * @cfg_id: Configuration parameter ID. - * @cfg_value: Pointer to variable in which cfg value - * will be saved. - * - * This function gets the value of the cfg parameter. - * - * Return: QDF_STATUS - */ -QDF_STATUS sme_cfg_get_int(mac_handle_t mac_handle, uint16_t cfg_id, - uint32_t *cfg_value) -{ - struct mac_context *pmac = MAC_CONTEXT(mac_handle); - QDF_STATUS status = QDF_STATUS_SUCCESS; - - if (QDF_STATUS_SUCCESS != wlan_cfg_get_int(pmac, cfg_id, cfg_value)) - status = QDF_STATUS_E_FAILURE; - - return status; -} - -/** - * sme_cfg_get_str() - Gets the cfg parameter string. - * @mac_handle: Opaque handle to the global MAC context. - * @cfg_id: Configuration parameter ID. - * @str: Pointer to the string buffer. - * @length: Pointer to length of the string. - * - * This function gets the string value of the cfg parameter. - * - * Return: QDF_STATUS - */ -QDF_STATUS sme_cfg_get_str(mac_handle_t mac_handle, uint16_t cfg_id, - uint8_t *str, uint32_t *length) -{ - struct mac_context *pmac = MAC_CONTEXT(mac_handle); - QDF_STATUS status = QDF_STATUS_SUCCESS; - - if (QDF_STATUS_SUCCESS != wlan_cfg_get_str(pmac, cfg_id, str, length)) - status = QDF_STATUS_E_INVAL; - - return status; -} - /* * sme_get_modify_profile_fields() - * HDD or SME - QOS calls this function to get the current values of diff --git a/core/sme/src/rrm/sme_rrm.c b/core/sme/src/rrm/sme_rrm.c index ecd953361984..4c5ba70b87e8 100644 --- a/core/sme/src/rrm/sme_rrm.c +++ b/core/sme/src/rrm/sme_rrm.c @@ -25,7 +25,6 @@ #include "ani_global.h" #include "sme_inside.h" #include "sme_api.h" -#include "cfg_api.h" #ifdef FEATURE_WLAN_DIAG_SUPPORT #include "host_diag_core_event.h" diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 7db2d1b8755f..9fc1809290a2 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -28,7 +28,6 @@ #include "wmi_unified.h" #include "wmi_version.h" #include "qdf_types.h" -#include "cfg_api.h" #include "qdf_status.h" #include "cds_sched.h" #include "cds_config.h" @@ -2191,28 +2190,6 @@ static inline bool wma_vdev_is_device_in_low_pwr_mode(uint8_t vdev_id) return iface->in_bmps || wma->in_imps; } -/** - * wma_vdev_get_cfg_int - Get cfg integer value - * @cfg_id: cfg item number - * @value: fill the out value - * - * Note caller must verify return status before using value - * - * Return: QDF_STATUS_SUCCESS when got item from cfg else QDF_STATUS_E_FAILURE - */ -static inline -QDF_STATUS wma_vdev_get_cfg_int(int cfg_id, int *value) -{ - struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE); - - *value = 0; - - if (!mac) - return QDF_STATUS_E_FAILURE; - - return wlan_cfg_get_int(mac, cfg_id, value); -} - /** * wma_vdev_get_dtim_period - Get dtim period value from mlme * @vdev_id: vdev index number diff --git a/core/wma/src/wlan_qct_wma_legacy.c b/core/wma/src/wlan_qct_wma_legacy.c index 10212d77e3c4..9e01fbaad8c1 100644 --- a/core/wma/src/wlan_qct_wma_legacy.c +++ b/core/wma/src/wlan_qct_wma_legacy.c @@ -30,7 +30,6 @@ /* Standard include files */ /* Application Specific include files */ #include "lim_api.h" -#include "cfg_api.h" #include "wma.h" #include "sme_power_save_api.h" /* Locally used Defines */ @@ -56,32 +55,6 @@ QDF_STATUS wma_post_ctrl_msg(struct mac_context *mac, struct scheduler_msg *pMsg return QDF_STATUS_SUCCESS; } -/** - * wma_post_cfg_msg() - Posts MNT messages to gSirMntMsgQ - * @mac: MAC parameters structure - * @pMsg: A pointer to the msg - * - * Return: Success or Failure - */ - -static QDF_STATUS wma_post_cfg_msg(struct mac_context *mac, - struct scheduler_msg *pMsg) -{ - QDF_STATUS rc = QDF_STATUS_SUCCESS; - - do { - /* - *For Windows based MAC, instead of posting message to different - * queues we will call the handler routines directly - */ - - cfg_process_mb_msg(mac, (tSirMbMsg *) pMsg->bodyptr); - rc = QDF_STATUS_SUCCESS; - } while (0); - - return rc; -} - /** * u_mac_post_ctrl_msg() - post ctrl msg * @pMb: A pointer to the maibox message @@ -118,10 +91,6 @@ QDF_STATUS u_mac_post_ctrl_msg(void *pSirGlobal, tSirMbMsg *pMb) status = lim_post_msg_api(mac, &msg); break; - case SIR_CFG_MSG_TYPES_BEGIN: /* Posts a message to the CFG MsgQ */ - status = wma_post_cfg_msg(mac, &msg); - break; - case SIR_SME_MSG_TYPES_BEGIN: /* Posts a message to the LIM MsgQ */ status = sme_post_pe_message(mac, &msg); break; diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 56ff7020a883..d6dc86a214d7 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -34,7 +34,6 @@ #include "ani_global.h" #include "wmi_unified.h" #include "wni_cfg.h" -#include "cfg_api.h" #if defined(CONFIG_HL_SUPPORT) #include "wlan_tgt_def_config_hl.h" #else @@ -3649,8 +3648,6 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, wma_vdev_get_vdev_dp_handle); pmo_register_is_device_in_low_pwr_mode(wma_handle->psoc, wma_vdev_is_device_in_low_pwr_mode); - pmo_register_get_cfg_int_callback(wma_handle->psoc, - wma_vdev_get_cfg_int); pmo_register_get_dtim_period_callback(wma_handle->psoc, wma_vdev_get_dtim_period); pmo_register_get_beacon_interval_callback(wma_handle->psoc, @@ -4798,7 +4795,6 @@ QDF_STATUS wma_close(void) pmo_unregister_get_beacon_interval_callback(wma_handle->psoc); pmo_unregister_get_dtim_period_callback(wma_handle->psoc); - pmo_unregister_get_cfg_int_callback(wma_handle->psoc); pmo_unregister_is_device_in_low_pwr_mode(wma_handle->psoc); pmo_unregister_get_pause_bitmap(wma_handle->psoc); pmo_unregister_pause_bitmap_notifier(wma_handle->psoc); @@ -8312,11 +8308,7 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg) #endif /* FEATURE_WLAN_ESE */ case WNI_CFG_DNLD_REQ: WMA_LOGD("McThread: WNI_CFG_DNLD_REQ"); - qdf_status = wma_wni_cfg_dnld(wma_handle); - if (QDF_IS_STATUS_SUCCESS(qdf_status)) - cds_wma_complete_cback(); - else - WMA_LOGD("config download failure"); + cds_wma_complete_cback(); break; case WMA_ADD_STA_SELF_REQ: txrx_vdev_handle = diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 3a8d6088370b..bd92b62c0f0c 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -32,7 +32,6 @@ #include "ani_global.h" #include "wmi_unified.h" #include "wni_cfg.h" -#include "cfg_api.h" #include "qdf_nbuf.h" #include "qdf_types.h" @@ -3478,31 +3477,6 @@ int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info, return 0; } -/** - * wma_wni_cfg_dnld() - cfg download request - * @handle: wma handle - * - * Return: QDF_STATUS_SUCCESS for success or error code - */ -QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle) -{ - QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; - void *mac = cds_get_context(QDF_MODULE_ID_PE); - - WMA_LOGD("%s: Enter", __func__); - - if (NULL == mac) { - WMA_LOGE("%s: Invalid context", __func__); - QDF_ASSERT(0); - return QDF_STATUS_E_FAILURE; - } - - process_cfg_download_req(mac); - - WMA_LOGD("%s: Exit", __func__); - return qdf_status; -} - #define BIG_ENDIAN_MAX_DEBUG_BUF 500 /** * wma_unified_debug_print_event_handler() - debug print event handler