|
@@ -486,7 +486,6 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
|
|
|
cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
|
|
|
if (!cds_ctx) {
|
|
|
cds_alert("Trying to open CDS without a PreOpen");
|
|
|
- QDF_ASSERT(0);
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
@@ -499,15 +498,12 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
|
|
|
status = qdf_event_create(&gp_cds_context->wma_complete_event);
|
|
|
if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
cds_alert("Unable to init wma_complete_event");
|
|
|
- QDF_ASSERT(0);
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
- hdd_ctx = (struct hdd_context *)(gp_cds_context->hdd_context);
|
|
|
+ hdd_ctx = gp_cds_context->hdd_context;
|
|
|
if (!hdd_ctx || !hdd_ctx->config) {
|
|
|
- /* Critical Error ... Cannot proceed further */
|
|
|
cds_err("Hdd Context is Null");
|
|
|
- QDF_ASSERT(0);
|
|
|
|
|
|
status = QDF_STATUS_E_FAILURE;
|
|
|
goto err_wma_complete_event;
|
|
@@ -524,9 +520,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
|
|
|
&gp_cds_context->qdf_sched,
|
|
|
sizeof(cds_sched_context));
|
|
|
if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
- /* Critical Error ... Cannot proceed further */
|
|
|
cds_alert("Failed to open CDS Scheduler");
|
|
|
- QDF_ASSERT(0);
|
|
|
goto err_dispatcher_disable;
|
|
|
}
|
|
|
|
|
@@ -541,7 +535,6 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
|
|
|
cds_cfg = cds_get_ini_config();
|
|
|
if (!cds_cfg) {
|
|
|
cds_err("Cds config is NULL");
|
|
|
- QDF_ASSERT(0);
|
|
|
|
|
|
status = QDF_STATUS_E_FAILURE;
|
|
|
goto err_sched_close;
|
|
@@ -588,9 +581,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
|
|
|
status = wma_open(psoc, hdd_update_tgt_cfg, cds_cfg,
|
|
|
hdd_ctx->target_type);
|
|
|
if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
- /* Critical Error ... Cannot proceed further */
|
|
|
cds_alert("Failed to open WMA module");
|
|
|
- QDF_ASSERT(0);
|
|
|
goto err_htc_close;
|
|
|
}
|
|
|
|
|
@@ -617,9 +608,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
|
|
|
status = htc_wait_target(HTCHandle);
|
|
|
if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
cds_alert("Failed to complete BMI phase. status: %d", status);
|
|
|
-
|
|
|
- if (status != QDF_STATUS_E_NOMEM && !cds_is_fw_down())
|
|
|
- QDF_BUG(0);
|
|
|
+ QDF_BUG(status == QDF_STATUS_E_NOMEM || cds_is_fw_down());
|
|
|
|
|
|
goto err_wma_close;
|
|
|
}
|
|
@@ -662,9 +651,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
|
|
|
gp_cds_context->hdd_context, cds_cfg);
|
|
|
|
|
|
if (QDF_STATUS_SUCCESS != status) {
|
|
|
- /* Critical Error ... Cannot proceed further */
|
|
|
cds_alert("Failed to open MAC");
|
|
|
- QDF_ASSERT(0);
|
|
|
goto err_soc_detach;
|
|
|
}
|
|
|
gp_cds_context->mac_context = mac_handle;
|
|
@@ -672,21 +659,23 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
|
|
|
/* Now proceed to open the SME */
|
|
|
status = sme_open(mac_handle);
|
|
|
if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
- /* Critical Error ... Cannot proceed further */
|
|
|
cds_alert("Failed to open SME");
|
|
|
- QDF_ASSERT(0);
|
|
|
goto err_mac_close;
|
|
|
}
|
|
|
|
|
|
cds_register_all_modules();
|
|
|
|
|
|
status = dispatcher_psoc_open(psoc);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ cds_alert("Failed to open PSOC Components");
|
|
|
+ goto deregister_modules;
|
|
|
+ }
|
|
|
|
|
|
- if (QDF_IS_STATUS_SUCCESS(status))
|
|
|
- return status;
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
|
|
|
- cds_alert("Failed to open PSOC Components");
|
|
|
- QDF_ASSERT(0);
|
|
|
+deregister_modules:
|
|
|
+ cds_deregister_all_modules();
|
|
|
+ sme_close(mac_handle);
|
|
|
|
|
|
err_mac_close:
|
|
|
mac_close(mac_handle);
|
|
@@ -694,6 +683,7 @@ err_mac_close:
|
|
|
|
|
|
err_soc_detach:
|
|
|
cdp_soc_detach(gp_cds_context->dp_soc);
|
|
|
+ gp_cds_context->dp_soc = NULL;
|
|
|
|
|
|
ucfg_ocb_update_dp_handle(psoc, NULL);
|
|
|
pmo_ucfg_psoc_update_dp_handle(psoc, NULL);
|
|
@@ -715,14 +705,12 @@ err_bmi_close:
|
|
|
bmi_cleanup(ol_ctx);
|
|
|
|
|
|
err_sched_close:
|
|
|
- if (QDF_IS_STATUS_ERROR(cds_sched_close())) {
|
|
|
- cds_err("Failed to close CDS Scheduler");
|
|
|
- QDF_ASSERT(false);
|
|
|
- }
|
|
|
+ if (QDF_IS_STATUS_ERROR(cds_sched_close()))
|
|
|
+ QDF_DEBUG_PANIC("Failed to close CDS Scheduler");
|
|
|
|
|
|
err_dispatcher_disable:
|
|
|
if (QDF_IS_STATUS_ERROR(dispatcher_disable()))
|
|
|
- cds_err("Failed to disable dispatcher");
|
|
|
+ QDF_DEBUG_PANIC("Failed to disable dispatcher");
|
|
|
|
|
|
err_wma_complete_event:
|
|
|
qdf_event_destroy(&gp_cds_context->wma_complete_event);
|