CRC and Rx Data Indication 10/3710/4
authorBalaji Shankaran <balaji.shankaran@radisys.com>
Fri, 15 May 2020 10:30:01 +0000 (16:00 +0530)
committerBalaji Shankaran <balaji.shankaran@radisys.com>
Tue, 19 May 2020 11:22:56 +0000 (16:52 +0530)
Change-Id: I9d63f8c37bef909cd820de9a4fb09eec4900ff90
Signed-off-by: Balaji Shankaran <balaji.shankaran@radisys.com>
13 files changed:
Dockerfile
Dockerfile-cu-stub
src/5gnrmac/lwr_mac_handle_phy.c
src/5gnrmac/lwr_mac_upr_inf.c
src/5gnrmac/lwr_mac_upr_inf.h
src/5gnrmac/mac_rach.c
src/5gnrsch/sch.c
src/5gnrsch/sch.h
src/cm/mac_sch_interface.c
src/cm/mac_sch_interface.h
src/cm/tfu.h
src/cm/tfu.x
src/phy_stub/l1_bdy1.c

index 7536b59..15f89a8 100644 (file)
@@ -1,4 +1,4 @@
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:7-u18.04 as ubuntu
+FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:8-u18.04 as ubuntu
 
 ADD . /opt/o-du-l2
 WORKDIR /opt/o-du-l2
index 79acea3..19db6d1 100644 (file)
@@ -1,4 +1,4 @@
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:7-u18.04 as ubuntu
+FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:8-u18.04 as ubuntu
 
 ADD . /opt/o-du-l2
 WORKDIR /opt/o-du-l2
index a85b861..736aca2 100644 (file)
@@ -64,6 +64,23 @@ packRachIndMsg sendRachIndOpts[] =
    packRachInd
 };
 
+/* Function pointer for crc indication from lower mac to mac */
+packCrcIndMsg sendCrcIndOpts[] =
+{
+   packCrcInd,
+   fapiMacCrcInd,
+   packCrcInd
+};
+
+/* Function pointer for Rx Data indication from lower mac to mac */
+packRxDataIndMsg sendRxDataIndOpts[] =
+{
+   packRxDataInd,
+   fapiMacRxDataInd,
+   packRxDataInd
+};
+
 /*******************************************************************
  *
  * @brief Fills post structure
@@ -189,6 +206,110 @@ uint8_t handleRachInd(fapi_rach_indication_t  *fapiRachInd)
 
 }/* handleRachInd */
 
+/*******************************************************************
+ *
+ * @brief Handles CRC indication from PHY and sends to MAC
+ *
+ * @details
+ *
+ *    Function : handleCrcInd
+ *
+ *    Functionality:
+ *      Handles CRC indication from PHY and sends to MAC
+ *
+ * @params[in] fapi_crc_ind_t message pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t handleCrcInd(fapi_crc_ind_t  *fapiCrcInd)
+{
+   Pst          pst;
+   uint8_t      crcInfoIdx;
+   uint8_t      crcStatusIdx;
+   CrcInfo      *crcIndInfo;
+   CrcInd       crcInd;
+
+   crcInd.timingInfo.sfn = fapiCrcInd->sfn;
+   crcInd.timingInfo.slot = fapiCrcInd->slot;
+   crcInd.numCrc = fapiCrcInd->numCrcs;
+
+   for(crcInfoIdx = 0; crcInfoIdx < crcInd.numCrc; crcInfoIdx++)
+   {
+      crcIndInfo = &crcInd.crcInfo[crcInfoIdx];
+      crcIndInfo->handle      = fapiCrcInd->crc[crcInfoIdx].handle;
+      crcIndInfo->rnti        = fapiCrcInd->crc[crcInfoIdx].rnti;
+      crcIndInfo->harqId      = fapiCrcInd->crc[crcInfoIdx].harqId;
+      crcIndInfo->tbCrcStatus = fapiCrcInd->crc[crcInfoIdx].tbCrcStatus;
+      crcIndInfo->numCb       = fapiCrcInd->crc[crcInfoIdx].numCb;
+      for(crcStatusIdx = 0; crcStatusIdx < crcIndInfo->numCb; crcStatusIdx++)
+      {
+         crcIndInfo->cbCrcStatus[crcStatusIdx] = \
+            fapiCrcInd->crc[crcInfoIdx].cbCrcStatus[crcStatusIdx];
+      }
+      crcIndInfo->ul_cqi  = fapiCrcInd->crc[crcInfoIdx].ul_cqi;
+      crcIndInfo->timingAdvance = fapiCrcInd->crc[crcInfoIdx].timingAdvance;
+      crcIndInfo->rssi = fapiCrcInd->crc[crcInfoIdx].rssi;
+   }
+
+   fillLwrMacToMacPst(&pst);
+   pst.event = EVENT_CRC_IND_TO_MAC;
+   
+   (*sendCrcIndOpts[pst.selector])(&pst, &crcInd);
+   return ROK;
+
+} /* handleCrcInd */
+
+/*******************************************************************
+ *
+ * @brief Handles Rx Data indication from PHY and sends to MAC
+ *
+ * @details
+ *
+ *    Function : handleRxDataInd
+ *
+ *    Functionality:
+ *      Handles Rx Data indication from PHY and sends to MAC
+ *
+ * @params[in] fapi_rx_data_indication_t message pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t handleRxDataInd(fapi_rx_data_indication_t  *fapiRxDataInd)
+{
+   Pst           pst;
+   uint8_t       pduIdx;
+   RxDataInd     rxDataInd;
+   RxDataIndPdu  *pdu;   
+
+   rxDataInd.timingInfo.sfn = fapiRxDataInd->sfn; 
+   rxDataInd.timingInfo.slot = fapiRxDataInd->slot;
+   rxDataInd.numPdus = fapiRxDataInd->numPdus;
+
+   for(pduIdx = 0; pduIdx < rxDataInd.numPdus; pduIdx++)
+   {
+      pdu = &rxDataInd.pdus[pduIdx];
+      pdu->handle = fapiRxDataInd->pdus[pduIdx].handle;
+      pdu->rnti = fapiRxDataInd->pdus[pduIdx].rnti;
+      pdu->harqId = fapiRxDataInd->pdus[pduIdx].harqId;
+      pdu->pduLength = fapiRxDataInd->pdus[pduIdx].pduLength;
+      pdu->ul_cqi = fapiRxDataInd->pdus[pduIdx].ul_cqi;
+      pdu->timingAdvance = fapiRxDataInd->pdus[pduIdx].timingAdvance;
+      pdu->rssi = fapiRxDataInd->pdus[pduIdx].rssi;
+      /* TODO : Copy pdu from FAPI msg to MAC structure*/
+      //pdu->pduData;
+   }
+
+   fillLwrMacToMacPst(&pst);
+   pst.event = EVENT_RX_DATA_IND_TO_MAC;
+   (*sendRxDataIndOpts[pst.selector])(&pst, &rxDataInd);
+   return ROK;
+}
+
 #endif /* FAPI */
 
 void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg)
@@ -225,16 +346,22 @@ void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg)
       }
       case FAPI_RX_DATA_INDICATION:
       {
+         fapi_rx_data_indication_t *rxDataInd;
+         rxDataInd = (fapi_rx_data_indication_t *)msg;
+         handleRxDataInd(rxDataInd);
          break;
       }  
       case FAPI_CRC_INDICATION:
       {
+         fapi_crc_ind_t  *crcInd;
+         crcInd = (fapi_crc_ind_t *)msg;
+         handleCrcInd(crcInd);
          break;
       }  
       case FAPI_UCI_INDICATION:
       {
          break;
-      }  
+      }
       case FAPI_SRS_INDICATION:
       {
          break;
index 46b7a42..b17ca95 100644 (file)
 
 #include "lwr_mac_upr_inf.h"
 
+/*******************************************************************
+ *
+ * @brief Packs and Sends CRC Ind to MAC
+ *
+ * @details
+ *
+ *    Function : packCrcInd
+ *
+ *    Functionality:
+ *      Packs and Sends CRC Ind to MAC
+ *
+ * @params[in] Post structure pointer
+ *             CRC indication
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t packCrcInd(Pst *pst, CrcInd *crcInd)
+{
+   if((pst->selector == MAC_SELECTOR_LC) || (pst->selector == MAC_SELECTOR_LWLC))
+   {
+      return ROK;
+   }
+   else
+   {
+      return RFAILED;
+   }
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and Sends Rx Data Ind to MAC
+ *
+ * @details
+ *
+ *    Function : packRxDataInd
+ *
+ *    Functionality:
+ *      Packs and Sends Rx data Ind to MAC
+ *
+ * @params[in] Post structure pointer
+ *             Rx Data indication
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd)
+{
+   if((pst->selector == MAC_SELECTOR_LC) || (pst->selector == MAC_SELECTOR_LWLC))
+   {
+      return ROK;
+   }
+   else
+   {
+      return RFAILED;
+   }
+}
+
+
 /*******************************************************************
  *
  * @brief Packs and Sends RACH Ind to MAC
index 98327a8..a339786 100644 (file)
@@ -54,6 +54,16 @@ typedef uint16_t (*packRachIndMsg)(Pst *pst, RachInd *rachInd);
 uint16_t packRachInd(Pst *pst, RachInd *rachInd);
 uint16_t fapiMacRachInd(Pst *pst, RachInd *rachInd);
 
+
+typedef uint16_t (*packCrcIndMsg)(Pst *pst, CrcInd *crcInd);
+uint16_t packCrcInd(Pst *pst, CrcInd *crcInd);
+uint16_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd);
+
+
+typedef uint16_t (*packRxDataIndMsg)(Pst *pst, RxDataInd *rxDataInd);
+uint16_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd);
+uint16_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd);
+
 #endif
 /**********************************************************************
          End of file
index f1b850a..2d5d2c8 100644 (file)
@@ -51,6 +51,13 @@ MacSchRachIndFunc macSchRachIndOpts[]=
    packMacSchRachInd
 };
 
+/* Function pointer for sending crc ind from MAC to SCH */
+MacSchCrcIndFunc macSchCrcIndOpts[]=
+{
+   packMacSchCrcInd,
+   macSchCrcInd,
+   packMacSchCrcInd
+};
 
 /*******************************************************************
  *
@@ -77,6 +84,33 @@ int sendRachIndMacToSch(RachIndInfo *rachInd)
     
    return(*macSchRachIndOpts[pst.selector])(&pst, rachInd); 
 }
+
+/*******************************************************************
+ *
+ * @brief Sends CRC Indication to SCH
+ *
+ * @details
+ *
+ *    Function : sendCrcIndMacToSch 
+ *
+ *    Functionality:
+ *       Sends CRC Indication to SCH
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+int sendCrcIndMacToSch(CrcIndInfo *crcInd)
+{
+   Pst pst;
+  
+   fillMacToSchPst(&pst);
+   pst.event = EVENT_CRC_IND_TO_SCH;
+   return(*macSchCrcIndOpts[pst.selector])(&pst, crcInd);
+}
+
  
 /*******************************************************************
  *
@@ -124,6 +158,40 @@ uint16_t fapiMacRachInd(Pst *pst, RachInd *rachInd)
    return(sendRachIndMacToSch(rachIndInfo));
 }
 
+/*******************************************************************
+ *
+ * @brief Processes CRC Indication from PHY
+ *
+ * @details
+ *
+ *    Function : fapiMacCrcInd
+ *
+ *    Functionality:
+ *       Processes CRC Indication from PHY
+ *
+ * @params[in] Post Structure Pointer
+ *             Crc Indication Pointer
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd)
+{
+   CrcIndInfo   crcIndInfo;
+
+   DU_LOG("\nMAC : Received CRC indication");
+   /* Considering one pdu and one preamble */
+   
+   crcIndInfo.cellId = macCb.macCell->cellId;;
+   crcIndInfo.crnti = crcInd->crcInfo[0].rnti;
+   crcIndInfo.timingInfo.sfn = crcInd->timingInfo.sfn;
+   crcIndInfo.timingInfo.slot = crcInd->timingInfo.slot;
+   crcIndInfo.numCrcInd = crcInd->crcInfo[0].numCb;
+   crcIndInfo.crcInd[0] = crcInd->crcInfo[0].cbCrcStatus[0];
+   
+   return(sendCrcIndMacToSch(&crcIndInfo));
+}
+
  
 /* spec-38.211 Table 6.3.3.1-7 */
 uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX] = 
@@ -140,6 +208,31 @@ int MacProcUlSchInfo(Pst *pst, UlSchInfo *ulSchInfo)
    return ROK;
 }
 
+/*******************************************************************
+ *
+ * @brief Process Rx Data Ind at MAC
+ *
+ * @details
+ *
+ *    Function : fapiMacRxDataInd
+ *
+ *    Functionality:
+ *       Process Rx Data Ind at MAC
+ *
+ * @params[in] Post structure
+ *             Rx Data Indication
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd)
+{
+   DU_LOG("\nMAC : Received Rx Data indication");
+   /* TODO : Demuxing */
+   return ROK;
+}
+
+
 /**********************************************************************
   End of file
  **********************************************************************/
index e9cd498..25c7fdb 100644 (file)
@@ -330,6 +330,41 @@ int macSchRachInd(Pst *pst, RachIndInfo *rachInd)
    return ROK;
 }
 
+/*******************************************************************
+ *
+ * @brief Processes CRC indication from MAC 
+ *
+ * @details
+ *
+ *    Function : macSchCrcInd
+ *
+ *    Functionality:
+ *      Processes CRC indication from MAC
+ *
+ * @params[in] Post structure
+ *             Crc Indication
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+int macSchCrcInd(Pst *pst, CrcIndInfo *crcInd)
+{
+   switch(crcInd->crcInd[0])
+       {
+      case CRC_FAILED:
+         DU_LOG("\nSCH : Received CRC indication. CRC Status [FAILURE]");
+                       break;
+      case CRC_PASSED:
+         DU_LOG("\nSCH : Received CRC indication. CRC Status [PASS]");
+                       break;
+          default:
+                       DU_LOG("\nSCH : Invalid CRC state %d", crcInd->crcInd[0]);
+                       return RFAILED;
+       }
+   return ROK;
+}
+
+
 /**
  * @brief inti cellCb based on cellCfg
  *
index 8bb3fa3..b97db6c 100644 (file)
@@ -38,6 +38,9 @@
 #define SI_RNTI 0xFFFF
 #define P_RNTI  0xFFFE
 
+#define CRC_FAILED 0
+#define CRC_PASSED 1
+
 /* allocate and zero out a static buffer */
 #define SCH_ALLOC(_datPtr, _size)                                \
 {                                                               \
index 8f53295..2b24499 100644 (file)
@@ -57,6 +57,22 @@ int packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd)
    RETVALUE(SPstTsk(pst,mBuf));
 }
 
+/*******************************************************************
+ *
+ * @brief Pack and Send Rach Ind from MAC to SCH
+ *
+ * @details
+ *
+ *    Function : packMacSchRachInd
+ *
+ *    Functionality:
+ *      Pack and Send Rach Ind from MAC to SCH
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
 int packMacSchRachInd(Pst *pst, RachIndInfo *rachInd)
 {
    if((pst->selector == MAC_SELECTOR_LC) || (pst->selector == MAC_SELECTOR_LWLC))
@@ -69,6 +85,36 @@ int packMacSchRachInd(Pst *pst, RachIndInfo *rachInd)
    }
    return ROK;
 }
+
+/*******************************************************************
+ *
+ * @brief Pack and Send Crc Ind from MAC to SCH
+ *
+ * @details
+ *
+ *    Function : packMacSchCrcInd
+ *
+ *    Functionality:
+ *       Pack and Send Crc Ind from MAC to SCH
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+int packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd)
+{
+   if((pst->selector == MAC_SELECTOR_LC) || (pst->selector == MAC_SELECTOR_LWLC))
+   {
+      /* TODO */
+   }
+   else
+   {
+      return RFAILED;
+   }
+   return ROK;
+}
+
 /**
  * @brief function to pack DL Broadcast allocation message 
  *        from MAC to SCH
index b08f2f8..9d43406 100644 (file)
@@ -48,6 +48,8 @@
 #define SCH_DATATYPE_SRS 8
 #define SCH_DATATYPE_PRACH 16
 
+#define MAX_NUMBER_OF_CRC_IND_BITS 1
+
 /*structures*/
 
 
@@ -391,6 +393,17 @@ typedef struct rachIndInfo
    uint16_t    timingAdv;
 }RachIndInfo;
 
+
+typedef struct crcIndInfo
+{
+   uint16_t    cellId;
+   uint16_t    crnti;
+   SlotIndInfo timingInfo;
+   uint16_t    numCrcInd;
+   uint8_t     crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
+}CrcIndInfo;
+
+
 /* function pointers */
 
 typedef int (*SchCellCfgCfmFunc)    ARGS((
@@ -430,6 +443,9 @@ EXTERN int MacProcUlSchInfo(Pst *pst, UlSchInfo *ulSchInfo);
 typedef int (*MacSchRachIndFunc)(Pst *pst, RachIndInfo *rachInd);
 int packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
 int macSchRachInd(Pst *pst, RachIndInfo *rachInd);
+typedef int (*MacSchCrcIndFunc)(Pst *pst, CrcIndInfo *crcInd);
+int packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
+int macSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
 
 /**********************************************************************
   End of file
index 01f7410..e6b9b70 100755 (executable)
 #define EVTTFUERRIND            25    /*!< TFU Error Indication */
 #define EVENT_RACH_IND_TO_MAC   26
 #define EVENT_RACH_IND_TO_SCH   27
+#define EVENT_CRC_IND_TO_MAC    28
+#define EVENT_CRC_IND_TO_SCH    29
+#define EVENT_RX_DATA_IND_TO_MAC 30
 /** @} */
 
 #define MAX_PREAM_PER_SLOT      1    /* Max number of preamble per slot */
-#define MAC_RACH_PDU_PER_SLOT   1    /* Max number of rach pdu per slot */
+#define MAX_RACH_PDU_PER_SLOT   1    /* Max number of rach pdu per slot */
+#define MAX_CRCS_PER_SLOT       1
+#define MAX_CB_PER_TTI_IN_BYTES 1
+#define MAX_ULSCH_PDUS_PER_TTI  1
 
 /* selector(coupling) values */
 #define TFU_SEL_TC              1    /*!< Selector for Tight coupling. */
index edf2d9c..e6466f6 100755 (executable)
@@ -2529,9 +2529,49 @@ typedef struct rachInd
 {
   SlotIndInfo   timingInfo;
   uint8_t       numPdu;
-  RachPduInfo   rachPdu[MAC_RACH_PDU_PER_SLOT];
+  RachPduInfo   rachPdu[MAX_RACH_PDU_PER_SLOT];
 }RachInd;
 
+typedef struct crcInfo
+{
+    uint32_t   handle;
+    uint16_t   rnti;
+    uint8_t    harqId;
+    uint8_t    tbCrcStatus;
+    uint16_t   numCb;
+    uint8_t    cbCrcStatus[MAX_CB_PER_TTI_IN_BYTES];
+    uint8_t    ul_cqi;
+    uint16_t   timingAdvance;
+    uint16_t   rssi;
+}CrcInfo;
+
+typedef struct crcInd
+{
+   SlotIndInfo   timingInfo;
+   uint16_t      numCrc;
+   CrcInfo       crcInfo[MAX_CRCS_PER_SLOT];
+}CrcInd;
+
+typedef struct 
+{
+   uint32_t      handle;
+   uint16_t      rnti;
+   uint8_t       harqId;
+   uint16_t      pduLength;
+   uint8_t       ul_cqi;
+   uint16_t      timingAdvance;
+   uint16_t      rssi;
+   uint8_t       *pduData;
+}RxDataIndPdu;
+typedef struct 
+{
+   SlotIndInfo   timingInfo;
+   uint16_t      numPdus;
+   RxDataIndPdu  pdus[MAX_ULSCH_PDUS_PER_TTI];
+}RxDataInd;
+
+
 typedef S16 (*TfuBndReq) ARGS((
    Pst*                 pst,
    SuId                 suId,
index 8595429..b5d40a3 100644 (file)
@@ -277,6 +277,120 @@ PUBLIC void l1HdlConfigReq(uint32_t msgLen, void *msg)
 
 }
 
+/*******************************************************************
+ *
+ * @brief Build and Send CRC Indication
+ *
+ * @details
+ *
+ *    Function : l1BuildAndSendCrcInd
+ *
+ *    Functionality:
+ *      Build and Send CRC Indication
+ *
+ * @params[in] Slot
+ *             SFN 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t l1BuildAndSendCrcInd(uint16_t slot, uint16_t sfn)
+{
+#ifdef FAPI
+   uint8_t idx = 0;
+   fapi_crc_ind_t  *crcInd;
+   
+   MAC_ALLOC(crcInd, sizeof(fapi_crc_ind_t));
+   if(!crcInd)
+   {
+      printf("\nPHY_STUB: Memory allocation failed for CRC Indication Message");
+      return RFAILED;
+   }
+
+   /* TODO: Fill the required values. As of now only 1 CRC status PASS is filled */
+   crcInd->sfn = sfn;
+   crcInd->slot = slot;
+   crcInd->numCrcs = 1;
+
+   crcInd->crc[idx].handle = 0;
+   crcInd->crc[idx].rnti = 0;
+   crcInd->crc[idx].harqId = 0;
+   crcInd->crc[idx].tbCrcStatus = 0;
+   crcInd->crc[idx].numCb = 1;
+   crcInd->crc[idx].cbCrcStatus[0] = 0;
+   crcInd->crc[idx].ul_cqi = 0;
+   crcInd->crc[idx].timingAdvance = 0;
+   crcInd->crc[idx].rssi = 0;
+
+   fillMsgHeader(&crcInd->header, FAPI_CRC_INDICATION, \
+      sizeof(fapi_crc_ind_t));
+
+   /* Sending RACH indication to MAC */
+   DU_LOG("\nPHY STUB: Sending CRC Indication to MAC");
+   handlePhyMessages(crcInd->header.message_type_id, sizeof(fapi_crc_ind_t), (void *)crcInd);
+   MAC_FREE(crcInd, sizeof(fapi_crc_ind_t));
+#endif
+   return ROK;
+} /* l1BuildAndSendCrcInd */
+
+
+/*******************************************************************
+ *
+ * @brief Build and send Rx data indication
+ *
+ * @details
+ *
+ *    Function : l1BuildAndSendRxDataInd
+ *
+ *    Functionality:
+ *       Build and send Rx data indication
+ *
+ * @params[in] SFN
+ *             Slot
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn)
+{
+#ifdef FAPI
+   uint8_t idx = 0;
+   fapi_rx_data_indication_t *rxDataInd;
+   fapi_pdu_ind_info_t       *pduInfo;
+   MAC_ALLOC(rxDataInd, sizeof(fapi_rx_data_indication_t));
+   if(!rxDataInd)
+   {
+      printf("\nPHY_STUB: Memory allocation failed for Rx Data Indication");
+      return RFAILED;
+   }
+
+   /* TODO: Fill the required values */
+   rxDataInd->sfn = sfn;
+   rxDataInd->slot = slot;
+   rxDataInd->numPdus = 1;
+
+   pduInfo = &rxDataInd->pdus[idx];
+   pduInfo->handle = 0;
+   pduInfo->rnti = 0;
+   pduInfo->harqId = 0;
+   pduInfo->pduLength = 0;
+   pduInfo->ul_cqi = 0;
+   pduInfo->timingAdvance = 0;
+   pduInfo->rssi = 0;
+   pduInfo->pduData = NULL;
+
+   fillMsgHeader(&rxDataInd->header, FAPI_RX_DATA_INDICATION, \
+    sizeof(fapi_rx_data_indication_t));
+
+   /* Sending Rx data indication to MAC */
+   DU_LOG("\nPHY STUB: Sending Rx data Indication to MAC");
+   handlePhyMessages(rxDataInd->header.message_type_id, sizeof(fapi_rx_data_indication_t), (void *)rxDataInd);
+   MAC_FREE(rxDataInd, sizeof(fapi_rx_data_indication_t));
+#endif
+   return ROK;
+}
+
 
 /*******************************************************************
  *