qcacld-3.0: TDLS: remove legacy core functions

Clear up the tdls legacy functions which handle add/delete
tdls peer, tdls mgmt frame process and tdls_oper callback.

Change-Id: I8ba344ce5593df44bd15527e2ff68e872b6d23b8
CRs-Fixed: 2105075
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index 7ee4087..f70febb 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -457,9 +457,7 @@
 	uint8_t sessionId;      /* To support BT-AMP */
 	uint16_t transactionId; /* To support BT-AMP */
 	tSirResultCodes statusCode;
-#ifdef CONVERGED_TDLS_ENABLE
 	struct wlan_objmgr_psoc *psoc;
-#endif
 } tSirSmeRsp, *tpSirSmeRsp;
 
 /* / Definition for indicating all modules ready on STA */
@@ -3505,9 +3503,7 @@
 	uint8_t ucastSig;
 	uint8_t bcastSig;
 	eTdlsAddOper tdlsAddOper;
-#ifdef CONVERGED_TDLS_ENABLE
 	struct wlan_objmgr_psoc *psoc;
-#endif
 } tSirTdlsAddStaRsp;
 
 /* TDLS Request struct SME-->PE */
@@ -3559,9 +3555,7 @@
 	tSirResultCodes statusCode;
 	struct qdf_mac_addr peermac;
 	uint16_t staId;
-#ifdef CONVERGED_TDLS_ENABLE
 	struct wlan_objmgr_psoc *psoc;
-#endif
 } tSirTdlsDelStaRsp, *tpSirTdlsDelStaRsp;
 /* TDLS Delete Indication struct PE-->SME */
 typedef struct sSirTdlsDelStaInd {
@@ -3582,9 +3576,7 @@
 	uint16_t length;
 	uint8_t sessionId;      /* Session ID */
 	uint32_t txCompleteStatus;
-#ifdef CONVERGED_TDLS_ENABLE
 	struct wlan_objmgr_psoc *psoc;
-#endif
 } tSirMgmtTxCompletionInd, *tpSirMgmtTxCompletionInd;
 
 typedef struct sSirTdlsEventnotify {
diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c
index 1761371..b593aa5 100644
--- a/core/mac/src/pe/lim/lim_process_action_frame.c
+++ b/core/mac/src/pe/lim/lim_process_action_frame.c
@@ -2105,25 +2105,7 @@
 					WMA_GET_RX_RSSI_NORMALIZED(
 					rx_pkt_info));
 		break;
-#ifdef FEATURE_WLAN_TDLS
-#ifndef CONVERGED_TDLS_ENABLE
-		case SIR_MAC_TDLS_DIS_RSP:
-			mac_hdr = NULL;
-			frame_len = 0;
-			rssi = 0;
 
-			mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
-			frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
-			rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info);
-			pe_debug("Public Action TDLS Discovery RSP");
-			lim_send_sme_mgmt_frame_ind(mac_ctx,
-				mac_hdr->fc.subType, (uint8_t *) mac_hdr,
-				frame_len + sizeof(tSirMacMgmtHdr),
-				session->smeSessionId,
-				WMA_GET_RX_CH(rx_pkt_info), session, rssi);
-		break;
-#endif
-#endif
 		case SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID:
 			lim_process_ext_channel_switch_action_frame(mac_ctx,
 							rx_pkt_info, session);
diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c
index 7c4c7be..4f0573c 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -1269,7 +1269,6 @@
 #ifdef FEATURE_WLAN_TDLS
 	tSirTdlsInd *tdls_ind = NULL;
 	tpDphHashNode sta_ds = NULL;
-	tTdlsLinkEstablishParams *tdls_link_params = NULL;
 #endif
 	tSirMbMsgP2p *p2p_msg = NULL;
 	tSirSetActiveModeSetBncFilterReq *bcn_filter_req = NULL;
@@ -1779,29 +1778,6 @@
 		qdf_mem_free((void *)(msg->bodyptr));
 		msg->bodyptr = NULL;
 		break;
-#ifdef FEATURE_WLAN_TDLS
-	case WMA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
-		tdls_link_params = (tTdlsLinkEstablishParams *) msg->bodyptr;
-		session_entry = pe_find_session_by_sta_id(mac_ctx,
-			tdls_link_params->staIdx, &session_id);
-		if (session_entry == NULL) {
-			pe_err("session %u does not exist", session_id);
-			/* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP
-			 * message to SME with session id as zero and status
-			 * as FAILURE so, that message queued in SME queue
-			 * can be freed to prevent the SME cmd buffer leak
-			 */
-			lim_send_sme_tdls_link_establish_req_rsp(mac_ctx, 0,
-				NULL, NULL, eSIR_FAILURE);
-		} else {
-			lim_send_sme_tdls_link_establish_req_rsp(mac_ctx,
-				session_entry->smeSessionId, NULL, NULL,
-				tdls_link_params->status);
-		}
-		qdf_mem_free((void *)(msg->bodyptr));
-		msg->bodyptr = NULL;
-		break;
-#endif
 
 	case WMA_RX_CHN_STATUS_EVENT:
 		lim_process_rx_channel_status_event(mac_ctx, msg->bodyptr);
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 11249d3..1613fd6 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -5059,9 +5059,6 @@
 	case eWNI_SME_TDLS_DEL_STA_REQ:
 		lim_process_sme_tdls_del_sta_req(pMac, pMsgBuf);
 		break;
-	case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
-		lim_process_sme_tdls_link_establish_req(pMac, pMsgBuf);
-		break;
 #endif
 	case eWNI_SME_RESET_AP_CAPS_CHANGED:
 		__lim_process_sme_reset_ap_caps_change(pMac, pMsgBuf);
diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c
index a2524d5..f59bb63 100644
--- a/core/mac/src/pe/lim/lim_process_tdls.c
+++ b/core/mac/src/pe/lim/lim_process_tdls.c
@@ -79,10 +79,7 @@
 #include "cds_regdomain.h"
 #include "cds_utils.h"
 #include "wlan_reg_services_api.h"
-
-#ifdef CONVERGED_TDLS_ENABLE
 #include "wlan_tdls_tgt_api.h"
-#endif
 
 /* define NO_PAD_TDLS_MIN_8023_SIZE to NOT padding: See CR#447630
    There was IOT issue with cisco 1252 open mode, where it pads
@@ -2677,18 +2674,11 @@
 
 	addStaRsp->length = sizeof(tSirTdlsAddStaRsp);
 	addStaRsp->messageType = eWNI_SME_TDLS_ADD_STA_RSP;
-#ifdef CONVERGED_TDLS_ENABLE
 	addStaRsp->psoc = pMac->psoc;
 	mmhMsg.bodyptr = addStaRsp;
 	mmhMsg.callback = tgt_tdls_add_peer_rsp;
 
 	return scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &mmhMsg);
-#else
-	mmhMsg.bodyptr = addStaRsp;
-	mmhMsg.bodyval = 0;
-	lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
-#endif
-	return QDF_STATUS_SUCCESS;
 }
 
 /*
@@ -2737,7 +2727,6 @@
 	return status;
 }
 
-#ifdef CONVERGED_TDLS_ENABLE
 /**
  * lim_send_tdls_comp_mgmt_rsp() - Send Response to upper layers
  * @mac_ctx:          Pointer to Global MAC structure
@@ -2786,7 +2775,6 @@
 	scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &msg);
 
 }
-#endif
 
 /**
  * lim_process_sme_tdls_mgmt_send_req() - send out tdls management frames
@@ -2908,52 +2896,14 @@
 	}
 
 lim_tdls_send_mgmt_error:
-#ifdef CONVERGED_TDLS_ENABLE
 	lim_send_tdls_comp_mgmt_rsp(mac_ctx, eWNI_SME_TDLS_SEND_MGMT_RSP,
 		 result_code, send_req->sessionId,
 		 send_req->transactionId);
-#else
-	lim_send_sme_rsp(mac_ctx, eWNI_SME_TDLS_SEND_MGMT_RSP,
-		 result_code, send_req->sessionId,
-		 send_req->transactionId);
-#endif
 
 	return eSIR_SUCCESS;
 }
 
 /*
- * Send Response to Link Establish Request to SME
- */
-void lim_send_sme_tdls_link_establish_req_rsp(tpAniSirGlobal pMac,
-					      uint8_t sessionId,
-					      struct qdf_mac_addr *peermac,
-					      tDphHashNode *pStaDs, uint8_t status)
-{
-	struct scheduler_msg mmhMsg = { 0 };
-
-	tSirTdlsLinkEstablishReqRsp *pTdlsLinkEstablishReqRsp = NULL;
-
-	pTdlsLinkEstablishReqRsp =
-		qdf_mem_malloc(sizeof(tSirTdlsLinkEstablishReqRsp));
-	if (NULL == pTdlsLinkEstablishReqRsp) {
-		pe_err("Failed to allocate memory");
-		return;
-	}
-	pe_debug("Send Resp to TDL Link Establish Req to SME");
-	pTdlsLinkEstablishReqRsp->statusCode = status;
-	if (peermac)
-		qdf_copy_macaddr(&pTdlsLinkEstablishReqRsp->peermac, peermac);
-
-	pTdlsLinkEstablishReqRsp->sessionId = sessionId;
-	mmhMsg.type = eWNI_SME_TDLS_LINK_ESTABLISH_RSP;
-	mmhMsg.bodyptr = pTdlsLinkEstablishReqRsp;
-	mmhMsg.bodyval = 0;
-	lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
-	return;
-
-}
-
-/*
  * Once link is teardown, send Del Peer Ind to SME
  */
 static QDF_STATUS lim_send_sme_tdls_del_sta_rsp(tpAniSirGlobal pMac,
@@ -2982,19 +2932,10 @@
 
 	pDelSta->length = sizeof(tSirTdlsDelStaRsp);
 	pDelSta->messageType = eWNI_SME_TDLS_DEL_STA_RSP;
-#ifdef CONVERGED_TDLS_ENABLE
 	pDelSta->psoc = pMac->psoc;
 	mmhMsg.bodyptr = pDelSta;
 	mmhMsg.callback = tgt_tdls_del_peer_rsp;
 	return scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &mmhMsg);
-#else
-	mmhMsg.bodyptr = pDelSta;
-
-	mmhMsg.bodyval = 0;
-#endif
-	lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
-	return QDF_STATUS_SUCCESS;
-
 }
 
 /*
@@ -3122,163 +3063,6 @@
 	return eSIR_SUCCESS;
 }
 
-/* Intersects the two input arrays and outputs an array */
-/* For now the array length of uint8_t suffices */
-static void lim_tdls_get_intersection(uint8_t *input_array1,
-				      uint8_t input1_length,
-				      uint8_t *input_array2,
-				      uint8_t input2_length,
-				      uint8_t *output_array,
-				      uint8_t *output_length)
-{
-	uint8_t i, j, k = 0, flag = 0;
-	for (i = 0; i < input1_length; i++) {
-		flag = 0;
-		for (j = 0; j < input2_length; j++) {
-			if (input_array1[i] == input_array2[j]) {
-				flag = 1;
-				break;
-			}
-		}
-		if (flag == 1) {
-			output_array[k] = input_array1[i];
-			k++;
-		}
-	}
-	*output_length = k;
-}
-
-/**
- * lim_process_sme_tdls_link_establish_req() - process tdls link establishment
- *                                            request
- *
- * @mac_ctx - global MAC context
- * @msg_buf - message buffer from SME
- *
- * Process Link Establishment Request from SME
- *
- * Return: eSIR_SUCCESS on success, failure code otherwise.
- */
-tSirRetStatus lim_process_sme_tdls_link_establish_req(tpAniSirGlobal mac_ctx,
-						     uint32_t *msg_buf)
-{
-	/* get all discovery request parameters */
-	tSirTdlsLinkEstablishReq *tdls_req =
-		(tSirTdlsLinkEstablishReq *) msg_buf;
-	tpPESession session_entry;
-	uint8_t session_id;
-	tpTdlsLinkEstablishParams tdls_req_params;
-	struct scheduler_msg msg = {0};
-	uint16_t peer_idx = 0;
-	tpDphHashNode stads = NULL;
-	uint32_t self_num_chan = WNI_CFG_VALID_CHANNEL_LIST_LEN;
-	uint8_t self_supp_chan[WNI_CFG_VALID_CHANNEL_LIST_LEN];
-
-	pe_debug("Process TDLS Link Establishment Request from SME");
-
-	session_entry = pe_find_session_by_bssid(mac_ctx, tdls_req->bssid.bytes,
-						 &session_id);
-	if (NULL == session_entry) {
-		pe_err("PE Session does not exist for sme session_id: %d",
-			  tdls_req->sessionId);
-		lim_send_sme_tdls_link_establish_req_rsp(mac_ctx,
-			tdls_req->sessionId, &tdls_req->peermac, NULL,
-			eSIR_FAILURE);
-		return eSIR_FAILURE;
-	}
-
-	/* check if we are in proper state to work as TDLS client */
-	if (!LIM_IS_STA_ROLE(session_entry)) {
-		pe_err("TDLS Link Establish Request received in wrong system Role: %d",
-			  GET_LIM_SYSTEM_ROLE(session_entry));
-		goto lim_tdls_link_establish_error;
-	}
-
-	/*
-	 * if we are still good, go ahead and check if we are in proper state to
-	 * do TDLS discovery req/rsp/....frames.
-	 */
-	if ((session_entry->limSmeState != eLIM_SME_ASSOCIATED_STATE) &&
-	    (session_entry->limSmeState != eLIM_SME_LINK_EST_STATE)) {
-		pe_err("TDLS Link Establish Request received in invalid LIMsme state: %d",
-			session_entry->limSmeState);
-		goto lim_tdls_link_establish_error;
-	}
-
-	stads = dph_lookup_hash_entry(mac_ctx, tdls_req->peermac.bytes,
-				      &peer_idx,
-				      &session_entry->dph.dphHashTable);
-	if (NULL == stads) {
-		pe_err("stads is NULL");
-		goto lim_tdls_link_establish_error;
-	}
-	tdls_req_params = qdf_mem_malloc(sizeof(tTdlsLinkEstablishParams));
-	if (NULL == tdls_req_params) {
-		pe_err("Unable to allocate memory TDLS Link Establish Request");
-		return eSIR_MEM_ALLOC_FAILED;
-	}
-
-	tdls_req_params->staIdx = stads->staIndex;
-	tdls_req_params->isResponder = tdls_req->isResponder;
-	tdls_req_params->uapsdQueues = tdls_req->uapsdQueues;
-	tdls_req_params->maxSp = tdls_req->maxSp;
-	tdls_req_params->isBufsta = tdls_req->isBufSta;
-	tdls_req_params->isOffChannelSupported =
-		tdls_req->isOffChannelSupported;
-
-	if (0 == tdls_req->supportedChannelsLen)
-		goto send_tdls_establish_request;
-
-	if (wlan_cfg_get_str(mac_ctx, WNI_CFG_VALID_CHANNEL_LIST,
-			     self_supp_chan,
-			     &self_num_chan) != eSIR_SUCCESS) {
-		/**
-		 * Could not get Valid channel list from CFG.
-		 * Log error.
-		 */
-		pe_warn("could not retrieve Valid channel list");
-	}
-
-	if (self_num_chan > WNI_CFG_VALID_CHANNEL_LIST_LEN) {
-		pe_warn("Channel List more than Valid Channel list");
-		self_num_chan = WNI_CFG_VALID_CHANNEL_LIST_LEN;
-	}
-
-	if (tdls_req->supportedChannelsLen > SIR_MAC_MAX_SUPP_CHANNELS) {
-		pe_warn("Channel List is more than the supported Channel list");
-		tdls_req->supportedChannelsLen = SIR_MAC_MAX_SUPP_CHANNELS;
-	}
-
-	lim_tdls_get_intersection(self_supp_chan, self_num_chan,
-		tdls_req->supportedChannels, tdls_req->supportedChannelsLen,
-		tdls_req_params->validChannels,
-		&tdls_req_params->validChannelsLen);
-
-send_tdls_establish_request:
-	qdf_mem_copy(tdls_req_params->validOperClasses,
-		     tdls_req->supportedOperClasses,
-		     tdls_req->supportedOperClassesLen);
-	tdls_req_params->validOperClassesLen =
-			tdls_req->supportedOperClassesLen;
-
-	msg.type = WMA_SET_TDLS_LINK_ESTABLISH_REQ;
-	msg.reserved = 0;
-	msg.bodyptr = tdls_req_params;
-	msg.bodyval = 0;
-	if (eSIR_SUCCESS != wma_post_ctrl_msg(mac_ctx, &msg)) {
-		pe_err("halPostMsgApi failed");
-		goto lim_tdls_link_establish_error;
-	}
-	return eSIR_SUCCESS;
-
-lim_tdls_link_establish_error:
-	lim_send_sme_tdls_link_establish_req_rsp(mac_ctx,
-		session_entry->smeSessionId, &tdls_req->peermac, NULL,
-		eSIR_FAILURE);
-
-	return eSIR_SUCCESS;
-}
-
 /**
  * lim_check_aid_and_delete_peer() - Funtion to check aid and delete peer
  * @p_mac: pointer to mac context
@@ -3341,53 +3125,6 @@
 	}
 }
 
-#ifndef CONVERGED_TDLS_ENABLE
-/**
- * lim_delete_tdls_peers() - delete tdls peers
- *
- * @mac_ctx - global MAC context
- * @session_entry - PE session entry
- *
- * Delete all the TDLS peer connected before leaving the BSS
- *
- * Return: eSIR_SUCCESS on success, error code otherwise
- */
-tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx,
-				    tpPESession session_entry)
-{
-	cds_msg_t msg;
-	struct sir_tdls_notify_set_state_disable *tdls_state_disable;
-
-	pe_debug("Enter");
-
-	if (NULL == session_entry) {
-		pe_err("NULL session_entry");
-		return eSIR_FAILURE;
-	}
-
-	lim_check_aid_and_delete_peer(mac_ctx, session_entry);
-	if (lim_is_roam_synch_in_progress(session_entry))
-		return eSIR_SUCCESS;
-
-	if (mac_ctx->lim.sme_msg_callback) {
-		tdls_state_disable = qdf_mem_malloc(
-						sizeof(*tdls_state_disable));
-		if (NULL == tdls_state_disable) {
-			pe_err("memory allocation failed");
-			return eSIR_FAILURE;
-		}
-		tdls_state_disable->session_id = session_entry->smeSessionId;
-		msg.type = eWNI_SME_TDLS_NOTIFY_SET_STATE_DISABLE;
-		msg.bodyptr = tdls_state_disable;
-		msg.bodyval = 0;
-		mac_ctx->lim.sme_msg_callback(mac_ctx, &msg);
-	}
-
-	lim_send_sme_tdls_delete_all_peer_ind(mac_ctx, session_entry);
-	pe_debug("Exit");
-	return eSIR_SUCCESS;
-}
-#else
 /**
  * lim_delete_tdls_peers() - delete tdls peers
  *
@@ -3419,7 +3156,6 @@
 	pe_debug("Exit");
 	return eSIR_SUCCESS;
 }
-#endif
 
 /**
  * lim_process_sme_del_all_tdls_peers(): process delete tdls peers
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index 7f8da95..1a18b29 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -62,9 +62,7 @@
 #include "wlan_reg_services_api.h"
 #include "wlan_utility.h"
 
-#ifdef CONVERGED_TDLS_ENABLE
 #include "wlan_tdls_tgt_api.h"
-#endif
 #include "lim_process_fils.h"
 
 static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx,
@@ -1215,87 +1213,21 @@
 lim_send_sme_tdls_del_sta_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs,
 			      tpPESession psessionEntry, uint16_t reasonCode)
 {
-	struct scheduler_msg mmhMsg = {0};
-	tSirTdlsDelStaInd *pSirTdlsDelStaInd;
+	struct tdls_event_info info;
 
-	pSirTdlsDelStaInd = qdf_mem_malloc(sizeof(tSirTdlsDelStaInd));
-	if (NULL == pSirTdlsDelStaInd) {
-		pe_err("AllocateMemory failed for eWNI_SME_TDLS_DEL_STA_IND");
-		return;
-	}
 	pe_debug("Delete TDLS Peer "MAC_ADDRESS_STR "with reason code: %d",
 			MAC_ADDR_ARRAY(pStaDs->staAddr), reasonCode);
-	/* messageType */
-	pSirTdlsDelStaInd->messageType = eWNI_SME_TDLS_DEL_STA_IND;
-	pSirTdlsDelStaInd->length = sizeof(tSirTdlsDelStaInd);
+	info.vdev_id = psessionEntry->smeSessionId;
+	qdf_mem_copy(info.peermac.bytes, pStaDs->staAddr, QDF_MAC_ADDR_SIZE);
+	info.message_type = TDLS_PEER_DISCONNECTED;
+	info.peer_reason = TDLS_DISCONNECTED_PEER_DELETE;
 
-	/* sessionId */
-	pSirTdlsDelStaInd->sessionId = psessionEntry->smeSessionId;
+	tgt_tdls_event_handler(pMac->psoc, &info);
 
-	/* peerMacAddr */
-	qdf_mem_copy(pSirTdlsDelStaInd->peermac.bytes, pStaDs->staAddr,
-		     QDF_MAC_ADDR_SIZE);
-
-	/* staId */
-	lim_copy_u16((uint8_t *) (&pSirTdlsDelStaInd->staId),
-		     (uint16_t) pStaDs->staIndex);
-
-	/* reasonCode */
-	lim_copy_u16((uint8_t *) (&pSirTdlsDelStaInd->reasonCode), reasonCode);
-
-	mmhMsg.type = eWNI_SME_TDLS_DEL_STA_IND;
-	mmhMsg.bodyptr = pSirTdlsDelStaInd;
-	mmhMsg.bodyval = 0;
-
-	lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
 	return;
 } /*** end lim_send_sme_tdls_del_sta_ind() ***/
 
 /**
- * lim_send_sme_tdls_delete_all_peer_ind()
- *
- ***FUNCTION:
- * This function is called to send the eWNI_SME_TDLS_DEL_ALL_PEER_IND
- * message to SME.
- *
- ***LOGIC:
- *
- ***ASSUMPTIONS:
- *
- ***NOTE:
- * NA
- *
- * @param  pMac   - Pointer to global MAC structure
- * @param  psessionEntry - Pointer to the session entry
- * @return None
- */
-void
-lim_send_sme_tdls_delete_all_peer_ind(tpAniSirGlobal pMac, tpPESession psessionEntry)
-{
-	struct scheduler_msg mmhMsg = {0};
-	tSirTdlsDelAllPeerInd *pSirTdlsDelAllPeerInd;
-
-	pSirTdlsDelAllPeerInd = qdf_mem_malloc(sizeof(tSirTdlsDelAllPeerInd));
-	if (NULL == pSirTdlsDelAllPeerInd) {
-		pe_err("AllocateMemory failed for eWNI_SME_TDLS_DEL_ALL_PEER_IND");
-		return;
-	}
-	/* messageType */
-	pSirTdlsDelAllPeerInd->messageType = eWNI_SME_TDLS_DEL_ALL_PEER_IND;
-	pSirTdlsDelAllPeerInd->length = sizeof(tSirTdlsDelAllPeerInd);
-
-	/* sessionId */
-	pSirTdlsDelAllPeerInd->sessionId = psessionEntry->smeSessionId;
-
-	mmhMsg.type = eWNI_SME_TDLS_DEL_ALL_PEER_IND;
-	mmhMsg.bodyptr = pSirTdlsDelAllPeerInd;
-	mmhMsg.bodyval = 0;
-
-	lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
-	return;
-} /*** end lim_send_sme_tdls_delete_all_peer_ind() ***/
-
-/**
  * lim_send_sme_mgmt_tx_completion()
  *
  ***FUNCTION:
@@ -1342,15 +1274,10 @@
 	mmhMsg.bodyptr = pSirMgmtTxCompletionInd;
 	mmhMsg.bodyval = 0;
 
-#ifdef CONVERGED_TDLS_ENABLE
 	pSirMgmtTxCompletionInd->psoc = pMac->psoc;
 	mmhMsg.callback = tgt_tdls_send_mgmt_tx_completion;
 	scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &mmhMsg);
 	return;
-#else
-	lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
-	return;
-#endif
 } /*** end lim_send_sme_tdls_delete_all_peer_ind() ***/
 
 void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType,
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h
index 6714f5a..c20c903 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h
@@ -102,9 +102,6 @@
 void lim_send_sme_max_assoc_exceeded_ntf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
 					 uint8_t smesessionId);
 #ifdef FEATURE_WLAN_TDLS
-void lim_send_sme_tdls_link_establish_req_rsp(tpAniSirGlobal pMac, uint8_t sessionId,
-					      struct qdf_mac_addr *peermac,
-					      tDphHashNode *pStaDs, uint8_t status);
 void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType,
 				    void *events);
 #endif
diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h
index 52ec012..45d6e50 100644
--- a/core/mac/src/pe/lim/lim_types.h
+++ b/core/mac/src/pe/lim/lim_types.h
@@ -554,12 +554,8 @@
 						 uint32_t *pMsgBuf);
 tSirRetStatus lim_process_sme_tdls_add_sta_req(tpAniSirGlobal pMac,
 					       uint32_t *pMsgBuf);
-tSirRetStatus lim_process_sme_tdls_link_establish_req(tpAniSirGlobal pMac,
-						     uint32_t *pMsgBuf);
 tSirRetStatus lim_process_sme_tdls_del_sta_req(tpAniSirGlobal pMac,
 					       uint32_t *pMsgBuf);
-void lim_send_sme_tdls_delete_all_peer_ind(tpAniSirGlobal pMac,
-					   tpPESession psessionEntry);
 void lim_send_sme_mgmt_tx_completion(
 		tpAniSirGlobal pMac,
 		uint32_t sme_session_id,