qcacld-3.0: Add legacy changes for TDLS UMAC component

Add changes in hdd and mlme modules to support TDLS UMAC
component.

Change-Id: I9e8514e73cebaef566444c9c89e2db2609962b4c
CRs-Fixed: 2035617
diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c
index 3d6a98c..c4b7bbf 100644
--- a/core/mac/src/pe/lim/lim_process_tdls.c
+++ b/core/mac/src/pe/lim/lim_process_tdls.c
@@ -2889,6 +2889,56 @@
 	return status;
 }
 
+#ifdef CONVERGED_TDLS_ENABLE
+/**
+ * lim_send_tdls_comp_mgmt_rsp() - Send Response to upper layers
+ * @mac_ctx:          Pointer to Global MAC structure
+ * @msg_type:         Indicates message type
+ * @result_code:       Indicates the result of previously issued
+ *                    eWNI_SME_msg_type_REQ message
+ *
+ * This function is called by lim_process_sme_req_messages() to send
+ * eWNI_SME_START_RSP, eWNI_SME_STOP_BSS_RSP
+ * or eWNI_SME_SWITCH_CHL_RSP messages to applications above MAC
+ * Software.
+ *
+ * Return: None
+ */
+
+static void
+lim_send_tdls_comp_mgmt_rsp(tpAniSirGlobal mac_ctx, uint16_t msg_type,
+	 tSirResultCodes result_code, uint8_t sme_session_id,
+	 uint16_t sme_transaction_id)
+{
+	struct scheduler_msg msg;
+	tSirSmeRsp *sme_rsp;
+
+	lim_log(mac_ctx, LOG1, FL("Sending message %s with reasonCode %s"),
+		lim_msg_str(msg_type), lim_result_code_str(result_code));
+
+	sme_rsp = qdf_mem_malloc(sizeof(tSirSmeRsp));
+	if (NULL == sme_rsp) {
+		/* Buffer not available. Log error */
+		QDF_TRACE(QDF_MODULE_ID_PE, LOGP,
+			FL("call to AllocateMemory failed for eWNI_SME_*_RSP"));
+		return;
+	}
+
+	sme_rsp->messageType = msg_type;
+	sme_rsp->length = sizeof(tSirSmeRsp);
+	sme_rsp->statusCode = result_code;
+
+	sme_rsp->sessionId = sme_session_id;
+	sme_rsp->transactionId = sme_transaction_id;
+
+	msg.type = msg_type;
+	sme_rsp->psoc = mac_ctx->psoc;
+	msg.bodyptr = sme_rsp;
+	msg.callback = tgt_tdls_send_mgmt_rsp;
+	scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &msg);
+
+}
+#endif
 /**
  * lim_process_sme_tdls_mgmt_send_req() - send out tdls management frames
  *
@@ -3005,9 +3055,15 @@
 	}
 
 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);
+		 result_code, send_req->sessionId,
+		 send_req->transactionId);
+#endif
 
 	return eSIR_SUCCESS;
 }
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 034041e..5426882 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
@@ -60,6 +60,9 @@
 #include "nan_datapath.h"
 #include "lim_assoc_utils.h"
 
+#include "wlan_tdls_tgt_api.h"
+
+
 static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx,
 	tpPESession session_entry, tSirResultCodes result_code,
 	tpSirSmeJoinRsp sme_join_rsp);
@@ -1305,8 +1308,15 @@
 	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,