From 4e2a29b15e4d8412c1af8d0ba9777be95ecc3ebb Mon Sep 17 00:00:00 2001 From: barveankit Date: Mon, 16 May 2022 13:36:33 +0530 Subject: [PATCH] [Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-449] Fixes releate to Cell Id Signed-off-by: lal.harshita Change-Id: I3dca21f74ce2f55c6d033ee2f9eac20cbdf62933 Signed-off-by: lal.harshita --- src/5gnrsch/sch.c | 2 +- src/cu_stub/cu_f1ap_msg_hdl.c | 39 +++++------------------ src/du_app/du_cfg.h | 2 +- src/du_app/du_f1ap_msg_hdl.c | 72 +++++++++++++++++++++++++------------------ src/du_app/du_msg_hdl.c | 2 +- src/du_app/du_sys_info_hdl.c | 4 +-- 6 files changed, 53 insertions(+), 68 deletions(-) diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index d561b1edd..15d4dfd08 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -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; } diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index 062dfa444..11607bf05 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -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) diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index 088ea6fb5..ff9115893 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -235,7 +235,7 @@ #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 diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 66cbf486b..dfcbb473b 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -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; } /******************************************************************* * diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index bb3c69c09..72e5949cc 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -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); } diff --git a/src/du_app/du_sys_info_hdl.c b/src/du_app/du_sys_info_hdl.c index 6644079e1..a53e16215 100644 --- a/src/du_app/du_sys_info_hdl.c +++ b/src/du_app/du_sys_info_hdl.c @@ -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; } -- 2.16.6