qcacld-3.0: Integrate DSC (driver mode change)

The Driver Synchronization Core (DSC) is a set of synchronization
primitives for use by the driver's orchestration layer. It provides APIs
for ensuring safe state transitions (including bring up and tear down)
of major driver objects: a single driver, associated psocs, and their
associated vdevs.

As part of integrating the DSC APIs into HDD, protect driver mode
change.

Change-Id: I28ae8a61f9ffa7e129cf81ade539df8adc72d853
CRs-Fixed: 2347024
This commit is contained in:
Dustin Brown 2018-09-20 12:10:22 -07:00 • committed by nshrivas
commit 67d3041bcc

View file

@ -13493,24 +13493,45 @@ unlock:
static int con_mode_handler(const char *kmessage, const struct kernel_param *kp)
{
int ret;
struct hdd_driver *hdd_driver = hdd_driver_get();
struct hdd_context *hdd_ctx;
QDF_STATUS status;
int errno;
hdd_enter();
status = dsc_driver_trans_start_wait(hdd_driver->dsc_driver,
"mode change");
if (QDF_IS_STATUS_ERROR(status)) {
hdd_err("Failed to start 'mode change'; status:%u", status);
errno = qdf_status_to_os_return(status);
goto exit;
}
dsc_driver_wait_for_ops(hdd_driver->dsc_driver);
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
ret = wlan_hdd_validate_context(hdd_ctx);
if (ret)
return ret;
errno = wlan_hdd_validate_context(hdd_ctx);
if (errno)
goto trans_stop;
if (!cds_wait_for_external_threads_completion(__func__)) {
hdd_warn("External threads are still active, can not change mode");
return -EAGAIN;
errno = -EAGAIN;
goto trans_stop;
}
cds_ssr_protect(__func__);
ret = __con_mode_handler(kmessage, kp, hdd_ctx);
errno = __con_mode_handler(kmessage, kp, hdd_ctx);
cds_ssr_unprotect(__func__);
return ret;
trans_stop:
dsc_driver_trans_stop(hdd_driver->dsc_driver);
exit:
hdd_exit();
return errno;
}
static int con_mode_handler_ftm(const char *kmessage,