From 068c4b0fc35d8939d76ecbbf3c34f25290ad9235 Mon Sep 17 00:00:00 2001 From: Govind Singh Date: Wed, 17 Aug 2016 16:37:13 +0530 Subject: [PATCH] qcacld-3.0: Set NAPI event after hif layer is initialized hdd_napi_event requires hif_ctx, after dynamic mode feature hif_ctx is getting created later as part of hdd_start_modules. HIF ctx is being created/destroyed depending on the interface up/down from the upper layer, hence set NAPI event after hif layer is initialized. Change-Id: I9fb21f6f75cc689620a6befd997956610e2ca3ae CRs-fixed: 1055660 --- core/hdd/src/wlan_hdd_cfg.c | 5 ----- core/hdd/src/wlan_hdd_driver_ops.c | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 6b38770d723c..a52bc2d9dd80 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -5970,11 +5970,6 @@ QDF_STATUS hdd_parse_config_ini(hdd_context_t *pHddCtx) /* Loop through the registry table and apply all these configs */ qdf_status = hdd_apply_cfg_ini(pHddCtx, cfgIniTable, i); hdd_set_rx_mode_value(pHddCtx); -#ifdef FEATURE_NAPI - if (QDF_STATUS_SUCCESS == qdf_status) - hdd_napi_event(NAPI_EVT_INI_FILE, - (void *)pHddCtx->napi_enable); -#endif /* FEATURE_NAPI */ if (QDF_GLOBAL_MONITOR_MODE == cds_get_conparam()) hdd_override_all_ps(pHddCtx); diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 2f9ef28f03fb..e4527bdb170a 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -219,6 +219,12 @@ int hdd_hif_open(struct device *dev, void *bdev, const hif_bus_id *bid, qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); struct hif_driver_state_callbacks cbk; uint32_t mode = cds_get_conparam(); + hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + + if (!hdd_ctx) { + hdd_err("hdd_ctx error"); + return -EFAULT; + } hdd_hif_init_driver_state_callbacks(dev, &cbk); @@ -252,6 +258,9 @@ int hdd_hif_open(struct device *dev, void *bdev, const hif_bus_id *bid, ret, reinit); ret = -EFAULT; goto err_hif_close; + } else { + hdd_napi_event(NAPI_EVT_INI_FILE, + (void *)hdd_ctx->napi_enable); } }