wlan: Process all candidate AP before setting state to not connected.

HDD connection state is set to eConnectionState_NotConnected for
each individual connection failure with the APs of the
requested profile i.e. with status eCSR_ROAM_ASSOCIATION_COMPLETION
and result eCSR_ROAM_RESULT_NOT_ASSOCIATED. Due to this if
disconnect command is sent from supplicant, it is dropped in HDD.
Eventually if DUT connects to an AP in the same requested profile,
driver is in connected state and supplicant is in
disconnected state.

Set HDD connection state to eConnectionState_NotConnected
only when CSR has completed all the available candidate AP
for the requested profile and Device is not able to
connect to any of them i.e status
eCSR_ROAM_ASSOCIATION FAILURE.

Process the Disconnect commands, even if SME is waiting
for the key.

Change-Id: I5edf92593fa765ace0ee43ceff207b64f33f69d6
CRs-Fixed: 668635
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 07d0d3a..652330a 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -5755,9 +5755,13 @@
          */
         if (WLAN_HDD_INFRA_STATION == pAdapter->device_mode ||
             WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)
+        {
+            VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+                   "%s: Set HDD connState to eConnectionState_Connecting",
+                   __func__);
             hdd_connSetConnectionState(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter),
                                                  eConnectionState_Connecting);
-
+        }
         status = sme_RoamConnect( WLAN_HDD_GET_HAL_CTX(pAdapter),
                             pAdapter->sessionId, pRoamProfile, &roamId);
 
@@ -6728,6 +6732,9 @@
     }
 
     pHddCtx->isAmpAllowed = VOS_TRUE;
+    VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+                   "%s: Set HDD connState to eConnectionState_Disconnecting",
+                   __func__);
     pHddStaCtx->conn_info.connState = eConnectionState_Disconnecting;
     INIT_COMPLETION(pAdapter->disconnect_comp_var);