X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_cell_mgr.c;h=947014d2a5202054c75f0d89fca550fb90fbc1b0;hb=49856df248fd976b4a9882ca4e650fc0bc3e4ee3;hp=6182d6a86df345f92b86be2b37949d482d4651ee;hpb=45967e320fb5747a257af75f3d2f12c0aa9daee0;p=o-du%2Fl2.git diff --git a/src/du_app/du_cell_mgr.c b/src/du_app/du_cell_mgr.c index 6182d6a86..947014d2a 100644 --- a/src/du_app/du_cell_mgr.c +++ b/src/du_app/du_cell_mgr.c @@ -18,6 +18,7 @@ /* This file contains message handling functionality for DU cell management */ #include "common_def.h" +#include "du_tmr.h" #include "lrg.h" #include "legtp.h" #include "lrg.x" @@ -26,6 +27,7 @@ #include "rgr.x" #include "du_app_mac_inf.h" #include "du_app_rlc_inf.h" +#include "du_e2ap_mgr.h" #include "du_cfg.h" #include "du_mgr.h" #include "du_utils.h" @@ -46,6 +48,7 @@ #endif +GConfiguration gConfigInfo; DuMacCellDeleteReq packMacCellDeleteReqOpts[] = { packDuMacCellDeleteReq, /* Loose coupling */ @@ -60,6 +63,12 @@ DuMacDlPcchInd packMacDlPcchIndOpts[] = packDuMacDlPcchInd /* Light weight-loose coupling */ }; +DuMacDlBroadcastReq packMacDlBroadcastReqOpts[] = +{ + packDuMacDlBroadcastReq, /* Loose coupling */ + MacProcDlBroadcastReq, /* TIght coupling */ + packDuMacDlBroadcastReq /* Light weight-loose coupling */ +}; /******************************************************************* * * @brief Processes cells to be activated @@ -246,13 +255,13 @@ uint8_t checkPagingRecord(DuCellCb *cellCb) * * Functionality: Send pcch indication to MAC * - * @Params[in] MacPcchInd *pcchInd + * @Params[in] DlPcchInd *pcchInd * @return ROK - success * RFAILED - failure * * ****************************************************************/ -uint8_t sendDlPcchIndToMac(MacPcchInd *pcchInd) +uint8_t sendDlPcchIndToMac(DlPcchInd *pcchInd) { uint8_t ret = ROK; Pst pst; @@ -358,16 +367,17 @@ uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId) { DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is UP", cellId->cellId); cellCb->cellStatus = ACTIVATED; - gCellStatus = CELL_UP; + gConfigInfo.gCellStatus = CELL_UP; - if(duCfgParam.tempSliceCfg.rrmPolicy) - BuildAndSendSliceConfigReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy, duCfgParam.tempSliceCfg.totalSliceCount); + if(duCfgParam.tempSliceCfg.numOfRrmPolicy) + BuildAndSendSliceConfigReq(); #ifdef O1_ENABLE DU_LOG("\nINFO --> DU APP : Raise cell UP alarm for cell id=%d", cellId->cellId); raiseCellAlrm(CELL_UP_ALARM_ID, cellId->cellId); setCellOpState(cellId->cellId, ENABLED, ACTIVE); #endif - + duCfgParam.macCellCfg.cellCfg.opState = OP_ENABLED; + duCfgParam.macCellCfg.cellCfg.cellState = CELL_ACTIVE; } if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC)) @@ -399,7 +409,7 @@ uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp) if(deleteRsp) { - if(deleteRsp->result == SUCCESSFUL_RSP) + if(deleteRsp->status == SUCCESSFUL) { GET_CELL_IDX(deleteRsp->cellId, cellIdx); DU_LOG("\nINFO --> DU APP : MAC CELL Delete Response : SUCCESS [CELL IDX : %d]", deleteRsp->cellId); @@ -416,7 +426,7 @@ uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp) } memset(duCb.actvCellLst[cellIdx], 0, sizeof(DuCellCb)); - gCellStatus = CELL_DOWN; + gConfigInfo.gCellStatus = CELL_DOWN; #ifdef O1_ENABLE DU_LOG("\nINFO --> DU APP : Raise cell down alarm for cell id=%d", deleteRsp->cellId); @@ -427,7 +437,6 @@ uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp) duCb.numActvCells--; duCb.numCfgCells--; DU_FREE(duCb.actvCellLst[cellIdx], sizeof(DuCellCb)); - } else { @@ -473,9 +482,9 @@ uint8_t sendCellDeleteReqToMac(uint16_t cellId) { Pst pst; uint8_t ret=ROK; - MacCellDelete *cellDelete = NULLP; + MacCellDeleteReq *cellDelete = NULLP; - DU_ALLOC_SHRABL_BUF(cellDelete, sizeof(MacCellDelete)); + DU_ALLOC_SHRABL_BUF(cellDelete, sizeof(MacCellDeleteReq)); if(cellDelete) { cellDelete->cellId = cellId; @@ -487,7 +496,7 @@ uint8_t sendCellDeleteReqToMac(uint16_t cellId) if(ret == RFAILED) { DU_LOG("\nERROR --> DU APP : sendCellDeleteReqToMac(): Failed to send Cell delete Req to MAC"); - DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellDelete, sizeof(MacCellDelete)); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cellDelete, sizeof(MacCellDeleteReq)); } } else @@ -624,7 +633,7 @@ uint8_t BuildAndSendDlPcchIndToMac(uint16_t cellId, uint16_t pf, uint8_t i_s, Cm PCCH_Message_t *pcchMsg = NULLP; asn_enc_rval_t encRetVal; PagingRrc_t *pagingMsg = NULLP; - MacPcchInd *macPcchInd = NULLP; + DlPcchInd *macPcchInd = NULLP; uint8_t recordIdx = 0, ret = RFAILED; /*As per 38.473 Sec 9.3.1.39,5G-S-TMSI :48 Bits >> Bytes and 0 UnusedBits */ @@ -729,7 +738,7 @@ uint8_t BuildAndSendDlPcchIndToMac(uint16_t cellId, uint16_t pf, uint8_t i_s, Cm memset(encBuf, 0, ENC_BUF_MAX_LEN); encBufSize = 0; /* Encode the PCCH RRC PDU as APER */ - encRetVal = aper_encode(&asn_DEF_PCCH_Message, 0, pcchMsg, PrepFinalEncBuf,\ + encRetVal = uper_encode(&asn_DEF_PCCH_Message, 0, pcchMsg, PrepFinalEncBuf,\ encBuf); if(encRetVal.encoded == ENCODE_FAIL) @@ -742,7 +751,7 @@ uint8_t BuildAndSendDlPcchIndToMac(uint16_t cellId, uint16_t pf, uint8_t i_s, Cm { DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for RRC PDU for Pcch indication \n"); - DU_ALLOC_SHRABL_BUF(macPcchInd, sizeof(MacPcchInd)); + DU_ALLOC_SHRABL_BUF(macPcchInd, sizeof(DlPcchInd)); if(macPcchInd == NULLP) { DU_LOG("\nERROR --> DU APP: BuildAndSendDlPcchIndToMac(); (macPcchInd) Memory Alloction failed!"); @@ -764,7 +773,7 @@ uint8_t BuildAndSendDlPcchIndToMac(uint16_t cellId, uint16_t pf, uint8_t i_s, Cm if(ret != ROK) { DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, macPcchInd->pcchPdu, macPcchInd->pduLen); - DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, macPcchInd, sizeof(MacPcchInd)); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, macPcchInd, sizeof(DlPcchInd)); break; } } @@ -1061,6 +1070,56 @@ uint8_t processPagingMsg(uint16_t cellId, DuPagingMsg *rcvdF1apPagingParam) return ROK; } + +/******************************************************************* + * + * @brief DU build and send dl broacast req and send it to MAC + * + * @details + * + * Function : duBuildAndSendDlBroadcastReq + * + * Functionality: DU build and send dl broacast req and send to MAC + * + * + * @params[in] cellId, crnti + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ + +uint8_t duBuildAndSendDlBroadcastReq() +{ + Pst pst; + uint8_t ret =ROK; + MacDlBroadcastReq *dlBroadcast=NULLP; + + DU_LOG("\nDEBUG --> DU_APP : Building Dl broadcast request"); + + DU_ALLOC_SHRABL_BUF(dlBroadcast, sizeof(MacDlBroadcastReq)); + if(dlBroadcast) + { + /*TODO - fill MAC DL Broadcast Request*/ + + FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_DL_BROADCAST_REQ); + + DU_LOG("\nDEBUG --> DU_APP: Sending Dl broadcast Request to MAC "); + ret = (*packMacDlBroadcastReqOpts[pst.selector])(&pst, dlBroadcast); + if(ret == RFAILED) + { + DU_LOG("\nERROR --> DU_APP: sendDlBroadcastReqToMac(): Failed to send Dl broadcast Req to MAC"); + DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlBroadcast, sizeof(MacDlBroadcastReq)); + } + } + else + { + DU_LOG("\nERROR --> DU_APP: sendDlBroadcastReqToMac(): Failed to allocate memory"); + ret = RFAILED; + } + + return ret; +} + /********************************************************************** End of file **********************************************************************/