#include "RRCReconfiguration-v1530-IEs.h"
#include "CNUEPagingIdentity.h"
#include "PagingCell-Item.h"
+#include "UL-DCCH-Message.h"
#include "cu_stub_sctp.h"
#include "cu_stub_egtp.h"
return ROK;
} /* SendF1APMsg */
-/*******************************************************************
- *
- * @brief Builds NRCell ID
- *
- * @details
- *
- * Function : BuildNrCellId
- *
- * Functionality: Building the NR Cell ID
- *
- * @params[in] BIT_STRING_t *nrcell
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-S16 BuildNrCellId(BIT_STRING_t *nrcell)
-{
- memset(nrcell->buf, 0, nrcell->size);
- nrcell->buf[4] = 16;
- nrcell->bits_unused = 4;
- nrcell->size = 5 * sizeof(uint8_t);
- return ROK;
-}
-
/********************************************************************
*
* @brief Builds and sends the F1SetupResponse
CellGroupConfigRrc_t cellGrpCfg, *cellGrpCfgMsg = NULLP;
asn_dec_rval_t rval; /* Decoder return value */
+ /* Copy the received container to UeCb */
+ memcpy(&ueCb->f1apMsgDb.duToCuContainer, &rrcCont, sizeof(OCTET_STRING_t));
+
/* Decoding DU to CU RRC container octet string to cell group config */
cellGrpCfgMsg = &cellGrpCfg;
memset(cellGrpCfgMsg, 0, sizeof(CellGroupConfigRrc_t));
uint8_t procInitULRRCMsg(uint32_t duId, F1AP_PDU_t *f1apMsg)
{
- uint8_t idx,cellIdx=0, duIdx=0, rrcMsgType, gnbDuUeF1apId;
+ uint8_t idx = 0, duIdx=0, rrcMsgType=0, gnbDuUeF1apId=0;
uint8_t ret =ROK;
- uint32_t nrCellId, crnti;
+ uint16_t cellIdx=0, nrCellId = 0;
+ uint32_t crnti;
DuDb *duDb;
CuCellCb *cellCb;
CuUeCb *ueCb;
break;
case ProtocolIE_ID_id_NRCGI:
- nrCellId = initULRRCMsg->protocolIEs.list.array[idx]->value.choice.NRCGI.nRCellIdentity.buf[4] >>
- initULRRCMsg->protocolIEs.list.array[idx]->value.choice.NRCGI.nRCellIdentity.bits_unused;
+ bitStringToInt(&initULRRCMsg->protocolIEs.list.array[idx]->value.choice.NRCGI.nRCellIdentity, &nrCellId);
SEARCH_CELL_DB(cellIdx, duDb, nrCellId, cellCb);
if(cellCb == NULLP)
return RFAILED;
CU_ALLOC(rrcRecfg->masterCellGroup, sizeof(OCTET_STRING_t));
if(!rrcRecfg->masterCellGroup)
{
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in fillRrcReconfigNonCriticalExt");
return RFAILED;
}
+ rrcRecfg->masterCellGroup->size = ueCb->f1apMsgDb.duToCuContainer.size;
+ CU_ALLOC(rrcRecfg->masterCellGroup->buf, rrcRecfg->masterCellGroup->size);
+ if(!rrcRecfg->masterCellGroup->buf)
+ {
+ DU_LOG("\nERROR --> F1AP : Memory allocation failed in fillRrcReconfigNonCriticalExt");
+ return RFAILED;
+ }
+ memcpy(rrcRecfg->masterCellGroup->buf, ueCb->f1apMsgDb.duToCuContainer.buf, rrcRecfg->masterCellGroup->size);
+
+#if 0
+ /* Use below code if masterCEllGroup is to be filled explicitly at CU rather than copying from DUToCURRCContainer
+ * received from DU */
if(fillCellGrpCfg(ueCb, rrcRecfg->masterCellGroup, updateAllRbCfg) != ROK)
{
+ DU_LOG("\nERROR --> F1AP : Failed to fill CellGroupCfg in fillRrcReconfigNonCriticalExt");
return RFAILED;
}
+#endif
return ROK;
}
DuDb *duDb = NULLP;
CuUeCb *ueCb = NULLP;
UEContextSetupResponse_t *ueCtxtSetupRsp = NULLP;
+ OCTET_STRING_t *duToCuRrcContainer;
SEARCH_DU_DB(duIdx, duId, duDb);
ueCtxtSetupRsp = &f1apMsg->choice.successfulOutcome->value.choice.UEContextSetupResponse;
case ProtocolIE_ID_id_DUtoCURRCInformation:
{
DU_LOG("\nINFO --> Received Du to Cu RRC Information ");
+ duToCuRrcContainer = &ueCtxtSetupRsp->protocolIEs.list.array[idx]->value.choice.\
+ DUtoCURRCInformation.cellGroupConfig;
if((extractDuToCuRrcCont(ueCb, ueCtxtSetupRsp->protocolIEs.list.array[idx]->value.choice.\
DUtoCURRCInformation.cellGroupConfig)) != ROK)
{
/* Store source DU info in the new UE context created in
* tareget DU */
ueCb->hoInfo.sourceDuId = srcDuDb->duId;
+
+ /* Copy the received container to UeCb */
+ memcpy(&ueCbInSrcDu->f1apMsgDb.duToCuContainer, duToCuRrcContainer, sizeof(OCTET_STRING_t));
+
if(BuildAndSendUeContextModificationReq(srcDuDb->duId, ueCbInSrcDu, STOP_DATA_TX) != ROK)
{
DU_LOG("\nERROR -> F1AP : Failed at BuildAndSendUeContextModificationReq()");
return RFAILED;
}
memcpy(rrcContainer, ulRrcMsg->protocolIEs.list.array[idx]->value.choice.RRCContainer.buf, rrcContLen);
+
+ if(duDb->ueCb[duUeF1apId-1].state == UE_HANDOVER_IN_PROGRESS)
+ return;
+
break;
}
ueContextModifyReq->protocolIEs.list.array[ieIdx]->value.choice.TransmissionActionIndicator = \
TransmissionActionIndicator_restart;
}
+
ieIdx++;
ueContextModifyReq->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_RRCContainer;
ueContextModifyReq->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
else
{
DU_LOG("\nDEBUG --> F1AP : Created APER encodedbuffer for ueContextModifyReq\n");
+#if 0
+ /* This for loop was going into an infinite loop even though encBufSize
+ * has a small value. Hence commented this
+ */
for(ieIdx=0; ieIdx< encBufSize; ieIdx++)
{
DU_LOG("%x",encBuf[ieIdx]);
}
+#endif
}
/* TODO : Hardcoding DU ID to 1 for messages other than F1 Setup Response. This will be made generic in future gerrit */
struct Served_Cells_To_Delete_ItemIEs *deleteItemIe = \
(struct Served_Cells_To_Delete_ItemIEs *)duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
Served_Cells_To_Delete_List.list.array[0];
- nrCellId = deleteItemIe->value.choice.Served_Cells_To_Delete_Item.oldNRCGI.nRCellIdentity.buf[4] >>\
- deleteItemIe->value.choice.Served_Cells_To_Delete_Item.oldNRCGI.nRCellIdentity.bits_unused;
+ bitStringToInt(&deleteItemIe->value.choice.Served_Cells_To_Delete_Item.oldNRCGI.nRCellIdentity, &nrCellId);
cellToBeDelete = true;
break;
}
srvCellItem = &duServedCell->list.array[plmnidx]->value.choice.GNB_DU_Served_Cells_Item;
ret = procServedCellPlmnList(&srvCellItem->served_Cell_Information.servedPLMNs);
memcpy(&nrcellIdentity, &srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity, sizeof(BIT_STRING_t));
-
+
+ /* TODO : Use bitStringToInt */
nrCellId = nrcellIdentity.buf[4] >> nrcellIdentity.bits_unused;
SEARCH_CELL_DB(cellIdx, duDb, nrCellId, cellCb);
if(cellCb == NULLP)