X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_rach.c;h=c07a7261a920044e2f5b61b5cd6273b67e3a70f4;hb=42e50f5a3e46d7ca3afe97907b39d2a0c79a21c2;hp=de3a6e4730c0683f213516c31fc9571d8e219d6c;hpb=fcf583c575025651191abc59b4a4535a9d01eab1;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_rach.c b/src/5gnrsch/sch_rach.c index de3a6e473..c07a7261a 100644 --- a/src/5gnrsch/sch_rach.c +++ b/src/5gnrsch/sch_rach.c @@ -540,7 +540,7 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin uint8_t k0TblIdx = 0, k1TblIdx = 0, k2TblIdx = 0; uint8_t k0Index = 0, k1Index = 0, k2Index = 0; uint8_t k0 = 0, k1 = 0, k2 = 0; - uint8_t numK1 = 0; + uint8_t numK1 = 0, ret = OK; uint8_t puschMu = 0; uint8_t msg3Delta = 0, msg3MinSchTime = 0; #ifdef NR_TDD @@ -596,10 +596,6 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin ADD_DELTA_TO_TIME(dciTime, rarTime, k0, cell->numSlots); rarSlot = rarTime.slot; - /* If PDSCH is already scheduled on this slot, cannot schedule PDSCH for another UE here. */ - if(cell->schDlSlotInfo[rarSlot]->pdschUe != 0) - continue; - /* If Contention-FREE RA is in progress, allocate resources for * PUCCH for next UL message */ if(cell->raReq[ueId-1]->isCFRA) @@ -701,10 +697,20 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin if(cell->raReq[ueId-1]->isCFRA) { /* Allocate resources for PUCCH */ - schAllocPucchResource(cell, pucchTime, cell->raReq[ueId-1]->rachInd->crnti,NULLP, FALSE, NULLP); + cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId; + ret = schAllocPucchResource(cell, pucchTime, NULLP, NULLP, NULLP); + if(ret == RFAILED) + { + SCH_FREE(dciSlotAlloc, sizeof(RarAlloc)); + cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP; + DU_LOG("\nERROR --> SCH : Resource allocation for PUCCH failed for CFRA!"); + return false; + + } } else { + cell->schUlSlotInfo[msg3Time.slot]->puschUe = ueId; /* Allocate resources for msg3 */ msg3PuschInfo = schAllocMsg3Pusch(schInst, cell->raReq[ueId-1]->rachInd->crnti, k2Index, msg3Time, &(cell->raCb[ueId-1].msg3HqProc), FALSE); if(msg3PuschInfo) @@ -784,11 +790,6 @@ bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uin } cell->schDlSlotInfo[dciSlot]->pdcchUe = ueId; - cell->schDlSlotInfo[rarSlot]->pdschUe = ueId; - if(cell->raReq[ueId-1]->isCFRA) - cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId; - else - cell->schUlSlotInfo[msg3Time.slot]->puschUe = ueId; /* Create raCb at SCH */ createSchRaCb(ueId, cell->raReq[ueId-1], schInst);