[EPIC-ID: ODUHIGH-488][TASK-ID: ODUHIGH-494] Rebasing to master branch change Id... 42/10742/1
authorlal.harshita <Harshita.Lal@radisys.com>
Fri, 17 Mar 2023 05:40:02 +0000 (11:10 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Fri, 17 Mar 2023 05:40:40 +0000 (11:10 +0530)
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Change-Id: I35159b19207a750c50657d095ad9c1899ed6964e

23 files changed:
src/5gnrmac/mac_cfg_hdl.c
src/5gnrmac/mac_msg_hdl.c
src/5gnrmac/mac_msg_router.c
src/5gnrmac/mac_ue_mgr.c
src/5gnrrlc/rlc_mgr.h
src/5gnrrlc/rlc_msg_hdl.c
src/5gnrrlc/rlc_tmr.c
src/5gnrsch/sch.c
src/5gnrsch/sch.h
src/5gnrsch/sch_common.c
src/5gnrsch/sch_msg_router.c
src/5gnrsch/sch_slot_ind.c
src/5gnrsch/sch_ue_mgr.c
src/cm/common_def.h
src/cm/du_app_mac_inf.c
src/cm/du_app_mac_inf.h
src/cm/du_app_rlc_inf.h
src/cm/mac_sch_interface.h
src/du_app/du_cell_mgr.c
src/du_app/du_mgr.h
src/du_app/du_mgr_msg_router.c
src/du_app/du_msg_hdl.c
src/du_app/du_ue_mgr.c

index cd3b9a5..1af9b0b 100644 (file)
@@ -500,7 +500,7 @@ void fapiMacConfigRsp(uint16_t cellId)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t MacSendCellDeleteRsp(CellDeleteStatus result, uint8_t cellId)
+uint8_t MacSendCellDeleteRsp(CauseOfResult  status, uint8_t cellId)
 {
    MacCellDeleteRsp *deleteRsp=NULLP;
    Pst            rspPst;
@@ -516,7 +516,7 @@ uint8_t MacSendCellDeleteRsp(CellDeleteStatus result, uint8_t cellId)
    
    memset(deleteRsp, 0, sizeof(MacCellDeleteRsp));
    deleteRsp->cellId = cellId;
-   deleteRsp->result = result;
+   deleteRsp->status = status;
 
    /* Fill Post structure and send CELL delete response*/
    memset(&rspPst, 0, sizeof(Pst));
@@ -545,7 +545,7 @@ uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDelRsp)
 {
    uint8_t  ret = ROK, sliceIdx = 0, plmnIdx = 0;
    uint16_t cellIdx=0;
-   CellDeleteStatus status;
+   CauseOfResult  cause;
 
 #ifdef CALL_FLOW_DEBUG_LOG
    DU_LOG("\nCall Flow: ENTSCH -> ENTMAC : EVENT_CELL_DELETE_RSP_TO_MAC\n");
@@ -562,7 +562,7 @@ uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDelRsp)
          {
             if(macCb.macCell[cellIdx]->cellId == schCellDelRsp->cellId)
             {
-               status  = SUCCESSFUL_RSP;
+               cause = SUCCESSFUL;
                for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++)
                {
                   if(macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].snssai)
@@ -582,24 +582,24 @@ uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDelRsp)
             else
             {
                DU_LOG("ERROR  -->  MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
-               status = CELL_ID_INVALID;
+               cause = CELLID_INVALID;
                ret = RFAILED;
             }
          }
          else
          {
             DU_LOG("ERROR  -->  MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
-            status = CELL_ID_INVALID;
+            cause = CELLID_INVALID;
             ret = RFAILED;
          }
       }
       else
       {
          DU_LOG("ERROR  -->  MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
-         status = CELL_ID_INVALID;
+         cause = CELLID_INVALID;
          ret = RFAILED;
       }
-      if(MacSendCellDeleteRsp(status, schCellDelRsp->cellId) != ROK)
+      if(MacSendCellDeleteRsp(cause, schCellDelRsp->cellId) != ROK)
       {
          DU_LOG("\nERROR  -->  MAC: MacProcSchCellDeleteRsp(): Failed to send CELL delete response");
          ret = RFAILED;
@@ -693,7 +693,7 @@ uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete)
       if(ret == RFAILED)
       {
           DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Sending failure response to DU");
-          if(MacSendCellDeleteRsp(CELL_ID_INVALID, cellDelete->cellId) != ROK)
+          if(MacSendCellDeleteRsp(CELLID_INVALID, cellDelete->cellId) != ROK)
           {
              DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): failed to send cell delete rsp for cellID[%d]",\
              cellDelete->cellId);
@@ -755,60 +755,6 @@ void freeMacSliceCfgReq(MacSliceCfgReq *cfgReq,Pst *pst)
     }
 
 }
-/**
- * @brief fill Mac Slice Config Rsp
- *
- * @details
- *
- *     Function : fillMacSliceCfgRsp 
- *
- *     This function   fill Mac Slice Config Rsp
- *
- *  @param[in]  SchSliceCfgRsp *sliceCfgRsp, MacSliceCfgRsp *macSliceCfgRsp,
- *  uint8_t *count
- *  @return  int
- *      -# ROK
- **/
-uint8_t fillMacSliceCfgRsp(SchSliceCfgRsp *schSliceCfgRsp, MacSliceCfgRsp *macSliceCfgRsp)
-{
-   
-    bool sliceFound = false;
-    uint8_t cfgIdx = 0;
-
-    macSliceCfgRsp->numSliceCfgRsp  = schSliceCfgRsp->numSliceCfgRsp;
-    MAC_ALLOC_SHRABL_BUF(macSliceCfgRsp->listOfSliceCfgRsp,  macSliceCfgRsp->numSliceCfgRsp* sizeof(MacSliceRsp*));
-    if(macSliceCfgRsp->listOfSliceCfgRsp == NULLP)
-    {
-       DU_LOG("\nERROR  -->  MAC : Memory allocation failedi in fillMacSliceCfgRsp");
-       return RFAILED;
-    }
-
-    for(cfgIdx = 0; cfgIdx<schSliceCfgRsp->numSliceCfgRsp; cfgIdx++)
-    {
-       sliceFound = false;
-       if(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp == RSP_OK)
-       {
-          sliceFound = true;
-       }
-
-       MAC_ALLOC_SHRABL_BUF(macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(SliceRsp));
-       if(macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx] == NULLP)
-       {
-          DU_LOG("\nERROR  -->  MAC : Memory allocation failedi in fillMacSliceCfgRsp");
-          return RFAILED;
-       }
-
-       macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->snssai = schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->snssai;
-       if(sliceFound == true)
-          macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp    = MAC_DU_APP_RSP_OK;
-       else
-       {
-          macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp    = MAC_DU_APP_RSP_NOK;
-          macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->cause  = SLICE_NOT_PRESENT;
-       }
-    }
-    return ROK;
-}
 
 /**
  * @brief send slice cfg response to duapp.
@@ -832,35 +778,6 @@ uint8_t MacSendSliceConfigRsp(MacSliceCfgRsp *macSliceCfgRsp)
     return (*macDuSliceCfgRspOpts[rspPst.selector])(&rspPst, macSliceCfgRsp);
 
 }
-/**
- * @brief free the slice cfg rsp received from sch.
- *
- * @details
- *
- *     Function : freeSchSliceCfgRsp 
- *
- *     This free the slice cfg rsp received from sch
- *
- *  @param[in]  SchSliceCfgRsp *sliceCfgrsp
- *  @return  int
- *      -# ROK
- **/
-void freeSchSliceCfgRsp(SchSliceCfgRsp *schSliceCfgRsp)
-{
-   uint8_t cfgIdx = 0;
-
-   if(schSliceCfgRsp)
-   {
-      if(schSliceCfgRsp->numSliceCfgRsp)
-      {
-         for(cfgIdx = 0; cfgIdx< schSliceCfgRsp->numSliceCfgRsp; cfgIdx++)
-         {
-            MAC_FREE(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(SliceRsp));
-         }
-         MAC_FREE(schSliceCfgRsp->listOfSliceCfgRsp, schSliceCfgRsp->numSliceCfgRsp * sizeof(SliceRsp*));
-      }
-   }
-}
 
 /**
  * @brief Mac process the slice cfg rsp received from sch.
@@ -876,6 +793,7 @@ void freeSchSliceCfgRsp(SchSliceCfgRsp *schSliceCfgRsp)
  *  @return  int
  *      -# ROK
  **/
+
 uint8_t MacProcSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *schSliceCfgRsp)
 {
    MacSliceCfgRsp *macSliceCfgRsp = NULLP;
@@ -888,33 +806,32 @@ uint8_t MacProcSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *schSliceCfgRsp)
           DU_LOG("\nERROR  -->  MAC : Failed to allocate memory in MacProcSchSliceCfgRsp");
           return RFAILED;
       }
-      if(schSliceCfgRsp->listOfSliceCfgRsp)
+      macSliceCfgRsp->snssai = schSliceCfgRsp->snssai;
+      if(schSliceCfgRsp->rsp == RSP_OK)
+         macSliceCfgRsp->rsp    = MAC_DU_APP_RSP_OK;
+      else
       {
-         if(fillMacSliceCfgRsp(schSliceCfgRsp, macSliceCfgRsp) != ROK)
-         {
-            DU_LOG("\nERROR  -->  MAC : Failed to fill the slice cfg response");
-            return RFAILED;
-         }
-         MacSendSliceConfigRsp(macSliceCfgRsp);
+         macSliceCfgRsp->rsp    = MAC_DU_APP_RSP_NOK;
       }
-      freeSchSliceCfgRsp(schSliceCfgRsp);
+      macSliceCfgRsp->cause  = schSliceCfgRsp->cause;
+      MacSendSliceConfigRsp(macSliceCfgRsp);
    }
    return ROK;
 }
 
 /**
-* @brief send slice cfg response to duapp.
-*
-* @details
-*
-*     Function : MacSendSliceReconfigRsp 
-*
-*   sends  slice cfg response to duapp
-*
-*  @param[in] MacSliceRecfgRsp macSliceRecfgRsp
-*  @return  int
-*      -# ROK
-**/
+ * @brief send slice cfg response to duapp.
+ *
+ * @details
+ *
+ *     Function : MacSendSliceReconfigRsp 
+ *
+ *   sends  slice cfg response to duapp
+ *
+ *  @param[in] MacSliceRecfgRsp macSliceRecfgRsp
+ *  @return  int
+ *      -# ROK
+ **/
 uint8_t MacSendSliceReconfigRsp(MacSliceRecfgRsp *macSliceRecfgRsp)
 {
    Pst  rspPst;
@@ -952,16 +869,15 @@ uint8_t MacProcSchSliceRecfgRsp(Pst *pst, SchSliceRecfgRsp *schSliceRecfgRsp)
           return RFAILED;
       }
 
-      if(schSliceRecfgRsp->listOfSliceCfgRsp)
+      macSliceRecfgRsp->snssai = schSliceRecfgRsp->snssai;
+      if(schSliceRecfgRsp->rsp == RSP_OK)
+         macSliceRecfgRsp->rsp    = MAC_DU_APP_RSP_OK;
+      else
       {
-         if(fillMacSliceCfgRsp(schSliceRecfgRsp, macSliceRecfgRsp) != ROK)
-         {
-            DU_LOG("\nERROR  -->  MAC : Failed to fill the slice Recfg response");
-            return RFAILED;
-         }
-         MacSendSliceReconfigRsp(macSliceRecfgRsp);
+         macSliceRecfgRsp->rsp    = MAC_DU_APP_RSP_NOK;
       }
-      freeSchSliceCfgRsp(schSliceRecfgRsp);
+      macSliceRecfgRsp->cause  = schSliceRecfgRsp->cause;
+      MacSendSliceReconfigRsp(macSliceRecfgRsp);
    }
    return ROK;
 }
index 0369b2c..d36792a 100644 (file)
@@ -86,6 +86,78 @@ uint8_t sendCrcIndMacToSch(CrcIndInfo *crcInd)
    return(SchMessageRouter(&pst, (void *)crcInd));
 }
 
+/*******************************************************************
+ *
+ * @brief Sends UL CQI Indication to SCH
+ *
+ * @details
+ *
+ *    Function : sendUlCqiIndMacToSch 
+ *
+ *    Functionality:
+ *       Sends Ul Cqi Indication to SCH
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ****************************************************************/
+uint8_t sendUlCqiIndMacToSch(SchUlCqiInd *ulCqiInd)
+{
+   Pst pst;
+
+   FILL_PST_MAC_TO_SCH(pst, EVENT_UL_CQI_TO_SCH);
+   return(SchMessageRouter(&pst, (void *)ulCqiInd));
+}
+
+/*******************************************************************
+ *
+ * @brief Sends DL CQI Indication to SCH
+ *
+ * @details
+ *
+ *    Function : sendDlCqiIndMacToSch 
+ *
+ *    Functionality:
+ *       Sends Dl Cqi Indication to SCH
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ****************************************************************/
+uint8_t sendDlCqiIndMacToSch(SchDlCqiInd *dlCqiInd)
+{
+   Pst pst;
+
+   FILL_PST_MAC_TO_SCH(pst, EVENT_DL_CQI_TO_SCH);
+   return(SchMessageRouter(&pst, (void *)dlCqiInd));
+}
+
+/*******************************************************************
+ *
+ * @brief Sends Power Headroom Indication to SCH
+ *
+ * @details
+ *
+ *    Function : sendPhrIndToSch 
+ *
+ *    Functionality:
+ *       Sends Phr Indication to SCH
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ ****************************************************************/
+uint8_t sendPhrIndToSch(SchPwrHeadroomInd *macPhrInd)
+{
+   Pst pst;
+
+   FILL_PST_MAC_TO_SCH(pst, EVENT_PHR_IND_TO_SCH);
+   return(SchMessageRouter(&pst, (void *)macPhrInd));
+}
+
 /*******************************************************************
  *
  * @brief Processes CRC Indication from PHY
@@ -842,8 +914,8 @@ uint8_t FapiMacUciInd(Pst *pst, UciInd *macUciInd)
  **********************************************************************/
 uint8_t fillSliceCfgInfo(SchSliceCfgReq *schSliceCfgReq, MacSliceCfgReq *macSliceCfgReq)
 {
-   uint8_t cfgIdx = 0, memberListIdx = 0, totalSliceCfgRecvd = 0;
-
+   uint8_t rrmPolicyIdx= 0,cfgIdx = 0, memberListIdx = 0, totalSliceCfgRecvd = 0;
    if(macSliceCfgReq->listOfRrmPolicy)
    {
       for(cfgIdx = 0; cfgIdx<macSliceCfgReq->numOfRrmPolicy; cfgIdx++)
@@ -858,11 +930,13 @@ uint8_t fillSliceCfgInfo(SchSliceCfgReq *schSliceCfgReq, MacSliceCfgReq *macSlic
          DU_LOG("\nERROR  -->  MAC : Memory allocation failed in fillSliceCfgInfo");
          return RFAILED;
       }
-      for(cfgIdx = 0; cfgIdx<schSliceCfgReq->numOfConfiguredSlice; cfgIdx++)
+      cfgIdx = 0; 
+
+      for(rrmPolicyIdx = 0; rrmPolicyIdx<macSliceCfgReq->numOfRrmPolicy; rrmPolicyIdx++)
       {
-         for(memberListIdx = 0; memberListIdx<macSliceCfgReq->listOfRrmPolicy[cfgIdx]->numOfRrmPolicyMem; memberListIdx++)
+         for(memberListIdx = 0; memberListIdx<macSliceCfgReq->listOfRrmPolicy[rrmPolicyIdx]->numOfRrmPolicyMem; memberListIdx++)
          {
-            if(macSliceCfgReq->listOfRrmPolicy[cfgIdx]->rRMPolicyMemberList[memberListIdx])
+            if(macSliceCfgReq->listOfRrmPolicy[rrmPolicyIdx]->rRMPolicyMemberList[memberListIdx])
             {
 
                MAC_ALLOC(schSliceCfgReq->listOfSlices[cfgIdx], sizeof(SchRrmPolicyOfSlice));
@@ -872,11 +946,12 @@ uint8_t fillSliceCfgInfo(SchSliceCfgReq *schSliceCfgReq, MacSliceCfgReq *macSlic
                   return RFAILED;
                }
 
-               memcpy(&schSliceCfgReq->listOfSlices[cfgIdx]->snssai, &macSliceCfgReq->listOfRrmPolicy[cfgIdx]->rRMPolicyMemberList[memberListIdx]->snssai, sizeof(Snssai));
+               memcpy(&schSliceCfgReq->listOfSlices[cfgIdx]->snssai, &macSliceCfgReq->listOfRrmPolicy[rrmPolicyIdx]->rRMPolicyMemberList[memberListIdx]->snssai, sizeof(Snssai));
 
-               schSliceCfgReq->listOfSlices[cfgIdx]->rrmPolicyRatioInfo.maxRatio = macSliceCfgReq->listOfRrmPolicy[cfgIdx]->policyRatio.maxRatio;
-               schSliceCfgReq->listOfSlices[cfgIdx]->rrmPolicyRatioInfo.minRatio = macSliceCfgReq->listOfRrmPolicy[cfgIdx]->policyRatio.minRatio;
-               schSliceCfgReq->listOfSlices[cfgIdx]->rrmPolicyRatioInfo.dedicatedRatio = macSliceCfgReq->listOfRrmPolicy[cfgIdx]->policyRatio.dedicatedRatio;
+               schSliceCfgReq->listOfSlices[cfgIdx]->rrmPolicyRatioInfo.maxRatio = macSliceCfgReq->listOfRrmPolicy[rrmPolicyIdx]->policyRatio.maxRatio;
+               schSliceCfgReq->listOfSlices[cfgIdx]->rrmPolicyRatioInfo.minRatio = macSliceCfgReq->listOfRrmPolicy[rrmPolicyIdx]->policyRatio.minRatio;
+               schSliceCfgReq->listOfSlices[cfgIdx]->rrmPolicyRatioInfo.dedicatedRatio = macSliceCfgReq->listOfRrmPolicy[rrmPolicyIdx]->policyRatio.dedicatedRatio;
+               cfgIdx++;
             }
          }
       }
index 88fea7b..114e1d8 100755 (executable)
@@ -173,6 +173,12 @@ void MacHdlDuappEvents(Pst *pst, Buffer *mBuf)
             unpackMacDlPcchInd(MacProcDlPcchInd, pst, mBuf);
             break;
          }
+      case EVENT_MAC_UE_RESET_REQ:
+         {
+            /* Process UE Reset Request */  
+            unpackMacUeResetReq(MacProcUeResetReq, pst, mBuf);
+            break;
+         }
 
       default:
          RG_FREE_MSG(mBuf);
index aaa95de..99c4e8d 100644 (file)
@@ -49,6 +49,59 @@ MacDuUeDeleteRspFunc macDuUeDeleteRspOpts[] =
    packDuMacUeDeleteRsp   /* packing for light weight loosly coupled */
 };
 
+MacDuUeResetRspFunc macDuUeResetRspOpts[] =
+{
+   packDuMacUeResetRsp,   /* packing for loosely coupled */
+   DuProcMacUeResetRsp,   /* packing for tightly coupled */
+   packDuMacUeResetRsp   /* packing for light weight loosly coupled */
+};
+
+MacDuUeSyncStatusIndFunc macDuUeSyncStatusIndOpts[] =
+{
+   packDuMacUeSyncStatusInd,   /* packing for loosely coupled */
+   DuProcMacUeSyncStatusInd,   /* packing for tightly coupled */
+   packDuMacUeSyncStatusInd    /* packing for light weight loosly coupled */
+};
+
+/*******************************************************************
+*
+* @brief Fill and Send UE Sync Status Indication from MAC to DU APP
+*
+* @details
+*
+*    Function : MacSendUeSyncStatusInd 
+*
+*    Functionality: Fill and Send UE Sync Status Indication from MAC to DUAPP
+*
+* @params[in] uint16_t cellId, uint16_t ueId, SyncStatus status 
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t MacSendUeSyncStatusInd(uint16_t cellId, uint16_t ueId, SyncStatus  status)
+{
+   MacUeSyncStatusInd *ueSyncStatusInd;
+   Pst            rspPst;
+
+   MAC_ALLOC_SHRABL_BUF(ueSyncStatusInd, sizeof(MacUeSyncStatusInd));
+   if(!ueSyncStatusInd)
+   {
+      DU_LOG("\nERROR  -->  MAC : Memory allocation for UE Sync Status Indication failed");
+      return RFAILED;
+   }
+
+   /* Filling UE Sync Status Indication */
+   ueSyncStatusInd->cellId = cellId;
+   ueSyncStatusInd->ueId   = ueId;
+   ueSyncStatusInd->status = status;
+
+   /* Fill Post structure and send UE Sync Status Indication */
+   memset(&rspPst, 0, sizeof(Pst));
+   FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_SYNC_STATUS_IND);
+   return (*macDuUeSyncStatusIndOpts[rspPst.selector])(&rspPst, ueSyncStatusInd);
+}
+
 /*******************************************************************
  *
  * @brief Fills mac cell group config to be sent to scheduler
@@ -2992,7 +3045,7 @@ uint8_t MacProcSchUeRecfgRsp(Pst *pst, SchUeRecfgRsp *schRecfgRsp)
    uint8_t ret = ROK;
    uint16_t cellIdx;
    MacUeRecfg *ueRecfg = NULLP;
-
+   
 #ifdef CALL_FLOW_DEBUG_LOG
    switch(pst->event)
    {
@@ -3111,7 +3164,7 @@ uint8_t MacProcUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg)
 *
 * ****************************************************************/
 
-uint8_t MacSendUeDeleteRsp(uint16_t cellId, uint16_t crnti, UeDeleteStatus result)
+uint8_t MacSendUeDeleteRsp(uint16_t cellId, uint16_t crnti, CauseOfResult  status)
 {
    MacUeDeleteRsp *deleteRsp;
    Pst            rspPst;
@@ -3126,7 +3179,7 @@ uint8_t MacSendUeDeleteRsp(uint16_t cellId, uint16_t crnti, UeDeleteStatus resul
    /* Filling UE delete response */
    deleteRsp->cellId = cellId;
    GET_UE_ID(crnti, deleteRsp->ueId);
-   deleteRsp->result = result;
+   deleteRsp->status = status;
 
    /* Fill Post structure and send UE delete response*/
    memset(&rspPst, 0, sizeof(Pst));
@@ -3210,7 +3263,7 @@ uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp)
    uint8_t ueId =0, isCrntiValid = 0, tbIdx =0, idx=0;
    uint16_t cellIdx=0;
    uint8_t ret = RFAILED;
-   UeDeleteStatus result;
+   CauseOfResult  status;
    DlHarqEnt  *dlHarqEnt;
 
 #ifdef CALL_FLOW_DEBUG_LOG
@@ -3230,7 +3283,7 @@ uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp)
             {
                /*C-RNTI value is out of Acceptable range*/
                DU_LOG("\nERROR  -->  MAC : MacProcSchUeDeleteRsp(): Invalid crnti[%d] ",schUeDelRsp->crnti);
-               result = UEID_INVALID;
+               status = UEID_INVALID;
             }
             else
             {
@@ -3264,29 +3317,29 @@ uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp)
                   }
                   memset(&macCb.macCell[cellIdx]->ueCb[ueId -1], 0, sizeof(MacUeCb));
                   macCb.macCell[cellIdx]->numActvUe--;
-                  result = DEL_SUCCESSFUL;
+                  status = SUCCESSFUL;
                   ret = ROK;
                }
                else
                {
                   DU_LOG("\nERROR  -->  MAC : MacProcSchUeDeleteRsp(): crnti[%d] does not exist ",schUeDelRsp->crnti);
-                  result = UEID_INVALID;
+                  status = UEID_INVALID;
                }
             }
          }
          else
          {
             DU_LOG("\nERROR  -->  MAC : MacProcSchUeDeleteRsp(): cellId[%d] does not exist ",schUeDelRsp->cellId);
-            result = CELLID_INVALID;
+            status = CELLID_INVALID;
          }
       }
       else
-      {
-         result = (schUeDelRsp->cause == INVALID_CELLID) ? CELLID_INVALID : UEID_INVALID;
-      }
-      if(MacSendUeDeleteRsp(schUeDelRsp->cellId, schUeDelRsp->crnti, result) != ROK)
+         status = schUeDelRsp->cause;
+      
+      if(MacSendUeDeleteRsp(schUeDelRsp->cellId, schUeDelRsp->crnti, status) != ROK)
       {
          DU_LOG("\nERROR  -->  MAC: MacProcSchUeDeleteRsp(): Failed to send UE delete response");
+         ret = RFAILED;
       }
    }
    else
@@ -3355,7 +3408,7 @@ uint8_t MacProcUeDeleteReq(Pst *pst, MacUeDelete *ueDelete)
 {
    uint8_t ret = ROK;
    uint8_t cellIdx=0;
-   UeDeleteStatus result=DEL_SUCCESSFUL;
+   CauseOfResult  status =SUCCESSFUL;
    MacUeCb  *ueCb = NULLP;
    MacCellCb *cellCb = NULLP;
 
@@ -3380,18 +3433,18 @@ uint8_t MacProcUeDeleteReq(Pst *pst, MacUeDelete *ueDelete)
          else
          {
             DU_LOG("\nERROR  -->  MAC : MacProcUeDeleteReq(): CRNTI is not matched");
-            result = UEID_INVALID;
+            status = UEID_INVALID;
          }
       }
       else
       {
          DU_LOG("\nERROR  -->  MAC : MacProcUeDeleteReq(): Failed to find the MacUeCb of UeId = %d",ueDelete->ueId);
-         result = CELLID_INVALID;
+         status = CELLID_INVALID;
       }
 
-      if(result != DEL_SUCCESSFUL)
+      if(status!= SUCCESSFUL)
       {
-         MacSendUeDeleteRsp(ueDelete->cellId, ueDelete->crnti, result);
+         MacSendUeDeleteRsp(ueDelete->cellId, ueDelete->crnti, status);
          MAC_FREE_SHRABL_BUF(pst->region, pst->pool, ueDelete, sizeof(MacUeDelete));
          ret = RFAILED;
       }
@@ -3404,6 +3457,104 @@ uint8_t MacProcUeDeleteReq(Pst *pst, MacUeDelete *ueDelete)
    return ret;
 }
 
+/*******************************************************************
+*
+* @brief Fill and Send UE Reset response from MAC to DU APP
+*
+* @details
+*
+*    Function : MacSendUeResetRsp 
+*
+*    Functionality: Fill and Send UE Reset response from MAC to DUAPP
+*
+* @params[in] MAC UE Reset result
+*             SCH UE Reset response
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t MacSendUeResetRsp(uint16_t cellId, uint16_t ueId, CauseOfResult  status)
+{
+   MacUeResetRsp *ResetRsp;
+   Pst            rspPst;
+
+   MAC_ALLOC_SHRABL_BUF(ResetRsp, sizeof(MacUeResetRsp));
+   if(!ResetRsp)
+   {
+      DU_LOG("\nERROR  -->  MAC : Memory allocation for UE Reset response failed");
+      return RFAILED;
+   }
+
+   /* Filling UE Reset response */
+   ResetRsp->cellId = cellId;
+   ResetRsp->ueId   = ueId;
+   ResetRsp->status = status;
+
+   /* Fill Post structure and send UE Reset response*/
+   memset(&rspPst, 0, sizeof(Pst));
+   FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_RESET_RSP);
+   return (*macDuUeResetRspOpts[rspPst.selector])(&rspPst, ResetRsp);
+}
+
+/*******************************************************************
+ *
+ * @brief Handles UE Reset request from DU APP
+ *
+ * @details
+ *
+ *    Function : MacProcUeResetReq
+ *
+ *    Functionality: Handles UE Reset requst from DU APP
+ *
+ * @params[in] Pst *pst, MacUeResetReq *ueReset
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t MacProcUeResetReq(Pst *pst, MacUeResetReq *ueReset)
+{
+   uint8_t cellIdx=0;
+   CauseOfResult  status =SUCCESSFUL;
+   MacUeCb  *ueCb = NULLP;
+   MacCellCb *cellCb = NULLP;
+
+   DU_LOG("\nINFO   -->  MAC : UE Reset Request received for ueId[%d]", ueReset->ueId);
+
+   if(ueReset)
+   {
+      GET_CELL_IDX(ueReset->cellId, cellIdx);     
+      cellCb = macCb.macCell[cellIdx];
+      if(cellCb)
+      {
+         ueCb = &cellCb->ueCb[ueReset->ueId-1];
+         if(ueCb->ueId == ueReset->ueId)
+         {
+            /* TODO := complete the processing of UE reset request*/
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  MAC : MacProcUeResetReq(): UE ID [%d] not found in Cell Id [%d]", ueCb->ueId , ueReset->cellId);
+            status = UEID_INVALID;
+         }
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  MAC : MacProcUeResetReq(): Cell Id [%d] not found ",ueReset->cellId);
+         status = CELLID_INVALID;
+      }
+
+      MacSendUeResetRsp(ueReset->cellId, ueReset->ueId, status);
+      MAC_FREE_SHRABL_BUF(pst->region, pst->pool, ueReset, sizeof(MacUeResetReq));
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC : MacProcUeResetReq(): MAC UE reset request processing failed");
+      return  RFAILED;
+   }
+   return ROK;
+}
 /**********************************************************************
   End of file
  **********************************************************************/
index dd5432c..c3b6489 100644 (file)
@@ -19,7 +19,7 @@
 /* This file stores defines used at RLC interface */
 uint8_t fillRlcUeCfgRsp(RlcUeCfgRsp *rlcCfgRsp, RlcCfgCfmInfo *rlcCRsp);
 uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp);
-uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId, uint8_t ueId, UeDeleteResult result);
+uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId, uint8_t ueId, CauseOfResult  status);
 
 /**********************************************************************
          End of file
index f10a520..649a18e 100644 (file)
@@ -853,13 +853,13 @@ uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo)
  *    Functionality:
  *      sending UE delete response to DU 
  *
- * @params[in] uint8_t cellId, uint8_t ueId, UeDeleteResult result 
+ * @params[in] uint8_t cellId, uint8_t ueId, CauseOfResult  status 
  *
  * @return ROK     - success
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId,uint8_t ueId, UeDeleteResult result)
+uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId,uint8_t ueId, CauseOfResult  status)
 {
    Pst pst;  
    RlcUeDeleteRsp *ueDeleteRsp = NULLP;
@@ -876,7 +876,7 @@ uint8_t sendRlcUeDeleteRspToDu(uint16_t cellId,uint8_t ueId, UeDeleteResult resu
    {
       ueDeleteRsp->cellId = cellId;
       ueDeleteRsp->ueId = ueId;
-      ueDeleteRsp->result = result;
+      ueDeleteRsp->status = status;
   
       if(rlcSendUeDeleteRspToDu(&pst, ueDeleteRsp) == ROK)
       {
@@ -915,7 +915,7 @@ uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete)
    uint8_t ret = ROK;
    RlcCb *gRlcCb = NULLP;
    RlcUlUeCb *ueCb = NULLP;
-   UeDeleteResult result=SUCCESSFUL;
+   CauseOfResult  status =SUCCESSFUL;
 
    DU_LOG("\nDEBUG  -->  RLC: UE Delete request received. CellID[%d] UEID[%d]",ueDelete->cellId, ueDelete->ueId);
 
@@ -935,17 +935,17 @@ uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete)
          }
          else
          {
-            result = INVALID_CELLID;
+            status = CELLID_INVALID;
          }
       }
       else
       {
-         result = INVALID_UEID;
+         status = UEID_INVALID;
       }
 
-      if(result != SUCCESSFUL)
+      if(status != SUCCESSFUL)
       {
-         ret = sendRlcUeDeleteRspToDu(ueDelete->cellId, ueDelete->ueId, result);
+         ret = sendRlcUeDeleteRspToDu(ueDelete->cellId, ueDelete->ueId, status);
          if(ret != ROK)
          {
             DU_LOG("\nERROR  -->  RLC: RlcProcUeDeleteReq():Failed to send UE Delete response to DU");
index fc8ae66..0c7234e 100755 (executable)
@@ -683,7 +683,7 @@ uint8_t rlcUeDeleteTmrExpiry(PTR cb)
    if(RlcProcCfgReq(&ueCb->ueDeleteInfo.pst, rlcUeCfg) != ROK)
    {
       DU_LOG("\nERROR  -->  RLC: rlcUeDeleteTmrExpiry(): Failed to delete UE");
-      if(sendRlcUeDeleteRspToDu(rlcUeCfg->cellId, rlcUeCfg->ueId, INVALID_UEID) != ROK)
+      if(sendRlcUeDeleteRspToDu(rlcUeCfg->cellId, rlcUeCfg->ueId, UEID_INVALID) != ROK)
       {
          DU_LOG("ERROR  --> RLC: rlcUeDeleteTmrExpiry(): Failed to send UE delete response ");
          return RFAILED;
index d5eb518..2b04e86 100644 (file)
@@ -1720,150 +1720,105 @@ void SchSendSliceCfgRspToMac(Inst inst, SchSliceCfgRsp sliceCfgRsp)
    MacMessageRouter(&rspPst, (void *)&sliceCfgRsp);
 
 }
+
 /*******************************************************************************
  *
- * @brief fill slice configuration response
+ * @brief This function is used to store or modify the slice configuration Sch DB
  *
  * @details
  *
- *    Function : fillSliceCfgRsp
+ *    Function : addOrModifySliceCfgInSchDb 
  *
  *    Functionality:
- *     fill slice configuration response
+ *     function is used to store or modify the slice configuration Sch DB
  *
- * @params[in] SchCellCb, SchSliceCfgReq, SchSliceCfgRsp,uint8_t  count
+ * @params[in] SchSliceCfg *storeSliceCfg, SchSliceCfgReq *cfgReq,
+ * SchSliceCfgRsp cfgRsp, uint8_t count
  *
  * @return
  *        ROK - Success
  *        RFAILED - Failure
  *
  * ********************************************************************************/
-uint8_t fillSliceCfgRsp(bool sliceRecfg, SchSliceCfg *storedSliceCfg, SchCellCb *cellCb, SchSliceCfgReq *schSliceCfgReq, SchSliceCfgRsp *schSliceCfgRsp, uint8_t *count)
+uint8_t addSliceCfgInSchDb(CmLListCp *sliceCfgInDb, SchRrmPolicyOfSlice *cfgReq)
 {
-   bool sliceFound = false;
-   uint8_t cfgIdx = 0, sliceIdx = 0, plmnIdx = 0;
+   SchRrmPolicyOfSlice *sliceToStore;
 
-   schSliceCfgRsp->numSliceCfgRsp  = schSliceCfgReq->numOfConfiguredSlice;
-   SCH_ALLOC(schSliceCfgRsp->listOfSliceCfgRsp, schSliceCfgRsp->numSliceCfgRsp * sizeof(SliceRsp*));
-   if(schSliceCfgRsp->listOfSliceCfgRsp == NULLP)
+   SCH_ALLOC(sliceToStore, sizeof(SchRrmPolicyOfSlice));
+   if(sliceToStore)
    {
-      DU_LOG("\nERROR  --> SCH : Memory allocation failed at fillSliceCfgRsp");
-      return RFAILED;
+      memcpy(&sliceToStore->snssai, &cfgReq->snssai, sizeof(Snssai));  
+      memcpy(&sliceToStore->rrmPolicyRatioInfo, &cfgReq->rrmPolicyRatioInfo, sizeof(SchRrmPolicyRatio));  
+      addNodeToLList(sliceCfgInDb, sliceToStore, NULL);
    }
-
-   for(cfgIdx = 0; cfgIdx<schSliceCfgRsp->numSliceCfgRsp ; cfgIdx++)
+   else
    {
-      sliceFound = false;
-      /* Here comparing the slice cfg request with the slice stored in cellCfg */
-      if(sliceRecfg != true)
-      {
-         for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++)
-         {
-            for(sliceIdx = 0; sliceIdx<cellCb->cellCfg.plmnInfoList[plmnIdx].numSliceSupport; sliceIdx++)
-            {
-               if(!memcmp(&schSliceCfgReq->listOfSlices[cfgIdx]->snssai, cellCb->cellCfg.plmnInfoList[plmnIdx].snssai[sliceIdx], sizeof(Snssai)))
-               {
-                  (*count)++;
-                  sliceFound = true;
-                  break;
-               }
-            }
-            if(sliceFound == true)
-            {
-               break;
-            }
-         }
-      }
-      else
-      {
-         /* Here comparing the slice cfg request with the slice stored in SchDb */
-         if(storedSliceCfg->listOfSlices)
-         {
-            for(sliceIdx = 0; sliceIdx<storedSliceCfg->numOfSliceConfigured; sliceIdx++)
-            {
-               if(!memcmp(&schSliceCfgReq->listOfSlices[cfgIdx]->snssai, &storedSliceCfg->listOfSlices[sliceIdx]->snssai,\
-                        sizeof(Snssai)))
-               {
-                  (*count)++;
-                  sliceFound = true;
-                  break;
-               }
-            }
-         }
-      }
-
-      SCH_ALLOC(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(SliceRsp));
-      if(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx] == NULLP)
-      {
-         DU_LOG("\nERROR  -->  SCH : Failed to allocate memory in fillSliceCfgRsp");
-         return RFAILED;
-      }
-
-
-      schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->snssai = schSliceCfgReq->listOfSlices[cfgIdx]->snssai;
-      if(sliceFound == true)
-         schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp    = RSP_OK;
-      else
-      {
-         schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp    = RSP_NOK;
-         schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->cause  = SLICE_NOT_FOUND;
-      }
+      DU_LOG("\nERROR  -->  SCH : Memory allocation failed in addOrModifySliceCfgInSchDb");
+      return RFAILED;
    }
    return ROK;
 }
 
 /*******************************************************************************
  *
- * @brief This function is used to store the slice configuration Sch DB
+ * @brief fill slice configuration response
  *
  * @details
  *
- *    Function : addSliceCfgInSchDb 
+ *    Function : fillSliceCfgRsp
  *
  *    Functionality:
- *     function is used to store the slice configuration Sch DB
+ *     fill slice configuration response
  *
- * @params[in] SchSliceCfg *storeSliceCfg, SchSliceCfgReq *cfgReq,
- * SchSliceCfgRsp cfgRsp, uint8_t count
+ * @params[in] SchCellCb, SchSliceCfgReq, SchSliceCfgRsp,uint8_t  count
  *
  * @return
  *        ROK - Success
  *        RFAILED - Failure
  *
  * ********************************************************************************/
-uint8_t addSliceCfgInSchDb(SchSliceCfg *storeSliceCfg, SchSliceCfgReq *cfgReq, SchSliceCfgRsp cfgRsp, uint8_t count)
+uint8_t fillSliceCfgRsp(Inst inst, CmLListCp *storedSliceCfg, SchCellCb *cellCb, SchSliceCfgReq *schSliceCfgReq)
 {
-   uint8_t cfgIdx = 0, sliceIdx = 0; 
-   
-   if(count)
-   {
-      storeSliceCfg->numOfSliceConfigured = count;
-      SCH_ALLOC(storeSliceCfg->listOfSlices, storeSliceCfg->numOfSliceConfigured * sizeof(SchRrmPolicyOfSlice*));
-      if(storeSliceCfg->listOfSlices == NULLP)
-      {
-         DU_LOG("\nERROR  -->  SCH : Failed to allocate memory in addSliceCfgInSchDb");
-         return RFAILED;
-      }
+   SchMacRsp sliceFound;
+   uint8_t cfgIdx = 0, sliceIdx = 0, plmnIdx = 0, ret =ROK;
+   SchSliceCfgRsp schSliceCfgRsp;
 
-      for(cfgIdx = 0; cfgIdx<storeSliceCfg->numOfSliceConfigured; cfgIdx++)
+   for(cfgIdx = 0; cfgIdx<schSliceCfgReq->numOfConfiguredSlice; cfgIdx++)
+   {
+      sliceFound = RSP_NOK;
+      /* Here comparing the slice cfg request with the slice stored in cellCfg */
+      for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++)
       {
-         if(cfgRsp.listOfSliceCfgRsp[cfgIdx]->rsp == RSP_OK)
+         for(sliceIdx = 0; sliceIdx<cellCb->cellCfg.plmnInfoList[plmnIdx].numSliceSupport; sliceIdx++)
          {
-            SCH_ALLOC(storeSliceCfg->listOfSlices[sliceIdx], sizeof(SchRrmPolicyOfSlice));
-            if(storeSliceCfg->listOfSlices[sliceIdx] == NULLP)
+            /* If we find the SliceCfgReq's SNSSAI in CellCb's SNSSAI DB, we mark this slice as configured and add it to Sch's DB. */ 
+            if(!memcmp(&schSliceCfgReq->listOfSlices[cfgIdx]->snssai, cellCb->cellCfg.plmnInfoList[plmnIdx].snssai[sliceIdx], sizeof(Snssai)))
             {
-               DU_LOG("\nERROR  -->  SCH : Failed to allocate memory in addSliceCfgInSchDb");
-               return RFAILED;
+               if(addSliceCfgInSchDb(storedSliceCfg, schSliceCfgReq->listOfSlices[cfgIdx]) == ROK)
+               {
+                  sliceFound = RSP_OK;
+                  schSliceCfgRsp.cause = SUCCESSFUL;
+               }
+               else
+               {
+                  DU_LOG("\nERROR  --> SCH : Failed to store slice configuration in SchDb");
+                  schSliceCfgRsp.cause = RESOURCE_UNAVAILABLE;
+                  ret = RFAILED;
+               }
+               plmnIdx = MAX_PLMN;
+               break;
             }
-
-            memcpy(&storeSliceCfg->listOfSlices[sliceIdx]->snssai, &cfgReq->listOfSlices[sliceIdx]->snssai, sizeof(Snssai));
-            memcpy(&storeSliceCfg->listOfSlices[sliceIdx]->rrmPolicyRatioInfo, &cfgReq->listOfSlices[sliceIdx]->rrmPolicyRatioInfo,
-                      sizeof(SchRrmPolicyRatio));
-            sliceIdx++;
          }
       }
+      
+      if((sliceFound == RSP_NOK) && (schSliceCfgRsp.cause != RESOURCE_UNAVAILABLE))
+         schSliceCfgRsp.cause = SLICE_NOT_FOUND;
+      
+      schSliceCfgRsp.snssai = schSliceCfgReq->listOfSlices[cfgIdx]->snssai;
+      schSliceCfgRsp.rsp    = sliceFound;
+      SchSendSliceCfgRspToMac(inst, schSliceCfgRsp);
    }
-   return ROK;
+   return ret;
 }
 
 /*******************************************************************************
@@ -1923,9 +1878,8 @@ void freeSchSliceCfgReq(SchSliceCfgReq *sliceCfgReq)
  * ********************************************************************************/
 uint8_t SchProcSliceCfgReq(Pst *pst, SchSliceCfgReq *schSliceCfgReq)
 {
-   uint8_t count = 0;
+   uint8_t ret = ROK;
    Inst   inst = pst->dstInst - SCH_INST_START;
-   SchSliceCfgRsp sliceCfgRsp;
 
    DU_LOG("\nINFO  -->  SCH : Received Slice Cfg request from MAC");
    if(schSliceCfgReq)
@@ -1933,77 +1887,22 @@ uint8_t SchProcSliceCfgReq(Pst *pst, SchSliceCfgReq *schSliceCfgReq)
       if(schSliceCfgReq->listOfSlices)
       {
          /* filling the slice configuration response of each slice */
-         if(fillSliceCfgRsp(false, NULLP, schCb[inst].cells[0], schSliceCfgReq, &sliceCfgRsp, &count) != ROK)
+         if(fillSliceCfgRsp(inst, &schCb[inst].sliceCfg, schCb[inst].cells[0], schSliceCfgReq) != ROK)
          {
             DU_LOG("\nERROR  -->  SCH : Failed to fill the slice cfg rsp");
-            return RFAILED;
-         }
-
-         if(addSliceCfgInSchDb(&schCb[inst].sliceCfg, schSliceCfgReq, sliceCfgRsp, count) != ROK)
-         {
-            DU_LOG("\nERROR  -->  SCH : Failed to add slice cfg in sch database");
-            return RFAILED;
+            ret = RFAILED;
          }
          freeSchSliceCfgReq(schSliceCfgReq);
-         SchSendSliceCfgRspToMac(inst, sliceCfgRsp);
       }
    }
    else
    {
       DU_LOG("\nERROR  -->  SCH : Received SchSliceCfgReq is NULL");
+      ret = RFAILED;
    }
-   return ROK;
+   return ret;
 }
 
-/*******************************************************************************
- *
- * @brief This function is used to store the slice reconfiguration Sch DB
- *
- * @details
- *
- *    Function : modifySliceCfgInSchDb 
- *
- *    Functionality:
- *     function is used to store the slice re configuration Sch DB
- *
- * @params[in] Pst *pst, SchSliceCfgReq *schSliceCfgReq
- *
- * @return
- *        ROK - Success
- *        RFAILED - Failure
- *
- * ********************************************************************************/
-uint8_t modifySliceCfgInSchDb(SchSliceCfg *storeSliceCfg, SchSliceRecfgReq *recfgReq, SchSliceRecfgRsp recfgRsp, uint8_t count)
-{
-   uint8_t cfgIdx = 0, sliceIdx = 0; 
-
-   if(count)
-   {
-      if(storeSliceCfg->listOfSlices == NULLP)
-      {
-         DU_LOG("\nINFO  -->  SCH : Memory allocation failed in modifySliceCfgInSchDb");
-         return RFAILED;
-      }
-
-      for(cfgIdx = 0; cfgIdx<recfgReq->numOfConfiguredSlice; cfgIdx++)
-      {
-         if(recfgRsp.listOfSliceCfgRsp[cfgIdx]->rsp == RSP_OK)
-         {
-            for(sliceIdx = 0; sliceIdx<storeSliceCfg->numOfSliceConfigured; sliceIdx++)
-            {
-               if(!memcmp(&storeSliceCfg->listOfSlices[sliceIdx]->snssai, &recfgReq->listOfSlices[cfgIdx]->snssai, sizeof(Snssai)))
-               {
-                  memcpy(&storeSliceCfg->listOfSlices[sliceIdx]->rrmPolicyRatioInfo, &recfgReq->listOfSlices[cfgIdx]->rrmPolicyRatioInfo,
-                           sizeof(SchRrmPolicyRatio));
-                  break;
-               }
-            }
-         }
-      }
-   }
-   freeSchSliceCfgReq(recfgReq);
-   return ROK;
-}
 /*******************************************************************************
  *
  * @brief This function is used to send Slice re Cfg rsp to MAC
@@ -2030,6 +1929,61 @@ void SchSendSliceRecfgRspToMac(Inst inst, SchSliceRecfgRsp schSliceRecfgRsp)
    
    MacMessageRouter(&rspPst, (void *)&schSliceRecfgRsp);
 }
+
+/*******************************************************************************
+ *
+ * @brief fill slice configuration response
+ *
+ * @details
+ *
+ *    Function : fillSliceRecfgRsp
+ *
+ *    Functionality: fill slice reconfiguration response
+ *
+ * @params[in] SchCellCb, SchSliceCfgReq, SchSliceCfgRsp,uint8_t  count
+ *
+ * @return
+ *        ROK - Success
+ *        RFAILED - Failure
+ *
+ * ********************************************************************************/
+
+uint8_t fillSliceRecfgRsp(Inst inst, CmLListCp *storedSliceCfg, SchSliceRecfgReq *schSliceRecfgReq)
+{
+   SchMacRsp sliceFound;
+   uint8_t cfgIdx = 0;
+   SchRrmPolicyOfSlice *rrmPolicyOfSlices;
+   SchSliceRecfgRsp schSliceRecfgRsp;
+
+   for(cfgIdx = 0; cfgIdx<schSliceRecfgReq->numOfConfiguredSlice; cfgIdx++)
+   {
+      sliceFound = RSP_NOK;
+      /* Here comparing the slice recfg request with the StoredSliceCfg */
+      CmLList *sliceCfg = storedSliceCfg->first;
+
+      while(sliceCfg)
+      {
+         rrmPolicyOfSlices = (SchRrmPolicyOfSlice*)sliceCfg->node;
+         
+         if(rrmPolicyOfSlices && (memcmp(&schSliceRecfgReq->listOfSlices[cfgIdx]->snssai, &(rrmPolicyOfSlices->snssai), sizeof(Snssai)) == 0))
+         {
+            memcpy(&rrmPolicyOfSlices->rrmPolicyRatioInfo, &schSliceRecfgReq->listOfSlices[cfgIdx]->rrmPolicyRatioInfo, sizeof(SchRrmPolicyRatio));
+            sliceFound = RSP_OK;
+            break;
+         }
+         sliceCfg = sliceCfg->next;
+      }
+
+      schSliceRecfgRsp.snssai = schSliceRecfgReq->listOfSlices[cfgIdx]->snssai;
+      schSliceRecfgRsp.rsp    = sliceFound;
+      if(schSliceRecfgRsp.rsp == RSP_OK)
+         schSliceRecfgRsp.cause = SUCCESSFUL;
+      else
+         schSliceRecfgRsp.cause = SLICE_NOT_FOUND;
+      SchSendSliceRecfgRspToMac(inst, schSliceRecfgRsp);
+   }
+   return ROK;
+}
 /*******************************************************************************
  *
  * @brief This function is used to store the slice reconfiguration Sch DB
@@ -2050,9 +2004,8 @@ void SchSendSliceRecfgRspToMac(Inst inst, SchSliceRecfgRsp schSliceRecfgRsp)
  * ********************************************************************************/
 uint8_t SchProcSliceRecfgReq(Pst *pst, SchSliceRecfgReq *schSliceRecfgReq)
 {
-   uint8_t count = 0;
+   uint8_t ret = ROK;
    Inst   inst = pst->dstInst - SCH_INST_START;
-   SchSliceRecfgRsp schSliceRecfgRsp;
 
    DU_LOG("\nINFO  -->  SCH : Received Slice ReCfg request from MAC");
    if(schSliceRecfgReq)
@@ -2060,26 +2013,20 @@ uint8_t SchProcSliceRecfgReq(Pst *pst, SchSliceRecfgReq *schSliceRecfgReq)
       if(schSliceRecfgReq->listOfSlices)
       {
          /* filling the slice configuration response of each slice */
-         if(fillSliceCfgRsp(true, &schCb[inst].sliceCfg, NULLP, schSliceRecfgReq, &schSliceRecfgRsp, &count) != ROK)
+         if(fillSliceRecfgRsp(inst, &schCb[inst].sliceCfg, schSliceRecfgReq) != ROK)
          {
             DU_LOG("\nERROR  -->  SCH : Failed to fill sch slice cfg response");
-            return RFAILED;
-         }
-         
-         /* Modify the slice configuration stored in schCb */
-         if(modifySliceCfgInSchDb(&schCb[inst].sliceCfg, schSliceRecfgReq, schSliceRecfgRsp, count) != ROK)
-         {
-            DU_LOG("\nERROR  -->  SCH : Failed to modify slice cfg of SchDb");
-            return RFAILED;
+            ret = RFAILED;
          }
-         SchSendSliceRecfgRspToMac(inst, schSliceRecfgRsp);
+         freeSchSliceCfgReq(schSliceRecfgReq);
       }
    }
    else
    {
       DU_LOG("\nERROR  -->  SCH : Received SchSliceRecfgReq is NULL");
+
    }
-   return ROK;
+   return ret;
 }
 
 /****************************************************************************
@@ -2387,6 +2334,201 @@ RgMngmt       *cfm
    return;
 }
 
+/*******************************************************************
+ *
+ * @brief Processes DL CQI ind from MAC
+ *
+ * @details
+ *
+ *    Function : SchProcDlCqiInd
+ *
+ *    Functionality:
+ *       Processes DL CQI ind from MAC
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t SchProcDlCqiInd(Pst *pst, SchDlCqiInd *dlCqiInd)
+{
+   uint8_t  ret = ROK;
+   uint16_t ueId = 0, cellIdx = 0;
+   SchUeCb *ueCb = NULLP;
+   SchCellCb *cell = NULLP;
+   Inst  inst = pst->dstInst-SCH_INST_START;   
+
+   if(!dlCqiInd)
+   {
+      DU_LOG("\nERROR  -->  SCH : SchProcDlCqiInd(): CQI Ind is empty");
+      ret = RFAILED;
+   }
+   else
+   {
+      GET_CELL_IDX(dlCqiInd->cellId, cellIdx);
+      cell = schCb[inst].cells[cellIdx];
+      if(cell == NULLP)
+      { 
+         DU_LOG("\nERROR  -->  SCH : SchProcDlCqiInd(): cell Id[%d] not found", dlCqiInd->cellId);
+         ret = RFAILED;
+      }
+      else
+      {
+         if(cell->cellId == dlCqiInd->cellId)
+         {
+            GET_UE_ID(dlCqiInd->crnti, ueId);
+            ueCb = &cell->ueCb[ueId-1];
+            if(ueCb->crnti != dlCqiInd->crnti)
+            {
+               DU_LOG("\nERROR  -->  SCH : SchProcDlCqiInd(): UeCb for received crnti[%d] not found", dlCqiInd->crnti);
+               ret = RFAILED;
+            }
+            else
+            {
+               /*TODO: complete the processing of DL CQI Ind*/ 
+            }
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  SCH : SchProcDlCqiInd(): Received cell Id[%d] from MAC is not matching with CellID[%d] in SCH Cb",\
+                    dlCqiInd->cellId, cell->cellId);
+            ret = RFAILED;
+         }
+      }
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Processes UL CQI ind from MAC
+ *
+ * @details
+ *
+ *    Function : SchProcUlCqiInd
+ *
+ *    Functionality:
+ *       Processes UL CQI ind from MAC
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t SchProcUlCqiInd(Pst *pst, SchUlCqiInd *ulCqiInd)
+{
+   uint8_t  ret = ROK;
+   uint16_t ueId = 0, cellIdx = 0;
+   SchUeCb *ueCb = NULLP;
+   SchCellCb *cell = NULLP;
+   Inst  inst = pst->dstInst-SCH_INST_START;   
+
+   if(!ulCqiInd)
+   {
+      DU_LOG("\nERROR  -->  SCH : SchProcUlCqiInd(): CQI Ind is empty");
+      ret = RFAILED;
+   }
+   else
+   {
+      GET_CELL_IDX(ulCqiInd->cellId, cellIdx);
+      cell = schCb[inst].cells[cellIdx];
+      if(cell == NULLP)
+      { 
+         DU_LOG("\nERROR  -->  SCH : SchProcUlCqiInd(): cell Id[%d] not found", ulCqiInd->cellId);
+         ret = RFAILED;
+      }
+      else
+      {
+         if(cell->cellId == ulCqiInd->cellId)
+         {
+            GET_UE_ID(ulCqiInd->crnti, ueId);
+            ueCb = &cell->ueCb[ueId-1];
+            if(ueCb->crnti != ulCqiInd->crnti)
+            {
+               DU_LOG("\nERROR  -->  SCH : SchProcUlCqiInd(): UeCb for received crnti[%d] not found",ulCqiInd->crnti);
+               ret = RFAILED;
+            }
+            else
+            {
+               /*TODO: complete the processing of UL CQI Ind*/ 
+            }
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  SCH : SchProcUlCqiInd(): Received cell Id[%d] from MAC is not matching with CellId[%d] in SCH Cb",\
+                    ulCqiInd->cellId, cell->cellId);
+            ret = RFAILED;
+         }
+      }
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Processes PHR ind from MAC
+ *
+ * @details
+ *
+ *    Function : SchProcPhrInd
+ *
+ *    Functionality:
+ *       Processes PHR ind from MAC
+ *
+ * @params[in] 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t SchProcPhrInd(Pst *pst, SchPwrHeadroomInd *schPhrInd)
+{
+   uint8_t  ret = ROK;
+   uint16_t ueId = 0, cellIdx = 0;
+   SchUeCb *ueCb = NULLP;
+   SchCellCb *cell = NULLP;
+   Inst  inst = pst->dstInst-SCH_INST_START;   
+
+   if(!schPhrInd)
+   {
+      DU_LOG("\nERROR  -->  SCH : SchProcPhrInd(): PHR is empty");
+      ret = RFAILED;
+   }
+   else
+   {
+      GET_CELL_IDX(schPhrInd->cellId, cellIdx);
+      cell = schCb[inst].cells[cellIdx];
+      if(cell == NULLP)
+      { 
+         DU_LOG("\nERROR  -->  SCH : schProcPhrInd(): cell Id[%d] is not found", schPhrInd->cellId);
+         ret = RFAILED;
+      }
+      else
+      {
+         if(cell->cellId == schPhrInd->cellId)
+         {
+            GET_UE_ID(schPhrInd->crnti, ueId);
+            ueCb = &cell->ueCb[ueId-1];
+            if(ueCb->crnti != schPhrInd->crnti)
+            {
+               DU_LOG("\nERROR  -->  SCH : SchProcPhrInd(): UeCb for received crnti[%d] not found",schPhrInd->crnti);
+               ret = RFAILED;
+            }
+            else
+            {
+               /*TODO: complete the processing of PHR Ind*/ 
+            }
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  SCH : SchProcPhrInd(): Mismatch between Received cell Id[%d] from MAC and CellID[%d] in SCH CB ",\
+                    schPhrInd->cellId, cell->cellId);
+            ret = RFAILED;
+         }
+      }
+   }
+   return ret;
+}
+
 /**********************************************************************
   End of file
  **********************************************************************/
index 89c633a..379bb27 100644 (file)
@@ -491,6 +491,10 @@ typedef struct schUeCb
    bool          ueDrxInfoPres;
    SchDrxUeCb    drxUeCb;
 #endif
+   bool                 k0K1TblPrsnt;
+   SchK0K1TimingInfoTbl k0K1InfoTbl;
+   bool                 k2TblPrsnt;
+   SchK2TimingInfoTbl   k2InfoTbl;
 }SchUeCb;
 
 /**
@@ -642,12 +646,6 @@ typedef struct schCellCb
 }SchCellCb;
 
 
-typedef struct schSliceCfg
-{
-   uint8_t        numOfSliceConfigured;
-   SchRrmPolicyOfSlice **listOfSlices;
-}SchSliceCfg;
-
 /**
  * @brief
  * Control block for sch
@@ -660,7 +658,7 @@ typedef struct schCb
    CmTqType               tmrTq[SCH_TQ_SIZE];    /*!< Timer Task Queue */
    SchAllApis             allApis[NUM_SCH_TYPE]; /*!<List of All Scheduler Type dependent Function pointers*/
    SchCellCb              *cells[MAX_NUM_CELL];  /* Array to store cellCb ptr */
-   SchSliceCfg            sliceCfg;
+   CmLListCp              sliceCfg;              /* Linklist to Store Slice configuration */
 }SchCb;
 
 /* Declaration for scheduler control blocks */
@@ -686,6 +684,9 @@ uint8_t SchProcCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
 uint8_t SchProcSlotInd(Pst *pst, SlotTimingInfo *slotInd);
 uint8_t SchProcRachInd(Pst *pst, RachIndInfo *rachInd);
 uint8_t SchProcCrcInd(Pst *pst, CrcIndInfo *crcInd);
+uint8_t SchProcUlCqiInd(Pst *pst, SchUlCqiInd *ulCqiInd);
+uint8_t SchProcDlCqiInd(Pst *pst, SchDlCqiInd *dlCqiInd);
+uint8_t SchProcPhrInd(Pst *pst, SchPwrHeadroomInd *schPhrInd);
 uint8_t SchProcDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
 uint8_t SchAddUeConfigReq(Pst *pst, SchUeCfgReq *ueCfgToSch);
 uint8_t SchProcBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
index f86c20a..c2f25cf 100644 (file)
@@ -1983,8 +1983,8 @@ bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
    if(schGetSlotSymbFrmt(dciTime.slot, cell->slotFrmtBitMap) == DL_SLOT)
 #endif
    {     
-      if(ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2TblPrsnt)
-         k2InfoTbl = &ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2InfoTbl;
+      if(ueCb->k2TblPrsnt)
+         k2InfoTbl = &ueCb->k2InfoTbl;
       else
          k2InfoTbl =  &cell->k2InfoTbl;
 
@@ -1992,7 +1992,7 @@ bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
       {
          k2Index = k2InfoTbl->k2TimingInfo[dciTime.slot].k2Indexes[k2TblIdx];
 
-         if(!ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2TblPrsnt)
+         if(!ueCb->k2TblPrsnt)
          {
             k2Val = cell->cellCfg.ulCfgCommon.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[k2Index].k2;
             startSymb = cell->cellCfg.ulCfgCommon.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[k2Index].startSymbol;
index c4385ee..edb21b8 100755 (executable)
@@ -102,6 +102,20 @@ void callFlowSchMsgRouter(Pst *pst)
             strcpy(message,"EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH");
             break;
          }
+      case EVENT_UL_CQI_TO_SCH:
+         {
+            strcpy(message,"EVENT_UL_CQI_TO_SCH");
+            break;
+         }
+      case EVENT_DL_CQI_TO_SCH:
+         {
+            strcpy(message,"EVENT_DL_CQI_TO_SCH");
+            break;
+         }
+      case EVENT_PHR_IND_TO_SCH
+         {
+            strcpy(message,"EVENT_PHR_IND_TO_SCH");
+         }
       case EVENT_RACH_IND_TO_SCH:
          {
             strcpy(message,"EVENT_RACH_IND_TO_SCH");
@@ -179,7 +193,7 @@ uint8_t SchMessageRouter(Pst *pst, void *msg)
    switch(pst->event)
    {
       case EVENT_SCH_GEN_CFG:
-         {
+      {
             SchProcGenCfgReq(pst, (RgMngmt *)msg);
          break;
       }
@@ -213,6 +227,21 @@ uint8_t SchMessageRouter(Pst *pst, void *msg)
          SchModUeConfigReq(pst, (SchUeRecfgReq *)msg);
          break;
       }
+      case EVENT_UL_CQI_TO_SCH:
+      {
+         SchProcUlCqiInd(pst, (SchUlCqiInd *)msg);
+         break;
+      }
+      case EVENT_DL_CQI_TO_SCH:
+      {
+         SchProcDlCqiInd(pst, (SchDlCqiInd *)msg);
+         break;
+      }
+      case EVENT_PHR_IND_TO_SCH:
+      {
+         SchProcPhrInd(pst, (SchPwrHeadroomInd *)msg);
+         break;
+      }
       case EVENT_RACH_IND_TO_SCH:
       {
          SchProcRachInd(pst, (RachIndInfo *)msg);
index 74574eb..00ea9b9 100644 (file)
@@ -111,7 +111,7 @@ bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t
       }
    }
 
-   if(findValidK0K1Value(cell, currTime, ueId, ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.k0K1TblPrsnt,\
+   if(findValidK0K1Value(cell, currTime, ueId, ueCb->k0K1TblPrsnt,\
             &pdschStartSymbol, &pdschNumSymbols, &pdcchTime, &pdschTime, &pucchTime, isRetx, *hqP) != true )
    {
       /* If a valid combination of slots to scheduled PDCCH, PDSCH and PUCCH is
@@ -436,7 +436,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId,
    if(dedMsg == true)
    {
       ueCb = &cell->ueCb[ueId-1];
-      k0K1InfoTbl = &ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.k0K1InfoTbl;
+      k0K1InfoTbl = &ueCb->k0K1InfoTbl;
    }
    else
    {
index 51534f9..9116d10 100644 (file)
@@ -200,27 +200,27 @@ void fillSchUlLcCtxt(SchUlLcCtxt *ueCbLcCfg, SchLcCfg *lcCfg)
 
 uint8_t updateDedLcInfo(Inst inst, Snssai *snssai, uint16_t *rsvdDedicatedPRB, bool *isDedicated)
 {
-   uint8_t sliceCfgIdx =0;
-   SchSliceCfg sliceCfg = schCb[inst].sliceCfg;
+   CmLList *sliceCfg = schCb[inst].sliceCfg.first;
+   SchRrmPolicyOfSlice *rrmPolicyOfSlices;
 
-   if(sliceCfg.numOfSliceConfigured)
+   while(sliceCfg)
    {
-      for(sliceCfgIdx = 0; sliceCfgIdx<sliceCfg.numOfSliceConfigured; sliceCfgIdx++)
+      rrmPolicyOfSlices = (SchRrmPolicyOfSlice*)sliceCfg->node;
+      if(rrmPolicyOfSlices && (memcmp(snssai, &(rrmPolicyOfSlices->snssai), sizeof(Snssai)) == 0))
       {
-         if(memcmp(snssai, &(sliceCfg.listOfSlices[sliceCfgIdx]->snssai), sizeof(Snssai)) == 0)
-         {
-            /*Updating latest RrmPolicy*/
-            *rsvdDedicatedPRB = \
-                                (uint16_t)(((sliceCfg.listOfSlices[sliceCfgIdx]->rrmPolicyRatioInfo.dedicatedRatio)*(MAX_NUM_RB))/100);
-            *isDedicated = TRUE;
-            DU_LOG("\nINFO  -->  SCH : Updated RRM policy, reservedPOOL:%d",*rsvdDedicatedPRB);
-         }
-      }
-      /*case: This LcCtxt  is either a Default LC or this LC is part of someother RRM_MemberList*/
-      if(*isDedicated != TRUE) 
-      {
-         DU_LOG("\nINFO  -->  SCH : This SNSSAI is not a part of this RRMPolicy");
+         /*Updating latest RrmPolicy*/
+         *rsvdDedicatedPRB = \
+                             (uint16_t)(((rrmPolicyOfSlices->rrmPolicyRatioInfo.dedicatedRatio)*(MAX_NUM_RB))/100);
+         *isDedicated = TRUE;
+         DU_LOG("\nINFO  -->  SCH : Updated RRM policy, reservedPOOL:%d",*rsvdDedicatedPRB);
+         break;
       }
+      sliceCfg = sliceCfg->next;
+   }
+   /*case: This LcCtxt  is either a Default LC or this LC is part of someother RRM_MemberList*/
+   if(*isDedicated != TRUE) 
+   {
+      DU_LOG("\nINFO  -->  SCH : This SNSSAI is not a part of this RRMPolicy");
    }
    return ROK;  
 }
@@ -374,14 +374,14 @@ uint8_t fillSchUeCbFrmCfgReq(Inst inst, SchUeCb *ueCb, SchUeCfgReq *ueCfg)
       {
          if(dlDataToUlAck)
          {
-            BuildK0K1Table(ueCb->cellCb, &ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.k0K1InfoTbl, false, pdschCfg,\
+            BuildK0K1Table(ueCb->cellCb, &ueCb->k0K1InfoTbl, false, pdschCfg,\
                   ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg, dlDataToUlAck->dlDataToUlAckListCount,\
                   dlDataToUlAck->dlDataToUlAckList);
-            ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.k0K1TblPrsnt = true;
+            ueCb->k0K1TblPrsnt = true;
             BuildK2InfoTable(ueCb->cellCb, ueCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.timeDomRsrcAllocList,\
                   ueCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\
-                  NULLP, &ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2InfoTbl);
-            ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2TblPrsnt = true;
+                  NULLP, &ueCb->k2InfoTbl);
+            ueCb->k2TblPrsnt = true;
          }
       }
    }
@@ -552,14 +552,14 @@ uint8_t fillSchUeCbFrmRecfgReq(Inst inst, SchUeCb *ueCb, SchUeRecfgReq *ueRecfg)
       {
          if(dlDataToUlAck)
          {
-            BuildK0K1Table(ueCb->cellCb, &ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.k0K1InfoTbl, false, pdschCfg,\
+            BuildK0K1Table(ueCb->cellCb, &ueCb->k0K1InfoTbl, false, pdschCfg,\
                   ueRecfg->spCellRecfg.servCellRecfg.initDlBwp.pdschCfg, dlDataToUlAck->dlDataToUlAckListCount,\
                   dlDataToUlAck->dlDataToUlAckList);
-            ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.k0K1TblPrsnt = true;
+            ueCb->k0K1TblPrsnt = true;
             BuildK2InfoTable(ueCb->cellCb, ueRecfg->spCellRecfg.servCellRecfg.initUlBwp.puschCfg.timeDomRsrcAllocList,\
                   ueRecfg->spCellRecfg.servCellRecfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\
-                  NULLP, &ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2InfoTbl);
-            ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2TblPrsnt = true;
+                  NULLP, &ueCb->k2InfoTbl);
+            ueCb->k2TblPrsnt = true;
          }
       }
    }
@@ -1399,12 +1399,12 @@ void deleteSchUeCb(SchUeCb *ueCb)
 *    Functionality: Fill and send UE delete response to MAC
 *
 * @params[in] Inst inst, SchUeDelete  *ueDelete, SchMacRsp result, 
-*              ErrorCause cause
+*              CauseOfResult  cause
 * @return ROK     - success
 *         RFAILED - failure
 *
 * ****************************************************************/
-void SchSendUeDeleteRspToMac(Inst inst, SchUeDelete  *ueDelete, SchMacRsp result, ErrorCause cause)
+void SchSendUeDeleteRspToMac(Inst inst, SchUeDelete  *ueDelete, SchMacRsp result, CauseOfResult  cause)
 {
     Pst rspPst;
     SchUeDeleteRsp  delRsp;
@@ -1439,9 +1439,9 @@ void SchSendUeDeleteRspToMac(Inst inst, SchUeDelete  *ueDelete, SchMacRsp result
 * ****************************************************************/
 uint8_t SchProcUeDeleteReq(Pst *pst, SchUeDelete  *ueDelete)
 {
-    uint8_t      idx=0, ueId=0, ret=ROK;
-    ErrorCause   result;
-    SchCellCb    *cellCb = NULLP;
+    uint8_t idx=0, ueId=0, ret=ROK;
+    CauseOfResult  cause;
+    SchCellCb *cellCb = NULLP;
     Inst         inst = pst->dstInst - SCH_INST_START;
    
     if(!ueDelete)
@@ -1456,7 +1456,7 @@ uint8_t SchProcUeDeleteReq(Pst *pst, SchUeDelete  *ueDelete)
     if(cellCb->cellId != ueDelete->cellId)
     {
        DU_LOG("\nERROR  -->  SCH : SchProcUeDeleteReq(): cell Id is not available");
-       result =  INVALID_CELLID;
+       cause =  CELLID_INVALID;
     }
     else
     {
@@ -1467,22 +1467,22 @@ uint8_t SchProcUeDeleteReq(Pst *pst, SchUeDelete  *ueDelete)
           cellCb->api->SchUeDeleteReq(&cellCb->ueCb[ueId-1]);
           deleteSchUeCb(&cellCb->ueCb[ueId-1]);
           cellCb->numActvUe--;
-          result = NOT_APPLICABLE;
+          cause = SUCCESSFUL;
        }
        else
        {
           DU_LOG("\nERROR  -->  SCH : SchProcUeDeleteReq(): SchUeCb not found");
-          result =  INVALID_UEID;
+          cause =  UEID_INVALID;
        }
     }
     
-    if(result == NOT_APPLICABLE)
+    if(cause == SUCCESSFUL)
     {
-       SchSendUeDeleteRspToMac(inst, ueDelete, RSP_OK, result);
+       SchSendUeDeleteRspToMac(inst, ueDelete, RSP_OK, cause);
     }
     else
     {
-       SchSendUeDeleteRspToMac(inst, ueDelete, RSP_NOK, result);
+       SchSendUeDeleteRspToMac(inst, ueDelete, RSP_NOK, cause);
        ret = RFAILED;
     }
     return ret;
index 4c0a55a..22b7ac9 100644 (file)
    _isLcidValid = ((_lcId >= SRB0_LCID && _lcId <= MAX_DRB_LCID) ? 1 : 0);\
 }
 
+typedef enum
+{
+   SUCCESSFUL, 
+   CELLID_INVALID, 
+   UEID_INVALID, 
+   RESOURCE_UNAVAILABLE,  
+   SLICE_NOT_FOUND,
+}CauseOfResult ;
+
 typedef enum
 {
    UE_CFG_INACTIVE,
    UE_CFG_INPROGRESS,
    UE_CREATE_COMPLETE,
    UE_DELETE_COMPLETE,
-   UE_RECFG_COMPLETE
+   UE_RECFG_COMPLETE,
+   UE_RESET_COMPLETE
 }UeCfgState;
 
 typedef enum
index c72636c..d5735c8 100644 (file)
@@ -1959,6 +1959,225 @@ uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf)
    return RFAILED;
 }
 
+/*******************************************************************
+*
+* @brief Packs and Sends UE Reset Request from DUAPP to MAC
+*
+* @details
+*
+*    Function : packDuMacUeResetReq
+*
+*    Functionality:
+*       Packs and Sends UE Reset Request from DUAPP to MAC
+*
+*
+* @params[in] Post structure pointer
+*             MacUeResetReq pointer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t packDuMacUeResetReq(Pst *pst, MacUeResetReq *ueDel)
+{
+    Buffer *mBuf = NULLP;
+
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+       {
+          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeResetReq");
+          return RFAILED;
+       }
+       /* pack the address of the structure */
+       CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
+    }
+    else
+    {
+       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeResetReq");
+       return RFAILED;
+    }
+    return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks UE Reset Request received from DU APP
+*
+* @details
+*
+*    Function : unpackMacUeResetReq 
+*
+*    Functionality:
+*         Unpacks UE Reset Request received from DU APP
+*
+* @params[in] Pointer to Handler
+*             Post structure pointer
+*             Message Buffer
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackMacUeResetReq(DuMacUeResetReq func, Pst *pst, Buffer *mBuf)
+{
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       MacUeResetReq *ueReset;
+
+       /* unpack the address of the structure */
+       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueReset, mBuf);
+       ODU_PUT_MSG_BUF(mBuf);
+       return (*func)(pst, ueReset);
+    }
+    else
+    {
+       /* Nothing to do for other selectors */
+       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for UE Reset Request ");
+       ODU_PUT_MSG_BUF(mBuf);
+    }
+
+    return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and send UE reset response from MAC to DU APP
+ *
+ * @details
+ *
+ *    Function : packDuMacUeResetRsp
+ *
+ *    Functionality:
+ *       Pack and send UE  reset response from MAC to DU APP
+ *
+ * @params[in]
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp)
+{
+   Buffer *mBuf = NULLP;
+   
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeResetRsp");
+         return RFAILED;
+      }
+      /* pack the address of the structure */
+      CMCHKPK(oduPackPointer,(PTR)resetRsp, mBuf);
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeResetRsp");
+      return RFAILED;
+   }
+   
+   return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpack UE Config Response from MAC to DU APP
+*
+* @details
+*
+*    Function :unpackDuMacUeResetRsp 
+*
+*    Functionality: Unpack UE Config Response from MAC to DU APP
+*
+* @params[in]
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf)
+{
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       MacUeResetRsp *ueResetRsp = NULLP;
+
+       /* unpack the address of the structure */
+       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueResetRsp, mBuf);
+       ODU_PUT_MSG_BUF(mBuf);
+       return (*func)(pst, ueResetRsp);
+    }
+
+    ODU_PUT_MSG_BUF(mBuf);
+    return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Pack and send UE Sync Status Indication from MAC to DU APP
+ *
+ * @details
+ *
+ *    Function : packDuMacUeSyncStatusInd
+ *
+ *    Functionality:
+ *       Pack and send UE Sync Status Indication from MAC to DU APP
+ *
+ * @params[in]
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *SyncStatusInd)
+{
+   Buffer *mBuf = NULLP;
+   
+   if(pst->selector == ODU_SELECTOR_LWLC)
+   {
+      if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+      {
+         DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeSyncStatusInd");
+         return RFAILED;
+      }
+      /* pack the address of the structure */
+      CMCHKPK(oduPackPointer,(PTR)SyncStatusInd, mBuf);
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeSyncStatusInd");
+      return RFAILED;
+   }
+   
+   return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpack UE Config Response from MAC to DU APP
+*
+* @details
+*
+*    Function :unpackDuMacUeSyncStatusInd 
+*
+*    Functionality: Unpack UE Config Response from MAC to DU APP
+*
+* @params[in]
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf)
+{
+    if(pst->selector == ODU_SELECTOR_LWLC)
+    {
+       MacUeSyncStatusInd *ueSyncStatusInd = NULLP;
+
+       /* unpack the address of the structure */
+       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueSyncStatusInd, mBuf);
+       ODU_PUT_MSG_BUF(mBuf);
+       return (*func)(pst, ueSyncStatusInd);
+    }
+
+    ODU_PUT_MSG_BUF(mBuf);
+    return RFAILED;
+}
+
 /*******************************************************************
  *
  * @brief Searches for first unset bit in ueBitMap
index 8d29801..af3b622 100644 (file)
@@ -84,6 +84,9 @@
 #define EVENT_MAC_RACH_RESOURCE_RSP  222
 #define EVENT_MAC_RACH_RESOURCE_REL  223
 #define EVENT_MAC_DL_PCCH_IND        224
+#define EVENT_MAC_UE_RESET_REQ       225
+#define EVENT_MAC_UE_RESET_RSP       226
+#define EVENT_MAC_UE_SYNC_STATUS_IND 227
 
 #define BSR_PERIODIC_TIMER_SF_10 10
 #define BSR_RETX_TIMER_SF_320 320
@@ -100,22 +103,10 @@ typedef enum
 
 typedef enum
 {
-   SLICE_PRESENT,
-   SLICE_NOT_PRESENT
-}RspReason;
-
-typedef enum
-{
-   DEL_SUCCESSFUL,
-   CELLID_INVALID,
-   UEID_INVALID
-}UeDeleteStatus;
-
-typedef enum
-{
-   SUCCESSFUL_RSP,
-   CELL_ID_INVALID
-}CellDeleteStatus;
+   IN_SYNC,
+   OUT_OF_SYNC,
+   OUT_OF_SUNC_MAX_RETRIES
+}SyncStatus;
 
 typedef enum
 {
@@ -518,15 +509,15 @@ typedef enum
    RESTART_TRANSMISSION
 }DataTransmissionAction;
 
-typedef struct failureCause
+typedef struct failureCause 
 {
    CauseGrp   type;
    union
    {
-      RadioNwLyrCause   radioNwCause;
-      TransLyrCause     transportCause;
-      ProtCause         protcolCause;
-      MiscFailCause     miscCause;
+      RadioNwLyrCause   radioNwResult;
+      TransLyrCause     transportResult;
+      ProtCause         protcolResult;
+      MiscFailCause     miscResult;
    }u;
 }FailureCause;
 
@@ -560,6 +551,14 @@ typedef enum
    CELL_ACTIVE,
 }MacCellState;
 
+/*Spec Ref: 38.331: RadioLinkMonitoringConfig*/
+typedef enum
+{
+   BeamFailure,
+   Rlf,
+   Both
+}PurposeOfFailureDet;
+
 typedef struct plmnInfoList
 {
    Plmn           plmn;
@@ -992,15 +991,51 @@ typedef struct initialDlBwp
    PdschConfig   pdschCfg;
 }InitialDlBwp;
 
-/* BWP Downlink common */
-typedef struct bwpDlCommon
+/*Spec 38.331 "SPS-Config'*/
+typedef struct spsConfig
+{
+   uint16_t     periodicity;
+   uint8_t      numOfHqProcess;
+   uint8_t      n1PucchAN;
+   McsTable     mcsTable;
+}SpsConfig;
+
+typedef uint8_t RadioLinkMonitoringRsId;
+
+typedef struct radioLinkMonRS
+{
+   RadioLinkMonitoringRsId radioLinkMonitoringRsId;
+   PurposeOfFailureDet      purpose; 
+   union
+   {
+      uint8_t ssbIndx;
+      uint8_t nzpCsiRsResId;
+   }detectionRes;
+}RadioLinkMonRS;
+
+typedef struct radioLinkConfig
 {
-}BwpDlCommon;
+   RadioLinkMonRS             failurDetResAddModList[1];
+   RadioLinkMonitoringRsId   failurDetResRelList[1];
+   uint8_t                    beamFailureInstanceMaxCount;
+   uint8_t                    beamFailureDetectionTimer;
+}RadioLinkConfig;
+
+/* Spec 38.331, 'BWP-DownlinkDedicated'*/
+typedef struct bwpDlCfgDed
+{
+  PdcchConfig     pdcchCfgDed;
+  PdschConfig     pdschCfgDed;
+  SpsConfig       spsCfgDed;
+  RadioLinkConfig radioLnkMonCfgDed;
+}BwpDlCfgDed;
 
 /* Downlink BWP information */
 typedef struct dlBwpInfo
 {
    uint8_t          bwpId;
+   BwpDlConfig      bwpCommon;
+   BwpDlCfgDed      bwpDedicated;
 }DlBwpInfo;
 
 /* PDCCH Serving Cell configuration */
@@ -1214,26 +1249,88 @@ typedef struct initialUlBwp
    PuschCfg   puschCfg;
 }InitialUlBwp;
 
+typedef struct bwpUlCfgDed
+{
+   PucchCfg   pucchCfg;
+   PuschCfg   puschCfg;
+}BwpUlCfgDed;
+
 /* Uplink BWP information */
 typedef struct ulBwpInfo
 {
-   uint8_t        bwpId;
+   uint8_t          bwpId;
+   BwpUlConfig      bwpCommon;
+   BwpUlCfgDed      bwpDed;
 }UlBwpInfo;
 
+typedef struct rachCfgGeneric
+{
+   uint8_t      prachCfgIdx;       /* PRACH config idx */
+   uint8_t      msg1Fdm;           /* PRACH FDM (1,2,4,8) */
+   uint16_t     msg1FreqStart;     /* Msg1-FrequencyStart */
+   uint8_t      zeroCorrZoneCfg;   /* Zero correlation zone cofig */
+   int16_t      preambleRcvdTargetPower; /*Prach Target power received*/
+   uint8_t      preambleTransMax;  /*Preamble Transmission Max power*/
+   uint8_t      pwrRampingStep;    /*Power Ramping Step*/
+   uint8_t      raRspWindow;       /* RA Response Window */
+}RachCfgGeneric;
+
+typedef struct raPrioritization
+{
+   uint8_t powerRampingStepHighPriority;
+   uint8_t scalingFactorBI;
+}RaPrioritization;
+
+typedef struct bfrCsiRsRes
+{
+   uint8_t csrRsIndex;
+   uint8_t raOccList;
+   uint8_t raPreambleIndex;
+}BfrCsiRsRes;
+
+typedef struct bfrSsbRes
+{
+   uint16_t ssbIndex;
+   uint8_t raPreambleIndex;
+}BfrSsbRes;
+
+typedef struct prachResDedBfr
+{
+   BfrSsbRes    ssb;
+   BfrCsiRsRes  csiRs;
+}PrachResDedBfr;
+
+/*Spec 38.331 'BeamFailureRecoveryConfig' */
+typedef struct beamFailRecoveryCfg
+{
+   uint8_t             rootSeqIndexBfr;
+   RachCfgGeneric      rachCfgBfr;
+   uint8_t             rsrpThreshSsbBfr;
+   PrachResDedBfr      candidteBeamRSList;
+   uint8_t             ssbPerachBfr;
+   uint8_t             raSsbOccMaskIndex;
+   uint8_t             recoverySearchSpaceId;
+   RaPrioritization    raPrioBfr;
+   uint16_t            bfrTimer;
+   uint8_t             msg1SubcSpacing;
+}BeamFailRecoveryCfg;
+
 /* Serving cell configuration */
 typedef struct servCellCfgInfo
 {
-   InitialDlBwp       initDlBwp;
-   uint8_t            numDlBwpToAdd;
-   DlBwpInfo          dlBwpToAddList[MAX_NUM_BWP];
-   uint8_t            firstActvDlBwpId;
-   uint8_t            defaultDlBwpId;
-   uint8_t            *bwpInactivityTmr;
-   PdschServCellCfg   pdschServCellCfg;
-   InitialUlBwp       initUlBwp;
-   uint8_t            numUlBwpToAdd;
-   UlBwpInfo          ulBwpToAddList[MAX_NUM_BWP];
-   uint8_t            firstActvUlBwpId;
+   InitialDlBwp         initDlBwp;
+   RadioLinkConfig      radioLinkMonConfig;
+   uint8_t              numDlBwpToAdd;
+   DlBwpInfo            dlBwpToAddList[MAX_NUM_BWP];
+   uint8_t              firstActvDlBwpId;
+   uint8_t              defaultDlBwpId;
+   uint8_t              *bwpInactivityTmr;
+   PdschServCellCfg     pdschServCellCfg;
+   InitialUlBwp         initUlBwp;
+   BeamFailRecoveryCfg  beamFailureRecoveryCfg;
+   uint8_t              numUlBwpToAdd;
+   UlBwpInfo            ulBwpToAddList[MAX_NUM_BWP];
+   uint8_t              firstActvUlBwpId;
 }ServCellCfgInfo;
 
 /* Special cell configuration */
@@ -1243,14 +1340,20 @@ typedef struct spCellCfg
    ServCellCfgInfo   servCellCfg;
 }SpCellCfg;
 
+typedef struct bwpRelInfo
+{
+   uint8_t bwpId;
+}BwpRelInfo;
+
 /* Serving cell Re-configuration */
 typedef struct servCellRecfgInfo
 {
    InitialDlBwp       initDlBwp;
+   RadioLinkConfig    radioLinkMonConfig;
    uint8_t            numDlBwpToAddOrMod;
    DlBwpInfo          dlBwpToAddOrModList[MAX_NUM_BWP];
    uint8_t            numDlBwpToRel;
-   DlBwpInfo          dlBwpToRelList[MAX_NUM_BWP];
+   BwpRelInfo         dlBwpToRelList[MAX_NUM_BWP];
    uint8_t            firstActvDlBwpId;
    uint8_t            defaultDlBwpId;
    uint8_t            *bwpInactivityTmr;
@@ -1259,7 +1362,7 @@ typedef struct servCellRecfgInfo
    uint8_t            numUlBwpToAddOrMod;
    UlBwpInfo          ulBwpToAddOrModList[MAX_NUM_BWP];
    uint8_t            numUlBwpToRel;
-   UlBwpInfo          ulBwpToRelList[MAX_NUM_BWP];
+   BwpRelInfo         ulBwpToRelList[MAX_NUM_BWP];
    uint8_t            firstActvUlBwpId;
 }ServCellRecfgInfo;
 
@@ -1359,6 +1462,7 @@ typedef struct macUeCfg
 {
    uint16_t               cellId;
    uint8_t                ueId;
+   uint8_t                beamIdx; 
    uint16_t               crnti;
    bool                   macCellGrpCfgPres;
    MacCellGrpCfg          macCellGrpCfg;
@@ -1489,7 +1593,7 @@ typedef struct ueDeleteRsp
 {
    uint16_t cellId;
    uint8_t  ueId;
-   UeDeleteStatus result;
+   CauseOfResult  status;
 }MacUeDeleteRsp;
 
 typedef struct macCellDeleteReq
@@ -1500,15 +1604,15 @@ typedef struct macCellDeleteReq
 typedef struct macCellDeleteRsp
 {
    uint16_t cellId;
-   CellDeleteStatus result;
+   CauseOfResult  status;
 }MacCellDeleteRsp;
 
-typedef struct macSliceRsp
+typedef struct macSliceCfgRsp 
 {
    Snssai     snssai;
    MacRsp     rsp;
-   RspReason  cause;  
-}MacSliceRsp;
+   CauseOfResult  cause;  
+}MacSliceCfgRsp;
 
 typedef struct rrmPolicyRatio
 {
@@ -1537,12 +1641,6 @@ typedef struct macSliceCfgReq
    MacSliceRrmPolicy **listOfRrmPolicy;
 }MacSliceCfgReq;
 
-typedef struct macSliceCfgRsp
-{
-   uint8_t      numSliceCfgRsp;
-   MacSliceRsp  **listOfSliceCfgRsp;
-}MacSliceCfgRsp;
-
 /*As per ORAN-WG8, Slice Cfg and ReCfg are same structures*/
 typedef struct macSliceCfgReq MacSliceRecfgReq;
 typedef struct macSliceCfgRsp MacSliceRecfgRsp;
@@ -1565,6 +1663,26 @@ typedef struct cellInfo
 typedef struct cellInfo CellStartInfo;
 typedef struct cellInfo CellStopInfo;
 
+typedef struct ueReset
+{
+    uint16_t cellId;
+    uint8_t  ueId;
+}MacUeResetReq;
+
+typedef struct ueResetRsp
+{
+   uint16_t cellId;
+   uint8_t  ueId;
+   CauseOfResult  status;
+}MacUeResetRsp;
+
+typedef struct ueSyncStatusInd
+{
+   uint16_t   cellId;
+   uint8_t    ueId;
+   SyncStatus status;
+}MacUeSyncStatusInd;
+
 /* Functions for CellUp Ind from MAC to DU APP*/
 typedef uint8_t (*DuMacCellUpInd) ARGS((
         Pst       *pst,
@@ -1697,6 +1815,21 @@ typedef uint8_t (*DuMacDlPcchInd) ARGS((
      Pst        *pst,
      DlPcchInd *pcchInd));
 
+/* UE Reset Request from DU APP to MAC*/
+typedef uint8_t (*DuMacUeResetReq) ARGS((
+     Pst           *pst,
+     MacUeResetReq *ueReset ));
+
+/* UE Reset Response from MAC to DU APP*/
+typedef uint8_t (*MacDuUeResetRspFunc) ARGS((
+     Pst            *pst,
+     MacUeResetRsp *resetRsp));
+
+/* UE sync status indication from MAC to DU APP*/
+typedef uint8_t (*MacDuUeSyncStatusIndFunc) ARGS((
+        Pst            *pst,
+        MacUeSyncStatusInd *syncStatusInd));
+
 uint64_t ueBitMapPerCell[MAX_NUM_CELL]; /* Bit Map to store used/free UE-IDX per Cell */
 
 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
@@ -1777,6 +1910,15 @@ uint8_t MacProcDlPcchInd(Pst *pst, DlPcchInd *pcchInd);
 uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf);
 int8_t getFreeBitFromUeBitMap(uint16_t cellId);
 void unsetBitInUeBitMap(uint16_t cellId, uint8_t bitPos);
+uint8_t packDuMacUeResetReq(Pst *pst, MacUeResetReq *ueReset);
+uint8_t MacProcUeResetReq(Pst *pst,  MacUeResetReq *ueReset);
+uint8_t unpackMacUeResetReq(DuMacUeResetReq func, Pst *pst, Buffer *mBuf);
+uint8_t packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
+uint8_t DuProcMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp);
+uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf);
+uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
+uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd);
+uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf);
 #endif
 
 
index 62ea905..44687a4 100644 (file)
@@ -92,13 +92,6 @@ typedef enum
    RLC_CFG_REAS_INVALID_RGUSAP     /*!< Invalid RGU SAP ID */
 }FailureReason;
 
-typedef enum
-{
-   SUCCESSFUL            ,  /*!< No Failure */
-   INVALID_CELLID      ,  /*!< CellId not present */
-   INVALID_UEID        ,  /*!< UEId not present */
-}UeDeleteResult;
-
 typedef enum
 {
    RLC_AM,                    //Acknowledged Mode
@@ -235,7 +228,7 @@ typedef struct rlcUeDeleteRsp
 {
    uint16_t       cellId;
    uint8_t        ueId;
-   UeDeleteResult result;
+   CauseOfResult  status;
 }RlcUeDeleteRsp;
 
 /* UL RRC Message from RLC to DU APP */
index 48f44b4..88b347e 100644 (file)
@@ -48,6 +48,9 @@
 #define EVENT_DL_PAGING_ALLOC        29
 #define EVENT_DL_REL_HQ_PROC         30 
 #define EVENT_DL_HARQ_IND_TO_SCH     31
+#define EVENT_DL_CQI_TO_SCH          32
+#define EVENT_UL_CQI_TO_SCH          33
+#define EVENT_PHR_IND_TO_SCH         34
 /*macros*/
 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
 #define SCH_SSB_MASK_SIZE   1
 #define MAX_PLMN 2
 #define DL_DMRS_SYMBOL_POS 4 /* Bitmap value 00000000000100 i.e. using 3rd symbol for PDSCH DMRS */
 
+#define MAX_PHR_REPORT 1 /*TODO: Range of PHR reports in multiple PHR.*/
+#define MAX_FAILURE_DET_RESOURCES 10 /*Spec 38.331 'maxNrofFailureDetectionResources'*/
+
 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr, numOfSlot)          \
 {                                                          \
    if ((crntTime.slot + incr) > (numOfSlot - 1))           \
@@ -133,12 +139,6 @@ typedef enum
    RRC_CONNECTED_USERS_RSRC
 }SchResourceType;
 
-typedef enum
-{
-   SLICE_FOUND,
-   SLICE_NOT_FOUND
-}RspCause;
-
 typedef enum
 {
    NO_TRANSMISSION,
@@ -146,14 +146,6 @@ typedef enum
    REPEATITION 
 }PduTxOccsaion;
 
-typedef enum
-{
-   UNSPECIFIED_CAUSE,
-   INVALID_PARAM_VALUE,
-   RESOURCE_UNAVAILABLE,
-   SYSTEM_ERROR
-}SchFailureCause;
-
 typedef enum
 {
    SR_PROHIBIT_MS1,
@@ -166,13 +158,6 @@ typedef enum
    SR_PROHIBIT_MS128
 }SchSrProhibitTimer;
 
-typedef enum
-{
-   NOT_APPLICABLE,
-   INVALID_CELLID,
-   INVALID_UEID
-}ErrorCause;
-
 typedef enum
 {
    SR_TRANS_MAX_N4,
@@ -408,6 +393,18 @@ typedef enum
    LONG_TRUNCATED_BSR
 }BsrType;
 
+typedef enum
+{
+   SINGLE_ENTRY_PHR,
+   MULTIPLE_ENTRY_PHR
+}PhrType;
+
+typedef enum
+{
+  PH_TYPE_1,
+  PH_TYPE_2
+}PhType;
+
 typedef enum
 {
    FORMAT0_0,
@@ -438,6 +435,19 @@ typedef enum
    RESTART_DATA_TRANSMISSION
 }SchDataTransmission;
 
+typedef enum
+{
+   SchBeamFailure,
+   SchRlf,
+   SchBoth
+}SchPurposeOfFailureDet;
+
+typedef enum
+{
+   CQI_PUCCH = 1,
+   CQI_PUSCH
+}CqiUlReportType;
+
 /*structures*/
 typedef struct timeDomainAlloc
 {
@@ -864,7 +874,7 @@ typedef struct schUlCfgCommon
    uint16_t          schTimeAlignTimer;
 }SchUlCfgCommon;
 
-/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.3.2.1*/
+/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.2.1 Cell Conf Request*/
 typedef struct schCellCfg
 {
    uint16_t        cellId;                 /* Cell Id */
@@ -896,13 +906,60 @@ typedef struct schCellCfg
    uint16_t            sib1PduLen;
 }SchCellCfg;
 
+/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.3.1 Cell Config Response*/
 typedef struct schCellCfgCfm
 {
    uint16_t         cellId;     /* Cell Id */
    SchMacRsp        rsp;   
-   SchFailureCause  cause;
+   CauseOfResult    cause;
 }SchCellCfgCfm;
 
+/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.2.2 Cell Del Req*/
+typedef struct schCellDeleteReq 
+{
+   uint16_t   cellId;
+}SchCellDeleteReq;
+
+/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.3.2 Cell Del Response*/
+typedef struct schCellDeleteRsp
+{
+   uint16_t        cellId;
+   SchMacRsp       rsp;
+   CauseOfResult   cause;
+}SchCellDeleteRsp;
+
+/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.2.3*/
+typedef struct schRrmPolicyRatio
+{
+   uint8_t maxRatio;
+   uint8_t minRatio;
+   uint8_t dedicatedRatio;
+}SchRrmPolicyRatio;
+
+typedef struct schRrmPolicyOfSlice
+{
+   Snssai  snssai;
+   SchRrmPolicyRatio rrmPolicyRatioInfo;
+}SchRrmPolicyOfSlice;
+
+typedef struct schSliceCfgReq
+{
+   uint8_t  numOfConfiguredSlice;
+   SchRrmPolicyOfSlice **listOfSlices;
+}SchSliceCfgReq;
+
+/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.3.3 Slice Cfg Response*/
+typedef struct schSliceCfgRsp
+{
+   Snssai     snssai;
+   SchMacRsp  rsp;
+   CauseOfResult cause;
+}SchSliceCfgRsp;
+
+/*As per ORAN-WG8 V7.0.0 Sec 11.2.4.3.4 , Slice Cfg and Recfg are same structures*/
+typedef struct schSliceCfgReq SchSliceRecfgReq;
+typedef struct schSliceCfgRsp SchSliceRecfgRsp;
+
 typedef struct ssbInfo
 {
    uint8_t         ssbIdx;          /* SSB Index */
@@ -1128,7 +1185,7 @@ typedef struct dlSchedInfo
 
 }DlSchedInfo;
 
-/*Reference: O-RAN.WG8.AAD.v7.0.0, Sec 11.2.3.3.13 Downlink Paging Allocation*/
+/*Reference: O-RAN.WG8.AAD.v7.0.0, Sec 11.2.4.3.13 Downlink Paging Allocation*/
 typedef struct interleaved_t
 {
    uint8_t regBundleSize;
@@ -1283,6 +1340,7 @@ typedef struct schPuschUci
    CsiInfo          csiInfo;    /* Csi information*/
 }SchPuschUci;
 
+/* Reference -> O-RAN.WG8.AAD.0-v07.00, Section 11.2.4.3.9 UL Scheduling Information */
 typedef struct ulSchedInfo
 {
    uint16_t         cellId;         /* Cell Id */
@@ -1295,42 +1353,6 @@ typedef struct ulSchedInfo
    SchPucchInfo     schPucchInfo;   /* Pucch and Uci scheduling info */
 }UlSchedInfo;
 
-typedef struct rachIndInfo
-{
-   uint16_t    cellId;
-   uint16_t    crnti;
-   SlotTimingInfo timingInfo;
-   uint8_t     slotIdx;
-   uint8_t     symbolIdx;
-   uint8_t     freqIdx;
-   uint8_t     preambleIdx;
-   uint16_t    timingAdv;
-}RachIndInfo;
-
-
-typedef struct crcIndInfo
-{
-   uint16_t    cellId;
-   uint16_t    crnti;
-   SlotTimingInfo timingInfo;
-   uint16_t    numCrcInd;
-   uint8_t     crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
-}CrcIndInfo;
-
-typedef struct boInfo
-{
-   uint8_t   lcId;
-   uint32_t  dataVolume;
-}BOInfo;
-
-typedef struct dlRlcBOInfo
-{
-   uint16_t    cellId;
-   uint16_t    crnti;
-   uint8_t     lcId;
-   uint32_t    dataVolume;
-}DlRlcBoInfo;
-
 /* Info of Scheduling Request to Add/Modify */
 typedef struct schSchedReqInfo
 {
@@ -1484,19 +1506,54 @@ typedef struct schInitalDlBwp
    SchPdcchConfig   pdcchCfg;
    bool             pdschCfgPres;
    SchPdschConfig   pdschCfg;
-   bool             k0K1TblPrsnt;
-   SchK0K1TimingInfoTbl k0K1InfoTbl;
 }SchInitalDlBwp;
 
-/* BWP Downlink common */
-typedef struct schBwpDlCommon
+/*Spec 38.331 'RadioLinkMonitoringConfig'*/
+typedef uint8_t SchRadioLinkMonitoringRsId;
+
+typedef struct schRadioLinkMonRS
+{
+   SchRadioLinkMonitoringRsId  radioLinkMonitoringRsId;
+   SchPurposeOfFailureDet      purpose; 
+   union
+   {
+      uint8_t ssbIndx;
+      uint8_t nzpCsiRsResId;
+   }SchDetectionRes;
+}SchRadioLinkMonRS;
+
+typedef struct schRadioLinkConfig
+{
+   SchRadioLinkMonRS           failurDetResAddModList[MAX_FAILURE_DET_RESOURCES];
+   SchRadioLinkMonitoringRsId  failurDetResRelList[MAX_FAILURE_DET_RESOURCES];
+   uint8_t                     beamFailureInstanceMaxCount;
+   uint8_t                     beamFailureDetectionTimer;
+}SchRadioLinkConfig;
+
+/*Spec 38.331 "SPS-Config'*/
+typedef struct schSpsConfig
+{
+   uint16_t     periodicity;
+   uint8_t      numOfHqProcess;
+   uint8_t      n1PucchAN;
+   SchMcsTable  mcsTable;
+}SchSpsConfig;
+
+/* Spec 38.331, 'BWP-DownlinkDedicated'*/
+typedef struct schBwpDlCfgDed
 {
-}SchBwpDlCommon;
+  SchPdcchConfig     pdcchCfgDed;
+  SchPdschConfig     pdschCfgDed;
+  SchSpsConfig       spsCfgDed;
+  SchRadioLinkConfig radioLnkMonCfgDed;
+}SchBwpDlCfgDed;
 
-/* Downlink BWP information */
+/* Spec 38.331, 'BWP-Downlink' Downlink BWP information */
 typedef struct schDlBwpInfo
 {
    uint8_t          bwpId;
+   SchBwpDlCfg      bwpCommon;
+   SchBwpDlCfgDed   bwpDedicated;
 }SchDlBwpInfo;
 
 /* PDCCH Serving Cell configuration */
@@ -1509,6 +1566,46 @@ typedef struct schPdschServCellCfg
    SchPdschXOverhead        *xOverhead;
 }SchPdschServCellCfg;
 
+typedef struct schRaPrioritization
+{
+   uint8_t powerRampingStepHighPriority;
+   uint8_t scalingFactorBI;
+}SchRaPrioritization;
+
+typedef struct schBfrCsiRsRes
+{
+   uint8_t csrRsIndex;
+   uint8_t raOccList;
+   uint8_t raPreambleIndex;
+}SchBfrCsiRsRes;
+
+typedef struct schBfrSsbRes
+{
+   uint16_t ssbIndex;
+   uint8_t raPreambleIndex;
+}SchBfrSsbRes;
+
+typedef struct schPrachResDedBfr
+{
+   SchBfrSsbRes    ssb;
+   SchBfrCsiRsRes  csiRs;
+}SchPrachResDedBfr;
+
+/*Spec 38.331 'BeamFailureRecoveryConfig' */
+typedef struct schBeamFailRecoveryCfg
+{
+   uint8_t             rootSeqIndexBfr;
+   SchRachCfgGeneric   rachCfgBfr;
+   uint8_t             rsrpThreshSsbBfr;     /* RSRP Threshold SSB */
+   SchPrachResDedBfr   candidateBeamRSList;
+   uint8_t             ssbPerRachBfr;        /* SSB per RACH occassion */
+   uint8_t             raSsbOccMaskIndex;
+   uint8_t             recoverySearchSpaceId;
+   SchRaPrioritization raPrioBfr;
+   uint16_t            bfrTimer;
+   uint8_t             msg1SubcSpacing;  /* Subcarrier spacing of RACH */
+}SchBeamFailRecoveryCfg;
+
 /* PUCCH Configuration */
 typedef struct schPucchResrcSetInfo
 {
@@ -1697,50 +1794,65 @@ typedef struct schInitialUlBwp
    SchPucchCfg   pucchCfg;
    bool          puschCfgPres;
    SchPuschCfg   puschCfg;
-   bool          k2TblPrsnt;
-   SchK2TimingInfoTbl k2InfoTbl;
 }SchInitialUlBwp;
 
+typedef struct schBwpCfgDedicated
+{
+   SchPucchCfg   pucchCfg;
+   SchPuschCfg   puschCfg;
+}SchBwpCfgDedicated;
+
 /* Uplink BWP information */
 typedef struct schUlBwpInfo
 {
-   uint8_t        bwpId;
+   uint8_t             bwpId;
+   SchBwpUlCfg         bwpCommon;
+   SchBwpCfgDedicated  bwpDed;
 }SchUlBwpInfo;
 
+typedef struct schBwpRelInfo
+{
+   uint8_t bwpId;
+}SchBwpRelInfo;
+
 /* Serving cell configuration */
 typedef struct schServCellRecfgInfo
 {
-   SchInitalDlBwp        initDlBwp;
-   uint8_t               numDlBwpToAddOrMod;
-   SchDlBwpInfo          dlBwpToAddOrModList[MAX_NUM_BWP];
-   uint8_t               numDlBwpToRel;
-   SchDlBwpInfo          dlBwpToRelList[MAX_NUM_BWP];
-   uint8_t               firstActvDlBwpId;
-   uint8_t               defaultDlBwpId;
-   uint8_t               *bwpInactivityTmr;
-   SchPdschServCellCfg   pdschServCellCfg;
-   SchInitialUlBwp       initUlBwp;
-   uint8_t               numUlBwpToAddOrMod;
-   SchUlBwpInfo          ulBwpToAddOrModList[MAX_NUM_BWP];
-   uint8_t               numUlBwpToRel;
-   SchUlBwpInfo          ulBwpToRelList[MAX_NUM_BWP];
-   uint8_t               firstActvUlBwpId;
+   SchInitalDlBwp          initDlBwp;
+   SchRadioLinkConfig      radioLinkMonConfig;
+   uint8_t                 numDlBwpToAddOrMod;
+   SchDlBwpInfo            dlBwpToAddOrModList[MAX_NUM_BWP];
+   uint8_t                 numDlBwpToRel;
+   SchBwpRelInfo           dlBwpToRelList[MAX_NUM_BWP];
+   uint8_t                 firstActvDlBwpId;
+   uint8_t                 defaultDlBwpId;
+   uint8_t                 *bwpInactivityTmr;
+   SchPdschServCellCfg     pdschServCellCfg;
+   SchInitialUlBwp         initUlBwp;
+   SchBeamFailRecoveryCfg  beamFailureRecoveryCfg;
+   uint8_t                 numUlBwpToAddOrMod;
+   SchUlBwpInfo            ulBwpToAddOrModList[MAX_NUM_BWP];
+   uint8_t                 numUlBwpToRel;
+   SchBwpRelInfo           ulBwpToRelList[MAX_NUM_BWP];
+   uint8_t                 firstActvUlBwpId;
 }SchServCellRecfgInfo;
 
 /* Serving cell configuration */
 typedef struct schServCellCfgInfo
 {
    SchInitalDlBwp        initDlBwp;
+   SchRadioLinkConfig    radioLinkMonConfig;
    uint8_t               numDlBwpToAdd;
    SchDlBwpInfo          dlBwpToAddList[MAX_NUM_BWP];
    uint8_t               firstActvDlBwpId;
    uint8_t               defaultDlBwpId;
    uint8_t               *bwpInactivityTmr;
-   SchPdschServCellCfg   pdschServCellCfg;
-   SchInitialUlBwp       initUlBwp;
-   uint8_t               numUlBwpToAdd;
-   SchUlBwpInfo          ulBwpToAddList[MAX_NUM_BWP];
-   uint8_t               firstActvUlBwpId;
+   SchPdschServCellCfg     pdschServCellCfg;
+   SchInitialUlBwp         initUlBwp;
+   SchBeamFailRecoveryCfg  beamFailureRecoveryCfg;
+   uint8_t                 numUlBwpToAdd;
+   SchUlBwpInfo            ulBwpToAddList[MAX_NUM_BWP];
+   uint8_t                 firstActvUlBwpId;
 }SchServCellCfgInfo;
 
 typedef struct schNonDynFiveQi
@@ -1846,18 +1958,18 @@ typedef struct schModulationInfo
    SchMcsTable  mcsTable;
 }SchModulationInfo;
 
-/* UE configuration */
+/*Spec O-RAN, WG8, V7.0.0, '11.2.4.2.5' UE Configuration Request*/
 typedef struct schUeCfgReq
 {
-   uint16_t        cellId;
-   uint8_t         ueId;
-   uint8_t         beamIdx; 
-   uint16_t        crnti;
-   bool macCellGrpCfgPres;
+   uint16_t           cellId;
+   uint8_t            ueId;
+   uint8_t            beamIdx; 
+   uint16_t           crnti;
+   bool               macCellGrpCfgPres;
    SchMacCellGrpCfg   macCellGrpCfg;
-   bool phyCellGrpCfgPres;
+   bool               phyCellGrpCfgPres;
    SchPhyCellGrpCfg   phyCellGrpCfg;
-   bool spCellCfgPres;
+   bool               spCellCfgPres;
    SchSpCellCfg       spCellCfg;
    SchAmbrCfg         *ambrCfg;
    SchModulationInfo  dlModInfo;
@@ -1866,7 +1978,7 @@ typedef struct schUeCfgReq
    SchLcCfg           schLcCfg[MAX_NUM_LC];
 }SchUeCfgReq;
 
-/* UE Re-configuration */
+/*Spec O-RAN, WG8, V7.0.0, '11.2.4.2.6' UE Reconfiguration Request*/
 typedef struct schUeRecfgReq
 {
    uint16_t         cellId;
@@ -1894,6 +2006,7 @@ typedef struct schUeRecfgReq
 #endif
 }SchUeRecfgReq;
 
+/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.3.5 UE Confg Response*/
 typedef struct schUeCfgRsp
 {
    uint16_t   cellId;
@@ -1901,12 +2014,108 @@ typedef struct schUeCfgRsp
    uint16_t   ueId;
    uint16_t   crnti;
    SchMacRsp  rsp;
-   SchFailureCause cause;
+   CauseOfResult cause;
 }SchUeCfgRsp;
 
-/*As per WG8, UE ReCFG and UECFG have same structure definition*/
+/*As per WG8 V7.0.0 Sec 11.2.4.3.6, UE ReCFG and UECFG have same structure definition*/
 typedef struct schUeCfgRsp SchUeRecfgRsp;
 
+/*Spec O-RAN, WG8, V7.0.0, '11.2.4.2.7' Delete UE Request*/
+typedef struct schUeDelete
+{
+   uint16_t   cellId;
+   uint16_t   crnti;
+}SchUeDelete;
+
+/*Ref: ORAN_WG8.V7.0.0 Sec 11.2.4.3.7*/
+typedef struct schUeDeleteRsp
+{
+   uint16_t   cellId;
+   uint16_t   crnti;
+   SchMacRsp  rsp;
+   CauseOfResult cause;
+}SchUeDeleteRsp;
+
+/*Spec O-RAN, WG8, V7.0.0, '11.2.4.2.8' DL HARQ Indication*/
+typedef struct dlHarqInd
+{
+   uint16_t       cellId;
+   uint16_t       crnti;
+   SlotTimingInfo slotInd;
+   uint8_t        numHarq;
+   uint8_t        harqPayload[MAX_HARQ_BITS_IN_BYTES];
+}DlHarqInd;
+
+/*Spec O-RAN, WG8, V7.0.0, '11.2.4.2.9' UL HARQ (CRC) Indication*/
+typedef struct crcIndInfo
+{
+   uint16_t       cellId;
+   uint16_t       crnti;
+   SlotTimingInfo timingInfo;
+   uint16_t       numCrcInd;
+   uint8_t        crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
+}CrcIndInfo;
+
+/*Spec O-RAN, WG8, V7.0.0, '11.2.4.2.10' UL Channel Quality Indication*/
+typedef struct ulCqiReport
+{
+   CqiUlReportType  reportType;
+   uint16_t ulCqi;
+   uint8_t  timingAdv;
+}UlCqiReport;
+
+typedef struct schUlCqiInd
+{
+   uint16_t       cellId;
+   uint16_t       crnti;
+   SlotTimingInfo timingInfo;
+   uint8_t        numUlCqiReported;
+   UlCqiReport    ulCqiRpt;
+}SchUlCqiInd;
+
+/*Spec O-RAN, WG8, V7.0.0, '11.2.4.2.11' DL Channel Quality Indication*/
+typedef struct dlCqiReport
+{
+   uint8_t  reportType; /*Bitmap for CQI, PMI, RI, CRI report*/
+   uint16_t cqi;
+   uint16_t pmi;
+   uint16_t cri;
+   uint16_t ri;
+}DlCqiReport;
+
+typedef struct schDlCqiInd
+{
+   uint16_t       cellId;
+   uint16_t       crnti;
+   SlotTimingInfo timingInfo;
+   uint8_t        numDlCqiReported;
+   DlCqiReport    dlCqiRpt;
+}SchDlCqiInd;
+
+/*Spec O-RAN WG8 v7.0.0, '11.2.4.2.12' Rach Ind contents*/
+typedef struct rachIndInfo
+{
+   uint16_t    cellId;
+   uint16_t    crnti;
+   SlotTimingInfo timingInfo;
+   uint8_t     slotIdx;
+   uint8_t     symbolIdx;
+   uint8_t     freqIdx;
+   uint8_t     preambleIdx;
+   uint16_t    timingAdv;
+}RachIndInfo;
+
+/*Spec O-RAN WG8 v7.0.0, '11.2.4.2.13' Paging Ind contents*/
+typedef struct schPageInd
+{
+   uint16_t  cellId;
+   uint16_t  pf;
+   uint8_t   i_s;
+   uint16_t  pduLen;
+   uint8_t  *pagePdu;
+}SchPageInd;
+
+/*ORAN WG8 v7.0.0, Sec 11.2.4.2.14 Rach Res Request*/
 typedef struct schRachRsrcReq
 {
    SlotTimingInfo slotInd;
@@ -1936,6 +2145,7 @@ typedef struct schRachRsrcRsp
    SchCfraResource  cfraResource;
 }SchRachRsrcRsp;
 
+/*ORAN WG8 v7.0.0, Sec 11.2.4.2.15 Rach Res Release*/
 typedef struct schRachRsrcRel
 {
    SlotTimingInfo slotInd;
@@ -1944,33 +2154,26 @@ typedef struct schRachRsrcRel
    SchCfraResource  cfraResource;
 }SchRachRsrcRel;
 
-typedef struct schUeDelete
-{
-   uint16_t   cellId;
-   uint16_t   crnti;
-}SchUeDelete;
-
-typedef struct schUeDeleteRsp
-{
-   uint16_t   cellId;
-   uint16_t   crnti;
-   SchMacRsp  rsp;
-   ErrorCause cause;
-}SchUeDeleteRsp;
-
-typedef struct schCellDeleteReq 
+/*O-RAN WG* v7.0.0 Sec 11.2.4.2.16 DL RLC Buffer Status Information*/
+typedef struct dlRlcBOInfo
 {
-   uint16_t   cellId;
-}SchCellDeleteReq;
-
+   uint16_t    cellId;
+   uint16_t    crnti;
+   uint8_t     lcId;
+   uint32_t    dataVolume;
+}DlRlcBoInfo;
 
-typedef struct schCellDeleteRsp
+/*O-RAN WG8 v7.0.0 Sec 11.2.4.2.17 Scheduling Request Indication*/
+typedef struct srUciIndInfo
 {
-   uint16_t        cellId;
-   SchMacRsp       rsp;
-   SchFailureCause cause;
-}SchCellDeleteRsp;
+   uint16_t    cellId;
+   uint16_t    crnti;
+   SlotTimingInfo slotInd;
+   uint8_t     numSrBits;
+   uint8_t     srPayload[MAX_SR_BITS_IN_BYTES];
+}SrUciIndInfo;
 
+/*O-RAN WG* v7.0.0 Sec 11.2.4.2.18 UL RLC Buffer Status Information*/
 typedef struct dataVolInfo
 {
    uint8_t  lcgId;
@@ -1986,68 +2189,41 @@ typedef struct ulBufferStatusRptInd
    DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
 }UlBufferStatusRptInd;
 
-typedef struct srUciIndInfo
+/**O-RAN WG* v7.0.0 Sec 11.2.4.2.19 Power Headroom Indication*/
+typedef struct phrData /*Spec 38.321 Sec 6.1.3.8*/
 {
-   uint16_t    cellId;
-   uint16_t    crnti;
-   SlotTimingInfo slotInd;
-   uint8_t     numSrBits;
-   uint8_t     srPayload[MAX_SR_BITS_IN_BYTES];
-}SrUciIndInfo;
+   uint8_t phr;
+   uint8_t pcmax_f_c;
+}PhrData;
 
-typedef struct dlHarqInd
+typedef struct singlePhrInfo
 {
-   uint16_t    cellId;
-   uint16_t    crnti;
-   SlotTimingInfo slotInd;
-   uint8_t     numHarq;
-   uint8_t     harqPayload[MAX_HARQ_BITS_IN_BYTES];
-}DlHarqInd;
+   PhrData  phrData;
+}SinglePhrInfo;
 
-typedef struct schRrmPolicyRatio
+typedef struct multiPhr
 {
-   uint8_t maxRatio;
-   uint8_t minRatio;
-   uint8_t dedicatedRatio;
-}SchRrmPolicyRatio;
+   PhType   phType;
+   PhrData  phrData;
+}MultiPhr;
 
-typedef struct schRrmPolicyOfSlice
+typedef struct multiplePhrInfo /*Spec 38.321 Sec 6.1.3.9*/
 {
-   Snssai  snssai;
-   SchRrmPolicyRatio rrmPolicyRatioInfo;
-}SchRrmPolicyOfSlice;
+   uint8_t  numPhrReported;
+   MultiPhr multiPhrStat[MAX_PHR_REPORT];
+}MultiplePhrInfo;
 
-typedef struct schSliceCfgReq
+typedef struct schPwrHeadroomInd
 {
-   uint8_t  numOfConfiguredSlice;
-   SchRrmPolicyOfSlice **listOfSlices;
-}SchSliceCfgReq;
-
-typedef struct sliceRsp
-{
-   Snssai     snssai;
-   SchMacRsp  rsp;
-   RspCause   cause;
-}SliceRsp;
-
-typedef struct schSliceCfgRsp
-{
-   uint8_t    numSliceCfgRsp;
-   SliceRsp   **listOfSliceCfgRsp;
-}SchSliceCfgRsp;
-
-/*As per ORAN-WG8, Slice Cfg and Recfg are same structures*/
-typedef struct schSliceCfgReq SchSliceRecfgReq;
-typedef struct schSliceCfgRsp SchSliceRecfgRsp;
-
-typedef struct schPageInd
-{
-   uint16_t  cellId;
-   uint16_t  pf;
-   uint8_t   i_s;
-   uint16_t  pduLen;
-   uint8_t  *pagePdu;
-}SchPageInd;
+   uint16_t    cellId;
+   uint16_t    crnti;
+   PhrType     phrType;
+   union
+   {
+      SinglePhrInfo   singlePhr;
+      MultiplePhrInfo multiPhr;
+   }phrInfo;
+}SchPwrHeadroomInd;
 
 typedef struct schUeHqInfo
 {
index 7af503f..191240f 100644 (file)
@@ -400,7 +400,7 @@ uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
 
    if(deleteRsp)
    {
-      if(deleteRsp->result == SUCCESSFUL_RSP)
+      if(deleteRsp->status == SUCCESSFUL)
       {
          GET_CELL_IDX(deleteRsp->cellId, cellIdx);
          DU_LOG("\nINFO   -->  DU APP : MAC CELL Delete Response : SUCCESS [CELL IDX : %d]", deleteRsp->cellId);
index 4cf1255..0cdc00d 100644 (file)
@@ -80,7 +80,8 @@ typedef enum
    UE_INACTIVE,
    UE_ACTIVE,
    UE_HANDIN_IN_PROGRESS,
-   UE_DELETION_IN_PROGRESS
+   UE_DELETION_IN_PROGRESS,
+   UE_RESET_IN_PROGRESS
 }UeState;
 
 typedef enum
index b5b5b49..2d650e4 100644 (file)
@@ -550,6 +550,11 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf)
                      ret = unpackDuMacSliceCfgRsp(DuProcMacSliceCfgRsp, pst, mBuf);
                      break;
                   }
+               case EVENT_MAC_UE_SYNC_STATUS_IND:
+                  {
+                     ret = unpackDuMacUeSyncStatusInd(DuProcMacUeSyncStatusInd, pst, mBuf);
+                     break;
+                                                                                                }
                case EVENT_MAC_SLICE_RECFG_RSP:
                   {
                      ret = unpackDuMacSliceRecfgRsp(DuProcMacSliceRecfgRsp, pst, mBuf);
@@ -560,6 +565,11 @@ uint8_t duActvTsk(Pst *pst, Buffer *mBuf)
                      ret = unpackDuMacRachRsrcRsp(DuProcMacRachRsrcRsp, pst, mBuf);
                      break;
                   }
+               case EVENT_MAC_UE_RESET_RSP:
+                  {
+                     ret = unpackDuMacUeResetRsp(DuProcMacUeResetRsp, pst, mBuf);
+                     break;
+                  }
                default:
                   {
                      DU_LOG("\nERROR  -->  DU_APP : Invalid event received at duActvTsk from ENTMAC");
index ca148c8..e5b2f79 100644 (file)
@@ -1861,40 +1861,6 @@ uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData)
    return ROK;
 }
 
-/*******************************************************************
- *
- * @brief  free the slice cfg rsp
- *
- * @details
- *
- *    Function : duFreeSliceCfgRsp 
- *
- *    Functionality: free the slice cfg rsp 
- *
- * @params[in] Post structure, MacSliceCfgRsp  *cfgRsp
- *             
- * @return ROK     - success
- *         RFAILED - failure
- *
- **********************************************************************/
-void duFreeSliceCfgRsp(Pst *pst,  MacSliceCfgRsp *cfgRsp) 
-{
-   uint8_t cfgIdx;
-
-   if(cfgRsp)
-   {
-      if(cfgRsp->numSliceCfgRsp)
-      {
-         for(cfgIdx = 0; cfgIdx<cfgRsp->numSliceCfgRsp; cfgIdx++)
-         {
-            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(MacSliceRsp)); 
-         }
-         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp->listOfSliceCfgRsp, cfgRsp->numSliceCfgRsp * sizeof(MacSliceRsp*)); 
-      }
-      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacSliceCfgRsp)); 
-   }
-}
-
 /*******************************************************************
  *
  * @brief process the slice cfg rsp received from MAC
@@ -1913,22 +1879,18 @@ void duFreeSliceCfgRsp(Pst *pst,  MacSliceCfgRsp *cfgRsp)
  **********************************************************************/
 uint8_t DuProcMacSliceCfgRsp(Pst *pst,  MacSliceCfgRsp *cfgRsp)
 {
-    uint8_t cfgIdx = 0;
-    
     if(cfgRsp)
     {
-        if(cfgRsp->listOfSliceCfgRsp)
-        {
-            for(cfgIdx = 0; cfgIdx<cfgRsp->numSliceCfgRsp; cfgIdx++)
-            {
-                if(cfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp ==  MAC_DU_APP_RSP_OK)
-                {
-                    duCb.sliceState = SLICE_CONFIGURED;
-                }
-            }
-            DU_LOG("\nINFO  -->  DU_APP : Slice Configuration is done successfully ");
-        }
-        duFreeSliceCfgRsp(pst, cfgRsp);
+       if(cfgRsp->rsp ==  MAC_DU_APP_RSP_OK)
+       {
+          duCb.sliceState = SLICE_CONFIGURED;
+          DU_LOG("\nINFO  -->  DU_APP : Slice configured successfully ");
+       }
+       else
+       {
+          DU_LOG("\nERROR  -->  DU_APP : Slice not available");
+       }
+       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacSliceCfgRsp));
     }
     return ROK;
 }
@@ -2038,28 +2000,20 @@ uint8_t BuildAndSendSliceRecfgReq()
  *         RFAILED - failure
  *
  **********************************************************************/
-uint8_t DuProcMacSliceRecfgRsp(Pst *pst,  MacSliceRecfgRsp *reCfgRsp)
+uint8_t DuProcMacSliceRecfgRsp(Pst *pst,  MacSliceRecfgRsp *recfgRsp)
 {
-   uint8_t cfgIdx = 0;
-
-   if(reCfgRsp)
+   if(recfgRsp)
    {
-      if(reCfgRsp->listOfSliceCfgRsp)
+      if(recfgRsp->rsp == MAC_DU_APP_RSP_OK)
       {
-         for(cfgIdx = 0; cfgIdx < reCfgRsp->numSliceCfgRsp; cfgIdx++)
-         {
-            if(reCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp == MAC_DU_APP_RSP_OK)
-            {
-               duCb.sliceState = SLICE_RECONFIGURED; 
-            }
-            else
-            {
-               DU_LOG("\nERROR  -->  DU_APP : Slice not available");
-            }
-         }
-         DU_LOG("\nINFO  --> DU_APP : Slice ReCOnfiguration response received");
+         duCb.sliceState = SLICE_RECONFIGURED; 
+          DU_LOG("\nINFO  -->  DU_APP : Slice Reconfigured successfully ");
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  DU_APP : Slice not available");
       }
-      duFreeSliceCfgRsp(pst, reCfgRsp);
+      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, recfgRsp, sizeof(MacSliceCfgRsp));
    }
    return ROK;
 }
index 974f6e6..f501127 100644 (file)
@@ -116,6 +116,12 @@ DuRlcUeDeleteReq packRlcUeDeleteReqOpts[] =
    packDuRlcUeDeleteReq        /* Light weight-loose coupling */
 };
 
+DuMacUeResetReq packMacUeResetReqOpts[] =
+{
+   packDuMacUeResetReq,       /* Loose coupling */
+   MacProcUeResetReq,         /* TIght coupling */
+   packDuMacUeResetReq        /* Light weight-loose coupling */
+};
 /******************************************************************
  *
  * @brief Function to return Drb LcId
@@ -3674,7 +3680,7 @@ uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
    
    if(deleteRsp)
    {
-      if(deleteRsp->result == DEL_SUCCESSFUL)
+      if(deleteRsp->status == SUCCESSFUL)
       {
          DU_LOG("\nINFO   -->  DU APP : MAC UE Delete Response : SUCCESS [UE IDX : %d]", deleteRsp->ueId);
          GET_CELL_IDX(deleteRsp->cellId, cellIdx);
@@ -3739,7 +3745,7 @@ uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp)
       ueId = delRsp->ueId;
       GET_CELL_IDX(delRsp->cellId, cellIdx);
 
-      if(delRsp->result == SUCCESSFUL)
+      if(delRsp->status == SUCCESSFUL)
       {
          DU_LOG("\nINFO   -->  DU_APP: RLC UE Delete Response : SUCCESS [UE IDX:%d]", ueId);
          if(duCb.actvCellLst[cellIdx]!=NULLP)
@@ -4019,6 +4025,218 @@ uint8_t duProcUeContextReleaseCommand(uint16_t cellId, DuUeCb *duUeCb)
    return ret;
 }
 
+/*******************************************************************
+ *
+ * @brief Sending UE Reset Req To Mac
+*
+* @details
+*
+*    Function : sendUeResetReqToMac
+*
+*    Functionality:
+*     sending UE Reset Req To Mac
+*
+*  @params[in]    cellId, ueId, crnti 
+*  @return ROK     - success
+*          RFAILED - failure
+*
+*****************************************************************/
+
+uint8_t sendUeResetReqToMac(uint16_t cellId, uint8_t ueId)
+{
+   Pst pst;
+   uint8_t ret=ROK;
+   MacUeResetReq *ueReset = NULLP;
+
+   DU_ALLOC_SHRABL_BUF(ueReset, sizeof(MacUeResetReq));
+   if(ueReset)
+   {
+      ueReset->cellId = cellId;
+      ueReset->ueId   = ueId;
+      FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_RESET_REQ);
+
+      DU_LOG("\nDEBUG  -->  DU_APP: Sending UE Reset Request to MAC ");
+      ret = (*packMacUeResetReqOpts[pst.selector])(&pst, ueReset);
+      if(ret == RFAILED)
+      {
+         DU_LOG("\nERROR  -->  DU_APP: sendUeResetReqToMac(): Failed to send UE Reset Req to MAC");
+         DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueReset, sizeof(MacUeResetReq));
+      }
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->   DU_APP: sendUeResetReqToMac(): Failed to allocate memory"); 
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief DU processes UE reset req  and send it to MAC
+ *
+ * @details
+ *
+ *    Function : duBuildAndSendUeResetReq
+ *
+ *    Functionality: DU processes UE reset req and send to MAC
+ *                   
+ *
+ * @params[in] cellId, crnti 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t duBuildAndSendUeResetReq(uint16_t cellId, uint16_t crnti)
+{
+   uint8_t  ueId =0;
+   uint16_t cellIdx = 0;
+
+   DU_LOG("\nDEBUG  -->  DU_APP : Building UE reset request");
+   GET_CELL_IDX(cellId, cellIdx);
+   GET_UE_ID(crnti, ueId);
+
+   if(duCb.actvCellLst[cellIdx] != NULLP)
+   {
+      if(crnti != duCb.actvCellLst[cellIdx]->ueCb[ueId - 1].crnti)
+      {
+         DU_LOG("\nERROR  -->  DU APP : duBuildAndSendUeResetReq(): CRNTI [%d] not found", crnti);
+         return RFAILED;
+      }
+
+      duCb.actvCellLst[cellIdx]->ueCb[ueId - 1].ueState = UE_RESET_IN_PROGRESS; 
+      if(sendUeResetReqToMac(cellId, ueId) == RFAILED)
+      {
+         DU_LOG("\nERROR  -->  DU APP : DuProcMacUeResetRsp(): Failed to build UE reset req for MAC ");
+         return RFAILED;
+      }
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  DU APP : duBuildAndSendUeResetReq(): Cell Id %d not found", cellId);
+      return RFAILED;
+   }
+
+   return ROK;
+}
+
+/*******************************************************************
+*
+* @brief Handle UE reset response from MAC
+*
+* @details
+*
+*    Function : DuProcMacUeResetRsp
+*
+*    Functionality: Handle UE reset response from MAC
+*
+* @params[in] Pointer to MacUeResetRsp and Pst
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t DuProcMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp)
+{
+   uint8_t  ret =ROK;
+   uint16_t cellIdx=0;
+   
+   if(resetRsp)
+   {
+      if(resetRsp->status == SUCCESSFUL)
+      {
+         DU_LOG("\nINFO   -->  DU APP : MAC UE Reset Response : SUCCESS [UE IDX : %d]", resetRsp->ueId);
+         GET_CELL_IDX(resetRsp->cellId, cellIdx);
+         if(duCb.actvCellLst[cellIdx])
+         {
+            duCb.actvCellLst[cellIdx]->ueCb[resetRsp->ueId -1].duMacUeCfg.macUeCfgState = UE_RESET_COMPLETE;
+            /*TODO - Complete the processing after receiving successfully reset rsp*/
+         }
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  DU APP : DuProcMacUeResetRsp(): MAC UE Reset Response : FAILURE [UE IDX : %d]",resetRsp->ueId);
+         ret =  RFAILED;
+      }
+      DU_FREE_SHRABL_BUF(pst->region, pst->pool, resetRsp, sizeof(MacUeResetRsp));
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  DU APP : DuProcMacUeResetRsp(): MAC UE Reset Response is null");
+      ret = RFAILED;
+   }
+   return ret;
+}
+
+/*******************************************************************
+*
+* @brief Handle UE sync status indication from MAC
+*
+* @details
+*
+*    Function : DuProcMacUeSyncStatusInd
+*
+*    Functionality: Handle UE sync status indication from MAC
+*
+* @params[in] Pointer to MacUeSyncStatusInd and Pst
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd)
+{
+   uint8_t  ret =RFAILED;
+   uint16_t cellIdx=0, crnti = 0;
+   char *status;
+
+   if(ueSyncStatusInd)
+   {
+      GET_CELL_IDX(ueSyncStatusInd->cellId, cellIdx);
+      if(duCb.actvCellLst[cellIdx])
+      {
+         GET_CRNTI(crnti, ueSyncStatusInd->ueId);
+         if(duCb.actvCellLst[cellIdx]->ueCb[ueSyncStatusInd->ueId-1].crnti == crnti)
+         {
+            switch(ueSyncStatusInd->status)
+            {
+               case IN_SYNC:
+                  status = "IN_SYNC";
+                  break;
+
+               case OUT_OF_SYNC:
+                  status = "OUT_OF_SYNC";
+                  break;
+
+               case OUT_OF_SUNC_MAX_RETRIES:
+                  status = "OUT_OF_SUNC_MAX_RETRIES";
+                  break;
+
+               default:
+                  status = "INVALID";
+                  break;
+                  
+            }
+            DU_LOG("\nINFO  -->   DU APP : MAC UE sync status for received UeId %d is %s", ueSyncStatusInd->ueId,status);
+         }
+         else
+         {
+            DU_LOG("\nERROR  -->  DU APP : DuProcMacUeSyncStatusInd(): MAC UE sync status indication : Ue Id [%d] not found",ueSyncStatusInd->cellId);
+         }
+      }
+      else
+      {
+         DU_LOG("\nERROR  -->  DU APP : DuProcMacUeSyncStatusInd(): MAC UE sync status indication : Cell Id [%d] not found",ueSyncStatusInd->cellId);
+      }
+      DU_FREE_SHRABL_BUF(pst->region, pst->pool, ueSyncStatusInd, sizeof(MacUeSyncStatusInd));
+   }
+   else
+   {
+      DU_LOG("\nERROR  -->  DU APP : DuProcMacUeSyncStatusInd(): MAC UE sync status indication is null");
+   }
+   return ret;
+}
 /**********************************************************************
   End of file
 ***********************************************************************/