ret = duBuildAndSendDlCcchInd(&cellId, &crnti, RRC_SETUP, dlRrcMsg->rrcMsgSize, dlRrcMsg->rrcMsgPdu);
if(ret == RFAILED)
{
- DU_LOG("\nERROR --> DU APP : Failed to build DlCcch Ind at procDlRrcMsgTrans()");
+ DU_LOG("\nERROR --> DU APP : Failed to build DlCcch Ind at procDlRrcMsgTrans()");
}
else
{
- if(duCb.actvCellLst[cellId-1]->numActvUes < MAX_NUM_UE)
- {
- ret = duCreateUeCb(&duCb.ueCcchCtxt[ueIdx], dlRrcMsg->gnbCuUeF1apId);
- if(ret == RFAILED)
- {
- DU_LOG("\nERROR --> DU APP : Failed to createUeCb for cellId [%d] at procDlRrcMsgTrans()", \
- duCb.ueCcchCtxt[ueIdx].cellId);
- }
- }
- else
- {
- DU_LOG("\nERROR --> DU_APP: Max Active UEs has reached at procDlRrcMsgTrans()");
- ret = RFAILED;
- }
+ if(duCb.actvCellLst[cellId-1] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : cellId [%d] does not exist", cellId);
+ ret = RFAILED;
+ }
+
+ if(duCb.actvCellLst[cellId-1]->numActvUes < MAX_NUM_UE)
+ {
+ ret = duCreateUeCb(&duCb.ueCcchCtxt[ueIdx], dlRrcMsg->gnbCuUeF1apId);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to createUeCb for cellId [%d] at procDlRrcMsgTrans()", \
+ duCb.ueCcchCtxt[ueIdx].cellId);
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU_APP: Max Active UEs has reached at procDlRrcMsgTrans()");
+ ret = RFAILED;
+ }
}
}
else
{
for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
{
- for(ueIdx = 0 ; ueIdx < MAX_NUM_UE; ueIdx++)
- {
- if((dlRrcMsg->gnbCuUeF1apId == duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId)
- && (dlRrcMsg->gnbDuUeF1apId == duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId))
- {
- ueFound = true;
- ret = duBuildAndSendDlRrcMsgToRlc(duCb.actvCellLst[cellIdx]->cellId, \
- duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg, dlRrcMsg);
- break;
- }
- }
+ for(ueIdx = 0 ; ueIdx < MAX_NUM_UE; ueIdx++)
+ {
+ if(duCb.actvCellLst[cellIdx] && (dlRrcMsg->gnbCuUeF1apId == duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId)
+ && (dlRrcMsg->gnbDuUeF1apId == duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId))
+ {
+ ueFound = true;
+ ret = duBuildAndSendDlRrcMsgToRlc(duCb.actvCellLst[cellIdx]->cellId, \
+ duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg, dlRrcMsg);
+ break;
+ }
+ }
if(ueFound)
break;
}
GET_CELL_IDX(cellId, cellIdx);
if(duCb.actvCellLst[cellIdx])
{
- return ++duCb.actvCellLst[cellIdx]->gnbDuUeF1apIdGenerator;
+ return ++duCb.gnbDuUeF1apIdGenerator;
}
else
{
{
/* Fetching MacDb from DuUeCb */
GET_CELL_IDX(cellId, cellIdx);
- duMacDb = &duCb.actvCellLst[cellIdx]->ueCb[ueId-1].macUeCfg;
+ if(duCb.actvCellLst[cellIdx])
+ duMacDb = &duCb.actvCellLst[cellIdx]->ueCb[ueId-1].macUeCfg;
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Cell Id [%d] does not exist", cellId);
+ return RFAILED;
+ }
duMacDb->macUeCfgState = UE_CFG_INPROGRESS;
/* Fetching MaUeCfg List for ADD/MOD/DEL */
macUeCfg->cellId = cellId;
for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
{
- if(ueCcchCtxt->cellId == duCb.actvCellLst[cellIdx]->cellId)
+ if(duCb.actvCellLst[cellIdx] && (ueCcchCtxt->cellId == duCb.actvCellLst[cellIdx]->cellId))
{
GET_UE_ID(ueCcchCtxt->crnti, ueId);
DU_LOG("\nDEBUG --> DU_APP: Filling UeCb for ueId [%d]", ueId);
ret = ROK;
GET_CELL_IDX(macUeCfg->cellId, cellIdx);
+ if(duCb.actvCellLst[cellIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: CellId[%d] not found", macUeCfg->cellId);
+ return RFAILED;
+ }
oldMacUeCfg = &duCb.actvCellLst[cellIdx]->ueCb[macUeCfg->ueId-1].macUeCfg;
/*Filling Cell Group Cfg*/
GET_CELL_IDX(cellId, cellIdx);
- if((duCb.actvCellLst[cellIdx]->ueCb[ueId-1].macUeCfg. \
- macUeCfgState == UE_RECFG_COMPLETE) &&
- (duCb.actvCellLst[cellIdx]->ueCb[ueId-1].rlcUeCfg. \
- rlcUeCfgState == UE_RECFG_COMPLETE))
+ if(duCb.actvCellLst[cellIdx] && (duCb.actvCellLst[cellIdx]->ueCb[ueId-1].macUeCfg.macUeCfgState == UE_RECFG_COMPLETE) &&
+ (duCb.actvCellLst[cellIdx]->ueCb[ueId-1].rlcUeCfg.rlcUeCfgState == UE_RECFG_COMPLETE))
{
ueCb = &duCb.actvCellLst[cellIdx]->ueCb[ueId-1];
* Processes UE create Req to RLC UL
*
* @params[in] cellId,
- * ueIdx,
+ * ueId,
* Pointer to RlcUeCfg
* @return ROK - success
* RFAILED - failure
}
}
}
- else
+ else if(ueCb->f1UeDb->actionType == UE_CTXT_MOD)
{
ret = duBuildAndSendUeContextModReq(cellId, ueCb->crnti, &ueCb->f1UeDb->duUeCfg);
if(ret == RFAILED)
{
DU_LOG("\nERROR --> DU APP : Failed to build ue context setup Req in duProcUeContextModReq()");
+ return RFAILED;
+ }
+ }
+ else if(ueCb->f1UeDb->actionType == UE_CTXT_CFG_QUERY)
+ {
+ if((BuildAndSendUeContextModRsp(ueCb) != ROK))
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to build UE Context modification response");
+ return RFAILED;
}
}
}
else
{
//TODO: To send the failure cause in UeContextModRsp
+
DU_LOG("ERROR --> DU APP : Failed to process UE CNTXT MOD REQ at duProcUeContextModReq()");
+ return RFAILED;
}
return ROK;
}
* RFAILED - failure
*
* ****************************************************************/
-uint8_t duProcUeContextReleaseCommand(DuUeCb *duUeCb)
+uint8_t duProcUeContextReleaseCommand(uint16_t cellId, DuUeCb *duUeCb)
{
uint8_t ret =ROK, ueId=0;
- uint16_t cellId=0,crnti =0;
- if(duUeCb == NULLP)
- {
- DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : duUeCb is null");
- return RFAILED;
- }
- if(duUeCb->f1UeDb == NULLP)
- {
- DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : f1UeDb is null");
- return RFAILED;
- }
-
- cellId = duCb.actvCellLst[duUeCb->f1UeDb->cellIdx]->cellId;
- crnti = duUeCb->crnti;
- GET_UE_ID(crnti, ueId);
-
- /* Send DL RRC msg for RRC release */
- if(duUeCb->f1UeDb->dlRrcMsg)
+ uint16_t crnti = 0;
+
+ if(duUeCb != NULLP)
{
- if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu != NULLP)
+ crnti = duUeCb->crnti;
+ GET_UE_ID(crnti, ueId);
+
+ if(duUeCb->f1UeDb)
{
- ret = duBuildAndSendDlRrcMsgToRlc(cellId, duCb.actvCellLst[duUeCb->f1UeDb->cellIdx]->ueCb[ueId-1].rlcUeCfg,\
- duUeCb->f1UeDb->dlRrcMsg);
- if(ret == RFAILED)
+ /* Send DL RRC msg for RRC release */
+ if(duUeCb->f1UeDb->dlRrcMsg)
{
- DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : Failed to send DL RRC msg");
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu,\
- duUeCb->f1UeDb->dlRrcMsg->rrcMsgSize);
- DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ if(duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu != NULLP)
+ {
+ ret = duBuildAndSendDlRrcMsgToRlc(cellId, duCb.actvCellLst[duUeCb->f1UeDb->cellIdx]->ueCb[ueId-1].rlcUeCfg,\
+ duUeCb->f1UeDb->dlRrcMsg);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand() : Failed to send DL RRC msg");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, duUeCb->f1UeDb->dlRrcMsg->rrcMsgPdu,\
+ duUeCb->f1UeDb->dlRrcMsg->rrcMsgSize);
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, duUeCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ }
+ }
}
}
- }
- else
- {
- ret = duBuildAndSendUeDeleteReq(cellId,crnti);
- if(ret == RFAILED)
+ else
{
- DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand(): Failed to build and send Ue Delete request");
+ ret = duBuildAndSendUeDeleteReq(cellId,crnti);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : duProcUeContextReleaseCommand(): Failed to build and send Ue Delete request");
+ }
}
}
-
return ret;
}