X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_msg_hdl.c;h=90fe20bfa9995ce927a7206c016088f03b99ea0e;hb=ba2574ac618b40905509604da8d3a2b1b9e39664;hp=98e24a0a34ecaef4c06709c6b965f035344a5dc1;hpb=d18338bde70b043c3dde28b7d88d128c0b138380;p=o-du%2Fl2.git diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index 98e24a0a3..90fe20bfa 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -40,6 +40,13 @@ #include "du_utils.h" #include "du_cell_mgr.h" +#ifdef O1_ENABLE + +#include "GlobalDefs.h" +#include "AlarmInterface.h" + +#endif + uint8_t rlcDlCfg = 0; uint8_t numRlcDlSaps = 0; uint8_t rlcUlCfg = 0; @@ -64,18 +71,18 @@ packMacCellCfgReq packMacCellCfgOpts[] = packMacCellCfg, /* packing for light weight loosly coupled */ }; -DuMacCellStartReq packMacCellStartReqOpts[] = +DuMacCellStart packMacCellStartOpts[] = { - packMacCellStartReq, /* Loose coupling */ - MacProcCellStartReq, /* TIght coupling */ - packMacCellStartReq /* Light weight-loose coupling */ + packMacCellStart, /* Loose coupling */ + MacProcCellStart, /* TIght coupling */ + packMacCellStart /* Light weight-loose coupling */ }; -DuMacCellStopReq packMacCellStopReqOpts[] = +DuMacCellStop packMacCellStopOpts[] = { - packMacCellStopReq, /* Loose coupling */ - MacProcCellStopReq, /* TIght coupling */ - packMacCellStopReq /* Light weight-loose coupling */ + packMacCellStop, /* Loose coupling */ + MacProcCellStop, /* TIght coupling */ + packMacCellStop /* Light weight-loose coupling */ }; /************************************************************************** @@ -336,7 +343,7 @@ uint8_t duProcCfgComplete() } else { - uint8_t idx1; + uint8_t idx1=0; memset(cell, 0, sizeof(DuCellCb)); cell->cellId = ++cellId; memset(&cell->cellInfo.nrEcgi.plmn, 0, sizeof(Plmn)); @@ -1171,10 +1178,8 @@ uint8_t duSendEgtpTnlMgmtReq(uint8_t action, uint32_t lclTeid, uint32_t remTeid) tnlEvt.remTeid = remTeid; DU_LOG("\nDU_APP : Sending EGTP tunnel management request"); - duFillEgtpPst(&pst, EVTTNLMGMTREQ); - packEgtpTnlMgmtReq(&pst, tnlEvt); - + egtpTnlMgmtReq(&pst, tnlEvt); return ROK; } @@ -1201,6 +1206,9 @@ uint8_t duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm) if(tnlEvtCfm.cfmStatus.status == LCM_PRIM_OK) { DU_LOG("\nDU_APP : Tunnel management confirm OK"); +#ifdef EGTP_TEST + duSendEgtpTestData(); +#endif } else { @@ -1211,6 +1219,21 @@ uint8_t duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm) return (ret); } +/******************************************************************* + * + * @brief Sends UL user data over to EGTP + * + * @details + * + * Function : duSendEgtpDatInd + * + * Functionality: Sends UL user data over to EGTP + * + * @params[in] UL data buffer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ uint8_t duSendEgtpDatInd(Buffer *mBuf) { EgtpMsg egtpMsg; @@ -1501,33 +1524,6 @@ uint8_t duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm) return ROK; } -/******************************************************************* - * - * @brief Sends Slot indication to EGTP - * - * @details - * - * Function : duSendEgtpSlotInd - * - * Functionality: - * Sends Slot indication to EGTP - * - * @params[in] - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -uint8_t duSendEgtpSlotInd() -{ - Pst pst; - - duFillEgtpPst(&pst, EVTSLOTIND); - packEgtpSlotInd(&pst); - - return ROK; - -} - /************************************************************************** * @brief Function to fill and send MacCellconfig * @@ -1600,7 +1596,7 @@ uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) ret = BuildAndSendDUConfigUpdate(); /* Build and Send Cell Start Req to MAC */ - ret = duBuildAndSendMacCellStartReq(); + ret = duBuildAndSendMacCellStart(); } else { @@ -1613,66 +1609,13 @@ uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) return ret; } -/******************************************************************* - * - * @brief Handles slot indication from MAC - * - * @details - * - * Function : duHandleSlotInd - * - * Functionality: - * Handles slot indication from MAC - * - * @params[in] Post structure pointer - * Slot Info pointer - * @return ROK - success - * RFAILED - failure - * - * ****************************************************************/ -uint8_t duHandleSlotInd(Pst *pst, SlotIndInfo *slotInfo) -{ - DuCellCb *cellCb = NULLP; - - if(slotInfo->cellId <=0 || slotInfo->cellId > MAX_NUM_CELL) - { - DU_LOG("\nDU APP : Invalid Cell Id %d", slotInfo->cellId); - return RFAILED; - } - - if(duGetCellCb(slotInfo->cellId, &cellCb) != ROK) - return RFAILED; - - if(!cellCb->firstSlotIndRcvd) - { - DU_LOG("\nDU APP : Slot Indication received"); - cellCb->firstSlotIndRcvd = true; - if((cellCb != NULL) && (cellCb->cellStatus == ACTIVATION_IN_PROGRESS)) - { - DU_LOG("\nDU APP : 5G-NR Cell %d is UP", slotInfo->cellId); - cellCb->cellStatus = ACTIVATED; - } - } - - /* TODO : Slot Indication to be moved out of EGTP_TEST when - * data path is established */ -#ifdef EGTP_TEST - duSendEgtpSlotInd(); -#endif - - if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC)) - DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, slotInfo, sizeof(SlotIndInfo)); - - return ROK; -} - /******************************************************************* * * @brief Builds and sends cell start request to MAC * * @details * - * Function : duBuildAndSendMacCellStartReq + * Function : duBuildAndSendMacCellStart * * Functionality: * Builds and sends cell start request to MAC @@ -1682,16 +1625,16 @@ uint8_t duHandleSlotInd(Pst *pst, SlotIndInfo *slotInfo) * RFAILED - failure * * ****************************************************************/ -uint8_t duBuildAndSendMacCellStartReq() +uint8_t duBuildAndSendMacCellStart() { Pst pst; - MacCellStartInfo *cellStartInfo = NULL; + OduCellId *cellId = NULL; DU_LOG("\nDU APP : Building and Sending cell start request to MAC"); /* Send Cell Start Request to MAC */ - DU_ALLOC_SHRABL_BUF(cellStartInfo, sizeof(MacCellStartInfo)); - if(!cellStartInfo) + DU_ALLOC_SHRABL_BUF(cellId, sizeof(OduCellId)); + if(!cellId) { DU_LOG("\nDU APP : Memory alloc failed while building cell start request"); return RFAILED; @@ -1701,13 +1644,12 @@ uint8_t duBuildAndSendMacCellStartReq() { if(duCb.actvCellLst[id]) { - duCb.actvCellLst[id]->firstSlotIndRcvd = FALSE; - cellStartInfo->cellId = duCb.actvCellLst[id]->cellId; + cellId->cellId = duCb.actvCellLst[id]->cellId; /* Fill Pst */ - FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_START_REQ); + FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_START); - return (*packMacCellStartReqOpts[pst.selector])(&pst, cellStartInfo); + return (*packMacCellStartOpts[pst.selector])(&pst, cellId); } } return ROK; @@ -1719,7 +1661,7 @@ uint8_t duBuildAndSendMacCellStartReq() * * @details * - * Function : duBuildAndSendMacCellStopReq + * Function : duBuildAndSendMacCellStop * * Functionality: * Builds and sends cell stop request to MAC @@ -1729,26 +1671,26 @@ uint8_t duBuildAndSendMacCellStartReq() * RFAILED - failure * * ****************************************************************/ -uint8_t duBuildAndSendMacCellStopReq() +uint8_t duBuildAndSendMacCellStop() { Pst pst; - MacCellStopInfo *cellStopInfo = NULL; + OduCellId *cellId = NULL; DU_LOG("\nDU APP : Building and Sending cell stop request to MAC"); /* Send Cell Stop Request to MAC */ - DU_ALLOC_SHRABL_BUF(cellStopInfo, sizeof(MacCellStopInfo)); - if(!cellStopInfo) + DU_ALLOC_SHRABL_BUF(cellId, sizeof(OduCellId)); + if(!cellId) { DU_LOG("\nDU APP : Memory alloc failed while building cell stop request"); return RFAILED; } - cellStopInfo->cellId = duCb.actvCellLst[0]->cellId; + cellId->cellId = duCb.actvCellLst[0]->cellId; /* Fill Pst */ - FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP_REQ); + FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP); - return (*packMacCellStopReqOpts[pst.selector])(&pst, cellStopInfo); + return (*packMacCellStopOpts[pst.selector])(&pst, cellId); } /******************************************************************* @@ -1767,34 +1709,35 @@ uint8_t duBuildAndSendMacCellStopReq() * RFAILED - failure * * ****************************************************************/ -uint8_t duHandleStopInd(Pst *pst, MacCellStopInfo *cellStopId) +uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId) { DuCellCb *cellCb = NULLP; - - if(cellStopId->cellId <=0 || cellStopId->cellId > MAX_NUM_CELL) + + if(cellId->cellId <=0 || cellId->cellId > MAX_NUM_CELL) { - DU_LOG("\nDU APP : Invalid Cell Id %d", cellStopId->cellId); + DU_LOG("\nDU APP : Invalid Cell Id %d in duHandleStopInd()", cellId->cellId); } - if(duGetCellCb(cellStopId->cellId, &cellCb) != ROK) + if(duGetCellCb(cellId->cellId, &cellCb) != ROK) return RFAILED; - if(cellCb->firstSlotIndRcvd) + if((cellCb->cellStatus == ACTIVATED)) { - cellCb->firstSlotIndRcvd = false; - if((cellCb->cellStatus == ACTIVATED)) - { - DU_LOG("\nDU APP : 5G-NR Cell %d is DOWN", cellStopId->cellId); - cellCb->cellStatus = DELETION_IN_PROGRESS; - } + DU_LOG("\nDU APP : 5G-NR Cell %d is DOWN", cellId->cellId); + cellCb->cellStatus = DELETION_IN_PROGRESS; + +#ifdef O1_ENABLE + DU_LOG("\nDU APP : Raise cell down alarm for cell id=%d", cellId->cellId); + raiseCellAlrm(CELL_DOWN_ALARM_ID, cellId->cellId); +#endif } + if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC)) - DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, cellStopId, sizeof(MacCellStopInfo)); + DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, cellId, sizeof(OduCellId)); cellCb->cellStatus = CELL_OUT_OF_SERVICE; //TODO: cell status must be set to OOS after all UE and cell cleanup which is not //supported now - return ROK; } @@ -1842,11 +1785,12 @@ uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo) uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo) { DuCellCb *cellCb = NULLP; - DuUeCb ueCb; + DuUeCb ueCb ={0}; if(duGetCellCb(ulRrcMsgInfo->cellId, &cellCb) != ROK) return RFAILED; - + if(ulRrcMsgInfo->ueIdx > 0) + { ueCb = cellCb->ueCb[ulRrcMsgInfo->ueIdx -1]; @@ -1855,6 +1799,7 @@ uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo) DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo->rrcMsg, ulRrcMsgInfo->msgLen); DU_FREE_SHRABL_BUF(pst->region, pst->pool, ulRrcMsgInfo, sizeof(RlcUlRrcMsgInfo)); + } return ROK; }