schUeCfg->crnti = ueCfg->crnti;
/* Copy MAC cell group config */
- memset(&schUeCfg->macCellGrpCfg, 0, sizeof(SchMacCellGrpCfg));
- if(fillMacCellGroupCfg(ueCfg->macCellGrpCfg, &schUeCfg->macCellGrpCfg) != ROK)
+ if(ueCfg->macCellGrpCfgPres == true)
{
- DU_LOG("\nERROR --> MAC : fillMacCellGroupCfg() failed");
- return RFAILED;
+ schUeCfg->macCellGrpCfgPres = true;
+ memset(&schUeCfg->macCellGrpCfg, 0, sizeof(SchMacCellGrpCfg));
+ if(fillMacCellGroupCfg(ueCfg->macCellGrpCfg, &schUeCfg->macCellGrpCfg) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : fillMacCellGroupCfg() failed");
+ return RFAILED;
+ }
}
-
- /* Copy Physical cell group config */
- memset(&schUeCfg->phyCellGrpCfg, 0,sizeof(SchPhyCellGrpCfg));
- if(fillPhyCellGroupCfg(ueCfg->phyCellGrpCfg, &schUeCfg->phyCellGrpCfg) != ROK)
+ if(ueCfg->phyCellGrpCfgPres == true)
{
- DU_LOG("\nERROR --> MAC : fillPhyCellGroupCfg() failed");
- return RFAILED;
+ schUeCfg->phyCellGrpCfgPres = true;
+ /* Copy Physical cell group config */
+ memset(&schUeCfg->phyCellGrpCfg, 0,sizeof(SchPhyCellGrpCfg));
+ if(fillPhyCellGroupCfg(ueCfg->phyCellGrpCfg, &schUeCfg->phyCellGrpCfg) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : fillPhyCellGroupCfg() failed");
+ return RFAILED;
+ }
}
- /* Copy sp cell config */
- memset(&schUeCfg->spCellCfg, 0, sizeof(SchSpCellCfg));
- if(fillSpCellCfg(ueCfg->spCellCfg, &schUeCfg->spCellCfg) != ROK)
+ if(ueCfg->spCellCfgPres == true)
{
- DU_LOG("\nERROR --> MAC : fillSpCellCfg() failed");
- return RFAILED;
+ schUeCfg->spCellCfgPres = true;
+ /* Copy sp cell config */
+ memset(&schUeCfg->spCellCfg, 0, sizeof(SchSpCellCfg));
+ if(fillSpCellCfg(ueCfg->spCellCfg, &schUeCfg->spCellCfg) != ROK)
+ {
+ DU_LOG("\nERROR --> MAC : fillSpCellCfg() failed");
+ return RFAILED;
+ }
}
-
if(ueCfg->ambrCfg != NULLP)
{
MAC_ALLOC(schUeCfg->ambrCfg, sizeof(SchAmbrCfg));
if(!schUeCfg->ambrCfg)
{
- DU_LOG("\nERROR --> MAC : Memory allocation failed in sendReconfigReqToSch");
- return RFAILED;
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in sendReconfigReqToSch");
+ return RFAILED;
}
schUeCfg->ambrCfg->ulBr = ueCfg->ambrCfg->ulBr;
}
ueCb->ueIdx = ueCfg->ueIdx;
ueCb->crnti = ueCfg->crnti;
ueCb->cellCb = macCb.macCell[cellIdx];
- ueCb->dlInfo.dlHarqEnt.numHarqProcs = \
+ if(ueCfg->spCellCfgPres)
+ {
+ ueCb->dlInfo.dlHarqEnt.numHarqProcs = \
ueCfg->spCellCfg.servCellCfg.pdschServCellCfg.numHarqProcForPdsch;
+ }
ueCb->state = UE_STATE_ACTIVE;
/*TODO: To check the bsr value during implementation */
- ueCb->bsrTmrCfg.periodicTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.periodicTimer;
- ueCb->bsrTmrCfg.retxTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.retxTimer;
- ueCb->bsrTmrCfg.srDelayTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.srDelayTimer;
+ if(ueCfg->macCellGrpCfgPres)
+ {
+ ueCb->bsrTmrCfg.periodicTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.periodicTimer;
+ ueCb->bsrTmrCfg.retxTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.retxTimer;
+ ueCb->bsrTmrCfg.srDelayTimer = ueCfg->macCellGrpCfg.bsrTmrCfg.srDelayTimer;
+ }
ret = fillMacLcCfgList(ueCb, ueCfg);
if(ret == RFAILED)
{
if(ret == ROK)
{
/*Sending Cfg Req to SCH */
- ret = fillSchUeCfg(pst, &schUeCfg, ueCfg);
- if(ret != ROK)
- DU_LOG("\nERROR --> MAC : Failed to fill sch Ue Cfg at MacProcUeReconfigReq()");
+ ret = fillSchUeCfg(pst, &schUeCfg, ueCfg);
+ if(ret != ROK)
+ DU_LOG("\nERROR --> MAC : Failed to fill sch Ue Cfg at MacProcUeReconfigReq()");
else
- {
+ {
/* Fill event and send UE create request to SCH */
ret = sendUeReqToSch(pst, &schUeCfg);
- if(ret != ROK)
- DU_LOG("\nERROR --> MAC : Failed to send UE Reconfig Request to SCH");
- }
+ if(ret != ROK)
+ DU_LOG("\nERROR --> MAC : Failed to send UE Reconfig Request to SCH");
+ }
}
else
{
- DU_LOG("\nERROR --> MAC : Failed to store MAC UE Cb ");
+ DU_LOG("\nERROR --> MAC : Failed to store MAC UE Cb ");
}
}
else
SchUlLcCtxt ulLcCtxt[MAX_NUM_LC];
}SchUlCb;
+typedef struct schUeCfgCb
+{
+ uint16_t cellId;
+ uint16_t crnti;
+ bool macCellGrpCfgPres;
+ SchMacCellGrpCfg macCellGrpCfg;
+ bool phyCellGrpCfgPres;
+ SchPhyCellGrpCfg phyCellGrpCfg;
+ bool spCellCfgPres;
+ SchSpCellCfg spCellCfg;
+ SchAmbrCfg *ambrCfg;
+ SchModulationInfo dlModInfo;
+ SchModulationInfo ulModInfo;
+}SchUeCfgCb;
+
/**
* @brief
* UE control block
{
uint16_t ueIdx;
uint16_t crnti;
- SchUeCfg ueCfg;
+ SchUeCfgCb ueCfg;
SchUeState state;
SchCellCb *cellCb;
bool srRcvd;
uint8_t fillSchUeCb(SchUeCb *ueCb, SchUeCfg *ueCfg)
{
uint8_t lcIdx, ueLcIdx;
+
+ ueCb->ueCfg.cellId = ueCfg->cellId;
+ ueCb->ueCfg.crnti = ueCfg->crnti;
+ if(ueCfg->macCellGrpCfgPres == true)
+ {
+ memcpy(&ueCb->ueCfg.macCellGrpCfg , &ueCfg->macCellGrpCfg, sizeof(SchMacCellGrpCfg));
+ ueCb->ueCfg.macCellGrpCfgPres = true;
+ }
+
+ if(ueCfg->phyCellGrpCfgPres == true)
+ {
+ memcpy(&ueCb->ueCfg.phyCellGrpCfg , &ueCfg->phyCellGrpCfg, sizeof(SchPhyCellGrpCfg));
+ ueCb->ueCfg.phyCellGrpCfgPres = true;
+ }
- memset(&ueCb->ueCfg, 0, sizeof(SchUeCfg));
- memcpy(&ueCb->ueCfg, ueCfg, sizeof(SchUeCfg));
+ if(ueCfg->spCellCfgPres == true)
+ {
+ memcpy(&ueCb->ueCfg.spCellCfg , &ueCfg->spCellCfg, sizeof(SchSpCellCfg));
+ ueCb->ueCfg.spCellCfgPres = true;
+ }
ueCb->state = SCH_UE_STATE_ACTIVE;
+ if(ueCfg->ambrCfg != NULLP)
+ {
+ SCH_ALLOC(ueCb->ueCfg.ambrCfg , sizeof(SchAmbrCfg));
+ memcpy(&ueCb->ueCfg.ambrCfg->ulBr , &ueCfg->ambrCfg->ulBr, sizeof(SchAmbrCfg));
+ }
+
+ memcpy(&ueCb->ueCfg.dlModInfo, &ueCfg->dlModInfo , sizeof(SchModulationInfo));
+ memcpy(&ueCb->ueCfg.ulModInfo, &ueCfg->ulModInfo , sizeof(SchModulationInfo));
+ //Updating SchUlCb and SchDlCb DB in SchUeCb
for(lcIdx = 0; lcIdx < ueCfg->numLcs; lcIdx++)
{
if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_ADD)
{
- fillSchUlLcCtxt(&ueCb->ulInfo.ulLcCtxt[ueCb->ulInfo.numUlLc], &ueCfg->schLcCfg[lcIdx]);
- ueCb->ulInfo.numUlLc++;
- fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueCb->dlInfo.numDlLc], &ueCfg->schLcCfg[lcIdx]);
- ueCb->dlInfo.numDlLc++;
+ fillSchUlLcCtxt(&ueCb->ulInfo.ulLcCtxt[ueCb->ulInfo.numUlLc], &ueCfg->schLcCfg[lcIdx]);
+ ueCb->ulInfo.numUlLc++;
+ fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueCb->dlInfo.numDlLc], &ueCfg->schLcCfg[lcIdx]);
+ ueCb->dlInfo.numDlLc++;
}
else
{
- for(ueLcIdx = 0; ueLcIdx < ueCb->ulInfo.numUlLc; ueLcIdx++) //searching for Lc to be Mod
+ for(ueLcIdx = 0; ueLcIdx < ueCb->ulInfo.numUlLc; ueLcIdx++) //searching for Lc to be Mod
{
- if(ueCb->ulInfo.ulLcCtxt[ueLcIdx].lcId == ueCfg->schLcCfg[lcIdx].lcId)
- {
- if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_MOD)
- {
- fillSchUlLcCtxt(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
- fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
- break;
- }
+ if(ueCb->ulInfo.ulLcCtxt[ueLcIdx].lcId == ueCfg->schLcCfg[lcIdx].lcId)
+ {
+ if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_MOD)
+ {
+ fillSchUlLcCtxt(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
+ fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
+ break;
+ }
if(ueCfg->schLcCfg[ueLcIdx].configType == CONFIG_DEL)
{
- memset(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], 0, sizeof(SchUlLcCtxt));
- ueCb->ulInfo.numUlLc--;
- updateSchUlCb(ueLcIdx, &ueCb->ulInfo); //moving arr elements one idx ahead
- memset(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], 0, sizeof(SchDlLcCtxt));
- ueCb->dlInfo.numDlLc--;
- updateSchDlCb(ueLcIdx, &ueCb->dlInfo); //moving arr elements one idx ahead
- break;
+ memset(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], 0, sizeof(SchUlLcCtxt));
+ ueCb->ulInfo.numUlLc--;
+ updateSchUlCb(ueLcIdx, &ueCb->ulInfo); //moving arr elements one idx ahead
+ memset(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], 0, sizeof(SchDlLcCtxt));
+ ueCb->dlInfo.numDlLc--;
+ updateSchDlCb(ueLcIdx, &ueCb->dlInfo); //moving arr elements one idx ahead
+ break;
}
}
}/*End of inner for loop */
uint8_t idx = 0;
SchCellCb *cellCb = ueCb->cellCb;
SchUlSlotInfo *schUlSlotInfo = NULLP;
- uint8_t k2 = ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.puschCfg.timeDomRsrcAllocList[0].k2;
- uint8_t startSymb = ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.puschCfg.timeDomRsrcAllocList[0].startSymbol;
- uint8_t symbLen = ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.puschCfg.timeDomRsrcAllocList[0].symbolLength;
-
+ uint8_t k2=0, startSymb=0 , symbLen=0;
+
+ if(ueCb->ueCfg.spCellCfgPres == true)
+ {
+ k2 = ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.puschCfg.timeDomRsrcAllocList[0].k2;
+ startSymb = ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.puschCfg.timeDomRsrcAllocList[0].startSymbol;
+ symbLen = ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.puschCfg.timeDomRsrcAllocList[0].symbolLength;
+ }
puschSlot = (pdcchSlot + k2) % cellCb->numSlots;
startRb = cellCb->schUlSlotInfo[puschSlot]->puschCurrentPrb;
uint8_t schFillUlDci(SchUeCb *ueCb, SchPuschInfo puschInfo, DciInfo *dciInfo)
{
SchCellCb *cellCb = ueCb->cellCb;
- SchControlRsrcSet coreset1 = ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdcchCfg.cRSetToAddModList[0];
-
+ SchControlRsrcSet coreset1 ;
+
+ memset(&coreset1, 0, sizeof(SchControlRsrcSet));
+ if(ueCb->ueCfg.spCellCfgPres == true)
+ {
+ coreset1 = ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdcchCfg.cRSetToAddModList[0];
+ }
+
dciInfo->cellId = cellCb->cellId;
dciInfo->crnti = ueCb->crnti;
uint16_t cellId;
uint8_t ueIdx;
uint16_t crnti;
+ bool macCellGrpCfgPres;
MacCellGrpCfg macCellGrpCfg;
+ bool phyCellGrpCfgPres;
PhyCellGrpCfg phyCellGrpCfg;
+ bool spCellCfgPres;
SpCellCfg spCellCfg;
AmbrCfg *ambrCfg;
ModulationInfo dlModInfo; /* DL modulation info */
{
uint16_t cellId;
uint16_t crnti;
+ bool macCellGrpCfgPres;
SchMacCellGrpCfg macCellGrpCfg;
+ bool phyCellGrpCfgPres;
SchPhyCellGrpCfg phyCellGrpCfg;
+ bool spCellCfgPres;
SchSpCellCfg spCellCfg;
SchAmbrCfg *ambrCfg;
SchModulationInfo dlModInfo;
/* Fill MacCell Group Reconfig */
if(cellGrp->mac_CellGroupConfig)
{
+ macUeCfg->macCellGrpCfgPres = true;
macCellGroup = ((MAC_CellGroupConfig_t *)(cellGrp->mac_CellGroupConfig));
if(macCellGroup->schedulingRequestConfig)
- {
+ {
extractSchReqReConfig(macCellGroup->schedulingRequestConfig, &macUeCfg->macCellGrpCfg.schReqCfg);
- }
+ }
if(macCellGroup->tag_Config)
- {
+ {
extractTagReconfig(macCellGroup->tag_Config, &macUeCfg->macCellGrpCfg.tagCfg);
- }
- if(macCellGroup->bsr_Config)
- {
+ }
+ if(macCellGroup->bsr_Config)
+ {
macUeCfg->macCellGrpCfg.bsrTmrCfg.periodicTimer = macCellGroup->bsr_Config->periodicBSR_Timer;
macUeCfg->macCellGrpCfg.bsrTmrCfg.retxTimer = macCellGroup->bsr_Config->retxBSR_Timer;
- if(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer)
- {
+ if(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer)
+ {
macUeCfg->macCellGrpCfg.bsrTmrCfg.srDelayTimer =\
- *(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer);
- }
- }
- if(macCellGroup->phr_Config)
- {
- if(macCellGroup->phr_Config->present == MAC_CellGroupConfig__phr_Config_PR_setup)
- {
+ *(macCellGroup->bsr_Config->logicalChannelSR_DelayTimer);
+ }
+ }
+ if(macCellGroup->phr_Config)
+ {
+ if(macCellGroup->phr_Config->present == MAC_CellGroupConfig__phr_Config_PR_setup)
+ {
macUeCfg->macCellGrpCfg.phrCfgSetupPres = true;
if(macCellGroup->phr_Config->choice.setup)
- {
- macUeCfg->macCellGrpCfg.phrCfg.periodicTimer = \
- macCellGroup->phr_Config->choice.setup->phr_PeriodicTimer;
- macUeCfg->macCellGrpCfg.phrCfg.prohibitTimer = \
- macCellGroup->phr_Config->choice.setup->phr_ProhibitTimer;
- macUeCfg->macCellGrpCfg.phrCfg.txPowerFactor = \
- macCellGroup->phr_Config->choice.setup->phr_Tx_PowerFactorChange;
- macUeCfg->macCellGrpCfg.phrCfg.multiplePHR = \
- macCellGroup->phr_Config->choice.setup->multiplePHR;
- macUeCfg->macCellGrpCfg.phrCfg.dummy = \
- macCellGroup->phr_Config->choice.setup->dummy;
- macUeCfg->macCellGrpCfg.phrCfg.phrType2OtherCell = \
- macCellGroup->phr_Config->choice.setup->phr_Type2OtherCell;
- macUeCfg->macCellGrpCfg.phrCfg.phrOtherCG = \
- macCellGroup->phr_Config->choice.setup->phr_ModeOtherCG;
- }
- }
- }
+ {
+ macUeCfg->macCellGrpCfg.phrCfg.periodicTimer = \
+ macCellGroup->phr_Config->choice.setup->phr_PeriodicTimer;
+ macUeCfg->macCellGrpCfg.phrCfg.prohibitTimer = \
+ macCellGroup->phr_Config->choice.setup->phr_ProhibitTimer;
+ macUeCfg->macCellGrpCfg.phrCfg.txPowerFactor = \
+ macCellGroup->phr_Config->choice.setup->phr_Tx_PowerFactorChange;
+ macUeCfg->macCellGrpCfg.phrCfg.multiplePHR = \
+ macCellGroup->phr_Config->choice.setup->multiplePHR;
+ macUeCfg->macCellGrpCfg.phrCfg.dummy = \
+ macCellGroup->phr_Config->choice.setup->dummy;
+ macUeCfg->macCellGrpCfg.phrCfg.phrType2OtherCell = \
+ macCellGroup->phr_Config->choice.setup->phr_Type2OtherCell;
+ macUeCfg->macCellGrpCfg.phrCfg.phrOtherCG = \
+ macCellGroup->phr_Config->choice.setup->phr_ModeOtherCG;
+ }
+ }
+ }
}
/* Fill Physical Cell Group Reconfig */
if(cellGrp->physicalCellGroupConfig)
{
+ macUeCfg->phyCellGrpCfgPres = true;
phyCellGrpCfg = ((PhysicalCellGroupConfig_t *)(cellGrp->physicalCellGroupConfig));
if(phyCellGrpCfg->p_NR_FR1)
- {
- if(*(phyCellGrpCfg->p_NR_FR1) != macUeCfg->phyCellGrpCfg.pNrFr1)
+ {
+ if(*(phyCellGrpCfg->p_NR_FR1) != macUeCfg->phyCellGrpCfg.pNrFr1)
macUeCfg->phyCellGrpCfg.pNrFr1 = *(phyCellGrpCfg->p_NR_FR1);
- }
+ }
macUeCfg->phyCellGrpCfg.pdschHarqAckCodebook = phyCellGrpCfg->pdsch_HARQ_ACK_Codebook;
}
/* Fill SpCell Reconfig */
if(cellGrp->spCellConfig)
{
+ macUeCfg->spCellCfgPres = true;
spcellCfg = ((SpCellConfig_t *)(cellGrp->spCellConfig));
if(spcellCfg->servCellIndex)
- {
+ {
macUeCfg->spCellCfg.servCellIdx = *(spcellCfg->servCellIndex);
- }
+ }
/* Fill Serving cell Reconfig info */
- if(cellGrp->spCellConfig->spCellConfigDedicated)
- {
- servCellCfg = ((ServingCellConfig_t *)(cellGrp->spCellConfig->spCellConfigDedicated));
+ if(cellGrp->spCellConfig->spCellConfigDedicated)
+ {
+ servCellCfg = ((ServingCellConfig_t *)(cellGrp->spCellConfig->spCellConfigDedicated));
ret = extractSpCellDedicatedCfg(servCellCfg, &macUeCfg->spCellCfg.servCellCfg);
- if(ret == RFAILED)
- {
- DU_LOG("\nERROR --> F1AP : Failed at extractSpCellDedicatedCfg()");
- }
- }
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> F1AP : Failed at extractSpCellDedicatedCfg()");
+ }
+ }
}
}
return ret;
}
else
{
+ duUeCb->f1UeDb->dlRrcMsgPres = true;
memset(duUeCb->f1UeDb->dlRrcMsg, 0, sizeof(F1DlRrcMsg));
ret = extractDlRrcMsg(gnbDuUeF1apId, gnbCuUeF1apId, duUeCb->f1UeDb->dlRrcMsg,\
&ueSetReq->protocolIEs.list.array[ieIdx]->value.choice.RRCContainer);
int16_t getStatProhTmr(uint8_t statProhTmrCfg);
uint8_t duProcUeContextModReq(DuUeCb *ueCb);
uint8_t BuildAndSendUeContextModResp(uint8_t ueIdx, uint8_t cellId);
+uint8_t duBuildAndSendUeContextModReq(uint16_t cellId, uint16_t crnti, DuUeCfg *duUeCfg);
/**********************************************************************
End of file
**********************************************************************/
UeCtxtActionType actionType;
uint8_t cellIdx;
DuUeCfg duUeCfg;
+ bool dlRrcMsgPres;
F1DlRrcMsg *dlRrcMsg;
}F1UeContextSetupDb;
ret = procUeReCfgCellInfo(macUeCfg, ueCfgDb->cellGrpCfg);
if(ret == ROK)
{
- if(macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschPresent)
- {
- fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg.numTimeDomRsrcAlloc,\
- &macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg, NULL);
- }
- if(macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschPresent)
+ if(macUeCfg->spCellCfgPres == true)
{
- fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\
- NULL, &macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg);
+ if(macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschPresent)
+ {
+ fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg.numTimeDomRsrcAlloc,\
+ &macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg, NULL);
+ }
+ if(macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschPresent)
+ {
+ fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\
+ NULL, &macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg);
+ }
}
- ret = fillAmbr(&macUeCfg->ambrCfg, ueCfgDb->ambrCfg);
-
+ ret = fillAmbr(&macUeCfg->ambrCfg, ueCfgDb->ambrCfg);
+
duFillModulationDetails(macUeCfg, duMacDb, ueCfgDb->ueNrCapability);
}
/* Filling LC Context */
for(dbIdx = 0; (dbIdx < ueCfgDb->numMacLcs && ret == ROK); dbIdx++)
{
- if(!ueCfgDb->macLcCfg[dbIdx].ulLcCfgPres)
- {
- /* Filling default UL LC config in MAC if not present */
- ueCfgDb->macLcCfg[dbIdx].ulLcCfgPres = true;
- fillDefaultUlLcCfg(&ueCfgDb->macLcCfg[dbIdx].ulLcCfg);
- }
- for(lcIdx = 0; lcIdx < duMacDb->numLcs; lcIdx++)
- {
- if(ueCfgDb->macLcCfg[dbIdx].lcId == duMacDb->lcCfgList[lcIdx].lcId)
- {
- lcIdFound = true;
- if((ueCfgDb->macLcCfg[dbIdx].configType == CONFIG_UNKNOWN) ||
- (ueCfgDb->macLcCfg[dbIdx].configType == CONFIG_MOD))
- {
- ueCfgDb->macLcCfg[dbIdx].configType = CONFIG_MOD;
- ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->macLcCfg[dbIdx]);
- }
- }
- else
- lcIdFound = false;
- }
- if(!lcIdFound)
- {
- /* ADD/DEL CONFIG */
- ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->macLcCfg[dbIdx]);
- }
- if(ret == ROK)
- {
- macUeCfg->numLcs++;
- }
- else
- {
- DU_LOG("\nERROR --> DU APP : Failed to add Lc at Idx %d in fillMacUeCfg()", dbIdx);
- break;
- }
+ if(!ueCfgDb->macLcCfg[dbIdx].ulLcCfgPres)
+ {
+ /* Filling default UL LC config in MAC if not present */
+ ueCfgDb->macLcCfg[dbIdx].ulLcCfgPres = true;
+ fillDefaultUlLcCfg(&ueCfgDb->macLcCfg[dbIdx].ulLcCfg);
+ }
+ for(lcIdx = 0; lcIdx < duMacDb->numLcs; lcIdx++)
+ {
+ if(ueCfgDb->macLcCfg[dbIdx].lcId == duMacDb->lcCfgList[lcIdx].lcId)
+ {
+ lcIdFound = true;
+ if((ueCfgDb->macLcCfg[dbIdx].configType == CONFIG_UNKNOWN) ||
+ (ueCfgDb->macLcCfg[dbIdx].configType == CONFIG_MOD))
+ {
+ ueCfgDb->macLcCfg[dbIdx].configType = CONFIG_MOD;
+ ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->macLcCfg[dbIdx]);
+ }
+ }
+ else
+ lcIdFound = false;
+ }
+ if(!lcIdFound)
+ {
+ /* ADD/DEL CONFIG */
+ ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->macLcCfg[dbIdx]);
+ }
+ if(ret == ROK)
+ {
+ macUeCfg->numLcs++;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to add Lc at Idx %d in fillMacUeCfg()", dbIdx);
+ break;
+ }
}/*End of Outer FOR loop */
}
return ret;
if(cfgRsp->result == MAC_DU_APP_RSP_OK)
{
if(pst->event == EVENT_MAC_UE_CREATE_RSP)
- {
+ {
DU_LOG("\nINFO --> DU APP : MAC UE Create Response : SUCCESS [UE IDX : %d]", cfgRsp->ueIdx);
duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
- macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
- }
+ macUeCfg.macUeCfgState = UE_CREATE_COMPLETE;
+ }
else if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
{
DU_LOG("\nINFO --> DU APP : MAC UE Reconfig Response : SUCCESS [UE IDX : %d]", cfgRsp->ueIdx);
duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
- macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
+ macUeCfg.macUeCfgState = UE_RECFG_COMPLETE;
if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
+ {
BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
+ duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
+ macUeCfg.macUeCfgState = 0;
+ }
}
}
else
{
DU_LOG("\nERROR --> DU APP : MAC UE CFG Response for EVENT[%d]: FAILURE [UE IDX : %d]", pst->event, cfgRsp->ueIdx);
- if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
- {
- //TODO: Send the failure case in Ue Context Setup Response
- }
+ if(pst->event == EVENT_MAC_UE_RECONFIG_RSP)
+ {
+ //TODO: Send the failure case in Ue Context Setup Response
+ }
ret = RFAILED;
}
DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(MacUeCfgRsp));
if(cfgRsp->result == RLC_DU_APP_RSP_OK)
{
if(pst->event == EVENT_RLC_UE_CREATE_RSP)
- {
- DU_LOG("\nINFO --> DU_APP: RLC UE Create Response : SUCCESS [UE IDX:%d]", cfgRsp->ueIdx);
- duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
- rlcUeCfg.rlcUeCfgState = UE_CREATE_COMPLETE;
- }
- else if(pst->event == EVENT_RLC_UE_RECONFIG_RSP)
- {
+ {
+ DU_LOG("\nINFO --> DU_APP: RLC UE Create Response : SUCCESS [UE IDX:%d]", cfgRsp->ueIdx);
+ duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
+ rlcUeCfg.rlcUeCfgState = UE_CREATE_COMPLETE;
+ }
+ else if(pst->event == EVENT_RLC_UE_RECONFIG_RSP)
+ {
DU_LOG("\nINFO --> DU_APP: RLC UE Reconfig Response : SUCCESS [UE IDX:%d]", cfgRsp->ueIdx);
- duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
- rlcUeCfg.rlcUeCfgState = UE_RECFG_COMPLETE;
- if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
+ duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
+ rlcUeCfg.rlcUeCfgState = UE_RECFG_COMPLETE;
+ if((ret = duUpdateDuUeCbCfg(cfgRsp->ueIdx, cfgRsp->cellId)) == ROK)
+ {
BuildAndSendUeCtxtRsp(cfgRsp->ueIdx, cfgRsp->cellId);
- }
+ duCb.actvCellLst[cfgRsp->cellId -1]->ueCb[cfgRsp->ueIdx -1].\
+ rlcUeCfg.rlcUeCfgState = 0;
+ }
+ }
}
else
{
DU_LOG("\nERROR --> DU_APP: RLC UE CFG Response for EVENT[%d] : FAILED [UE IDX : %d, REASON :%d]",\
- pst->event, cfgRsp->ueIdx, cfgRsp->reason);
- if((pst->event == EVENT_RLC_UE_RECONFIG_RSP))
- {
+ pst->event, cfgRsp->ueIdx, cfgRsp->reason);
+ if((pst->event == EVENT_RLC_UE_RECONFIG_RSP))
+ {
//TODO: update failure case in ue Context setup Response
- }
- ret = RFAILED;
+ }
+ ret = RFAILED;
}
DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cfgRsp, sizeof(RlcUeCfgRsp));
}
return ret;
}
-
-
/*******************************************************************
*
* @brief Builds and Send Ue Reconfig Req to RLC
{
GET_UE_IDX(dlRrcMsg->crnti, ueIdx);
ueCb = &duCb.actvCellLst[dlRrcMsg->cellId -1]->ueCb[ueIdx -1];
- if(ueCb->f1UeDb && ueCb->f1UeDb->actionType == UE_CTXT_SETUP)
+ if(ueCb->f1UeDb && ueCb->f1UeDb->dlRrcMsgPres)
{
- ret = duBuildAndSendUeContextSetupReq(dlRrcMsg->cellId, dlRrcMsg->crnti, &ueCb->f1UeDb->duUeCfg);
- if(ret == RFAILED)
- DU_LOG("\nERROR --> DU APP : Failed to process UE Context Setup Request in DuProcRlcDlRrcMsgRsp()");
+ if(ueCb->f1UeDb->actionType == UE_CTXT_SETUP)
+ {
+ ret = duBuildAndSendUeContextSetupReq(dlRrcMsg->cellId, dlRrcMsg->crnti, &ueCb->f1UeDb->duUeCfg);
+ if(ret == RFAILED)
+ DU_LOG("\nERROR --> DU APP : Failed to process UE Context Setup Request in DuProcRlcDlRrcMsgRsp()");
+ }
+ if(ueCb->f1UeDb->actionType == UE_CTXT_MOD)
+ {
+ ret = duBuildAndSendUeContextModReq(dlRrcMsg->cellId, dlRrcMsg->crnti, &ueCb->f1UeDb->duUeCfg);
+ if(ret == RFAILED)
+ DU_LOG("\nERROR --> DU APP : Failed to process UE Context Mod Request in DuProcRlcDlRrcMsgRsp()");
+ }
}
}
else
uint8_t duProcUeContextSetupRequest(DuUeCb *ueCb)
{
uint8_t ret, cellId;
-
+
ret = ROK;
if(ueCb)
{
{
DU_LOG("\nERROR --> DU APP : Failed to send DL RRC msg in duProcUeContextSetupRequest()");
DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg->rrcMsgPdu,\
- ueCb->f1UeDb->dlRrcMsg->rrcMsgSize);
+ ueCb->f1UeDb->dlRrcMsg->rrcMsgSize);
DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
}
}
else if(ueCb->f1UeDb->actionType == UE_CTXT_SETUP)
{
ret = duBuildAndSendUeContextSetupReq(cellId, ueCb->crnti, &ueCb->f1UeDb->duUeCfg);
- if(ret == RFAILED)
- {
+ if(ret == RFAILED)
+ {
DU_LOG("\nERROR --> DU APP : Failed to build ue context setup Req in duProcUeContextSetupRequest()");
- }
+ }
}
}
else
}
return ret;
}
+
/*******************************************************************
-*
-* @brief Process UE context modification request from CU
-*
-* @details
-*
-* Function : duProcUeContextModReq
-*
-* Functionality: Process UE context modification request from CU
-*
-* @params[in] DuUeCb *ueCb
-* @return ROK - success
-* RFAILED - failure
-*
-* ****************************************************************/
+ *
+ * @brief Build and Send Ue context mod request
+ *
+ * @details
+ *
+ *
+ * Function : duBuildAndSendUeContextModReq
+ *
+ * Functionality:
+ * Build and Send Ue context mod request
+ *
+ * @params[in] cellId, crnti, DuUeCfg pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *****************************************************************/
+
+uint8_t duBuildAndSendUeContextModReq(uint16_t cellId, uint16_t crnti, DuUeCfg *duUeCfg)
+{
+ uint8_t ret = ROK;
+
+ DU_LOG("\nDEBUG --> DU_APP: Processing Ue Context Mod Request for cellId [%d]", cellId);
+ /* Filling RLC Ue Reconfig */
+ ret = duBuildAndSendUeReCfgReqToRlc(cellId, crnti, duUeCfg);
+ if(ret == RFAILED)
+ DU_LOG("\nERROR --> DU APP : Failed to build ctxt setup req for RLC at duBuildAndSendUeContextModReq()");
+
+ /* Filling MAC Ue Reconfig */
+ ret = duBuildAndSendUeReCfgReqToMac(cellId, crnti, duUeCfg);
+ if(ret == RFAILED)
+ DU_LOG("\nERROR --> DU APP : Failed at build ctxt setup req for MAC at duBuildAndSendUeContextModReq()");
+
+ return ret;
+}
+/*******************************************************************
+ *
+ * @brief Processing Ue context mod request
+ *
+ * @details
+ *
+ *
+ * Function : duProcUeContextModReq
+ *
+ * Functionality:
+ * Processing Ue context mod request
+ *
+ * @params[in] DuUeCb *ueCb
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ *****************************************************************/
+
uint8_t duProcUeContextModReq(DuUeCb *ueCb)
{
-
- //TODO:After RB configuration are done Mod Response is triggered
- return ROK;
+ uint8_t ret, cellId;
+
+ ret = ROK;
+ if(ueCb)
+ {
+ cellId = duCb.actvCellLst[ueCb->f1UeDb->cellIdx]->cellId;
+ /* Send DL RRC msg for security Mode */
+ if(ueCb->f1UeDb->dlRrcMsg)
+ {
+ if(ueCb->f1UeDb->dlRrcMsg->rrcMsgPdu)
+ {
+ /* Sending DL RRC Message to RLC */
+ ret = duBuildAndSendDlRrcMsgToRlc(cellId, ueCb->rlcUeCfg, ueCb->f1UeDb->dlRrcMsg);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : Failed to send DL RRC msg in duProcUeContextModReq()");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg->rrcMsgPdu,\
+ ueCb->f1UeDb->dlRrcMsg->rrcMsgSize);
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCb->f1UeDb->dlRrcMsg, sizeof(F1DlRrcMsg));
+ }
+ }
+ }
+ else
+ {
+ 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()");
+ }
+ }
+ }
+ else
+ {
+ //TODO: To send the failure cause in UeContextModRsp
+ DU_LOG("ERROR --> DU APP : Failed to process UE CNTXT MOD REQ at duProcUeContextModReq()");
+ }
+ return ROK;
}
/**********************************************************************
End of file