qcacld-3.0: Enable compile time enable/disable for roaming

Enable compile time featurization support for both LFR2.0
and LFR3.0 using WLAN_FEATURE_HOST_ROAM and
WLAN_FEATURE_ROAM_OFFLOAD respectively

CRs-Fixed: 978905
Change-Id: Ib5976cd0cd5a6e117a1334bfc73a043e36e25f77
diff --git a/Kbuild b/Kbuild
index f14e5a9..3316971 100755
--- a/Kbuild
+++ b/Kbuild
@@ -41,6 +41,8 @@
 	CONFIG_MOBILE_ROUTER := y
 	endif
 
+	#Flag to enable Legacy Fast Roaming2(LFR2)
+	CONFIG_QCACLD_WLAN_LFR2 := y
 	#Flag to enable Legacy Fast Roaming3(LFR3)
 	CONFIG_QCACLD_WLAN_LFR3 := y
 
@@ -401,10 +403,8 @@
 		$(MAC_SRC_DIR)/pe/lim/lim_admit_control.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_api.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_assoc_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_reassoc_utils.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_debug.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_ft.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_ft_preauth.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_ibss_peer_mgmt.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_link_monitoring_algo.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_p2p.o \
@@ -417,7 +417,6 @@
 		$(MAC_SRC_DIR)/pe/lim/lim_process_deauth_frame.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_process_disassoc_frame.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_process_message_queue.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_mlm_host_roam.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_process_mlm_req_messages.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_process_mlm_rsp_messages.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_process_probe_req_frame.o \
@@ -427,7 +426,6 @@
 		$(MAC_SRC_DIR)/pe/lim/lim_scan_result_utils.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_security_utils.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_send_management_frames.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_send_frames_host_roam.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_send_messages.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_send_sme_rsp_messages.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_ser_des_utils.o \
@@ -436,7 +434,6 @@
 		$(MAC_SRC_DIR)/pe/lim/lim_sme_req_utils.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_sta_hash_api.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_timer_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_roam_timer_utils.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_trace.o \
 		$(MAC_SRC_DIR)/pe/lim/lim_utils.o
 
@@ -444,6 +441,14 @@
 MAC_LIM_OBJS += $(MAC_SRC_DIR)/pe/lim/lim_process_tdls.o
 endif
 
+ifeq ($(CONFIG_QCACLD_WLAN_LFR2),y)
+	MAC_LIM_OBJS += $(MAC_SRC_DIR)/pe/lim/lim_process_mlm_host_roam.o \
+		$(MAC_SRC_DIR)/pe/lim/lim_send_frames_host_roam.o \
+		$(MAC_SRC_DIR)/pe/lim/lim_roam_timer_utils.o \
+		$(MAC_SRC_DIR)/pe/lim/lim_ft_preauth.o \
+		$(MAC_SRC_DIR)/pe/lim/lim_reassoc_utils.o
+endif
+
 MAC_SCH_OBJS := $(MAC_SRC_DIR)/pe/sch/sch_api.o \
 		$(MAC_SRC_DIR)/pe/sch/sch_beacon_gen.o \
 		$(MAC_SRC_DIR)/pe/sch/sch_beacon_process.o \
@@ -500,13 +505,18 @@
 		-I$(WLAN_ROOT)/$(SME_SRC_DIR)/csr
 
 SME_CSR_OBJS := $(SME_SRC_DIR)/csr/csr_api_roam.o \
-		$(SME_SRC_DIR)/csr/csr_roam_preauth.o \
 		$(SME_SRC_DIR)/csr/csr_api_scan.o \
 		$(SME_SRC_DIR)/csr/csr_cmd_process.o \
 		$(SME_SRC_DIR)/csr/csr_link_list.o \
 		$(SME_SRC_DIR)/csr/csr_neighbor_roam.o \
 		$(SME_SRC_DIR)/csr/csr_util.o \
+
+
+ifeq ($(CONFIG_QCACLD_WLAN_LFR2),y)
+SME_CSR_OBJS += $(SME_SRC_DIR)/csr/csr_roam_preauth.o \
 		$(SME_SRC_DIR)/csr/csr_host_scan_roam.o
+endif
+
 
 ifeq ($(CONFIG_QCOM_TDLS),y)
 SME_CSR_OBJS += $(SME_SRC_DIR)/csr/csr_tdls_process.o
@@ -1019,6 +1029,10 @@
 CDEFINES += -DWLAN_FEATURE_ROAM_OFFLOAD
 endif
 
+ifeq ($(CONFIG_QCACLD_WLAN_LFR2),y)
+CDEFINES += -DWLAN_FEATURE_HOST_ROAM
+endif
+
 ifeq ($(CONFIG_PRIMA_WLAN_OKC),y)
 CDEFINES += -DFEATURE_WLAN_OKC
 endif
diff --git a/Kconfig b/Kconfig
index 029683a..13c92b8 100644
--- a/Kconfig
+++ b/Kconfig
@@ -115,4 +115,8 @@
 	bool "Enable MCC to SCC Switch Logic"
 	default n
 
+config QCACLD_WLAN_LFR2
+	bool "Enable the WLAN Legacy Fast Roaming feature Version 2"
+	default n
+
 endif # QCA_CLD_WLAN
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index 53a8445..0e3224a 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -1645,4 +1645,17 @@
 static inline void hdd_set_tso_flags(hdd_context_t *hdd_ctx,
 	 struct net_device *wlan_dev){}
 #endif /* FEATURE_TSO */
+
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+static inline bool is_roaming_offload_enabled(hdd_context_t *hdd_ctx)
+{
+	return hdd_ctx->config->isRoamOffloadEnabled;
+}
+#else
+static inline bool is_roaming_offload_enabled(hdd_context_t *hdd_ctx)
+{
+	return false;
+}
+#endif
+
 #endif /* end #if !defined(WLAN_HDD_MAIN_H) */
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 1ce82c2..cdf0e41 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -2184,7 +2184,7 @@
 		return -EPERM;
 	}
 
-	if (hdd_ctx_ptr->config->isRoamOffloadEnabled) {
+	if (is_roaming_offload_enabled(hdd_ctx_ptr)) {
 		hddLog(LOG1, FL("Key Mgmt Offload is supported"));
 		wlan_hdd_cfg80211_set_feature(feature_flags,
 				QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD);
@@ -2889,6 +2889,7 @@
 
 	return ret;
 }
+#endif
 
 static const struct nla_policy qca_wlan_vendor_get_wifi_info_policy[
 			QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_MAX + 1] = {
@@ -3086,6 +3087,7 @@
 	return ret;
 }
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 /**
  * wlan_hdd_send_roam_auth_event() - Send the roamed and authorized event
  * @hdd_ctx_ptr: pointer to HDD Context.
@@ -3126,7 +3128,7 @@
 		return -EINVAL;
 	}
 
-	if (!hdd_ctx_ptr->config->isRoamOffloadEnabled ||
+	if (!is_roaming_offload_enabled(hdd_ctx_ptr) ||
 			!roam_info_ptr->roamSynchInProgress)
 		return 0;
 
@@ -3221,7 +3223,7 @@
 	kfree_skb(skb);
 	return -EINVAL;
 }
-#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
+#endif
 
 static const struct nla_policy
 wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1] = {
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index eb2622b..9723486 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -4640,6 +4640,10 @@
 		FL("Not able to post ROAM_INVOKE_CMD message to WMA"));
 	}
 }
+#else
+static inline void hdd_wma_send_fastreassoc_cmd(int sessionId,
+		tSirMacAddr bssid, int channel)
+{}
 #endif
 static int drv_cmd_fast_reassoc(hdd_adapter_t *adapter,
 				hdd_context_t *hdd_ctx,
@@ -4713,13 +4717,11 @@
 		hddLog(LOGE, FL("Invalid Channel [%d]"), channel);
 		return -EINVAL;
 	}
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (hdd_ctx->config->isRoamOffloadEnabled) {
+	if (is_roaming_offload_enabled(hdd_ctx)) {
 		hdd_wma_send_fastreassoc_cmd((int)adapter->sessionId,
 					targetApBssid, (int)channel);
 		goto exit;
 	}
-#endif
 	/* Proceed with reassoc */
 	handoffInfo.channel = channel;
 	handoffInfo.src = FASTREASSOC;
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index 7859837..e6d13f0 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -154,12 +154,11 @@
 #endif /* FEATURE_WLAN_EXTSCAN */
 
 #define SIR_KRK_KEY_LEN 16
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 #define SIR_BTK_KEY_LEN 32
 #define SIR_KCK_KEY_LEN 16
 #define SIR_KEK_KEY_LEN 16
 #define SIR_REPLAY_CTR_LEN 8
-
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 #define SIR_UAPSD_BITOFFSET_ACVO     0
 #define SIR_UAPSD_BITOFFSET_ACVI     1
 #define SIR_UAPSD_BITOFFSET_ACBK     2
@@ -4006,7 +4005,6 @@
 	uint8_t event_data[];
 } tSirNanEvent, *tpSirNanEvent;
 #endif
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 typedef struct sSirSmeRoamOffloadSynchInd {
 	uint16_t messageType;   /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
 	uint16_t length;
@@ -4034,6 +4032,7 @@
 	tpSirBssDescription  bss_desc_ptr;
 } roam_offload_synch_ind;
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 typedef struct sSirSmeRoamOffloadSynchCnf {
 	uint8_t sessionId;
 } tSirSmeRoamOffloadSynchCnf, *tpSirSmeRoamOffloadSynchCnf;
diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h
index 149a2c0..126f2aa 100644
--- a/core/mac/src/pe/include/lim_api.h
+++ b/core/mac/src/pe/include/lim_api.h
@@ -170,6 +170,13 @@
 QDF_STATUS pe_roam_synch_callback(tpAniSirGlobal mac_ctx,
 	struct sSirSmeRoamOffloadSynchInd *roam_sync_ind_ptr,
 	tpSirBssDescription  bss_desc_ptr);
+#else
+static inline QDF_STATUS pe_roam_synch_callback(tpAniSirGlobal mac_ctx,
+	struct sSirSmeRoamOffloadSynchInd *roam_sync_ind_ptr,
+	tpSirBssDescription  bss_desc_ptr)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
 #endif
 #define limGetQosMode(psessionEntry, pVal) (*(pVal) = (psessionEntry)->limQosEnabled)
 #define limGetWmeMode(psessionEntry, pVal) (*(pVal) = (psessionEntry)->limWmeEnabled)
diff --git a/core/mac/src/pe/include/lim_ft.h b/core/mac/src/pe/include/lim_ft.h
index 2b40efc..01307d7 100644
--- a/core/mac/src/pe/include/lim_ft.h
+++ b/core/mac/src/pe/include/lim_ft.h
@@ -45,45 +45,91 @@
    ------------------------------------------------------------------------*/
 void lim_ft_open(tpAniSirGlobal pMac, tpPESession psessionEntry);
 void lim_ft_cleanup(tpAniSirGlobal pMac, tpPESession psessionEntry);
-void lim_ft_cleanup_pre_auth_info(tpAniSirGlobal pMac, tpPESession psessionEntry);
+#ifdef WLAN_FEATURE_HOST_ROAM
+void lim_ft_cleanup_pre_auth_info(tpAniSirGlobal pMac,
+		tpPESession psessionEntry);
 int lim_process_ft_pre_auth_req(tpAniSirGlobal pMac, tpSirMsgQ pMsg);
+void lim_process_ft_preauth_rsp_timeout(tpAniSirGlobal pMac);
+void lim_process_mlm_ft_reassoc_req(tpAniSirGlobal pMac, uint32_t *pMsgBuf,
+		tpPESession psessionEntry);
 void lim_perform_ft_pre_auth(tpAniSirGlobal pMac, QDF_STATUS status,
-			     uint32_t *data, tpPESession psessionEntry);
-void limPerformPostFTPreAuth(tpAniSirGlobal pMac, QDF_STATUS status,
-			     uint32_t *data, tpPESession psessionEntry);
-void limFTResumeLinkCb(tpAniSirGlobal pMac, QDF_STATUS status, uint32_t *data);
+		uint32_t *data, tpPESession psessionEntry);
 void lim_post_ft_pre_auth_rsp(tpAniSirGlobal pMac, tSirRetStatus status,
-			      uint8_t *auth_rsp, uint16_t auth_rsp_length,
-			      tpPESession psessionEntry);
+		uint8_t *auth_rsp, uint16_t auth_rsp_length,
+		tpPESession psessionEntry);
 void lim_handle_ft_pre_auth_rsp(tpAniSirGlobal pMac, tSirRetStatus status,
-				uint8_t *auth_rsp, uint16_t auth_rsp_len,
-				tpPESession psessionEntry);
-void lim_process_mlm_reassoc_cnf(tpAniSirGlobal, uint32_t *);
+		uint8_t *auth_rsp, uint16_t auth_rsp_len,
+		tpPESession psessionEntry);
+tSirRetStatus lim_ft_setup_auth_session(tpAniSirGlobal pMac,
+		tpPESession psessionEntry);
+void lim_process_mlm_reassoc_cnf(tpAniSirGlobal mac_ctx, uint32_t *msg);
 void lim_process_sta_mlm_add_bss_rsp_ft(tpAniSirGlobal pMac,
 		tpSirMsgQ limMsgQ, tpPESession psessionEntry);
-void lim_process_mlm_reassoc_req(tpAniSirGlobal, uint32_t *);
-void lim_process_mlm_ft_reassoc_req(tpAniSirGlobal pMac, uint32_t *pMsgBuf,
-				    tpPESession psessionEntry);
-void lim_process_ft_preauth_rsp_timeout(tpAniSirGlobal pMac);
+void lim_process_mlm_reassoc_req(tpAniSirGlobal mac_ctx, uint32_t *msg);
 void lim_preauth_scan_event_handler(tpAniSirGlobal mac_ctx,
 				enum lim_scan_event_type event,
 				uint8_t session_id,
 				uint32_t scan_id);
-tSirRetStatus lim_ft_setup_auth_session(tpAniSirGlobal pMac,
-					tpPESession psessionEntry);
+QDF_STATUS lim_send_preauth_scan_offload(tpAniSirGlobal mac_ctx,
+		uint8_t session_id, tSirFTPreAuthReq *ft_preauth_req);
+#else
+static inline void lim_ft_cleanup_pre_auth_info(tpAniSirGlobal pMac,
+		tpPESession psessionEntry)
+{}
+static inline void lim_process_ft_preauth_rsp_timeout(tpAniSirGlobal pMac)
+{}
+static inline void lim_process_mlm_ft_reassoc_req(tpAniSirGlobal pMac,
+		uint32_t *pMsgBuf, tpPESession psessionEntry)
+{}
+static inline void lim_handle_ft_pre_auth_rsp(tpAniSirGlobal pMac,
+		tSirRetStatus status, uint8_t *auth_rsp,
+		uint16_t auth_rsp_len, tpPESession psessionEntry)
+{}
+static inline void lim_process_mlm_reassoc_cnf(tpAniSirGlobal mac_ctx,
+		uint32_t *msg)
+{}
+static inline void lim_process_sta_mlm_add_bss_rsp_ft(tpAniSirGlobal pMac,
+		tpSirMsgQ limMsgQ, tpPESession psessionEntry)
+{}
+static inline void lim_process_mlm_reassoc_req(tpAniSirGlobal mac_ctx,
+		uint32_t *msg)
+{}
+static inline void lim_preauth_scan_event_handler(tpAniSirGlobal mac_ctx,
+		enum lim_scan_event_type event,
+		uint8_t session_id, uint32_t scan_id)
+{}
+static inline int lim_process_ft_pre_auth_req(tpAniSirGlobal pMac,
+		tpSirMsgQ pMsg)
+{
+	return 0;
+}
+#endif
 
-bool lim_process_ft_update_key(tpAniSirGlobal pMac, uint32_t *pMsgBuf);
-tSirRetStatus lim_process_ft_aggr_qos_req(tpAniSirGlobal pMac, uint32_t *pMsgBuf);
-void lim_process_ft_aggr_qo_s_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg);
-void lim_ft_cleanup_all_ft_sessions(tpAniSirGlobal pMac);
+#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 void lim_fill_ft_session(tpAniSirGlobal pMac,
 		tpSirBssDescription pbssDescription,
 		tpPESession pftSessionEntry,
 		tpPESession psessionEntry);
-tSirRetStatus lim_ft_prepare_add_bss_req(tpAniSirGlobal pMac,
-		uint8_t updateEntry,
+void lim_ft_prepare_add_bss_req(tpAniSirGlobal pMac, uint8_t updateEntry,
 		tpPESession pftSessionEntry,
 		tpSirBssDescription bssDescription);
 QDF_STATUS lim_send_preauth_scan_offload(tpAniSirGlobal mac_ctx,
 		uint8_t session_id, tSirFTPreAuthReq *ft_preauth_req);
+#else
+static inline void lim_fill_ft_session(tpAniSirGlobal pMac,
+		tpSirBssDescription pbssDescription,
+		tpPESession pftSessionEntry,
+		tpPESession psessionEntry)
+{}
+static inline void lim_ft_prepare_add_bss_req(tpAniSirGlobal pMac,
+		uint8_t updateEntry, tpPESession pftSessionEntry,
+		tpSirBssDescription bssDescription)
+{}
+#endif
+
+bool lim_process_ft_update_key(tpAniSirGlobal pMac, uint32_t *pMsgBuf);
+tSirRetStatus lim_process_ft_aggr_qos_req(tpAniSirGlobal pMac,
+		uint32_t *pMsgBuf);
+void lim_process_ft_aggr_qo_s_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg);
+void lim_ft_cleanup_all_ft_sessions(tpAniSirGlobal pMac);
 #endif /* __LIMFT_H__ */
diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c
index 673e5c3..04f13f0 100644
--- a/core/mac/src/pe/lim/lim_assoc_utils.c
+++ b/core/mac/src/pe/lim/lim_assoc_utils.c
@@ -608,7 +608,7 @@
 	pStaDs->valid = 0;
 	lim_send_sme_tsm_ie_ind(pMac, psessionEntry, 0, 0, 0);
 	/* Any roaming related changes should be above this line */
-	if (psessionEntry->bRoamSynchInProgress)
+	if (lim_is_roam_synch_in_progress(psessionEntry))
 		return eSIR_SUCCESS;
 	pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_DEL_STA_RSP_STATE;
 
diff --git a/core/mac/src/pe/lim/lim_assoc_utils.h b/core/mac/src/pe/lim/lim_assoc_utils.h
index 43c5d90..9e605f1 100644
--- a/core/mac/src/pe/lim/lim_assoc_utils.h
+++ b/core/mac/src/pe/lim/lim_assoc_utils.h
@@ -84,8 +84,6 @@
 			       uint8_t *pSupportedMCSSet,
 			       tpPESession psessionEntry,
 			       tDot11fIEVHTCaps * pVHTCaps);
-void lim_handle_del_bss_in_re_assoc_context(tpAniSirGlobal pMac,
-		   tpDphHashNode pStaDs, tpPESession psessionEntry);
 
 #define MCSMAPMASK1x1 0x3
 #define MCSMAPMASK2x2 0xC
@@ -93,16 +91,66 @@
 tSirRetStatus lim_add_sta(tpAniSirGlobal, tpDphHashNode, uint8_t, tpPESession);
 tSirRetStatus lim_del_bss(tpAniSirGlobal, tpDphHashNode, uint16_t, tpPESession);
 tSirRetStatus lim_del_sta(tpAniSirGlobal, tpDphHashNode, bool, tpPESession);
-tSirRetStatus lim_add_ft_sta_self(tpAniSirGlobal pMac, uint16_t assocId,
-				  tpPESession psessionEntry);
 tSirRetStatus lim_add_sta_self(tpAniSirGlobal, uint16_t, uint8_t, tpPESession);
 
 void lim_teardown_infra_bss(tpAniSirGlobal, tpPESession);
+#ifdef WLAN_FEATURE_HOST_ROAM
 void lim_restore_pre_reassoc_state(tpAniSirGlobal,
 				   tSirResultCodes, uint16_t, tpPESession);
 void lim_post_reassoc_failure(tpAniSirGlobal,
 			      tSirResultCodes, uint16_t, tpPESession);
 bool lim_is_reassoc_in_progress(tpAniSirGlobal, tpPESession);
+
+void lim_handle_add_bss_in_re_assoc_context(tpAniSirGlobal pMac,
+		tpDphHashNode pStaDs, tpPESession psessionEntry);
+void lim_handle_del_bss_in_re_assoc_context(tpAniSirGlobal pMac,
+		   tpDphHashNode pStaDs, tpPESession psessionEntry);
+void lim_send_retry_reassoc_req_frame(tpAniSirGlobal pMac,
+	      tLimMlmReassocReq *pMlmReassocReq, tpPESession psessionEntry);
+tSirRetStatus lim_add_ft_sta_self(tpAniSirGlobal pMac, uint16_t assocId,
+				  tpPESession psessionEntry);
+#else
+static inline void lim_restore_pre_reassoc_state(tpAniSirGlobal mac_ctx,
+			tSirResultCodes res_code, uint16_t prot_status,
+			tpPESession pe_session)
+{}
+static inline void lim_post_reassoc_failure(tpAniSirGlobal mac_ctx,
+			      tSirResultCodes res_code, uint16_t prot_status,
+			      tpPESession pe_session)
+{}
+static inline void lim_handle_add_bss_in_re_assoc_context(tpAniSirGlobal pMac,
+		tpDphHashNode pStaDs, tpPESession psessionEntry)
+{}
+static inline void lim_handle_del_bss_in_re_assoc_context(tpAniSirGlobal pMac,
+		   tpDphHashNode pStaDs, tpPESession psessionEntry)
+{}
+static inline void lim_send_retry_reassoc_req_frame(tpAniSirGlobal pMac,
+	      tLimMlmReassocReq *pMlmReassocReq, tpPESession psessionEntry)
+{}
+static inline bool lim_is_reassoc_in_progress(tpAniSirGlobal mac_ctx,
+		tpPESession pe_session)
+{
+	return false;
+}
+static inline tSirRetStatus lim_add_ft_sta_self(tpAniSirGlobal pMac,
+		uint16_t assocId, tpPESession psessionEntry)
+{
+	return eSIR_SUCCESS;
+}
+#endif
+
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+static inline bool lim_is_roam_synch_in_progress(tpPESession pe_session)
+{
+	return pe_session->bRoamSynchInProgress;
+}
+#else
+static inline bool lim_is_roam_synch_in_progress(tpPESession pe_session)
+{
+	return false;
+}
+#endif
+
 void
 lim_send_del_sta_cnf(tpAniSirGlobal pMac, struct qdf_mac_addr sta_dsaddr,
 		     uint16_t staDsAssocId, tLimMlmStaContext mlmStaContext,
@@ -150,18 +198,10 @@
 tSirRetStatus lim_is_dot11h_power_capabilities_in_range(tpAniSirGlobal pMac,
 							tSirAssocReq *assoc,
 							tpPESession);
-
-/* API to re-add the same BSS during re-association */
-void lim_handle_add_bss_in_re_assoc_context(tpAniSirGlobal pMac, tpDphHashNode pStaDs,
-					    tpPESession psessionEntry);
-
 /* API to fill in RX Highest Supported data Rate */
 void lim_fill_rx_highest_supported_rate(tpAniSirGlobal pMac,
 					uint16_t *rxHighestRate,
 					uint8_t *pSupportedMCSSet);
-void lim_send_retry_reassoc_req_frame(tpAniSirGlobal pMac,
-				      tLimMlmReassocReq *pMlmReassocReq,
-				      tpPESession psessionEntry);
 #ifdef WLAN_FEATURE_11W
 void lim_send_sme_unprotected_mgmt_frame_ind(tpAniSirGlobal pMac, uint8_t frameType,
 					     uint8_t *frame, uint32_t frameLen,
diff --git a/core/mac/src/pe/lim/lim_ft.c b/core/mac/src/pe/lim/lim_ft.c
index f794947..01a2afc 100644
--- a/core/mac/src/pe/lim/lim_ft.c
+++ b/core/mac/src/pe/lim/lim_ft.c
@@ -119,6 +119,7 @@
 	qdf_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext), 0);
 }
 
+#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 /*------------------------------------------------------------------
  *
  * Create the new Add Bss Req to the new AP.
@@ -126,10 +127,9 @@
  * The newly created ft Session entry is passed to this function
  *
  *------------------------------------------------------------------*/
-tSirRetStatus lim_ft_prepare_add_bss_req(tpAniSirGlobal pMac,
-					 uint8_t updateEntry,
-					 tpPESession pftSessionEntry,
-					 tpSirBssDescription bssDescription)
+void lim_ft_prepare_add_bss_req(tpAniSirGlobal pMac,
+		uint8_t updateEntry, tpPESession pftSessionEntry,
+		tpSirBssDescription bssDescription)
 {
 	tpAddBssParams pAddBssParams = NULL;
 	tAddStaParams *sta_ctx;
@@ -139,14 +139,14 @@
 	/* Nothing to be done if the session is not in STA mode */
 	if (!LIM_IS_STA_ROLE(pftSessionEntry)) {
 		lim_log(pMac, LOGE, FL("psessionEntry is not in STA mode"));
-		return eSIR_FAILURE;
+		return;
 	}
 
 	pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct));
 	if (NULL == pBeaconStruct) {
 		lim_log(pMac, LOGE,
 			FL("Unable to allocate memory for creating ADD_BSS"));
-		return eSIR_MEM_ALLOC_FAILED;
+		return;
 	}
 	/* Package SIR_HAL_ADD_BSS_REQ message parameters */
 	pAddBssParams = qdf_mem_malloc(sizeof(tAddBssParams));
@@ -154,7 +154,7 @@
 		qdf_mem_free(pBeaconStruct);
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory for creating ADD_BSS"));
-		return eSIR_MEM_ALLOC_FAILED;
+		return;
 	}
 
 	qdf_mem_set((uint8_t *) pAddBssParams, sizeof(tAddBssParams), 0);
@@ -457,7 +457,7 @@
 	pAddBssParams->sessionId = pftSessionEntry->peSessionId;
 
 	/* Set a new state for MLME */
-	if (!pftSessionEntry->bRoamSynchInProgress) {
+	if (!lim_is_roam_synch_in_progress(pftSessionEntry)) {
 		pftSessionEntry->limMlmState =
 			eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE;
 		MTRACE(mac_trace
@@ -469,12 +469,14 @@
 
 	pftSessionEntry->ftPEContext.pAddBssReq = pAddBssParams;
 
-	lim_log(pMac, LOG1, FL("Saving SIR_HAL_ADD_BSS_REQ for pre-auth ap..."));
+	lim_log(pMac, LOG1, FL("Saving SIR_HAL_ADD_BSS_REQ for pre-auth ap."));
 
 	qdf_mem_free(pBeaconStruct);
-	return 0;
+	return;
 }
+#endif
 
+#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 /*------------------------------------------------------------------
  *
  * Setup the new session for the pre-auth AP.
@@ -667,7 +669,7 @@
 		regMax, localPowerConstraint,
 		pMac->roam.configParam.nTxPowerCap,
 		pftSessionEntry->maxTxPower);
-	if (!psessionEntry->bRoamSynchInProgress) {
+	if (!lim_is_roam_synch_in_progress(psessionEntry)) {
 		pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState;
 		pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE;
 		MTRACE(mac_trace(pMac,
@@ -692,6 +694,7 @@
 
 	qdf_mem_free(pBeaconStruct);
 }
+#endif
 
 /*------------------------------------------------------------------
  *
diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c
index 707d6e6..03577a9 100644
--- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c
+++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c
@@ -535,16 +535,14 @@
 	tSchBeaconStruct *beacon;
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	uint8_t sme_sessionid = 0;
-#endif
 	tCsrRoamSession *roam_session;
+#endif
 
 	/* Initialize status code to success. */
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (session_entry->bRoamSynchInProgress)
+	if (lim_is_roam_synch_in_progress(session_entry))
 		hdr = (tpSirMacMgmtHdr) mac_ctx->roam.pReassocResp;
 	else
-#endif
-	hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
+		hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	sme_sessionid = session_entry->smeSessionId;
 #endif
@@ -587,21 +585,17 @@
 		qdf_mem_free(beacon);
 		return;
 	}
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (session_entry->bRoamSynchInProgress) {
+	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;
 	} else {
-#endif
-	hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
-	frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-}
-#endif
+		hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
+		frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
+	}
 	if (((subtype == LIM_ASSOC) &&
 		(session_entry->limMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE)) ||
 		((subtype == LIM_REASSOC) &&
-		 !session_entry->bRoamSynchInProgress &&
+		 !lim_is_roam_synch_in_progress(session_entry) &&
 		((session_entry->limMlmState != eLIM_MLM_WT_REASSOC_RSP_STATE)
 		&& (session_entry->limMlmState !=
 		eLIM_MLM_WT_FT_REASSOC_RSP_STATE)
@@ -667,12 +661,10 @@
 		return;
 	}
 	/* Get pointer to Re/Association Response frame body */
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (session_entry->bRoamSynchInProgress)
+	if (lim_is_roam_synch_in_progress(session_entry))
 		body = mac_ctx->roam.pReassocResp + SIR_MAC_HDR_LEN_3A;
 	else
-#endif
-	body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
+		body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
 	/* parse Re/Association Response frame. */
 	if (sir_convert_assoc_resp_frame2_struct(mac_ctx, body,
 		frame_len, assoc_rsp) == eSIR_FAILURE) {
@@ -853,7 +845,7 @@
 	if (!((session_entry->bssType == eSIR_BTAMP_STA_MODE) ||
 		((session_entry->bssType == eSIR_BTAMP_AP_MODE) &&
 		LIM_IS_BT_AMP_STA_ROLE(session_entry)) ||
-		session_entry->bRoamSynchInProgress)) {
+		lim_is_roam_synch_in_progress(session_entry))) {
 		if (lim_set_link_state
 			(mac_ctx, eSIR_LINK_POSTASSOC_STATE,
 			session_entry->bssId,
@@ -909,7 +901,7 @@
 		}
 		if ((session_entry->limMlmState ==
 		    eLIM_MLM_WT_FT_REASSOC_RSP_STATE) ||
-			session_entry->bRoamSynchInProgress) {
+			lim_is_roam_synch_in_progress(session_entry)) {
 			lim_log(mac_ctx, LOG1, FL("Sending self sta"));
 			lim_update_assoc_sta_datas(mac_ctx, sta_ds, assoc_rsp,
 				session_entry);
@@ -920,17 +912,14 @@
 				session_entry->gLimEdcaParams,
 				session_entry);
 			/* Send the active EDCA parameters to HAL */
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-			if (!session_entry->bRoamSynchInProgress) {
-#endif
-			lim_send_edca_params(mac_ctx,
-				session_entry->gLimEdcaParamsActive,
-				sta_ds->bssId);
-			lim_add_ft_sta_self(mac_ctx, (assoc_rsp->aid & 0x3FFF),
-				session_entry);
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-		}
-#endif
+			if (!lim_is_roam_synch_in_progress(session_entry)) {
+				lim_send_edca_params(mac_ctx,
+					session_entry->gLimEdcaParamsActive,
+					sta_ds->bssId);
+				lim_add_ft_sta_self(mac_ctx,
+					(assoc_rsp->aid & 0x3FFF),
+					session_entry);
+			}
 			qdf_mem_free(beacon);
 			return;
 		}
diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c
index f524a28..5950dd3 100644
--- a/core/mac/src/pe/lim/lim_process_tdls.c
+++ b/core/mac/src/pe/lim/lim_process_tdls.c
@@ -3257,7 +3257,7 @@
 			CLEAR_BIT(session_entry->peerAIDBitmap[i], aid);
 		}
 	}
-	if (session_entry->bRoamSynchInProgress)
+	if (lim_is_roam_synch_in_progress(session_entry))
 		return eSIR_SUCCESS;
 	lim_send_sme_tdls_delete_all_peer_ind(mac_ctx, session_entry);
 
diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h
index 2bbb79d..c2a4bb4 100644
--- a/core/mac/src/pe/lim/lim_types.h
+++ b/core/mac/src/pe/lim/lim_types.h
@@ -458,11 +458,20 @@
 void lim_send_auth_mgmt_frame(tpAniSirGlobal, tSirMacAuthFrameBody *, tSirMacAddr,
 			      uint8_t, tpPESession, bool wait_for_ack);
 void lim_send_assoc_req_mgmt_frame(tpAniSirGlobal, tLimMlmAssocReq *, tpPESession);
+#ifdef WLAN_FEATURE_HOST_ROAM
+void lim_send_reassoc_req_with_ft_ies_mgmt_frame(tpAniSirGlobal pMac,
+		tLimMlmReassocReq *pMlmReassocReq, tpPESession psessionEntry);
 void lim_send_reassoc_req_mgmt_frame(tpAniSirGlobal, tLimMlmReassocReq *,
 				     tpPESession);
-void lim_send_reassoc_req_with_ft_ies_mgmt_frame(tpAniSirGlobal pMac,
-						 tLimMlmReassocReq *pMlmReassocReq,
-						 tpPESession psessionEntry);
+#else
+static inline void lim_send_reassoc_req_with_ft_ies_mgmt_frame(
+		tpAniSirGlobal pMac, tLimMlmReassocReq *pMlmReassocReq,
+		tpPESession psessionEntry)
+{}
+static inline void lim_send_reassoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
+		tLimMlmReassocReq *reassoc_req, tpPESession pe_session)
+{}
+#endif
 void lim_send_delts_req_action_frame(tpAniSirGlobal pMac, tSirMacAddr peer,
 				     uint8_t wmmTspecPresent,
 				     tSirMacTSInfo * pTsinfo,
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index 1ceeabd..b96e9b8 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -585,9 +585,21 @@
 void lim_update_obss_scanparams(tpPESession session,
 			tDot11fIEOBSSScanParameters *scan_params);
 void lim_init_obss_params(tpAniSirGlobal mac_ctx, tpPESession session);
+#ifdef WLAN_FEATURE_HOST_ROAM
 uint32_t lim_create_timers_host_roam(tpAniSirGlobal mac_ctx);
 void lim_delete_timers_host_roam(tpAniSirGlobal mac_ctx);
 void lim_deactivate_and_change_timer_host_roam(tpAniSirGlobal mac_ctx,
 		uint32_t timer_id);
+#else
+static inline uint32_t lim_create_timers_host_roam(tpAniSirGlobal mac_ctx)
+{
+	return 0;
+}
+static inline void lim_delete_timers_host_roam(tpAniSirGlobal mac_ctx)
+{}
+static inline void lim_deactivate_and_change_timer_host_roam(
+		tpAniSirGlobal mac_ctx, uint32_t timer_id)
+{}
+#endif
 
 #endif /* __LIM_UTILS_H */
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index 5570ac6..8a05500 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -1573,9 +1573,16 @@
 				     uint32_t staId, void *pContext);
 #endif /* FEATURE_WLAN_ESE */
 typedef void (*tCsrSnrCallback)(int8_t snr, uint32_t staId, void *pContext);
-
+#ifdef WLAN_FEATURE_HOST_ROAM
 QDF_STATUS csr_roam_issue_ft_preauth_req(tHalHandle hHal, uint32_t sessionId,
-					 tpSirBssDescription pBssDescription);
+		tpSirBssDescription pBssDescription);
+#else
+static inline QDF_STATUS csr_roam_issue_ft_preauth_req(tHalHandle hHal,
+		uint32_t sessionId, tpSirBssDescription pBssDescription)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
 QDF_STATUS csr_set_band(tHalHandle hHal, uint8_t sessionId, eCsrBand eBand);
 eCsrBand csr_get_current_band(tHalHandle hHal);
 typedef void (*csr_readyToSuspendCallback)(void *pContext, bool suspended);
diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h
index a476d8d..290584e 100644
--- a/core/sme/inc/csr_internal.h
+++ b/core/sme/inc/csr_internal.h
@@ -1008,10 +1008,8 @@
 	uint8_t RoamRssiDiff;
 	bool isWESModeEnabled;
 	uint32_t deauthRspStatus;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	uint8_t *pReassocResp;          /* reassociation response from new AP */
 	uint16_t reassocRespLen;        /* length of reassociation response */
-#endif
 } tCsrRoamStruct;
 
 #define GET_NEXT_ROAM_ID(pRoamStruct)  (((pRoamStruct)->nextRoamId + 1 == 0) ? \
@@ -1300,8 +1298,16 @@
 		uint8_t channel);
 QDF_STATUS csr_add_to_channel_list_front(uint8_t *pChannelList, int numChannels,
 		uint8_t channel);
+#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 QDF_STATUS csr_roam_offload_scan_rsp_hdlr(tpAniSirGlobal pMac,
 		tpSirRoamOffloadScanRsp scanOffloadRsp);
+#else
+static inline QDF_STATUS csr_roam_offload_scan_rsp_hdlr(tpAniSirGlobal pMac,
+		tpSirRoamOffloadScanRsp scanOffloadRsp)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
 QDF_STATUS csr_handoff_request(tpAniSirGlobal pMac, uint8_t sessionId,
 		tCsrHandoffRequest *pHandoffInfo);
 bool csr_roam_is_sta_mode(tpAniSirGlobal pMac, uint32_t sessionId);
@@ -1325,6 +1331,11 @@
 QDF_STATUS
 csr_roam_update_add_ies(tpAniSirGlobal pMac,
 		tSirUpdateIE *pUpdateIE, eUpdateIEsType updateType);
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+QDF_STATUS csr_scan_save_roam_offload_ap_to_scan_cache(tpAniSirGlobal pMac,
+		struct sSirSmeRoamOffloadSynchInd *roam_synch_ind_ptr,
+		tpSirBssDescription  bss_desc_ptr);
+void csr_process_ho_fail_ind(tpAniSirGlobal pMac, void *pMsgBuf);
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
 void csr_roaming_report_diag_event(tpAniSirGlobal mac_ctx,
 		roam_offload_synch_ind *roam_synch_ind_ptr,
@@ -1335,11 +1346,6 @@
 		eCsrDiagWlanStatusEventReason reason)
 {}
 #endif
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-QDF_STATUS csr_scan_save_roam_offload_ap_to_scan_cache(tpAniSirGlobal pMac,
-		roam_offload_synch_ind *roam_synch_ind_ptr,
-		tpSirBssDescription  bss_desc_ptr);
-void csr_process_ho_fail_ind(tpAniSirGlobal pMac, void *pMsgBuf);
 #endif
 bool csr_store_joinreq_param(tpAniSirGlobal mac_ctx,
 		tCsrRoamProfile *profile,
diff --git a/core/sme/inc/csr_neighbor_roam.h b/core/sme/inc/csr_neighbor_roam.h
index 5bae53f..1283abf 100644
--- a/core/sme/inc/csr_neighbor_roam.h
+++ b/core/sme/inc/csr_neighbor_roam.h
@@ -177,28 +177,95 @@
 		uint8_t sessionId, QDF_STATUS status);
 QDF_STATUS csr_neighbor_roam_indicate_disconnect(tpAniSirGlobal pMac,
 		uint8_t sessionId);
-bool csr_neighbor_roam_is_handoff_in_progress(tpAniSirGlobal pMac,
-		uint8_t sessionId);
-void csr_neighbor_roam_request_handoff(tpAniSirGlobal pMac, uint8_t sessionId);
 QDF_STATUS csr_neighbor_roam_init(tpAniSirGlobal pMac, uint8_t sessionId);
 void csr_neighbor_roam_close(tpAniSirGlobal pMac, uint8_t sessionId);
-void csr_neighbor_roam_purge_preauth_failed_list(tpAniSirGlobal pMac);
 QDF_STATUS csr_neighbor_roam_transit_to_cfg_chan_scan(tpAniSirGlobal pMac,
 		uint8_t sessionId);
 QDF_STATUS csrNeighborRoamTransitionToPreauthDone(tpAniSirGlobal pMac);
 QDF_STATUS csr_neighbor_roam_prepare_scan_profile_filter(tpAniSirGlobal pMac,
 		tCsrScanResultFilter *pScanFilter, uint8_t sessionId);
-bool csr_neighbor_roam_get_handoff_ap_info(tpAniSirGlobal pMac,
-		tpCsrNeighborRoamBSSInfo pHandoffNode, uint8_t sessionId);
 QDF_STATUS csr_neighbor_roam_preauth_rsp_handler(tpAniSirGlobal pMac,
 		uint8_t sessionId, tSirRetStatus limStatus);
 bool csr_neighbor_roam_is11r_assoc(tpAniSirGlobal pMac, uint8_t sessionId);
 QDF_STATUS csr_neighbor_roam_create_chan_list_from_neighbor_report(
 		tpAniSirGlobal pMac, uint8_t sessionId);
+#ifdef WLAN_FEATURE_HOST_ROAM
 void csr_neighbor_roam_tranistion_preauth_done_to_disconnected(
 		tpAniSirGlobal pMac, uint8_t sessionId);
 bool csr_neighbor_roam_state_preauth_done(tpAniSirGlobal pMac,
 		uint8_t sessionId);
+QDF_STATUS csr_roam_issue_reassociate_cmd(tpAniSirGlobal pMac,
+		uint32_t sessionId);
+void csr_neighbor_roam_free_roamable_bss_list(tpAniSirGlobal mac_ctx,
+		tDblLinkList *llist);
+bool csr_neighbor_roam_get_handoff_ap_info(tpAniSirGlobal pMac,
+		tpCsrNeighborRoamBSSInfo pHandoffNode, uint8_t sessionId);
+QDF_STATUS csr_roam_issue_reassociate(tpAniSirGlobal pMac,
+		uint32_t sessionId, tSirBssDescription *pSirBssDesc,
+		tDot11fBeaconIEs *pIes, tCsrRoamProfile *pProfile);
+void csr_neighbor_roam_request_handoff(tpAniSirGlobal pMac, uint8_t sessionId);
+QDF_STATUS csr_neighbor_roam_candidate_found_ind_hdlr(tpAniSirGlobal pMac,
+		void *pMsg);
+QDF_STATUS csr_neighbor_roam_process_scan_complete(tpAniSirGlobal pMac,
+		uint8_t sessionId);
+bool csr_neighbor_roam_is_handoff_in_progress(tpAniSirGlobal pMac,
+		uint8_t sessionId);
+void csr_neighbor_roam_reset_preauth_control_info(
+		tpAniSirGlobal mac_ctx, uint8_t session_id);
+void csr_neighbor_roam_purge_preauth_failed_list(tpAniSirGlobal pMac);
+#else
+static inline bool csr_neighbor_roam_state_preauth_done(tpAniSirGlobal pMac,
+		uint8_t sessionId)
+{
+	return false;
+}
+static inline QDF_STATUS csr_roam_issue_reassociate_cmd(tpAniSirGlobal pMac,
+		uint32_t sessionId)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+static inline QDF_STATUS csr_roam_issue_reassociate(tpAniSirGlobal pMac,
+		uint32_t sessionId, tSirBssDescription *pSirBssDesc,
+		tDot11fBeaconIEs *pIes, tCsrRoamProfile *pProfile)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+static inline QDF_STATUS csr_neighbor_roam_candidate_found_ind_hdlr(
+		tpAniSirGlobal pMac, void *pMsg)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+static inline QDF_STATUS csr_neighbor_roam_process_scan_complete(
+		tpAniSirGlobal pMac, uint8_t sessionId)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+static inline void csr_neighbor_roam_tranistion_preauth_done_to_disconnected(
+		tpAniSirGlobal pMac, uint8_t sessionId)
+{}
+static inline void csr_neighbor_roam_free_roamable_bss_list(
+		tpAniSirGlobal mac_ctx, tDblLinkList *llist)
+{}
+static inline void csr_neighbor_roam_request_handoff(tpAniSirGlobal pMac,
+		uint8_t sessionId)
+{}
+static inline void csr_neighbor_roam_reset_preauth_control_info(
+		tpAniSirGlobal mac_ctx, uint8_t session_id)
+{}
+static inline void csr_neighbor_roam_purge_preauth_failed_list(
+		tpAniSirGlobal pMac)
+{}
+static inline bool csr_neighbor_roam_get_handoff_ap_info(tpAniSirGlobal pMac,
+		tpCsrNeighborRoamBSSInfo pHandoffNode, uint8_t sessionId)
+{
+	return false;
+}
+static inline bool csr_neighbor_roam_is_handoff_in_progress(tpAniSirGlobal pMac,
+		uint8_t sessionId)
+{
+	return false;
+}
+#endif
 bool csr_neighbor_middle_of_roaming(tpAniSirGlobal pMac, uint8_t sessionId);
 QDF_STATUS csr_neighbor_roam_set_lookup_rssi_threshold(tpAniSirGlobal pMac,
 		uint8_t sessionId, uint8_t neighborLookupRssiThreshold);
@@ -270,10 +337,16 @@
 #define REASON_ROAM_SCAN_HI_RSSI_DELAY_CHANGED      32
 #define REASON_ROAM_SCAN_HI_RSSI_UB_CHANGED         33
 
+#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 QDF_STATUS csr_roam_offload_scan(tpAniSirGlobal pMac, uint8_t sessionId,
 		uint8_t command, uint8_t reason);
-QDF_STATUS csr_neighbor_roam_candidate_found_ind_hdlr(tpAniSirGlobal pMac,
-		void *pMsg);
+#else
+static inline QDF_STATUS csr_roam_offload_scan(tpAniSirGlobal pMac,
+		uint8_t sessionId, uint8_t command, uint8_t reason)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
 QDF_STATUS csr_neighbor_roam_handoff_req_hdlr(tpAniSirGlobal pMac, void *pMsg);
 QDF_STATUS csr_neighbor_roam_proceed_with_handoff_req(tpAniSirGlobal pMac,
 		uint8_t sessionId);
@@ -294,6 +367,11 @@
 void csr_roam_synch_callback(tpAniSirGlobal mac,
 	roam_offload_synch_ind *roam_synch_data,
 	tpSirBssDescription  bss_desc_ptr, uint8_t reason);
+#else
+static inline void csr_roam_synch_callback(tpAniSirGlobal mac,
+	roam_offload_synch_ind *roam_synch_data,
+	tpSirBssDescription  bss_desc_ptr, uint8_t reason)
+{}
 #endif
 void csr_neighbor_roam_state_transition(tpAniSirGlobal mac_ctx,
 		uint8_t newstate, uint8_t session);
@@ -307,8 +385,6 @@
 		tpCsrNeighborRoamBSSInfo neighborRoamBSSNode);
 QDF_STATUS csr_neighbor_roam_issue_preauth_req(tpAniSirGlobal pMac,
 		uint8_t sessionId);
-void csr_neighbor_roam_reset_preauth_control_info(
-		tpAniSirGlobal mac_ctx, uint8_t session_id);
 bool csr_neighbor_roam_is_preauth_candidate(tpAniSirGlobal pMac,
 		    uint8_t sessionId, tSirMacAddr bssId);
 #ifdef FEATURE_WLAN_LFR_METRICS
@@ -320,18 +396,9 @@
 		tSirMacAddr bssid, eRoamCmdStatus status)
 {}
 #endif
-void csr_neighbor_roam_free_roamable_bss_list(tpAniSirGlobal mac_ctx,
-		tDblLinkList * llist);
-QDF_STATUS csr_neighbor_roam_process_scan_complete(tpAniSirGlobal pMac,
-		uint8_t sessionId);
 QDF_STATUS csr_roam_stop_wait_for_key_timer(tpAniSirGlobal pMac);
 uint32_t csr_get_current_ap_rssi(tpAniSirGlobal pMac,
 		tScanResultHandle *pScanResultList, uint8_t sessionId);
-QDF_STATUS csr_roam_issue_reassociate(tpAniSirGlobal pMac,
-		uint32_t sessionId, tSirBssDescription *pSirBssDesc,
-		tDot11fBeaconIEs *pIes, tCsrRoamProfile *pProfile);
-QDF_STATUS csr_roam_issue_reassociate_cmd(tpAniSirGlobal pMac,
-		uint32_t sessionId);
 QDF_STATUS csr_roam_copy_connected_profile(tpAniSirGlobal pMac,
 		uint32_t sessionId, tCsrRoamProfile *pDstProfile);
 
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 310dd9a..15c702f 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -6355,7 +6355,6 @@
 	tSirBssDescription *bss_desc = NULL;
 	tCsrScanResult *scan_res = NULL;
 	sme_qos_csr_event_indType ind_qos;
-	csr_roam_offload_synch_params *roam_offload_params = NULL;
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
 	tSirSmeHTProfile *src_profile = NULL;
 	tCsrRoamHTProfile *dst_profile = NULL;
@@ -6367,7 +6366,6 @@
 	tSirSmeJoinRsp *join_rsp = (tSirSmeJoinRsp *) context;
 	uint32_t len;
 
-	roam_offload_params = &session->roamOffloadSynchParams;
 	conn_profile = &session->connectedProfile;
 	if (eCsrReassocSuccess == res)
 		ind_qos = SME_QOS_CSR_REASSOC_COMPLETE;
@@ -6496,63 +6494,49 @@
 				bss_desc, &bcast_mac, false, false,
 				eSIR_TX_RX, 0, 0, NULL, 0);
 		} else {
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-			if (session->roam_synch_in_progress
-				&& (roam_offload_params->authStatus
-				== CSR_ROAM_AUTH_STATUS_AUTHENTICATED)) {
-				QDF_TRACE(QDF_MODULE_ID_SME,
-					QDF_TRACE_LEVEL_DEBUG,
-					FL("LFR3:Don't start waitforkey timer"));
-				csr_roam_substate_change(mac_ctx,
-					eCSR_ROAM_SUBSTATE_NONE, session_id);
-			} else {
-#endif
-				/* Need to wait for supplicant authtication */
-				roam_info.fAuthRequired = true;
-				/*
-				 * Set the substate to WaitForKey in case
-				 * authentiation is needed
-				 */
-				csr_roam_substate_change(mac_ctx,
+			/* Need to wait for supplicant authtication */
+			roam_info.fAuthRequired = true;
+			/*
+			 * Set the substate to WaitForKey in case
+			 * authentiation is needed
+			 */
+			csr_roam_substate_change(mac_ctx,
 					eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
 					session_id);
 
-				/*
-				 * Set remain_in_power_active_till_dhcp to make
-				 * sure we wait for until keys are set before
-				 * going into BMPS.
-				 */
-				ps_global_info->remain_in_power_active_till_dhcp
-					= true;
+			/*
+			 * Set remain_in_power_active_till_dhcp to make
+			 * sure we wait for until keys are set before
+			 * going into BMPS.
+			 */
+			ps_global_info->remain_in_power_active_till_dhcp
+				= true;
 
-				if (profile->bWPSAssociation)
-					key_timeout_interval =
-						CSR_WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD;
-				else
-					key_timeout_interval =
-						CSR_WAIT_FOR_KEY_TIMEOUT_PERIOD;
+			if (profile->bWPSAssociation)
+				key_timeout_interval =
+					CSR_WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD;
+			else
+				key_timeout_interval =
+					CSR_WAIT_FOR_KEY_TIMEOUT_PERIOD;
 
-				/* Save session_id in case of timeout */
-				mac_ctx->roam.WaitForKeyTimerInfo.sessionId =
-					(uint8_t) session_id;
-				/*
-				 * This time should be long enough for the rest
-				 * of the process plus setting key
-				 */
-				if (!QDF_IS_STATUS_SUCCESS
+			/* Save session_id in case of timeout */
+			mac_ctx->roam.WaitForKeyTimerInfo.sessionId =
+				(uint8_t) session_id;
+			/*
+			 * This time should be long enough for the rest
+			 * of the process plus setting key
+			 */
+			if (!QDF_IS_STATUS_SUCCESS
 					(csr_roam_start_wait_for_key_timer(
-						mac_ctx, key_timeout_interval))
-					) {
-					/* Reset state so nothing is blocked. */
-					sms_log(mac_ctx, LOGE, FL
+					   mac_ctx, key_timeout_interval))
+			   ) {
+				/* Reset state so nothing is blocked. */
+				sms_log(mac_ctx, LOGE, FL
 						("Failed preauth timer start"));
-					csr_roam_substate_change(mac_ctx,
+				csr_roam_substate_change(mac_ctx,
 						eCSR_ROAM_SUBSTATE_NONE,
 						session_id);
-				}
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 			}
-#endif
 		}
 
 		assoc_info.pBssDesc = bss_desc;       /* could be NULL */
@@ -6699,29 +6683,6 @@
 				(csr_is_concurrent_session_running(mac_ctx))) {
 				mac_ctx->roam.configParam.doBMPSWorkaround = 1;
 			}
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-			if (session->roam_synch_in_progress) {
-				roam_info.roamSynchInProgress = 1;
-				roam_info.synchAuthStatus =
-					roam_offload_params->authStatus;
-				qdf_mem_copy(roam_info.kck,
-					roam_offload_params->kck,
-					SIR_KCK_KEY_LEN);
-				qdf_mem_copy(roam_info.kek,
-					roam_offload_params->kek,
-					SIR_KEK_KEY_LEN);
-				qdf_mem_copy(roam_info.replay_ctr,
-					roam_offload_params->replay_ctr,
-					SIR_REPLAY_CTR_LEN);
-				QDF_TRACE(QDF_MODULE_ID_SME,
-					QDF_TRACE_LEVEL_DEBUG,
-					FL
-					("LFR3: Copy KCK, KEK and Replay Ctr"));
-			}
-
-			roam_info.subnet_change_status =
-				CSR_GET_SUBNET_STATUS(roam_offload_params->roamReason);
-#endif
 			csr_roam_call_callback(mac_ctx, session_id, &roam_info,
 				cmd->u.roamCmd.roamId,
 				eCSR_ROAM_ASSOCIATION_COMPLETION,
@@ -16181,6 +16142,74 @@
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+QDF_STATUS csr_roam_set_key_mgmt_offload(tpAniSirGlobal pMac,
+					 uint32_t sessionId,
+					 bool nRoamKeyMgmtOffloadEnabled)
+{
+	tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId);
+	if (!pSession) {
+		sms_log(pMac, LOGE, FL("session %d not found"), sessionId);
+		return QDF_STATUS_E_FAILURE;
+	}
+	pSession->RoamKeyMgmtOffloadEnabled = nRoamKeyMgmtOffloadEnabled;
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * csr_update_roam_scan_offload_request() - updates req msg with roam offload
+ * paramters
+ * @pMac:          mac global context
+ * @req_buf:       out param, roam offload scan request packet
+ * @session:       roam session
+ *
+ * Return: void
+ */
+static void
+csr_update_roam_scan_offload_request(tpAniSirGlobal mac_ctx,
+				     tSirRoamOffloadScanReq *req_buf,
+				     tCsrRoamSession *session)
+{
+	qdf_mem_copy(req_buf->PSK_PMK, session->psk_pmk,
+		     sizeof(req_buf->PSK_PMK));
+	req_buf->pmk_len = session->pmk_len;
+	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
+		  "LFR3: PMK Length = %d", req_buf->pmk_len);
+	req_buf->R0KH_ID_Length = session->ftSmeContext.r0kh_id_len;
+	qdf_mem_copy(req_buf->R0KH_ID,
+		     session->ftSmeContext.r0kh_id,
+		     req_buf->R0KH_ID_Length);
+	req_buf->Prefer5GHz = mac_ctx->roam.configParam.nRoamPrefer5GHz;
+	req_buf->RoamRssiCatGap = mac_ctx->roam.configParam.bCatRssiOffset;
+	req_buf->Select5GHzMargin = mac_ctx->roam.configParam.nSelect5GHzMargin;
+	if (wlan_cfg_get_int(mac_ctx, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
+			     (uint32_t *) &req_buf->ReassocFailureTimeout)
+	    != eSIR_SUCCESS) {
+		sms_log(mac_ctx, LOGE,
+			FL("could not retrieve ReassocFailureTimeout value"));
+		req_buf->ReassocFailureTimeout =
+			DEFAULT_REASSOC_FAILURE_TIMEOUT;
+	}
+#ifdef FEATURE_WLAN_ESE
+	if (csr_is_auth_type_ese(req_buf->ConnectedNetwork.authentication)) {
+		qdf_mem_copy(req_buf->KRK, session->eseCckmInfo.krk,
+			     SIR_KRK_KEY_LEN);
+		qdf_mem_copy(req_buf->BTK, session->eseCckmInfo.btk,
+			     SIR_BTK_KEY_LEN);
+	}
+#endif
+	req_buf->AcUapsd.acbe_uapsd =
+		SIR_UAPSD_GET(ACBE, mac_ctx->lim.gUapsdPerAcBitmask);
+	req_buf->AcUapsd.acbk_uapsd =
+		SIR_UAPSD_GET(ACBK, mac_ctx->lim.gUapsdPerAcBitmask);
+	req_buf->AcUapsd.acvi_uapsd =
+		SIR_UAPSD_GET(ACVI, mac_ctx->lim.gUapsdPerAcBitmask);
+	req_buf->AcUapsd.acvo_uapsd =
+		SIR_UAPSD_GET(ACVO, mac_ctx->lim.gUapsdPerAcBitmask);
+}
+#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
+
+#if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 static tSirRetStatus
 csr_roam_scan_offload_populate_mac_header(tpAniSirGlobal pMac,
 					  uint8_t *pBD,
@@ -16297,73 +16326,6 @@
 	return eSIR_SUCCESS;
 }
 
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-QDF_STATUS csr_roam_set_key_mgmt_offload(tpAniSirGlobal pMac,
-					 uint32_t sessionId,
-					 bool nRoamKeyMgmtOffloadEnabled)
-{
-	tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId);
-	if (!pSession) {
-		sms_log(pMac, LOGE, FL("session %d not found"), sessionId);
-		return QDF_STATUS_E_FAILURE;
-	}
-	pSession->RoamKeyMgmtOffloadEnabled = nRoamKeyMgmtOffloadEnabled;
-	return QDF_STATUS_SUCCESS;
-}
-
-/**
- * csr_update_roam_scan_offload_request() - updates req msg with roam offload
- * paramters
- * @pMac:          mac global context
- * @req_buf:       out param, roam offload scan request packet
- * @session:       roam session
- *
- * Return: void
- */
-static void
-csr_update_roam_scan_offload_request(tpAniSirGlobal mac_ctx,
-				     tSirRoamOffloadScanReq *req_buf,
-				     tCsrRoamSession *session)
-{
-	qdf_mem_copy(req_buf->PSK_PMK, session->psk_pmk,
-		     sizeof(req_buf->PSK_PMK));
-	req_buf->pmk_len = session->pmk_len;
-	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
-		  "LFR3: PMK Length = %d", req_buf->pmk_len);
-	req_buf->R0KH_ID_Length = session->ftSmeContext.r0kh_id_len;
-	qdf_mem_copy(req_buf->R0KH_ID,
-		     session->ftSmeContext.r0kh_id,
-		     req_buf->R0KH_ID_Length);
-	req_buf->Prefer5GHz = mac_ctx->roam.configParam.nRoamPrefer5GHz;
-	req_buf->RoamRssiCatGap = mac_ctx->roam.configParam.bCatRssiOffset;
-	req_buf->Select5GHzMargin = mac_ctx->roam.configParam.nSelect5GHzMargin;
-	if (wlan_cfg_get_int(mac_ctx, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
-			     (uint32_t *) &req_buf->ReassocFailureTimeout)
-	    != eSIR_SUCCESS) {
-		sms_log(mac_ctx, LOGE,
-			FL("could not retrieve ReassocFailureTimeout value"));
-		req_buf->ReassocFailureTimeout =
-			DEFAULT_REASSOC_FAILURE_TIMEOUT;
-	}
-#ifdef FEATURE_WLAN_ESE
-	if (csr_is_auth_type_ese(req_buf->ConnectedNetwork.authentication)) {
-		qdf_mem_copy(req_buf->KRK, session->eseCckmInfo.krk,
-			     SIR_KRK_KEY_LEN);
-		qdf_mem_copy(req_buf->BTK, session->eseCckmInfo.btk,
-			     SIR_BTK_KEY_LEN);
-	}
-#endif
-	req_buf->AcUapsd.acbe_uapsd =
-		SIR_UAPSD_GET(ACBE, mac_ctx->lim.gUapsdPerAcBitmask);
-	req_buf->AcUapsd.acbk_uapsd =
-		SIR_UAPSD_GET(ACBK, mac_ctx->lim.gUapsdPerAcBitmask);
-	req_buf->AcUapsd.acvi_uapsd =
-		SIR_UAPSD_GET(ACVI, mac_ctx->lim.gUapsdPerAcBitmask);
-	req_buf->AcUapsd.acvo_uapsd =
-		SIR_UAPSD_GET(ACVO, mac_ctx->lim.gUapsdPerAcBitmask);
-}
-#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
-
 /**
  * csr_check_band_channel_match() - check if passed band and channel match
  * paramters
@@ -17120,6 +17082,7 @@
 	}
 	return QDF_STATUS_SUCCESS;
 }
+#endif
 
 tCsrPeStatsReqInfo *csr_roam_check_pe_stats_req_list(tpAniSirGlobal pMac,
 						     uint32_t statsMask,
@@ -18718,6 +18681,7 @@
 }
 #endif
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 /**
  * csr_roam_synch_callback() - SME level callback for roam synch propagation
  * @mac_ctx: MAC Context
@@ -18980,3 +18944,4 @@
 	qdf_mem_free(roam_info);
 	sme_release_global_lock(&mac_ctx->sme);
 }
+#endif
diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h
index 1e7ae4c..7bc3d36 100644
--- a/core/sme/src/csr/csr_inside_api.h
+++ b/core/sme/src/csr/csr_inside_api.h
@@ -997,12 +997,18 @@
 QDF_STATUS
 csr_send_chng_mcc_beacon_interval(tpAniSirGlobal pMac, uint32_t sessionId);
 
-/* ---------------------------------------------------------------------------
-    \fn csr_roam_ft_pre_auth_rsp_processor
-    \brief csr function that handles pre auth response from LIM
-   ---------------------------------------------------------------------------*/
+#ifdef WLAN_FEATURE_HOST_ROAM
 void csr_roam_ft_pre_auth_rsp_processor(tHalHandle hHal,
-					tpSirFTPreAuthRsp pFTPreAuthRsp);
+		tpSirFTPreAuthRsp pFTPreAuthRsp);
+void csr_release_command_preauth(tpAniSirGlobal mac_ctx, tSmeCmd *command);
+#else
+static inline void csr_roam_ft_pre_auth_rsp_processor(tHalHandle hHal,
+		tpSirFTPreAuthRsp pFTPreAuthRsp)
+{}
+static inline void csr_release_command_preauth(tpAniSirGlobal mac_ctx,
+		tSmeCmd *command)
+{}
+#endif
 
 #if defined(FEATURE_WLAN_ESE)
 void update_cckmtsf(uint32_t *timeStamp0, uint32_t *timeStamp1,
@@ -1058,4 +1064,3 @@
 void csr_scan_active_list_timeout_handle(void *userData);
 QDF_STATUS csr_prepare_disconnect_command(tpAniSirGlobal mac,
 			uint32_t session_id, tSmeCmd **sme_cmd);
-void csr_release_command_preauth(tpAniSirGlobal mac_ctx, tSmeCmd *command);
diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c
index 469e788..0a26228 100644
--- a/core/sme/src/csr/csr_neighbor_roam.c
+++ b/core/sme/src/csr/csr_neighbor_roam.c
@@ -1647,9 +1647,9 @@
 {
 	tpCsrNeighborRoamControlInfo ngbr_roam_info =
 		&pMac->roam.neighborRoamInfo[session_id];
+	tCsrRoamSession *session = &pMac->roam.roamSession[session_id];
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	tCsrRoamInfo roamInfo;
-	tCsrRoamSession *session = &pMac->roam.roamSession[session_id];
 	tpSirSetActiveModeSetBncFilterReq msg;
 #endif
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index 4f21445..bf5933a 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -1334,12 +1334,14 @@
 	 * the serialized MC thread context with a timer.
 	 */
 	qdf_mc_timer_t service_ready_ext_timer;
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	void (*csr_roam_synch_cb)(tpAniSirGlobal mac,
 		roam_offload_synch_ind *roam_synch_data,
 		tpSirBssDescription  bss_desc_ptr, uint8_t reason);
 	QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
 		roam_offload_synch_ind *roam_synch_data,
 		tpSirBssDescription  bss_desc_ptr);
+#endif
 	qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
 	qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
 	qdf_runtime_lock_t wma_runtime_resume_lock;
diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h
index d3c653a..6d2dd9a 100644
--- a/core/wma/inc/wma_internal.h
+++ b/core/wma/inc/wma_internal.h
@@ -395,10 +395,8 @@
 QDF_STATUS  wma_ipa_offload_enable_disable(tp_wma_handle wma,
 			struct sir_ipa_offload_enable_disable *ipa_offload);
 
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 void wma_process_unit_test_cmd(WMA_HANDLE handle,
 				      t_wma_unit_test_cmd * wma_utest);
-#endif
 
 QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
 
diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h
index 12b7ff6..5657503 100644
--- a/core/wma/inc/wma_types.h
+++ b/core/wma/inc/wma_types.h
@@ -698,11 +698,24 @@
 
 QDF_STATUS wma_de_register_mgmt_frm_client(void *p_cds_gctx);
 QDF_STATUS wma_register_roaming_callbacks(void *cds_ctx,
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 		void (*csr_roam_synch_cb)(tpAniSirGlobal mac,
 			roam_offload_synch_ind *roam_synch_data,
 			tpSirBssDescription  bss_desc_ptr, uint8_t reason),
 		QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
 			roam_offload_synch_ind *roam_synch_data,
 			tpSirBssDescription  bss_desc_ptr));
+#else
+static inline CDF_STATUS wma_register_roaming_callbacks(void *cds_ctx,
+		void (*csr_roam_synch_cb)(tpAniSirGlobal mac,
+			roam_offload_synch_ind *roam_synch_data,
+			tpSirBssDescription  bss_desc_ptr, uint8_t reason),
+		CDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
+			roam_offload_synch_ind *roam_synch_data,
+			tpSirBssDescription  bss_desc_ptr))
+{
+	return CDF_STATUS_E_NOSUPPORT;
+}
+#endif
 
 #endif
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c
index c3bf626..38dcfaf 100644
--- a/core/wma/src/wma_mgmt.c
+++ b/core/wma/src/wma_mgmt.c
@@ -3062,6 +3062,7 @@
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
 /**
  * wma_register_roaming_callbacks() - Register roaming callbacks
  * @cds_ctx: CDS Context
@@ -3093,6 +3094,8 @@
 	WMA_LOGD("Registered roam synch callbacks with WMA successfully");
 	return QDF_STATUS_SUCCESS;
 }
+#endif
+
 /**
  * wma_register_mgmt_frm_client() - register management frame callback
  * @cds_ctx: cds context
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 2196320..6f77683 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -2103,51 +2103,6 @@
 }
 
 /**
- * wma_rssi_breached_event_handler() - rssi breached event handler
- * @handle: wma handle
- * @cmd_param_info: event handler data
- * @len: length of @cmd_param_info
- *
- * Return: 0 on success; error number otherwise
- */
-int wma_rssi_breached_event_handler(void *handle,
-				u_int8_t  *cmd_param_info, u_int32_t len)
-{
-	WMI_RSSI_BREACH_EVENTID_param_tlvs *param_buf;
-	wmi_rssi_breach_event_fixed_param  *event;
-	struct rssi_breach_event  rssi;
-	tpAniSirGlobal mac = cds_get_context(QDF_MODULE_ID_PE);
-
-	if (!mac) {
-		WMA_LOGE("%s: Invalid mac context", __func__);
-		return -EINVAL;
-	}
-	if (!mac->sme.rssi_threshold_breached_cb) {
-		WMA_LOGE("%s: Callback not registered", __func__);
-		return -EINVAL;
-	}
-	param_buf = (WMI_RSSI_BREACH_EVENTID_param_tlvs *)cmd_param_info;
-	if (!param_buf) {
-		WMA_LOGE("%s: Invalid rssi breached event", __func__);
-		return -EINVAL;
-	}
-	event = param_buf->fixed_param;
-
-	rssi.request_id = event->request_id;
-	rssi.session_id = event->vdev_id;
-	rssi.curr_rssi = event->rssi + WMA_TGT_NOISE_FLOOR_DBM;
-	WMI_MAC_ADDR_TO_CHAR_ARRAY(&event->bssid, rssi.curr_bssid.bytes);
-
-	WMA_LOGD("%s: req_id: %u vdev_id: %d curr_rssi: %d", __func__,
-		rssi.request_id, rssi.session_id, rssi.curr_rssi);
-	WMA_LOGI("%s: curr_bssid: %pM", __func__, rssi.curr_bssid.bytes);
-
-	mac->sme.rssi_threshold_breached_cb(mac->hHdd, &rssi);
-	WMA_LOGD("%s: Invoke HDD rssi breached callback", __func__);
-	return 0;
-}
-
-/**
  * wma_roam_scan_fill_self_caps() - fill capabilities
  * @wma_handle: wma handle
  * @roam_offload_params: offload parameters
@@ -2352,6 +2307,51 @@
 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
 
 /**
+ * wma_rssi_breached_event_handler() - rssi breached event handler
+ * @handle: wma handle
+ * @cmd_param_info: event handler data
+ * @len: length of @cmd_param_info
+ *
+ * Return: 0 on success; error number otherwise
+ */
+int wma_rssi_breached_event_handler(void *handle,
+				u_int8_t  *cmd_param_info, u_int32_t len)
+{
+	WMI_RSSI_BREACH_EVENTID_param_tlvs *param_buf;
+	wmi_rssi_breach_event_fixed_param  *event;
+	struct rssi_breach_event  rssi;
+	tpAniSirGlobal mac = cds_get_context(QDF_MODULE_ID_PE);
+
+	if (!mac) {
+		WMA_LOGE("%s: Invalid mac context", __func__);
+		return -EINVAL;
+	}
+	if (!mac->sme.rssi_threshold_breached_cb) {
+		WMA_LOGE("%s: Callback not registered", __func__);
+		return -EINVAL;
+	}
+	param_buf = (WMI_RSSI_BREACH_EVENTID_param_tlvs *)cmd_param_info;
+	if (!param_buf) {
+		WMA_LOGE("%s: Invalid rssi breached event", __func__);
+		return -EINVAL;
+	}
+	event = param_buf->fixed_param;
+
+	rssi.request_id = event->request_id;
+	rssi.session_id = event->vdev_id;
+	rssi.curr_rssi = event->rssi + WMA_TGT_NOISE_FLOOR_DBM;
+	WMI_MAC_ADDR_TO_CHAR_ARRAY(&event->bssid, rssi.curr_bssid.bytes);
+
+	WMA_LOGD("%s: req_id: %u vdev_id: %d curr_rssi: %d", __func__,
+		rssi.request_id, rssi.session_id, rssi.curr_rssi);
+	WMA_LOGI("%s: curr_bssid: %pM", __func__, rssi.curr_bssid.bytes);
+
+	mac->sme.rssi_threshold_breached_cb(mac->hHdd, &rssi);
+	WMA_LOGD("%s: Invoke HDD rssi breached callback", __func__);
+	return 0;
+}
+
+/**
  * wma_process_unit_test_cmd() - send unit test command to fw.
  * @handle: wma handle
  * @wma_utest: unit test command