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:
@@ -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);
|
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
|
* cds_is_fw_down() - Is FW down or not
|
||||||
*
|
*
|
||||||
|
@@ -190,8 +190,6 @@ QDF_STATUS cds_init(void)
|
|||||||
qdf_register_fw_down_callback(cds_is_fw_down);
|
qdf_register_fw_down_callback(cds_is_fw_down);
|
||||||
qdf_register_ssr_protect_callbacks(cds_ssr_protect,
|
qdf_register_ssr_protect_callbacks(cds_ssr_protect,
|
||||||
cds_ssr_unprotect);
|
cds_ssr_unprotect);
|
||||||
qdf_register_module_state_query_callback(
|
|
||||||
cds_is_module_state_transitioning);
|
|
||||||
|
|
||||||
gp_cds_context = &g_cds_context;
|
gp_cds_context = &g_cds_context;
|
||||||
|
|
||||||
|
@@ -12356,6 +12356,11 @@ static void hdd_qdf_print_deinit(void)
|
|||||||
qdf_print_ctrl_cleanup(qdf_print_idx);
|
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
|
* hdd_init() - Initialize Driver
|
||||||
*
|
*
|
||||||
@@ -12376,6 +12381,7 @@ int hdd_init(void)
|
|||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
qdf_register_module_state_query_callback(hdd_state_query_cb);
|
||||||
|
|
||||||
wlan_init_bug_report_lock();
|
wlan_init_bug_report_lock();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user