qcacld-3.0: Validate context for qdf transition check

cds_is_module_state_transitioning() is effectively a partial
re-implementation of wlan_hdd_validate_context(). Instead of having
multiple copies of this logic, register a new callback in QDF which
simply calls wlan_hdd_validate_context() instead.

Change-Id: If533d72725b4cc9dbe5e4b9c25e499657c8e1376
CRs-Fixed: 2308771
This commit is contained in:
Dustin Brown
2018-09-04 13:11:38 -07:00
committed by nshrivas
parent 0d5a51e3ad
commit 94ce20f5a4
3 changed files with 6 additions and 21 deletions

View File

@@ -207,25 +207,6 @@ static inline bool cds_is_module_stop_in_progress(void)
return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_MODULE_STOPPING);
}
/**
* cds_is_module_state_transitioning() - Is module state transitioning
*
* Return: true if module stop is in progress.
*/
static inline int cds_is_module_state_transitioning(void)
{
if (cds_is_load_or_unload_in_progress() || cds_is_driver_recovering() ||
cds_is_module_stop_in_progress()) {
pr_info("%s: Load/Unload %d or recovery %d or module_stop %d is in progress",
__func__, cds_is_load_or_unload_in_progress(),
cds_is_driver_recovering(),
cds_is_module_stop_in_progress());
return true;
} else {
return false;
}
}
/**
* cds_is_fw_down() - Is FW down or not
*

View File

@@ -190,8 +190,6 @@ QDF_STATUS cds_init(void)
qdf_register_fw_down_callback(cds_is_fw_down);
qdf_register_ssr_protect_callbacks(cds_ssr_protect,
cds_ssr_unprotect);
qdf_register_module_state_query_callback(
cds_is_module_state_transitioning);
gp_cds_context = &g_cds_context;

View File

@@ -12356,6 +12356,11 @@ static void hdd_qdf_print_deinit(void)
qdf_print_ctrl_cleanup(qdf_print_idx);
}
static inline int hdd_state_query_cb(void)
{
return !!wlan_hdd_validate_context(cds_get_context(QDF_MODULE_ID_HDD));
}
/**
* hdd_init() - Initialize Driver
*
@@ -12376,6 +12381,7 @@ int hdd_init(void)
ret = -ENOMEM;
goto err_out;
}
qdf_register_module_state_query_callback(hdd_state_query_cb);
wlan_init_bug_report_lock();