From 4aaae0f586a8f12c6f459e3ce43c21fbc5f13a4d Mon Sep 17 00:00:00 2001 From: Venkata Sharath Chandra Manchala Date: Mon, 10 Jul 2017 11:59:19 -0700 Subject: [PATCH] qcacld-3.0: Propagate config parameters to datapath Provide an interface to propagate the feature specific config parameters to Lithium datapath. Change-Id: Iec6f2205a87a02806933abf7538a95bddd82d5a0 CRs-Fixed: 2097229 --- core/cds/inc/cds_api.h | 22 ++++++++++ core/cds/src/cds_api.c | 79 +++++++++++++++++++++++------------- core/hdd/src/wlan_hdd_cfg.c | 2 + core/hdd/src/wlan_hdd_main.c | 67 ++++++++++++++++++++++++++++-- 4 files changed, 137 insertions(+), 33 deletions(-) diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 4a35fef9136e..2c9add63a1ae 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -323,6 +323,17 @@ QDF_STATUS cds_pre_enable(void); QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc); +/** + * cds_dp_open() - Open datapath module + * @psoc - object manager soc handle + * + * API to map the datapath rings to interrupts + * and also open the datapath pdev module. + * + * Return: QDF status + */ +QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc); + QDF_STATUS cds_enable(struct wlan_objmgr_psoc *psoc); QDF_STATUS cds_disable(struct wlan_objmgr_psoc *psoc); @@ -331,6 +342,17 @@ QDF_STATUS cds_post_disable(void); QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc); +/** + * cds_dp_close() - Close datapath module + * @psoc: Object manager soc handle + * + * API used to detach interrupts assigned to service + * datapath rings and close pdev module + * + * Return: Status + */ +QDF_STATUS cds_dp_close(struct wlan_objmgr_psoc *psoc); + void *cds_get_context(QDF_MODULE_ID moduleId); uint8_t cds_get_datapath_handles(void **soc, struct cdp_pdev **pdev, diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index cd444962c24f..791d71b85651 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -587,9 +587,6 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) if (!gp_cds_context->dp_soc) goto err_wma_close; - if (cdp_txrx_intr_attach(gp_cds_context->dp_soc) != QDF_STATUS_SUCCESS) - goto err_wma_close; - pmo_ucfg_psoc_update_dp_handle(psoc, gp_cds_context->dp_soc); if (gp_cds_context->dp_soc == NULL) @@ -621,29 +618,11 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) QDF_ASSERT(0); goto err_mac_close; } - cds_set_context(QDF_MODULE_ID_TXRX, - cdp_pdev_attach(cds_get_context(QDF_MODULE_ID_SOC), - gp_cds_context->cfg_ctx, - gp_cds_context->htc_ctx, - gp_cds_context->qdf_ctx, 0)); - if (!gp_cds_context->pdev_txrx_ctx) { - /* Critical Error ... Cannot proceed further */ - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, - "%s: Failed to open TXRX", __func__); - QDF_ASSERT(0); - goto err_sme_close; - } - pmo_ucfg_psoc_set_txrx_handle(psoc, gp_cds_context->pdev_txrx_ctx); - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH, - "%s: CDS successfully Opened", __func__); cds_register_all_modules(); return dispatcher_psoc_open(psoc); -err_sme_close: - sme_close(gp_cds_context->pMACContext); - err_mac_close: mac_close(gp_cds_context->pMACContext); @@ -685,6 +664,41 @@ err_probe_event: return qdf_status; } /* cds_open() */ +QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc) +{ + if (cdp_txrx_intr_attach(gp_cds_context->dp_soc) + != QDF_STATUS_SUCCESS) { + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, + "%s: Failed to attach interrupts", __func__); + goto close; + } + + cds_set_context(QDF_MODULE_ID_TXRX, + cdp_pdev_attach(cds_get_context(QDF_MODULE_ID_SOC), + gp_cds_context->cfg_ctx, + gp_cds_context->htc_ctx, + gp_cds_context->qdf_ctx, 0)); + if (!gp_cds_context->pdev_txrx_ctx) { + /* Critical Error ... Cannot proceed further */ + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, + "%s: Failed to open TXRX", __func__); + QDF_ASSERT(0); + goto intr_close; + } + + pmo_ucfg_psoc_set_txrx_handle(psoc, gp_cds_context->pdev_txrx_ctx); + + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH, + "%s: CDS successfully Opened", __func__); + + return 0; + +intr_close: + cdp_txrx_intr_detach(gp_cds_context->dp_soc); +close: + return QDF_STATUS_E_FAILURE; +} + /** * cds_pre_enable() - pre enable cds * @@ -1074,7 +1088,6 @@ QDF_STATUS cds_post_disable(void) QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc) { QDF_STATUS qdf_status; - void *ctx; dispatcher_psoc_close(psoc); @@ -1085,19 +1098,12 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc) QDF_ASSERT(0); } - cdp_txrx_intr_detach(gp_cds_context->dp_soc); if (gp_cds_context->htc_ctx) { htc_destroy(gp_cds_context->htc_ctx); pmo_ucfg_psoc_update_htc_handle(psoc, NULL); gp_cds_context->htc_ctx = NULL; } - ctx = cds_get_context(QDF_MODULE_ID_TXRX); - cds_set_context(QDF_MODULE_ID_TXRX, NULL); - pmo_ucfg_psoc_set_txrx_handle(psoc, NULL); - cdp_pdev_detach(cds_get_context(QDF_MODULE_ID_SOC), - (struct cdp_pdev *)ctx, 1); - qdf_status = sme_close(gp_cds_context->pMACContext); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, @@ -1160,6 +1166,21 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } +QDF_STATUS cds_dp_close(struct wlan_objmgr_psoc *psoc) +{ + void *ctx; + + cdp_txrx_intr_detach(gp_cds_context->dp_soc); + + ctx = cds_get_context(QDF_MODULE_ID_TXRX); + cds_set_context(QDF_MODULE_ID_TXRX, NULL); + pmo_ucfg_psoc_set_txrx_handle(psoc, NULL); + cdp_pdev_detach(cds_get_context(QDF_MODULE_ID_SOC), + (struct cdp_pdev *)ctx, 1); + + return QDF_STATUS_SUCCESS; +} + /** * cds_get_context() - get context data area * diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 979094d90a35..97cf91a44408 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -6550,6 +6550,8 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx) hdd_ctx->config->max_msdus_per_rxinorderind); hdd_debug("Name = [active_mode_offload] value = [%d]", hdd_ctx->config->active_mode_offload); + hdd_debug("Name = [gEnableNAPI] value = [%d]", + hdd_ctx->napi_enable); hdd_debug("Name = [gfine_time_meas_cap] value = [%u]", hdd_ctx->config->fine_time_meas_cap); #ifdef WLAN_FEATURE_FASTPATH diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7fa1d911777d..d66af8c8ace8 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -124,6 +124,7 @@ #include "wlan_hdd_rx_monitor.h" #include "sme_power_save_api.h" #include "enet.h" +#include #ifdef CNSS_GENL #include @@ -2365,7 +2366,7 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, ret = hdd_update_config(hdd_ctx); if (ret) { hdd_err("Failed to update configuration :%d", ret); - goto ol_cds_free; + goto cds_free; } hdd_update_cds_ac_specs_params(hdd_ctx); @@ -2374,7 +2375,7 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Failed to Open CDS: %d", status); ret = (status == QDF_STATUS_E_NOMEM) ? -ENOMEM : -EINVAL; - goto ol_cds_free; + goto cds_free; } /* initalize components configurations after psoc open */ @@ -2384,6 +2385,11 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, ret); goto close; } + status = cds_dp_open(hdd_ctx->hdd_psoc); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Failed to Open cds post open: %d", status); + goto close; + } /* * NAN compoenet requires certian operations like, open adapter, @@ -2398,7 +2404,7 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Failed to pre-enable CDS: %d", status); ret = (status == QDF_STATUS_E_NOMEM) ? -ENOMEM : -EINVAL; - goto close; + goto cds_txrx_free; } hdd_register_policy_manager_callback( @@ -2458,11 +2464,13 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, post_disable: cds_post_disable(); +cds_txrx_free: + cds_dp_close(hdd_ctx->hdd_psoc); close: hdd_ctx->driver_status = DRIVER_MODULES_CLOSED; cds_close(hdd_ctx->hdd_psoc); -ol_cds_free: +cds_free: ol_cds_free(); hif_close: @@ -9561,6 +9569,14 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) ret = -EINVAL; QDF_ASSERT(0); } + + qdf_status = cds_dp_close(hdd_ctx->hdd_psoc); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + hdd_warn("Failed to stop CDS DP: %d", qdf_status); + ret = -EINVAL; + QDF_ASSERT(0); + } + qdf_status = cds_close(hdd_ctx->hdd_psoc); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { hdd_warn("Failed to stop CDS: %d", qdf_status); @@ -11881,6 +11897,43 @@ static void hdd_update_hif_config(struct hdd_context *hdd_ctx) hif_vote_link_up(scn); } +/** + * hdd_update_dp_config() - Propagate config parameters to Lithium + * datapath + * @hdd_ctx: HDD Context + * + * Return: 0 for success/errno for failure + */ +static int hdd_update_dp_config(struct hdd_context *hdd_ctx) +{ + struct cdp_config_params params; + QDF_STATUS status; + + params.tso_enable = hdd_ctx->config->tso_enable; + params.lro_enable = hdd_ctx->config->lro_enable; +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 + params.tx_flow_stop_queue_threshold = + hdd_ctx->config->TxFlowStopQueueThreshold; + params.tx_flow_start_queue_offset = + hdd_ctx->config->TxFlowStartQueueOffset; +#endif + params.flow_steering_enable = hdd_ctx->config->flow_steering_enable; + params.napi_enable = hdd_ctx->napi_enable; + params.tcp_udp_checksumoffload = + hdd_ctx->config->enable_ip_tcp_udp_checksum_offload; + + status = cdp_update_config_parameters( + cds_get_context(QDF_MODULE_ID_SOC), + ¶ms); + if (status) { + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, + "%s: Failed to attach config parameters", __func__); + return status; + } + + return 0; +} + /** * hdd_update_config() - Initialize driver per module ini parameters * @hdd_ctx: HDD Context @@ -12151,10 +12204,16 @@ int hdd_update_components_config(struct hdd_context *hdd_ctx) ret = hdd_update_pmo_config(hdd_ctx); if (ret) return ret; + ret = hdd_update_scan_config(hdd_ctx); if (ret) return ret; + ret = hdd_update_tdls_config(hdd_ctx); + if (ret) + return ret; + + ret = hdd_update_dp_config(hdd_ctx); return ret; }