X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_rach.c;h=0e9bd93b9e951cf573adc4da0caa17e4ef7e9220;hb=9665386af091888e0e62b83ce91c25c973eb33aa;hp=7cec7b8608958822885921b4be4e2878c972629b;hpb=65443172dd60a6ea312bd3a15959dbf54ad7f045;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_rach.c b/src/5gnrsch/sch_rach.c index 7cec7b860..0e9bd93b9 100644 --- a/src/5gnrsch/sch_rach.c +++ b/src/5gnrsch/sch_rach.c @@ -132,7 +132,7 @@ uint8_t schAllocMsg3Pusch(Inst schInst, uint16_t slot, uint16_t crnti, \ /* Slot allocation for msg3 based on 38.214 section 6.1.2.1 */ msg3SlotAlloc = slot + k2 + delta; - msg3SlotAlloc = msg3SlotAlloc % SCH_NUM_SLOTS; + msg3SlotAlloc = msg3SlotAlloc % cell->numSlots; startRb = cell->schUlSlotInfo[msg3SlotAlloc]->puschCurrentPrb; tbSize = schCalcTbSize(8); /* 6 bytes msg3 and 2 bytes header */ @@ -152,12 +152,12 @@ uint8_t schAllocMsg3Pusch(Inst schInst, uint16_t slot, uint16_t crnti, \ SCH_ALLOC(schUlSlotInfo->schPuschInfo, sizeof(SchPuschInfo)); if(!schUlSlotInfo->schPuschInfo) { - DU_LOG("SCH: Memory allocation failed in schAllocMsg3Pusch"); + DU_LOG("\nERROR --> SCH : Memory allocation failed in schAllocMsg3Pusch"); return RFAILED; } tbSize = 0; /* since nPrb has been incremented, recalculating tbSize */ tbSize = schCalcTbSizeFromNPrb(numRb, mcs, numPdschSymbols); - + tbSize = tbSize/8;/*bits to byte conversion*/ schUlSlotInfo->schPuschInfo->crnti = crnti; schUlSlotInfo->schPuschInfo->harqProcId = SCH_HARQ_PROC_ID; schUlSlotInfo->schPuschInfo->resAllocType = SCH_ALLOC_TYPE_1; @@ -165,7 +165,9 @@ uint8_t schAllocMsg3Pusch(Inst schInst, uint16_t slot, uint16_t crnti, \ schUlSlotInfo->schPuschInfo->fdAlloc.numPrb = numRb; schUlSlotInfo->schPuschInfo->tdAlloc.startSymb = startSymb; schUlSlotInfo->schPuschInfo->tdAlloc.numSymb = symbLen; - schUlSlotInfo->schPuschInfo->tbInfo.mcs = mcs; + schUlSlotInfo->schPuschInfo->tbInfo.qamOrder = 2; /* QPSK modulation */ + schUlSlotInfo->schPuschInfo->tbInfo.mcs = mcs; + schUlSlotInfo->schPuschInfo->tbInfo.mcsTable = SCH_MCS_TABLE_QAM_64; schUlSlotInfo->schPuschInfo->tbInfo.ndi = 1; /* new transmission */ schUlSlotInfo->schPuschInfo->tbInfo.rv = 0; schUlSlotInfo->schPuschInfo->tbInfo.tbSize = tbSize; /*Considering 2 PRBs */ @@ -175,7 +177,6 @@ uint8_t schAllocMsg3Pusch(Inst schInst, uint16_t slot, uint16_t crnti, \ *msg3StartRb = startRb; *msg3NumRb = numRb; - return ROK; } @@ -205,7 +206,7 @@ uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst) uint8_t ret = ROK; /* RAR will sent with a delay of RAR_DELAY */ - rarSlot = (rachInd->timingInfo.slot+RAR_DELAY+PHY_DELTA)%SCH_NUM_SLOTS; + rarSlot = (rachInd->timingInfo.slot+RAR_DELAY+PHY_DELTA_DL)%cell->numSlots; SchDlSlotInfo *schDlSlotInfo = cell->schDlSlotInfo[rarSlot]; /* RAR will sent in the next slot */ @@ -213,7 +214,7 @@ uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst) SCH_ALLOC(rarInfo, sizeof(RarInfo)); if(rarInfo == NULLP) { - DU_LOG("\nMAC: Memory Allocation failed for rarInfo"); + DU_LOG("\nERROR --> SCH : Memory Allocation failed for rarInfo"); return RFAILED; }