X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_cell_mgr.c;h=f5d0373ce8339e1e9f491261514848dd40ae5e53;hb=45d134510deb6902b870b4a0fb574b6075fba601;hp=4f4782267fae015f7b34fc8ed99df7d292172f6e;hpb=958e8b2edbd1e0681419ad86aa0775c88981282c;p=o-du%2Fl2.git diff --git a/src/du_app/du_cell_mgr.c b/src/du_app/du_cell_mgr.c index 4f4782267..f5d0373ce 100644 --- a/src/du_app/du_cell_mgr.c +++ b/src/du_app/du_cell_mgr.c @@ -16,14 +16,22 @@ ################################################################################ *******************************************************************************/ -/* This file contains message handling functionality for DU APP */ -#include "du_cell_mgr.h" +/* This file contains message handling functionality for DU cell management */ +#include "common_def.h" +#include "lrg.h" +#include "legtp.h" +#include "lrg.x" +#include "lkw.x" +#include "du_app_mac_inf.h" #include "du_cfg.h" +#include "E2AP-PDU.h" +#include +#include "F1AP-PDU.h" +#include "du_cell_mgr.h" +#include "odu_common_codec.h" extern DuCfgParams duCfgParam; - -extern S16 cmPkRgrCfgReq(Pst* pst, RgrCfgTransId transId, \ - RgrCfgReqInfo *cfgReqInfo); +extern S16 duBuildAndSendMacCellCfg(); /******************************************************************* * @@ -43,63 +51,53 @@ extern S16 cmPkRgrCfgReq(Pst* pst, RgrCfgTransId transId, \ * ****************************************************************/ S16 procCellsToBeActivated(Cells_to_be_Activated_List_t cellsToActivate) { - U16 idx; - S16 ret; + U16 idx = 0; + S16 ret = ROK; for(idx=0; idx\ value.choice.Cells_to_be_Activated_List_Item; bitStringToInt(&cell.nRCGI.nRCellIdentity, &nci); - if(cell.nRPCI) + if(nci <= 0 || nci > MAX_NUM_CELL) { - pci = *cell.nRPCI; + DU_LOG("\nDU APP : Invalid NCI %d", nci); + return RFAILED; } - if(ROK != (cmHashListFind(&(duCb.cellLst), (U8*) &nci, sizeof(nci), - 0, (PTR*)cellCb))) + + if(cell.nRPCI) { - return RFAILED; + pci = *cell.nRPCI; } + + cellCb = duCb.cfgCellLst[nci-1]; + if(!cellCb) { - DU_LOG("\nDU_APP : HashList Find failed for nci [%d]", nci); + DU_LOG("\nDU APP : No Cell found for NCI %d", nci); return RFAILED; } cellCb->cellStatus = ACTIVATION_IN_PROGRESS; cellCb->cellInfo.nrPci = pci; /* Now remove this cell from configured list and move to active list */ - ret = cmHashListDelete(&(duCb.actvCellLst), (PTR)(cellCb)); - if(ret != ROK) - { - DU_LOG("\nDU_APP : HashListInsert into ActvCellLst failed for [%d]", nci); - } - ret = cmHashListInsert(&(duCb.actvCellLst), (PTR)(cellCb), - (U8 *)&(nci), (U16) sizeof(nci)); - + duCb.cfgCellLst[nci-1] = NULL; + duCb.actvCellLst[nci-1] = cellCb; + duCb.numActvCells++; + /* Build and send Mac Cell Cfg for the number of active cells */ + ret = duBuildAndSendMacCellCfg(); if(ret != ROK) { - DU_LOG("\nDU_APP : HashListInsert into ActvCellLst failed for [%d]", nci); - break; - } - else - { - DU_LOG("\nDU_APP : HashListInsert into ActvCellLst successful for [%d]", nci); + DU_LOG("\nDU APP : macCellCfg build and send failed"); + return RFAILED; } } - - /* Start sending scheduler config */ - if(ret == ROK) - { - //TODO: uncomment later duSendSchGnbCfg(); - } - - return ROK; + return ret; } /****************************************************************** @@ -117,9 +115,9 @@ S16 procCellsToBeActivated(Cells_to_be_Activated_List_t cellsToActivate) * RFAILED - failure * * ****************************************************************/ -S16 procF1SetupRsp(F1AP_PDU_t *f1apMsg) +uint8_t procF1SetupRsp(F1AP_PDU_t *f1apMsg) { - S16 ret = ROK; + uint8_t ret = ROK; F1SetupResponse_t *f1SetRspMsg; F1SetupRsp f1SetRspDb; @@ -180,99 +178,39 @@ S16 procF1SetupRsp(F1AP_PDU_t *f1apMsg) SPutSBuf(DU_APP_MEM_REGION, DU_POOL,(Data *)&f1apMsg,(Size)sizeof(F1AP_PDU_t)); #endif - /* Build and send GNB-DU config update */ - ret = BuildAndSendDUConfigUpdate(); return ret; } -/****************************************************************** -* -* @brief Send gNB cfg to scheduler via MAC -* -* @details -* -* Function : duSendSchGnbCfg -* -* Functionality: Send gNB cfg to scheduler via MAC -* -* @return ROK - success -* RFAILED - failure -* -* ****************************************************************/ -S16 duSendSchGnbCfg() +/******************************************************************* + * + * @brief Processes GNB DU config update ack + * + * @details + * + * Function : procGNBDUCfgUpdAck + * + * Functionality: Processes GNB DU config update ack + * + * @params[in] F1AP_PDU_t ASN decoded F1AP message + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +S16 procGNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg) { - - RgrCfgReqInfo *cfgReq = NULLP; - MacSchedGnbCfg *cfg = NULLP; - U32 transId = 1; - - DU_ALLOC(cfgReq, sizeof(RgrCfgReqInfo)); - if( cfgReq == NULLP) - { - DU_LOG("\nDU_APP : Mem allocation failed in duSendSchGnbCfg"); - return RFAILED; - } - - cfgReq->action = SCH_CONFIG; - cfgReq->u.cfgInfo.cfgType = MAC_GNB_CFG; - cfg = &(cfgReq->u.cfgInfo.u.schedGnbCfg); - cfg->numTxAntPorts = duCfgParam.schedCfg.numTxAntPorts; - cfg->ulSchdType = duCfgParam.schedCfg.ulSchdType; - cfg->dlSchdType = duCfgParam.schedCfg.dlSchdType; - cfg->numCells = duCfgParam.schedCfg.numCells; - cfg->maxUlUePerTti = duCfgParam.schedCfg.maxUlUePerTti; - cfg->maxDlUePerTti = duCfgParam.schedCfg.maxDlUePerTti; - - if(ROK != duSendSchGnbCfgToMac(cfgReq, transId)) - { - return RFAILED; - } - - return ROK; + DU_LOG("\nF1AP : GNB-DU config update acknowledgment received"); +/* TODO :Check the deallocation */ +#if 0 + SPutSBuf(DU_APP_MEM_REGION,DU_POOL,(Data*)&(gNBDuCfgAck->protocolIEs.list.array),\ + (Size)elementCnt * sizeof(GNBDUConfigurationUpdateAcknowledgeIEs_t +)); + SPutSBuf(DU_APP_MEM_REGION,DU_POOL,(Data*)&(f1apMsg->choice.successfulOutcome),\ + (Size)sizeof(SuccessfulOutcome_t)); + SPutSBuf(DU_APP_MEM_REGION,DU_POOL,(Data*)&f1apMsg,(Size)sizeof(F1AP_PDU_t)); +#endif + return ROK; } -/****************************************************************** -* -* @brief Send gNB cfg to scheduler via MAC -* -* @details -* -* Function : duSendSchGnbCfgToMac -* -* Functionality: Send gNB cfg to scheduler via MAC -* -* @return ROK - success -* RFAILED - failure -* -* ****************************************************************/ -S16 duSendSchGnbCfgToMac(RgrCfgReqInfo *cfgReq, U32 trans_id) -{ - RgrCfgTransId transId; - Pst pst; - - DU_SET_ZERO(&pst, sizeof(Pst)); - DU_SET_ZERO(&transId, sizeof(RgrCfgTransId)); - - transId.trans[0] = MAC_GNB_CFG; - transId.trans[1] = cfgReq->action; - transId.trans[7] = trans_id & 0x000000ff; trans_id >>= 8; - transId.trans[6] = trans_id & 0x000000ff; trans_id >>= 8; - transId.trans[5] = trans_id & 0x000000ff; trans_id >>= 8; - transId.trans[4] = trans_id & 0x000000ff; trans_id >>= 8; - - pst.selector = DU_SELECTOR_LC; - pst.srcEnt = ENTDUAPP; - pst.dstEnt = ENTRG; - pst.dstInst = (Inst)0; - pst.dstProcId = DU_PROC; - pst.srcProcId = DU_PROC; - pst.region = duCb.init.region; - pst.event = (Event) EVTMACSCHCFGREQ; - - cmPkRgrCfgReq(&pst, transId, cfgReq); - - return ROK; -} /********************************************************************** End of file