X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_slot_ind.c;h=a936494184581d4559d1374e87b52d4d11664ec8;hb=56db1b2ff587365594f48f3274f806180eda4cb2;hp=281cd2112533f8994108d80bc9d31c041bdd0d51;hpb=2dc9d6735bc5ff973a761b7d6b3f71f97e95d60e;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_slot_ind.c b/src/5gnrsch/sch_slot_ind.c index 281cd2112..a93649418 100644 --- a/src/5gnrsch/sch_slot_ind.c +++ b/src/5gnrsch/sch_slot_ind.c @@ -50,8 +50,6 @@ SchMacDlAllocFunc schMacDlAllocOpts[] = }; SchCb schCb[SCH_MAX_INST]; -int schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t - offsetPointA); /******************************************************************* * @@ -75,7 +73,7 @@ uint8_t sendDlAllocToMac(DlSchedInfo *dlSchedInfo, Inst inst) memset(&pst, 0, sizeof(Pst)); FILL_PST_SCH_TO_MAC(pst, inst); - pst.event = EVENT_DL_ALLOC; + pst.event = EVENT_DL_SCH_INFO; return(*schMacDlAllocOpts[pst.selector])(&pst, dlSchedInfo); @@ -98,7 +96,7 @@ uint8_t sendDlAllocToMac(DlSchedInfo *dlSchedInfo, Inst inst) * RFAILED - failure * * ****************************************************************/ -void schCalcSlotValues(SlotIndInfo slotInd, SchSlotValue *schSlotValue) +void schCalcSlotValues(SlotTimingInfo slotInd, SchSlotValue *schSlotValue) { /**************************************************************** * PHY_DELTA - the physical layer delta * @@ -182,6 +180,12 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM } ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0; } + + if (!dlMsgAlloc->numLc) + { + DU_LOG("\nDEBUG --> SCH : No bo for any lcid\n"); + return ROK; + } /* pdcch and pdsch data is filled */ schDlRsrcAllocDlMsg(dlMsgAlloc, cell, crnti, &accumalatedSize, slot); @@ -223,7 +227,7 @@ uint8_t schFillBoGrantDlSchedInfo(SchCellCb *cell, DlSchedInfo *dlSchedInfo, DlM * RFAILED - failure * * ****************************************************************/ -uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) +uint8_t schProcessSlotInd(SlotTimingInfo *slotInd, Inst schInst) { uint8_t ssb_rep, ueIdx, lcgIdx, ret = ROK; uint16_t slot; @@ -243,8 +247,13 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) dlBrdcstAlloc->sib1Trans = NO_SIB1; cell = schCb[schInst].cells[schInst]; + if(cell == NULLP) + { + DU_LOG("\nERROR --> SCH : Cell Does not exist"); + return RFAILED; + } ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod; - memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo)); + memcpy(&cell->slotInfo, slotInd, sizeof(SlotTimingInfo)); dlBrdcstAlloc->ssbIdxSupported = 1; slot = dlSchedInfo.schSlotValue.currentTime.slot; @@ -323,9 +332,11 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) schFillRar(rarAlloc, cell->schDlSlotInfo[slot]->rarInfo->raRnti, cell->cellCfg.phyCellId, - cell->cellCfg.ssbSchCfg.ssbOffsetPointA); + cell->cellCfg.ssbSchCfg.ssbOffsetPointA, + dlBrdcstAlloc->ssbTrans, + dlBrdcstAlloc->sib1Trans); - SCH_FREE(cell->schDlSlotInfo[slot]->rarInfo,sizeof(RarAlloc)); + SCH_FREE(cell->schDlSlotInfo[slot]->rarInfo,sizeof(RarInfo)); cell->schDlSlotInfo[slot]->rarInfo = NULLP; } @@ -349,7 +360,7 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) sizeof(DlMsgInfo)); /* pdcch and pdsch data is filled */ - schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.dlMsgTime.slot); + schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.dlMsgTime.slot, dlBrdcstAlloc->ssbTrans, dlBrdcstAlloc->sib1Trans); /* PUCCH resource */ schAllocPucchResource(cell, msg4Alloc->dlMsgInfo.crnti, dlSchedInfo.schSlotValue.dlMsgTime.slot); @@ -390,13 +401,13 @@ uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) } memset(dciInfo,0,sizeof(DciInfo)); /* update the SFN and SLOT */ - memcpy(&dlSchedInfo.schSlotValue.ulDciTime, slotInd, sizeof(SlotIndInfo)); + memcpy(&dlSchedInfo.schSlotValue.ulDciTime, slotInd, sizeof(SlotTimingInfo)); slot = dlSchedInfo.schSlotValue.ulDciTime.slot; /* Update PUSCH allocation */ schFillPuschAlloc(ueCb, slot, totDataReq, &schPuschInfo); /* Fill DCI for UL grant */ schFillUlDci(ueCb, schPuschInfo, dciInfo); - memcpy(&dciInfo->slotIndInfo, &dlSchedInfo.schSlotValue.ulDciTime, sizeof(SlotIndInfo)); + memcpy(&dciInfo->slotIndInfo, &dlSchedInfo.schSlotValue.ulDciTime, sizeof(SlotTimingInfo)); dlSchedInfo.ulGrant = dciInfo; } }