Forráskód Böngészése

qcacld-3.0: Move hdd callback events under connection manager macro

Move hdd callback events under connection manager macro.

Change-Id: I4563f26c94fdb5960be9bd02b4c07b4a38cb2f2a
CRs-Fixed: 2889620
gaurank kathpalia 4 éve
szülő
commit
2120b33aab

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

@@ -1277,6 +1277,7 @@ struct hdd_adapter {
 #ifndef FEATURE_CM_ENABLE
 	bool disconnection_in_progress;
 	qdf_mutex_t disconnection_status_lock;
+	struct completion roaming_comp_var;
 #endif
 	unsigned long event_flags;
 
@@ -1311,9 +1312,6 @@ struct hdd_adapter {
 	/* TODO: move these to sta ctx. These may not be used in AP */
 	/** completion variable for disconnect callback */
 	struct completion disconnect_comp_var;
-
-	struct completion roaming_comp_var;
-
 	/* completion variable for Linkup Event */
 	struct completion linkup_event_var;
 

+ 21 - 45
core/hdd/src/wlan_hdd_assoc.c

@@ -1226,8 +1226,6 @@ hdd_send_ft_assoc_response(struct net_device *dev,
 	qdf_mem_free(buff);
 }
 
-#endif
-
 /**
  * hdd_send_ft_event() - send fast transition event
  * @adapter: pointer to adapter
@@ -1334,8 +1332,6 @@ static void hdd_send_ft_event(struct hdd_adapter *adapter)
 	qdf_mem_free(buff);
 #endif
 }
-
-#ifndef FEATURE_CM_ENABLE
 #ifdef FEATURE_WLAN_ESE
 /**
  * hdd_send_new_ap_channel_info() - send new ap channel info
@@ -3563,6 +3559,7 @@ hdd_indicate_tsm_ie(struct hdd_adapter *adapter, uint8_t tid,
 	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
 }
 
+#ifndef FEATURE_CM_ENABLE
 /**
  * hdd_indicate_cckm_pre_auth() - send cckm preauth indication
  * @adapter: pointer to adapter
@@ -3612,6 +3609,7 @@ hdd_indicate_cckm_pre_auth(struct hdd_adapter *adapter,
 	/* send the event */
 	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
 }
+#endif
 
 /**
  * hdd_indicate_ese_adj_ap_rep_ind() - send adjacent AP report indication
@@ -3904,6 +3902,7 @@ hdd_indicate_ese_bcn_report_ind(const struct hdd_adapter *adapter,
 
 #endif /* FEATURE_WLAN_ESE */
 
+#ifndef FEATURE_CM_ENABLE
 /**
  * hdd_is_8021x_sha256_auth_type() - check authentication type to 8021x_sha256
  * @sta_ctx:	Station Context
@@ -3926,7 +3925,7 @@ hdd_is_8021x_sha256_auth_type(struct hdd_station_ctx *sta_ctx)
 	return false;
 }
 #endif
-
+#endif
 /*
  * hdd_roam_channel_switch_handler() - hdd channel switch handler
  * @adapter: Pointer to adapter context
@@ -4039,11 +4038,11 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 	QDF_STATUS qdf_ret_status = QDF_STATUS_SUCCESS;
 	struct hdd_adapter *adapter = context;
 	struct hdd_station_ctx *sta_ctx = NULL;
-	struct cfg80211_bss *bss_status;
 	struct hdd_context *hdd_ctx;
 
-	hdd_debug("CSR Callback: status=%d result=%d roamID=%d",
-		  roam_status, roam_result, roam_id);
+	hdd_debug("CSR Callback: status=%s (%d) result= %s (%d) roamID=%d",
+		  get_e_roam_cmd_status_str(roam_status), roam_status,
+		  get_e_csr_roam_result_str(roam_result), roam_result, roam_id);
 
 	/* Sanity check */
 	if ((!adapter) || (WLAN_HDD_ADAPTER_MAGIC != adapter->magic)) {
@@ -4058,6 +4057,7 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 				 adapter->vdev_id, roam_status));
 
 	switch (roam_status) {
+#ifndef FEATURE_CM_ENABLE
 	/*
 	 * We did pre-auth,then we attempted a 11r or ese reassoc.
 	 * reassoc failed due to failure, timeout, reject from ap
@@ -4068,17 +4068,14 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 		hdd_err("Reassoc Failed with roam_status: %d roam_result: %d SessionID: %d",
 			 roam_status, roam_result, adapter->vdev_id);
 		/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
 		qdf_ret_status =
 			hdd_dis_connect_handler(adapter, roam_info, roam_id,
 						roam_status, roam_result);
-#endif
 		sta_ctx->ft_carrier_on = false;
 		sta_ctx->hdd_reassoc_scenario = false;
 		hdd_debug("hdd_reassoc_scenario set to: %d, ReAssoc Failed, session: %d",
 			  sta_ctx->hdd_reassoc_scenario, adapter->vdev_id);
 		break;
-
 	case eCSR_ROAM_FT_START:
 		/*
 		 * When we roam for ESE and 11r, we dont want the OS to be
@@ -4147,12 +4144,10 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 		 */
 		hdd_disable_and_flush_mc_addr_list(adapter,
 			pmo_peer_disconnect);
-		/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
+
 		qdf_ret_status =
 			hdd_dis_connect_handler(adapter, roam_info, roam_id,
 						roam_status, roam_result);
-#endif
 	}
 	break;
 	case eCSR_ROAM_ASSOCIATION_COMPLETION:
@@ -4174,13 +4169,11 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 				  sta_ctx->hdd_reassoc_scenario,
 				  adapter->vdev_id);
 		}
-		/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
+
 		qdf_ret_status =
 			hdd_association_completion_handler(adapter, roam_info,
 							   roam_id, roam_status,
 							   roam_result);
-#endif
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 		if (roam_info)
 			roam_info->roamSynchInProgress = false;
@@ -4190,15 +4183,13 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 		hdd_debug("****eCSR_ROAM_CANCELLED****");
 		/* fallthrough */
 	case eCSR_ROAM_ASSOCIATION_FAILURE:
-		/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
 		qdf_ret_status = hdd_association_completion_handler(adapter,
 								    roam_info,
 								    roam_id,
 								    roam_status,
 								    roam_result);
-#endif
 		break;
+#endif /* ndef FEATURE_CM_ENABLE */
 	case eCSR_ROAM_MIC_ERROR_IND:
 		hdd_roam_mic_error_indication_handler(adapter, roam_info);
 		break;
@@ -4221,11 +4212,10 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 			roam_info->roamSynchInProgress = false;
 #endif
 		break;
-
+#ifndef FEATURE_CM_ENABLE
 	case eCSR_ROAM_FT_RESPONSE:
 		hdd_send_ft_event(adapter);
 		break;
-
 	case eCSR_ROAM_PMK_NOTIFY:
 		if (eCSR_AUTH_TYPE_RSN == sta_ctx->conn_info.auth_type
 				|| hdd_is_8021x_sha256_auth_type(sta_ctx)) {
@@ -4276,6 +4266,7 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 		}
 		break;
 #endif
+#endif /* ndef FEATURE_CM_ENABLE */
 #ifdef WLAN_FEATURE_11W
 	case eCSR_ROAM_UNPROT_MGMT_FRAME_IND:
 		if (roam_info)
@@ -4292,7 +4283,7 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 				    roam_info->tsm_ie.state,
 				    roam_info->tsm_ie.msmt_interval);
 		break;
-
+#ifndef FEATURE_CM_ENABLE
 	case eCSR_ROAM_CCKM_PREAUTH_NOTIFY:
 	{
 		if (eCSR_AUTH_TYPE_CCKM_WPA ==
@@ -4303,7 +4294,7 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 		}
 		break;
 	}
-
+#endif
 	case eCSR_ROAM_ESE_ADJ_AP_REPORT_IND:
 	{
 		hdd_indicate_ese_adj_ap_rep_ind(adapter, roam_info);
@@ -4320,24 +4311,11 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 		hdd_roam_channel_switch_handler(adapter, roam_info);
 		break;
 
-	case eCSR_ROAM_UPDATE_SCAN_RESULT:
-		if ((roam_info) && (roam_info->bss_desc)) {
-			bss_status = wlan_hdd_inform_bss_frame(adapter,
-							roam_info->bss_desc);
-			if (!bss_status)
-				hdd_debug("UPDATE_SCAN_RESULT returned NULL");
-			else
-				cfg80211_put_bss(
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)) || defined(WITH_BACKPORTS)
-					(WLAN_HDD_GET_CTX(adapter))->wiphy,
-#endif
-					bss_status);
-		}
-		break;
 	case eCSR_ROAM_NDP_STATUS_UPDATE:
 		hdd_ndp_event_handler(adapter, roam_info, roam_id, roam_status,
 			roam_result);
 		break;
+#ifndef FEATURE_CM_ENABLE
 	case eCSR_ROAM_START:
 		hdd_debug("Process ROAM_START from firmware");
 		wlan_hdd_netif_queue_control(adapter,
@@ -4358,12 +4336,6 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 		sta_ctx->ft_carrier_on = false;
 		complete(&adapter->roaming_comp_var);
 		break;
-
-	case eCSR_ROAM_SAE_COMPUTE:
-		if (roam_info)
-			wlan_hdd_sae_callback(adapter, roam_info);
-		break;
-
 	case eCSR_ROAM_ROAMING_START:
 		/*
 		 * For LFR2, Handle roaming start to remove disassociated
@@ -4380,7 +4352,11 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
 							adapter->vdev_id);
 		}
 		break;
-
+#endif /* ndef FEATURE_CM_ENABLE */
+	case eCSR_ROAM_SAE_COMPUTE:
+		if (roam_info)
+			wlan_hdd_sae_callback(adapter, roam_info);
+		break;
 	case eCSR_ROAM_FIPS_PMK_REQUEST:
 		/* notify the supplicant of a new candidate */
 		qdf_ret_status = wlan_hdd_cfg80211_pmksa_candidate_notify(

+ 5 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -18151,6 +18151,7 @@ static int wlan_hdd_cfg80211_set_default_beacon_key(struct wiphy *wiphy,
 }
 #endif
 
+#ifndef FEATURE_CM_ENABLE
 void wlan_hdd_cfg80211_unlink_bss(struct hdd_adapter *adapter,
 				  tSirMacAddr bssid, uint8_t *ssid,
 				  uint8_t ssid_len)
@@ -18217,8 +18218,7 @@ static inline void wlan_hdd_add_age_ie(struct ieee80211_mgmt *mgmt,
 }
 #endif /* WLAN_ENABLE_AGEIE_ON_SCAN_RESULTS */
 
-
-struct cfg80211_bss *
+static struct cfg80211_bss *
 wlan_hdd_inform_bss_frame(struct hdd_adapter *adapter,
 				     struct bss_description *bss_desc)
 {
@@ -18349,6 +18349,7 @@ wlan_hdd_cfg80211_update_bss_db(struct hdd_adapter *adapter,
 	}
 	return bss;
 }
+#endif
 
 /**
  * wlan_hdd_cfg80211_pmksa_candidate_notify() - notify a new PMSKA candidate
@@ -18385,6 +18386,7 @@ int wlan_hdd_cfg80211_pmksa_candidate_notify(struct hdd_adapter *adapter,
 	return 0;
 }
 
+#ifndef FEATURE_CM_ENABLE
 #ifdef FEATURE_WLAN_LFR_METRICS
 /**
  * wlan_hdd_cfg80211_roam_metrics_preauth() - roam metrics preauth
@@ -18521,6 +18523,7 @@ wlan_hdd_cfg80211_roam_metrics_handover(struct hdd_adapter *adapter,
 	return QDF_STATUS_SUCCESS;
 }
 #endif
+#endif
 
 #ifdef FEATURE_MONITOR_MODE_SUPPORT
 static

+ 6 - 15
core/hdd/src/wlan_hdd_cfg80211.h

@@ -286,9 +286,11 @@ typedef enum {
 #define PCL_CHANNEL_SUPPORT_CLI			BIT(1)
 #define PCL_CHANNEL_EXCLUDE_IN_GO_NEG		BIT(3)
 
+#ifndef FEATURE_CM_ENABLE
 struct cfg80211_bss *
 wlan_hdd_cfg80211_update_bss_db(struct hdd_adapter *adapter,
 				struct csr_roam_info *roam_info);
+#endif
 
 #define CONNECTIVITY_CHECK_SET_ARP \
 	QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_ARP
@@ -337,12 +339,11 @@ wlan_hdd_wifi_test_config_policy[
 int wlan_hdd_cfg80211_pmksa_candidate_notify(struct hdd_adapter *adapter,
 					struct csr_roam_info *roam_info,
 					int index, bool preauth);
-
+#ifndef FEATURE_CM_ENABLE
 #ifdef FEATURE_WLAN_LFR_METRICS
 QDF_STATUS
 wlan_hdd_cfg80211_roam_metrics_preauth(struct hdd_adapter *adapter,
 				       struct csr_roam_info *roam_info);
-
 QDF_STATUS
 wlan_hdd_cfg80211_roam_metrics_preauth_status(struct hdd_adapter *adapter,
 					      struct csr_roam_info *roam_info,
@@ -352,6 +353,7 @@ QDF_STATUS
 wlan_hdd_cfg80211_roam_metrics_handover(struct hdd_adapter *adapter,
 					struct csr_roam_info *roam_info);
 #endif
+#endif
 
 extern const struct nla_policy
 	qca_wlan_vendor_set_nud_stats_policy
@@ -505,6 +507,7 @@ int wlan_hdd_send_avoid_freq_for_dnbs(struct hdd_context *hdd_ctx,
 void wlan_hdd_rso_cmd_status_cb(hdd_handle_t hdd_handle,
 				struct rso_cmd_status *rso_status);
 
+#ifndef FEATURE_CM_ENABLE
 /*
  * wlan_hdd_cfg80211_unlink_bss :to inform nl80211
  * interface that BSS might have been lost.
@@ -518,6 +521,7 @@ void wlan_hdd_rso_cmd_status_cb(hdd_handle_t hdd_handle,
 void wlan_hdd_cfg80211_unlink_bss(struct hdd_adapter *adapter,
 				  tSirMacAddr bssid, uint8_t *ssid,
 				  uint8_t ssid_len);
+#endif
 
 void wlan_hdd_cfg80211_acs_ch_select_evt(struct hdd_adapter *adapter);
 
@@ -611,19 +615,6 @@ wlan_hdd_cfg80211_indicate_disconnect(struct hdd_adapter *adapter,
 				      uint8_t *disconnect_ies,
 				      uint16_t disconnect_ies_len);
 
-/**
- * wlan_hdd_inform_bss_frame() - inform bss details to NL80211
- * @adapter: Pointer to adapter
- * @bss_desc: Pointer to bss descriptor
- *
- * This function is used to inform the BSS details to nl80211 interface.
- *
- * Return: struct cfg80211_bss pointer
- */
-struct cfg80211_bss *
-wlan_hdd_inform_bss_frame(struct hdd_adapter *adapter,
-				     struct bss_description *bss_desc);
-
 /**
  * wlan_hdd_change_hw_mode_for_given_chnl() - change HW mode for given channel
  * @adapter: pointer to adapter

+ 4 - 0
core/hdd/src/wlan_hdd_cm_disconnect.c

@@ -43,6 +43,8 @@
 #include "wlan_crypto_global_api.h"
 #include "wlan_mlme_vdev_mgr_interface.h"
 #include "hif.h"
+#include "wlan_hdd_power.h"
+#include "wlan_hdd_napi.h"
 
 void hdd_handle_disassociation_event(struct hdd_adapter *adapter,
 				     struct qdf_mac_addr *peer_macaddr)
@@ -292,6 +294,8 @@ hdd_cm_disconnect_complete_pre_user_update(struct wlan_objmgr_vdev *vdev,
 	struct hdd_adapter *adapter = hdd_get_adapter_by_vdev(hdd_ctx,
 					wlan_vdev_get_id(vdev));
 
+	hdd_napi_serialize(0);
+	hdd_disable_and_flush_mc_addr_list(adapter, pmo_peer_disconnect);
 	__hdd_cm_disconnect_handler_pre_user_update(adapter);
 
 	hdd_handle_disassociation_event(adapter, &rsp->req.req.bssid);

+ 2 - 0
core/hdd/src/wlan_hdd_main.c

@@ -6566,7 +6566,9 @@ error:
 static void hdd_init_completion(struct hdd_adapter *adapter)
 {
 	init_completion(&adapter->disconnect_comp_var);
+#ifndef FEATURE_CM_ENABLE
 	init_completion(&adapter->roaming_comp_var);
+#endif
 	init_completion(&adapter->linkup_event_var);
 	init_completion(&adapter->sta_authorized_event);
 	init_completion(&adapter->offchannel_tx_event);

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

@@ -1674,7 +1674,9 @@ QDF_STATUS hdd_wlan_re_init(void)
 
 	hdd_init_scan_reject_params(hdd_ctx);
 
+#ifndef FEATURE_CM_ENABLE
 	complete(&adapter->roaming_comp_var);
+#endif
 	hdd_ctx->bt_coex_mode_set = false;
 
 	/* Allow the phone to go to sleep */

+ 2 - 0
core/hdd/src/wlan_hdd_scan.c

@@ -310,6 +310,7 @@ void hdd_init_scan_reject_params(struct hdd_context *hdd_ctx)
 	}
 }
 
+#ifndef FEATURE_CM_ENABLE
 void hdd_reset_scan_reject_params(struct hdd_context *hdd_ctx,
 				  eRoamCmdStatus roam_status,
 				  eCsrRoamResult roam_result)
@@ -321,6 +322,7 @@ void hdd_reset_scan_reject_params(struct hdd_context *hdd_ctx,
 		hdd_init_scan_reject_params(hdd_ctx);
 	}
 }
+#endif
 
 /*
  * wlan_hdd_update_scan_ies() - API to update the scan IEs of scan request

+ 4 - 1
core/hdd/src/wlan_hdd_scan.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -130,6 +130,8 @@ void wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,
  */
 void hdd_init_scan_reject_params(struct hdd_context *hdd_ctx);
 
+#ifndef FEATURE_CM_ENABLE
+
 /**
  * hdd_reset_scan_reject_params() - reset scan reject params per roam stats
  * @hdd_ctx: hdd contxt
@@ -141,6 +143,7 @@ void hdd_init_scan_reject_params(struct hdd_context *hdd_ctx);
 void hdd_reset_scan_reject_params(struct hdd_context *hdd_ctx,
 				  eRoamCmdStatus roam_status,
 				  eCsrRoamResult roam_result);
+#endif
 
 /**
  * wlan_hdd_cfg80211_scan_block() - scan block handler

+ 6 - 12
core/mac/src/sys/legacy/src/utils/src/mac_trace.c

@@ -102,27 +102,21 @@ uint8_t *mac_trace_getcsr_roam_sub_state(uint16_t csr_roam_sub_state)
 	switch (csr_roam_sub_state) {
 		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_NONE);
 		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_START_BSS_REQ);
-		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_JOIN_REQ);
-		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_REASSOC_REQ);
 		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_DISASSOC_REQ);
 		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_STOP_BSS_REQ);
+#ifndef FEATURE_CM_ENABLE
+		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_JOIN_REQ);
+		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_REASSOC_REQ);
 		CASE_RETURN_STRING
 			(eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING);
-		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_AUTH_REQ);
-		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_CONFIG);
-		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_DEAUTH_REQ);
 		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN);
 		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE);
 		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_DISASSOC_FORCED);
-		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY);
-#ifndef FEATURE_CM_ENABLE
 		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF);
 #endif
-		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC);
-		CASE_RETURN_STRING
-			(eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC);
-		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC);
-
+		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_CONFIG);
+		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_DEAUTH_REQ);
+		CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY);
 	default:
 		return (uint8_t *) "UNKNOWN";
 		break;

+ 0 - 6
core/sap/src/sap_api_link_cntl.c

@@ -886,12 +886,6 @@ QDF_STATUS wlansap_roam_callback(void *ctx,
 					     eSAP_STA_SET_KEY_EVENT,
 					     (void *) eSAP_STATUS_FAILURE);
 		break;
-	case eCSR_ROAM_DISASSOCIATED:
-		if (roam_result == eCSR_ROAM_RESULT_MIC_FAILURE)
-			sap_signal_hdd_event(sap_ctx, csr_roam_info,
-					     eSAP_STA_MIC_FAILURE_EVENT,
-					     (void *) eSAP_STATUS_FAILURE);
-		break;
 	case eCSR_ROAM_WPS_PBC_PROBE_REQ_IND:
 		break;
 	case eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS:

+ 48 - 66
core/sme/inc/csr_api.h

@@ -273,107 +273,89 @@ typedef struct tagCsr11dinfo {
 } tCsr11dinfo;
 
 typedef enum {
+#ifndef FEATURE_CM_ENABLE
 	eCSR_ROAM_CANCELLED = 1,
-	/* it means error happens before assoc_start/roaming_start is called. */
-	eCSR_ROAM_FAILED,
 	/*
 	 * a CSR trigger roaming operation starts,
 	 * callback may get a pointer to tCsrConnectedProfile
 	 */
-	eCSR_ROAM_ROAMING_START,
+	eCSR_ROAM_ROAMING_START = 3,
 	/* a CSR trigger roaming operation is completed */
-	eCSR_ROAM_ROAMING_COMPLETION,
+	eCSR_ROAM_ROAMING_COMPLETION  = 4,
 	/* Connection completed status. */
-	eCSR_ROAM_CONNECT_COMPLETION,
-	/*
-	 * an association or start_IBSS operation starts,
-	 * callback may get a pointer to struct csr_roam_profile and
-	 * a pointer to struct bss_description
-	 */
-	eCSR_ROAM_ASSOCIATION_START,
+	eCSR_ROAM_CONNECT_COMPLETION = 5,
 	/*
 	 * a roaming operation is finish, see eCsrRoamResult for
 	 * possible data passed back
 	 */
-	eCSR_ROAM_ASSOCIATION_COMPLETION,
-	eCSR_ROAM_DISASSOCIATED,
-	eCSR_ROAM_ASSOCIATION_FAILURE,
+	eCSR_ROAM_ASSOCIATION_COMPLETION = 7,
+	eCSR_ROAM_DISASSOCIATED = 8,
+	eCSR_ROAM_ASSOCIATION_FAILURE = 9,
 	/* when callback with this flag. it gets a pointer to the BSS desc. */
-	eCSR_ROAM_SHOULD_ROAM,
-	/* A new candidate for PMKID is found */
-	eCSR_ROAM_SCAN_FOUND_NEW_BSS,
+	eCSR_ROAM_SHOULD_ROAM = 10,
+#endif
 	/* CSR is done lostlink roaming and still cannot reconnect */
-	eCSR_ROAM_LOSTLINK,
-	/* a link lost is detected. CSR starts roaming. */
-	eCSR_ROAM_LOSTLINK_DETECTED,
+	eCSR_ROAM_LOSTLINK = 12,
 	/*
 	 * TKIP MIC error detected, callback gets a pointer
 	 * to struct mic_failure_ind
 	 */
-	eCSR_ROAM_MIC_ERROR_IND,
-	/*
-	 * Update the connection status network is active etc.
-	 */
-	eCSR_ROAM_CONNECT_STATUS_UPDATE,
-	eCSR_ROAM_GEN_INFO,
-	eCSR_ROAM_SET_KEY_COMPLETE,
+	eCSR_ROAM_MIC_ERROR_IND = 14,
+	eCSR_ROAM_SET_KEY_COMPLETE = 17,
 	/* BSS in SoftAP mode status indication */
-	eCSR_ROAM_INFRA_IND,
-	eCSR_ROAM_WPS_PBC_PROBE_REQ_IND,
-	eCSR_ROAM_FT_RESPONSE,
-	eCSR_ROAM_FT_START,
-	/* this mean error happens before assoc_start/roam_start is called. */
-	eCSR_ROAM_SESSION_OPENED,
-	eCSR_ROAM_FT_REASSOC_FAILED,
-	eCSR_ROAM_PMK_NOTIFY,
+	eCSR_ROAM_INFRA_IND = 18,
+	eCSR_ROAM_WPS_PBC_PROBE_REQ_IND = 19,
+#ifndef FEATURE_CM_ENABLE
+	eCSR_ROAM_FT_RESPONSE = 20,
+	eCSR_ROAM_FT_START = 21,
+	eCSR_ROAM_FT_REASSOC_FAILED = 23,
+	eCSR_ROAM_PMK_NOTIFY = 24,
 	/*
 	 * Following 4 enums are used by FEATURE_WLAN_LFR_METRICS
 	 * but they are needed for compilation even when
 	 * FEATURE_WLAN_LFR_METRICS is not defined.
 	 */
-	eCSR_ROAM_PREAUTH_INIT_NOTIFY,
-	eCSR_ROAM_PREAUTH_STATUS_SUCCESS,
-	eCSR_ROAM_PREAUTH_STATUS_FAILURE,
-	eCSR_ROAM_HANDOVER_SUCCESS,
-	/*
-	 * TDLS callback events
-	 */
-	eCSR_ROAM_TDLS_STATUS_UPDATE,
-	eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND,
-
+	eCSR_ROAM_PREAUTH_INIT_NOTIFY = 25,
+	eCSR_ROAM_PREAUTH_STATUS_SUCCESS = 26,
+	eCSR_ROAM_PREAUTH_STATUS_FAILURE = 27,
+	eCSR_ROAM_HANDOVER_SUCCESS = 28,
+#endif
 	/* Disaconnect all the clients */
-	eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS,
+	eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS = 31,
 	/* Stopbss triggered from SME due to different */
-	eCSR_ROAM_SEND_P2P_STOP_BSS,
+	eCSR_ROAM_SEND_P2P_STOP_BSS = 32,
 	/* beacon interval */
 #ifdef WLAN_FEATURE_11W
-	eCSR_ROAM_UNPROT_MGMT_FRAME_IND,
+	eCSR_ROAM_UNPROT_MGMT_FRAME_IND = 33,
 #endif
 
 #ifdef FEATURE_WLAN_ESE
-	eCSR_ROAM_TSM_IE_IND,
-	eCSR_ROAM_CCKM_PREAUTH_NOTIFY,
-	eCSR_ROAM_ESE_ADJ_AP_REPORT_IND,
-	eCSR_ROAM_ESE_BCN_REPORT_IND,
+	eCSR_ROAM_TSM_IE_IND = 34,
+#ifndef FEATURE_CM_ENABLE
+	eCSR_ROAM_CCKM_PREAUTH_NOTIFY = 35,
+#endif
+	eCSR_ROAM_ESE_ADJ_AP_REPORT_IND = 36,
+	eCSR_ROAM_ESE_BCN_REPORT_IND = 37,
 #endif /* FEATURE_WLAN_ESE */
 
 	/* Radar indication from lower layers */
-	eCSR_ROAM_DFS_RADAR_IND,
-	eCSR_ROAM_SET_CHANNEL_RSP,
+	eCSR_ROAM_DFS_RADAR_IND = 38,
+	eCSR_ROAM_SET_CHANNEL_RSP = 39,
 
 	/* Channel sw update notification */
-	eCSR_ROAM_DFS_CHAN_SW_NOTIFY,
-	eCSR_ROAM_EXT_CHG_CHNL_IND,
-	eCSR_ROAM_STA_CHANNEL_SWITCH,
-	eCSR_ROAM_NDP_STATUS_UPDATE,
-	eCSR_ROAM_UPDATE_SCAN_RESULT,
-	eCSR_ROAM_START,
-	eCSR_ROAM_ABORT,
-	eCSR_ROAM_NAPI_OFF,
-	eCSR_ROAM_CHANNEL_COMPLETE_IND,
-	eCSR_ROAM_CAC_COMPLETE_IND,
-	eCSR_ROAM_SAE_COMPUTE,
-	eCSR_ROAM_FIPS_PMK_REQUEST,
+	eCSR_ROAM_DFS_CHAN_SW_NOTIFY = 40,
+	eCSR_ROAM_EXT_CHG_CHNL_IND = 41,
+	eCSR_ROAM_STA_CHANNEL_SWITCH = 42,
+	eCSR_ROAM_NDP_STATUS_UPDATE = 43,
+#ifndef FEATURE_CM_ENABLE
+	eCSR_ROAM_START = 44,
+	eCSR_ROAM_ABORT = 45,
+	eCSR_ROAM_NAPI_OFF = 46,
+#endif
+	eCSR_ROAM_CHANNEL_COMPLETE_IND = 47,
+	eCSR_ROAM_CAC_COMPLETE_IND = 48,
+	eCSR_ROAM_SAE_COMPUTE = 49,
+	eCSR_ROAM_FIPS_PMK_REQUEST = 50,
 } eRoamCmdStatus;
 
 /* comment inside indicates what roaming callback gets */

+ 26 - 27
core/sme/inc/csr_internal.h

@@ -115,39 +115,41 @@ enum csr_roam_reason {
 	eCsrSmeIssuedAssocToSimilarAP,
 #endif
 	eCsrStopBss,
+#ifndef FEATURE_CM_ENABLE
 	eCsrSmeIssuedFTReassoc,
+#endif
 	eCsrForcedDisassocSta,
 	eCsrForcedDeauthSta,
 #ifndef FEATURE_CM_ENABLE
 	eCsrPerformPreauth,
 #endif
-	/* Roaming disabled from driver during connect/start BSS */
-	ecsr_driver_disabled,
 };
 
 enum csr_roam_substate {
 	eCSR_ROAM_SUBSTATE_NONE = 0,
 	eCSR_ROAM_SUBSTATE_START_BSS_REQ,
+#ifndef FEATURE_CM_ENABLE
 	eCSR_ROAM_SUBSTATE_JOIN_REQ,
 	eCSR_ROAM_SUBSTATE_REASSOC_REQ,
+#endif
 	eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
 	eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
+#ifndef FEATURE_CM_ENABLE
 	/* Continue the current roam command after disconnect */
 	eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING,
-	eCSR_ROAM_SUBSTATE_AUTH_REQ,
+#endif
 	eCSR_ROAM_SUBSTATE_CONFIG,
 	eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
+#ifndef FEATURE_CM_ENABLE
 	eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
 	eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
 	eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
+#endif
 	eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
 #ifndef FEATURE_CM_ENABLE
 	eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
-#endif
-	eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
-	eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
-	eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
 	eCSR_ROAM_SUBSTATE_DISASSOC_STA_HAS_LEFT,
+#endif
 	/*  max is 15 unless the bitfield is expanded... */
 };
 
@@ -167,6 +169,7 @@ enum csr_join_state {
 #endif
 };
 
+#ifndef FEATURE_CM_ENABLE
 enum csr_roaming_reason {
 	eCsrNotRoaming,
 	eCsrLostlinkRoamingDisassoc,
@@ -174,6 +177,7 @@ enum csr_roaming_reason {
 	eCsrDynamicRoaming,
 	eCsrReassocRoaming,
 };
+#endif
 
 enum csr_roam_wmstatus_changetypes {
 	eCsrDisassociated,
@@ -497,11 +501,12 @@ struct csr_roam_session {
 	bool is_fils_connection;
 	uint16_t fils_seq_num;
 	bool discon_in_progress;
-#endif /* ndef FEATURE_CM_ENABLE */
+	qdf_mc_timer_t roaming_offload_timer;
 	struct csr_timer_info roamingTimerInfo;
+	qdf_mc_timer_t hTimerRoaming;
 	enum csr_roaming_reason roamingReason;
 	bool fCancelRoaming;
-	qdf_mc_timer_t hTimerRoaming;
+#endif /* ndef FEATURE_CM_ENABLE */
 #ifdef WLAN_BCN_RECV_FEATURE
 	bool is_bcn_recv_start;
 	bool beacon_report_do_not_resume;
@@ -528,7 +533,6 @@ struct csr_roam_session {
 	bool ch_switch_in_progress;
 	uint8_t nss;
 	bool dhcp_done;
-	qdf_mc_timer_t roaming_offload_timer;
 	struct csr_disconnect_stats disconnect_stats;
 };
 
@@ -575,14 +579,13 @@ struct csr_roamstruct {
 		CSR_IS_ROAM_STATE(mac, eCSR_ROAMING_STATE_JOINED, sessionId)
 #define CSR_IS_ROAM_SUBSTATE(mac, subState, sessionId) \
 		((subState) == (mac)->roam.curSubState[sessionId])
+#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(mac, sessionId) \
+		CSR_IS_ROAM_SUBSTATE((mac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
+#ifndef FEATURE_CM_ENABLE
 #define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(mac, sessionId) \
 	CSR_IS_ROAM_SUBSTATE((mac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
-#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(mac, sessionId) \
-	CSR_IS_ROAM_SUBSTATE((mac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
 #define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(mac, sessionId) \
 	CSR_IS_ROAM_SUBSTATE((mac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
-#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(mac, sessionId) \
-	CSR_IS_ROAM_SUBSTATE((mac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
 #define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(mac, sessionId) \
 	CSR_IS_ROAM_SUBSTATE((mac), \
 		eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
@@ -592,6 +595,7 @@ struct csr_roamstruct {
 #define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(mac, sessionId) \
 		CSR_IS_ROAM_SUBSTATE((mac), \
 			eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
+#endif
 #define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(mac, sessionId) \
 		CSR_IS_ROAM_SUBSTATE((mac), \
 			eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
@@ -601,9 +605,11 @@ struct csr_roamstruct {
 #define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(mac, sessionId) \
 		CSR_IS_ROAM_SUBSTATE((mac), \
 			eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
+#ifndef FEATURE_CM_ENABLE
 #define CSR_IS_ROAM_SUBSTATE_DISCONNECT_CONTINUE(mac, sessionId) \
 		CSR_IS_ROAM_SUBSTATE((mac), \
 		eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, sessionId)
+#endif
 #define CSR_IS_ROAM_SUBSTATE_CONFIG(mac, sessionId) \
 		CSR_IS_ROAM_SUBSTATE((mac), \
 		eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
@@ -615,16 +621,6 @@ struct csr_roamstruct {
 		CSR_IS_ROAM_SUBSTATE((mac), \
 			eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
 #endif
-#define CSR_IS_ROAM_SUBSTATE_HO_NT(mac, sessionId) \
-		CSR_IS_ROAM_SUBSTATE((mac), \
-			eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
-#define CSR_IS_ROAM_SUBSTATE_HO_NRT(mac, sessionId)  \
-			CSR_IS_ROAM_SUBSTATE((mac), \
-				eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,\
-					sessionId)
-#define CSR_IS_ROAM_SUBSTATE_HO_RT(mac, sessionId) \
-			CSR_IS_ROAM_SUBSTATE((mac),\
-			eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC, sessionId)
 #define CSR_IS_PHY_MODE_B_ONLY(mac) \
 	((eCSR_DOT11_MODE_11b == (mac)->roam.configParam.phyMode) || \
 	 (eCSR_DOT11_MODE_11b_ONLY == (mac)->roam.configParam.phyMode))
@@ -716,15 +712,18 @@ struct csr_roamstruct {
 	(CSR_IS_OPEARTING_DUAL_BAND((mac)) || \
 		CSR_IS_RADIO_BG_ONLY((mac)) || CSR_IS_24_BAND_ONLY((mac)))
 
+#ifndef FEATURE_CM_ENABLE
 #define CSR_IS_ROAMING(pSession) \
 	((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
 		(eCsrDynamicRoaming == (pSession)->roamingReason)  ||	\
 		(eCsrReassocRoaming == (pSession)->roamingReason))
+
+#define CSR_IS_LOSTLINK_ROAMING(reason) \
+		((eCsrLostlinkRoamingDisassoc == (reason)) || \
+			(eCsrLostlinkRoamingDeauth == (reason)))
+#endif
 #define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(mac) \
 	(mac->mlme_cfg->wmm_params.wmm_tspec_element.ts_acm_is_off)
-#define CSR_IS_LOSTLINK_ROAMING(reason) \
-	((eCsrLostlinkRoamingDisassoc == (reason)) || \
-		(eCsrLostlinkRoamingDeauth == (reason)))
 
 #ifdef FEATURE_LFR_SUBNET_DETECTION
 /* bit-4 and bit-5 indicate the subnet status */

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

@@ -582,8 +582,11 @@ QDF_STATUS sme_roam_disconnect_sta(mac_handle_t mac_handle, uint8_t sessionId,
 		struct csr_del_sta_params *p_del_sta_params);
 QDF_STATUS sme_roam_deauth_sta(mac_handle_t mac_handle, uint8_t sessionId,
 		struct csr_del_sta_params *pDelStaParams);
+#ifndef FEATURE_CM_ENABLE
 struct bss_description *sme_roam_get_connect_bss_desc(mac_handle_t mac_handle,
 						       uint8_t vdev_id);
+#endif
+
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 /**
  * sme_set_roam_scan_ch_event_cb() - Register roam scan ch callback

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

@@ -77,12 +77,14 @@ void sme_set_ft_ies(mac_handle_t mac_handle, uint32_t sessionId,
 		    const uint8_t *ft_ies, uint16_t ft_ies_length);
 QDF_STATUS sme_ft_update_key(mac_handle_t mac_handle, uint32_t sessionId,
 			     tCsrRoamSetKey *pFTKeyInfo);
+#ifndef FEATURE_CM_ENABLE
 void sme_get_ft_pre_auth_response(mac_handle_t mac_handle, uint32_t sessionId,
 				  uint8_t *ft_ies, uint32_t ft_ies_ip_len,
 				  uint16_t *ft_ies_length);
 void sme_get_rici_es(mac_handle_t mac_handle, uint32_t sessionId,
 		     uint8_t *ric_ies,
 		     uint32_t ric_ies_ip_len, uint32_t *ric_ies_length);
+#endif
 /**
  * sme_check_ft_status() - Check for key wait status in FT mode
  * @mac_handle: MAC handle

+ 1 - 1
core/sme/src/common/sme_api.c

@@ -3203,6 +3203,7 @@ QDF_STATUS sme_roam_deauth_sta(mac_handle_t mac_handle, uint8_t sessionId,
 	return status;
 }
 
+#ifndef FEATURE_CM_ENABLE
 struct bss_description *sme_roam_get_connect_bss_desc(mac_handle_t mac_handle,
 						      uint8_t vdev_id)
 {
@@ -3229,7 +3230,6 @@ struct bss_description *sme_roam_get_connect_bss_desc(mac_handle_t mac_handle,
 	return bss_desc;
 }
 
-#ifndef FEATURE_CM_ENABLE
 QDF_STATUS sme_roam_del_pmkid_from_cache(mac_handle_t mac_handle,
 					 uint8_t vdev_id,
 					 struct wlan_crypto_pmksa *pmksa,

+ 1 - 1
core/sme/src/common/sme_ft_api.c

@@ -286,6 +286,7 @@ bool sme_ft_key_ready_for_install(mac_handle_t mac_handle, uint32_t session_id)
 }
 #endif
 
+#ifndef FEATURE_CM_ENABLE
 /*
  * HDD Interface to SME. SME now sends the Auth 2 and RIC IEs up to the
  * supplicant. The supplicant will then proceed to send down the
@@ -379,7 +380,6 @@ void sme_get_rici_es(mac_handle_t mac_handle, uint32_t sessionId,
 	sme_release_global_lock(&mac->sme);
 }
 
-#ifndef FEATURE_CM_ENABLE
 /*
  * Timer callback for the timer that is started between the preauth completion
  * and reassoc request to the PE. In this interval, it is expected that the

+ 65 - 98
core/sme/src/csr/csr_api_roam.c

@@ -183,7 +183,6 @@ static QDF_STATUS csr_roam_close(struct mac_context *mac);
 static bool csr_roam_is_same_profile_keys(struct mac_context *mac,
 				   tCsrRoamConnectedProfile *pConnProfile,
 				   struct csr_roam_profile *pProfile2);
-#endif
 static QDF_STATUS csr_roam_start_roaming_timer(struct mac_context *mac,
 					       uint32_t vdev_id,
 					       uint32_t interval);
@@ -195,6 +194,7 @@ static void csr_roam_roaming_offload_timer_action(struct mac_context *mac_ctx,
 		uint32_t interval, uint8_t session_id, uint8_t action);
 #endif
 static void csr_roam_roaming_offload_timeout_handler(void *timer_data);
+#endif
 
 static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11dinfo);
 static QDF_STATUS csr_init_channel_power_list(struct mac_context *mac,
@@ -1038,10 +1038,6 @@ QDF_STATUS csr_start(struct mac_context *mac)
 		for (i = 0; i < WLAN_MAX_VDEVS; i++)
 			csr_roam_state_change(mac, eCSR_ROAMING_STATE_IDLE, i);
 
-		status = csr_roam_start(mac);
-		if (!QDF_IS_STATUS_SUCCESS(status))
-			break;
-
 		mac->roam.sPendingCommands = 0;
 
 #ifndef FEATURE_CM_ENABLE
@@ -1265,9 +1261,12 @@ static inline void csr_packetdump_timer_deinit(struct mac_context *mac) {}
 static QDF_STATUS csr_roam_open(struct mac_context *mac)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
+#ifndef FEATURE_CM_ENABLE
 	uint32_t i;
 	struct csr_roam_session *pSession;
+#endif
 
+#ifndef FEATURE_CM_ENABLE
 	for (i = 0; i < WLAN_MAX_VDEVS; i++) {
 		pSession = CSR_GET_SESSION(mac, i);
 
@@ -1277,7 +1276,7 @@ static QDF_STATUS csr_roam_open(struct mac_context *mac)
 		pSession->roamingTimerInfo.mac = mac;
 		pSession->roamingTimerInfo.vdev_id = WLAN_UMAC_VDEV_ID_MAX;
 	}
-
+#endif
 	status = csr_packetdump_timer_init(mac);
 	if (QDF_IS_STATUS_ERROR(status))
 		return status;
@@ -1309,17 +1308,6 @@ static QDF_STATUS csr_roam_close(struct mac_context *mac)
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS csr_roam_start(struct mac_context *mac)
-{
-	(void)mac;
-	return QDF_STATUS_SUCCESS;
-}
-
-void csr_roam_stop(struct mac_context *mac, uint32_t sessionId)
-{
-	csr_roam_stop_roaming_timer(mac, sessionId);
-}
-
 void csr_roam_free_connect_profile(tCsrRoamConnectedProfile *profile)
 {
 	qdf_mem_zero(profile, sizeof(tCsrRoamConnectedProfile));
@@ -2230,6 +2218,7 @@ QDF_STATUS csr_init_channel_power_list(struct mac_context *mac,
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifndef FEATURE_CM_ENABLE
 /**
  * csr_roam_remove_duplicate_cmd_from_list()- Remove duplicate roam cmd from
  * list
@@ -2284,21 +2273,14 @@ static void csr_roam_remove_duplicate_pending_cmd_from_list(
 					sizeof(QDF_MAC_ADDR_SIZE))) &&
 				((command->u.roamCmd.roamReason ==
 					dup_cmd->u.roamCmd.roamReason) ||
-			/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
 				(eCsrForcedDisassoc ==
 					command->u.roamCmd.roamReason) ||
-#endif
 				(eCsrHddIssued ==
 					command->u.roamCmd.roamReason)))) ||
 			/* OR if pCommand is NULL */
 			((vdev_id == dup_cmd->vdev_id) &&
 			(eSmeCommandRoam == dup_cmd->command) &&
-			(
-			/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
-			(eCsrForcedDisassoc == roam_reason) ||
-#endif
+			((eCsrForcedDisassoc == roam_reason) ||
 			(eCsrHddIssued == roam_reason &&
 			!CSR_IS_DISCONNECT_COMMAND(dup_cmd))))) {
 			sme_debug("RoamReason: %d",
@@ -2342,7 +2324,6 @@ void csr_roam_remove_duplicate_command(struct mac_context *mac_ctx,
 		session_id, command, roam_reason);
 }
 
-#ifndef FEATURE_CM_ENABLE
 /**
  * csr_roam_populate_channels() - Helper function to populate channels
  * @beacon_ies: pointer to beacon ie
@@ -6605,6 +6586,8 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t vdev_id,
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint32_t roam_id = 0;
 	struct csr_roam_session *session = CSR_GET_SESSION(mac, vdev_id);
+	struct wlan_serialization_queued_cmd_info cmd = {0};
+	struct wlan_objmgr_vdev *vdev;
 
 	if (!session) {
 		sme_err("session does not exist for given sessionId: %d",
@@ -6617,11 +6600,27 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t vdev_id,
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, vdev_id,
+						    WLAN_LEGACY_SME_ID);
+	if (!vdev) {
+		sme_err("vdev not found for id %d", vdev_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	sme_debug("Persona %d authtype %d  encryType %d mc_encType %d",
 		  profile->csrPersona, profile->AuthType.authType[0],
 		  profile->EncryptionType.encryptionType[0],
 		  profile->mcEncryptionType.encryptionType[0]);
-	csr_roam_remove_duplicate_command(mac, vdev_id, NULL, eCsrHddIssued);
+
+	/* Flush any pending vdev start command */
+	cmd.vdev = vdev;
+	cmd.cmd_type = WLAN_SER_CMD_VDEV_START_BSS;
+	cmd.req_type = WLAN_SER_CANCEL_VDEV_NON_SCAN_CMD_TYPE;
+	cmd.requestor = WLAN_UMAC_COMP_MLME;
+	cmd.queue_type = WLAN_SERIALIZATION_PENDING_QUEUE;
+
+	wlan_serialization_cancel_request(&cmd);
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 
 	roam_id = GET_NEXT_ROAM_ID(&mac->roam);
 	if (pRoamId)
@@ -7079,11 +7078,6 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
 	}
 
 error:
-	/* tell the caller if we fail to trigger a join request */
-	if (fCallCallback) {
-		csr_roam_call_callback(mac, sessionId, NULL, roamId,
-				eCSR_ROAM_FAILED, eCSR_ROAM_RESULT_FAILURE);
-	}
 	qdf_mem_free(first_ap_profile);
 
 	return status;
@@ -7160,10 +7154,6 @@ csr_roam_reassoc(struct mac_context *mac_ctx, uint32_t session_id,
 		status = csr_roam_issue_reassoc(mac_ctx, session_id, profile,
 				&mod_fields, eCsrHddIssuedReassocToSameAP,
 				roamId, false);
-	} else {
-		status = csr_roam_call_callback(mac_ctx, session_id, NULL,
-						roamId, eCSR_ROAM_FAILED,
-						eCSR_ROAM_RESULT_FAILURE);
 	}
 
 	return status;
@@ -8077,7 +8067,6 @@ static QDF_STATUS csr_roam_issue_join(struct mac_context *mac, uint32_t sessionI
 					pIes, eWNI_SME_JOIN_REQ);
 	return status;
 }
-#endif
 
 static void
 csr_roam_reissue_roam_command(struct mac_context *mac, uint8_t session_id)
@@ -8132,10 +8121,8 @@ csr_roam_reissue_roam_command(struct mac_context *mac, uint8_t session_id)
 	roam_info->bss_desc = pCommand->u.roamCmd.pLastRoamBss;
 	roam_info->status_code = pSession->joinFailStatusCode.status_code;
 	roam_info->reasonCode = pSession->joinFailStatusCode.reasonCode;
-	/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
+
 	pSession->connectState = eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTED;
-#endif
 	csr_roam_call_callback(mac, sessionId, roam_info,
 			       pCommand->u.roamCmd.roamId,
 			       eCSR_ROAM_INFRA_IND,
@@ -8181,6 +8168,7 @@ bool csr_is_roam_command_waiting_for_session(struct mac_context *mac,
 
 	return fRet;
 }
+#endif
 
 static void
 csr_roaming_state_config_cnf_processor(struct mac_context *mac_ctx,
@@ -8472,9 +8460,6 @@ static void csr_roam_roaming_state_stop_bss_rsp_processor(struct mac_context *ma
 				result_code = eCsrStopBssFailure;
 		}
 		csr_roam_complete(mac, result_code, NULL, pSmeRsp->vdev_id);
-	} else if (CSR_IS_ROAM_SUBSTATE_DISCONNECT_CONTINUE(mac,
-			pSmeRsp->vdev_id)) {
-		csr_roam_reissue_roam_command(mac, pSmeRsp->vdev_id);
 	}
 }
 
@@ -8884,19 +8869,7 @@ static void csr_roam_roaming_state_deauth_rsp_processor(struct mac_context *mac,
 	tSirResultCodes status_code;
 	status_code = csr_get_de_auth_rsp_status_code(pSmeRsp);
 	mac->roam.deauthRspStatus = status_code;
-	if (CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(mac, pSmeRsp->sessionId)) {
-		csr_roam_complete(mac, eCsrNothingToJoin, NULL,
-				pSmeRsp->sessionId);
-	} else {
-		if (eSIR_SME_SUCCESS == status_code) {
-			/* Successfully deauth from the 'old' Bss... */
-			/* */
-			sme_debug(
-				"CSR SmeDeauthReq disassociated Successfully");
-		}
-		/* We are not done yet. Get the data and continue roaming */
-		csr_roam_reissue_roam_command(mac, pSmeRsp->sessionId);
-	}
+	csr_roam_complete(mac, eCsrNothingToJoin, NULL, pSmeRsp->sessionId);
 }
 
 static void
@@ -10448,11 +10421,6 @@ csr_roam_chk_lnk_disassoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 	uint32_t sessionId = WLAN_UMAC_VDEV_ID_MAX;
 	QDF_STATUS status;
 	struct disassoc_ind *pDisassocInd;
-	tSmeCmd *cmd;
-
-	cmd = qdf_mem_malloc(sizeof(*cmd));
-	if (!cmd)
-		return;
 
 	/*
 	 * Check if AP dis-associated us because of MIC failure. If so,
@@ -10465,15 +10433,13 @@ csr_roam_chk_lnk_disassoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		sme_err("Session Id not found for BSSID "QDF_MAC_ADDR_FMT,
 			QDF_MAC_ADDR_REF(pDisassocInd->bssid.bytes));
-		qdf_mem_free(cmd);
+
 		return;
 	}
 
 	if (csr_is_deauth_disassoc_already_active(mac_ctx, sessionId,
-	    pDisassocInd->peer_macaddr)) {
-		qdf_mem_free(cmd);
+	    pDisassocInd->peer_macaddr))
 		return;
-	}
 
 	sme_nofl_info("disassoc from peer " QDF_MAC_ADDR_FMT
 		      "reason: %d status: %d vid %d",
@@ -10483,7 +10449,6 @@ csr_roam_chk_lnk_disassoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 	session = CSR_GET_SESSION(mac_ctx, sessionId);
 	if (!session) {
 		sme_err("session: %d not found", sessionId);
-		qdf_mem_free(cmd);
 		return;
 	}
 	/* This is temp ifdef will be removed in near future */
@@ -10527,21 +10492,6 @@ csr_roam_chk_lnk_disassoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 #endif
 	csr_roam_issue_wm_status_change(mac_ctx, sessionId,
 					eCsrDisassociated, msg_ptr);
-	if (CSR_IS_INFRA_AP(&session->connectedProfile)) {
-		/*
-		 * STA/P2P client got  disassociated so remove any pending
-		 * deauth commands in sme pending list
-		 */
-		cmd->command = eSmeCommandRoam;
-		cmd->vdev_id = (uint8_t) sessionId;
-		cmd->u.roamCmd.roamReason = eCsrForcedDeauthSta;
-		qdf_mem_copy(cmd->u.roamCmd.peerMac,
-			     pDisassocInd->peer_macaddr.bytes,
-			     QDF_MAC_ADDR_SIZE);
-		csr_roam_remove_duplicate_command(mac_ctx, sessionId, cmd,
-						  eCsrForcedDeauthSta);
-	}
-	qdf_mem_free(cmd);
 }
 
 static void
@@ -10971,6 +10921,7 @@ void csr_roam_check_for_link_status_change(struct mac_context *mac,
 	} /* end switch on message type */
 }
 
+#ifndef FEATURE_CM_ENABLE
 void csr_call_roaming_completion_callback(struct mac_context *mac,
 					  struct csr_roam_session *pSession,
 					  struct csr_roam_info *roam_info,
@@ -11283,19 +11234,17 @@ void csr_roam_completion(struct mac_context *mac, uint32_t vdev_id,
 		csr_roam_complete_roaming(mac, vdev_id, fSuccess,
 								roamResult);
 	else {
-		/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
 		if (pSession->bRefAssocStartCnt != 0) {
 			QDF_ASSERT(pSession->bRefAssocStartCnt == 0);
 			return;
 		}
-#endif
 		sme_debug("indicates association completion roamResult: %d",
 			roamResult);
 		csr_roam_call_callback(mac, vdev_id, roam_info, roamId,
 				       roamStatus, roamResult);
 	}
 }
+#endif
 
 static
 QDF_STATUS csr_roam_lost_link(struct mac_context *mac, uint32_t sessionId,
@@ -11344,10 +11293,6 @@ QDF_STATUS csr_roam_lost_link(struct mac_context *mac, uint32_t sessionId,
 	mlme_set_discon_reason_n_from_ap(mac->psoc, sessionId, from_ap,
 				      pSession->joinFailStatusCode.reasonCode);
 
-
-	csr_roam_call_callback(mac, sessionId, NULL, 0,
-			       eCSR_ROAM_LOSTLINK_DETECTED, result);
-
 	if (eWNI_SME_DISASSOC_IND == type)
 		status = csr_send_mb_disassoc_cnf_msg(mac, pDisassocIndMsg);
 	else if (eWNI_SME_DEAUTH_IND == type)
@@ -12493,7 +12438,6 @@ QDF_STATUS csr_roam_get_wpa_rsn_req_ie(struct mac_context *mac, uint32_t session
 	}
 	return status;
 }
-#endif
 
 eRoamCmdStatus csr_get_roam_complete_status(struct mac_context *mac,
 						uint32_t sessionId)
@@ -12511,6 +12455,7 @@ eRoamCmdStatus csr_get_roam_complete_status(struct mac_context *mac,
 
 	return retStatus;
 }
+#endif
 
 static QDF_STATUS csr_roam_start_wds(struct mac_context *mac, uint32_t sessionId,
 				     struct csr_roam_profile *pProfile,
@@ -14441,6 +14386,7 @@ QDF_STATUS csr_setup_vdev_session(struct vdev_mlme_obj *vdev_mlme)
 
 	qdf_mem_copy(&session->self_mac_addr, mac_addr,
 		     sizeof(struct qdf_mac_addr));
+#ifndef FEATURE_CM_ENABLE
 	status = qdf_mc_timer_init(&session->hTimerRoaming,
 				   QDF_TIMER_TYPE_SW,
 				   csr_roam_roaming_timer_handler,
@@ -14449,7 +14395,6 @@ QDF_STATUS csr_setup_vdev_session(struct vdev_mlme_obj *vdev_mlme)
 		sme_err("cannot allocate memory for Roaming timer");
 		return status;
 	}
-
 	status = qdf_mc_timer_init(&session->roaming_offload_timer,
 				   QDF_TIMER_TYPE_SW,
 				   csr_roam_roaming_offload_timeout_handler,
@@ -14459,6 +14404,7 @@ QDF_STATUS csr_setup_vdev_session(struct vdev_mlme_obj *vdev_mlme)
 		sme_err("timer init failed for join failure timer");
 		return status;
 	}
+#endif
 
 	ht_cap.caps = 0;
 	vht_config.caps = 0;
@@ -14501,7 +14447,7 @@ QDF_STATUS csr_setup_vdev_session(struct vdev_mlme_obj *vdev_mlme)
 		wlan_mlme_update_oce_flags(mac_ctx->pdev);
 	}
 
-	return status;
+	return QDF_STATUS_SUCCESS;
 }
 
 void csr_cleanup_vdev_session(struct mac_context *mac, uint8_t vdev_id)
@@ -14510,8 +14456,9 @@ void csr_cleanup_vdev_session(struct mac_context *mac, uint8_t vdev_id)
 		struct csr_roam_session *pSession = CSR_GET_SESSION(mac,
 								vdev_id);
 
-		csr_roam_stop(mac, vdev_id);
-
+#ifndef FEATURE_CM_ENABLE
+		csr_roam_stop_roaming_timer(mac, vdev_id);
+#endif
 		/* Clean up FT related data structures */
 		sme_ft_close(MAC_HANDLE(mac), vdev_id);
 		csr_free_connect_bss_desc(mac, vdev_id);
@@ -14522,8 +14469,10 @@ void csr_cleanup_vdev_session(struct mac_context *mac, uint8_t vdev_id)
 		csr_roam_free_connected_info(mac, &pSession->connectedInfo);
 		csr_roam_free_connected_info(mac,
 					     &pSession->prev_assoc_ap_info);
+#ifndef FEATURE_CM_ENABLE
 		qdf_mc_timer_destroy(&pSession->hTimerRoaming);
 		qdf_mc_timer_destroy(&pSession->roaming_offload_timer);
+#endif
 		csr_init_session(mac, vdev_id);
 	}
 }
@@ -14541,8 +14490,10 @@ QDF_STATUS csr_prepare_vdev_delete(struct mac_context *mac_ctx,
 	if (!CSR_IS_SESSION_VALID(mac_ctx, vdev_id))
 		return QDF_STATUS_E_INVAL;
 
+#ifndef FEATURE_CM_ENABLE
 	/* Vdev going down stop roaming */
 	session->fCancelRoaming = true;
+#endif
 	if (cleanup) {
 		csr_cleanup_vdev_session(mac_ctx, vdev_id);
 		return status;
@@ -16041,10 +15992,13 @@ void csr_process_ho_fail_ind(struct mac_context *mac_ctx, void *msg_buf)
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 
 	mac_ctx->sme.set_connection_info_cb(false);
+	/* This is temp ifdef will be removed in near future */
+#ifndef FEATURE_CM_ENABLE
 	csr_roam_roaming_offload_timer_action(mac_ctx, 0, sessionId,
 			ROAMING_OFFLOAD_TIMER_STOP);
 	csr_roam_call_callback(mac_ctx, sessionId, NULL, 0,
 			eCSR_ROAM_NAPI_OFF, eCSR_ROAM_RESULT_FAILURE);
+#endif
 	csr_roam_synch_clean_up(mac_ctx, sessionId);
 	csr_roaming_report_diag_event(mac_ctx, NULL,
 			DIAG_REASON_ROAM_HO_FAIL);
@@ -16855,6 +16809,8 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 
 	switch (reason) {
 	case SIR_ROAMING_DEREGISTER_STA:
+		/* This is temp ifdef will be removed in near future */
+#ifndef FEATURE_CM_ENABLE
 		/*
 		 * The following is the first thing done in CSR
 		 * after receiving RSI. Hence stopping the timer here.
@@ -16862,8 +16818,6 @@ 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);
 
-		/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
 		if (session->discon_in_progress) {
 			sme_err("LFR3: vdev:%d Disconnect is in progress roam_synch is not allowed",
 				session_id);
@@ -16877,8 +16831,11 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		if (QDF_IS_STATUS_ERROR(status))
 			goto end;
 
+		/* This is temp ifdef will be removed in near future */
+#ifndef FEATURE_CM_ENABLE
 		csr_roam_call_callback(mac_ctx, session_id, NULL, 0,
 				eCSR_ROAM_FT_START, eCSR_ROAM_RESULT_SUCCESS);
+#endif
 		goto end;
 	case SIR_ROAMING_START:
 		status = wlan_cm_roam_state_change(mac_ctx->pdev, session_id,
@@ -16887,12 +16844,14 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		if (QDF_IS_STATUS_ERROR(status))
 			goto end;
 
+		/* This is temp ifdef will be removed in near future */
+#ifndef FEATURE_CM_ENABLE
 		csr_roam_roaming_offload_timer_action(mac_ctx,
 				CSR_ROAMING_OFFLOAD_TIMEOUT_PERIOD, session_id,
 				ROAMING_OFFLOAD_TIMER_START);
 		csr_roam_call_callback(mac_ctx, session_id, NULL, 0,
 				eCSR_ROAM_START, eCSR_ROAM_RESULT_SUCCESS);
-
+#endif
 		/*
 		 * For emergency deauth roaming, firmware sends ROAM start
 		 * instead of ROAM scan start notification as data path queues
@@ -16929,15 +16888,21 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		wlan_cm_roam_state_change(mac_ctx->pdev, session_id,
 					   WLAN_ROAM_RSO_ENABLED,
 					   REASON_ROAM_ABORT);
+		/* This is temp ifdef will be removed in near future */
+#ifndef FEATURE_CM_ENABLE
 		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,
 				eCSR_ROAM_ABORT, eCSR_ROAM_RESULT_SUCCESS);
+#endif
 		vdev_roam_params->roam_invoke_in_progress = false;
 		goto end;
 	case SIR_ROAM_SYNCH_NAPI_OFF:
+		/* This is temp ifdef will be removed in near future */
+#ifndef FEATURE_CM_ENABLE
 		csr_roam_call_callback(mac_ctx, session_id, NULL, 0,
 				eCSR_ROAM_NAPI_OFF, eCSR_ROAM_RESULT_SUCCESS);
+#endif
 		goto end;
 	case SIR_ROAMING_INVOKE_FAIL:
 		sme_debug("Roaming triggered failed source %d nud behaviour %d",
@@ -17052,8 +17017,11 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		}
 		goto end;
 	case SIR_ROAMING_DEAUTH:
+		/* This is temp ifdef will be removed in near future */
+#ifndef FEATURE_CM_ENABLE
 		csr_roam_roaming_offload_timer_action(
 			mac_ctx, 0, session_id, ROAMING_OFFLOAD_TIMER_STOP);
+#endif
 		goto end;
 	default:
 		status = QDF_STATUS_E_FAILURE;
@@ -17402,10 +17370,9 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 #ifndef FEATURE_CM_ENABLE
 	/* for CM fill fils info in struct wlan_cm_connect_resp */
 	csr_copy_fils_join_rsp_roam_info(roam_info, roam_synch_data);
-#endif
 	csr_roam_call_callback(mac_ctx, session_id, roam_info, 0,
 		eCSR_ROAM_ASSOCIATION_COMPLETION, eCSR_ROAM_RESULT_ASSOCIATED);
-
+#endif
 	/* for CM move all this sme qos API to cm_csr * API as in
 	 * cm_csr_connect_rsp */
 	if (IS_ROAM_REASON_DISCONNECTION(roam_synch_data->roamReason))

+ 0 - 4
core/sme/src/csr/csr_api_scan.c

@@ -1208,10 +1208,6 @@ error:
 		csr_release_profile(mac_ctx, session->scan_info.profile);
 		qdf_mem_free(session->scan_info.profile);
 		session->scan_info.profile = NULL;
-		if (notify)
-			csr_roam_call_callback(mac_ctx, session_id, NULL,
-					roam_id, eCSR_ROAM_FAILED,
-					eCSR_ROAM_RESULT_FAILURE);
 	}
 	return status;
 }

+ 7 - 4
core/sme/src/csr/csr_inside_api.h

@@ -152,9 +152,6 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 				 struct csr_roam_profile *pDstProfile,
 				 struct csr_roam_profile *pSrcProfile,
 				 uint8_t vdev_id);
-QDF_STATUS csr_roam_start(struct mac_context *mac);
-void csr_roam_stop(struct mac_context *mac, uint32_t sessionId);
-
 QDF_STATUS csr_scan_open(struct mac_context *mac);
 QDF_STATUS csr_scan_close(struct mac_context *mac);
 
@@ -249,21 +246,23 @@ QDF_STATUS csr_roam_issue_start_bss(struct mac_context *mac, uint32_t sessionId,
 					uint32_t roamId);
 QDF_STATUS csr_roam_issue_stop_bss(struct mac_context *mac, uint32_t sessionId,
 				   enum csr_roam_substate NewSubstate);
+#ifndef FEATURE_CM_ENABLE
 bool csr_is_roam_command_waiting_for_session(struct mac_context *mac,
 					uint32_t sessionId);
 eRoamCmdStatus csr_get_roam_complete_status(struct mac_context *mac,
 					    uint32_t sessionId);
+#endif
 /* pBand can be NULL if caller doesn't need to get it */
 QDF_STATUS csr_roam_issue_disassociate_cmd(struct mac_context *mac,
 					   uint32_t sessionId,
 					   eCsrRoamDisconnectReason reason,
 					   enum wlan_reason_code mac_reason);
+#ifndef FEATURE_CM_ENABLE
 /* pCommand may be NULL */
 void csr_roam_remove_duplicate_command(struct mac_context *mac, uint32_t sessionId,
 				       tSmeCmd *pCommand,
 				       enum csr_roam_reason eRoamReason);
 
-#ifndef FEATURE_CM_ENABLE
 bool csr_is_same_profile(struct mac_context *mac, tCsrRoamConnectedProfile
 			*pProfile1, struct csr_roam_profile *pProfile2,
 			uint8_t vdev_id);
@@ -341,6 +340,7 @@ void csr_apply_channel_power_info_to_fw(struct mac_context *mac,
 					uint8_t *countryCode);
 void csr_apply_power2_current(struct mac_context *mac);
 
+#ifndef FEATURE_CM_ENABLE
 /* return a bool to indicate whether roaming completed or continue. */
 bool csr_roam_complete_roaming(struct mac_context *mac, uint32_t sessionId,
 			       bool fForce, eCsrRoamResult roamResult);
@@ -348,6 +348,7 @@ void csr_roam_completion(struct mac_context *mac, uint32_t sessionId,
 			 struct csr_roam_info *roam_info, tSmeCmd *pCommand,
 			 eCsrRoamResult roamResult, bool fSuccess);
 void csr_roam_cancel_roaming(struct mac_context *mac, uint32_t sessionId);
+#endif
 void csr_apply_channel_power_info_wrapper(struct mac_context *mac);
 QDF_STATUS csr_save_to_channel_power2_g_5_g(struct mac_context *mac,
 					uint32_t tableSize,
@@ -729,11 +730,13 @@ QDF_STATUS csr_roam_disconnect(struct mac_context *mac, uint32_t session_id,
 QDF_STATUS csr_roam_issue_stop_bss_cmd(struct mac_context *mac, uint32_t sessionId,
 				       bool fHighPriority);
 
+#ifndef FEATURE_CM_ENABLE
 void csr_call_roaming_completion_callback(struct mac_context *mac,
 					  struct csr_roam_session *pSession,
 					  struct csr_roam_info *roam_info,
 					  uint32_t roamId,
 					  eCsrRoamResult roamResult);
+#endif
 /**
  * csr_roam_issue_disassociate_sta_cmd() - disassociate a associated station
  * @mac:          Pointer to global structure for MAC

+ 7 - 10
core/sme/src/csr/csr_util.c

@@ -241,8 +241,8 @@ static const bool g_phy_rates_suppt[24][8] = {
 const char *get_e_roam_cmd_status_str(eRoamCmdStatus val)
 {
 	switch (val) {
+#ifndef FEATURE_CM_ENABLE
 		CASE_RETURN_STR(eCSR_ROAM_CANCELLED);
-		CASE_RETURN_STR(eCSR_ROAM_FAILED);
 		CASE_RETURN_STR(eCSR_ROAM_ROAMING_START);
 		CASE_RETURN_STR(eCSR_ROAM_ROAMING_COMPLETION);
 		CASE_RETURN_STR(eCSR_ROAM_CONNECT_COMPLETION);
@@ -250,18 +250,15 @@ const char *get_e_roam_cmd_status_str(eRoamCmdStatus val)
 		CASE_RETURN_STR(eCSR_ROAM_DISASSOCIATED);
 		CASE_RETURN_STR(eCSR_ROAM_ASSOCIATION_FAILURE);
 		CASE_RETURN_STR(eCSR_ROAM_SHOULD_ROAM);
-		CASE_RETURN_STR(eCSR_ROAM_SCAN_FOUND_NEW_BSS);
+#endif
 		CASE_RETURN_STR(eCSR_ROAM_LOSTLINK);
-		CASE_RETURN_STR(eCSR_ROAM_LOSTLINK_DETECTED);
 		CASE_RETURN_STR(eCSR_ROAM_MIC_ERROR_IND);
-		CASE_RETURN_STR(eCSR_ROAM_CONNECT_STATUS_UPDATE);
-		CASE_RETURN_STR(eCSR_ROAM_GEN_INFO);
 		CASE_RETURN_STR(eCSR_ROAM_SET_KEY_COMPLETE);
 		CASE_RETURN_STR(eCSR_ROAM_INFRA_IND);
 		CASE_RETURN_STR(eCSR_ROAM_WPS_PBC_PROBE_REQ_IND);
+#ifndef FEATURE_CM_ENABLE
 		CASE_RETURN_STR(eCSR_ROAM_FT_RESPONSE);
 		CASE_RETURN_STR(eCSR_ROAM_FT_START);
-		CASE_RETURN_STR(eCSR_ROAM_SESSION_OPENED);
 		CASE_RETURN_STR(eCSR_ROAM_FT_REASSOC_FAILED);
 		CASE_RETURN_STR(eCSR_ROAM_PMK_NOTIFY);
 #ifdef FEATURE_WLAN_LFR_METRICS
@@ -270,9 +267,6 @@ const char *get_e_roam_cmd_status_str(eRoamCmdStatus val)
 		CASE_RETURN_STR(eCSR_ROAM_PREAUTH_STATUS_FAILURE);
 		CASE_RETURN_STR(eCSR_ROAM_HANDOVER_SUCCESS);
 #endif
-#ifdef FEATURE_WLAN_TDLS
-		CASE_RETURN_STR(eCSR_ROAM_TDLS_STATUS_UPDATE);
-		CASE_RETURN_STR(eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND);
 #endif
 		CASE_RETURN_STR(eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS);
 		CASE_RETURN_STR(eCSR_ROAM_SEND_P2P_STOP_BSS);
@@ -281,7 +275,9 @@ const char *get_e_roam_cmd_status_str(eRoamCmdStatus val)
 #endif
 #ifdef FEATURE_WLAN_ESE
 		CASE_RETURN_STR(eCSR_ROAM_TSM_IE_IND);
+#ifndef FEATURE_CM_ENABLE
 		CASE_RETURN_STR(eCSR_ROAM_CCKM_PREAUTH_NOTIFY);
+#endif
 		CASE_RETURN_STR(eCSR_ROAM_ESE_ADJ_AP_REPORT_IND);
 		CASE_RETURN_STR(eCSR_ROAM_ESE_BCN_REPORT_IND);
 #endif /* FEATURE_WLAN_ESE */
@@ -291,10 +287,11 @@ const char *get_e_roam_cmd_status_str(eRoamCmdStatus val)
 		CASE_RETURN_STR(eCSR_ROAM_EXT_CHG_CHNL_IND);
 		CASE_RETURN_STR(eCSR_ROAM_STA_CHANNEL_SWITCH);
 		CASE_RETURN_STR(eCSR_ROAM_NDP_STATUS_UPDATE);
-		CASE_RETURN_STR(eCSR_ROAM_UPDATE_SCAN_RESULT);
+#ifndef FEATURE_CM_ENABLE
 		CASE_RETURN_STR(eCSR_ROAM_START);
 		CASE_RETURN_STR(eCSR_ROAM_ABORT);
 		CASE_RETURN_STR(eCSR_ROAM_NAPI_OFF);
+#endif
 		CASE_RETURN_STR(eCSR_ROAM_CHANNEL_COMPLETE_IND);
 		CASE_RETURN_STR(eCSR_ROAM_SAE_COMPUTE);
 		CASE_RETURN_STR(eCSR_ROAM_FIPS_PMK_REQUEST);

+ 1 - 14
core/sme/src/rrm/sme_rrm.c

@@ -451,7 +451,6 @@ static QDF_STATUS sme_rrm_send_scan_result(struct mac_context *mac_ctx,
 	tpRrmSMEContext rrm_ctx =
 		&mac_ctx->rrm.rrmSmeContext[measurement_index];
 	uint32_t session_id;
-	struct csr_roam_info *roam_info = NULL;
 	tSirScanType scan_type;
 	struct csr_roam_session *session;
 
@@ -573,12 +572,6 @@ static QDF_STATUS sme_rrm_send_scan_result(struct mac_context *mac_ctx,
 		goto rrm_send_scan_results_done;
 	}
 
-	roam_info = qdf_mem_malloc(sizeof(*roam_info));
-	if (!roam_info) {
-		status = QDF_STATUS_E_NOMEM;
-		goto rrm_send_scan_results_done;
-	}
-
 	session = CSR_GET_SESSION(mac_ctx, session_id);
 
 	/* This is temp ifdef will be removed in near future */
@@ -631,13 +624,8 @@ static QDF_STATUS sme_rrm_send_scan_result(struct mac_context *mac_ctx,
 		sme_debug("Scan res timer:%lu, rrm scan timer:%llu",
 				scan_results->timer, rrm_scan_timer);
 		if ((scan_results->timer >= rrm_scan_timer) ||
-		    (is_conn_bss_found == true) || is_nontx_of_conn_bss) {
-			roam_info->bss_desc = &scan_results->BssDescriptor;
-			csr_roam_call_callback(mac_ctx, session_id, roam_info,
-						0, eCSR_ROAM_UPDATE_SCAN_RESULT,
-						eCSR_ROAM_RESULT_NONE);
+		    (is_conn_bss_found == true) || is_nontx_of_conn_bss)
 			scanresults_arr[counter++] = scan_results;
-		}
 		scan_results = next_result;
 		if (counter >= num_scan_results)
 			break;
@@ -670,7 +658,6 @@ static QDF_STATUS sme_rrm_send_scan_result(struct mac_context *mac_ctx,
 rrm_send_scan_results_done:
 	if (scanresults_arr)
 		qdf_mem_free(scanresults_arr);
-	qdf_mem_free(roam_info);
 	sme_scan_result_purge(result_handle);
 
 	return status;