#include "GTPTunnel.h"
#ifdef O1_ENABLE
-#include "ConfigInterface.h"
+#include "CmInterface.h"
extern StartupConfig g_cfg;
#endif
DuCfgParams duCfgParam;
+/******************************************************************
+ *
+ * @brief Function to fetch lcId based on DRB Id
+ *
+ * @details
+ *
+ * Function : fetchLcId
+ *
+ * @params[in] drbId
+ *
+ * Functionality: Function to fetch lcId based on DRB Id
+ *
+ * Returns: lcId - SUCCESS
+ * RFAILED - FAILURE
+ *****************************************************************/
+
+uint8_t fetchLcId(uint8_t drbId)
+{
+ uint8_t cellIdx = 0, ueIdx = 0, lcIdx = 0, numLcs = 0, lcId = 0;
+
+ for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
+ {
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
+ {
+ if(duCb.actvCellLst[cellIdx] != NULLP)
+ {
+ numLcs = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.numLcs;
+ for(lcIdx = 0; lcIdx < numLcs; lcIdx++)
+ {
+ if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].rbId == drbId && \
+ duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].rbType == RB_TYPE_DRB)
+ {
+ lcId = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].rlcUeCfg.rlcLcCfg[lcIdx].lcId;
+ return lcId;
+ }
+ }
+ }
+ }
+ }
+ DU_LOG("\nERROR --> DU_APP: fetchLcId() failed for drbId %d", drbId);
+ return RFAILED;
+}
+
/************************************************************************
*
* @brief Converts enum values into actual value of Poll retransmit timer
S16 BuildNrCellId(BIT_STRING_t *nrcell)
{
memset(nrcell->buf, 0, nrcell->size);
- nrcell->buf[4] = 16;
+ nrcell->buf[4] = duCfgParam.sib1Params.cellIdentity;
nrcell->bits_unused = 4;
return ROK;
}
{
srvCellInfo->nRCGI.nRCellIdentity.buf[tmp] = 0;
}
- srvCellInfo->nRCGI.nRCellIdentity.buf[4] = 16;
+ srvCellInfo->nRCGI.nRCellIdentity.buf[4] = duCfgParam.sib1Params.cellIdentity;
srvCellInfo->nRCGI.nRCellIdentity.bits_unused =4;
/*nRPCI*/
{
modifyItem->oldNRCGI.nRCellIdentity.buf[ieIdx] = 0;
}
- modifyItem->oldNRCGI.nRCellIdentity.buf[4] = 16;
+ modifyItem->oldNRCGI.nRCellIdentity.buf[4] = duCfgParam.sib1Params.cellIdentity;
modifyItem->oldNRCGI.nRCellIdentity.bits_unused = 4;
if(fillServedCellInfo(&modifyItem->served_Cell_Information))
{
deleteItem->oldNRCGI.nRCellIdentity.buf[arrIdx] = 0;
}
- deleteItem->oldNRCGI.nRCellIdentity.buf[4] = 16;
+ deleteItem->oldNRCGI.nRCellIdentity.buf[4] = duCfgParam.sib1Params.cellIdentity;
deleteItem->oldNRCGI.nRCellIdentity.bits_unused = 4;
return ROK;
}
uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId)
{
uint8_t ieIdx=0, arrIdx=0,ret=ROK;
- uint8_t ueId =0 , ueIdx =0;
+ uint8_t ueId =0 , ueIdx =0, totalActiveUe = 0;
uint16_t cellId =0, cellIdx =0, crnti=0;
CmLList *f1apPduNode = NULLP;
ReservedF1apPduInfo *f1apPduInfo =NULLP;
ret = duSendCellDeletReq(cellId);
if(ret == RFAILED)
{
- DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to send cell delete\
+ DU_LOG("\nERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to send cell delete\
request for cellId[%d]", cellId);
}
}
else
{
- for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
+ totalActiveUe = duCb.actvCellLst[cellIdx]->numActvUes;
+ while(totalActiveUe)
{
+ if(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].ueState != UE_ACTIVE)
+ {
+ ueIdx++;
+ continue;
+ }
+
crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti;
GET_UE_IDX(crnti,ueId);
+ /* Sending Ue Context release request only for maximum supporting UEs */
ret = BuildAndSendUeContextReleaseReq(cellId, ueId);
if(ret == RFAILED)
{
- DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to build and send UE delete\
+ DU_LOG("\nERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): Failed to build and send UE delete\
request for cellId[%d]", cellId);
}
+ ueIdx++;
+ totalActiveUe--;
}
}
}
else
{
- DU_LOG("ERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId);
+ DU_LOG("\nERROR --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId);
ret = RFAILED;
}
break;
break;
}while(true);
- if(ret == ROK)
+ if(ret == ROK && (duCb.actvCellLst[cellId-1]->numActvUes == 0))
{
duCb.actvCellLst[cellId-1]->cellStatus = DELETION_IN_PROGRESS;
ret = duSendCellDeletReq(cellId);
{
for(cellIdx = 0; cellIdx < duCb.numActvCells; cellIdx++)
{
- for(ueIdx = 0; ueIdx < duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
{
if((duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId == gnbDuUeF1apId)&&\
(duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId == gnbCuUeF1apId))
}
if(!ueIdxFound)
{
- DU_LOG("\nERROR --> F1AP: DuUeCb is not found at procF1UeContextSetupReq()");
+ DU_LOG("\nERROR --> F1AP: DuUeCb is not found at procF1UeContextReleaseCommand()");
ret = RFAILED;
}