X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcu_stub%2Fcu_stub.c;h=7a622154f13fc8ddeb85ce990a6b03e010f64dbf;hb=4848b11c1cbfa7792e066cc31caeccb17a7bdb40;hp=1694a14dd5b0323cd8a92c07a4c25058c3df0ff4;hpb=8f9c36b26af6c88c2c7a9c0375e58e1723246090;p=o-du%2Fl2.git diff --git a/src/cu_stub/cu_stub.c b/src/cu_stub/cu_stub.c index 1694a14dd..7a622154f 100644 --- a/src/cu_stub/cu_stub.c +++ b/src/cu_stub/cu_stub.c @@ -33,60 +33,6 @@ extern StartupConfig g_cfg; #endif -/******************************************************************* - * - * @brief Fetches pointer to DU Database - * - * @details - * - * Function : getDuDb - * - * Functionality: - * Searches and returns pointer to DU structure based on DU Id - * - * @params[in] DU Id - * @return Pointer to DU Db - * - ******************************************************************/ -DuDb* getDuDb(uint32_t duId) -{ - uint8_t duIdx; - for(duIdx=0; duIdx < cuCb.numDu; duIdx++) - { - if(cuCb.duInfo[duIdx].duId == duId) - return (&cuCb.duInfo[duIdx]); - } - return NULLP; -} - -/******************************************************************* - * - * @brief Fetches pointer to Cell Cb - * - * @details - * - * Function : getCellCb - * - * Functionality: - * Searches for a cell within a DU based on NR cell Id - * Returns pointer to this cell Cb structure - * - * @params[in] Pointer to DU Db - * NR Cell ID - * @return Pointer to cell Cb - * - ******************************************************************/ -CuCellCb* getCellCb(DuDb *duDb, uint32_t cellId) -{ - uint8_t cellIdx; - for(cellIdx=0; cellIdx < duDb->numCells; cellIdx++) - { - if(duDb->cellCb[cellIdx].nrCellId == cellId) - return &(duDb->cellCb[cellIdx]); - } - return NULLP; -} - /******************************************************************* * * @brief Handles SCTP notification @@ -283,14 +229,15 @@ void readCuCfg() * ****************************************************************/ void initiateInterDuHandover(uint32_t sourceDuId, uint32_t targetDuId, uint32_t ueId) { + uint8_t duIdx = 0; DuDb *duDb = NULLP; CuUeCb *ueCb = NULLP; - - duDb = getDuDb(sourceDuId); + + SEARCH_DU_DB(duIdx, sourceDuId, duDb); if(duDb) ueCb = &duDb->ueCb[ueId-1]; if(ueCb) - ueCb->state = HANDOVER_IN_PROGRESS; + ueCb->state = UE_HANDOVER_IN_PROGRESS; DU_LOG("\nINFO --> CU_STUB: Inter-DU Handover Started for ueId [%d] from DU ID [%d] to DU ID [%d]", \ ueId, sourceDuId, targetDuId);