diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 9e1a920a4d..475ffb830c 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1776,12 +1776,12 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter, if ((eConnectionState_Disconnecting == sta_ctx->conn_info.connState) || (eConnectionState_NotConnected == + sta_ctx->conn_info.connState) || + (eConnectionState_Connecting == sta_ctx->conn_info.connState)) { hdd_debug("HDD has initiated a disconnect, no need to send disconnect indication to kernel"); sendDisconInd = false; - } - - if (sta_ctx->conn_info.connState != eConnectionState_Disconnecting) { + } else { INIT_COMPLETION(adapter->disconnect_comp_var); hdd_conn_set_connection_state(adapter, eConnectionState_Disconnecting); @@ -1894,7 +1894,14 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter, } /* Clear saved connection information in HDD */ hdd_conn_remove_connect_info(sta_ctx); - hdd_conn_set_connection_state(adapter, eConnectionState_NotConnected); + /* + * eConnectionState_Connecting state mean that connection is in + * progress so no need to set state to eConnectionState_NotConnected + */ + if ((eConnectionState_Connecting != sta_ctx->conn_info.connState)) { + hdd_conn_set_connection_state(adapter, + eConnectionState_NotConnected); + } pmo_ucfg_flush_gtk_offload_req(adapter->hdd_vdev); if ((QDF_STA_MODE == adapter->device_mode) || diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index f9b7ca625e..9553e9653f 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -3906,12 +3906,12 @@ static void csr_roam_remove_duplicate_pending_cmd_from_list( LL_ACCESS_NOLOCK); dup_cmd = GET_BASE_ADDR(entry, tSmeCmd, Link); /* - * Remove the previous command if.. - * - the new roam command is for the same RoamReason... - * - the new roam command is a NewProfileList. - * - the new roam command is a Forced Dissoc - * - the new roam command is from an 802.11 OID - * (OID_SSID or OID_BSSID). + * If command is not NULL remove the similar duplicate cmd for + * same reason as command. If command is NULL then check if + * roam_reason is eCsrForcedDisassoc (disconnect) and remove + * all roam command for the sessionId, else if roam_reason is + * eCsrHddIssued (connect) remove all connect (non disconenct) + * commands. */ if ((command && (command->sessionId == dup_cmd->sessionId) && ((command->command == dup_cmd->command) && @@ -3934,7 +3934,8 @@ static void csr_roam_remove_duplicate_pending_cmd_from_list( ((session_id == dup_cmd->sessionId) && (eSmeCommandRoam == dup_cmd->command) && ((eCsrForcedDisassoc == roam_reason) || - (eCsrHddIssued == roam_reason)))) { + (eCsrHddIssued == roam_reason && + !CSR_IS_DISCONNECT_COMMAND(dup_cmd))))) { sme_debug("RoamReason: %d", dup_cmd->u.roamCmd.roamReason); /* Remove the roam command from the pending list */