Fix for teardown of link on wrong session in Activmode offload context

In Active mode offload context when both P2P and STA links are present,
the heartbeatfailure on one session results in link loss on the other
session.handle missed beacon indication using the bssIdx passed by
firmware

Change-Id: Ie3208b18dc35685cae6499eba081195d7d4d4fea
CRs-fixed: 457247,454235
diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c
index 5fc6bc2..5007828 100644
--- a/CORE/MAC/src/pe/lim/limApi.c
+++ b/CORE/MAC/src/pe/lim/limApi.c
@@ -1973,8 +1973,20 @@
   \return - none 
   \sa
   ----------------------------------------------------------------- */
-void limHandleMissedBeaconInd(tpAniSirGlobal pMac)
+void limHandleMissedBeaconInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg)
 {
+#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
+    tpSirSmeMissedBeaconInd  pSirMissedBeaconInd =
+                           (tpSirSmeMissedBeaconInd)pMsg->bodyptr;
+    tpPESession psessionEntry = peFindSessionByBssIdx(pMac,pSirMissedBeaconInd->bssIdx);
+    if (psessionEntry == NULL)
+    {
+         limLog(pMac, LOGE,
+               FL("session does not exist for given BSSIdx:%d"),
+               pSirMissedBeaconInd->bssIdx);
+         return;
+    }
+#endif
     if ( (pMac->pmm.gPmmState == ePMM_STATE_BMPS_SLEEP) ||
          (pMac->pmm.gPmmState == ePMM_STATE_UAPSD_SLEEP)||
          (pMac->pmm.gPmmState == ePMM_STATE_WOWLAN) )
@@ -1991,7 +2003,7 @@
     {
         pMac->pmm.inMissedBeaconScenario = TRUE;
         PELOGE(limLog(pMac, LOGE, FL("Received Heart Beat Failure\n"));)
-        limMissedBeaconInActiveMode(pMac);
+        limMissedBeaconInActiveMode(pMac, psessionEntry);
     }
 #endif
     else