JIRA ID - ODUHIGH-241 Implementation of RRC DELIVERY REPORT 04/4804/6
authorbalajihands <balaji.Shankaran@radisys.com>
Mon, 5 Oct 2020 06:08:02 +0000 (11:38 +0530)
committersphoorthi <sphoorthi.dayanand@radisys.com>
Fri, 16 Oct 2020 10:42:23 +0000 (16:12 +0530)
Change-Id: Ife6ece70cf2f2549ea650cf3f6758ae7d10c5f9f
Signed-off-by: balajihands <balaji.Shankaran@radisys.com>
Signed-off-by: sphoorthi <sphoorthi.dayanand@radisys.com>
src/5gnrrlc/rlc_msg_hdl.c
src/5gnrrlc/rlc_upr_inf_api.c
src/5gnrrlc/rlc_upr_inf_api.h
src/5gnrrlc/rlc_utils.h
src/cm/du_app_rlc_inf.c
src/cm/du_app_rlc_inf.h
src/cu_stub/cu_f1ap_msg_hdl.c
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_mgr_ex_ms.c
src/du_app/du_msg_hdl.c

index 713fc27..4c0a977 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "du_app_rlc_inf.h"
 #include "rlc_utils.h"
-
+#include "rlc_upr_inf_api.h"
 /*******************************************************************
  *
  * @brief Fills RLC UL UE Cfg Rsp from RlcCRsp 
@@ -209,8 +209,49 @@ uint8_t RlcUlProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg)
       RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCfg));
       return ret;
 }
-
 /*******************************************************************
+*
+* @brief filling the structure of rrc delivery msg info
+*
+* @details
+*
+*    Function : BuildAndSendRrcDeliveryReportToDu
+*
+*    Functionality: filling the structure of rrc delivery msg info
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo )
+{
+    Pst             pst;
+    RrcDeliveryReport *rrcDelivery;
+    
+    DU_LOG("\nRLC : Filling the RRC Delivery Report");
+    RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, rrcDelivery, sizeof(RrcDeliveryReport));
+
+    if(rrcDelivery)
+    {
+       rrcDelivery->cellId = dlRrcMsgInfo->cellId;
+       rrcDelivery->ueIdx  = dlRrcMsgInfo->ueIdx;
+       rrcDelivery->srbId  = dlRrcMsgInfo->lcId ;
+       rrcDelivery->rrcDeliveryStatus.deliveryStatus    = PDCP_SN;
+       rrcDelivery->rrcDeliveryStatus.triggeringMessage = PDCP_SN;
+
+       /* Sending UL RRC Message transfeer to DU APP */
+       memset(&pst, 0, sizeof(Pst));
+       FILL_PST_RLC_TO_DUAPP(pst, SFndProcId(), RLC_UL_INST, EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU);
+       rlcSendRrcDeliveryReportToDu(&pst, rrcDelivery);
+    }
+    else
+    {
+       DU_LOG("\nRLC : Memory allocation failed");
+    }
+
+   return ROK;
+}
+/* ****************************************************************
  *
  * @brief Process the DL RRC Message from DU APP
  *
@@ -260,6 +301,12 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
         (MsgLen *)&copyLen);
 
    RlcUiKwuDatReq(pst, datReqInfo, mBuf);
+   
+   /* RRC Delivery report is only send when RRC Delivery status report is true in DL RRC Message */
+   if(dlRrcMsgInfo->deliveryStaRpt)
+   {
+      BuildAndSendRrcDeliveryReportToDu(dlRrcMsgInfo);
+   }
 
    /* Free memory allocated by du app */
    RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo));
@@ -267,7 +314,6 @@ uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
    RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
    return ROK;
 }
-
 /**********************************************************************
          End of file
 **********************************************************************/
index 4785fb7..52dd083 100644 (file)
@@ -26,6 +26,12 @@ RlcUlRrcMsgToDuFunc rlcSendUlRrcMsgToDuOpts[] =
    packRlcUlRrcMsgToDu        /* 2 - Light weight loosely coupled */
 };
 
+RlcRrcDeliveryReportToDuFunc rlcSendRrcDeliveryReportToDuOpts[]=
+{
+   packRrcDeliveryReportToDu,          /* 0 - Loosely coupled */
+   DuProcRlcRrcDeliveryReport,    /* 1 - Tightly coupled */
+   packRrcDeliveryReportToDu           /* 2 - Light weight loosely coupled */
+};
 /*******************************************************************
  *
  * @brief Sends UL RRC Message Info to DU APP
@@ -47,6 +53,26 @@ uint8_t rlcSendUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
    return (*rlcSendUlRrcMsgToDuOpts[pst->selector])(pst, ulRrcMsgInfo);
 }
 
+/*******************************************************************
+*
+* @brief Sends RRC delivery Message Info to DU APP
+*
+* @details
+*
+*    Function : rlcSendRrcDeliveryReportToDu
+*
+*    Functionality:  Sends RRC delivery Message Info to DU APP
+*
+* @params[in] Pst structure
+*             RRC delivery Msg Info
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t rlcSendRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDelivery) 
+{
+   return (*rlcSendRrcDeliveryReportToDuOpts[pst->selector])(pst, rrcDelivery);
+}
 /**********************************************************************
          End of file
 **********************************************************************/
index dc1df1e..71bd23a 100644 (file)
@@ -17,7 +17,7 @@
 *******************************************************************************/
 
 uint8_t rlcSendUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
-
+uint8_t rlcSendRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDelivery);
 /**********************************************************************
          End of file
 **********************************************************************/
index c7126ae..4cc614f 100644 (file)
@@ -50,6 +50,7 @@
    _pst.intfVer     = 0;                                       \
 }
 
+#define PDCP_SN 1
 void reverseFixBuf(uint8_t *buf, uint16_t len);
 uint16_t getTransId();
 
index 42a51dd..85a1699 100644 (file)
@@ -327,6 +327,84 @@ uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf)
    return RFAILED;
 }
 
+/*******************************************************************
+*
+* @brief packs RRC delivery report sending from  RLC to DU APP
+*
+* @details
+*
+*    Function : packRrcDeliveryReportToDu
+*
+*    Functionality:
+*      Unpacks the DL RRC Message info received at RLC from DU APP
+*
+* @params[in] Pointer to handler function
+*             Post structure
+*             Messae buffer to be unpacked
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport)
+{
+    Buffer *mBuf = NULLP;
+
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+       {
+          DU_LOG("\nRLC : Memory allocation failed at packRrcDeliveryReportToDu");
+          return RFAILED;
+       }
+       /* pack the address of the structure */
+       CMCHKPK(oduPackPointer,(PTR)rrcDeliveryReport, mBuf);
+       return ODU_POST_TASK(pst,mBuf);
+    }
+    else
+    {
+       DU_LOG("\nRLC: Only LWLC supported for packRrcDeliveryReportToDu");
+    }
+    return RFAILED;
+ }
+
+/*******************************************************************
+*
+* @brief Unpacks RRC Delivery Report info received at DU APP from RIC
+*
+* @details
+*
+*    Function : unpackRrcDeliveryReportToDu
+*
+*    Functionality:
+*      Unpacks RRC Delivery Report info received at DU APP from RIC
+*
+* @params[in] Pointer to handler function
+*             Post structure
+*             Messae buffer to be unpacked
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func, Pst *pst, Buffer *mBuf)
+{
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       RrcDeliveryReport *rrcDeliveryReport;
+       /* unpack the address of the structure */
+       CMCHKUNPK(oduUnpackPointer, (PTR *)&rrcDeliveryReport, mBuf);
+       ODU_PUT_MSG_BUF(mBuf);
+       return (*func)(pst, rrcDeliveryReport);
+    }
+    else
+    {
+       /* Nothing to do for other selectors */
+       DU_LOG("\nRLC: Only LWLC supported for RRC delivery Message transfer ");
+       ODU_PUT_MSG_BUF(mBuf);
+    }
+
+    return RFAILED;
+}
+
 /**********************************************************************
          End of file
 ***********************************************************************/
index 5cfe45b..03e0594 100644 (file)
@@ -25,6 +25,7 @@
 #define EVENT_RLC_UL_UE_CREATE_RSP 211    /*!< Config Confirm */
 #define EVENT_UL_RRC_MSG_TRANS_TO_DU  212
 #define EVENT_DL_RRC_MSG_TRANS_TO_RLC 213
+#define EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU 214
 
 /* Macro for Ue Context */
 #define MAX_NUM_LOGICAL_CHANNELS 11
@@ -518,6 +519,21 @@ typedef struct dlRrcMsgInfo
    uint8_t    *rrcMsg;        /* RRC Message (DL-DCCH Message) */
 }RlcDlRrcMsgInfo;
 
+/* RRC delivery message from RLC to DU APP */
+typedef struct rrcDeliveryStatus
+{
+   uint16_t  deliveryStatus;
+   uint16_t  triggeringMessage;
+}RrcDeliveryStatus;
+
+typedef struct rrcDeliveryReportInfo
+{
+   uint16_t  cellId;
+   uint16_t  ueIdx;
+   uint8_t   srbId;
+   RrcDeliveryStatus  rrcDeliveryStatus;
+}RrcDeliveryReport;
+
 /* Function Pointers */
 /* UE create Request from DU APP to RLC*/
 typedef uint8_t (*DuRlcUlUeCreateReq) ARGS((
@@ -539,6 +555,11 @@ typedef uint8_t (*DuDlRrcMsgToRlcFunc) ARGS((
    Pst           *pst,
    RlcDlRrcMsgInfo *dlRrcMsgInfo));
 
+/* RRC delivery message from RLC to DU APP */
+typedef uint8_t (*RlcRrcDeliveryReportToDuFunc) ARGS((
+   Pst           *pst,
+   RrcDeliveryReport *rrcDeliveryReport));
+
 /* Pack/Unpack function declarations */
 uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
 uint8_t unpackRlcUlUeCreateReq(DuRlcUlUeCreateReq func, Pst *pst, Buffer *mBuf);
@@ -548,13 +569,15 @@ uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf);
 uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
 uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf);
+uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
+uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func,Pst *pst, Buffer *mBuf);
 
 /* Event Handler function declarations */
 uint8_t RlcUlProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
 uint8_t DuProcRlcUlUeCreateRsp(Pst *pst, RlcUeCfgRsp *cfgRsp);
 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
-
+uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
 #endif /* RLC_INF_H */
 
 /**********************************************************************
index 33c6081..fb6220e 100644 (file)
@@ -2803,6 +2803,13 @@ void F1APMsgHdlr(Buffer *mBuf)
            {
               DU_LOG("\nF1AP : Received ULRRCMessageTransfer");
               procUlRrcMsg(f1apMsg);
+              break;
+           }
+           
+           case InitiatingMessage__value_PR_RRCDeliveryReport:
+           {
+              DU_LOG("\nF1AP : Received RRC delivery report");
+               break;
            }
             default:
             {
index 1ebe773..cf4be45 100644 (file)
@@ -2559,7 +2559,7 @@ uint8_t BuildRlcBearerToAddModList(struct CellGroupConfigRrc__rlc_BearerToAddMod
    controlRSet = controlRSetList->list.array[idx];
 
    controlRSet->controlResourceSetId = PDCCH_CTRL_RSRC_SET_ONE_ID;
+
    /* size 6 bytes
     * 3 LSBs unsued
     * Bit string stored ff0000000000
@@ -5428,12 +5428,12 @@ void FreeF1ResetReq(F1AP_PDU_t *f1apMsg)
 {
    uint8_t idx =0 ;
    Reset_t *f1ResetMsg;
-   
+
    if(f1apMsg)
    {
       if(f1apMsg->choice.initiatingMessage)
       {
-         f1ResetMsg = &f1apMsg->choice.initiatingMessage->value.choice.Reset;
+        f1ResetMsg = &f1apMsg->choice.initiatingMessage->value.choice.Reset;
 
         if(f1ResetMsg->protocolIEs.list.array)
         {
@@ -5729,53 +5729,53 @@ uint8_t BuildAndSendF1ResetAck()
 }
 
 /*******************************************************************
-*
-* @brief Processes GNB DU config update ack
-*
-* @details
-*
-*    Function : procGNBDUCfgUpdAck
-*
-*    Functionality: Processes GNB DU config update ack
-*
-* @params[in] F1AP_PDU_t ASN decoded F1AP message
-* @return ROK     - success
-*         RFAILED - failure
-*
-* ****************************************************************/
+ *
+ * @brief Processes GNB DU config update ack
+ *
+ * @details
+ *
+ *    Function : procGNBDUCfgUpdAck
+ *
+ *    Functionality: Processes GNB DU config update ack
+ *
+ * @params[in] F1AP_PDU_t ASN decoded F1AP message
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
 uint8_t procGNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg)
 {
-    DU_LOG("\nF1AP : GNB-DU config update acknowledgment received");
+   DU_LOG("\nF1AP : GNB-DU config update acknowledgment received");
 #if 0
-    if(BuildAndSendF1ResetReq() != ROK)
-    {
-       return RFAILED;
-    }
+   if(BuildAndSendF1ResetReq() != ROK)
+   {
+      return RFAILED;
+   }
 #endif
-    /* TODO :Check the deallocation */
+   /* TODO :Check the deallocation */
 
 #if 0
-    DU_FREE(gNBDuCfgAck->protocolIEs.list.array,(Size)elementCnt * sizeof(GNBDUConfigurationUpdateAcknowledgeIEs_t));
-    DU_FREE(f1apMsg->choice.successfulOutcome,(Size)sizeof(SuccessfulOutcome_t));
-    DU_FREE(f1apMsg,(Size)sizeof(F1AP_PDU_t));
+   DU_FREE(gNBDuCfgAck->protocolIEs.list.array,(Size)elementCnt * sizeof(GNBDUConfigurationUpdateAcknowledgeIEs_t));
+   DU_FREE(f1apMsg->choice.successfulOutcome,(Size)sizeof(SuccessfulOutcome_t));
+   DU_FREE(f1apMsg,(Size)sizeof(F1AP_PDU_t));
 #endif
-    return ROK;
+   return ROK;
 }
 /******************************************************************
-*
-* @brief Processes DL RRC Message Transfer  sent by CU
-*
-* @details
-*
-*    Function : procDlRrcMsgTrans
-*
-*    Functionality: Processes DL RRC Message Transfer sent by CU
-*
-* @params[in] F1AP_PDU_t ASN decoded F1AP message
-* @return ROK     - success
-*         RFAILED - failure
-*
-* ****************************************************************/
+ *
+ * @brief Processes DL RRC Message Transfer  sent by CU
+ *
+ * @details
+ *
+ *    Function : procDlRrcMsgTrans
+ *
+ *    Functionality: Processes DL RRC Message Transfer sent by CU
+ *
+ * @params[in] F1AP_PDU_t ASN decoded F1AP message
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
 uint8_t procF1ResetReq(F1AP_PDU_t *f1apMsg)
 {
    /* we are currently not supporting Ue release. right now we are supporting only init case of fireset */
@@ -5790,27 +5790,213 @@ uint8_t procF1ResetReq(F1AP_PDU_t *f1apMsg)
    {
       switch(f1ResetMsg->protocolIEs.list.array[idx]->id)
       {
-         case ProtocolIE_ID_id_TransactionID:
-           break;
+        case ProtocolIE_ID_id_TransactionID:
+           break;
 
-         case ProtocolIE_ID_id_Cause:
-           break;
+        case ProtocolIE_ID_id_Cause:
+           break;
 
-       case ProtocolIE_ID_id_ResetType:
-       {
-          DU_LOG("\nReceived F1 Reset request");
-          break;
-        }
+        case ProtocolIE_ID_id_ResetType:
+           {
+              DU_LOG("\nReceived F1 Reset request");
+              break;
+           }
 
-       default:
-          break;
+        default:
+           break;
       }
    }
    ret = BuildAndSendF1ResetAck();
    DU_LOG("\nUE release is not supported for now");
    return ret;
 }
+
+/*******************************************************************
+ *
+ * @brief free the RRC delivery report
+ *
+ * @details
+ *
+ *    Function : freeRrcDeliveryReport
+ *
+ *    Functionality: free the RRC delivery report
+ *
+ * @params[in]
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+void freeRrcDeliveryReport(F1AP_PDU_t  *f1apMsg )
+{
+   uint8_t idx=0;
+   RRCDeliveryReport_t *rrcDeliveryReport= NULLP;
+
+   if(f1apMsg)
+   {
+      if(f1apMsg->choice.initiatingMessage)
+      {
+        rrcDeliveryReport = &f1apMsg->choice.initiatingMessage->value.choice.RRCDeliveryReport;
+        if(rrcDeliveryReport->protocolIEs.list.array)
+        {
+           for(idx =0 ;idx <rrcDeliveryReport->protocolIEs.list.count ;
+                 idx++)
+           {
+              if(rrcDeliveryReport->protocolIEs.list.array[idx])
+              {
+                 DU_FREE(rrcDeliveryReport->protocolIEs.list.array[idx],
+                       sizeof(RRCDeliveryReportIEs_t));
+              }   
+           }
+           DU_FREE(rrcDeliveryReport->protocolIEs.list.array,
+                 rrcDeliveryReport->protocolIEs.list.size);
+        }
+        DU_FREE(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+      }
+      DU_FREE(f1apMsg,
+           sizeof(F1AP_PDU_t));
+   }
+}
+
 /*******************************************************************
+*
+* @brief Builds and sends the RRC delivery report
+*
+* @details
+*
+*    Function : BuildAndSendRrcDeliveryReport
+*
+*    Functionality: Builds and sends the RRC delivery report
+*
+* @params[in]
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildAndSendRrcDeliveryReport(uint32_t gnbCuUeF1apId, uint32_t gnbDuUeF1apId, RrcDeliveryReport
+*rrcDelivery)
+{
+   uint8_t             ret = RFAILED;
+   uint8_t             idx    = 0;
+   uint8_t             idx1   = 0;
+   uint8_t             elementCnt = 0;
+   F1AP_PDU_t          *f1apMsg = NULLP;
+   asn_enc_rval_t      encRetVal;  
+   RRCDeliveryReport_t *rrcDeliveryReport= NULLP;
+
+   do{
+
+      DU_LOG("\nF1AP : Building RRC delivery Message Transfer Message\n");
+      DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
+      if(f1apMsg == NULLP)
+      {
+        DU_LOG(" F1AP : Memory allocation for F1AP-PDU failed");
+        break;
+      }
+      f1apMsg->present = F1AP_PDU_PR_initiatingMessage;
+      DU_ALLOC(f1apMsg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+      if(f1apMsg->choice.initiatingMessage == NULLP)
+      {
+        DU_LOG(" F1AP : Memory allocation for  F1AP-PDU  failed");
+        break;
+      }
+      f1apMsg->choice.initiatingMessage->procedureCode = ProcedureCode_id_RRCDeliveryReport;
+      f1apMsg->choice.initiatingMessage->criticality   = Criticality_ignore;
+      f1apMsg->choice.initiatingMessage->value.present = InitiatingMessage__value_PR_RRCDeliveryReport;
+
+      rrcDeliveryReport = &f1apMsg->choice.initiatingMessage->value.choice.RRCDeliveryReport;
+      elementCnt = 4;
+      rrcDeliveryReport->protocolIEs.list.count = elementCnt;
+      rrcDeliveryReport->protocolIEs.list.size = elementCnt * sizeof(RRCDeliveryReportIEs_t *);
+
+      /* Initialize the F1Setup members */
+      DU_ALLOC(rrcDeliveryReport->protocolIEs.list.array, rrcDeliveryReport->protocolIEs.list.size);
+      if(rrcDeliveryReport->protocolIEs.list.array == NULLP)
+      {
+        DU_LOG(" F1AP : Memory allocation for RRC Delivery  failed");
+        break;
+      }
+      for(idx =0 ;idx <elementCnt; idx++)
+      {
+        DU_ALLOC(rrcDeliveryReport->protocolIEs.list.array[idx], sizeof(RRCDeliveryReportIEs_t));
+        if(rrcDeliveryReport->protocolIEs.list.array[idx] == NULLP)
+        {
+           break;
+        }
+      }
+
+      idx1 = 0;
+
+      /*GNB CU UE F1AP ID*/
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_GNB_CU_UE_F1AP_ID;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.GNB_CU_UE_F1AP_ID = gnbCuUeF1apId;
+
+      /*GNB DU UE F1AP ID*/
+      idx1++;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_reject;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_GNB_DU_UE_F1AP_ID;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.GNB_DU_UE_F1AP_ID = gnbDuUeF1apId;
+
+      /*RRC delivery status*/
+      idx1++;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_RRCDeliveryStatus;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_ignore;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_RRCDeliveryStatus;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.RRCDeliveryStatus.delivery_status =
+      rrcDelivery->rrcDeliveryStatus.deliveryStatus;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.RRCDeliveryStatus.triggering_message =
+      rrcDelivery->rrcDeliveryStatus.triggeringMessage;
+
+      /* SRB ID */ 
+      idx1++;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->id = ProtocolIE_ID_id_SRBID;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->criticality = Criticality_ignore;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->value.present = RRCDeliveryReportIEs__value_PR_SRBID;
+      rrcDeliveryReport->protocolIEs.list.array[idx1]->value.choice.SRBID =  rrcDelivery->srbId;
+
+      xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
+
+      /* Encode the RRC DELIVERY REPORT type as APER */
+      memset((uint8_t *)encBuf, 0, ENC_BUF_MAX_LEN);
+      encBufSize = 0;
+      encRetVal = aper_encode(&asn_DEF_F1AP_PDU, 0, f1apMsg, PrepFinalEncBuf,\
+           encBuf);
+
+      /* Encode results */
+      if(encRetVal.encoded == ENCODE_FAIL)
+      {
+        DU_LOG("\nF1AP : Could not encode RRC Delivery Msg structure (at %s)\n",\
+              encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+        break;
+      }
+      else
+      {
+        DU_LOG("\nF1AP : Created APER encoded buffer for RRC Delivery Msg \n");
+        for(idx=0; idx< encBufSize; idx++)
+        {
+           printf("%x",encBuf[idx]);
+        }
+      }
+
+      /* Sending msg */
+      if(SendF1APMsg(DU_APP_MEM_REGION, DU_POOL) != ROK)
+      {
+        DU_LOG("\nF1AP : Sending RRC delivery  msg request failed");
+        break;
+      }
+      ret = ROK;
+      break;
+
+   }while(true);
+
+   freeRrcDeliveryReport(f1apMsg);
+   return ret;
+}
+                                                                               
+/*****************************************************************i
  *
  * @brief Handles received F1AP message and sends back response  
  *
@@ -5883,8 +6069,8 @@ void F1APMsgHdlr(Buffer *mBuf)
            switch(f1apMsg->choice.successfulOutcome->value.present)
            {
               case SuccessfulOutcome__value_PR_ResetAcknowledge:
-                 {
-                      DU_LOG("\nF1AP : F1ResetAcknowledge is received successfully ");
+                 {
+                    DU_LOG("\nF1AP : F1ResetAcknowledge is received successfully ");
                     break;
                  }
               case SuccessfulOutcome__value_PR_F1SetupResponse:
@@ -5914,11 +6100,11 @@ void F1APMsgHdlr(Buffer *mBuf)
            switch(f1apMsg->choice.initiatingMessage->value.present)
            {
               case InitiatingMessage__value_PR_Reset:
-              {
-                  DU_LOG("\nF1AP : F1 reset request received");
-                  procF1ResetReq(f1apMsg);
-                  break;
-              }
+                 {
+                    DU_LOG("\nF1AP : F1 reset request received");
+                    procF1ResetReq(f1apMsg);
+                    break;
+                 }
               case InitiatingMessage__value_PR_DLRRCMessageTransfer:
                  {
                     procDlRrcMsgTrans(f1apMsg);
index f2a7fd3..fce7500 100644 (file)
@@ -183,6 +183,11 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf)
                     ret = unpackRlcUlRrcMsgToDu(DuProcRlcUlRrcMsgTrans, pst, mBuf);
                     break;
                   }
+              case EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU:
+                 {
+                    ret = unpackRrcDeliveryReportToDu(DuProcRlcRrcDeliveryReport, pst, mBuf);
+                    break;
+                 }
               default:
                  {
                     DU_LOG("\nDU_APP : Invalid event %d received at duActvTsk from ENTRLC", \
index 4dd8cfc..6483dca 100644 (file)
@@ -1852,6 +1852,35 @@ uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
    return ROK;
 }
 
+/*******************************************************************
+*
+* @brief Process RRC delivery report from RLC
+*
+* @details
+*
+*    Function : DuProcRlcRrcDeliveryReport
+*
+*    Functionality: Process RRC delivery Message from RLC
+*
+* @params[in] Post structure
+*             UL RRC Message Info
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport)
+{
+       DuUeCb   ueCb;
+       uint8_t  ret = RFAILED;
+
+       ueCb = duCb.actvCellLst[rrcDeliveryReport->cellId -1]->ueCb[rrcDeliveryReport->ueIdx -1];
+       ret = BuildAndSendRrcDeliveryReport(ueCb.gnbCuUeF1apId, ueCb.gnbDuUeF1apId,rrcDeliveryReport);
+
+       DU_FREE_SHRABL_BUF(pst->region, pst->pool, rrcDeliveryReport, sizeof(RrcDeliveryReport));
+       return ret;
+}
+
+
 /**********************************************************************
   End of file
  **********************************************************************/