wlan: update Listen Interval with change in multisession

Update LI when transitioning from MCC to P2P CLI only mode
or STA only mode

Change-Id: I3a9af45160fd5cd39081331a829c5fb8bc5d7db8
CRs-fixed: 451713
diff --git a/CORE/SME/inc/smeInside.h b/CORE/SME/inc/smeInside.h
index e99f94f..494fbb2 100644
--- a/CORE/SME/inc/smeInside.h
+++ b/CORE/SME/inc/smeInside.h
@@ -281,7 +281,7 @@
 eHalStatus pmcUpdateScanParams(tHalHandle hHal, tCsrConfig *pRequest, tCsrChannel *pChannelList, tANI_U8 b11dResolved);
 eHalStatus pmcSetRssiFilter(tHalHandle hHal,   v_U8_t        rssiThreshold);
 #endif // FEATURE_WLAN_SCAN_PNO
-eHalStatus pmcSetPowerParams(tHalHandle hHal,   tSirSetPowerParamsReq*  pwParams);
+eHalStatus pmcSetPowerParams(tHalHandle hHal,   tSirSetPowerParamsReq*  pwParams, tANI_BOOLEAN forced);
 
 tANI_BOOLEAN csrRoamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
 #ifdef FEATURE_WLAN_TDLS
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index b37c141..0426f90 100755
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -1945,9 +1945,12 @@
     \brief  API to set Power Parameters 
     \param  hHal - The handle returned by macOpen.
     \param  pwParams -  Pointer to the power parameters requested.
+    \param  forced - if true, not to be dropped silently in host, it must reach
+    FW; It is added to avoid a race condition scenario where LIM hasn't deleted
+    the session yet before power params gets sent to PMC
     \return eHalStatus
   ---------------------------------------------------------------------------*/
-eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams);
+eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced);
 
 /* ---------------------------------------------------------------------------
     \fn sme_SetTxPerTracking
diff --git a/CORE/SME/src/pmc/pmcApi.c b/CORE/SME/src/pmc/pmcApi.c
index 3887781..314bba7 100644
--- a/CORE/SME/src/pmc/pmcApi.c
+++ b/CORE/SME/src/pmc/pmcApi.c
@@ -3042,14 +3042,15 @@
 }
 #endif // FEATURE_WLAN_SCAN_PNO
 
-eHalStatus pmcSetPowerParams(tHalHandle hHal,   tSirSetPowerParamsReq*  pwParams)
+eHalStatus pmcSetPowerParams(tHalHandle hHal,   tSirSetPowerParamsReq*  pwParams, tANI_BOOLEAN forced)
 {
     tSirSetPowerParamsReq* pRequestBuf;
     vos_msg_t msg;
     tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
     tpPESession     psessionEntry;
 
-    if((psessionEntry = peGetValidPowerSaveSession(pMac))== NULL)
+    psessionEntry = peGetValidPowerSaveSession(pMac);
+    if (!forced && (psessionEntry == NULL))
     {
         return eHAL_STATUS_NOT_INITIALIZED;
     }
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 35d1445..f9a3c08 100755
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -5382,14 +5382,14 @@
 
 #endif // FEATURE_WLAN_SCAN_PNO
 
-eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams)
+eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced)
 {
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     eHalStatus status;
 
     if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) )
     {
-        pmcSetPowerParams(hHal, pwParams);
+        pmcSetPowerParams(hHal, pwParams, forced);
         sme_ReleaseGlobalLock( &pMac->sme );
     }