X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_common.c;h=d7b4016a7d9d42c9ae89df3a54ca741981e6f285;hb=f73456bd55152c329601f8286ae67fe9875025bc;hp=f86c20ae6d6d3da7f64480d65dac15a37e645b7b;hpb=f0f43ed6f745eec0ceb4e204c62f4dc36f1e8d7f;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index f86c20ae6..d7b4016a7 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -41,6 +41,7 @@ File: sch_common.c #include "du_app_mac_inf.h" #include "mac_sch_interface.h" #include "sch.h" +#include "sch_tmr.h" #include "sch_utils.h" /** @@ -535,13 +536,21 @@ uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst) memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo)); } - //send msg to MAC + /* Send msg to MAC */ ret = sendUlSchInfoToMac(&ulSchedInfo, schInst); if(ret != ROK) { DU_LOG("\nERROR --> SCH : Sending UL Sch info from SCH to MAC failed"); } + /* Update UL statistics */ + if(schCb[schInst].statistics.ulTotalPrbUsage) + { + schCb[schInst].statistics.ulTotalPrbUsage->numPrbUsedForTx += schUlSlotInfo->prbAlloc.numPrbAlloc; + schCb[schInst].statistics.ulTotalPrbUsage->totalPrbAvailForTx += MAX_NUM_RB; + } + + /* Re-initialize UL Slot */ schInitUlSlot(schUlSlotInfo); return ret; } @@ -1092,7 +1101,7 @@ SchPdschConfig pdschDedCfg, uint8_t ulAckListCount, uint8_t *UlAckTbl) /* Initialization the K0K1 structure, total num of slot and calculating the slot pattern length. */ memset(k0K1InfoTbl, 0, sizeof(SchK0K1TimingInfoTbl)); k0K1InfoTbl->tblSize = cell->numSlots; - totalCfgSlot = calculateSlotPatternLength(cell->cellCfg.scsCommon, cell->cellCfg.tddCfg.tddPeriod); + totalCfgSlot = calculateSlotPatternLength(cell->cellCfg.ssbScs, cell->cellCfg.tddCfg.tddPeriod); /* Storing time domain resource allocation list based on common or * dedicated configuration availability. */ @@ -1322,7 +1331,7 @@ SchK2TimingInfoTbl *msg3K2InfoTbl, SchK2TimingInfoTbl *k2InfoTbl) k2InfoTbl->tblSize = cell->numSlots; if(msg3K2InfoTbl) msg3K2InfoTbl->tblSize = cell->numSlots; - totalCfgSlot = calculateSlotPatternLength(cell->cellCfg.scsCommon, cell->cellCfg.tddCfg.tddPeriod); + totalCfgSlot = calculateSlotPatternLength(cell->cellCfg.ssbScs, cell->cellCfg.tddCfg.tddPeriod); /* Checking all possible indexes for K2. */ for(slotIdx = 0; slotIdx < cell->numSlots; slotIdx++) @@ -1340,7 +1349,7 @@ SchK2TimingInfoTbl *msg3K2InfoTbl, SchK2TimingInfoTbl *k2InfoTbl) k2Val = timeDomRsrcAllocList[k2Index].k2; if(!k2Val) { - switch(cell->cellCfg.scsCommon) + switch(cell->cellCfg.ssbScs) { case SCS_15KHZ: k2Val = DEFAULT_K2_VALUE_FOR_SCS15; @@ -1390,7 +1399,7 @@ SchK2TimingInfoTbl *msg3K2InfoTbl, SchK2TimingInfoTbl *k2InfoTbl) if(msg3K2InfoTbl) { - msg3Delta = puschDeltaTable[cell->cellCfg.numerology]; + msg3Delta = puschDeltaTable[cell->numerology]; /* Check for K2 for MSG3 */ /* Current slot + k2 should be either UL or FLEXI slot. @@ -1691,12 +1700,12 @@ void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgSchInfo *dlMsgAlloc,\ * Functionality: * fill DL message information for MSG4 and Dedicated DL Msg * -* @params[in] DlMsgInfo *dlMsgInfo, uint8_t crnti +* @params[in] DlMsgInfo *dlMsgInfo, uint16_t crnti * @params[in] bool isRetx, SchDlHqProcCb *hqP * @return void * *******************************************************************/ -void fillDlMsgInfo(DlMsgSchInfo *dlMsgSchInfo, uint8_t crnti, bool isRetx, SchDlHqProcCb *hqP) +void fillDlMsgInfo(DlMsgSchInfo *dlMsgSchInfo, uint16_t crnti, bool isRetx, SchDlHqProcCb *hqP) { hqP->tbInfo[0].isEnabled = TRUE; hqP->tbInfo[0].state = HQ_TB_WAITING; @@ -1983,8 +1992,8 @@ bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId if(schGetSlotSymbFrmt(dciTime.slot, cell->slotFrmtBitMap) == DL_SLOT) #endif { - if(ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2TblPrsnt) - k2InfoTbl = &ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2InfoTbl; + if(ueCb->k2TblPrsnt) + k2InfoTbl = &ueCb->k2InfoTbl; else k2InfoTbl = &cell->k2InfoTbl; @@ -1992,7 +2001,7 @@ bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId { k2Index = k2InfoTbl->k2TimingInfo[dciTime.slot].k2Indexes[k2TblIdx]; - if(!ueCb->ueCfg.spCellCfg.servCellRecfg.initUlBwp.k2TblPrsnt) + if(!ueCb->k2TblPrsnt) { k2Val = cell->cellCfg.ulCfgCommon.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[k2Index].k2; startSymb = cell->cellCfg.ulCfgCommon.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[k2Index].startSymbol; @@ -2225,7 +2234,7 @@ bool schGetMsg3K2(SchCellCb *cell, SchUlHqProcCb* msg3HqProc, uint16_t dlTime, S SchK2TimingInfoTbl *msg3K2InfoTbl=NULLP; SlotTimingInfo currTime, msg3TempTime; currTime = cell->slotInfo; - puschMu = cell->cellCfg.numerology; + puschMu = cell->numerology; if (isRetx) { @@ -2241,7 +2250,7 @@ bool schGetMsg3K2(SchCellCb *cell, SchUlHqProcCb* msg3HqProc, uint16_t dlTime, S { numK2 = cell->msg3K2InfoTbl.k2TimingInfo[dlTime].numK2; msg3K2InfoTbl = &cell->k2InfoTbl; - msg3MinSchTime = minMsg3SchTime[cell->cellCfg.numerology]; + msg3MinSchTime = minMsg3SchTime[cell->numerology]; msg3Delta = puschDeltaTable[puschMu]; }