qcacld-3.0: Add and use API to check FW Down indication bit during probe

When commands to Firmware fail during probe due to Firmware being down, in
most cases QDF_BUGs are hit, not allowing re-probing to take place. A new
API is defined to check if the failure is due to Firmware being down or not.
If so, return error gracefully allowing re-probing to take place

Change-Id: Ib2f21a6f1ced1c16e9d2bdbda810b160ff63e2c6
CRs-fixed: 2027444
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 566c4a2..c1883b7 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -7539,9 +7539,11 @@
 		goto err_free_config;
 
 
-	pld_set_fw_log_mode(hdd_ctx->parent_dev,
-			    hdd_ctx->config->enable_fw_log);
+	ret = pld_set_fw_log_mode(hdd_ctx->parent_dev,
+			hdd_ctx->config->enable_fw_log);
 
+	if (ret && cds_is_fw_down())
+		goto err_deinit_hdd_context;
 
 	/* Uses to enabled logging after SSR */
 	hdd_ctx->fw_log_settings.enable = hdd_ctx->config->enable_fw_log;
@@ -9414,11 +9416,14 @@
 
 	cds_deinit_ini_config();
 err_hdd_free_context:
-	hdd_start_complete(ret);
+	if (cds_is_fw_down())
+		hdd_err("Not setting the complete event as fw is down");
+	else
+		hdd_start_complete(ret);
+
 	qdf_mc_timer_destroy(&hdd_ctx->iface_change_timer);
 	mutex_destroy(&hdd_ctx->iface_change_lock);
 	hdd_context_destroy(hdd_ctx);
-	QDF_BUG(1);
 	return -EIO;
 
 success: