X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_msg_hdl.c;h=fd1fe653a1a8a56e2c0b9e8b62c8ca3c5397eabc;hb=a71383f67779dcf9d67d15bf47949c7df9b5ddbb;hp=d236c9ac83ceef10a9139903b4b721a93bb092da;hpb=a31737d4988c5e02d4998c16973b1048fa2be9a4;p=o-du%2Fl2.git diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index d236c9ac8..fd1fe653a 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -36,7 +36,6 @@ #include "du_ue_mgr.h" #include "lsctp.h" #include "legtp.h" -#include "lphy_stub.h" #include "du_utils.h" #include "du_cell_mgr.h" @@ -63,6 +62,7 @@ uint8_t egtpHdlDatInd(EgtpMsg egtpMsg); uint8_t BuildAndSendDUConfigUpdate(); uint16_t getTransId(); uint8_t cmPkLrgSchCfgReq(Pst * pst,RgMngmt * cfg); +uint8_t sendCellDeleteReqToMac(uint16_t cellId); packMacCellCfgReq packMacCellCfgOpts[] = { @@ -330,7 +330,7 @@ uint8_t duBuildRlcUsapCfg(uint8_t elemId, Ent ent, Inst inst) uint8_t duProcCfgComplete() { uint8_t ret = ROK; - static uint16_t cellId = 0; + uint16_t cellId = 0; uint16_t idx; for(idx=0; idx< DEFAULT_CELLS; idx++) { @@ -352,7 +352,7 @@ uint8_t duProcCfgComplete() cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2; cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0; cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1; - cell->cellInfo.nrEcgi.cellId = NR_CELL_ID; + cell->cellInfo.nrEcgi.cellId = cell->cellId; cell->cellInfo.nrPci = NR_PCI; cell->cellInfo.fiveGsTac = DU_TAC; memset(&cell->cellInfo.plmn[idx1], 0, sizeof(Plmn)); @@ -367,7 +367,7 @@ uint8_t duProcCfgComplete() cell->cellInfo.maxUe = duCfgParam.maxUe; cell->cellStatus = CELL_OUT_OF_SERVICE; gCellStatus = CELL_DOWN; - + cell->gnbDuUeF1apIdGenerator = 0; duCb.cfgCellLst[duCb.numCfgCells] = cell; duCb.numCfgCells++; } @@ -1476,13 +1476,13 @@ uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) { if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId) { - duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP; + duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP; } } if(macCellCfgCfm->rsp == ROK) { /* Build and send GNB-DU config update */ - ret = BuildAndSendDUConfigUpdate(); + ret = BuildAndSendDUConfigUpdate(SERV_CELL_TO_MODIFY); /* Build and Send Cell Start Req to MAC */ ret = duBuildAndSendMacCellStart(); @@ -1578,7 +1578,7 @@ uint8_t duBuildAndSendMacCellStop(uint16_t cellId) DU_LOG("\nERROR --> DU APP : duBuildAndSendMacCellStop(): Memory allocation failed "); return RFAILED; } - + memset(oduCellId, 0, sizeof(OduCellId)); oduCellId->cellId = duCb.actvCellLst[cellIdx]->cellId; /* Fill Pst */ @@ -1622,10 +1622,16 @@ uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId) if(duGetCellCb(cellId->cellId, &cellCb) != ROK) return RFAILED; - if((cellCb->cellStatus == ACTIVATED)) + if((cellCb->cellStatus == ACTIVATED) || (cellCb->cellStatus == DELETION_IN_PROGRESS)) { DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is DOWN", cellId->cellId); - cellCb->cellStatus = DELETION_IN_PROGRESS; + if(sendCellDeleteReqToMac(cellId->cellId) == RFAILED) + { + DU_LOG("\nERROR --> DU APP : duHandleStopInd(): Failed to send Cell delete req to MAC for\ + cellId[%d]", cellId->cellId); + return RFAILED; + } + #ifdef O1_ENABLE DU_LOG("\nINFO --> DU APP : Raise cell down alarm for cell id=%d", cellId->cellId);