qcacld-3.0: Check the device status during hdd cleanup of present mode

On a change of the mode ( from the current one to the FTM mode ) ,
the clean up of the adapters are again done though they are already
cleaned ( signified by device_status = DRIVER_MODULES_CLOSED ). Hence
check for this device_status while to avoid a redundant clean up of the
adapters.

Change-Id: I2a851b235809db5cd47ec5d738067d1553f83129
CRs-Fixed: 1115243
This commit is contained in:
Ashish Kumar Dhanotiya
2017-01-24 16:37:34 +05:30
committed by qcabuildsw
parent 5f924ba0c3
commit 0024313a75

View File

@@ -9685,12 +9685,18 @@ static enum tQDF_ADAPTER_MODE hdd_get_adpter_mode(
static void hdd_cleanup_present_mode(hdd_context_t *hdd_ctx,
enum tQDF_GLOBAL_CON_MODE curr_mode)
{
int driver_status;
driver_status = hdd_ctx->driver_status;
switch (curr_mode) {
case QDF_GLOBAL_MISSION_MODE:
case QDF_GLOBAL_MONITOR_MODE:
case QDF_GLOBAL_FTM_MODE:
hdd_abort_mac_scan_all_adapters(hdd_ctx);
hdd_stop_all_adapters(hdd_ctx);
if (driver_status != DRIVER_MODULES_CLOSED) {
hdd_abort_mac_scan_all_adapters(hdd_ctx);
hdd_stop_all_adapters(hdd_ctx);
}
hdd_deinit_all_adapters(hdd_ctx, false);
hdd_close_all_adapters(hdd_ctx, false);
break;