X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_rach.c;h=28517e82b62f0fcfff960a75655a5a197d3cf810;hb=38ebc92a011353b8b2d9401efa4173c79114fa1c;hp=2e0527c7cde746597d83be27a224f4efa9a91f46;hpb=af8f9c8f6f7cd5e0a89e5dfa7a566fa5811e110c;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_rach.c b/src/5gnrsch/sch_rach.c index 2e0527c7c..28517e82b 100644 --- a/src/5gnrsch/sch_rach.c +++ b/src/5gnrsch/sch_rach.c @@ -109,7 +109,7 @@ bool schCheckPrachOcc(SchCellCb *cell, SlotTimingInfo prachOccasionTimingInfo) uint8_t schCalcPrachNumRb(SchCellCb *cell) { uint8_t tableIdx = 0; - uint16_t puschScs = fetchScsValue(cell->cellCfg.schInitialUlBwp.bwp.scs); + uint16_t puschScs = convertScsEnumValToScsVal(cell->cellCfg.schInitialUlBwp.bwp.scs); for(tableIdx=0; tableIdx < MAX_RACH_NUM_RB_IDX; tableIdx++) { @@ -223,11 +223,11 @@ uint16_t calculateRaRnti(uint8_t symbolIdx, uint8_t slotIdx, uint8_t freqIdx) **/ void createSchRaCb(uint16_t tcrnti, Inst schInst) { - uint8_t ueIdx = 0; + uint8_t ueId = 0; - GET_UE_IDX(tcrnti, ueIdx); - schCb[schInst].cells[schInst]->raCb[ueIdx -1].tcrnti = tcrnti; - schCb[schInst].cells[schInst]->raCb[ueIdx -1].msg4recvd = FALSE; + GET_UE_ID(tcrnti, ueId); + schCb[schInst].cells[schInst]->raCb[ueId -1].tcrnti = tcrnti; + schCb[schInst].cells[schInst]->raCb[ueId -1].msg4recvd = FALSE; } /** @@ -350,7 +350,7 @@ RaRspWindowStatus isInRaRspWindow(SchRaReq *raReq, SlotTimingInfo frameToCheck, * @param[in] Current timing of the cell * @return ROK **/ -bool schProcessRaReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId) +bool schProcessRaReq(Inst schInst, SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId) { bool k2Found = false; uint8_t k0TblIdx = 0, k2TblIdx = 0; @@ -469,7 +469,7 @@ bool schProcessRaReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId) } /* Allocate resources for msg3 */ - msg3PuschInfo = schAllocMsg3Pusch(cell->instIdx, cell->raReq[ueId-1]->rachInd->crnti, k2Index, msg3Time); + msg3PuschInfo = schAllocMsg3Pusch(schInst, cell->raReq[ueId-1]->rachInd->crnti, k2Index, msg3Time); if(msg3PuschInfo) { /* Fill RAR info */ @@ -523,7 +523,7 @@ bool schProcessRaReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId) cell->schUlSlotInfo[msg3Time.slot]->puschUe = ueId; /* Create raCb at SCH */ - createSchRaCb(cell->raReq[ueId-1]->rachInd->crnti, cell->instIdx); + createSchRaCb(cell->raReq[ueId-1]->rachInd->crnti, schInst); /* Remove RachInd from pending RA request list */ SCH_FREE(cell->raReq[ueId-1]->rachInd, sizeof(RachIndInfo)); @@ -553,7 +553,7 @@ uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst) SchRaReq *raReq = NULLP; float slotDuration; uint8_t winNumSlots; - uint8_t ueIdx; + uint8_t ueId; if(cell == NULLP) { @@ -562,8 +562,8 @@ uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst) } /* Storing RA request in cellCb */ - GET_UE_IDX(rachInd->crnti, ueIdx); - if(ueIdx <= 0) + GET_UE_ID(rachInd->crnti, ueId); + if(ueId <= 0) { DU_LOG("\nERROR --> SCH: Invalid CRNTI [%d]", rachInd->crnti); return RFAILED; @@ -589,10 +589,10 @@ uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst) /* Adding window size to window start time to get window end time */ ADD_DELTA_TO_TIME(raReq->winStartTime, raReq->winEndTime, winNumSlots); - cell->raReq[ueIdx -1] = raReq; + cell->raReq[ueId -1] = raReq; /* Adding UE Id to list of pending UEs to be scheduled */ - addUeToBeScheduled(cell, ueIdx); + addUeToBeScheduled(cell, ueId); return ROK; }