From: pborla Date: Tue, 27 Feb 2024 18:10:29 +0000 (+0530) Subject: [Epic-ID: ODUHIGH-538][Issue-ID: ODUHIGH-571] Adding XML parser for macros defined... X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=5256719522354a90ea688e9c95a1212d0104b34e;p=o-du%2Fl2.git [Epic-ID: ODUHIGH-538][Issue-ID: ODUHIGH-571] Adding XML parser for macros defined common_def file Change-Id: I33f90b4749fa665a267c53bf84dee3b64228181a Signed-off-by: pborla --- diff --git a/build/config/odu_config.xml b/build/config/odu_config.xml index a7f0d1816..0aeed96ac 100644 --- a/build/config/odu_config.xml +++ b/build/config/odu_config.xml @@ -14,8 +14,6 @@ 1 ORAN OAM DU 29 - 3 - 32 192.168.130.81 192.168.130.82 192.168.130.80 @@ -627,28 +625,6 @@ - 10 - 2 - 4 - 1 - 32 - 3 - 64 - 16 - 2 - 1 - 100 - 500 - 4 - 20 - 106 - 5 - 60000 - 4 - 10 - 1024 - 15 - 14 2 @@ -710,6 +686,35 @@ + + 10 + 1 + 1 + 5 + 60000 + + diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index 859144334..a91755a63 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -3807,7 +3807,7 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) { GET_CELL_IDX(currTimingInfo.cellId, cellIdx); /* consider phy delay */ - ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,PHY_DELTA_DL, macCb.macCell[cellIdx]->numOfSlots); + ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,gConfigInfo.gPhyDeltaDl, macCb.macCell[cellIdx]->numOfSlots); dlTtiReqTimingInfo.cellId = currTimingInfo.cellId; macCellCfg = macCb.macCell[cellIdx]->macCellCfg; @@ -4504,7 +4504,7 @@ uint16_t fillUlTtiReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t pre macCellCfg = macCb.macCell[cellIdx]->macCellCfg; /* add PHY delta */ - ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,PHY_DELTA_UL, macCb.macCell[cellIdx]->numOfSlots); + ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,gConfigInfo.gPhyDeltaUl, macCb.macCell[cellIdx]->numOfSlots); currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % macCb.macCell[cellIdx]->numOfSlots]; LWR_MAC_ALLOC(ulTtiElem, (sizeof(fapi_api_queue_elem_t) + sizeof(fapi_ul_tti_req_t))); diff --git a/src/5gnrmac/mac_msg_hdl.c b/src/5gnrmac/mac_msg_hdl.c index d5544ba2d..a211003b3 100644 --- a/src/5gnrmac/mac_msg_hdl.c +++ b/src/5gnrmac/mac_msg_hdl.c @@ -514,7 +514,7 @@ uint8_t sendSchedRptToRlc(DlSchedInfo dlInfo, SlotTimingInfo slotInfo, uint8_t u uint8_t MacProcCellStart(Pst *pst, CellStartInfo *cellStart) { DU_LOG("\nINFO --> MAC : Handling cell start request"); - gSlotCount = 0; + gConfigInfo.gSlotCount = 0; sendToLowerMac(START_REQUEST, 0, cellStart); MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellStart, \ diff --git a/src/5gnrmac/mac_slot_ind.c b/src/5gnrmac/mac_slot_ind.c index e17d220ac..cbcf1c347 100644 --- a/src/5gnrmac/mac_slot_ind.c +++ b/src/5gnrmac/mac_slot_ind.c @@ -333,7 +333,7 @@ void buildAndSendMuxPdu(SlotTimingInfo currTimingInfo) GET_CELL_IDX(currTimingInfo.cellId, cellIdx); - ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, PHY_DELTA_DL, macCb.macCell[cellIdx]->numOfSlots); + ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, gConfigInfo.gPhyDeltaDl, macCb.macCell[cellIdx]->numOfSlots); currDlSlot = &macCb.macCell[cellIdx]->dlSlot[muxTimingInfo.slot]; for(ueIdx=0; ueIdxcellId, cellIdx); macCb.macCell[cellIdx]->state = CELL_STATE_UP; @@ -557,7 +557,7 @@ uint8_t fapiMacSlotInd(Pst *pst, SlotTimingInfo *slotInd) /*First Slot Ind is for CellUp. Any other Slot, will be notified to DUAPP as * SLOT_IND*/ - if(gSlotCount == 1) + if(gConfigInfo.gSlotCount == 1) { /* send cell up indication to du app */ ret = sendCellUpIndMacToDuApp(slotInd->cellId); diff --git a/src/5gnrrlc/rlc_tmr.c b/src/5gnrrlc/rlc_tmr.c index 2f3a18732..6f7cc6140 100755 --- a/src/5gnrrlc/rlc_tmr.c +++ b/src/5gnrrlc/rlc_tmr.c @@ -159,7 +159,7 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) case EVENT_RLC_UE_THROUGHPUT_TMR: { RlcThpt *thptCb = (RlcThpt *)cb; - TMR_CALCUATE_WAIT(arg.wait, ODU_UE_THROUGHPUT_PRINT_TIME_INTERVAL, gCb->genCfg.timeRes); + TMR_CALCUATE_WAIT(arg.wait, gConfigInfo.gUeThrptTimeIntervl, gCb->genCfg.timeRes); arg.timers = &thptCb->ueTputInfo.ueThptTmr; arg.max = RLC_MAX_THPT_TMR; break; @@ -175,7 +175,7 @@ void rlcStartTmr(RlcCb *gCb, PTR cb, int16_t tmrEvnt) case EVENT_RLC_SNSSAI_THROUGHPUT_TMR: { RlcThpt *thptCb = (RlcThpt *)cb; - TMR_CALCUATE_WAIT(arg.wait, ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL, gCb->genCfg.timeRes); + TMR_CALCUATE_WAIT(arg.wait, gConfigInfo.gSnssaiThrptTimeIntervl, gCb->genCfg.timeRes); arg.timers = &thptCb->snssaiTputInfo.snssaiThptTmr; arg.max = RLC_MAX_THPT_TMR; break; @@ -515,7 +515,7 @@ void rlcUeThptTmrExpiry(PTR cb) RlcThpt *rlcThptCb = (RlcThpt*)cb; /* If cell is not up, throughput details cannot be printed */ - if(gCellStatus != CELL_UP) + if(gConfigInfo.gCellStatus != CELL_UP) { /* Restart timer */ rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)(rlcThptCb), EVENT_RLC_UE_THROUGHPUT_TMR); @@ -537,7 +537,7 @@ void rlcUeThptTmrExpiry(PTR cb) * Since our dataVol is in bytes, multiplying 0.008 to covert into kilobits i.e. * Throughput[kbits/sec] = (dataVol * 0.008 * 1000)/time in ms */ - tpt = (double)(rlcThptCb->ueTputInfo.thptPerUe[ueIdx].dataVol * 8)/(double)ODU_UE_THROUGHPUT_PRINT_TIME_INTERVAL; + tpt = (double)(rlcThptCb->ueTputInfo.thptPerUe[ueIdx].dataVol * 8)/(double)gConfigInfo.gUeThrptTimeIntervl; DU_LOG("\nUE Id : %d DL Tpt : %.2Lf", rlcThptCb->ueTputInfo.thptPerUe[ueIdx].ueId, tpt); rlcThptCb->ueTputInfo.thptPerUe[ueIdx].dataVol = 0; @@ -571,7 +571,7 @@ void rlcSnssaiThptTmrExpiry(PTR cb) static uint8_t snssaiTputBitmap = DIR_NONE; /* If cell is not up, throughput details cannot be printed */ - if(gCellStatus != CELL_UP) + if(gConfigInfo.gCellStatus != CELL_UP) { /* Restart timer */ rlcStartTmr(RLC_GET_RLCCB(rlcThptCb->inst), (PTR)(rlcThptCb), EVENT_RLC_SNSSAI_THROUGHPUT_TMR); diff --git a/src/5gnrrlc/rlc_upr_inf_mgr.c b/src/5gnrrlc/rlc_upr_inf_mgr.c index a717adf6a..296f2c449 100755 --- a/src/5gnrrlc/rlc_upr_inf_mgr.c +++ b/src/5gnrrlc/rlc_upr_inf_mgr.c @@ -1074,7 +1074,7 @@ uint8_t rlcCalculateTputPerSnssai(CmLListCp *snssaiList, Direction dir) while(node) { snssaiNode = (RlcTptPerSnssai *)node->node; - snssaiNode->tpt = (double)(snssaiNode->dataVol * 8)/(double)(ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL * 0.001); + snssaiNode->tpt = (double)(snssaiNode->dataVol * 8)/(double)(gConfigInfo.gSnssaiThrptTimeIntervl * 0.001); if(dir == DIR_DL) { diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index 51673306c..6cba700a4 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -534,7 +534,7 @@ uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst) memset(&ulSchedInfo, 0, sizeof(UlSchedInfo)); /* add PHY delta */ - ADD_DELTA_TO_TIME(cell->slotInfo,ulTimingInfo,PHY_DELTA_UL+SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo,ulTimingInfo,gConfigInfo.gPhyDeltaUl+SCHED_DELTA, cell->numSlots); ulSchedInfo.cellId = cell->cellId; ulSchedInfo.slotIndInfo.cellId = ulSchedInfo.cellId; @@ -2081,7 +2081,7 @@ bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId } /* Calculating time frame to send DCI for SR */ - ADD_DELTA_TO_TIME(currTime, dciTime, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(currTime, dciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); #ifdef NR_TDD if(schGetSlotSymbFrmt(dciTime.slot, cell->slotFrmtBitMap) == DL_SLOT) #endif @@ -2264,7 +2264,7 @@ uint8_t schMsg3RetxSchedulingForUe(SchRaCb *raCb) currTime = cell->slotInfo; /* Calculating time frame to send DCI for MSG3 Retx*/ - ADD_DELTA_TO_TIME(currTime, dciTime, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(currTime, dciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); #ifdef NR_TDD /* Consider this slot for sending DCI, only if it is a DL slot */ if(schGetSlotSymbFrmt(dciSlot, raCb->cell->slotFrmtBitMap) == DL_SLOT) diff --git a/src/5gnrsch/sch_drx.c b/src/5gnrsch/sch_drx.c index 4eb815ac8..e46cdbe87 100644 --- a/src/5gnrsch/sch_drx.c +++ b/src/5gnrsch/sch_drx.c @@ -515,17 +515,17 @@ void schDrxUeReCfgTimer(SchCellCb *cell, SchUeCb *ueCb) if((ueCb->drxUeCb.onDurationExpiryDistance != SCH_DRX_INVALID_DISTANCE) && (ueCb->drxUeCb.onDurationExpiryIndex != SCH_DRX_INVALID_INDEX)) { currentSlotTime = cell->slotInfo.sfn * cell->numSlots + cell->slotInfo.slot; - currentSlotIndx = (currentSlotTime + PHY_DELTA_DL + SCHED_DELTA)%MAX_DRX_SIZE; + currentSlotIndx = (currentSlotTime + gConfigInfo.gPhyDeltaDl + SCHED_DELTA)%MAX_DRX_SIZE; if(currentSlotIndx >= ueCb->drxUeCb.onDurationExpiryIndex ) { onDurExpSlotTime = currentSlotTime + ((ueCb->drxUeCb.onDurationExpiryDistance +1) * MAX_DRX_SIZE) +\ - (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + PHY_DELTA_DL + SCHED_DELTA); + (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + gConfigInfo.gPhyDeltaDl + SCHED_DELTA); } else { onDurExpSlotTime = currentSlotTime + ((ueCb->drxUeCb.onDurationExpiryDistance) * MAX_DRX_SIZE) +\ - (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + PHY_DELTA_DL + SCHED_DELTA); + (ueCb->drxUeCb.onDurationExpiryIndex - currentSlotIndx + gConfigInfo.gPhyDeltaDl + SCHED_DELTA); } if(onDurTime <= onDurExpSlotTime) { @@ -717,8 +717,8 @@ void schHdlDrxOnDurStrtTimer(SchCellCb *cell) uint16_t dlIndx = 0, ulIndx=0; SlotTimingInfo dlSlotInfo, ulSlotInfo; - ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); - ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots); dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE; ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE; @@ -803,7 +803,7 @@ void schHdlDrxStartShortCycleTimer(SchCellCb *cell, SchUeCb *ueCb) } /* recalculate the new index of on duration start based on short cycle */ - schAddUeInOndurationList(cell, ueCb, PHY_DELTA_DL + SCHED_DELTA); + schAddUeInOndurationList(cell, ueCb, gConfigInfo.gPhyDeltaDl + SCHED_DELTA); /* if any node is present in short cycle exp list then remove the node from list */ if(ueCb->drxUeCb.shortCycleExpiryIndex != SCH_DRX_INVALID_INDEX && ueCb->drxUeCb.shortCycleDistance != SCH_DRX_INVALID_DISTANCE) @@ -923,8 +923,8 @@ void schHdlDrxDlHqRetxStrtTimer(SchCellCb *cell) uint16_t dlIndx = 0, ulIndx=0; SlotTimingInfo dlSlotInfo, ulSlotInfo; - ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); - ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots); dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE; ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE; @@ -1086,8 +1086,8 @@ void schHdlDrxUlHqRetxStrtTimer(SchCellCb *cell) uint16_t dlIndx = 0, ulIndx=0; SlotTimingInfo dlSlotInfo, ulSlotInfo; - ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); - ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots); dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE; ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE; @@ -1227,8 +1227,8 @@ void schHdlDrxOnDurExpiryTimer(SchCellCb *cell) uint16_t dlIndx = 0, ulIndx = 0; SlotTimingInfo dlSlotInfo, ulSlotInfo; - ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); - ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots); dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE; ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE; @@ -1348,8 +1348,8 @@ void schHdlDrxInActvExpiryTimer(SchCellCb *cell) uint16_t dlIndx = 0, ulIndx = 0; SlotTimingInfo dlSlotInfo, ulSlotInfo; - ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); - ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots); dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE; ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE; @@ -1403,7 +1403,7 @@ void schHdlDrxShortCycleExpiryTimerForDlDirection(SchCellCb *cell, uint16_t dlI ueCb->drxUeCb.onDurationStartDistance = SCH_DRX_INVALID_DISTANCE; /* Recalculate on-duration with long cycle */ - schAddUeInOndurationList(cell, ueCb, PHY_DELTA_DL + SCHED_DELTA); + schAddUeInOndurationList(cell, ueCb, gConfigInfo.gPhyDeltaDl + SCHED_DELTA); } } } @@ -1470,8 +1470,8 @@ void schHdlDrxShortCycleExpiryTimer(SchCellCb *cell) uint16_t dlIndx = 0, ulIndx= 0; SlotTimingInfo dlSlotInfo, ulSlotInfo; - ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); - ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots); dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE; ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE; @@ -1646,8 +1646,8 @@ void schHdlDrxDlHarqExpireTimer(SchCellCb *cell) uint16_t dlIndx = 0, ulIndx = 0; SlotTimingInfo dlSlotInfo, ulSlotInfo; - ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); - ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots); dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE; ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE; @@ -1872,8 +1872,8 @@ void schHdlDrxUlHarqExpireTimer(SchCellCb *cell) uint16_t dlIndx = 0, ulIndx = 0; SlotTimingInfo dlSlotInfo, ulSlotInfo; - ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); - ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, PHY_DELTA_UL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, dlSlotInfo, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(cell->slotInfo, ulSlotInfo, gConfigInfo.gPhyDeltaUl + SCHED_DELTA, cell->numSlots); dlIndx = (dlSlotInfo.sfn*MAX_SLOTS+dlSlotInfo.slot)%MAX_DRX_SIZE; ulIndx = (ulSlotInfo.sfn*MAX_SLOTS+ulSlotInfo.slot)%MAX_DRX_SIZE; diff --git a/src/5gnrsch/sch_fcfs.c b/src/5gnrsch/sch_fcfs.c index e949f3b10..f98a1652d 100644 --- a/src/5gnrsch/sch_fcfs.c +++ b/src/5gnrsch/sch_fcfs.c @@ -1274,7 +1274,7 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst) else { #ifdef NR_DRX - schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_DL + SCHED_DELTA); + schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaDl + SCHED_DELTA); #endif } } @@ -1309,7 +1309,7 @@ void schFcfsScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst schInst) else { #ifdef NR_DRX - schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_UL + SCHED_DELTA); + schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaUl + SCHED_DELTA); #endif } } diff --git a/src/5gnrsch/sch_rach.c b/src/5gnrsch/sch_rach.c index c07a7261a..025f38c4d 100644 --- a/src/5gnrsch/sch_rach.c +++ b/src/5gnrsch/sch_rach.c @@ -568,7 +568,7 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin } /* Calculating time frame to send DCI for RAR */ - ADD_DELTA_TO_TIME(currTime, dciTime, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(currTime, dciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); dciSlot = dciTime.slot; #ifdef NR_TDD /* Consider this slot for sending DCI, only if it is a DL slot */ diff --git a/src/5gnrsch/sch_slice_based.c b/src/5gnrsch/sch_slice_based.c index ece81a09b..49f026952 100644 --- a/src/5gnrsch/sch_slice_based.c +++ b/src/5gnrsch/sch_slice_based.c @@ -1266,7 +1266,7 @@ void schSliceBasedScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst sc else { #ifdef NR_DRX - schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_DL + SCHED_DELTA); + schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaDl + SCHED_DELTA); #endif } } @@ -1301,7 +1301,7 @@ void schSliceBasedScheduleSlot(SchCellCb *cell, SlotTimingInfo *slotInd, Inst sc else { #ifdef NR_DRX - schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], PHY_DELTA_UL + SCHED_DELTA); + schHdlDrxInActvStrtTmr(cell, &cell->ueCb[ueId-1], gConfigInfo.gPhyDeltaUl + SCHED_DELTA); #endif } } diff --git a/src/5gnrsch/sch_slot_ind.c b/src/5gnrsch/sch_slot_ind.c index 8b423b27a..f9292914a 100644 --- a/src/5gnrsch/sch_slot_ind.c +++ b/src/5gnrsch/sch_slot_ind.c @@ -313,11 +313,11 @@ void schCalcSlotValues(SlotTimingInfo slotInd, SchSlotValue *schSlotValue, uint1 * on PHY_DELTA + SCHED_DELTA + BO_DELTA * ****************************************************************/ - ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, PHY_DELTA_DL, numOfSlots); - ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots); - ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots); - ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots); - ADD_DELTA_TO_TIME(slotInd, schSlotValue->ulDciTime, PHY_DELTA_DL + SCHED_DELTA, numOfSlots); + ADD_DELTA_TO_TIME(slotInd, schSlotValue->currentTime, gConfigInfo.gPhyDeltaDl, numOfSlots); + ADD_DELTA_TO_TIME(slotInd, schSlotValue->broadcastTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots); + ADD_DELTA_TO_TIME(slotInd, schSlotValue->rarTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots); + ADD_DELTA_TO_TIME(slotInd, schSlotValue->dlMsgTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots); + ADD_DELTA_TO_TIME(slotInd, schSlotValue->ulDciTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, numOfSlots); } /******************************************************************* @@ -424,7 +424,7 @@ bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, SchUeCb *ueCb = NULLP; SchK0K1TimingInfoTbl *k0K1InfoTbl; - ADD_DELTA_TO_TIME(currTime, (*pdcchTime), PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(currTime, (*pdcchTime), gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); #ifdef NR_TDD if(schGetSlotSymbFrmt(pdcchTime->slot, cell->slotFrmtBitMap) != DL_SLOT) { @@ -577,7 +577,7 @@ uint8_t schProcDlPageAlloc(SchCellCb *cell, SlotTimingInfo currTime, Inst schIns { dlPageAlloc.cellId = currTime.cellId; - ADD_DELTA_TO_TIME(currTime, dlPageAlloc.dlPageTime, PHY_DELTA_DL + SCHED_DELTA, cell->numSlots); + ADD_DELTA_TO_TIME(currTime, dlPageAlloc.dlPageTime, gConfigInfo.gPhyDeltaDl + SCHED_DELTA, cell->numSlots); dlPageAlloc.shortMsgInd = FALSE; pdschTime = dlPageAlloc.dlPageTime; diff --git a/src/cm/common_def.h b/src/cm/common_def.h index 531335d12..e07f6a67d 100644 --- a/src/cm/common_def.h +++ b/src/cm/common_def.h @@ -56,7 +56,6 @@ #define SCH_INST_START 1 #define SCH_MAX_INST 1 -#define RADIO_FRAME_DURATION 10 /* Time duration of a radio frame in ms */ /* MAX values */ #define MAX_NUM_CELL 2 /* Changed to 2 to support cell Id 2 even if there is only one cell in DU */ #define MAX_NUM_MU 4 @@ -69,15 +68,6 @@ #define MAX_NUM_HARQ_PROC 16 /* spec 38.331, nrofHARQ-ProcessesForPDSCH */ #define MAX_NUM_TB_PER_UE 2 /* spec 38.331, maxNrofCodeWordsScheduledByDCI */ -/* 5G ORAN phy delay */ -#ifdef NR_TDD -#define PHY_DELTA_DL 2 -#define PHY_DELTA_UL 0 -#else -#define PHY_DELTA_DL 1 -#define PHY_DELTA_UL 0 -#endif - /* SELECTORS */ #define ODU_SELECTOR_LC 0 #define ODU_SELECTOR_TC 1 @@ -115,9 +105,6 @@ #define MAX_NUM_RB TOTAL_PRB_20MHZ_MU0 /* value for numerology 0, 20 MHz */ #endif -#define ODU_UE_THROUGHPUT_PRINT_TIME_INTERVAL 5 /* in milliseconds */ -#define ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL 60000 /* in milliseconds */ - /*Spec 38.331 Sec 6.4: Maximum number of paging occasion per paging frame*/ #define MAX_PO_PER_PF 4 @@ -132,7 +119,6 @@ /*First SCS in kHz as per 3gpp spec 38.211 Table 4.2-1 */ #define BASE_SCS 15 -#define MAX_NUM_STATS_CFG 2 /* Max number of statistics configuration/Subscription supported */ #define MAX_NUM_STATS_GRP 5 /* Max number of statistics group per configuration request */ #define MAX_NUM_STATS 10 /* Max number of statistics per group */ @@ -384,9 +370,19 @@ typedef struct tddCfg }TDDCfg; #endif -OduCellStatus gCellStatus; -uint64_t gSlotCount; -uint64_t gDlDataRcvdCnt; /* Number of DL data received at EGTP */ +typedef struct gConfiguration +{ + uint8_t gPhyDeltaDl; + uint8_t gPhyDeltaUl; + uint8_t gUeThrptTimeIntervl; + uint8_t gSnssaiThrptTimeIntervl; + uint8_t gRadioFrameDuration; + OduCellStatus gCellStatus; + uint64_t gSlotCount; + uint64_t gDlDataRcvdCnt; /* Number of DL data received at EGTP */ +}GConfiguration; + +GConfiguration gConfigInfo; void fillCoresetFeqDomAllocMap(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDomain); void oduCpyFixBufToMsg(uint8_t *fixBuf, Buffer *mBuf, uint16_t len); diff --git a/src/cm/du_app_mac_inf.h b/src/cm/du_app_mac_inf.h index c7db1848e..19308f2e9 100644 --- a/src/cm/du_app_mac_inf.h +++ b/src/cm/du_app_mac_inf.h @@ -875,7 +875,7 @@ typedef struct beamformingConf typedef struct csiRsCfg { - uint8_t *csiFreqDomainAlloc; + uint8_t *csiFreqDomainAlloc; uint8_t csiNrofPorts; uint8_t csirsfirstOFDMSymbolInTimeDomain; uint8_t csirsfirstOFDMSymbolInTimeDomain2; @@ -893,7 +893,7 @@ typedef struct macCellCfg CarrierCfg carrCfg; /* Carrier configuration */ CellCfg cellCfg; /* Cell Configuration*/ SsbCfg ssbCfg; /* SSB configuration */ - CsiRsCfg csiRsCfg; /*Reference: 38.331 CSI-MeasConfig*/ + CsiRsCfg csiRsCfg; /*Reference: 38.331 CSI-RS-ResourceMapping */ PrachCfg prachCfg; /* PRACH Configuration */ #ifdef NR_TDD TDDCfg tddCfg; /* TDD periodicity and slot configuration */ diff --git a/src/du_app/du_cell_mgr.c b/src/du_app/du_cell_mgr.c index b0eb8651c..889a89769 100644 --- a/src/du_app/du_cell_mgr.c +++ b/src/du_app/du_cell_mgr.c @@ -366,7 +366,7 @@ uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId) { DU_LOG("\nINFO --> DU APP : 5G-NR Cell %d is UP", cellId->cellId); cellCb->cellStatus = ACTIVATED; - gCellStatus = CELL_UP; + gConfigInfo.gCellStatus = CELL_UP; if(duCfgParam.tempSliceCfg.numOfRrmPolicy) BuildAndSendSliceConfigReq(); @@ -425,7 +425,7 @@ uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp) } memset(duCb.actvCellLst[cellIdx], 0, sizeof(DuCellCb)); - gCellStatus = CELL_DOWN; + gConfigInfo.gCellStatus = CELL_DOWN; #ifdef O1_ENABLE DU_LOG("\nINFO --> DU APP : Raise cell down alarm for cell id=%d", deleteRsp->cellId); diff --git a/src/du_app/du_cfg.c b/src/du_app/du_cfg.c index ffd077b79..3b5fca31a 100644 --- a/src/du_app/du_cfg.c +++ b/src/du_app/du_cfg.c @@ -1686,13 +1686,21 @@ uint8_t parsePrachCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PrachCfg *prac * ****************************************************************/ uint8_t parseCsiRsCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CsiRsCfg *csiRsCfg) { + uint8_t csiFreqDomainAlloc=0; memset(csiRsCfg, 0, sizeof(CsiRsCfg)); cur = cur -> xmlChildrenNode; while(cur != NULL) { if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_FREQ")) && (cur->ns == ns)) { - csiRsCfg->csiFreqDomainAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + csiFreqDomainAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + DU_ALLOC(csiRsCfg->csiFreqDomainAlloc, sizeof(uint8_t)); + if(!csiRsCfg->csiFreqDomainAlloc) + { + DU_LOG("\nERROR --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__); + return RFAILED; + } + memcpy(csiRsCfg->csiFreqDomainAlloc, &csiFreqDomainAlloc, sizeof(uint8_t)); } if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_PORTS")) && (cur->ns == ns)) @@ -4924,6 +4932,61 @@ uint8_t parseE2ConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, E2apDb * return ROK; } +/******************************************************************* + * + * @brief Fill Global config Parameters + * + * @details + * + * Function : parseGlobalConfigParams + * + * Functionality: Fill Global config Parmeters + * + * @params[in] XML document pointer + * XML namespace + * Current node in XML + * Pointer to structure to be filled + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t parseGlobalConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) +{ + + memset(&gConfigInfo, 0, sizeof(GConfiguration)); + cur = cur->xmlChildrenNode; + while (cur != NULL) + { + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"RADIO_FRAME_DURATION")) && (cur->ns == ns)) + { + gConfigInfo.gRadioFrameDuration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ODU_UE_THROUGHPUT_PRINT_TIME_INTERVAL")) && (cur->ns == ns)) + { + gConfigInfo.gUeThrptTimeIntervl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL")) && (cur->ns == ns)) + { + gConfigInfo.gSnssaiThrptTimeIntervl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PHY_DELTA_DL")) && (cur->ns == ns)) + { + gConfigInfo.gPhyDeltaDl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + + if ((!xmlStrcmp(cur->name, (const xmlChar *)"PHY_DELTA_UL")) && (cur->ns == ns)) + { + gConfigInfo.gPhyDeltaUl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); + } + cur = cur -> next; + } + return ROK; +} + /******************************************************************* * * @brief Fill DU Config Parmeters @@ -4991,16 +5054,6 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) duCfgParam.maxNumDrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); } - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE_SUPPORTED")) && (cur->ns == ns)) - { - duCfgParam.maxSupportedUes = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - - if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE")) && (cur->ns == ns)) - { - duCfgParam.maxUe = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); - } - #ifdef O1_ENABLE if( getStartupConfig(&g_cfg) != ROK ) { @@ -5054,7 +5107,7 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) duCfgParam.egtpParams.localIp.ipV4Pres = true; duCfgParam.egtpParams.destIp.ipV4Pres = true; duCfgParam.egtpParams.destIp.ipV4Addr = cuIp; - duCfgParam.egtpParams.maxTunnelId = duCfgParam.maxNumDrb * duCfgParam.maxSupportedUes; + duCfgParam.egtpParams.maxTunnelId = duCfgParam.maxNumDrb * MAX_NUM_UE; } if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIB_PARAMS")) && (cur->ns == ns)) @@ -5120,6 +5173,15 @@ uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2NodeConfigUpdate.timer), 1); } } + + if((!xmlStrcmp(cur->name, (const xmlChar *)"GLOBAL_CFG")) && (cur->ns == ns)) + { + if(parseGlobalConfigParams(doc, ns, cur) != ROK) + { + return RFAILED; + } + } + cur = cur -> next; } return ROK; @@ -5311,8 +5373,6 @@ void printDuConfig() DU_LOG("Lower MAC CORE ID %d\n", duCfgParam.threadInfo.lwrMacCoreId); DU_LOG("MAX NUM DRB %d\n", duCfgParam.maxNumDrb); - DU_LOG("MAX SUPPORTED UE %d\n", duCfgParam.maxSupportedUes); - DU_LOG("MAX UE %d\n",duCfgParam.maxUe); sctp = &duCfgParam.sctpParams; DU_LOG("\n ** SCTP PARAMETER ** \n"); diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index 4b5865584..d82297a6d 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -1161,8 +1161,6 @@ typedef struct duCfgParams uint32_t duId; char *duName; uint16_t maxNumDrb; - uint16_t maxSupportedUes; - uint32_t maxUe; ThreadInfo threadInfo; SctpParams sctpParams; /* SCTP Params */ F1EgtpParams egtpParams; /* EGTP Params */ diff --git a/src/du_app/du_egtp.c b/src/du_app/du_egtp.c index a5d63aa30..752760c76 100644 --- a/src/du_app/du_egtp.c +++ b/src/du_app/du_egtp.c @@ -60,7 +60,7 @@ uint8_t egtpActvInit(Ent entity, Inst inst, Region region, Reason reason) memset (&egtpCb, 0, sizeof(EgtpGlobalCb)); protType = CM_INET_PROTO_UDP; - gDlDataRcvdCnt = 0; + gConfigInfo.gDlDataRcvdCnt = 0; return ROK; } @@ -920,10 +920,10 @@ uint8_t egtpRecvMsg() ret = cmInetRecvMsg(&egtpCb.sockFd, &egtpCb.dstCb.dstAddr, &memInfo, &recvBuf, (int16_t *)&bufLen, CM_INET_NO_FLAG); if(ret == ROK && recvBuf != NULLP) { - DU_LOG("\nDEBUG --> EGTP : Received DL Message[%ld]\n", gDlDataRcvdCnt + 1); + DU_LOG("\nDEBUG --> EGTP : Received DL Message[%ld]\n", gConfigInfo.gDlDataRcvdCnt + 1); //ODU_PRINT_MSG(recvBuf, 0 ,0); egtpHdlRecvData(recvBuf); - gDlDataRcvdCnt++; + gConfigInfo.gDlDataRcvdCnt++; } } diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index 323fcf112..5a179322a 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -142,7 +142,7 @@ uint8_t duBuildRlcCfg(Inst inst) genCfg = &(rlcMngmt.t.cfg.s.gen); /*----------- Fill General Configuration Parameters ---------*/ - genCfg->maxUe = duCfgParam.maxUe; + genCfg->maxUe = MAX_NUM_UE; genCfg->maxKwuSaps = 2; genCfg->maxUdxSaps = 1; genCfg->rlcMode = (inst == RLC_UL_INST) ? @@ -395,9 +395,9 @@ uint8_t duProcCfgComplete() cell->cellInfo.plmn[idx1].mnc[1] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mnc[1]; cell->cellInfo.plmn[idx1].mnc[2] = duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].plmn.mnc[2]; } - cell->cellInfo.maxUe = duCfgParam.maxUe; + cell->cellInfo.maxUe = MAX_NUM_UE; cell->cellStatus = CELL_OUT_OF_SERVICE; - gCellStatus = CELL_DOWN; + gConfigInfo.gCellStatus = CELL_DOWN; duCb.cfgCellLst[duCb.numCfgCells] = cell; duCb.numCfgCells++; }