diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 143c34b50480..0e770d3311fd 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1844,6 +1844,14 @@ int wlan_hdd_validate_context(hdd_context_t *pHddCtx); */ int hdd_validate_adapter(hdd_adapter_t *adapter); +/** + * wlan_hdd_validate_context_in_loading() - check the HDD context in loading + * @hdd_ctx: HDD context pointer + * + * Return: 0 if the context is valid. Error code otherwise + */ +int wlan_hdd_validate_context_in_loading(hdd_context_t *hdd_ctx); + bool hdd_is_valid_mac_address(const uint8_t *pMacAddr); QDF_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx); bool wlan_hdd_validate_modules_state(hdd_context_t *hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index e0ebc952780a..aaa14b49da8c 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -886,6 +886,12 @@ static void __hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx) return; } + if (!hdd_ipa_is_rt_debugging_enabled(hdd_ctx)) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, + "%s: IPA RT debug is not enabled", __func__); + return; + } + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "========= WLAN-IPA DEBUG BUF DUMP ==========\n"); HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, @@ -1041,7 +1047,7 @@ static void hdd_ipa_uc_rt_debug_init(hdd_context_t *hdd_ctx) { struct hdd_ipa_priv *hdd_ipa; - if (wlan_hdd_validate_context(hdd_ctx)) + if (wlan_hdd_validate_context_in_loading(hdd_ctx)) return; hdd_ipa = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 5a3c71fa063b..07816c1733f8 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -605,6 +605,36 @@ int hdd_qdf_trace_enable(QDF_MODULE_ID module_id, uint32_t bitmask) return 0; } +/** + * wlan_hdd_validate_context_in_loading() - check the HDD context in loading + * @hdd_ctx: HDD context pointer + * + * Return: 0 if the context is valid. Error code otherwise + */ +int wlan_hdd_validate_context_in_loading(hdd_context_t *hdd_ctx) +{ + if (NULL == hdd_ctx || NULL == hdd_ctx->config) { + hdd_info("%pS HDD context is Null", (void *)_RET_IP_); + return -ENODEV; + } + + if (cds_is_driver_recovering()) { + hdd_info("%pS Recovery in Progress. State: 0x%x Ignore!!!", + (void *)_RET_IP_, cds_get_driver_state()); + return -EAGAIN; + } + + if (hdd_ctx->start_modules_in_progress || + hdd_ctx->stop_modules_in_progress) { + hdd_info("%pS Start/Stop Modules in progress. Ignore!!!", + (void *)_RET_IP_); + return -EAGAIN; + } + + return 0; +} + + /** * wlan_hdd_validate_context() - check the HDD context * @hdd_ctx: HDD context pointer