qcacld-3.0: Maintain driver state in CDS

Driver state of loading, unloading, logp are maintained in
multiple modules like HDD, CDS. Change to maintain the driver
state in CDS and provide CDS APIs to find out the state of the
driver so that any of the module can query it.
Also rename the logp to recovery in progress for clarity purpose.

Change-Id: I8e1864e1bc7f3b1dd6f4eb804ce2578c6695967d
CRs-fixed: 958659
diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c
index 03e4392..d6b98e1 100644
--- a/core/hdd/src/wlan_hdd_softap_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c
@@ -168,7 +168,6 @@
 	sme_ac_enum_type ac = SME_AC_BE;
 	hdd_adapter_t *pAdapter = (hdd_adapter_t *) netdev_priv(dev);
 	hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
 	struct cdf_mac_addr *pDestMacAddress;
 	uint8_t STAId;
 	uint8_t proto_type = 0;
@@ -181,9 +180,9 @@
 	 * context may not be reinitialized at this time which may
 	 * lead to a crash.
 	 */
-	if (pHddCtx->isLogpInProgress) {
+	if (cds_is_driver_recovering()) {
 		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_INFO_HIGH,
-			  "%s: LOGP in Progress. Ignore!!!", __func__);
+			  "%s: Recovery in Progress. Ignore!!!", __func__);
 		goto drop_pkt;
 	}
 
@@ -368,9 +367,9 @@
 	 * recovery here
 	 */
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	if (hdd_ctx->isLogpInProgress) {
+	if (cds_is_driver_recovering()) {
 		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			 "%s: LOGP in Progress. Ignore!!!", __func__);
+			 "%s: Recovery in Progress. Ignore!!!", __func__);
 		return;
 	}
 }
@@ -810,10 +809,10 @@
 	/* bss deregister is not allowed during wlan driver loading or
 	 * unloading
 	 */
-	if ((pHddCtx->isLoadInProgress) || (pHddCtx->isUnloadInProgress)) {
+	if (cds_is_load_unload_in_progress()) {
 		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s:Loading_unloading in Progress. Ignore!!!",
-			  __func__);
+			  "%s: Loading_unloading in Progress, state: 0x%x. Ignore!!!",
+			  __func__, cds_get_driver_state());
 		return CDF_STATUS_E_PERM;
 	}