[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-449] Fixes releate to Cell Id 84/8284/4
authorbarveankit <anbarve@radisys.com>
Mon, 16 May 2022 08:06:33 +0000 (13:36 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Mon, 16 May 2022 11:02:37 +0000 (16:32 +0530)
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Change-Id: I3dca21f74ce2f55c6d033ee2f9eac20cbdf62933
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
src/5gnrsch/sch.c
src/cu_stub/cu_f1ap_msg_hdl.c
src/du_app/du_cfg.h
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_msg_hdl.c
src/du_app/du_sys_info_hdl.c

index d561b1e..15d4dfd 100644 (file)
@@ -2158,7 +2158,7 @@ uint8_t schAddPagingIndtoList(CmLListCp *storedPageList,void * pageIndInfo)
    {
       cmLListAdd2Tail(storedPageList, currentNodeInfo);
    }
-   DU_LOG("\nINFO  -->  SCH : Paging information is stored sucessfully");
+   DU_LOG("\nINFO  -->  SCH : Paging information is stored successfully");
    return ROK;
 }
 
index 062dfa4..11607bf 100644 (file)
@@ -189,31 +189,6 @@ S16 SendF1APMsg(Region region, Pool pool, uint32_t duId)
    return ROK;
 } /* SendF1APMsg */
 
-/*******************************************************************
- *
- * @brief Builds NRCell ID 
- *
- * @details
- *
- *    Function : BuildNrCellId
- *
- *    Functionality: Building the NR Cell ID
- *
- * @params[in] BIT_STRING_t *nrcell
- * @return ROK     - success
- *         RFAILED - failure
- *
- * ****************************************************************/
-
-S16 BuildNrCellId(BIT_STRING_t *nrcell)
-{
-   memset(nrcell->buf, 0, nrcell->size);
-   nrcell->buf[4]   = 16; 
-   nrcell->bits_unused = 4;
-   nrcell->size = 5 * sizeof(uint8_t);
-   return ROK;
-}
-
 /********************************************************************
  *
  * @brief Builds and sends the F1SetupResponse
@@ -2006,9 +1981,10 @@ uint8_t extractDuToCuRrcCont(CuUeCb *ueCb, OCTET_STRING_t rrcCont)
 
 uint8_t procInitULRRCMsg(uint32_t duId, F1AP_PDU_t *f1apMsg)
 {
-   uint8_t idx,cellIdx=0, duIdx=0, rrcMsgType, gnbDuUeF1apId;
+   uint8_t idx = 0, duIdx=0, rrcMsgType=0, gnbDuUeF1apId=0;
    uint8_t ret =ROK;
-   uint32_t nrCellId, crnti;
+   uint16_t cellIdx=0, nrCellId = 0;
+   uint32_t crnti;
    DuDb     *duDb;
    CuCellCb *cellCb;
    CuUeCb   *ueCb;
@@ -2028,8 +2004,7 @@ uint8_t procInitULRRCMsg(uint32_t duId, F1AP_PDU_t *f1apMsg)
             break;
 
          case ProtocolIE_ID_id_NRCGI:
-            nrCellId = initULRRCMsg->protocolIEs.list.array[idx]->value.choice.NRCGI.nRCellIdentity.buf[4] >>
-               initULRRCMsg->protocolIEs.list.array[idx]->value.choice.NRCGI.nRCellIdentity.bits_unused;
+            bitStringToInt(&initULRRCMsg->protocolIEs.list.array[idx]->value.choice.NRCGI.nRCellIdentity, &nrCellId);
             SEARCH_CELL_DB(cellIdx, duDb, nrCellId, cellCb);
             if(cellCb == NULLP)
                return RFAILED;
@@ -11104,8 +11079,7 @@ uint8_t procGnbDuUpdate(uint32_t duId, F1AP_PDU_t *f1apMsg)
                struct Served_Cells_To_Delete_ItemIEs *deleteItemIe = \
                   (struct Served_Cells_To_Delete_ItemIEs *)duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
                   Served_Cells_To_Delete_List.list.array[0];
-               nrCellId = deleteItemIe->value.choice.Served_Cells_To_Delete_Item.oldNRCGI.nRCellIdentity.buf[4] >>\
-                  deleteItemIe->value.choice.Served_Cells_To_Delete_Item.oldNRCGI.nRCellIdentity.bits_unused;
+               bitStringToInt(&deleteItemIe->value.choice.Served_Cells_To_Delete_Item.oldNRCGI.nRCellIdentity, &nrCellId); 
                cellToBeDelete = true;
                break;
             }
@@ -11536,7 +11510,8 @@ void procF1SetupReq(uint32_t *destDuId, F1AP_PDU_t *f1apMsg)
                               srvCellItem =  &duServedCell->list.array[plmnidx]->value.choice.GNB_DU_Served_Cells_Item;
                               ret = procServedCellPlmnList(&srvCellItem->served_Cell_Information.servedPLMNs);
                               memcpy(&nrcellIdentity, &srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity, sizeof(BIT_STRING_t));
-
+                              
+                              /* TODO : Use bitStringToInt */
                               nrCellId = nrcellIdentity.buf[4] >> nrcellIdentity.bits_unused;
                               SEARCH_CELL_DB(cellIdx, duDb, nrCellId, cellCb);
                               if(cellCb == NULLP)
index 088ea6f..ff91158 100644 (file)
 #define SPARE 0
 #define SSB_SC_OFFSET 0
 #define DU_RANAC 1
-#define CELL_IDENTITY 16
+#define CELL_IDENTITY 1
 
 /* Macro definitions for DUtoCuRrcContainer */
 #define CELL_GRP_ID 0
index 66cbf48..dfcbb47 100644 (file)
@@ -362,30 +362,6 @@ uint8_t BuildDLNRInfo(NRFreqInfo_t *dlnrfreq)
    return ROK;
 }
 
-/*******************************************************************
- *
- * @brief Builds NRCell ID 
- *
- * @details
- *
- *    Function : BuildNrCellId
- *
- *    Functionality: Building the NR Cell ID
- *
- * @params[in] BIT_STRING_t *nrcell
- * @return ROK     - success
- *         RFAILED - failure
- *
- * ****************************************************************/
-
-S16 BuildNrCellId(BIT_STRING_t *nrcell)
-{
-   memset(nrcell->buf, 0, nrcell->size);
-   nrcell->buf[4]   = duCfgParam.sib1Params.cellIdentity; 
-   nrcell->bits_unused = 4;
-   return ROK;
-}
-
 /*******************************************************************
  *
  * @brief Builds Nrcgi 
@@ -425,7 +401,7 @@ uint8_t BuildNrcgi(NRCGI_t *nrcgi)
    {
       return RFAILED;
    }
-   BuildNrCellId(&nrcgi->nRCellIdentity);
+   fillBitString(&nrcgi->nRCellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity);
 
    return ROK;
 }
@@ -8037,11 +8013,46 @@ uint8_t FreeMemDuToCuRrcCont(CellGroupConfigRrc_t *cellGrpCfg)
                macLcConfig = rlcBearerList->list.array[idx]->mac_LogicalChannelConfig;
                if(rlcConfig)
                {
-                  if(rlcConfig->choice.am)
+                  switch(rlcConfig->present)
                   {
-                     DU_FREE(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
-                     DU_FREE(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t)); 
-                     DU_FREE(rlcConfig->choice.am, sizeof(struct RLC_Config__am));
+                     case RLC_Config_PR_am:
+                        {
+                           if(rlcConfig->choice.am)
+                           {
+                              DU_FREE(rlcConfig->choice.am->ul_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t));
+                              DU_FREE(rlcConfig->choice.am->dl_AM_RLC.sn_FieldLength, sizeof(SN_FieldLengthAM_t)); 
+                              DU_FREE(rlcConfig->choice.am, sizeof(struct RLC_Config__am));
+                           }
+                           break;
+                        }
+                     case RLC_Config_PR_um_Bi_Directional:
+                        {
+                           if(rlcConfig->choice.um_Bi_Directional)
+                           {
+                              DU_FREE(rlcConfig->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t)); 
+                              DU_FREE(rlcConfig->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+                              DU_FREE(rlcConfig->choice.um_Bi_Directional, sizeof(struct RLC_Config__um_Bi_Directional));
+                           }
+                           break;
+                        }
+                     case RLC_Config_PR_um_Uni_Directional_UL:
+                        {
+                           if(rlcConfig->choice.um_Uni_Directional_UL)
+                           {
+                              DU_FREE(rlcConfig->choice.um_Uni_Directional_UL->ul_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+                              DU_FREE(rlcConfig->choice.um_Uni_Directional_UL , sizeof(struct RLC_Config__um_Uni_Directional_UL));
+                           }
+                           break;
+                        }
+                     case RLC_Config_PR_um_Uni_Directional_DL:
+                        {
+                           if(rlcConfig->choice.um_Uni_Directional_DL )
+                           {
+                              DU_FREE(rlcConfig->choice.um_Uni_Directional_DL->dl_UM_RLC.sn_FieldLength, sizeof(SN_FieldLengthUM_t));
+                              DU_FREE(rlcConfig->choice.um_Uni_Directional_DL , sizeof(struct RLC_Config__um_Uni_Directional_DL));
+                           }
+                           break;
+                        }
                   }    
                   DU_FREE(rlcConfig, sizeof(struct RLC_Config));
                }
@@ -8091,6 +8102,7 @@ uint8_t FreeMemDuToCuRrcCont(CellGroupConfigRrc_t *cellGrpCfg)
       }
       if(macCellGrpCfg->bsr_Config)
       {
+         DU_FREE(macCellGrpCfg->bsr_Config->logicalChannelSR_DelayTimer, sizeof(long));
          DU_FREE(macCellGrpCfg->bsr_Config, sizeof(struct BSR_Config));
       }
       tagConfig = macCellGrpCfg->tag_Config;
@@ -15417,7 +15429,7 @@ uint8_t BuildAndSendUeContextModRsp(DuUeCb *ueCb)
       break;
    }
    FreeUeContextModResp(f1apMsg);
-   return ret;
+return ret;
 }
 /*******************************************************************
  *
index bb3c69c..72e5949 100644 (file)
@@ -1925,7 +1925,7 @@ uint8_t DuProcMacSliceCfgRsp(Pst *pst,  MacSliceCfgRsp *cfgRsp)
                     duCb.sliceState = SLICE_CONFIGURED;
                 }
             }
-            DU_LOG("\nINFO  -->  DU_APP : Slice Configuration is done sucessfully ");
+            DU_LOG("\nINFO  -->  DU_APP : Slice Configuration is done successfully ");
         }
         duFreeSliceCfgRsp(pst, cfgRsp);
     }
index 6644079..a53e162 100644 (file)
@@ -333,7 +333,6 @@ uint8_t BuildMibMsg()
 uint8_t BuildCellIdentity(CellIdentity_t  *cellIdentity)
 {
    cellIdentity->size = ODU_VALUE_FIVE*sizeof(uint8_t);
-   cellIdentity->bits_unused = ODU_VALUE_FOUR;
 
    DU_ALLOC(cellIdentity->buf, cellIdentity->size);
    if(!cellIdentity->buf)
@@ -341,8 +340,7 @@ uint8_t BuildCellIdentity(CellIdentity_t  *cellIdentity)
       DU_LOG("\nERROR  -->  DU APP: CellIdentity memory allocation failure");
       return RFAILED;
    }
-   memset(cellIdentity->buf, 0,  cellIdentity->size);
-   cellIdentity->buf[4] = duCfgParam.sib1Params.cellIdentity;
+   fillBitString(cellIdentity, ODU_VALUE_FOUR, ODU_VALUE_FIVE, duCfgParam.sib1Params.cellIdentity); 
 
    return ROK;
 }