Fix for seg fault at 5th and 20th slot and SIB1
[o-du/l2.git] / src / 5gnrmac / lwr_mac_fsm.c
index 8496582..47a681e 100644 (file)
 #include "du_app_mac_inf.h"
 #include "mac.h"
 #include "rg.x"            /* typedefs for MAC */
+#include "lwr_mac_phy.h"
+#include "math.h"
 
 #define MIB_SFN_BITMASK 0xFC
 #define PDCCH_PDU_TYPE 0
 #define PDSCH_PDU_TYPE 1
 #define SSB_PDU_TYPE 3
+#define PRACH_PDU_TYPE 0
+#define PDU_PRESENT 1
 #define SETLENGTH(x, size) x += size
 
+extern void fapiMacConfigRsp();
+extern uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX];
 
-EXTERN void sendToPhy ARGS((uint8_t msgType, uint32_t msgLen, void *msg));
-SlotIndInfo slotIndInfo;   //global variable
+/* Global variables */
+SlotIndInfo slotIndInfo;
+uint8_t slotIndIdx;
+
+void lwrMacInit()
+{
+#ifdef INTEL_WLS
+   uint8_t  idx;
+
+   /* Initializing WLS free mem list */
+   slotIndIdx = 1;
+   for(idx = 0; idx < WLS_MEM_FREE_PRD; idx++)
+   {
+      cmLListInit(&wlsBlockToFreeList[idx]);
+   }
+#endif
+}
 
  /*******************************************************************
   *
@@ -1301,12 +1322,17 @@ S16 lwr_mac_handleParamReqEvt(void *msg)
    uint32_t msgLen;      //Length of message Body
    msgLen = 0;
    fapi_param_req_t *paramReq;
+#ifdef INTEL_WLS
+   WLS_MEM_ALLOC(paramReq, sizeof(fapi_param_req_t));
+#else
    MAC_ALLOC(paramReq, sizeof(fapi_param_req_t));
+#endif
    if(paramReq != NULLP)
    {
       fillMsgHeader(&paramReq->header, FAPI_PARAM_REQUEST, msgLen);
       DU_LOG("\nLOWER MAC: sending param Req to Phy");
-      sendToPhy(paramReq->header.message_type_id, sizeof(fapi_param_req_t), (void *)paramReq);
+      LwrMacSendToPhy(paramReq->header.message_type_id, sizeof(fapi_param_req_t), (void *)paramReq);
       MAC_FREE(paramReq, sizeof(fapi_param_req_t));
       return ROK;
    }
@@ -1891,7 +1917,11 @@ S16 lwr_mac_handleConfigReqEvt(void *msg)
    cellParams = rgCb[inst].cell;
    macCfgParams = cellParams->macCellCfg;
    configReqSize = sizeof(fapi_config_req_t) + (macCfgParams.numTlv * sizeof(fapi_uint16_tlv_t));
+#ifdef INTEL_WLS
+   WLS_MEM_ALLOC(configReq, configReqSize);
+#else
    MAC_ALLOC(configReq, configReqSize);
+#endif
 
    if(configReq != NULL)
    {
@@ -1963,7 +1993,8 @@ S16 lwr_mac_handleConfigReqEvt(void *msg)
 
       fillMsgHeader(&configReq->header, FAPI_CONFIG_REQUEST, msgLen);
       DU_LOG("\nLOWER_MAC: Sending Config Request to Phy");
-      sendToPhy(configReq->header.message_type_id, msgLen, (void *)configReq);
+      /* TODO : Recheck the size / msglen to be sent to WLS_Put*/
+      LwrMacSendToPhy(configReq->header.message_type_id, msgLen, (void *)configReq);
       MAC_FREE(configReq, configReqSize);
       return ROK;
    }
@@ -2020,13 +2051,17 @@ S16 lwr_mac_handleStartReqEvt(void *msg)
 #ifdef FAPI
    uint32_t msgLen = 0;
    fapi_start_req_t *startReq;
+#ifdef INTEL_WLS
+   WLS_MEM_ALLOC(startReq, sizeof(fapi_start_req_t));
+#else
    MAC_ALLOC(startReq, sizeof(fapi_start_req_t));
+#endif
 
    if(startReq != NULL)
    {
       fillMsgHeader(&startReq->header, FAPI_START_REQUEST, msgLen);
       DU_LOG("\nLOWER MAC: Sending Start Request to PHY");
-      sendToPhy(startReq->header.message_type_id, sizeof(fapi_start_req_t), (void *)startReq);
+      LwrMacSendToPhy(startReq->header.message_type_id, sizeof(fapi_start_req_t), (void *)startReq);
       MAC_FREE(startReq, sizeof(fapi_start_req_t));
       return ROK;
    }
@@ -2045,9 +2080,8 @@ S16 lwr_mac_handleStopReqEvt(void *msg)
 #ifdef FAPI
    /* stop TX and RX operation return PHy to configured State
       send stop.indication to l2/l3 */
-#else
-   RETVALUE(ROK);
 #endif
+   return ROK;
 }
 
 /*******************************************************************
@@ -2307,7 +2341,11 @@ uint32_t *msgLen)
        dlTtiReqPdu->u.pdcch_pdu.shiftIndex =  sib1PdcchInfo->sib1Coreset0Cfg.shiftIndex;
        dlTtiReqPdu->u.pdcch_pdu.precoderGranularity = sib1PdcchInfo->sib1Coreset0Cfg.precoderGranularity;
        dlTtiReqPdu->u.pdcch_pdu.numDlDci = sib1PdcchInfo->numDlDci;
+#ifdef INTEL_WLS       
+       WLS_MEM_ALLOC(dlTtiReqPdu->u.pdcch_pdu.dlDci, sizeof(fapi_dl_dci_t));
+#else
        MAC_ALLOC(dlTtiReqPdu->u.pdcch_pdu.dlDci, sizeof(fapi_dl_dci_t));
+#endif
        fillDlDciPdu(dlTtiReqPdu->u.pdcch_pdu.dlDci, sib1PdcchInfo);
        dlTtiReqPdu->pduSize = sizeof(fapi_dl_pdcch_pdu_t);
        SETLENGTH(*msgLen, sizeof(fapi_dl_pdcch_pdu_t));
@@ -2447,15 +2485,275 @@ uint8_t calculatePduCount(DlBrdcstAlloc *cellBroadcastInfo)
  * ****************************************************************/
 S16 handleDlTtiReq(CmLteTimingInfo *dlTtiReqtimingInfo)
 {
+#ifdef FAPI
+       uint8_t idx;
+       uint8_t nPdu = 0;
+       uint8_t numPduEncoded = 0;
+       uint32_t msgLen = 0;
+       fapi_dl_tti_req_t *dlTtiReq = NULLP;
+       fapi_dl_tti_req_pdu_t *dlTtiReqPdu = NULLP;
+       RgCellCb  *cellCbParams = NULLP;
+       MacDlSlot *currDlSlot = NULLP;
+       MacCellCfg macCellCfg;
+       memset(&macCellCfg, 0, sizeof(MacCellCfg));
+       Inst inst = 0;
+
+       if(clGlobalCp.phyState == PHY_STATE_RUNNING)
+       {
+               cellCbParams = rgCb[inst].cell;
+               macCellCfg = cellCbParams->macCellCfg;
+
+               if(dlTtiReqtimingInfo != NULLP)
+               {
+#ifdef INTEL_WLS
+                       WLS_MEM_ALLOC(dlTtiReq, sizeof(fapi_dl_tti_req_t));
+#else
+                       MAC_ALLOC(dlTtiReq, sizeof(fapi_dl_tti_req_t));
+#endif
+                       if(dlTtiReq != NULLP)
+                       {
+                               dlTtiReq->sfn = dlTtiReqtimingInfo->sfn;
+                               dlTtiReq->slot = dlTtiReqtimingInfo->slot;
+                               currDlSlot = &macCb.macCell->dlSlot[dlTtiReq->slot % MAX_SLOT_SUPPORTED];
+                               dlTtiReq->nPdus = calculatePduCount(&currDlSlot->cellBroadcastInfo);  /* get total Pdus */
+                               nPdu = dlTtiReq->nPdus;
+                               dlTtiReq->nGroup = 0;
+                               if(dlTtiReq->nPdus > 0)
+                               {
+#ifdef INTEL_WLS
+                                       WLS_MEM_ALLOC(dlTtiReqPdu, (nPdu * sizeof(fapi_dl_tti_req_pdu_t)));
+#else
+                                       MAC_ALLOC(dlTtiReqPdu, (nPdu * sizeof(fapi_dl_tti_req_pdu_t)));
+#endif
+                                       if(currDlSlot->cellBroadcastInfo.ssbTrans)
+                                       {
+                                               if(dlTtiReqPdu != NULLP)
+                                               {
+                                                       for(idx = 0; idx < currDlSlot->cellBroadcastInfo.ssbIdxSupported; idx++)
+                                                       {
+                                                               if(idx > 0)
+                                                                       dlTtiReq->pdus++;
+                                                               fillSsbPdu(dlTtiReqPdu, &macCellCfg, currDlSlot, &msgLen, idx);
+                                                               dlTtiReq->pdus = dlTtiReqPdu;
+                                                               numPduEncoded++;
+                                                       }
+                                               }
+                                       }
+                                       if(currDlSlot->cellBroadcastInfo.sib1Trans)
+                                       {
+                                               /* Filling SIB1 param */
+                                               if(dlTtiReqPdu != NULLP)
+                                               {
+                                                       if(numPduEncoded != nPdu)
+                                                       {
+                                                               dlTtiReq->pdus++;
+                                                               dlTtiReqPdu = dlTtiReq->pdus;
+                                                               fillPdcchPdu(dlTtiReqPdu, &currDlSlot->cellBroadcastInfo.\
+                                                                               sib1Alloc.sib1PdcchCfg, &msgLen);
+                                                               dlTtiReq->pdus = dlTtiReqPdu;
+                                                               numPduEncoded++;
+                                                               dlTtiReq->pdus++;
+                                                               dlTtiReqPdu = dlTtiReq->pdus;
+                                                               fillPdschPdu(dlTtiReqPdu,&currDlSlot->cellBroadcastInfo.\
+                                                                               sib1Alloc.sib1PdschCfg, &msgLen);
+                                                               dlTtiReq->pdus = dlTtiReqPdu;
+                                                               numPduEncoded++;
+                                                       }
+                                               }
+                                       }
+                                       msgLen += sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
+                                       fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
+                                       /* TODO : Recheck the size / msglen to be sent to WLS_Put*/
+                                       LwrMacSendToPhy(dlTtiReq->header.message_type_id, msgLen, (void *)dlTtiReq);
+                                       if(currDlSlot->cellBroadcastInfo.sib1Trans)
+                                       {
+                                               if(currDlSlot->cellBroadcastInfo.ssbTrans)
+                                               {
+
+                                                       MAC_FREE(dlTtiReq->pdus[1].u.pdcch_pdu.dlDci, 
+                                                                       sizeof(fapi_dl_dci_t));
+                                               }
+                                               else
+                                               {
+
+                                                       MAC_FREE(dlTtiReq->pdus[0].u.pdcch_pdu.dlDci, 
+                                                                       sizeof(fapi_dl_dci_t));
+                                               }
+                                       }
+
+                                       MAC_FREE(dlTtiReqPdu, (nPdu * sizeof(fapi_dl_tti_req_pdu_t)));
+                               }
+                               else
+                               {
+                                       msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
+                                       fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
+                                       /* TODO : Recheck the size / msglen to be sent to WLS_Put*/
+                                       LwrMacSendToPhy(dlTtiReq->header.message_type_id, msgLen, (void *)dlTtiReq);
+                               }
+                               MAC_FREE(dlTtiReq, sizeof(fapi_dl_tti_req_t));
+                               return ROK;
+                       }
+                       else
+                       {
+                               DU_LOG("\nLOWER MAC: Failed to allocate memory for DL TTI Request");
+                               return RFAILED;
+                       }
+               }
+      else
+      {
+         DU_LOG("\nLOWER MAC: Current TTI Info is NULL");
+         return RFAILED;
+      }
+   }
+   else
+   {
+       lwr_mac_handleInvalidEvt(dlTtiReqtimingInfo);
+   }
+#endif
+   return ROK;
+}
+
+/***********************************************************************
+ *
+ * @brief calculates the total size to be allocated for UL TTI Req
+ *
+ * @details
+ *
+ *    Function : getnPdus
+ *
+ *    Functionality:
+ *         -calculates the total pdu count to be allocated for UL TTI Req
+ *
+ * @params[in] Pointer to fapi Ul TTI Req
+ *             Pointer to CurrUlSlot
+ * @return count
+ * ********************************************************************/
+#ifdef FAPI
+uint8_t getnPdus(fapi_ul_tti_req_t *ulTtiReq, MacUlSlot *currUlSlot)
+{
+       uint8_t pduCount = 0;
+
+       if(currUlSlot != NULLP)
+   {
+          if(currUlSlot->ulCellInfo.dataType & SCH_DATATYPE_PRACH)
+          {
+             pduCount++;
+             ulTtiReq->rachPresent = PDU_PRESENT;
+               }
+               if(currUlSlot->ulCellInfo.dataType & SCH_DATATYPE_PUSCH_UCI)
+               {
+                  pduCount++;
+                       ulTtiReq->nUlsch = PDU_PRESENT;
+               }
+               if(currUlSlot->ulCellInfo.dataType & SCH_DATATYPE_UCI)
+               {
+                  pduCount++;
+                       ulTtiReq->nUlcch = PDU_PRESENT;
+               }
+               if(currUlSlot->ulCellInfo.dataType & SCH_DATATYPE_SRS)
+               {
+                  pduCount++;
+               }
+   }
+       return pduCount;
+} 
+#endif 
+
+/***********************************************************************
+ *
+ * @brief Set the value of zero correlation config in PRACH PDU
+ *
+ * @details
+ *
+ *    Function : setNumCs
+ *
+ *    Functionality:
+ *         -Set the value of zero correlation config in PRACH PDU
+ *
+ * @params[in] Pointer to zero correlation config
+ *             Pointer to MacCellCfg
+ * ********************************************************************/
+
+void setNumCs(uint8_t *numCs, MacCellCfg *macCellCfg)
+{
 #ifdef FAPI
    uint8_t idx;
+       if(macCellCfg != NULLP)
+       {
+          idx = macCellCfg->prachCfg.fdm[0].zeroCorrZoneCfg; 
+          *numCs = UnrestrictedSetNcsTable[idx];
+       }
+#endif
+}
+
+/***********************************************************************
+ *
+ * @brief Fills the PRACH PDU in UL TTI Request
+ *
+ * @details
+ *
+ *    Function : fillPrachPdu
+ *
+ *    Functionality:
+ *         -Fills the PRACH PDU in UL TTI Request
+ *
+ * @params[in] Pointer to Prach Pdu
+ *             Pointer to CurrUlSlot
+ *             Pointer to macCellCfg
+ *             Pointer to msgLen
+ * ********************************************************************/
+
+#ifdef FAPI
+void fillPrachPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg, MacUlSlot *currUlSlot, uint32_t *msgLen)
+{
+   if(ulTtiReqPdu != NULLP)
+   {
+      ulTtiReqPdu->pduType = PRACH_PDU_TYPE; 
+      ulTtiReqPdu->u.prach_pdu.physCellId = macCellCfg->phyCellId;
+      ulTtiReqPdu->u.prach_pdu.numPrachOcas = currUlSlot->ulCellInfo.prachSchInfo.numPrachOcas;
+      ulTtiReqPdu->u.prach_pdu.prachFormat = \
+               currUlSlot->ulCellInfo.prachSchInfo.prachFormat;
+      ulTtiReqPdu->u.prach_pdu.numRa = currUlSlot->ulCellInfo.prachSchInfo.numRa;
+      ulTtiReqPdu->u.prach_pdu.prachStartSymbol = \
+               currUlSlot->ulCellInfo.prachSchInfo.prachStartSymb;
+      setNumCs(&ulTtiReqPdu->u.prach_pdu.numCs, macCellCfg);
+      ulTtiReqPdu->u.prach_pdu.beamforming.numPrgs = 0;
+      ulTtiReqPdu->u.prach_pdu.beamforming.prgSize = 0;
+      ulTtiReqPdu->u.prach_pdu.beamforming.digBfInterfaces = 0;
+      ulTtiReqPdu->u.prach_pdu.beamforming.pmi_bfi[0].pmIdx = 0;
+      ulTtiReqPdu->u.prach_pdu.beamforming.pmi_bfi[0].beamIdx[0].beamidx = 0;
+      ulTtiReqPdu->pduSize = sizeof(fapi_ul_prach_pdu_t); 
+      SETLENGTH(*msgLen, sizeof(fapi_dl_pdsch_pdu_t));
+   }
+}
+#endif
+
+/*******************************************************************
+ *
+ * @brief Sends UL TTI Request to PHY
+ *
+ * @details
+ *
+ *    Function : handleUlTtiReq
+ *
+ *    Functionality:
+ *         -Sends FAPI Param req to PHY
+ *
+ * @params[in]  Pointer to CmLteTimingInfo
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ******************************************************************/
+S16 handleUlTtiReq(CmLteTimingInfo *currTimingInfo)
+{
+#ifdef FAPI
    uint32_t msgLen = 0;
-   fapi_dl_tti_req_t *dlTtiReq = NULLP;
-   fapi_dl_tti_req_pdu_t *dlTtiReqPdu = NULLP;
+   fapi_ul_tti_req_t *ulTtiReq = NULLP;
+   fapi_ul_tti_req_pdu_t *ulTtiReqPdu = NULLP;
    RgCellCb  *cellCbParams = NULLP;
-       MacDlSlot *currDlSlot = NULLP;
+   MacUlSlot *currUlSlot = NULLP;
    MacCellCfg macCellCfg;
-       cmMemset((U8 *)&macCellCfg, 0, sizeof(MacCellCfg));
+       memset(&macCellCfg, 0, sizeof(MacCellCfg));
    Inst inst = 0;
 
    if(clGlobalCp.phyState == PHY_STATE_RUNNING)
@@ -2463,82 +2761,68 @@ S16 handleDlTtiReq(CmLteTimingInfo *dlTtiReqtimingInfo)
       cellCbParams = rgCb[inst].cell;
       macCellCfg = cellCbParams->macCellCfg;
 
-      if(dlTtiReqtimingInfo != NULLP)
+      if(currTimingInfo != NULLP)
       {
-         MAC_ALLOC(dlTtiReq, sizeof(fapi_dl_tti_req_t));
-         if(dlTtiReq != NULLP)
+#ifdef INTEL_WLS
+         WLS_MEM_ALLOC(ulTtiReq, sizeof(fapi_ul_tti_req_t));
+#else
+         MAC_ALLOC(ulTtiReq, sizeof(fapi_ul_tti_req_t));
+#endif
+         if(ulTtiReq != NULLP)
          {
-            dlTtiReq->sfn = dlTtiReqtimingInfo->sfn;
-            dlTtiReq->slot = dlTtiReqtimingInfo->slot;
-                               currDlSlot = &macCb.macCell->dlSlot[dlTtiReq->slot % MAX_SLOT_SUPPORTED];
-                               dlTtiReq->nPdus = calculatePduCount(&currDlSlot->cellBroadcastInfo);  /* get total Pdus */
-            dlTtiReq->nGroup = 0;
-            if(dlTtiReq->nPdus > 0)
+            ulTtiReq->sfn = currTimingInfo->sfn;
+            ulTtiReq->slot = currTimingInfo->slot;
+            currUlSlot = &macCb.macCell->ulSlot[ulTtiReq->slot % MAX_SLOT_SUPPORTED];
+                ulTtiReq->nPdus = getnPdus(ulTtiReq, currUlSlot);
+            ulTtiReq->nGroup = 0;
+            if(ulTtiReq->nPdus > 0)
             {
-               MAC_ALLOC(dlTtiReqPdu, (dlTtiReq->nPdus * sizeof(fapi_dl_tti_req_pdu_t)));
-               if(currDlSlot->cellBroadcastInfo.ssbTrans)
+#ifdef INTEL_WLS
+               WLS_MEM_ALLOC(ulTtiReqPdu, (ulTtiReq->nPdus * sizeof(fapi_ul_tti_req_pdu_t)));
+#else
+               MAC_ALLOC(ulTtiReqPdu, (ulTtiReq->nPdus * sizeof(fapi_ul_tti_req_pdu_t)));
+#endif
+               /* Fill Prach Pdu */
+               if(ulTtiReq->rachPresent)
                {
-                 if(dlTtiReqPdu != NULLP)
+                 if(ulTtiReqPdu != NULLP)
                  {
-                    for(idx = 0; idx < currDlSlot->cellBroadcastInfo.ssbIdxSupported; idx++)
-                    {
-                                                         if(idx > 0)
-                       dlTtiReq->pdus++;
-                       fillSsbPdu(dlTtiReqPdu, &macCellCfg, currDlSlot, &msgLen, idx);
-                       dlTtiReq->pdus = dlTtiReqPdu;
-                    }
+                    fillPrachPdu(ulTtiReqPdu, &macCellCfg, currUlSlot, &msgLen);
+                    ulTtiReq->pdus = ulTtiReqPdu;
                  }
+                 msgLen = sizeof(fapi_ul_tti_req_t) - sizeof(fapi_msg_t);
+                 fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, msgLen);
+                 LwrMacSendToPhy(ulTtiReq->header.message_type_id, msgLen, (void *)ulTtiReq);
+                                         MAC_FREE(ulTtiReqPdu, (ulTtiReq->nPdus * sizeof(fapi_ul_tti_req_pdu_t)));
                }
-               if(currDlSlot->cellBroadcastInfo.sib1Trans)
-               {
-                  /* Filling SIB1 param */
-                  if(dlTtiReqPdu != NULLP)
-                  {
-                     dlTtiReq->pdus++;
-                     fillPdcchPdu(dlTtiReqPdu, &currDlSlot->cellBroadcastInfo.sib1Alloc.sib1PdcchCfg, &msgLen);
-                     dlTtiReq->pdus = dlTtiReqPdu;
-                     dlTtiReq->pdus++;
-                     fillPdschPdu(dlTtiReqPdu, &currDlSlot->cellBroadcastInfo.sib1Alloc.sib1PdschCfg, &msgLen);
-                     dlTtiReq->pdus = dlTtiReqPdu;
-                  }
-               }
-               msgLen += sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
-               fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
-               sendToPhy(dlTtiReq->header.message_type_id, msgLen, (void *)dlTtiReq);
-                                       if(currDlSlot->cellBroadcastInfo.sib1Trans)
-                                       {
-                  MAC_FREE(dlTtiReq->pdus->u.pdcch_pdu.dlDci, sizeof(fapi_dl_dci_t));
-                                  }
-               MAC_FREE(dlTtiReqPdu, (dlTtiReq->nPdus * sizeof(fapi_dl_tti_req_pdu_t)));
-             }
-             else
-             {
-                msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
-                fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
-                sendToPhy(dlTtiReq->header.message_type_id, msgLen, (void *)dlTtiReq);
-             }
-             MAC_FREE(dlTtiReq, sizeof(fapi_dl_tti_req_t));
-             return ROK;
+            } 
+            else
+            {
+                msgLen = sizeof(fapi_ul_tti_req_t) - sizeof(fapi_msg_t);
+                fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, msgLen);
+                LwrMacSendToPhy(ulTtiReq->header.message_type_id, msgLen, (void *)ulTtiReq);
+            }
+                               MAC_FREE(ulTtiReq, sizeof(fapi_ul_tti_req_t));
+                               return ROK;
          }
-         else
-         {
-            DU_LOG("\nLOWER MAC: Failed to allocate memory for DL TTI Request");
+             else
+             {
+                DU_LOG("\nLOWER MAC: Failed to allocate memory for UL TTI Request");
             return RFAILED;
          }
       }
       else
       {
-         DU_LOG("\nLOWER MAC: Current TTI Info is NULL");
+         DU_LOG("\nLOWER MAC: Current TTI Info in UL is NULL");
          return RFAILED;
       }
    }
    else
    {
-       lwr_mac_handleInvalidEvt(dlTtiReqtimingInfo);
+       lwr_mac_handleInvalidEvt(currTimingInfo);
    }
-#else
-   return ROK;
 #endif
+   return ROK;
 }
 
 lwrMacFsmHdlr fapiEvtHdlr[MAX_STATE][MAX_EVENT] =