uint8_t duProcCfgComplete()
{
uint8_t ret = ROK;
- uint16_t cellId = 0;
uint16_t idx;
for(idx=0; idx< DEFAULT_CELLS; idx++)
{
{
uint8_t idx1=0;
memset(cell, 0, sizeof(DuCellCb));
- cell->cellId = ++cellId;
+ cell->cellId = NR_CELL_ID; //++cellId;
memset(&cell->cellInfo.nrEcgi.plmn, 0, sizeof(Plmn));
cell->cellInfo.nrEcgi.plmn.mcc[0] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mcc[0];
cell->cellInfo.nrEcgi.plmn.mcc[1] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mcc[1];
}
/* store the address in the duCellCb so that we can free on confirm msg */
- duCb.actvCellLst[cellId-1]->duMacCellCfg = duMacCellCfg;
+ if(duCb.actvCellLst[cellId-1])
+ duCb.actvCellLst[cellId-1]->duMacCellCfg = duMacCellCfg;
+ else
+ {
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, duMacCellCfg, sizeof(MacCellCfg));
+ return RFAILED;
+ }
/* copy the mac config structure from duCfgParams */
memcpy(duMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
for(actvCellIdx = 0; actvCellIdx < MAX_NUM_CELL; actvCellIdx++)
{
- if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
+ if((duCb.actvCellLst[actvCellIdx]) && (macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId))
{
duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP;
}
return RFAILED;
}
- for(uint8_t id = 0; id < duCb.numActvCells; id++)
+ for(uint8_t id = 0; id < MAX_NUM_CELL; id++)
{
if(duCb.actvCellLst[id])
{
- cellId->cellId = duCb.actvCellLst[id]->cellId;
+ cellId->cellId = duCb.actvCellLst[id]->cellId;
- /* Fill Pst */
- FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_START);
+ /* Fill Pst */
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_START);
- return (*packMacCellStartOpts[pst.selector])(&pst, cellId);
+ return (*packMacCellStartOpts[pst.selector])(&pst, cellId);
}
}
return ROK;
* ****************************************************************/
uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
{
+ uint8_t ret = ROK;
DuCellCb *cellCb = NULLP;
- DuUeCb ueCb ={0};
+ DuUeCb *ueCb = NULLP;
- if(duGetCellCb(ulRrcMsgInfo->cellId, &cellCb) != ROK)
- return RFAILED;
- if(ulRrcMsgInfo->ueId > 0)
+ duGetCellCb(ulRrcMsgInfo->cellId, &cellCb);
+ if(cellCb)
{
- ueCb = cellCb->ueCb[ulRrcMsgInfo->ueId -1];
+ if(ulRrcMsgInfo->ueId > 0)
+ {
+ if(cellCb->ueCb[ulRrcMsgInfo->ueId -1].gnbDuUeF1apId == ulRrcMsgInfo->ueId)
+ ueCb = &cellCb->ueCb[ulRrcMsgInfo->ueId -1];
+ if(ueCb)
+ {
+ /* If UL message is received for a UE in handover, it signifies that UE is now
+ * attached to GNB. Hence marking this UE as active and requesting MAC to
+ * release the dedicated RACH resources */
+ if(ueCb->ueState == UE_HANDIN_IN_PROGRESS)
+ {
+ ueCb->ueState = UE_ACTIVE;
+ cellCb->numActvUes++;
+
+ /* Release RACH resources */
+ memset(&ueCb->cfraResource, 0, sizeof(MacCfraResource));
+ if(duBuildAndSendRachRsrcRelToMac(ulRrcMsgInfo->cellId, ueCb) != ROK)
+ {
+ DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : Failed to send RACH resource release to MAC");
+ }
+ }
- BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, ulRrcMsgInfo->rrcMsg);
+ if(BuildAndSendULRRCMessageTransfer(ueCb, ulRrcMsgInfo->lcId, ulRrcMsgInfo->msgLen, ulRrcMsgInfo->rrcMsg) != ROK)
+ {
+ DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : Failed to build and send UL RRC Message Transfer");
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : UE ID [%d] not found", ulRrcMsgInfo->ueId);
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : Invalid UE ID [%d]", ulRrcMsgInfo->ueId);
+ ret = RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP : DuProcRlcUlRrcMsgTrans() : Cell ID [%d] not found", ulRrcMsgInfo->cellId);
+ ret = RFAILED;
+ }
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;
+ return ret;
}
/*******************************************************************
duCb.sliceState = SLICE_CONFIGURED;
}
}
- DU_LOG("\nINFO --> DU_APP : Slice Configuration is done sucessfully ");
+ DU_LOG("\nINFO --> DU_APP : Slice Configuration is done successfully ");
}
duFreeSliceCfgRsp(pst, cfgRsp);
}
for(sliceRecord = 0; sliceRecord < sliceStats->numSlice; sliceRecord++)
{
- DU_LOG("\nINFO --> DU_APP: SliceIndx:%d, DlTput %.5lf, UlTput:%.5lf", sliceStats->sliceRecord[sliceRecord].networkSliceIdentifier,\
- sliceStats->sliceRecord[sliceRecord].ThpDl, sliceStats->sliceRecord[sliceRecord].ThpUl);
+ DU_LOG("\nINFO --> DU_APP: SliceId[SST-SD]:%d-%d, DlTput %.5lf, UlTput:%.5lf", sliceStats->sliceRecord[sliceRecord].networkSliceIdentifier.sst,\
+ sliceStats->sliceRecord[sliceRecord].networkSliceIdentifier.sd,sliceStats->sliceRecord[sliceRecord].ThpDl,\
+ sliceStats->sliceRecord[sliceRecord].ThpUl);
}
#ifdef O1_ENABLE
if(sliceStats)