diff options
| author | Arun Khandavalli <akhandav@codeaurora.org> | 2016-06-26 07:37:21 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-07-28 15:33:17 +0530 |
| commit | c811dccdac733343804ae0a38f8d3905e16bebbd (patch) | |
| tree | 2d419187e3c21acd2902f1ac21ed345f42a38f64 | |
| parent | 2c27249b3cf3837c1c010e9b4f92043cba69011c (diff) | |
qcacld-3.0: Create ini config structures for cds
Update ini configuration parameters for cds modules in the driver,
this helps in avoiding layer violation of using the hdd context in
cds modules.
Change-Id: Iff149cc51ea5eacae4f84d83c51d0ed63834ba50
CRs-Fixed: 1026817
| -rw-r--r-- | core/cds/inc/cds_api.h | 4 | ||||
| -rw-r--r-- | core/cds/inc/cds_config.h | 135 | ||||
| -rw-r--r-- | core/cds/inc/cds_sched.h | 2 | ||||
| -rw-r--r-- | core/cds/src/cds_api.c | 187 | ||||
| -rw-r--r-- | core/hdd/inc/wlan_hdd_ftm.h | 1 | ||||
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 2 | ||||
| -rw-r--r-- | core/hdd/inc/wlan_hdd_nan.h | 19 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_ftm.c | 67 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 158 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_power.c | 6 | ||||
| -rw-r--r-- | core/mac/inc/ani_global.h | 90 | ||||
| -rw-r--r-- | core/mac/inc/mac_init_api.h | 4 | ||||
| -rw-r--r-- | core/mac/src/pe/include/lim_api.h | 2 | ||||
| -rw-r--r-- | core/mac/src/pe/lim/lim_api.c | 8 | ||||
| -rw-r--r-- | core/mac/src/sys/legacy/src/system/src/mac_init_api.c | 4 | ||||
| -rw-r--r-- | core/wma/inc/wma_types.h | 2 | ||||
| -rw-r--r-- | core/wma/src/wma_main.c | 110 |
17 files changed, 504 insertions, 297 deletions
diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 9e9774fe99a1..bb8cf4a58032 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -279,4 +279,8 @@ void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx, int cds_get_radio_index(void); QDF_STATUS cds_set_radio_index(int radio_index); +void cds_init_ini_config(struct cds_config_info *cds_cfg); +void cds_deinit_ini_config(void); +struct cds_config_info *cds_get_ini_config(void); + #endif /* if !defined __CDS_API_H */ diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h new file mode 100644 index 000000000000..5d2eafb9eb9f --- /dev/null +++ b/core/cds/inc/cds_config.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2016 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. + */ + +/** + * DOC: cds_config.h + * + * Defines the configuration Information for various modules. Default values + * are read from the INI file and saved into cds_config_info which are passed + * to various modules for the initialization. + */ + +#if !defined(__CDS_CONFIG_H) +#define __CDS_CONFIG_H + +/** + * enum driver_type - Indicate the driver type to the cds, and based on this + * do appropriate initialization. + * + * @DRIVER_TYPE_PRODUCTION: Driver used in the production + * @DRIVER_TYPE_MFG: Driver used in the Factory + * + */ +enum driver_type { + DRIVER_TYPE_PRODUCTION = 0, + DRIVER_TYPE_MFG = 1, +}; + +/** + * struct cds_config_info - Place Holder for cds configuration + * @max_station: Max station supported + * @max_bssid: Max Bssid Supported + * @frame_xln_reqd: frame transmission required + * @powersave_offload_enabled: Indicate if powersave offload is enabled + * @sta_maxlimod_dtim: station max listen interval + * @sta_mod_dtim: station mode DTIM + * @sta_dynamic_dtim: station dynamic DTIM + * @driver_type: Enumeration of Driver Type whether FTM or Mission mode + * @max_wow_filters: Max wow filters to be configured to fw + * @wow_enable: Indicate whether wow is enabled or not + * @ol_ini_info: Status of offload enabled from ini 1st bit for arm,2nd for NS + * currently rest of bits are not used + * @ssdp: Indicate ssdp is enabled or not + * @enable_mc_list : To Check if Multicast list filtering is enabled in FW + * @dfs_phyerr_filter_offload: DFS Phyerror Filtering offload status from ini + * Indicates whether support is enabled or not + * @ap_disable_intrabss_fwd: pass intra-bss-fwd info to txrx module + * @ap_maxoffload_peers: max offload peer + * @ap_maxoffload_reorderbuffs: max offload reorder buffs + * @ra_ratelimit_interval: RA rate limit value + * @is_ra_ratelimit_enabled: Indicate RA rate limit enabled or not + * @reorder_offload: is RX re-ordering offloaded to the fw + * @dfs_pri_multiplier: dfs radar pri multiplier + * @uc_offload_enabled: IPA Micro controller data path offload enable flag + * @uc_txbuf_count: IPA Micro controller data path offload TX buffer count + * @uc_txbuf_size: IPA Micro controller data path offload TX buffer size + * @uc_rxind_ringcount: IPA Micro controller data path offload RX indication + * ring count + * @uc_tx_partition_base: IPA Micro controller datapath offload TX partition + * base + * @enable_rxthread: Rx processing in thread from TXRX + * @ip_tcp_udp_checksum_offload: checksum offload enabled or not + * @ce_classify_enabled: CE based classification enabled + * @max_scan: Maximum number of parallel scans + * @tx_flow_stop_queue_th: Threshold to stop queue in percentage + * @tx_flow_start_queue_offset: Start queue offset in percentage + * @is_lpass_enabled: Indicate whether LPASS is enabled or not + * @is_nan_enabled: Indicate whether NAN is enabled or not + * @tx_chain_mask_cck: Tx chain mask enabled or not + * @self_gen_frm_pwr: Self gen from power + * + * Structure for holding cds ini parameters. + */ + +struct cds_config_info { + uint16_t max_station; + uint16_t max_bssid; + uint32_t frame_xln_reqd; + uint8_t powersave_offload_enabled; + uint8_t sta_maxlimod_dtim; + uint8_t sta_mod_dtim; + uint8_t sta_dynamic_dtim; + enum driver_type driver_type; + uint8_t max_wow_filters; + uint8_t wow_enable; + uint8_t ol_ini_info; + bool ssdp; + bool enable_mc_list; + uint8_t dfs_phyerr_filter_offload; + uint8_t ap_disable_intrabss_fwd; + uint8_t ap_maxoffload_peers; + uint8_t ap_maxoffload_reorderbuffs; +#ifdef FEATURE_WLAN_RA_FILTERING + uint16_t ra_ratelimit_interval; + bool is_ra_ratelimit_enabled; +#endif + uint8_t reorder_offload; + int32_t dfs_pri_multiplier; + uint8_t uc_offload_enabled; + uint32_t uc_txbuf_count; + uint32_t uc_txbuf_size; + uint32_t uc_rxind_ringcount; + uint32_t uc_tx_partition_base; + bool enable_rxthread; + bool ip_tcp_udp_checksum_offload; + bool ce_classify_enabled; + uint8_t max_scan; +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 + uint32_t tx_flow_stop_queue_th; + uint32_t tx_flow_start_queue_offset; +#endif +#ifdef WLAN_FEATURE_LPSS + bool is_lpass_enabled; +#endif +#ifdef WLAN_FEATURE_NAN + bool is_nan_enabled; +#endif + bool tx_chain_mask_cck; + uint16_t self_gen_frm_pwr; +}; +#endif /* !defined( __CDS_CONFIG_H ) */ diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h index 6dfc00ded6af..2b33ebb515ab 100644 --- a/core/cds/inc/cds_sched.h +++ b/core/cds/inc/cds_sched.h @@ -49,6 +49,7 @@ #include <qdf_types.h> #include "qdf_lock.h" #include "qdf_mc_timer.h" +#include "cds_config.h" #define TX_POST_EVENT_MASK 0x001 #define TX_SUSPEND_EVENT_MASK 0x002 @@ -317,6 +318,7 @@ typedef struct _cds_context_type { uint32_t sap_mandatory_channels_len; bool do_hw_mode_change; bool enable_fatal_event; + struct cds_config_info *cds_cfg; } cds_context_type, *p_cds_contextType; /*--------------------------------------------------------------------------- diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index d50f781aa8a3..4fd6f9a07e20 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -158,25 +158,6 @@ void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx, } #endif -#ifdef WLAN_FEATURE_NAN -/** - * cds_set_nan_enable() - set nan enable flag in mac open param - * @wma_handle: Pointer to mac open param - * @hdd_ctx: Pointer to hdd context - * - * Return: none - */ -static void cds_set_nan_enable(tMacOpenParameters *param, - hdd_context_t *hdd_ctx) -{ - param->is_nan_enabled = hdd_ctx->config->enable_nan_support; -} -#else -static void cds_set_nan_enable(tMacOpenParameters *param, - hdd_context_t *pHddCtx) -{ -} -#endif /** * cds_open() - open the CDS Module @@ -197,24 +178,33 @@ QDF_STATUS cds_open(void) QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; int iter = 0; tSirRetStatus sirStatus = eSIR_SUCCESS; - tMacOpenParameters mac_openParms; + struct cds_config_info *cds_cfg; qdf_device_t qdf_ctx; HTC_INIT_INFO htcInfo; struct ol_context *ol_ctx; struct hif_opaque_softc *scn; void *HTCHandle; hdd_context_t *pHddCtx; + cds_context_type *cds_ctx; QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH, "%s: Opening CDS", __func__); - if (NULL == gp_cds_context) { + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Trying to open CDS without a PreOpen", __func__); QDF_ASSERT(0); return QDF_STATUS_E_FAILURE; } + cds_cfg = cds_get_ini_config(); + if (!cds_cfg) { + cds_err("Cds config is NULL"); + QDF_ASSERT(0); + return QDF_STATUS_E_FAILURE; + } + /* Initialize the timer module */ qdf_timer_module_init(); @@ -282,9 +272,6 @@ QDF_STATUS cds_open(void) "%s: scn is null!", __func__); goto err_sched_close; } - - hdd_update_config(pHddCtx); - ol_ctx = cds_get_context(QDF_MODULE_ID_BMI); /* Initialize BMI and Download firmware */ qdf_status = bmi_download_firmware(ol_ctx); @@ -314,91 +301,11 @@ QDF_STATUS cds_open(void) goto err_htc_close; } - /* - ** Need to open WMA first because it calls WDI_Init, which calls wpalOpen - ** The reason that is needed becasue cds_packet_open need to use PAL APIs - */ - /*Open the WMA module */ - qdf_mem_set(&mac_openParms, sizeof(mac_openParms), 0); - /* UMA is supported in hardware for performing the - ** frame translation 802.11 <-> 802.3 - */ - mac_openParms.frameTransRequired = 1; - mac_openParms.driverType = eDRIVER_TYPE_PRODUCTION; - mac_openParms.powersaveOffloadEnabled = - pHddCtx->config->enablePowersaveOffload; - mac_openParms.staDynamicDtim = pHddCtx->config->enableDynamicDTIM; - mac_openParms.staModDtim = pHddCtx->config->enableModulatedDTIM; - mac_openParms.staMaxLIModDtim = pHddCtx->config->fMaxLIModulatedDTIM; - mac_openParms.wowEnable = pHddCtx->config->wowEnable; - mac_openParms.maxWoWFilters = pHddCtx->config->maxWoWFilters; - /* Here olIniInfo is used to store ini status of arp offload - * ns offload and others. Currently 1st bit is used for arp - * off load and 2nd bit for ns offload currently, rest bits are unused - */ - if (pHddCtx->config->fhostArpOffload) - mac_openParms.olIniInfo = mac_openParms.olIniInfo | 0x1; - if (pHddCtx->config->fhostNSOffload) - mac_openParms.olIniInfo = mac_openParms.olIniInfo | 0x2; - /* - * Copy the DFS Phyerr Filtering Offload status. - * This parameter reflects the value of the - * dfsPhyerrFilterOffload flag as set in the ini. - */ - mac_openParms.dfsPhyerrFilterOffload = - pHddCtx->config->fDfsPhyerrFilterOffload; - if (pHddCtx->config->ssdp) - mac_openParms.ssdp = pHddCtx->config->ssdp; - mac_openParms.enable_mc_list = pHddCtx->config->fEnableMCAddrList; -#ifdef FEATURE_WLAN_RA_FILTERING - mac_openParms.RArateLimitInterval = - pHddCtx->config->RArateLimitInterval; - mac_openParms.IsRArateLimitEnabled = - pHddCtx->config->IsRArateLimitEnabled; -#endif - - mac_openParms.apMaxOffloadPeers = pHddCtx->config->apMaxOffloadPeers; - - mac_openParms.apMaxOffloadReorderBuffs = - pHddCtx->config->apMaxOffloadReorderBuffs; - - mac_openParms.apDisableIntraBssFwd = - pHddCtx->config->apDisableIntraBssFwd; - - mac_openParms.dfsRadarPriMultiplier = - pHddCtx->config->dfsRadarPriMultiplier; - mac_openParms.reorderOffload = pHddCtx->config->reorderOffloadSupport; - - /* IPA micro controller data path offload resource config item */ - mac_openParms.ucOffloadEnabled = hdd_ipa_uc_is_enabled(pHddCtx); - mac_openParms.ucTxBufCount = pHddCtx->config->IpaUcTxBufCount; - mac_openParms.ucTxBufSize = pHddCtx->config->IpaUcTxBufSize; - mac_openParms.ucRxIndRingCount = pHddCtx->config->IpaUcRxIndRingCount; - mac_openParms.ucTxPartitionBase = pHddCtx->config->IpaUcTxPartitionBase; - mac_openParms.max_scan = pHddCtx->config->max_scan_count; - - mac_openParms.ip_tcp_udp_checksum_offload = - pHddCtx->config->enable_ip_tcp_udp_checksum_offload; - mac_openParms.enable_rxthread = pHddCtx->config->enableRxThread; - mac_openParms.ce_classify_enabled = - pHddCtx->config->ce_classify_enabled; - -#ifdef QCA_LL_TX_FLOW_CONTROL_V2 - mac_openParms.tx_flow_stop_queue_th = - pHddCtx->config->TxFlowStopQueueThreshold; - mac_openParms.tx_flow_start_queue_offset = - pHddCtx->config->TxFlowStartQueueOffset; -#endif - cds_set_nan_enable(&mac_openParms, pHddCtx); - - mac_openParms.tx_chain_mask_cck = pHddCtx->config->tx_chain_mask_cck; - mac_openParms.self_gen_frm_pwr = pHddCtx->config->self_gen_frm_pwr; - mac_openParms.maxStation = pHddCtx->config->maxNumberOfPeers; qdf_status = wma_open(gp_cds_context, hdd_update_tgt_cfg, - hdd_dfs_indicate_radar, &mac_openParms); + hdd_dfs_indicate_radar, cds_cfg); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { /* Critical Error ... Cannot proceed further */ @@ -410,10 +317,10 @@ QDF_STATUS cds_open(void) /* Number of peers limit differs in each chip version. If peer max * limit configured in ini exceeds more than supported, WMA adjusts - * and keeps correct limit in mac_openParms.maxStation. So, make sure + * and keeps correct limit in cds_cfg.max_station. So, make sure * config entry pHddCtx->config->maxNumberOfPeers has adjusted value */ - pHddCtx->config->maxNumberOfPeers = mac_openParms.maxStation; + pHddCtx->config->maxNumberOfPeers = cds_cfg->max_station; HTCHandle = cds_get_context(QDF_MODULE_ID_HTC); if (!HTCHandle) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, @@ -431,11 +338,9 @@ QDF_STATUS cds_open(void) /* UMA is supported in hardware for performing the * frame translation 802.11 <-> 802.3 */ - mac_openParms.frameTransRequired = 1; - sirStatus = - mac_open(&(gp_cds_context->pMACContext), gp_cds_context->pHDDContext, - &mac_openParms); + mac_open(&(gp_cds_context->pMACContext), + gp_cds_context->pHDDContext, cds_cfg); if (eSIR_SUCCESS != sirStatus) { /* Critical Error ... Cannot proceed further */ @@ -860,6 +765,7 @@ QDF_STATUS cds_close(v_CONTEXT_t cds_context) gp_cds_context->pHDDContext = NULL; + cds_deinit_ini_config(); return QDF_STATUS_SUCCESS; } @@ -2237,3 +2143,62 @@ QDF_STATUS cds_set_radio_index(int radio_index) return QDF_STATUS_SUCCESS; } + +/** + * cds_init_ini_config() - API to initialize CDS configuration parameters + * @cfg: CDS Configuration + * + * Return: void + */ + +void cds_init_ini_config(struct cds_config_info *cfg) +{ + cds_context_type *cds_ctx; + + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { + cds_err("Invalid CDS Context"); + return; + } + + cds_ctx->cds_cfg = cfg; +} + +/** + * cds_deinit_ini_config() - API to free CDS configuration parameters + * + * Return: void + */ +void cds_deinit_ini_config(void) +{ + cds_context_type *cds_ctx; + + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { + cds_err("Invalid CDS Context"); + return; + } + + if (!cds_ctx->cds_cfg) + qdf_mem_free(cds_ctx->cds_cfg); + + cds_ctx->cds_cfg = NULL; +} + +/** + * cds_get_ini_config() - API to get CDS configuration parameters + * + * Return: cds config structure + */ +struct cds_config_info *cds_get_ini_config(void) +{ + cds_context_type *cds_ctx; + + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { + cds_err("Invalid CDS Context"); + return NULL; + } + + return cds_ctx->cds_cfg; +} diff --git a/core/hdd/inc/wlan_hdd_ftm.h b/core/hdd/inc/wlan_hdd_ftm.h index 9ecccfe2683c..eddce28f6131 100644 --- a/core/hdd/inc/wlan_hdd_ftm.h +++ b/core/hdd/inc/wlan_hdd_ftm.h @@ -57,6 +57,7 @@ struct wlan_hdd_ftm_status { int wlan_hdd_ftm_open(hdd_context_t *hdd_ctx); int wlan_hdd_ftm_close(hdd_context_t *hdd_ctx); +int hdd_update_cds_config_ftm(hdd_context_t *hdd_ctx); #if defined(QCA_WIFI_FTM) QDF_STATUS wlan_hdd_ftm_testmode_cmd(void *data, int len); diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 10318736dca5..a4671978ce80 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1631,7 +1631,7 @@ hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx, enum phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width); uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel, uint8_t bw_offset); -void hdd_update_config(hdd_context_t *hdd_ctx); +int hdd_update_config(hdd_context_t *hdd_ctx); QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *adapter, struct net_device *dev, diff --git a/core/hdd/inc/wlan_hdd_nan.h b/core/hdd/inc/wlan_hdd_nan.h index ac2f62f38be9..87b1de590b21 100644 --- a/core/hdd/inc/wlan_hdd_nan.h +++ b/core/hdd/inc/wlan_hdd_nan.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -47,6 +47,19 @@ int wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy, bool wlan_hdd_nan_is_supported(void); void wlan_hdd_nan_init(struct hdd_context_s *hdd_ctx); +/** + * hdd_nan_populate_cds_config() - Populate NAN cds configuration + * @cds_cfg: CDS Configuration + * @hdd_ctx: Pointer to hdd context + * + * Return: none + */ +static inline void hdd_nan_populate_cds_config(struct cds_config_info *cds_cfg, + hdd_context_t *hdd_ctx) +{ + cds_cfg->is_nan_enabled = hdd_ctx->config->enable_nan_support; +} + #else static inline bool wlan_hdd_nan_is_supported(void) { @@ -55,5 +68,9 @@ static inline bool wlan_hdd_nan_is_supported(void) static inline void wlan_hdd_nan_init(struct hdd_context_s *hdd_ctx) { } +static inline void hdd_nan_populate_cds_config(struct cds_config_info *cds_cfg, + hdd_context_t *hdd_ctx) +{ +} #endif /* WLAN_FEATURE_NAN */ #endif /* __WLAN_HDD_NAN_H */ diff --git a/core/hdd/src/wlan_hdd_ftm.c b/core/hdd/src/wlan_hdd_ftm.c index 94cd241c2bef..97a0cd2754d6 100644 --- a/core/hdd/src/wlan_hdd_ftm.c +++ b/core/hdd/src/wlan_hdd_ftm.c @@ -138,18 +138,49 @@ static void wlan_hdd_ftm_update_tgt_cfg(void *context, void *param) } #ifdef WLAN_FEATURE_LPSS -static inline void hdd_is_lpass_supported(tMacOpenParameters *mac_openParms, +static inline void hdd_is_lpass_supported(struct cds_config_info *cds_cfg, hdd_context_t *hdd_ctx) { - mac_openParms->is_lpass_enabled = hdd_ctx->config->enable_lpass_support; + cds_cfg->is_lpass_enabled = hdd_ctx->config->enable_lpass_support; } #else -static inline void hdd_is_lpass_supported(tMacOpenParameters *mac_openParms, +static inline void hdd_is_lpass_supported(struct cds_config_info *cds_cfg, hdd_context_t *hdd_ctx) { } #endif /** + * hdd_update_cds_config_ftm() - API to update cds configuration parameters + * for FTM mode. + * @hdd_ctx: HDD Context + * + * Return: 0 on success; errno on failure + */ + +int hdd_update_cds_config_ftm(hdd_context_t *hdd_ctx) +{ + struct cds_config_info *cds_cfg; + + cds_cfg = qdf_mem_malloc(sizeof(struct cds_config_info)); + if (!cds_cfg) { + hdd_err("failed to allocate cds config"); + return -ENOMEM; + } + qdf_mem_zero(cds_cfg, sizeof(struct cds_config_info)); + + cds_cfg->driver_type = eDRIVER_TYPE_MFG; + cds_cfg->powersave_offload_enabled = + hdd_ctx->config->enablePowersaveOffload; + hdd_is_lpass_supported(cds_cfg, hdd_ctx); + /* UMA is supported in hardware for performing the + * frame translation 802.11 <-> 802.3 + */ + cds_cfg->frame_xln_reqd = 1; + cds_init_ini_config(cds_cfg); + + return 0; +} +/** * wlan_ftm_cds_open() - Open the CDS Module in FTM mode * @p_cds_context: pointer to the global CDS context * @hddContextSize: Size of the HDD context to allocate. @@ -173,8 +204,8 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, QDF_STATUS vStatus = QDF_STATUS_SUCCESS; int iter = 0; tSirRetStatus sirStatus = eSIR_SUCCESS; - tMacOpenParameters mac_openParms; p_cds_contextType gp_cds_context = (p_cds_contextType) p_cds_context; + struct cds_config_info *cds_cfg; #if defined(QCA_WIFI_FTM) qdf_device_t qdf_ctx; HTC_INIT_INFO htcInfo; @@ -182,18 +213,22 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, void *pHtcContext = NULL; struct ol_context *ol_ctx; #endif + cds_context_type *cds_ctx; hdd_context_t *hdd_ctx; QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH, "%s: Opening CDS", __func__); - if (NULL == gp_cds_context) { + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, "%s: Trying to open CDS without a PreOpen", __func__); QDF_ASSERT(0); return QDF_STATUS_E_FAILURE; } + cds_cfg = cds_ctx->cds_cfg; + /* Initialize the probe event */ if (qdf_event_create(&gp_cds_context->ProbeEvent) != QDF_STATUS_SUCCESS) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, @@ -280,10 +315,6 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, } #endif /* QCA_WIFI_FTM */ - /*Open the WMA module */ - qdf_mem_set(&mac_openParms, sizeof(mac_openParms), 0); - mac_openParms.driverType = eDRIVER_TYPE_MFG; - hdd_ctx = (hdd_context_t *) (gp_cds_context->pHDDContext); if ((NULL == hdd_ctx) || (NULL == hdd_ctx->config)) { /* Critical Error ... Cannot proceed further */ @@ -292,14 +323,8 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, QDF_ASSERT(0); goto err_htc_close; } - - mac_openParms.powersaveOffloadEnabled = - hdd_ctx->config->enablePowersaveOffload; - - hdd_is_lpass_supported(&mac_openParms, hdd_ctx); - vStatus = wma_open(gp_cds_context, - wlan_hdd_ftm_update_tgt_cfg, NULL, &mac_openParms); + wlan_hdd_ftm_update_tgt_cfg, NULL, cds_cfg); if (!QDF_IS_STATUS_SUCCESS(vStatus)) { /* Critical Error ... Cannot proceed further */ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, @@ -310,7 +335,6 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, } #if defined(QCA_WIFI_FTM) hdd_update_config(hdd_ctx); - pHtcContext = cds_get_context(QDF_MODULE_ID_HTC); if (!pHtcContext) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, @@ -325,16 +349,9 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, #endif /* Now proceed to open the MAC */ - - /* UMA is supported in hardware for performing the - * frame translation 802.11 <-> 802.3 - */ - mac_openParms.frameTransRequired = 1; - sirStatus = mac_open(&(gp_cds_context->pMACContext), - gp_cds_context->pHDDContext, - &mac_openParms); + gp_cds_context->pHDDContext, cds_cfg); if (eSIR_SUCCESS != sirStatus) { /* Critical Error ... Cannot proceed further */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 50a49085632f..c2f45c42be92 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6115,6 +6115,145 @@ static int hdd_update_country_code(hdd_context_t *hdd_ctx, return ret; } +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 +/** + * hdd_txrx_populate_cds_config() - Populate txrx cds configuration + * @cds_cfg: CDS Configuration + * @hdd_ctx: Pointer to hdd context + * + * Return: none + */ +static inline void hdd_txrx_populate_cds_config(struct cds_config_info + *cds_cfg, + hdd_context_t *hdd_ctx) +{ + cds_cfg->tx_flow_stop_queue_th = + hdd_ctx->config->TxFlowStopQueueThreshold; + cds_cfg->tx_flow_start_queue_offset = + hdd_ctx->config->TxFlowStartQueueOffset; +} +#else +static inline void hdd_txrx_populate_cds_config(struct cds_config_info + *cds_cfg, + hdd_context_t *hdd_ctx) +{ +} +#endif + +#ifdef FEATURE_WLAN_RA_FILTERING +/** + * hdd_ra_populate_cds_config() - Populate RA filtering cds configuration + * @cds_cfg: CDS Configuration + * @hdd_ctx: Pointer to hdd context + * + * Return: none + */ +inline void hdd_ra_populate_cds_config(struct cds_config_info *cds_cfg, + hdd_context_t *hdd_ctx) +{ + cds_cfg->ra_ratelimit_interval = + hdd_ctx->config->RArateLimitInterval; + cds_cfg->is_ra_ratelimit_enabled = + hdd_ctx->config->IsRArateLimitEnabled; +} +#else +inline void hdd_ra_populate_cds_config(struct cds_config_info *cds_cfg, + hdd_context_t *hdd_ctx) +{ +} +#endif + +/** + * hdd_update_cds_config() - API to update cds configuration parameters + * @hdd_ctx: HDD Context + * + * Return: 0 for Success, errno on failure + */ +int hdd_update_cds_config(hdd_context_t *hdd_ctx) +{ + struct cds_config_info *cds_cfg; + + cds_cfg = (struct cds_config_info *)qdf_mem_malloc(sizeof(*cds_cfg)); + if (!cds_cfg) { + hdd_err("failed to allocate cds config"); + return -ENOMEM; + } + + qdf_mem_zero(cds_cfg, sizeof(*cds_cfg)); + + /* UMA is supported in hardware for performing the + * frame translation 802.11 <-> 802.3 + */ + cds_cfg->frame_xln_reqd = 1; + cds_cfg->driver_type = DRIVER_TYPE_PRODUCTION; + cds_cfg->powersave_offload_enabled = + hdd_ctx->config->enablePowersaveOffload; + cds_cfg->sta_dynamic_dtim = hdd_ctx->config->enableDynamicDTIM; + cds_cfg->sta_mod_dtim = hdd_ctx->config->enableModulatedDTIM; + cds_cfg->sta_maxlimod_dtim = hdd_ctx->config->fMaxLIModulatedDTIM; + cds_cfg->wow_enable = hdd_ctx->config->wowEnable; + cds_cfg->max_wow_filters = hdd_ctx->config->maxWoWFilters; + + /* Here ol_ini_info is used to store ini status of arp offload + * ns offload and others. Currently 1st bit is used for arp + * off load and 2nd bit for ns offload currently, rest bits are unused + */ + if (hdd_ctx->config->fhostArpOffload) + cds_cfg->ol_ini_info = cds_cfg->ol_ini_info | 0x1; + if (hdd_ctx->config->fhostNSOffload) + cds_cfg->ol_ini_info = cds_cfg->ol_ini_info | 0x2; + + /* + * Copy the DFS Phyerr Filtering Offload status. + * This parameter reflects the value of the + * dfs_phyerr_filter_offload flag as set in the ini. + */ + cds_cfg->dfs_phyerr_filter_offload = + hdd_ctx->config->fDfsPhyerrFilterOffload; + if (hdd_ctx->config->ssdp) + cds_cfg->ssdp = hdd_ctx->config->ssdp; + + cds_cfg->enable_mc_list = hdd_ctx->config->fEnableMCAddrList; + cds_cfg->ap_maxoffload_peers = hdd_ctx->config->apMaxOffloadPeers; + + cds_cfg->ap_maxoffload_reorderbuffs = + hdd_ctx->config->apMaxOffloadReorderBuffs; + + cds_cfg->ap_disable_intrabss_fwd = + hdd_ctx->config->apDisableIntraBssFwd; + + cds_cfg->dfs_pri_multiplier = + hdd_ctx->config->dfsRadarPriMultiplier; + cds_cfg->reorder_offload = + hdd_ctx->config->reorderOffloadSupport; + + /* IPA micro controller data path offload resource config item */ + cds_cfg->uc_offload_enabled = hdd_ipa_uc_is_enabled(hdd_ctx); + cds_cfg->uc_txbuf_count = hdd_ctx->config->IpaUcTxBufCount; + cds_cfg->uc_txbuf_size = hdd_ctx->config->IpaUcTxBufSize; + cds_cfg->uc_rxind_ringcount = + hdd_ctx->config->IpaUcRxIndRingCount; + cds_cfg->uc_tx_partition_base = + hdd_ctx->config->IpaUcTxPartitionBase; + cds_cfg->max_scan = hdd_ctx->config->max_scan_count; + + cds_cfg->ip_tcp_udp_checksum_offload = + hdd_ctx->config->enable_ip_tcp_udp_checksum_offload; + cds_cfg->enable_rxthread = hdd_ctx->config->enableRxThread; + cds_cfg->ce_classify_enabled = + hdd_ctx->config->ce_classify_enabled; + cds_cfg->tx_chain_mask_cck = hdd_ctx->config->tx_chain_mask_cck; + cds_cfg->self_gen_frm_pwr = hdd_ctx->config->self_gen_frm_pwr; + cds_cfg->max_station = hdd_ctx->config->maxNumberOfPeers; + + hdd_ra_populate_cds_config(cds_cfg, hdd_ctx); + hdd_txrx_populate_cds_config(cds_cfg, hdd_ctx); + hdd_nan_populate_cds_config(cds_cfg, hdd_ctx); + + cds_init_ini_config(cds_cfg); + return 0; +} + /** * hdd_init_thermal_info - Initialize thermal level * @hdd_ctx: HDD context @@ -6582,6 +6721,10 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc) if (ret) goto err_hdd_free_context; + ret = hdd_update_config(hdd_ctx); + if (ret) + goto err_hdd_free_context; + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { ret = hdd_enable_ftm(hdd_ctx); if (ret) @@ -6591,7 +6734,6 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc) } hdd_wlan_green_ap_init(hdd_ctx); - status = cds_open(); if (!QDF_IS_STATUS_SUCCESS(status)) { hddLog(QDF_TRACE_LEVEL_FATAL, FL("cds_open failed")); @@ -6838,7 +6980,7 @@ err_exit_nl_srv: hdd_err("Failed to deinit policy manager"); /* Proceed and complete the clean up */ } - + cds_deinit_ini_config(); err_hdd_free_context: hdd_context_destroy(hdd_ctx); QDF_BUG(1); @@ -7887,12 +8029,20 @@ static void hdd_update_hif_config(hdd_context_t *hdd_ctx) * @hdd_ctx: HDD Context * * API is used to initialize all driver per module configuration parameters - * Return: void + * Return: 0 for success, errno for failure */ -void hdd_update_config(hdd_context_t *hdd_ctx) +int hdd_update_config(hdd_context_t *hdd_ctx) { + int ret; + hdd_update_ol_config(hdd_ctx); hdd_update_hif_config(hdd_ctx); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) + ret = hdd_update_cds_config_ftm(hdd_ctx); + else + ret = hdd_update_cds_config(hdd_ctx); + + return ret; } /* Register the module init/exit functions */ diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 8eb578c50773..c4321ebecdcc 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1432,7 +1432,7 @@ QDF_STATUS hdd_wlan_re_init(void *hif_sc) hdd_context_t *pHddCtx = NULL; QDF_STATUS qdf_ret_status; hdd_adapter_t *pAdapter; - int i; + int i, ret; hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); @@ -1460,6 +1460,10 @@ QDF_STATUS hdd_wlan_re_init(void *hif_sc) /* The driver should always be initialized in STA mode after SSR */ hdd_set_conparam(0); + ret = hdd_update_config(pHddCtx); + if (ret) + goto err_re_init; + /* Re-open CDS, it is a re-open b'se control transport was never closed. */ qdf_status = cds_open(); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index cd786eac3f21..c51afa2d247e 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -871,96 +871,6 @@ typedef enum { eDRIVER_TYPE_MFG = 1, } tDriverType; -/** ------------------------------------------------------------------------- * - - \typedef tMacOpenParameters - - \brief Parameters needed for Enumeration of all status codes returned by the higher level - interface functions. - - -------------------------------------------------------------------------- */ - -typedef struct sMacOpenParameters { - uint16_t maxStation; - uint16_t maxBssId; - uint32_t frameTransRequired; - uint8_t powersaveOffloadEnabled; - /* Powersave Parameters */ - uint8_t staMaxLIModDtim; - uint8_t staModDtim; - uint8_t staDynamicDtim; - tDriverType driverType; - uint8_t maxWoWFilters; - uint8_t wowEnable; -/* Here olIniInfo is used to store ini - * status of arp offload, ns offload - * and others. Currently 1st bit is used - * for arp off load and 2nd bit for ns - * offload currently, rest bits are unused - */ - uint8_t olIniInfo; - bool ssdp; - bool enable_mc_list; - /* - * DFS Phyerror Filtering offload status from ini - * 0 indicates offload disabled - * 1 indicates offload enabled - */ - uint8_t dfsPhyerrFilterOffload; -/* pass intra-bss-fwd info to txrx module */ - uint8_t apDisableIntraBssFwd; - - /* max offload peer */ - uint8_t apMaxOffloadPeers; - - /* max offload reorder buffs */ - uint8_t apMaxOffloadReorderBuffs; - -#ifdef FEATURE_WLAN_RA_FILTERING - uint16_t RArateLimitInterval; - bool IsRArateLimitEnabled; -#endif - /* is RX re-ordering offloaded to the fw */ - uint8_t reorderOffload; - - /* dfs radar pri multiplier */ - int32_t dfsRadarPriMultiplier; - - /* IPA Micro controller data path offload enable flag */ - uint8_t ucOffloadEnabled; - /* IPA Micro controller data path offload TX buffer count */ - uint32_t ucTxBufCount; - /* IPA Micro controller data path offload TX buffer size */ - uint32_t ucTxBufSize; - /* IPA Micro controller data path offload RX indication ring count */ - uint32_t ucRxIndRingCount; - /* IPA Micro controller data path offload TX partition base */ - uint32_t ucTxPartitionBase; - bool enable_rxthread; - bool ip_tcp_udp_checksum_offload; - - /* CE based classification enabled */ - bool ce_classify_enabled; - - /* Maximum number of parallel scans */ - uint8_t max_scan; - -#ifdef QCA_LL_TX_FLOW_CONTROL_V2 - /* Threshold to stop queue in percentage */ - uint32_t tx_flow_stop_queue_th; - /* Start queue offset in percentage */ - uint32_t tx_flow_start_queue_offset; -#endif -#ifdef WLAN_FEATURE_LPSS - bool is_lpass_enabled; -#endif -#ifdef WLAN_FEATURE_NAN - bool is_nan_enabled; -#endif - bool tx_chain_mask_cck; - uint16_t self_gen_frm_pwr; -} tMacOpenParameters; - typedef struct sHalMacStartParameters { /* parametes for the Firmware */ tDriverType driverType; diff --git a/core/mac/inc/mac_init_api.h b/core/mac/inc/mac_init_api.h index 195f9e83db86..1a231d43f4e9 100644 --- a/core/mac/inc/mac_init_api.h +++ b/core/mac/inc/mac_init_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -44,7 +44,7 @@ tSirRetStatus mac_start(tHalHandle hHal, void *pHalMacStartParams); tSirRetStatus mac_stop(tHalHandle hHal, tHalStopType stopType); tSirRetStatus mac_open(tHalHandle *pHalHandle, tHddHandle hHdd, - tMacOpenParameters *pMacOpenParms); + struct cds_config_info *cds_cfg); tSirRetStatus mac_close(tHalHandle hHal); #endif /* __MAC_INIT_API_H */ diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index 82f9a2cff61a..550babf49c04 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -98,7 +98,7 @@ typedef enum eMgmtFrmDropReason { * This called upon LIM thread creation. */ extern tSirRetStatus lim_initialize(tpAniSirGlobal); -tSirRetStatus pe_open(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam); +tSirRetStatus pe_open(tpAniSirGlobal pMac, struct cds_config_info *cds_cfg); tSirRetStatus pe_close(tpAniSirGlobal pMac); void pe_register_tl_handle(tpAniSirGlobal pMac); tSirRetStatus lim_start(tpAniSirGlobal pMac); diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 941a893bf000..f450afb4d8d6 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -691,15 +691,15 @@ void lim_cleanup(tpAniSirGlobal pMac) \return tSirRetStatus -------------------------------------------------------------*/ -tSirRetStatus pe_open(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam) +tSirRetStatus pe_open(tpAniSirGlobal pMac, struct cds_config_info *cds_cfg) { tSirRetStatus status = eSIR_SUCCESS; - if (eDRIVER_TYPE_MFG == pMacOpenParam->driverType) + if (DRIVER_TYPE_MFG == cds_cfg->driver_type) return eSIR_SUCCESS; - pMac->lim.maxBssId = pMacOpenParam->maxBssId; - pMac->lim.maxStation = pMacOpenParam->maxStation; + pMac->lim.maxBssId = cds_cfg->max_bssid; + pMac->lim.maxStation = cds_cfg->max_station; if ((pMac->lim.maxBssId == 0) || (pMac->lim.maxStation == 0)) { PELOGE(lim_log(pMac, LOGE, 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 387685742f88..5e86c7e1f02e 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 @@ -104,7 +104,7 @@ tSirRetStatus mac_stop(tHalHandle hHal, tHalStopType stopType) -------------------------------------------------------------*/ tSirRetStatus mac_open(tHalHandle *pHalHandle, tHddHandle hHdd, - tMacOpenParameters *pMacOpenParms) + struct cds_config_info *cds_cfg) { tpAniSirGlobal p_mac = NULL; tSirRetStatus status = eSIR_SUCCESS; @@ -155,7 +155,7 @@ tSirRetStatus mac_open(tHalHandle *pHalHandle, tHddHandle hHdd, p_mac->mgmtSeqNum = WLAN_HOST_SEQ_NUM_MIN - 1; p_mac->first_scan_done = false; - status = pe_open(p_mac, pMacOpenParms); + status = pe_open(p_mac, cds_cfg); if (eSIR_SUCCESS != status) { sys_log(p_mac, LOGE, FL("mac_open failure\n")); qdf_mem_free(p_mac); diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index d5ababa095fd..5c2c0c63df65 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -701,7 +701,7 @@ QDF_STATUS wma_tx_packet(void *pWMA, QDF_STATUS wma_open(void *p_cds_context, wma_tgt_cfg_cb pTgtUpdCB, wma_dfs_radar_indication_cb radar_ind_cb, - tMacOpenParameters *pMacParams); + struct cds_config_info *cds_cfg); typedef QDF_STATUS (*wma_mgmt_frame_rx_callback)(void *p_cds_gctx, void *cds_buff); diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index b3f5e28c4e18..191c760afc24 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1575,23 +1575,23 @@ int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx) /** * ol_cfg_set_flow_control_parameters() - set flow control parameters * @olCfg: cfg parameters - * @mac_params: mac parameters + * @cds_cfg: CDS Configuration * * Return: none */ static void ol_cfg_set_flow_control_parameters(struct txrx_pdev_cfg_param_t *olCfg, - tMacOpenParameters *mac_params) + struct cds_config_info *cds_cfg) { olCfg->tx_flow_start_queue_offset = - mac_params->tx_flow_start_queue_offset; + cds_cfg->tx_flow_start_queue_offset; olCfg->tx_flow_stop_queue_th = - mac_params->tx_flow_stop_queue_th; + cds_cfg->tx_flow_stop_queue_th; } #else static void ol_cfg_set_flow_control_parameters(struct txrx_pdev_cfg_param_t *olCfg, - tMacOpenParameters *mac_params) + struct cds_config_info *cds_cfg) { return; } @@ -1601,18 +1601,18 @@ void ol_cfg_set_flow_control_parameters(struct txrx_pdev_cfg_param_t *olCfg, /** * wma_set_nan_enable() - set nan enable flag in WMA handle * @wma_handle: Pointer to wma handle - * @mac_param: Pointer to mac_param + * @cds_cfg: Pointer to CDS Configuration * * Return: none */ static void wma_set_nan_enable(tp_wma_handle wma_handle, - tMacOpenParameters *mac_param) + struct cds_config_info *cds_cfg) { - wma_handle->is_nan_enabled = mac_param->is_nan_enabled; + wma_handle->is_nan_enabled = cds_cfg->is_nan_enabled; } #else static void wma_set_nan_enable(tp_wma_handle wma_handle, - tMacOpenParameters *mac_param) + struct cds_config_info *cds_cfg) { } #endif @@ -1642,14 +1642,14 @@ static void wma_init_max_no_of_peers(tp_wma_handle wma_handle, * @cds_context: cds context * @wma_tgt_cfg_cb: tgt config callback fun * @radar_ind_cb: dfs radar indication callback - * @mac_params: mac parameters + * @cds_cfg: mac parameters * * Return: 0 on success, errno on failure */ QDF_STATUS wma_open(void *cds_context, wma_tgt_cfg_cb tgt_cfg_cb, wma_dfs_radar_indication_cb radar_ind_cb, - tMacOpenParameters *mac_params) + struct cds_config_info *cds_cfg) { tp_wma_handle wma_handle; HTC_HANDLE htc_handle; @@ -1724,30 +1724,30 @@ QDF_STATUS wma_open(void *cds_context, wma_handle->htc_handle = htc_handle; wma_handle->cds_context = cds_context; wma_handle->qdf_dev = qdf_dev; - wma_handle->max_scan = mac_params->max_scan; + wma_handle->max_scan = cds_cfg->max_scan; wma_handle->wma_runtime_resume_lock = qdf_runtime_lock_init("wma_runtime_resume"); /* Initialize max_no_of_peers for wma_get_number_of_peers_supported() */ - wma_init_max_no_of_peers(wma_handle, mac_params->maxStation); + wma_init_max_no_of_peers(wma_handle, cds_cfg->max_station); /* Cap maxStation based on the target version */ - mac_params->maxStation = wma_get_number_of_peers_supported(wma_handle); + cds_cfg->max_station = wma_get_number_of_peers_supported(wma_handle); /* Reinitialize max_no_of_peers based on the capped maxStation value */ - wma_init_max_no_of_peers(wma_handle, mac_params->maxStation); + wma_init_max_no_of_peers(wma_handle, cds_cfg->max_station); /* initialize default target config */ wma_set_default_tgt_config(wma_handle); - olCfg.is_uc_offload_enabled = mac_params->ucOffloadEnabled; - olCfg.uc_tx_buffer_count = mac_params->ucTxBufCount; - olCfg.uc_tx_buffer_size = mac_params->ucTxBufSize; - olCfg.uc_rx_indication_ring_count = mac_params->ucRxIndRingCount; - olCfg.uc_tx_partition_base = mac_params->ucTxPartitionBase; + olCfg.is_uc_offload_enabled = cds_cfg->uc_offload_enabled; + olCfg.uc_tx_buffer_count = cds_cfg->uc_txbuf_count; + olCfg.uc_tx_buffer_size = cds_cfg->uc_txbuf_size; + olCfg.uc_rx_indication_ring_count = cds_cfg->uc_rxind_ringcount; + olCfg.uc_tx_partition_base = cds_cfg->uc_tx_partition_base; - wma_handle->tx_chain_mask_cck = mac_params->tx_chain_mask_cck; - wma_handle->self_gen_frm_pwr = mac_params->self_gen_frm_pwr; + wma_handle->tx_chain_mask_cck = cds_cfg->tx_chain_mask_cck; + wma_handle->self_gen_frm_pwr = cds_cfg->self_gen_frm_pwr; /* Allocate cfg handle */ @@ -1756,16 +1756,16 @@ QDF_STATUS wma_open(void *cds_context, * HL also sdould be enabled, schedule TBD */ #ifdef WLAN_FEATURE_RX_FULL_REORDER_OL - olCfg.is_full_reorder_offload = mac_params->reorderOffload; + olCfg.is_full_reorder_offload = cds_cfg->reorder_offload; #else olCfg.is_full_reorder_offload = 0; #endif /* WLAN_FEATURE_RX_FULL_REORDER_OL */ - olCfg.enable_rxthread = mac_params->enable_rxthread; + olCfg.enable_rxthread = cds_cfg->enable_rxthread; olCfg.ip_tcp_udp_checksum_offload = - mac_params->ip_tcp_udp_checksum_offload; - olCfg.ce_classify_enabled = mac_params->ce_classify_enabled; + cds_cfg->ip_tcp_udp_checksum_offload; + olCfg.ce_classify_enabled = cds_cfg->ce_classify_enabled; - ol_cfg_set_flow_control_parameters(&olCfg, mac_params); + ol_cfg_set_flow_control_parameters(&olCfg, cds_cfg); ((p_cds_contextType) cds_context)->cfg_ctx = ol_pdev_cfg_attach(((p_cds_contextType) cds_context)->qdf_ctx, @@ -1779,7 +1779,7 @@ QDF_STATUS wma_open(void *cds_context, /* adjust the cfg_ctx default value based on setting */ ol_set_cfg_rx_fwd_disabled((ol_pdev_handle) ((p_cds_contextType) cds_context)->cfg_ctx, - (uint8_t) mac_params->apDisableIntraBssFwd); + (uint8_t) cds_cfg->ap_disable_intrabss_fwd); /* adjust the packet log enable default value based on CFG INI setting */ ol_set_cfg_packet_log_enabled((ol_pdev_handle) @@ -1797,12 +1797,14 @@ QDF_STATUS wma_open(void *cds_context, if (cds_get_conparam() == QDF_GLOBAL_FTM_MODE) wma_utf_attach(wma_handle); #endif /* QCA_WIFI_FTM */ + wma_init_max_no_of_peers(wma_handle, cds_cfg->max_station); + cds_cfg->max_station = wma_get_number_of_peers_supported(wma_handle); - mac_params->maxBssId = WMA_MAX_SUPPORTED_BSS; - mac_params->frameTransRequired = 0; + cds_cfg->max_bssid = WMA_MAX_SUPPORTED_BSS; + cds_cfg->frame_xln_reqd = 0; wma_handle->wlan_resource_config.num_wow_filters = - mac_params->maxWoWFilters; + cds_cfg->max_wow_filters; wma_handle->wlan_resource_config.num_keep_alive_pattern = WMA_MAXNUM_PERIODIC_TX_PTRNS; @@ -1810,33 +1812,33 @@ QDF_STATUS wma_open(void *cds_context, * offload peers should be (number of vdevs + 1). */ wma_handle->wlan_resource_config.num_offload_peers = - mac_params->apMaxOffloadPeers + 1; + cds_cfg->ap_maxoffload_peers + 1; wma_handle->wlan_resource_config.num_offload_reorder_buffs = - mac_params->apMaxOffloadReorderBuffs + 1; - - wma_handle->ol_ini_info = mac_params->olIniInfo; - wma_handle->max_station = mac_params->maxStation; - wma_handle->max_bssid = mac_params->maxBssId; - wma_handle->frame_xln_reqd = mac_params->frameTransRequired; - wma_handle->driver_type = mac_params->driverType; - wma_handle->ssdp = mac_params->ssdp; - wma_handle->enable_mc_list = mac_params->enable_mc_list; + cds_cfg->ap_maxoffload_reorderbuffs + 1; + + wma_handle->ol_ini_info = cds_cfg->ol_ini_info; + wma_handle->max_station = cds_cfg->max_station; + wma_handle->max_bssid = cds_cfg->max_bssid; + wma_handle->frame_xln_reqd = cds_cfg->frame_xln_reqd; + wma_handle->driver_type = cds_cfg->driver_type; + wma_handle->ssdp = cds_cfg->ssdp; + wma_handle->enable_mc_list = cds_cfg->enable_mc_list; #ifdef FEATURE_WLAN_RA_FILTERING - wma_handle->IsRArateLimitEnabled = mac_params->IsRArateLimitEnabled; - wma_handle->RArateLimitInterval = mac_params->RArateLimitInterval; + wma_handle->IsRArateLimitEnabled = cds_cfg->is_ra_ratelimit_enabled; + wma_handle->RArateLimitInterval = cds_cfg->ra_ratelimit_interval; #endif /* FEATURE_WLAN_RA_FILTERING */ #ifdef WLAN_FEATURE_LPSS - wma_handle->is_lpass_enabled = mac_params->is_lpass_enabled; + wma_handle->is_lpass_enabled = cds_cfg->is_lpass_enabled; #endif - wma_set_nan_enable(wma_handle, mac_params); + wma_set_nan_enable(wma_handle, cds_cfg); /* * Indicates if DFS Phyerr filtering offload * is Enabled/Disabed from ini */ wma_handle->dfs_phyerr_filter_offload = - mac_params->dfsPhyerrFilterOffload; - wma_handle->dfs_pri_multiplier = mac_params->dfsRadarPriMultiplier; + cds_cfg->dfs_phyerr_filter_offload; + wma_handle->dfs_pri_multiplier = cds_cfg->dfs_pri_multiplier; wma_handle->interfaces = qdf_mem_malloc(sizeof(struct wma_txrx_node) * wma_handle->max_bssid); if (!wma_handle->interfaces) { @@ -2035,13 +2037,13 @@ QDF_STATUS wma_open(void *cds_context, * 3 - Legacy Powersave + Deepsleep Enabled * 4 - QPower + Deepsleep Enabled */ - wma_handle->powersave_mode = mac_params->powersaveOffloadEnabled; - wma_handle->staMaxLIModDtim = mac_params->staMaxLIModDtim; - wma_handle->staModDtim = mac_params->staModDtim; - wma_handle->staDynamicDtim = mac_params->staDynamicDtim; + wma_handle->powersave_mode = cds_cfg->powersave_offload_enabled; + wma_handle->staMaxLIModDtim = cds_cfg->sta_maxlimod_dtim; + wma_handle->staModDtim = cds_cfg->sta_mod_dtim; + wma_handle->staDynamicDtim = cds_cfg->sta_dynamic_dtim; /* - * Value of mac_params->wowEnable can be, + * Value of cds_cfg->wow_enable can be, * 0 - Disable both magic pattern match and pattern byte match. * 1 - Enable magic pattern match on all interfaces. * 2 - Enable pattern byte match on all interfaces. @@ -2049,9 +2051,9 @@ QDF_STATUS wma_open(void *cds_context, * all interfaces. */ wma_handle->wow.magic_ptrn_enable = - (mac_params->wowEnable & 0x01) ? true : false; + (cds_cfg->wow_enable & 0x01) ? true : false; wma_handle->ptrn_match_enable_all_vdev = - (mac_params->wowEnable & 0x02) ? true : false; + (cds_cfg->wow_enable & 0x02) ? true : false; #ifdef FEATURE_WLAN_TDLS wmi_unified_register_event_handler(wma_handle->wmi_handle, |
