X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_slot_ind.c;h=55824759676c2264dba1bcc1154473819320f1fe;hb=deeae2741b8520edcd37ecb20a40f1de821ceadf;hp=b382047ea69d7aa394797148c18af6072740696b;hpb=5ea4c59cb4dd37164953218b0bd355284e11d22c;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_slot_ind.c b/src/5gnrsch/sch_slot_ind.c index b382047ea..558247596 100644 --- a/src/5gnrsch/sch_slot_ind.c +++ b/src/5gnrsch/sch_slot_ind.c @@ -118,8 +118,12 @@ int schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) { int ret = ROK; uint8_t ssb_rep; + uint16_t sfn = slotInd->sfn; + uint16_t slot = slotInd->slot; + uint16_t sfnSlot = 0; DlBrdcstAlloc dlBrdcstAlloc; dlBrdcstAlloc.ssbTrans = NO_SSB; + dlBrdcstAlloc.sib1Trans = NO_SIB1; SchCellCb *cell; #ifdef LTE_L2_MEAS @@ -127,26 +131,60 @@ int schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) #endif cell = schCb[schInst].cells[schInst]; - ssb_rep = cell->cellCfg.ssbPeriod; +// schDlResAlloc(cell, slotInd); + + ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod; memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo)); - memcpy(&dlBrdcstAlloc.slotIndInfo, slotInd, sizeof(SlotIndInfo)); dlBrdcstAlloc.cellId = cell->cellId; dlBrdcstAlloc.ssbIdxSupported = 1; + if((slot + SCHED_DELTA) >= 10) + { + sfn++; + } + slot = ((slot + SCHED_DELTA) % 10 ); + sfnSlot = ((sfn * 10) + slot); + + dlBrdcstAlloc.slotIndInfo.sfn = sfn; + dlBrdcstAlloc.slotIndInfo.slot = slot; + /* Identify SSB ocassion*/ - if ((slotInd->sfn % SCH_MIB_TRANS == 0))// && (slotInd.slot == 0)) + if (sfnSlot % SCH_MIB_TRANS == 0) { dlBrdcstAlloc.ssbTrans = SSB_TRANSMISSION; } - else if ((slotInd->sfn % ssb_rep == 0))// && (slotInd.slot == 0)) + else if (sfnSlot % ssb_rep == 0) { dlBrdcstAlloc.ssbTrans = SSB_REPEAT; } else { - ; + /* not SSB occassion */ } - schCmnDlAlloc(cell, &dlBrdcstAlloc); + + /* Identify SIB1 occasions */ + if(sfnSlot % cell->cellCfg.sib1SchCfg.sib1NewTxPeriod == 0) + { + dlBrdcstAlloc.sib1Trans = SIB1_TRANSMISSION; + } + else if (sfnSlot % cell->cellCfg.sib1SchCfg.sib1RepetitionPeriod == 0) + { + dlBrdcstAlloc.sib1Trans = SIB1_REPITITION; + } + else + { + /* not SIB1 occassion */ + } + + if(dlBrdcstAlloc.ssbTrans || dlBrdcstAlloc.sib1Trans) + { + ret = schCmnDlAlloc(cell, &dlBrdcstAlloc); + if(ret != ROK) + { + DU_LOG("\nschCmnDlAlloc failed"); + RETVALUE(ret); + } + } //send msg to MAC ret = sendDlBrdcstAllocToMac(&dlBrdcstAlloc, schInst); if(ret != ROK) @@ -154,6 +192,9 @@ int schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst) DU_LOG("\nSending DL Broadcast allocation from SCH to MAC failed"); RETVALUE(ret); } + + schUlResAlloc(cell, schInst); + return ret; }