Browse Source

qcacld-3.0: Add roam offload state machine changes

Add changes to handle transition to the 2 new states:
1. Roaming in progress: Switch to this state when roam
start notification is received from firmware.
2. Roam Synch in progress: Switch to this from RSO
STARTED state if roam synch indication event is received
from firmware. Change to this state is also allowed in
RSO STOPPED state if supplicant disabled roaming on that
vdev - to allow roam invoke to be processed.

Also query the state machine to get the roaming status instead
of using discrete flags at various layers. Clean the redundant
roaming in progress, roam synch related flags.

Change-Id: Ide20a30d9d8c20a96d8bba70367b51b8643cae09
CRs-Fixed: 2725443
Pragaspathi Thilagaraj 4 years ago
parent
commit
eb128b5dfe
34 changed files with 542 additions and 514 deletions
  1. 4 4
      components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_srtuct.h
  2. 1 12
      core/hdd/inc/wlan_hdd_assoc.h
  3. 1 2
      core/hdd/inc/wlan_hdd_main.h
  4. 40 79
      core/hdd/src/wlan_hdd_assoc.c
  5. 6 9
      core/hdd/src/wlan_hdd_cfg80211.c
  6. 18 33
      core/hdd/src/wlan_hdd_main.c
  7. 0 1
      core/hdd/src/wlan_hdd_power.c
  8. 3 6
      core/hdd/src/wlan_hdd_softap_tx_rx.c
  9. 0 1
      core/mac/src/pe/include/lim_session.h
  10. 6 27
      core/mac/src/pe/lim/lim_api.c
  11. 2 1
      core/mac/src/pe/lim/lim_assoc_utils.c
  12. 5 3
      core/mac/src/pe/lim/lim_assoc_utils.h
  13. 2 2
      core/mac/src/pe/lim/lim_ft.c
  14. 18 17
      core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c
  15. 2 2
      core/mac/src/pe/lim/lim_process_deauth_frame.c
  16. 1 1
      core/mac/src/pe/lim/lim_process_disassoc_frame.c
  17. 2 0
      core/mac/src/pe/lim/lim_process_message_queue.c
  18. 34 52
      core/mac/src/pe/lim/lim_process_mlm_host_roam.c
  19. 1 2
      core/mac/src/pe/lim/lim_process_mlm_req_messages.c
  20. 7 5
      core/mac/src/pe/lim/lim_process_tdls.c
  21. 20 1
      core/mac/src/pe/lim/lim_types.h
  22. 1 1
      core/mac/src/pe/lim/lim_utils.c
  23. 0 2
      core/sme/inc/csr_api.h
  24. 0 3
      core/sme/inc/csr_internal.h
  25. 220 76
      core/sme/src/csr/csr_api_roam.c
  26. 29 42
      core/sme/src/csr/csr_neighbor_roam.c
  27. 2 2
      core/sme/src/qos/sme_qos.c
  28. 3 6
      core/wma/inc/wma.h
  29. 2 14
      core/wma/inc/wma_internal.h
  30. 44 50
      core/wma/src/wma_dev_if.c
  31. 7 7
      core/wma/src/wma_features.c
  32. 3 5
      core/wma/src/wma_nan_datapath.c
  33. 57 45
      core/wma/src/wma_scan_roam.c
  34. 1 1
      core/wma/src/wma_utils.c

+ 4 - 4
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_srtuct.h

@@ -31,10 +31,10 @@
  * @WLAN_ROAM_DEINIT: Roaming module is not initialized at the
  *  firmware.
  * @WLAN_ROAM_INIT: Roaming module initialized at the firmware.
- * @WLAN_ROAM_RSO_ENABLED: RSO started, firmware can roam to different AP.
- * @WLAN_ROAM_RSO_STOPPED: RSO stopped - roaming module is initialized at firmware,
- * but firmware cannot do roaming due to supplicant disabled roaming/driver
- * disabled roaming.
+ * @WLAN_ROAM_RSO_ENABLED: RSO enabled, firmware can roam to different AP.
+ * @WLAN_ROAM_RSO_STOPPED: RSO stopped - roaming module is initialized at
+ * firmware, but firmware cannot do roaming due to supplicant disabled
+ * roaming/driver disabled roaming.
  * @WLAN_ROAMING_IN_PROG: Roaming started at firmware. This state is
  * transitioned after candidate selection is done at fw and preauth to
  * the AP is started.

+ 1 - 12
core/hdd/inc/wlan_hdd_assoc.h

@@ -358,23 +358,12 @@ hdd_indicate_ese_bcn_report_no_results(const struct hdd_adapter *adapter,
  * @adapter: HDD adapter
  * @peer_mac_addr: Peer MAC address
  * @sta_state: peer state
- * @roam_synch_in_progress: roam synch in progress
  *
  * Return: QDF status
  */
 QDF_STATUS hdd_change_peer_state(struct hdd_adapter *adapter,
 				 uint8_t *peer_mac_addr,
-				 enum ol_txrx_peer_state sta_state,
-				 bool roam_synch_in_progress);
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-bool hdd_is_roam_sync_in_progress(struct csr_roam_info *roaminfo);
-#else
-static inline bool hdd_is_roam_sync_in_progress(struct csr_roam_info *roaminfo)
-{
-	return false;
-}
-#endif
-
+				 enum ol_txrx_peer_state sta_state);
 /**
  * hdd_update_dp_vdev_flags() - update datapath vdev flags
  * @cbk_data: callback data

+ 1 - 2
core/hdd/inc/wlan_hdd_main.h

@@ -802,7 +802,7 @@ struct hdd_station_ctx {
 	struct qdf_mac_addr requested_bssid;
 	struct hdd_connection_info conn_info;
 	struct hdd_connection_info cache_conn_info;
-	int ft_carrier_on;
+	bool ft_carrier_on;
 	bool hdd_reassoc_scenario;
 	int sta_debug_state;
 	struct hdd_mon_set_ch_info ch_info;
@@ -3630,7 +3630,6 @@ tSirAddie *hdd_assoc_additional_ie(struct hdd_adapter *adapter)
  * Return: true if roaming is in progress else false
  */
 bool hdd_is_roaming_in_progress(struct hdd_context *hdd_ctx);
-void hdd_set_roaming_in_progress(bool value);
 
 /**
  * hdd_is_connection_in_progress() - check if connection is in progress

+ 40 - 79
core/hdd/src/wlan_hdd_assoc.c

@@ -1023,6 +1023,19 @@ static inline void hdd_copy_he_operation(struct hdd_station_ctx *hdd_sta_ctx,
 }
 #endif
 
+/**
+ * hdd_is_roam_sync_in_progress()- Check if roam offloaded
+ * @hdd_ctx: Pointer to hdd context
+ * @vdev_id: Vdev id
+ *
+ * Return: roam sync status if roaming offloaded else false
+ */
+static bool hdd_is_roam_sync_in_progress(struct hdd_context *hdd_ctx,
+					 uint8_t vdev_id)
+{
+	return MLME_IS_ROAM_SYNCH_IN_PROGRESS(hdd_ctx->psoc, vdev_id);
+}
+
 /**
  * hdd_save_bss_info() - save connection info in hdd sta ctx
  * @adapter: Pointer to adapter
@@ -1033,6 +1046,7 @@ static inline void hdd_copy_he_operation(struct hdd_station_ctx *hdd_sta_ctx,
 static void hdd_save_bss_info(struct hdd_adapter *adapter,
 						struct csr_roam_info *roam_info)
 {
+	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	struct hdd_station_ctx *hdd_sta_ctx =
 		WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 
@@ -1051,8 +1065,9 @@ static void hdd_save_bss_info(struct hdd_adapter *adapter,
 		hdd_sta_ctx->conn_info.conn_flag.ht_present = false;
 	}
 	if (roam_info->reassoc ||
-	    hdd_is_roam_sync_in_progress(roam_info))
+	    hdd_is_roam_sync_in_progress(hdd_ctx, adapter->vdev_id))
 		hdd_sta_ctx->conn_info.roam_count++;
+
 	if (roam_info->hs20vendor_ie.present) {
 		hdd_sta_ctx->conn_info.conn_flag.hs20_present = true;
 		qdf_mem_copy(&hdd_sta_ctx->conn_info.hs20vendor_ie,
@@ -1483,15 +1498,12 @@ static void hdd_send_association_event(struct net_device *dev,
 	memset(&wrqu, '\0', sizeof(wrqu));
 	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
 	we_event = SIOCGIWAP;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (roam_info)
-		if (roam_info->roamSynchInProgress) {
-			/* Update tdls module about the disconnection event */
-			hdd_notify_sta_disconnect(adapter->vdev_id,
-						 true, false,
-						 adapter->vdev);
-		}
-#endif
+
+	/* Update tdls module about the disconnection event */
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(hdd_ctx->psoc, adapter->vdev_id))
+		hdd_notify_sta_disconnect(adapter->vdev_id, true, false,
+					  adapter->vdev);
+
 	if (eConnectionState_Associated == sta_ctx->conn_info.conn_state) {
 		struct oem_channel_info chan_info = {0};
 
@@ -1500,7 +1512,8 @@ static void hdd_send_association_event(struct net_device *dev,
 			return;
 		}
 
-		if (!hdd_is_roam_sync_in_progress(roam_info)) {
+		if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(hdd_ctx->psoc,
+						    adapter->vdev_id)) {
 			policy_mgr_incr_active_session(hdd_ctx->psoc,
 				adapter->device_mode, adapter->vdev_id);
 			hdd_green_ap_start_state_mc(hdd_ctx,
@@ -1961,9 +1974,7 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter,
 		hdd_conn_set_connection_state(adapter,
 					       eConnectionState_NotConnected);
 
-	/* Clear roaming in progress flag */
-	hdd_set_roaming_in_progress(false);
-
+	hdd_init_scan_reject_params(hdd_ctx);
 	ucfg_pmo_flush_gtk_offload_req(adapter->vdev);
 
 	if ((QDF_STA_MODE == adapter->device_mode) ||
@@ -2046,10 +2057,10 @@ void hdd_set_unpause_queue(void *soc, struct hdd_adapter *adapter)
 
 QDF_STATUS hdd_change_peer_state(struct hdd_adapter *adapter,
 				 uint8_t *peer_mac,
-				 enum ol_txrx_peer_state sta_state,
-				 bool roam_synch_in_progress)
+				 enum ol_txrx_peer_state sta_state)
 {
 	QDF_STATUS err;
+	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	err = cdp_peer_state_update(soc, peer_mac, sta_state);
@@ -2057,10 +2068,9 @@ QDF_STATUS hdd_change_peer_state(struct hdd_adapter *adapter,
 		hdd_err("peer state update failed");
 		return QDF_STATUS_E_FAULT;
 	}
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (roam_synch_in_progress)
+
+	if (hdd_is_roam_sync_in_progress(hdd_ctx, adapter->vdev_id))
 		return QDF_STATUS_SUCCESS;
-#endif
 
 	if (sta_state == OL_TXRX_PEER_STATE_AUTH) {
 		/* Reset scan reject params on successful set key */
@@ -2133,25 +2143,13 @@ QDF_STATUS hdd_update_dp_vdev_flags(void *cbk_data,
  *
  * Return: QDF_STATUS enumeration
  */
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-static QDF_STATUS hdd_conn_change_peer_state(struct hdd_adapter *adapter,
-					     struct csr_roam_info *roam_info,
-					     uint8_t *mac_addr,
-					     enum ol_txrx_peer_state sta_state)
-{
-	return hdd_change_peer_state(adapter, mac_addr, sta_state,
-				     roam_info->roamSynchInProgress);
-}
-#else
 static QDF_STATUS hdd_conn_change_peer_state(struct hdd_adapter *adapter,
 					     struct csr_roam_info *roam_info,
 					     uint8_t *mac_addr,
 					     enum ol_txrx_peer_state sta_state)
 {
-	return hdd_change_peer_state(adapter, mac_addr, sta_state,
-				     false);
+	return hdd_change_peer_state(adapter, mac_addr, sta_state);
 }
-#endif
 
 #if defined(WLAN_SUPPORT_RX_FISA)
 /**
@@ -2452,7 +2450,7 @@ static void hdd_send_re_assoc_event(struct net_device *dev,
 	 * active session count should still be the same and hence upon
 	 * successful reassoc decrement the active session count here.
 	 */
-	if (!hdd_is_roam_sync_in_progress(roam_info)) {
+	if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(hdd_ctx->psoc, adapter->vdev_id)) {
 		hdd_roam_decr_conn_count(adapter, hdd_ctx);
 		hdd_green_ap_start_state_mc(hdd_ctx, adapter->device_mode,
 					    false);
@@ -2534,22 +2532,6 @@ done:
 	qdf_mem_free(assoc_req_ies);
 }
 
-/**
- * hdd_is_roam_sync_in_progress()- Check if roam offloaded
- * @roaminfo - Roaming Information
- *
- * Return: roam sync status if roaming offloaded else false
- */
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-bool hdd_is_roam_sync_in_progress(struct csr_roam_info *roaminfo)
-{
-	if (roaminfo)
-		return roaminfo->roamSynchInProgress;
-	else
-		return false;
-}
-#endif
-
 /**
  * hdd_change_sta_state_authenticated()-
  * This function changes STA state to authenticated
@@ -2587,8 +2569,7 @@ static int hdd_change_sta_state_authenticated(struct hdd_adapter *adapter,
 	 */
 
 	status = hdd_change_peer_state(adapter, mac_addr,
-				       OL_TXRX_PEER_STATE_AUTH,
-				       hdd_is_roam_sync_in_progress(roaminfo));
+				       OL_TXRX_PEER_STATE_AUTH);
 	hdd_conn_set_authenticated(adapter, true);
 	hdd_objmgr_set_peer_mlme_auth_state(adapter->vdev, true);
 
@@ -3102,8 +3083,8 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 						 * decrement the active session
 						 * count here.
 						 */
-						if (!hdd_is_roam_sync_in_progress
-								(roam_info)) {
+						if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(
+							hdd_ctx->psoc, adapter->vdev_id)) {
 						hdd_roam_decr_conn_count(
 							 adapter, hdd_ctx);
 
@@ -3256,13 +3237,7 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 				qdf_status =
 					hdd_change_peer_state(adapter,
 						roam_info->bssid.bytes,
-						OL_TXRX_PEER_STATE_CONN,
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-						roam_info->roamSynchInProgress
-#else
-						false
-#endif
-						);
+						OL_TXRX_PEER_STATE_CONN);
 				hdd_conn_set_authenticated(adapter, false);
 				hdd_objmgr_set_peer_mlme_auth_state(
 							adapter->vdev,
@@ -3275,13 +3250,7 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 				qdf_status =
 					hdd_change_peer_state(adapter,
 						roam_info->bssid.bytes,
-						OL_TXRX_PEER_STATE_AUTH,
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-						roam_info->roamSynchInProgress
-#else
-						false
-#endif
-						);
+						OL_TXRX_PEER_STATE_AUTH);
 				hdd_conn_set_authenticated(adapter, true);
 				hdd_objmgr_set_peer_mlme_auth_state(
 							adapter->vdev,
@@ -3298,10 +3267,6 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 			}
 
 			/* Start the tx queues */
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-			if (roam_info->roamSynchInProgress)
-				hdd_debug("LFR3:netif_tx_wake_all_queues");
-#endif
 			hdd_debug("Enabling queues");
 			wlan_hdd_netif_queue_control(adapter,
 						   WLAN_WAKE_ALL_NETIF_QUEUE,
@@ -4312,16 +4277,13 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 		hdd_napi_serialize(0);
 		if (roam_result == eCSR_ROAM_RESULT_FAILURE) {
 			adapter->roam_ho_fail = true;
-			hdd_set_roaming_in_progress(false);
 		} else {
 			adapter->roam_ho_fail = false;
 		}
+
+		hdd_init_scan_reject_params(hdd_ctx);
 		complete(&adapter->roaming_comp_var);
 		break;
-	case eCSR_ROAM_SYNCH_COMPLETE:
-		hdd_debug("LFR3: Roam synch complete");
-		hdd_set_roaming_in_progress(false);
-		break;
 	case eCSR_ROAM_SHOULD_ROAM:
 		/* notify apps that we can't pass traffic anymore */
 		hdd_debug("Disabling queues");
@@ -4347,7 +4309,7 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 		hdd_debug("****eCSR_ROAM_DISASSOCIATED****");
 		hdd_napi_serialize(0);
 		hdd_set_connection_in_progress(false);
-		hdd_set_roaming_in_progress(false);
+		hdd_init_scan_reject_params(hdd_ctx);
 		adapter->roam_ho_fail = false;
 		complete(&adapter->roaming_comp_var);
 
@@ -4536,7 +4498,6 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 				WLAN_STOP_ALL_NETIF_QUEUE,
 				WLAN_CONTROL_PATH);
 		hdd_set_connection_in_progress(true);
-		hdd_set_roaming_in_progress(true);
 		policy_mgr_restart_opportunistic_timer(hdd_ctx->psoc, true);
 		break;
 	case eCSR_ROAM_ABORT:
@@ -4546,7 +4507,7 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 				WLAN_WAKE_ALL_NETIF_QUEUE,
 				WLAN_CONTROL_PATH);
 		hdd_set_connection_in_progress(false);
-		hdd_set_roaming_in_progress(false);
+		hdd_init_scan_reject_params(hdd_ctx);
 		adapter->roam_ho_fail = false;
 		sta_ctx->ft_carrier_on = false;
 		complete(&adapter->roaming_comp_var);

+ 6 - 9
core/hdd/src/wlan_hdd_cfg80211.c

@@ -18347,11 +18347,11 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
 		 *
 		 * If connection state is not changed, connection state will
 		 * remain in eConnectionState_NotConnected state.
-		 * In hdd_association_completion_handler, "hddDisconInProgress"
-		 * is set to true if conn state is
+		 * In hdd_association_completion_handler,
+		 * "disconnection_in_progress" is set to true if conn state is
 		 * eConnectionState_NotConnected.
-		 * If "hddDisconInProgress" is set to true then cfg80211 layer
-		 * is not informed of connect result indication which
+		 * If "disconnection_in_progress" is set to true then cfg80211
+		 * layer is not informed of connect result indication which
 		 * is an issue.
 		 */
 		if (QDF_STA_MODE == adapter->device_mode ||
@@ -19825,11 +19825,11 @@ static void wlan_hdd_wait_for_roaming(mac_handle_t mac_handle,
 		rc = wait_for_completion_timeout(&adapter->roaming_comp_var,
 				msecs_to_jiffies(WLAN_WAIT_TIME_STOP_ROAM));
 		if (!rc) {
+			hdd_init_scan_reject_params(hdd_ctx);
 			hdd_err("roaming_comp_var time out vdev id: %d",
 				adapter->vdev_id);
-			/* Clear roaming in progress flag */
-			hdd_set_roaming_in_progress(false);
 		}
+
 		if (adapter->roam_ho_fail) {
 			INIT_COMPLETION(adapter->disconnect_comp_var);
 			hdd_conn_set_connection_state(adapter,
@@ -19894,12 +19894,9 @@ static int wlan_hdd_reassoc_bssid_hint(struct hdd_adapter *adapter,
 		qdf_mem_copy(sta_ctx->requested_bssid.bytes, bssid,
 			     QDF_MAC_ADDR_SIZE);
 
-		hdd_set_roaming_in_progress(true);
-
 		status = hdd_reassoc(adapter, bssid, ch_freq,
 				     CONNECT_CMD_USERSPACE);
 		if (QDF_IS_STATUS_ERROR(status)) {
-			hdd_set_roaming_in_progress(false);
 			hdd_debug("Failed with status: %d", status);
 		}
 	}

+ 18 - 33
core/hdd/src/wlan_hdd_main.c

@@ -14345,14 +14345,12 @@ wlan_hdd_disable_roaming(struct hdd_adapter *cur_adapter,
 {
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(cur_adapter);
 	struct hdd_adapter *adapter = NULL;
-	struct csr_roam_profile *roam_profile;
 	struct hdd_station_ctx *sta_ctx;
 
 	if (!policy_mgr_is_sta_active_connection_exists(hdd_ctx->psoc))
 		return;
 
 	hdd_for_each_adapter(hdd_ctx, adapter) {
-		roam_profile = hdd_roam_profile(adapter);
 		sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 
 		if (cur_adapter->vdev_id != adapter->vdev_id &&
@@ -14373,14 +14371,12 @@ wlan_hdd_enable_roaming(struct hdd_adapter *cur_adapter,
 {
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(cur_adapter);
 	struct hdd_adapter *adapter = NULL;
-	struct csr_roam_profile *roam_profile;
 	struct hdd_station_ctx *sta_ctx;
 
 	if (!policy_mgr_is_sta_active_connection_exists(hdd_ctx->psoc))
 		return;
 
 	hdd_for_each_adapter(hdd_ctx, adapter) {
-		roam_profile = hdd_roam_profile(adapter);
 		sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 
 		if (cur_adapter->vdev_id != adapter->vdev_id &&
@@ -16789,44 +16785,33 @@ int hdd_enable_disable_ca_event(struct hdd_context *hdd_ctx, uint8_t set_value)
 	return 0;
 }
 
-/**
- * hdd_set_roaming_in_progress() - to set the roaming in progress flag
- * @value: value to set
- *
- * This function will set the passed value to roaming in progress flag.
- *
- * Return: None
- */
-void hdd_set_roaming_in_progress(bool value)
+bool hdd_is_roaming_in_progress(struct hdd_context *hdd_ctx)
 {
-	struct hdd_context *hdd_ctx;
+	struct hdd_adapter *adapter = NULL;
+	uint8_t vdev_id;
 
-	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	if (!hdd_ctx) {
 		hdd_err("HDD context is NULL");
-		return;
-	}
-
-	hdd_ctx->roaming_in_progress = value;
-	hdd_debug("Roaming in Progress set to %d", value);
-	if (!hdd_ctx->roaming_in_progress) {
-		/* Reset scan reject params on successful roam complete */
-		hdd_debug("Reset scan reject params");
-		hdd_init_scan_reject_params(hdd_ctx);
+		return false;
 	}
-}
 
-bool hdd_is_roaming_in_progress(struct hdd_context *hdd_ctx)
-{
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!policy_mgr_is_sta_active_connection_exists(hdd_ctx->psoc))
 		return false;
-	}
 
-	if (hdd_ctx->roaming_in_progress)
-		hdd_debug("Roaming is in progress");
+	hdd_for_each_adapter(hdd_ctx, adapter) {
+		vdev_id = adapter->vdev_id;
+		if (adapter->device_mode == QDF_STA_MODE &&
+		    (MLME_IS_ROAM_SYNCH_IN_PROGRESS(hdd_ctx->psoc, vdev_id) ||
+		     MLME_IS_ROAMING_IN_PROG(hdd_ctx->psoc, vdev_id) ||
+		     mlme_is_roam_invoke_in_progress(hdd_ctx->psoc,
+						      vdev_id))) {
+			hdd_debug("Roaming is in progress on:vdev_id:%d",
+				  adapter->vdev_id);
+			return true;
+		}
+	}
 
-	return hdd_ctx->roaming_in_progress;
+	return false;
 }
 
 /**

+ 0 - 1
core/hdd/src/wlan_hdd_power.c

@@ -1515,7 +1515,6 @@ QDF_STATUS hdd_wlan_re_init(void)
 
 	hdd_init_scan_reject_params(hdd_ctx);
 
-	hdd_set_roaming_in_progress(false);
 	complete(&adapter->roaming_comp_var);
 	hdd_ctx->bt_coex_mode_set = false;
 

+ 3 - 6
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -1216,8 +1216,7 @@ QDF_STATUS hdd_softap_register_sta(struct hdd_adapter *adapter,
 		 */
 		qdf_status = hdd_change_peer_state(adapter,
 						   txrx_desc.peer_addr.bytes,
-						   OL_TXRX_PEER_STATE_AUTH,
-						   false);
+						   OL_TXRX_PEER_STATE_AUTH);
 
 		sta_info->peer_state = OL_TXRX_PEER_STATE_AUTH;
 		if (!qdf_is_macaddr_broadcast(sta_mac))
@@ -1232,8 +1231,7 @@ QDF_STATUS hdd_softap_register_sta(struct hdd_adapter *adapter,
 
 		qdf_status = hdd_change_peer_state(adapter,
 						   txrx_desc.peer_addr.bytes,
-						   OL_TXRX_PEER_STATE_CONN,
-						   false);
+						   OL_TXRX_PEER_STATE_CONN);
 
 		sta_info->peer_state = OL_TXRX_PEER_STATE_CONN;
 	}
@@ -1350,8 +1348,7 @@ QDF_STATUS hdd_softap_change_sta_state(struct hdd_adapter *adapter,
 		qdf_mem_copy(&mac_addr, sta_mac, QDF_MAC_ADDR_SIZE);
 
 	qdf_status =
-		hdd_change_peer_state(adapter, mac_addr.bytes,
-				      state, false);
+		hdd_change_peer_state(adapter, mac_addr.bytes, state);
 	hdd_debug("Station " QDF_MAC_ADDR_STR " changed to state %d",
 		  QDF_MAC_ADDR_ARRAY(mac_addr.bytes), state);
 

+ 0 - 1
core/mac/src/pe/include/lim_session.h

@@ -554,7 +554,6 @@ struct pe_session {
 	bool is_session_obss_offload_enabled;
 	bool is_obss_reset_timer_initialized;
 	bool sae_pmk_cached;
-	bool fw_roaming_started;
 	bool recvd_deauth_while_roaming;
 	bool recvd_disassoc_while_roaming;
 	bool deauth_disassoc_rc;

+ 6 - 27
core/mac/src/pe/lim/lim_api.c

@@ -2383,6 +2383,7 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 	struct pe_session *session_ptr;
 	struct pe_session *ft_session_ptr;
 	uint8_t session_id;
+	uint8_t *reassoc_resp;
 	tpDphHashNode curr_sta_ds;
 	uint16_t aid;
 	struct bss_params *add_bss_params;
@@ -2407,11 +2408,7 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 
 	pe_debug("LFR3: PE callback reason: %d", reason);
 	switch (reason) {
-	case SIR_ROAMING_START:
-		session_ptr->fw_roaming_started = true;
-		return QDF_STATUS_SUCCESS;
 	case SIR_ROAMING_ABORT:
-		session_ptr->fw_roaming_started = false;
 		/*
 		 * If there was a disassoc or deauth that was received
 		 * during roaming and it was not honored, then we have
@@ -2431,13 +2428,12 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 		}
 		return QDF_STATUS_SUCCESS;
 	case SIR_ROAM_SYNCH_PROPAGATION:
-		session_ptr->fw_roaming_started = false;
 		break;
 	default:
 		return status;
 	}
 
-	pe_debug("LFR3:Received ROAM_OFFLOAD_SYNCH_IND bssid %pM auth: %d vdevId: %d",
+	pe_debug("LFR3:Received ROAM SYNCH IND bssid %pM auth: %d vdevId: %d",
 		 roam_sync_ind_ptr->bssid.bytes, roam_sync_ind_ptr->authStatus,
 		 roam_sync_ind_ptr->roamed_vdev_id);
 
@@ -2517,19 +2513,6 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 		return status;
 	}
 
-	mac_ctx->roam.reassocRespLen = roam_sync_ind_ptr->reassocRespLength;
-	mac_ctx->roam.pReassocResp =
-		qdf_mem_malloc(mac_ctx->roam.reassocRespLen);
-	if (!mac_ctx->roam.pReassocResp) {
-		ft_session_ptr->bRoamSynchInProgress = false;
-		return QDF_STATUS_E_NOMEM;
-	}
-	qdf_mem_copy(mac_ctx->roam.pReassocResp,
-			(uint8_t *)roam_sync_ind_ptr +
-			roam_sync_ind_ptr->reassocRespOffset,
-			mac_ctx->roam.reassocRespLen);
-
-	ft_session_ptr->bRoamSynchInProgress = true;
 
 	if (roam_sync_ind_ptr->authStatus ==
 	    CSR_ROAM_AUTH_STATUS_AUTHENTICATED) {
@@ -2537,7 +2520,10 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 		curr_sta_ds->is_key_installed = true;
 	}
 
-	lim_process_assoc_rsp_frame(mac_ctx, mac_ctx->roam.pReassocResp,
+	reassoc_resp = (uint8_t *)roam_sync_ind_ptr +
+			roam_sync_ind_ptr->reassocRespOffset;
+	lim_process_assoc_rsp_frame(mac_ctx, reassoc_resp,
+				    roam_sync_ind_ptr->reassocRespLength,
 				    LIM_REASSOC, ft_session_ptr);
 
 	lim_check_ft_initial_im_association(roam_sync_ind_ptr, ft_session_ptr);
@@ -2563,9 +2549,6 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 	roam_sync_ind_ptr->join_rsp = qdf_mem_malloc(join_rsp_len);
 	if (!roam_sync_ind_ptr->join_rsp) {
 		ft_session_ptr->bRoamSynchInProgress = false;
-		if (mac_ctx->roam.pReassocResp)
-			qdf_mem_free(mac_ctx->roam.pReassocResp);
-		mac_ctx->roam.pReassocResp = NULL;
 		return QDF_STATUS_E_NOMEM;
 	}
 
@@ -2607,10 +2590,6 @@ pe_roam_synch_callback(struct mac_context *mac_ctx,
 	ft_session_ptr->limSmeState = eLIM_SME_LINK_EST_STATE;
 	ft_session_ptr->limPrevSmeState = ft_session_ptr->limSmeState;
 	ft_session_ptr->bRoamSynchInProgress = false;
-	if (mac_ctx->roam.pReassocResp)
-		qdf_mem_free(mac_ctx->roam.pReassocResp);
-	mac_ctx->roam.pReassocResp = NULL;
-
 
 	return QDF_STATUS_SUCCESS;
 }

+ 2 - 1
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -462,8 +462,9 @@ lim_cleanup_rx_path(struct mac_context *mac, tpDphHashNode sta,
 	sta->valid = 0;
 	lim_send_sme_tsm_ie_ind(mac, pe_session, 0, 0, 0);
 	/* Any roaming related changes should be above this line */
-	if (lim_is_roam_synch_in_progress(pe_session))
+	if (lim_is_roam_synch_in_progress(mac->psoc, pe_session))
 		return QDF_STATUS_SUCCESS;
+
 	sta->mlmStaContext.mlmState = eLIM_MLM_WT_DEL_STA_RSP_STATE;
 
 	if (LIM_IS_STA_ROLE(pe_session)) {

+ 5 - 3
core/mac/src/pe/lim/lim_assoc_utils.h

@@ -170,12 +170,14 @@ static inline QDF_STATUS lim_add_ft_sta_self(struct mac_context *mac,
 #endif
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
-static inline bool lim_is_roam_synch_in_progress(struct pe_session *pe_session)
+static inline bool lim_is_roam_synch_in_progress(struct wlan_objmgr_psoc *psoc,
+						 struct pe_session *pe_session)
 {
-	return pe_session->bRoamSynchInProgress;
+	return MLME_IS_ROAM_SYNCH_IN_PROGRESS(psoc, pe_session->vdev_id);
 }
 #else
-static inline bool lim_is_roam_synch_in_progress(struct pe_session *pe_session)
+static inline bool lim_is_roam_synch_in_progress(struct wlan_objmgr_psoc *psoc,
+						 struct pe_session *pe_session)
 {
 	return false;
 }

+ 2 - 2
core/mac/src/pe/lim/lim_ft.c

@@ -339,7 +339,7 @@ void lim_ft_prepare_add_bss_req(struct mac_context *mac,
 	pAddBssParams->staContext.smesessionId = ft_session->smeSessionId;
 
 	/* Set a new state for MLME */
-	if (!lim_is_roam_synch_in_progress(ft_session)) {
+	if (!lim_is_roam_synch_in_progress(mac->psoc, ft_session)) {
 		ft_session->limMlmState =
 			eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE;
 		MTRACE(mac_trace
@@ -718,7 +718,7 @@ void lim_fill_ft_session(struct mac_context *mac,
 
 	pe_debug("Reg max: %d local pwr: %d, max tx pwr: %d", regMax,
 		 localPowerConstraint, ft_session->maxTxPower);
-	if (!lim_is_roam_synch_in_progress(pe_session)) {
+	if (!lim_is_roam_synch_in_progress(mac->psoc, pe_session)) {
 		ft_session->limPrevSmeState = ft_session->limSmeState;
 		ft_session->limSmeState = eLIM_SME_WT_REASSOC_STATE;
 		MTRACE(mac_trace(mac,

+ 18 - 17
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -626,6 +626,8 @@ lim_handle_pmfcomeback_timer(struct pe_session *session_entry,
  * lim_process_assoc_rsp_frame() - Processes assoc response
  * @mac_ctx: Pointer to Global MAC structure
  * @rx_packet_info    - A pointer to Rx packet info structure
+ * @reassoc_frame_length - Valid frame length if its a reassoc response frame
+ * else 0
  * @sub_type - Indicates whether it is Association Response (=0) or
  *                   Reassociation Response (=1) frame
  *
@@ -634,10 +636,10 @@ lim_handle_pmfcomeback_timer(struct pe_session *session_entry,
  *
  * Return: None
  */
-
 void
-lim_process_assoc_rsp_frame(struct mac_context *mac_ctx,
-	uint8_t *rx_pkt_info, uint8_t subtype, struct pe_session *session_entry)
+lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
+			    uint32_t reassoc_frame_len,
+			    uint8_t subtype, struct pe_session *session_entry)
 {
 	uint8_t *body;
 	uint16_t caps, ie_len;
@@ -649,17 +651,14 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx,
 	tpSirAssocRsp assoc_rsp;
 	tLimMlmAssocCnf assoc_cnf;
 	tSchBeaconStruct *beacon;
+	uint8_t vdev_id = session_entry->vdev_id;
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	uint8_t vdev_id = 0;
 	struct csr_roam_session *roam_session;
 #endif
 	uint8_t ap_nss;
 	int8_t rssi;
 	QDF_STATUS status;
 
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	vdev_id = session_entry->vdev_id;
-#endif
 	assoc_cnf.resultCode = eSIR_SME_SUCCESS;
 	/* Update PE session Id */
 	assoc_cnf.sessionId = session_entry->peSessionId;
@@ -674,9 +673,9 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx,
 		return;
 	}
 
-	if (lim_is_roam_synch_in_progress(session_entry)) {
-		hdr = (tpSirMacMgmtHdr) mac_ctx->roam.pReassocResp;
-		frame_len = mac_ctx->roam.reassocRespLen - SIR_MAC_HDR_LEN_3A;
+	if (lim_is_roam_synch_in_progress(mac_ctx->psoc, session_entry)) {
+		hdr = (tpSirMacMgmtHdr)rx_pkt_info;
+		frame_len = reassoc_frame_len - SIR_MAC_HDR_LEN_3A;
 		rssi = 0;
 	} else {
 		hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
@@ -690,7 +689,7 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx,
 	}
 
 	pe_nofl_info("Assoc rsp RX: subtype %d vdev %d sys role %d lim state %d rssi %d from " QDF_MAC_ADDR_STR,
-		     subtype, session_entry->vdev_id,
+		     subtype, vdev_id,
 		     GET_LIM_SYSTEM_ROLE(session_entry),
 		     session_entry->limMlmState, rssi,
 		     QDF_MAC_ADDR_ARRAY(hdr->sa));
@@ -704,7 +703,7 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx,
 	if (((subtype == LIM_ASSOC) &&
 		(session_entry->limMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE)) ||
 		((subtype == LIM_REASSOC) &&
-		 !lim_is_roam_synch_in_progress(session_entry) &&
+		 !lim_is_roam_synch_in_progress(mac_ctx->psoc, session_entry) &&
 		((session_entry->limMlmState != eLIM_MLM_WT_REASSOC_RSP_STATE)
 		&& (session_entry->limMlmState !=
 		eLIM_MLM_WT_FT_REASSOC_RSP_STATE)
@@ -760,8 +759,8 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx,
 		return;
 	}
 	/* Get pointer to Re/Association Response frame body */
-	if (lim_is_roam_synch_in_progress(session_entry))
-		body = mac_ctx->roam.pReassocResp + SIR_MAC_HDR_LEN_3A;
+	if (lim_is_roam_synch_in_progress(mac_ctx->psoc, session_entry))
+		body =  rx_pkt_info + SIR_MAC_HDR_LEN_3A;
 	else
 		body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
 	/* parse Re/Association Response frame. */
@@ -988,8 +987,9 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx,
 					   session_entry->nss);
 
 		if ((session_entry->limMlmState ==
-		    eLIM_MLM_WT_FT_REASSOC_RSP_STATE) ||
-			lim_is_roam_synch_in_progress(session_entry)) {
+		     eLIM_MLM_WT_FT_REASSOC_RSP_STATE) ||
+		    lim_is_roam_synch_in_progress(mac_ctx->psoc,
+						  session_entry)) {
 			pe_debug("Sending self sta");
 			lim_update_assoc_sta_datas(mac_ctx, sta_ds, assoc_rsp,
 				session_entry, NULL);
@@ -1002,7 +1002,8 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx,
 				session_entry->gLimEdcaParams,
 				session_entry);
 			/* Send the active EDCA parameters to HAL */
-			if (!lim_is_roam_synch_in_progress(session_entry)) {
+			if (!lim_is_roam_synch_in_progress(mac_ctx->psoc,
+							   session_entry)) {
 				lim_send_edca_params(mac_ctx,
 					session_entry->gLimEdcaParamsActive,
 					session_entry->vdev_id, false);

+ 2 - 2
core/mac/src/pe/lim/lim_process_deauth_frame.c

@@ -235,13 +235,13 @@ lim_process_deauth_frame(struct mac_context *mac, uint8_t *pRxPacketInfo,
 
 	if (lim_is_reassoc_in_progress(mac, pe_session) ||
 	    lim_is_reassoc_in_progress(mac, pRoamSessionEntry) ||
-	    pe_session->fw_roaming_started) {
+	    MLME_IS_ROAMING_IN_PROG(mac->psoc, pe_session->vdev_id)) {
 		/*
 		 * For LFR3, the roaming bssid is not known during ROAM_START,
 		 * so check if the deauth is received from current AP when
 		 * roaming is being done in the firmware
 		 */
-		if (pe_session->fw_roaming_started &&
+		if (MLME_IS_ROAMING_IN_PROG(mac->psoc, pe_session->vdev_id) &&
 		    IS_CURRENT_BSSID(mac, pHdr->sa, pe_session)) {
 			pe_debug("LFR3: Drop deauth frame from connected AP");
 			/*

+ 1 - 1
core/mac/src/pe/lim/lim_process_disassoc_frame.c

@@ -191,7 +191,7 @@ lim_process_disassoc_frame(struct mac_context *mac, uint8_t *pRxPacketInfo,
 		 * so check if the disassoc is received from current AP when
 		 * roaming is being done in the firmware
 		 */
-		if (pe_session->fw_roaming_started &&
+		if (MLME_IS_ROAMING_IN_PROG(mac->psoc, pe_session->vdev_id) &&
 		    IS_CURRENT_BSSID(mac, pHdr->sa, pe_session)) {
 			pe_debug("Dropping disassoc frame from connected AP");
 			pe_session->recvd_disassoc_while_roaming = true;

+ 2 - 0
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -1409,6 +1409,7 @@ lim_handle80211_frames(struct mac_context *mac, struct scheduler_msg *limMsg,
 
 		case SIR_MAC_MGMT_ASSOC_RSP:
 			lim_process_assoc_rsp_frame(mac, pRxPacketInfo,
+						    ASSOC_FRAME_LEN,
 						    LIM_ASSOC,
 						    pe_session);
 			break;
@@ -1430,6 +1431,7 @@ lim_handle80211_frames(struct mac_context *mac, struct scheduler_msg *limMsg,
 
 		case SIR_MAC_MGMT_REASSOC_RSP:
 			lim_process_assoc_rsp_frame(mac, pRxPacketInfo,
+						    ASSOC_FRAME_LEN,
 						    LIM_REASSOC,
 						    pe_session);
 			break;

+ 34 - 52
core/mac/src/pe/lim/lim_process_mlm_host_roam.c

@@ -401,53 +401,44 @@ void lim_process_sta_mlm_add_bss_rsp_ft(struct mac_context *mac,
 		       pe_session->bssId);
 		goto end;
 	}
+
 	/* Prepare and send Reassociation request frame */
 	/* start reassoc timer. */
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (pe_session->bRoamSynchInProgress != true) {
-#endif
-		mac->lim.lim_timers.gLimReassocFailureTimer.sessionId =
+	mac->lim.lim_timers.gLimReassocFailureTimer.sessionId =
 			pe_session->peSessionId;
-		/* / Start reassociation failure timer */
-		MTRACE(mac_trace
-			(mac, TRACE_CODE_TIMER_ACTIVATE,
-			 pe_session->peSessionId, eLIM_REASSOC_FAIL_TIMER));
-		if (tx_timer_activate
-			(&mac->lim.lim_timers.gLimReassocFailureTimer)
-			!= TX_SUCCESS) {
-			/* / Could not start reassoc failure timer. */
-			/* Log error */
-			pe_err("could not start Reassoc failure timer");
-			/* Return Reassoc confirm with */
-			/* Resources Unavailable */
-			mlmReassocCnf.resultCode =
-				eSIR_SME_RESOURCES_UNAVAILABLE;
-			mlmReassocCnf.protStatusCode =
-				eSIR_MAC_UNSPEC_FAILURE_STATUS;
+	/* / Start reassociation failure timer */
+	MTRACE(mac_trace
+		(mac, TRACE_CODE_TIMER_ACTIVATE,
+		 pe_session->peSessionId, eLIM_REASSOC_FAIL_TIMER));
+
+	if (tx_timer_activate(&mac->lim.lim_timers.gLimReassocFailureTimer) !=
+	    TX_SUCCESS) {
+		/* / Could not start reassoc failure timer. */
+		/* Log error */
+		pe_err("could not start Reassoc failure timer");
+		/* Return Reassoc confirm with */
+		/* Resources Unavailable */
+		mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE;
+		mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS;
+		goto end;
+	}
+
+	mac->lim.pe_session = pe_session;
+	if (!mac->lim.pe_session->pLimMlmReassocRetryReq) {
+		/* Take a copy of reassoc request for retrying */
+		mac->lim.pe_session->pLimMlmReassocRetryReq =
+			qdf_mem_malloc(sizeof(tLimMlmReassocReq));
+		if (!mac->lim.pe_session->pLimMlmReassocRetryReq)
 			goto end;
-		}
-		mac->lim.pe_session = pe_session;
-		if (!mac->lim.pe_session->pLimMlmReassocRetryReq) {
-			/* Take a copy of reassoc request for retrying */
-			mac->lim.pe_session->pLimMlmReassocRetryReq =
-				qdf_mem_malloc(sizeof(tLimMlmReassocReq));
-			if (!mac->lim.pe_session->pLimMlmReassocRetryReq)
-				goto end;
-			qdf_mem_copy(mac->lim.pe_session->
-					pLimMlmReassocRetryReq,
-					pe_session->pLimMlmReassocReq,
-					sizeof(tLimMlmReassocReq));
-		}
-		mac->lim.reAssocRetryAttempt = 0;
-		lim_send_reassoc_req_with_ft_ies_mgmt_frame(mac,
-				pe_session->
-				pLimMlmReassocReq,
-				pe_session);
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	} else {
-		pe_debug("LFR3:Do not activate timer and dont send the reassoc");
+
+		qdf_mem_copy(mac->lim.pe_session->pLimMlmReassocRetryReq,
+			     pe_session->pLimMlmReassocReq,
+			     sizeof(tLimMlmReassocReq));
 	}
-#endif
+	mac->lim.reAssocRetryAttempt = 0;
+	lim_send_reassoc_req_with_ft_ies_mgmt_frame(
+		mac, pe_session->pLimMlmReassocReq, pe_session);
+
 	pe_session->limPrevMlmState = pe_session->limMlmState;
 	pe_session->limMlmState = eLIM_MLM_WT_FT_REASSOC_RSP_STATE;
 	MTRACE(mac_trace
@@ -513,13 +504,6 @@ void lim_process_sta_mlm_add_bss_rsp_ft(struct mac_context *mac,
 	/* Lets save this for when we receive the Reassoc Rsp */
 	pe_session->ftPEContext.pAddStaReq = pAddStaParams;
 
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (pe_session->bRoamSynchInProgress) {
-		pe_debug("LFR3:Prep and save AddStaReq for post-assoc-rsp");
-		lim_process_assoc_rsp_frame(mac, mac->roam.pReassocResp,
-					    LIM_REASSOC, pe_session);
-	}
-#endif
 	return;
 
 end:
@@ -611,9 +595,7 @@ void lim_process_mlm_ft_reassoc_req(struct mac_context *mac,
 	else
 		val = mac->mlme_cfg->sap_cfg.listen_interval;
 
-	status = wma_add_bss_peer_sta(session->vdev_id, session->bssId,
-				      false);
-
+	status = wma_add_bss_peer_sta(session->vdev_id, session->bssId);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		qdf_mem_free(reassoc_req);
 		return;

+ 1 - 2
core/mac/src/pe/lim/lim_process_mlm_req_messages.c

@@ -389,8 +389,7 @@ lim_process_mlm_post_join_suspend_link(struct mac_context *mac_ctx,
 	mac_ctx->lim.lim_timers.gLimJoinFailureTimer.sessionId =
 		session->peSessionId;
 
-	status = wma_add_bss_peer_sta(session->vdev_id, session->bssId,
-				      false);
+	status = wma_add_bss_peer_sta(session->vdev_id, session->bssId);
 	lim_post_join_set_link_state_callback(mac_ctx, session, status);
 
 	return;

+ 7 - 5
core/mac/src/pe/lim/lim_process_tdls.c

@@ -2746,7 +2746,7 @@ QDF_STATUS lim_process_sme_tdls_mgmt_send_req(struct mac_context *mac_ctx,
 		goto lim_tdls_send_mgmt_error;
 	}
 
-	if (lim_is_roam_synch_in_progress(session_entry)) {
+	if (lim_is_roam_synch_in_progress(mac_ctx->psoc, session_entry)) {
 		pe_err("roaming in progress, reject mgmt! for session %d",
 		       send_req->session_id);
 		result_code = eSIR_SME_REFUSED;
@@ -2909,7 +2909,7 @@ QDF_STATUS lim_process_sme_tdls_add_sta_req(struct mac_context *mac,
 		goto lim_tdls_add_sta_error;
 	}
 
-	if (lim_is_roam_synch_in_progress(pe_session)) {
+	if (lim_is_roam_synch_in_progress(mac->psoc, pe_session)) {
 		pe_err("roaming in progress, reject add sta! for session %d",
 		       add_sta_req->session_id);
 		goto lim_tdls_add_sta_error;
@@ -2971,7 +2971,7 @@ QDF_STATUS lim_process_sme_tdls_del_sta_req(struct mac_context *mac,
 		goto lim_tdls_del_sta_error;
 	}
 
-	if (lim_is_roam_synch_in_progress(pe_session)) {
+	if (lim_is_roam_synch_in_progress(mac->psoc, pe_session)) {
 		pe_err("roaming in progress, reject del sta! for session %d",
 		       del_sta_req->session_id);
 		lim_send_sme_tdls_del_sta_rsp(mac, del_sta_req->session_id,
@@ -3040,7 +3040,8 @@ static void lim_check_aid_and_delete_peer(struct mac_context *p_mac,
 			pe_debug("Deleting "QDF_MAC_ADDR_STR,
 				QDF_MAC_ADDR_ARRAY(stads->staAddr));
 
-			if (!lim_is_roam_synch_in_progress(session_entry)) {
+			if (!lim_is_roam_synch_in_progress(p_mac->psoc,
+							   session_entry)) {
 				lim_send_deauth_mgmt_frame(p_mac,
 					eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
 					stads->staAddr, session_entry, false);
@@ -3094,8 +3095,9 @@ QDF_STATUS lim_delete_tdls_peers(struct mac_context *mac_ctx,
 	tgt_tdls_delete_all_peers_indication(mac_ctx->psoc,
 					     session_entry->smeSessionId);
 
-	if (lim_is_roam_synch_in_progress(session_entry))
+	if (lim_is_roam_synch_in_progress(mac_ctx->psoc, session_entry))
 		return QDF_STATUS_SUCCESS;
+
 	/* In case of CSA, Only peers in lim and TDLS component
 	 * needs to be removed and set state disable command
 	 * should not be sent to fw as there is no way to enable

+ 20 - 1
core/mac/src/pe/lim/lim_types.h

@@ -449,7 +449,26 @@ lim_fill_sme_assoc_ind_params(
 void lim_send_mlm_assoc_ind(struct mac_context *mac, tpDphHashNode sta,
 			    struct pe_session *pe_session);
 
-void lim_process_assoc_rsp_frame(struct mac_context *, uint8_t *, uint8_t, struct pe_session *);
+#define ASSOC_FRAME_LEN 0
+/**
+ * lim_process_assoc_rsp_frame() - Processes assoc response
+ * @mac_ctx:              Pointer to Global MAC structure
+ * @rx_packet_info:       A pointer to Rx packet info structure
+ * @reassoc_frame_length: Valid frame length if its a reassoc response frame
+ * else 0
+ * @sub_type: Indicates whether it is Association Response (=0) or
+ *             Reassociation Response (=1) frame
+ *
+ * This function is called by lim_handle80211_frames() or
+ * pe_roam_synch_callback() upon Re/Association Response frame reception or
+ * roam synch indication with reassociation response frame is received.
+ *
+ * Return: None
+ */
+void lim_process_assoc_rsp_frame(struct mac_context *mac, uint8_t *rx_pkt_info,
+				 uint32_t reassoc_frame_len, uint8_t subtype,
+				 struct pe_session *pe_session);
+
 void lim_process_disassoc_frame(struct mac_context *, uint8_t *, struct pe_session *);
 
 /**

+ 1 - 1
core/mac/src/pe/lim/lim_utils.c

@@ -3780,7 +3780,7 @@ void lim_update_sta_run_time_ht_switch_chnl_params(struct mac_context *mac,
 		return;
 	}
 
-	if (lim_is_roam_synch_in_progress(pe_session)) {
+	if (lim_is_roam_synch_in_progress(mac->psoc, pe_session)) {
 		pe_debug("Roaming in progress, ignore HT IE BW update");
 		return;
 	}

+ 0 - 2
core/sme/inc/csr_api.h

@@ -378,8 +378,6 @@ typedef enum {
 	eCSR_ROAM_CHANNEL_COMPLETE_IND,
 	eCSR_ROAM_CAC_COMPLETE_IND,
 	eCSR_ROAM_SAE_COMPUTE,
-	/* LFR3 Roam sync complete */
-	eCSR_ROAM_SYNCH_COMPLETE,
 	eCSR_ROAM_FIPS_PMK_REQUEST,
 } eRoamCmdStatus;
 

+ 0 - 3
core/sme/inc/csr_internal.h

@@ -610,7 +610,6 @@ struct csr_roam_session {
 	uint8_t join_bssid_count;
 	struct csr_roam_stored_profile stored_roam_profile;
 	bool ch_switch_in_progress;
-	bool roam_synch_in_progress;
 	bool supported_nss_1x1;
 	uint8_t vdev_nss;
 	uint8_t nss;
@@ -651,8 +650,6 @@ struct csr_roamstruct {
 	uint8_t RoamRssiDiff;
 	bool isWESModeEnabled;
 	uint32_t deauthRspStatus;
-	uint8_t *pReassocResp;          /* reassociation response from new AP */
-	uint16_t reassocRespLen;        /* length of reassociation response */
 	qdf_mc_timer_t packetdump_timer;
 	spinlock_t roam_state_lock;
 };

+ 220 - 76
core/sme/src/csr/csr_api_roam.c

@@ -4774,22 +4774,16 @@ static void csr_roam_ccm_cfg_set_callback(struct mac_context *mac,
 		csr_nonscan_active_ll_peek_head(mac, LL_ACCESS_LOCK);
 	uint32_t sessionId;
 	tSmeCmd *pCommand = NULL;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	struct csr_roam_session *pSession = NULL;
-#endif
+
 	if (!pEntry) {
 		sme_err("CFG_CNF with active list empty");
 		return;
 	}
 	pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
 	sessionId = pCommand->vdev_id;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	pSession = &mac->roam.roamSession[sessionId];
-	if (pSession->roam_synch_in_progress) {
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
-			  "LFR3:csr_roam_cfg_set_callback");
-	}
-#endif
+
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac->psoc, sessionId))
+		sme_debug("LFR3: Set ccm vdev_id:%d", session_id);
 
 	if (CSR_IS_ROAM_JOINING(mac, sessionId)
 	    && CSR_IS_ROAM_SUBSTATE_CONFIG(mac, sessionId)) {
@@ -4873,9 +4867,10 @@ QDF_STATUS csr_roam_set_bss_config_cfg(struct mac_context *mac, uint32_t session
 
 	mac->mlme_cfg->timeouts.join_failure_timeout =
 		pBssConfig->uJoinTimeOut;
+
 	/* Any roaming related changes should be above this line */
-	if (pSession && pSession->roam_synch_in_progress) {
-		sme_debug("Roam synch is in progress Session_id: %d",
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac->psoc, sessionId)) {
+		sme_debug("LFR3: Roam synch is in progress Session_id: %d",
 			  sessionId);
 		return QDF_STATUS_SUCCESS;
 	}
@@ -6548,12 +6543,9 @@ static void csr_roam_synch_clean_up(struct mac_context *mac, uint8_t session_id)
 {
 	struct scheduler_msg msg = {0};
 	struct roam_offload_synch_fail *roam_offload_failed = NULL;
-	struct csr_roam_session *session = &mac->roam.roamSession[session_id];
 
 	/* Clean up the roam synch in progress for LFR3 */
-	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
-		  "%s: Roam Synch Failed, Clean Up", __func__);
-	session->roam_synch_in_progress = false;
+	sme_err("Roam Synch Failed, Clean Up");
 
 	roam_offload_failed = qdf_mem_malloc(
 				sizeof(struct roam_offload_synch_fail));
@@ -7401,14 +7393,12 @@ static void csr_roam_process_join_res(struct mac_context *mac_ctx,
 		assoc_info.bss_desc = bss_desc;       /* could be NULL */
 		assoc_info.pProfile = profile;
 		if (context) {
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-			if (session->roam_synch_in_progress)
-				QDF_TRACE(QDF_MODULE_ID_SME,
-					QDF_TRACE_LEVEL_DEBUG,
-					FL("LFR3:Clear Connected info"));
-#endif
+			if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac_ctx->psoc,
+							   session_id))
+				sme_debug("LFR3: Clear Connected info");
+
 			csr_roam_free_connected_info(mac_ctx,
-				&session->connectedInfo);
+						     &session->connectedInfo);
 			len = join_rsp->assocReqLength +
 				join_rsp->assocRspLength +
 				join_rsp->beaconLength;
@@ -7571,14 +7561,9 @@ static void csr_roam_process_join_res(struct mac_context *mac_ctx,
 	 * we need to keep at this point.
 	 */
 	if (!CSR_IS_WAIT_FOR_KEY(mac_ctx, session_id)) {
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-		if (session->roam_synch_in_progress) {
-			QDF_TRACE(QDF_MODULE_ID_SME,
-				QDF_TRACE_LEVEL_DEBUG,
-				FL
-				("NO CSR_IS_WAIT_FOR_KEY -> csr_roam_link_up"));
-		}
-#endif
+		if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac_ctx->psoc, session_id))
+			sme_debug("LFR3: NO WAIT_FOR_KEY do csr_roam_link_up");
+
 		csr_roam_link_up(mac_ctx, conn_profile->bssid);
 	}
 
@@ -8856,7 +8841,7 @@ csr_roam_save_connected_information(struct mac_context *mac,
 	 * profile and cleared and then is copied back. This is not needed for
 	 * LFR3.0, since the profile is not cleared.
 	 */
-	if (!pSession->roam_synch_in_progress) {
+	if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac->psoc, sessionId)) {
 		qdf_mem_zero(&pSession->connectedProfile,
 				sizeof(tCsrRoamConnectedProfile));
 		pConnectProfile->AuthType = pProfile->negotiatedAuthType;
@@ -18596,9 +18581,14 @@ csr_roam_switch_to_init(struct mac_context *mac, uint8_t vdev_id,
 		}
 		break;
 
+	case WLAN_ROAM_SYNCH_IN_PROG:
+		mlme_set_roam_state(mac->psoc, vdev_id, WLAN_ROAM_INIT);
+
+		return QDF_STATUS_SUCCESS;
 	case WLAN_ROAM_INIT:
 	case WLAN_ROAM_RSO_STOPPED:
 	case WLAN_ROAM_RSO_ENABLED:
+	case WLAN_ROAMING_IN_PROG:
 	/*
 	 * Already the roaming module is initialized at fw,
 	 * just return from here
@@ -18631,16 +18621,20 @@ csr_roam_switch_to_init(struct mac_context *mac, uint8_t vdev_id,
 }
 
 static QDF_STATUS
-csr_roam_switch_to_rso_start(struct mac_context *mac, uint8_t vdev_id,
-			     uint8_t reason)
+csr_roam_switch_to_rso_enable(struct mac_context *mac, uint8_t vdev_id,
+			      uint8_t reason)
 {
-	enum roam_offload_state cur_state;
+	enum roam_offload_state cur_state, new_roam_state;
 	QDF_STATUS status;
 	uint8_t control_bitmap;
 	bool sup_disabled_roaming;
 	bool rso_allowed = csr_roam_is_roam_offload_scan_enabled(mac);
 	uint8_t rso_command = ROAM_SCAN_OFFLOAD_START;
 
+	sup_disabled_roaming = mlme_get_supplicant_disabled_roaming(mac->psoc,
+								    vdev_id);
+	control_bitmap = mlme_get_operations_bitmap(mac->psoc, vdev_id);
+
 	cur_state = mlme_get_roam_state(mac->psoc, vdev_id);
 	switch (cur_state) {
 	case WLAN_ROAM_INIT:
@@ -18658,6 +18652,40 @@ csr_roam_switch_to_rso_start(struct mac_context *mac, uint8_t vdev_id,
 	 * Send RSO update config if roaming already enabled
 	 */
 		rso_command = ROAM_SCAN_OFFLOAD_UPDATE_CFG;
+		break;
+	case WLAN_ROAMING_IN_PROG:
+		/*
+		 * When roam abort happens, the roam offload
+		 * state machine moves to RSO_ENABLED state.
+		 * But if Supplicant disabled roaming is set in case
+		 * of roam invoke or if roaming was disabled due to
+		 * other reasons like SAP start/connect on other vdev,
+		 * the state should be transitioned to RSO STOPPED.
+		 */
+		if (sup_disabled_roaming || control_bitmap)
+			new_roam_state = WLAN_ROAM_RSO_STOPPED;
+		else
+			new_roam_state = WLAN_ROAM_RSO_ENABLED;
+
+		mlme_set_roam_state(mac->psoc, vdev_id, new_roam_state);
+
+		return QDF_STATUS_SUCCESS;
+	case WLAN_ROAM_SYNCH_IN_PROG:
+		/*
+		 * After roam sych propagation is complete, send
+		 * RSO start command to firmware to update AP profile,
+		 * new PCL.
+		 * If this is roam invoke case and supplicant has already
+		 * disabled firmware roaming, then move to RSO stopped state
+		 * instead of RSO enabled.
+		 */
+		if (sup_disabled_roaming || control_bitmap) {
+			new_roam_state = WLAN_ROAM_RSO_STOPPED;
+			mlme_set_roam_state(mac->psoc, vdev_id, new_roam_state);
+
+			return QDF_STATUS_SUCCESS;
+		}
+
 		break;
 	default:
 		return QDF_STATUS_SUCCESS;
@@ -18668,7 +18696,6 @@ csr_roam_switch_to_rso_start(struct mac_context *mac, uint8_t vdev_id,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	control_bitmap = mlme_get_operations_bitmap(mac->psoc, vdev_id);
 	if (control_bitmap) {
 		sme_debug("ROAM: RSO Disabled internaly: vdev[%d] bitmap[0x%x]",
 			  vdev_id, control_bitmap);
@@ -18686,10 +18713,9 @@ csr_roam_switch_to_rso_start(struct mac_context *mac, uint8_t vdev_id,
 	 * If supplicant disabled roaming, driver does not send
 	 * RSO cmd to fw. This causes roam invoke to fail in FW
 	 * since RSO start never happened at least once to
-	 * configure roaming engine in FW.
+	 * configure roaming engine in FW. So send RSO start followed
+	 * by RSO stop if supplicant disabled roaming is true.
 	 */
-	sup_disabled_roaming = mlme_get_supplicant_disabled_roaming(mac->psoc,
-								    vdev_id);
 	if (!sup_disabled_roaming)
 		return QDF_STATUS_SUCCESS;
 
@@ -18708,6 +18734,8 @@ csr_roam_switch_to_rso_stop(struct mac_context *mac, uint8_t vdev_id,
 	cur_state = mlme_get_roam_state(mac->psoc, vdev_id);
 	switch (cur_state) {
 	case WLAN_ROAM_RSO_ENABLED:
+	case WLAN_ROAMING_IN_PROG:
+	case WLAN_ROAM_SYNCH_IN_PROG:
 		status = csr_post_rso_stop(mac, vdev_id, reason);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			sme_err("ROAM: Unable to switch to RSO STOP State");
@@ -18738,7 +18766,13 @@ csr_roam_switch_to_deinit(struct mac_context *mac, uint8_t vdev_id,
 	enum roam_offload_state cur_state = mlme_get_roam_state(mac->psoc,
 								vdev_id);
 	switch (cur_state) {
+	/*
+	 * If RSO stop is not done already, send RSO stop first and
+	 * then post deinit.
+	 */
 	case WLAN_ROAM_RSO_ENABLED:
+	case WLAN_ROAMING_IN_PROG:
+	case WLAN_ROAM_SYNCH_IN_PROG:
 		csr_roam_switch_to_rso_stop(mac, vdev_id, reason);
 		break;
 	case WLAN_ROAM_RSO_STOPPED:
@@ -18766,6 +18800,87 @@ csr_roam_switch_to_deinit(struct mac_context *mac, uint8_t vdev_id,
 	return QDF_STATUS_SUCCESS;
 }
 
+static QDF_STATUS
+csr_roam_switch_to_roam_start(struct mac_context *mac, uint8_t vdev_id,
+			      uint8_t reason)
+{
+	enum roam_offload_state cur_state =
+				mlme_get_roam_state(mac->psoc, vdev_id);
+	switch (cur_state) {
+	case WLAN_ROAM_RSO_ENABLED:
+		mlme_set_roam_state(mac->psoc, vdev_id, WLAN_ROAMING_IN_PROG);
+		break;
+
+	case WLAN_ROAM_RSO_STOPPED:
+		/*
+		 * When supplicant has disabled roaming, roam invoke triggered
+		 * from supplicant can cause firmware to send roam start
+		 * notification. Allow roam start in this condition.
+		 */
+		if (mlme_get_supplicant_disabled_roaming(mac->psoc, vdev_id) &&
+		    mlme_is_roam_invoke_in_progress(mac->psoc, vdev_id)) {
+			mlme_set_roam_state(mac->psoc, vdev_id,
+					    WLAN_ROAMING_IN_PROG);
+			break;
+		}
+	case WLAN_ROAM_INIT:
+	case WLAN_ROAM_DEINIT:
+	case WLAN_ROAM_SYNCH_IN_PROG:
+	default:
+		sme_err("ROAM: Roaming start received in invalid state: %d",
+			cur_state);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+static QDF_STATUS
+csr_roam_switch_to_roam_sync(struct mac_context *mac, uint8_t vdev_id,
+			     uint8_t reason)
+{
+	enum roam_offload_state cur_state = mlme_get_roam_state(mac->psoc,
+								vdev_id);
+	switch (cur_state) {
+	case WLAN_ROAM_RSO_ENABLED:
+		/*
+		 * Roam synch can come directly without roam start
+		 * after waking up from power save mode or in case of
+		 * deauth roam trigger to stop data path queues
+		 */
+	case WLAN_ROAMING_IN_PROG:
+		if (!CSR_IS_ROAM_JOINED(mac, vdev_id)) {
+			sme_err("ROAM: STA not in connected state");
+			return QDF_STATUS_E_FAILURE;
+		}
+
+		mlme_set_roam_state(mac->psoc, vdev_id,
+				    WLAN_ROAM_SYNCH_IN_PROG);
+		break;
+	case WLAN_ROAM_RSO_STOPPED:
+		/*
+		 * If roaming is disabled by Supplicant and if this transition
+		 * is due to roaming invoked by the supplicant, then allow
+		 * this state transition
+		 */
+		if (mlme_get_supplicant_disabled_roaming(mac->psoc, vdev_id) &&
+		    mlme_is_roam_invoke_in_progress(mac->psoc, vdev_id)) {
+			mlme_set_roam_state(mac->psoc, vdev_id,
+					    WLAN_ROAM_SYNCH_IN_PROG);
+			break;
+		}
+	case WLAN_ROAM_INIT:
+	case WLAN_ROAM_DEINIT:
+	case WLAN_ROAM_SYNCH_IN_PROG:
+	default:
+		sme_err("ROAM: Roam synch not allowed in [%d] state",
+			cur_state);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
 static QDF_STATUS
 csr_handle_roam_state_change(struct mac_context *mac, uint8_t vdev_id,
 			     enum roam_offload_state requested_state,
@@ -18789,13 +18904,21 @@ csr_handle_roam_state_change(struct mac_context *mac, uint8_t vdev_id,
 						 reason);
 		break;
 	case WLAN_ROAM_RSO_ENABLED:
-		status = csr_roam_switch_to_rso_start(mac, vdev_id,
-						      reason);
+		status = csr_roam_switch_to_rso_enable(mac, vdev_id,
+						       reason);
 		break;
 	case WLAN_ROAM_RSO_STOPPED:
 		status = csr_roam_switch_to_rso_stop(mac, vdev_id,
 						     reason);
 		break;
+	case WLAN_ROAMING_IN_PROG:
+		status = csr_roam_switch_to_roam_start(mac, vdev_id,
+						       reason);
+		break;
+	case WLAN_ROAM_SYNCH_IN_PROG:
+		status = csr_roam_switch_to_roam_sync(mac, vdev_id,
+						      reason);
+		break;
 	default:
 		sme_debug("ROAM: Invalid roam state %d", requested_state);
 		break;
@@ -20828,9 +20951,11 @@ csr_check_and_set_sae_single_pmk_cap(struct mac_context *mac_ctx,
 #define IS_ROAM_REASON_STA_KICKOUT(reason) ((reason & 0xF) == \
 	WMI_ROAM_TRIGGER_REASON_STA_KICKOUT)
 
-static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
-		struct roam_offload_synch_ind *roam_synch_data,
-		struct bss_description *bss_desc, enum sir_roam_op_code reason)
+static QDF_STATUS
+csr_process_roam_sync_callback(struct mac_context *mac_ctx,
+			       struct roam_offload_synch_ind *roam_synch_data,
+			       struct bss_description *bss_desc,
+			       enum sir_roam_op_code reason)
 {
 	uint8_t session_id = roam_synch_data->roamed_vdev_id;
 	struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
@@ -20876,8 +21001,8 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		goto end;
 	}
 
-	sme_debug("LFR3: reason: %d roaming in progress %d, source %d", reason,
-		  vdev_roam_params->roam_invoke_in_progress,
+	sme_debug("LFR3: reason: %d roam invoke in progress %d, source %d",
+		  reason, vdev_roam_params->roam_invoke_in_progress,
 		  vdev_roam_params->source);
 
 	switch (reason) {
@@ -20888,20 +21013,31 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		 */
 		csr_roam_roaming_offload_timer_action(mac_ctx,
 				0, session_id, ROAMING_OFFLOAD_TIMER_STOP);
-		if (session->discon_in_progress ||
-		    (MLME_IS_ROAM_STATE_STOPPED(mac_ctx->psoc, session_id) &&
-		    !vdev_roam_params->roam_invoke_in_progress) ||
-		    !CSR_IS_ROAM_JOINED(mac_ctx, session_id)) {
-			QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
-				FL("LFR3: Session not in connected state or disconnect is in progress %d"),
-				session->discon_in_progress);
+
+		if (session->discon_in_progress) {
+			sme_err("LFR3: vdev:%d Disconnect is in progress roam_synch is not allowed",
+				session_id);
 			status = QDF_STATUS_E_FAILURE;
 			goto end;
 		}
+
+		status = csr_post_roam_state_change(mac_ctx, session_id,
+						    WLAN_ROAM_SYNCH_IN_PROG,
+						    REASON_ROAM_HANDOFF_DONE);
+		if (QDF_IS_STATUS_ERROR(status))
+			goto end;
+
 		csr_roam_call_callback(mac_ctx, session_id, NULL, 0,
 				eCSR_ROAM_FT_START, eCSR_ROAM_RESULT_SUCCESS);
 		goto end;
 	case SIR_ROAMING_START:
+		status = csr_post_roam_state_change(
+					mac_ctx, session_id,
+					WLAN_ROAMING_IN_PROG,
+					REASON_ROAM_CANDIDATE_FOUND);
+		if (QDF_IS_STATUS_ERROR(status))
+			goto end;
+
 		csr_roam_roaming_offload_timer_action(mac_ctx,
 				CSR_ROAMING_OFFLOAD_TIMEOUT_PERIOD, session_id,
 				ROAMING_OFFLOAD_TIMER_START);
@@ -20934,6 +21070,16 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 				session_id, scan_id, false);
 		goto end;
 	case SIR_ROAMING_ABORT:
+		/*
+		 * Roaming abort is received after roaming is started
+		 * in firmware(after candidate selection) but re-assoc to
+		 * the candidate was not successful.
+		 * Connection to the previous AP is still valid in this
+		 * case. So move to RSO_ENABLED state.
+		 */
+		csr_post_roam_state_change(mac_ctx, session_id,
+					   WLAN_ROAM_RSO_ENABLED,
+					   REASON_ROAM_ABORT);
 		csr_roam_roaming_offload_timer_action(mac_ctx,
 				0, session_id, ROAMING_OFFLOAD_TIMER_STOP);
 		csr_roam_call_callback(mac_ctx, session_id, NULL, 0,
@@ -20995,7 +21141,6 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 			roam_synch_data->hw_mode_trans_ind.vdev_mac_map,
 			mac_ctx->psoc);
 		mac_ctx->sme.set_connection_info_cb(false);
-		session->roam_synch_in_progress = false;
 
 		csr_check_and_set_sae_single_pmk_cap(mac_ctx, session,
 						     session_id);
@@ -21012,15 +21157,25 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		}
 
 		policy_mgr_check_n_start_opportunistic_timer(mac_ctx->psoc);
-		csr_roam_call_callback(mac_ctx, session_id, NULL, 0,
-				       eCSR_ROAM_SYNCH_COMPLETE,
-				       eCSR_ROAM_RESULT_SUCCESS);
 		policy_mgr_check_concurrent_intf_and_restart_sap(mac_ctx->psoc);
-		if (roam_synch_data->authStatus ==
-		    CSR_ROAM_AUTH_STATUS_AUTHENTICATED)
-			csr_roam_update_cfg(mac_ctx, session_id,
-					    REASON_CONNECT);
 		vdev_roam_params->roam_invoke_in_progress = false;
+
+		if (roam_synch_data->authStatus ==
+		    CSR_ROAM_AUTH_STATUS_AUTHENTICATED) {
+			csr_post_roam_state_change(mac_ctx, session_id,
+						   WLAN_ROAM_RSO_ENABLED,
+						   REASON_CONNECT);
+		} else {
+			/*
+			 * STA is just in associated state here, RSO
+			 * enable will be sent once EAP & EAPOL will be done by
+			 * user-space and after set key response
+			 * is received.
+			 */
+			csr_post_roam_state_change(mac_ctx, session_id,
+						   WLAN_ROAM_INIT,
+						   REASON_CONNECT);
+		}
 		goto end;
 	case SIR_ROAMING_DEAUTH:
 		csr_roam_roaming_offload_timer_action(
@@ -21030,13 +21185,11 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
-	session->roam_synch_in_progress = true;
 	session->roam_synch_data = roam_synch_data;
 	status = csr_get_parsed_bss_description_ies(
 			mac_ctx, bss_desc, &ies_local);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		sme_err("LFR3: fail to parse IEs");
-		session->roam_synch_in_progress = false;
 		goto end;
 	}
 
@@ -21064,7 +21217,6 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 					SCAN_ENTRY_CON_STATE_NONE);
 	roam_info = qdf_mem_malloc(sizeof(struct csr_roam_info));
 	if (!roam_info) {
-		session->roam_synch_in_progress = false;
 		qdf_mem_free(ies_local);
 		status = QDF_STATUS_E_NOMEM;
 		goto end;
@@ -21102,11 +21254,8 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	 *      with AP after this point and sends new keys to the driver.
 	 *      Driver starts wait_for_key timer for that purpose.
 	 */
-	if (roam_synch_data->authStatus
-				== CSR_ROAM_AUTH_STATUS_AUTHENTICATED) {
-		QDF_TRACE(QDF_MODULE_ID_SME,
-				QDF_TRACE_LEVEL_DEBUG,
-				FL("LFR3:Don't start waitforkey timer"));
+	if (roam_synch_data->authStatus == CSR_ROAM_AUTH_STATUS_AUTHENTICATED) {
+		sme_debug("LFR3:Don't start waitforkey timer");
 		csr_roam_substate_change(mac_ctx,
 				eCSR_ROAM_SUBSTATE_NONE, session_id);
 		/*
@@ -21210,7 +21359,6 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	roam_info->pbFrames = qdf_mem_malloc(roam_info->nBeaconLength +
 		roam_info->nAssocReqLength + roam_info->nAssocRspLength);
 	if (!roam_info->pbFrames) {
-		session->roam_synch_in_progress = false;
 		if (roam_info)
 			qdf_mem_free(roam_info);
 		qdf_mem_free(ies_local);
@@ -21229,11 +21377,8 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 			SIR_MAC_HDR_LEN_3A,
 			roam_info->nAssocRspLength);
 
-	QDF_TRACE(QDF_MODULE_ID_SME,
-			QDF_TRACE_LEVEL_DEBUG,
-			FL("LFR3:Clear Connected info"));
-	csr_roam_free_connected_info(mac_ctx,
-			&session->connectedInfo);
+	sme_debug("LFR3:Clear Connected info");
+	csr_roam_free_connected_info(mac_ctx, &session->connectedInfo);
 	len = roam_synch_data->join_rsp->parsedRicRspLen;
 
 #ifdef FEATURE_WLAN_ESE
@@ -21370,7 +21515,6 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	}
 
 	session->fRoaming = false;
-	session->roam_synch_in_progress = false;
 	sme_free_join_rsp_fils_params(roam_info);
 	qdf_mem_free(roam_info->pbFrames);
 	qdf_mem_free(roam_info);

+ 29 - 42
core/sme/src/csr/csr_neighbor_roam.c

@@ -872,47 +872,36 @@ static void csr_neighbor_roam_info_ctx_init(struct mac_context *mac,
 		csr_neighbor_roam_purge_preauth_failed_list(mac);
 	}
 
-	if (csr_roam_is_roam_offload_scan_enabled(mac)) {
-		/*
-		 * Store the current PMK info of the AP
-		 * to the single pmk global cache if the BSS allows
-		 * single pmk roaming capable.
-		 */
-		csr_store_sae_single_pmk_to_global_cache(mac, session,
-							 session_id);
-
-		/*
-		 * If this is not a INFRA type BSS, then do not send the command
-		 * down to firmware.Do not send the START command for
-		 * other session connections.
-		 */
-		if (!csr_roam_is_sta_mode(mac, session_id)) {
-			QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
-				"Wrong Mode %d",
-				session->connectedProfile.BSSType);
-			return;
-		}
-		ngbr_roam_info->uOsRequestedHandoff = 0;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-		if (session->roam_synch_in_progress) {
-			if (mac->roam.pReassocResp) {
-				qdf_mem_free(mac->roam.pReassocResp);
-				mac->roam.pReassocResp = NULL;
-			}
-		} else
-#endif
-		{
-			csr_post_roam_state_change(mac, session_id,
-						   WLAN_ROAM_RSO_ENABLED,
-						   REASON_CTX_INIT);
+	if (!csr_roam_is_roam_offload_scan_enabled(mac))
+		return;
+	/*
+	 * Store the current PMK info of the AP
+	 * to the single pmk global cache if the BSS allows
+	 * single pmk roaming capable.
+	 */
+	csr_store_sae_single_pmk_to_global_cache(mac, session,
+						 session_id);
 
-		}
+	/*
+	 * If this is not a INFRA type BSS, then do not send the command
+	 * down to firmware.Do not send the START command for
+	 * other session connections.
+	 */
+	if (!csr_roam_is_sta_mode(mac, session_id)) {
+		sme_debug("Wrong Mode %d", session->connectedProfile.BSSType);
+		return;
 	}
+
+	ngbr_roam_info->uOsRequestedHandoff = 0;
+	if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac->psoc, session_id))
+		csr_post_roam_state_change(mac, session_id,
+					   WLAN_ROAM_RSO_ENABLED,
+					   REASON_CTX_INIT);
 }
 
 /**
- * csr_neighbor_roam_indicate_connect()
- * @mac: mac context
+* csr_neighbor_roam_indicate_connect()
+* @mac: mac context
  * @session_id: Session Id
  * @qdf_status: QDF status
  *
@@ -961,22 +950,20 @@ QDF_STATUS csr_neighbor_roam_indicate_connect(
 		return QDF_STATUS_SUCCESS;
 	}
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (session->roam_synch_in_progress &&
-		(eSIR_ROAM_AUTH_STATUS_AUTHENTICATED ==
-		session->roam_synch_data->authStatus)) {
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac->psoc, session_id) &&
+	    eSIR_ROAM_AUTH_STATUS_AUTHENTICATED ==
+	     session->roam_synch_data->authStatus) {
 		sme_debug("LFR3: Authenticated");
 		roam_info = qdf_mem_malloc(sizeof(*roam_info));
 		if (!roam_info)
 			return QDF_STATUS_E_NOMEM;
 		qdf_copy_macaddr(&roam_info->peerMac,
 				 &session->connectedProfile.bssid);
-		roam_info->roamSynchInProgress =
-			session->roam_synch_in_progress;
 		csr_roam_call_callback(mac, session_id, roam_info, 0,
 				       eCSR_ROAM_SET_KEY_COMPLETE,
 				       eCSR_ROAM_RESULT_AUTHENTICATED);
 		csr_neighbor_roam_reset_init_state_control_info(mac,
-			session_id);
+								session_id);
 		csr_neighbor_roam_info_ctx_init(mac, session_id);
 		qdf_mem_free(roam_info);
 		return status;

+ 2 - 2
core/sme/src/qos/sme_qos.c

@@ -3774,7 +3774,7 @@ QDF_STATUS sme_qos_process_ft_reassoc_rsp_ev(struct mac_context *mac_ctx,
 				 csr_conn_info->nAssocRspLength));
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (!csr_session->roam_synch_in_progress) {
+	if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac_ctx->psoc, sessionid)) {
 #endif
 		for (ac = QCA_WLAN_AC_BE; ac < QCA_WLAN_AC_ALL; ac++) {
 			ac_info = &qos_session->ac_info[ac];
@@ -4727,7 +4727,7 @@ static bool sme_qos_ft_handoff_required(struct mac_context *mac,
 	csr_roam_session = CSR_GET_SESSION(mac, session_id);
 
 	if (csr_roam_session &&
-	    csr_roam_session->roam_synch_in_progress &&
+	    MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac->psoc, session_id) &&
 	    csr_roam_is_ese_assoc(mac, session_id) &&
 	    csr_roam_session->connectedInfo.nTspecIeLength)
 		return true;

+ 3 - 6
core/wma/inc/wma.h

@@ -721,7 +721,6 @@ struct wma_txrx_node {
 	uint32_t nwType;
 	tSetStaKeyParams *staKeyParams;
 	uint32_t peer_count;
-	bool roam_synch_in_progress;
 	void *plink_status_req;
 	void *psnr_req;
 	uint8_t delay_before_vdev_stop;
@@ -1649,11 +1648,10 @@ void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
 		struct set_ie_param *ie_params);
 
 QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *mac_addr,
-			   uint8_t vdev_id, bool roam_synch_in_progress);
+			   uint8_t vdev_id);
 
 QDF_STATUS wma_create_peer(tp_wma_handle wma, uint8_t peer_addr[6],
-			   u_int32_t peer_type, u_int8_t vdev_id,
-			   bool roam_synch_in_progress);
+			   u_int32_t peer_type, u_int8_t vdev_id);
 
 QDF_STATUS wma_peer_unmap_conf_cb(uint8_t vdev_id,
 				  uint32_t peer_id_cnt,
@@ -2409,8 +2407,7 @@ int wma_motion_det_base_line_host_event_handler(void *handle, u_int8_t *event,
  *
  * Return: 0 on success, else error on failure
  */
-QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid,
-				bool roam_sync);
+QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid);
 
 /**
  * wma_send_vdev_stop() - WMA api to send vdev stop to fw

+ 2 - 14
core/wma/inc/wma_internal.h

@@ -615,17 +615,6 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id);
-static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
-		uint8_t vdev_id)
-{
-	return wma->interfaces[vdev_id].roam_synch_in_progress;
-}
-#else
-static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma,
-		uint8_t vdev_id)
-{
-	return false;
-}
 #endif
 
 /*
@@ -687,15 +676,14 @@ QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
 				uint32_t param_id, uint32_t param_value);
 
 QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *mac_addr,
-			   uint8_t vdev_id, bool roam_synch_in_progress);
+			   uint8_t vdev_id);
 
 QDF_STATUS wma_peer_unmap_conf_send(tp_wma_handle wma,
 				    struct send_peer_unmap_conf_params *msg);
 
 QDF_STATUS wma_create_peer(tp_wma_handle wma,
 			   uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
-			   uint32_t peer_type, uint8_t vdev_id,
-			   bool roam_synch_in_progress);
+			   uint32_t peer_type, uint8_t vdev_id);
 
 /**
  * wma_send_del_bss_response() - send delete bss resp

+ 44 - 50
core/wma/src/wma_dev_if.c

@@ -521,7 +521,7 @@ static QDF_STATUS wma_self_peer_remove(tp_wma_handle wma_handle,
 		  del_vdev_req->self_mac_addr);
 
 	qdf_status = wma_remove_peer(wma_handle, del_vdev_req->self_mac_addr,
-				     vdev_id, false);
+				     vdev_id);
 	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("wma_remove_peer is failed");
 		goto error;
@@ -1546,12 +1546,11 @@ bool wma_objmgr_peer_exist(tp_wma_handle wma,
  * @wma: wma handle
  * @mac_addr: peer mac address, to be removed
  * @vdev_id: vdev id
- * @roam_synch_in_progress: roam in progress flag
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *mac_addr,
-			   uint8_t vdev_id, bool roam_synch_in_progress)
+			   uint8_t vdev_id)
 {
 #define PEER_ALL_TID_BITMASK 0xffffffff
 	uint32_t peer_tid_bitmap = PEER_ALL_TID_BITMASK;
@@ -1563,6 +1562,7 @@ QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *mac_addr,
 	uint32_t bitmap = 1 << CDP_PEER_DELETE_NO_SPECIAL;
 	bool peer_unmap_conf_support_enabled;
 	uint8_t peer_vdev_id;
+	bool roam_synch_in_progress = false;
 
 	if (!wma->interfaces[vdev_id].peer_count) {
 		WMA_LOGE("%s: Can't remove peer with peer_addr %pM vdevid %d peer_count %d",
@@ -1596,8 +1596,11 @@ QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *mac_addr,
 
 	cdp_peer_teardown(soc, vdev_id, peer_addr);
 
-	if (roam_synch_in_progress)
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id)) {
+		roam_synch_in_progress = true;
 		goto peer_detach;
+	}
+
 	/* Flush all TIDs except MGMT TID for this peer in Target */
 	peer_tid_bitmap &= ~(0x1 << WMI_MGMT_TID);
 	param.peer_tid_bitmap = peer_tid_bitmap;
@@ -1639,10 +1642,9 @@ peer_detach:
 					     bitmap);
 		}
 	} else {
-		if (roam_synch_in_progress) {
-			wma_debug("LFR3: normal peer delete for peer %pM",
-				 peer_addr);
-		}
+		if (roam_synch_in_progress)
+			wma_debug("LFR3: Delete the peer %pM", peer_addr);
+
 		if (peer_unmap_conf_support_enabled)
 			cdp_peer_delete_sync(soc, vdev_id, peer_addr,
 					     wma_peer_unmap_conf_cb,
@@ -1773,14 +1775,12 @@ static struct wlan_objmgr_peer *wma_create_objmgr_peer(tp_wma_handle wma,
  * @peer_addr: peer mac addr
  * @peer_type: peer type
  * @vdev_id: vdev id
- * @roam_synch_in_progress: roam in progress
  *
  * Return: QDF status
  */
 QDF_STATUS wma_create_peer(tp_wma_handle wma,
 			   uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
-			   uint32_t peer_type, uint8_t vdev_id,
-			   bool roam_synch_in_progress)
+			   uint32_t peer_type, uint8_t vdev_id)
 {
 	struct peer_create_params param = {0};
 	uint8_t *mac_addr_raw;
@@ -1838,7 +1838,7 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma,
 	if (peer_type == WMI_PEER_TYPE_TDLS)
 		cdp_peer_set_peer_as_tdls(dp_soc, vdev_id, peer_addr, true);
 
-	if (roam_synch_in_progress) {
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id)) {
 		wma_debug("LFR3: Created peer %pM vdev_id %d, peer_count %d",
 			 peer_addr, vdev_id,
 			 wma->interfaces[vdev_id].peer_count);
@@ -1927,7 +1927,7 @@ static int wma_remove_bss_peer(tp_wma_handle wma, uint32_t vdev_id,
 		mac_addr = bssid.bytes;
 	}
 
-	qdf_status = wma_remove_peer(wma, mac_addr, vdev_id, false);
+	qdf_status = wma_remove_peer(wma, mac_addr, vdev_id);
 
 	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		WMA_LOGE(FL("wma_remove_peer failed vdev_id:%d"), vdev_id);
@@ -2383,7 +2383,7 @@ QDF_STATUS wma_vdev_self_peer_create(struct vdev_mlme_obj *vdev_mlme)
 		status = wma_create_peer(wma_handle,
 					 vdev->vdev_mlme.macaddr,
 					 WMI_PEER_TYPE_DEFAULT,
-					 wlan_vdev_get_id(vdev), false);
+					 wlan_vdev_get_id(vdev));
 		if (QDF_IS_STATUS_ERROR(status))
 			wma_err("Failed to create peer %d", status);
 	} else if (vdev_mlme->mgmt.generic.type == WMI_VDEV_TYPE_STA) {
@@ -3395,7 +3395,7 @@ QDF_STATUS wma_pre_vdev_start_setup(uint8_t vdev_id,
 		mac_addr = wlan_vdev_mlme_get_macaddr(iface->vdev);
 
 	status = wma_create_peer(wma, mac_addr,
-				 WMI_PEER_TYPE_DEFAULT, vdev_id, false);
+				 WMI_PEER_TYPE_DEFAULT, vdev_id);
 	if (status != QDF_STATUS_SUCCESS) {
 		wma_err("Failed to create peer");
 		return status;
@@ -3669,8 +3669,7 @@ QDF_STATUS wma_add_bss_lfr2_vdev_start(struct wlan_objmgr_vdev *vdev,
 
 peer_cleanup:
 	if (peer_exist)
-		wma_remove_peer(wma, mlme_obj->mgmt.generic.bssid, vdev_id,
-				false);
+		wma_remove_peer(wma, mlme_obj->mgmt.generic.bssid, vdev_id);
 
 send_fail_resp:
 	wma_send_add_bss_resp(wma, vdev_id, QDF_STATUS_E_FAILURE);
@@ -3810,7 +3809,7 @@ QDF_STATUS wma_send_peer_assoc_req(struct bss_params *add_bss)
 
 peer_cleanup:
 	if (peer_exist)
-		wma_remove_peer(wma, add_bss->bssId, vdev_id, false);
+		wma_remove_peer(wma, add_bss->bssId, vdev_id);
 send_resp:
 	wma_send_add_bss_resp(wma, vdev_id, status);
 
@@ -3856,8 +3855,7 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 
 	if (cdp_find_peer_exist_on_vdev(soc, add_sta->smesessionId,
 					add_sta->staMac)) {
-		wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId,
-				false);
+		wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId);
 		WMA_LOGE("%s: Peer already exists, Deleted peer with peer_addr %pM",
 			__func__, add_sta->staMac);
 	}
@@ -3877,7 +3875,7 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	wma_delete_invalid_peer_entries(add_sta->smesessionId, add_sta->staMac);
 
 	status = wma_create_peer(wma, add_sta->staMac, WMI_PEER_TYPE_DEFAULT,
-				 add_sta->smesessionId, false);
+				 add_sta->smesessionId);
 	if (status != QDF_STATUS_SUCCESS) {
 		WMA_LOGE("%s: Failed to create peer for %pM",
 			 __func__, add_sta->staMac);
@@ -3890,8 +3888,7 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 		WMA_LOGE("%s: Failed to find peer handle using peer mac %pM",
 			 __func__, add_sta->staMac);
 		add_sta->status = QDF_STATUS_E_FAILURE;
-		wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId,
-				false);
+		wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId);
 		goto send_rsp;
 	}
 
@@ -3947,7 +3944,7 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 			wma_remove_req(wma, add_sta->smesessionId,
 				       WMA_PEER_ASSOC_CNF_START);
 			wma_remove_peer(wma, add_sta->staMac,
-					add_sta->smesessionId, false);
+					add_sta->smesessionId);
 			peer_assoc_cnf = false;
 			goto send_rsp;
 		}
@@ -3958,8 +3955,7 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	ret = wma_send_peer_assoc(wma, add_sta->nwType, add_sta);
 	if (ret) {
 		add_sta->status = QDF_STATUS_E_FAILURE;
-		wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId,
-				false);
+		wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId);
 		goto send_rsp;
 	}
 
@@ -3975,7 +3971,7 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 				 add_sta->staMac);
 			add_sta->status = QDF_STATUS_E_FAILURE;
 			wma_remove_peer(wma, add_sta->staMac,
-					add_sta->smesessionId, false);
+					add_sta->smesessionId);
 			goto send_rsp;
 		}
 	}
@@ -4023,7 +4019,7 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 		 add_sta->staType,
 		 add_sta->updateSta, add_sta->bssId, add_sta->staMac);
 
-	if (wma_is_roam_synch_in_progress(wma, add_sta->smesessionId) ||
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, add_sta->smesessionId) ||
 	    wma_is_roam_in_progress(add_sta->smesessionId)) {
 		WMA_LOGE("%s: roaming in progress, reject add sta!", __func__);
 		add_sta->status = QDF_STATUS_E_PERM;
@@ -4041,7 +4037,7 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 
 		status = wma_create_peer(wma, add_sta->staMac,
 					 WMI_PEER_TYPE_TDLS,
-					 add_sta->smesessionId, false);
+					 add_sta->smesessionId);
 		if (status != QDF_STATUS_SUCCESS) {
 			WMA_LOGE("%s: Failed to create peer for %pM",
 				 __func__, add_sta->staMac);
@@ -4078,7 +4074,7 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 				wma_remove_req(wma, add_sta->smesessionId,
 					       WMA_PEER_ASSOC_CNF_START);
 				wma_remove_peer(wma, add_sta->staMac,
-						add_sta->smesessionId, false);
+						add_sta->smesessionId);
 				peer_assoc_cnf = false;
 				goto send_rsp;
 			}
@@ -4095,7 +4091,7 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 		if (ret) {
 			add_sta->status = QDF_STATUS_E_FAILURE;
 			wma_remove_peer(wma, add_sta->staMac,
-					add_sta->smesessionId, false);
+					add_sta->smesessionId);
 			cdp_peer_add_last_real_peer(soc, pdev_id,
 						    add_sta->smesessionId);
 			wma_remove_req(wma, add_sta->smesessionId,
@@ -4225,7 +4221,8 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 					      OL_TXRX_PEER_STATE_CONN);
 		}
 
-		if (wma_is_roam_synch_in_progress(wma, params->smesessionId)) {
+		if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc,
+						   params->smesessionId)) {
 			/* iface->nss = params->nss; */
 			/*In LFR2.0, the following operations are performed as
 			 * part of wma_send_peer_assoc. As we are
@@ -4257,7 +4254,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 				wma_remove_req(wma, params->smesessionId,
 					       WMA_PEER_ASSOC_CNF_START);
 				wma_remove_peer(wma, params->bssId,
-						params->smesessionId, false);
+						params->smesessionId);
 				peer_assoc_cnf = false;
 				goto out;
 			}
@@ -4280,7 +4277,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 		if (ret) {
 			status = QDF_STATUS_E_FAILURE;
 			wma_remove_peer(wma, params->bssId,
-					params->smesessionId, false);
+					params->smesessionId);
 			goto out;
 		}
 
@@ -4390,7 +4387,7 @@ out:
 		  params->smesessionId, params->assocId,
 		  QDF_MAC_ADDR_ARRAY(params->bssId), params->status);
 	/* Don't send a response during roam sync operation */
-	if (!wma_is_roam_synch_in_progress(wma, params->smesessionId))
+	if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, params->smesessionId))
 		wma_send_msg_high_priority(wma, WMA_ADD_STA_RSP,
 					   (void *)params, 0);
 }
@@ -4409,7 +4406,7 @@ static void wma_delete_sta_req_ap_mode(tp_wma_handle wma,
 	QDF_STATUS qdf_status;
 
 	qdf_status = wma_remove_peer(wma, del_sta->staMac,
-				     del_sta->smesessionId, false);
+				     del_sta->smesessionId);
 	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		WMA_LOGE(FL("wma_remove_peer failed"));
 		del_sta->status = QDF_STATUS_E_FAILURE;
@@ -4467,7 +4464,7 @@ static void wma_del_tdls_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
 		goto send_del_rsp;
 	}
 
-	if (wma_is_roam_synch_in_progress(wma, del_sta->smesessionId)) {
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, del_sta->smesessionId)) {
 		WMA_LOGE("%s: roaming in progress, reject del sta!", __func__);
 		del_sta->status = QDF_STATUS_E_PERM;
 		qdf_mem_free(peer_state);
@@ -4543,7 +4540,7 @@ static void wma_delete_sta_req_sta_mode(tp_wma_handle wma,
 
 	iface = &wma->interfaces[params->smesessionId];
 	iface->uapsd_cached_val = 0;
-	if (wma_is_roam_synch_in_progress(wma, params->smesessionId))
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, params->smesessionId))
 		return;
 #ifdef FEATURE_WLAN_TDLS
 	if (STA_ENTRY_TDLS_PEER == params->staType) {
@@ -4633,9 +4630,9 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
 	switch (oper_mode) {
 	case BSS_OPERATIONAL_MODE_STA:
 		wma_delete_sta_req_sta_mode(wma, del_sta);
-		if (wma_is_roam_synch_in_progress(wma, smesession_id)) {
+		if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, smesession_id)) {
 			wma_debug("LFR3: Del STA on vdev_id %d",
-				 del_sta->smesessionId);
+				  del_sta->smesessionId);
 			qdf_mem_free(del_sta);
 			return;
 		}
@@ -4884,10 +4881,10 @@ void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id)
 		qdf_mem_free(roam_scan_stats_req);
 	}
 
-	if (wma_is_roam_synch_in_progress(wma, vdev_id)) {
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id)) {
 		roam_synch_in_progress = true;
-		wma_debug("LFR3: Setting vdev_up to FALSE for session %d",
-			 vdev_id);
+		wma_debug("LFR3: Setting vdev_up to FALSE for vdev:%d",
+			  vdev_id);
 
 		goto detach_peer;
 	}
@@ -4930,9 +4927,8 @@ void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id)
 	return;
 
 detach_peer:
-	wma_remove_peer(wma, bssid.bytes, vdev_id,
-			roam_synch_in_progress);
-	if (wma_is_roam_synch_in_progress(wma, vdev_id))
+	wma_remove_peer(wma, bssid.bytes, vdev_id);
+	if (roam_synch_in_progress)
 		return;
 
 out:
@@ -5093,8 +5089,7 @@ QDF_STATUS wma_set_wlm_latency_level(void *wma_ptr,
 	return ret;
 }
 
-QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid,
-				bool roam_synch)
+QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid)
 {
 	tp_wma_handle wma;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
@@ -5105,8 +5100,7 @@ QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid,
 		goto err;
 	}
 
-	status = wma_create_peer(wma, bssid, WMI_PEER_TYPE_DEFAULT,
-				 vdev_id, roam_synch);
+	status = wma_create_peer(wma, bssid, WMI_PEER_TYPE_DEFAULT, vdev_id);
 err:
 	return status;
 }

+ 7 - 7
core/wma/src/wma_features.c

@@ -1165,10 +1165,10 @@ int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len)
 	if (!csa_offload_event)
 		return -EINVAL;
 
-	if (wma->interfaces[vdev_id].roaming_in_progress ||
-		wma->interfaces[vdev_id].roam_synch_in_progress) {
-		WMA_LOGE("Roaming in progress for vdev %d, ignore csa_offload_event",
-				vdev_id);
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id) ||
+	    wma->interfaces[vdev_id].roaming_in_progress) {
+		WMA_LOGE("Roaming in progress for vdev %d, ignore csa event",
+			 vdev_id);
 		qdf_mem_free(csa_offload_event);
 		return -EINVAL;
 	}
@@ -3523,8 +3523,8 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
 		goto end_tdls_peer_state;
 	}
 
-	if (wma_is_roam_synch_in_progress(wma_handle,
-					  peer_state->vdev_id)) {
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma_handle->psoc,
+					   peer_state->vdev_id)) {
 		WMA_LOGE("%s: roaming in progress, reject peer update cmd!",
 			 __func__);
 		ret = -EPERM;
@@ -3586,7 +3586,7 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
 			 peer_state->vdev_id);
 		qdf_status = wma_remove_peer(wma_handle,
 					     peer_state->peer_macaddr,
-					     peer_state->vdev_id, false);
+					     peer_state->vdev_id);
 		if (QDF_IS_STATUS_ERROR(qdf_status)) {
 			WMA_LOGE(FL("wma_remove_peer failed"));
 			ret = -EINVAL;

+ 3 - 5
core/wma/src/wma_nan_datapath.c

@@ -77,8 +77,7 @@ void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	}
 
 	status = wma_create_peer(wma, add_sta->staMac,
-				 WMI_PEER_TYPE_NAN_DATA, add_sta->smesessionId,
-				 false);
+				 WMI_PEER_TYPE_NAN_DATA, add_sta->smesessionId);
 	if (status != QDF_STATUS_SUCCESS) {
 		WMA_LOGE(FL("Failed to create peer for %pM"), add_sta->staMac);
 		add_sta->status = status;
@@ -90,8 +89,7 @@ void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 		WMA_LOGE(FL("Failed to find peer handle using peer mac %pM"),
 			 add_sta->staMac);
 		add_sta->status = QDF_STATUS_E_FAILURE;
-		wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId,
-				false);
+		wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId);
 		goto send_rsp;
 	}
 
@@ -119,7 +117,7 @@ void wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
 					tpDeleteStaParams del_sta)
 {
 	wma_remove_peer(wma, del_sta->staMac,
-			del_sta->smesessionId, false);
+			del_sta->smesessionId);
 	del_sta->status = QDF_STATUS_SUCCESS;
 
 	if (del_sta->respReqd) {

+ 57 - 45
core/wma/src/wma_scan_roam.c

@@ -1999,12 +1999,12 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle,
 		 * should go through to the firmware and receive HO_FAIL
 		 * and clean up.
 		 */
-		if (wma_is_roam_synch_in_progress(wma_handle,
-				roam_req->sessionId) &&
-				roam_req->reason ==
-				REASON_ROAM_STOP_ALL) {
-				wma_debug("Dont send RSO stop during roam sync");
-				break;
+		if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma_handle->psoc,
+						   roam_req->sessionId) &&
+		    roam_req->reason == REASON_ROAM_STOP_ALL) {
+			wma_info("vdev_id:%d : Drop RSO stop during roam sync",
+				 roam_req->sessionId);
+			break;
 		}
 
 		/*
@@ -2305,14 +2305,6 @@ void wma_process_roam_synch_fail(WMA_HANDLE handle,
 	wlan_roam_debug_log(synch_fail->session_id,
 			    DEBUG_ROAM_SYNCH_FAIL,
 			    DEBUG_INVALID_PEER_ID, NULL, NULL, 0, 0);
-
-	/* Hand Off Failure could happen as an exception, when a roam synch
-	 * indication is posted to Host, but a roam synch complete is not
-	 * posted to the firmware.So, clear the roam synch in progress
-	 * flag before disconnecting the session through this event.
-	 */
-	wma_handle->interfaces[synch_fail->session_id].roam_synch_in_progress =
-		false;
 }
 
 /**
@@ -2773,7 +2765,7 @@ wma_roam_update_vdev(tp_wma_handle wma,
 
 	wma_delete_sta(wma, del_sta_params);
 	wma_delete_bss(wma, vdev_id);
-	wma_add_bss_peer_sta(vdev_id, roam_synch_ind_ptr->bssid.bytes, true);
+	wma_add_bss_peer_sta(vdev_id, roam_synch_ind_ptr->bssid.bytes);
 	/* Update new peer's uc cipher */
 	wma_update_roamed_peer_unicast_cipher(wma, uc_cipher, cipher_cap,
 					      roam_synch_ind_ptr->bssid.bytes);
@@ -2907,9 +2899,9 @@ int wma_mlme_roam_synch_event_handler_cb(void *handle, uint8_t *event,
 		synch_event->vdev_id, QDF_TRACE_DEFAULT_PDEV_ID,
 		QDF_PROTO_TYPE_EVENT, QDF_ROAM_SYNCH));
 
-	if (wma_is_roam_synch_in_progress(wma, synch_event->vdev_id)) {
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, synch_event->vdev_id)) {
 		WMA_LOGE("%s: Ignoring RSI since one is already in progress",
-				__func__);
+			 __func__);
 		goto cleanup_label;
 	}
 
@@ -2982,8 +2974,6 @@ int wma_mlme_roam_synch_event_handler_cb(void *handle, uint8_t *event,
 	qdf_wake_lock_timeout_acquire(&wma->roam_ho_wl,
 				      WMA_ROAM_HO_WAKE_LOCK_DURATION);
 
-	wma->interfaces[synch_event->vdev_id].roam_synch_in_progress = true;
-
 	roam_synch_ind_ptr = qdf_mem_malloc(roam_synch_data_len);
 	if (!roam_synch_ind_ptr) {
 		QDF_ASSERT(roam_synch_ind_ptr);
@@ -3068,9 +3058,6 @@ cleanup_label:
 		qdf_mem_free(roam_synch_ind_ptr);
 	if (bss_desc_ptr)
 		qdf_mem_free(bss_desc_ptr);
-	if (wma && synch_event)
-		wma->interfaces[synch_event->vdev_id].roam_synch_in_progress =
-			false;
 
 	return status;
 }
@@ -3085,7 +3072,6 @@ int wma_roam_synch_frame_event_handler(void *handle, uint8_t *event,
 	struct wma_txrx_node *iface = NULL;
 	int status = -EINVAL;
 
-	wma_debug("LFR3:Synch Frame event");
 	if (!event) {
 		WMA_LOGE("event param null");
 		return status;
@@ -3128,18 +3114,17 @@ int wma_roam_synch_frame_event_handler(void *handle, uint8_t *event,
 	vdev_id = synch_frame_event->vdev_id;
 	iface = &wma->interfaces[vdev_id];
 
-	if (wma_is_roam_synch_in_progress(wma, vdev_id)) {
+	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id)) {
 		WMA_LOGE("Ignoring this event as it is unexpected");
 		wma_free_roam_synch_frame_ind(iface);
 		return status;
 	}
-	wma_debug("LFR3: Received ROAM_SYNCH_FRAME_EVENT");
 
-	wma_debug("synch frame payload: LEN bcn:%d, req:%d, rsp:%d morefrag: %d",
-		 synch_frame_event->bcn_probe_rsp_len,
-		 synch_frame_event->reassoc_req_len,
-		 synch_frame_event->reassoc_rsp_len,
-		 synch_frame_event->more_frag);
+	wma_debug("LFR3: Roam synch frame payload: LEN bcn:%d, req:%d, rsp:%d morefrag: %d",
+		  synch_frame_event->bcn_probe_rsp_len,
+		  synch_frame_event->reassoc_req_len,
+		  synch_frame_event->reassoc_rsp_len,
+		  synch_frame_event->more_frag);
 
 	if (synch_frame_event->bcn_probe_rsp_len) {
 		iface->roam_synch_frame_ind.bcn_probe_rsp_len =
@@ -4170,21 +4155,18 @@ void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id)
 		return;
 	}
 
-	if (!wma_is_vdev_valid(vdev_id)) {
-		WMA_LOGE("%s: Invalid vdev id:%d", __func__, vdev_id);
+	if (!wma_is_vdev_valid(vdev_id))
 		return;
-	}
 
 	if (wmi_unified_roam_synch_complete_cmd(wma_handle->wmi_handle,
-				 vdev_id)) {
+						vdev_id))
 		return;
-	}
 
 	DPTRACE(qdf_dp_trace_record_event(QDF_DP_TRACE_EVENT_RECORD,
 		vdev_id, QDF_TRACE_DEFAULT_PDEV_ID,
 		QDF_PROTO_TYPE_EVENT, QDF_ROAM_COMPLETE));
 
-	wma_info("LFR3: Posting WMA_ROAM_OFFLOAD_SYNCH_CNF");
+	wma_info("LFR3: vdev[%d] Sent ROAM_SYNCH_COMPLETE", vdev_id);
 	wlan_roam_debug_log(vdev_id, DEBUG_ROAM_SYNCH_CNF,
 			    DEBUG_INVALID_PEER_ID, NULL, NULL, 0, 0);
 
@@ -5948,11 +5930,12 @@ static void wma_invalid_roam_reason_handler(tp_wma_handle wma_handle,
 		return;
 
 	roam_synch_data->roamed_vdev_id = vdev_id;
-	wma_handle->pe_roam_synch_cb(wma_handle->mac_context, roam_synch_data,
-				     NULL, op_code);
+	if (notif != WMI_ROAM_NOTIF_ROAM_START)
+		wma_handle->pe_roam_synch_cb(wma_handle->mac_context,
+					     roam_synch_data, NULL, op_code);
+
 	wma_handle->csr_roam_synch_cb(wma_handle->mac_context, roam_synch_data,
 				      NULL, op_code);
-
 	qdf_mem_free(roam_synch_data);
 }
 
@@ -5963,6 +5946,36 @@ void wma_handle_roam_sync_timeout(tp_wma_handle wma_handle,
 					WMI_ROAM_NOTIF_ROAM_ABORT);
 }
 
+static char *wma_get_roam_event_reason_string(uint32_t reason)
+{
+	switch (reason) {
+	case WMI_ROAM_REASON_INVALID:
+		return "Default";
+	case WMI_ROAM_REASON_BETTER_AP:
+		return "Better AP";
+	case WMI_ROAM_REASON_BMISS:
+		return "BMISS";
+	case WMI_ROAM_REASON_LOW_RSSI:
+		return "Low Rssi";
+	case WMI_ROAM_REASON_SUITABLE_AP:
+		return "Suitable AP";
+	case WMI_ROAM_REASON_HO_FAILED:
+		return "Hand-off Failed";
+	case WMI_ROAM_REASON_INVOKE_ROAM_FAIL:
+		return "Roam Invoke failed";
+	case WMI_ROAM_REASON_RSO_STATUS:
+		return "RSO status";
+	case WMI_ROAM_REASON_BTM:
+		return "BTM";
+	case WMI_ROAM_REASON_DEAUTH:
+		return "Deauth";
+	default:
+		return "Invalid";
+	}
+
+	return "Invalid";
+}
+
 /**
  * wma_roam_event_callback() - roam event callback
  * @handle: wma handle
@@ -5992,10 +6005,6 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
 	}
 
 	wmi_event = param_buf->fixed_param;
-	wma_debug("Reason %x, Notif %x for vdevid %x, rssi %d",
-		 wmi_event->reason, wmi_event->notif,
-		 wmi_event->vdev_id, wmi_event->rssi);
-
 	if (wmi_event->vdev_id >= wma_handle->max_bssid) {
 		WMA_LOGE("Invalid vdev id from firmware");
 		return -EINVAL;
@@ -6010,6 +6019,11 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
 		wmi_event->vdev_id, QDF_TRACE_DEFAULT_PDEV_ID,
 		QDF_PROTO_TYPE_EVENT, QDF_ROAM_EVENTID));
 
+	wma_debug("FW_ROAM_EVT: Reason:%s[%d], Notif %x for vdevid %x, rssi %d",
+		  wma_get_roam_event_reason_string(wmi_event->reason),
+		  wmi_event->reason,
+		  wmi_event->notif, wmi_event->vdev_id, wmi_event->rssi);
+
 	switch (wmi_event->reason) {
 	case WMI_ROAM_REASON_BTM:
 		/*
@@ -6072,8 +6086,6 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
 		WMA_LOGE("mac addr to avoid %pM", bssid.bytes);
 		wma_handle_hw_mode_transition(wma_handle, param_buf);
 		wma_roam_ho_fail_handler(wma_handle, wmi_event->vdev_id, bssid);
-		wma_handle->interfaces[wmi_event->vdev_id].roaming_in_progress =
-								false;
 		break;
 #endif
 	case WMI_ROAM_REASON_INVALID:

+ 1 - 1
core/wma/src/wma_utils.c

@@ -4374,7 +4374,7 @@ void wma_remove_bss_peer_on_vdev_start_failure(tp_wma_handle wma,
 		return;
 	}
 
-	wma_remove_peer(wma, bss_peer.bytes, vdev_id, false);
+	wma_remove_peer(wma, bss_peer.bytes, vdev_id);
 }
 
 QDF_STATUS wma_sta_vdev_up_send(struct vdev_mlme_obj *vdev_mlme,