Validate the p2pIeOffset in beacon template.

The p2pIeOffset should be greater than timIeOffset.
Adding required checks for validating the p2pIeOffset before
sending the beacon template to the FW.

Change-Id: I00fdbb5b9769fd1c190452ad85c46e60a78b9606
CRs-Fixed: 443901
diff --git a/CORE/WDA/src/wlan_qct_wda.c b/CORE/WDA/src/wlan_qct_wda.c
index f191d52..830a5ef 100644
--- a/CORE/WDA/src/wlan_qct_wda.c
+++ b/CORE/WDA/src/wlan_qct_wda.c
@@ -5945,6 +5945,16 @@
                               pSendbeaconParams->beaconLength;
    wdiSendBeaconReqParam.wdiSendBeaconParamsInfo.timIeOffset = 
                               pSendbeaconParams->timIeOffset;
+   /* p2pIeOffset should be atleast greater than timIeOffset */
+   if ((pSendbeaconParams->p2pIeOffset != 0) &&
+           (pSendbeaconParams->p2pIeOffset <
+            pSendbeaconParams->timIeOffset))
+   {
+       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+               "Invalid p2pIeOffset = %hu ", pSendbeaconParams->p2pIeOffset);
+       VOS_ASSERT( 0 );
+       return WDI_STATUS_E_FAILURE;
+   }
    wdiSendBeaconReqParam.wdiSendBeaconParamsInfo.usP2PIeOffset = 
                               pSendbeaconParams->p2pIeOffset;
    /* Copy the beacon template to local buffer */