prima: use mgmtFrameSessionId while sending resp to sme

This change addresses below two issues.
1) While sending tx complete status of tdls mgmt frames
use lim. mgmtFrameSessionId instead of smeSessionId from
pesessionEntry. pesessionEntry may not exist in few
cases where ack cnf comes after pe delete session.
2) If mgmt tx fails before calling WDA_TxPacket then
lim sends eWNI_SME_TDLS_SEND_MGMT_RSP to sme and as part of
handling this msg, apart from removing current command from
active command queue also send tx ack cnf to hdd so that it wont
wait for tx cnf for 11s.

Change-Id: I089be87fef71ebfb0327c47a301aaf5ede59d031
CRs-Fixed: 887676
diff --git a/CORE/MAC/src/pe/lim/limProcessTdls.c b/CORE/MAC/src/pe/lim/limProcessTdls.c
index ea7f034..87eb15f 100644
--- a/CORE/MAC/src/pe/lim/limProcessTdls.c
+++ b/CORE/MAC/src/pe/lim/limProcessTdls.c
@@ -532,7 +532,6 @@
  eHalStatus limMgmtTXComplete(tpAniSirGlobal pMac,
                                    void *pData)
 {
-    tpPESession psessionEntry = NULL ;
     tANI_U32 txCompleteSuccess = 0;
     tpSirTxBdStatus pTxBdStatus = NULL;
 
@@ -557,14 +556,8 @@
 
     if (0xff != pMac->lim.mgmtFrameSessionId)
     {
-        psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.mgmtFrameSessionId);
-        if (NULL == psessionEntry)
-        {
-            limLog(pMac, LOGE, FL("sessionID %d is not found"),
-                               pMac->lim.mgmtFrameSessionId);
-            return eHAL_STATUS_FAILURE;
-        }
-        limSendSmeMgmtTXCompletion(pMac, psessionEntry, txCompleteSuccess);
+        limSendSmeMgmtTXCompletion(pMac, pMac->lim.mgmtFrameSessionId,
+                                   txCompleteSuccess);
         pMac->lim.mgmtFrameSessionId = 0xff;
     }
     return eHAL_STATUS_SUCCESS;
@@ -753,7 +746,7 @@
         limLog(pMac, LOGE, FL("could not send TDLS Discovery Request frame"));
         return eSIR_FAILURE;
     }
-    pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId;
+    pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId;
 
     return eSIR_SUCCESS;
 
@@ -1031,7 +1024,7 @@
         limLog(pMac, LOGE, FL("could not send TDLS Discovery Response frame!"));
         return eSIR_FAILURE;
     }
-    pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId;
+    pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId;
 
     return eSIR_SUCCESS;
 
@@ -1339,7 +1332,7 @@
         limLog(pMac, LOGE, FL("could not send TDLS Setup Request frame!"));
         return eSIR_FAILURE;
     }
-    pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId;
+    pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId;
 
     return eSIR_SUCCESS;
 
@@ -1548,7 +1541,7 @@
         return eSIR_FAILURE;
 
     }
-    pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId;
+    pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId;
     return eSIR_SUCCESS;
 
 }
@@ -1809,7 +1802,7 @@
         limLog(pMac, LOGE, FL("could not send TDLS Setup Response"));
         return eSIR_FAILURE;
     }
-    pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId;
+    pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId;
 
     return eSIR_SUCCESS;
 
@@ -2061,7 +2054,7 @@
         return eSIR_FAILURE;
 
     }
-    pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId;
+    pMac->lim.mgmtFrameSessionId = psessionEntry->smeSessionId;
 
     return eSIR_SUCCESS;
 }