X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_common.c;h=e064b8376370c9c3c152af8d9dbaaef00a3c205b;hb=60d14257f866aab93574d57cceecad4859670f82;hp=d92d513aefef81ae79862a0b75d272929f140e5c;hpb=2dc9d6735bc5ff973a761b7d6b3f71f97e95d60e;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index d92d513ae..e064b8376 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -181,6 +181,7 @@ void schPrachResAlloc(SchCellCb *cell, UlSchedInfo *ulSchedInfo, SlotIndInfo pra uint8_t prachOcas = 0; uint8_t dataType = 0; uint8_t idx = 0; + uint8_t subFrame = 0; SchUlSlotInfo *schUlSlotInfo = NULLP; puschScs = cell->cellCfg.schInitialUlBwp.bwp.scs; @@ -194,45 +195,59 @@ void schPrachResAlloc(SchCellCb *cell, UlSchedInfo *ulSchedInfo, SlotIndInfo pra if((prachOccasionTimingInfo.sfn%x) == y) { +#ifdef NR_TDD + subFrame = prachOccasionTimingInfo.slot/2; +#else + subFrame = prachOccasionTimingInfo.slot; +#endif /* check for subFrame number */ - if ((1 << prachOccasionTimingInfo.slot) & prachSubframe) + if ((1 << subFrame) & prachSubframe) { - /* prach ocassion present in this subframe */ - - prachFormat = prachCfgIdxTable[prachCfgIdx][0]; - prachStartSymbol = prachCfgIdxTable[prachCfgIdx][4]; - prachOcas = prachCfgIdxTable[prachCfgIdx][6]; - - /* freq domain resource determination for RACH*/ - freqStart = cell->cellCfg.schRachCfg.msg1FreqStart; - /* numRa determined as 𝑛 belonging {0,1,.., M − 1}, - * where M is given by msg1Fdm */ - numRa = (cell->cellCfg.schRachCfg.msg1Fdm - 1); - for(idx=0; idxcellCfg.schRachCfg.rootSeqLen) - { - if(numRbForPrachTable[idx][1] == cell->cellCfg.schRachCfg.prachSubcSpacing) - { - if(numRbForPrachTable[idx][2] == puschScs) - { - break; - } - } - } - } - numPrachRb = numRbForPrachTable[idx][3]; - dataType |= SCH_DATATYPE_PRACH; - /* Considering first slot in the frame for PRACH */ - idx = 0; - schUlSlotInfo->assignedPrb[idx] = freqStart+numPrachRb; + /* prach ocassion present in this subframe */ +#ifdef NR_TDD + if(UL_SLOT != schGetSlotSymbFrmt(prachOccasionTimingInfo.slot, cell->slotFrmtBitMap)) + { + DU_LOG("\nERROR --> SCH : PrachCfgIdx %d doesn't support UL slot", prachCfgIdx); + } + else +#endif + { + prachFormat = prachCfgIdxTable[prachCfgIdx][0]; + prachStartSymbol = prachCfgIdxTable[prachCfgIdx][4]; + prachOcas = prachCfgIdxTable[prachCfgIdx][6]; + + /* freq domain resource determination for RACH*/ + freqStart = cell->cellCfg.schRachCfg.msg1FreqStart; + /* numRa determined as 𝑛 belonging {0,1,.., M − 1}, + * where M is given by msg1Fdm */ + numRa = (cell->cellCfg.schRachCfg.msg1Fdm - 1); + for(idx=0; idxcellCfg.schRachCfg.rootSeqLen) + { + if(numRbForPrachTable[idx][1] == cell->cellCfg.schRachCfg.prachSubcSpacing) + { + if(numRbForPrachTable[idx][2] == puschScs) + { + break; + } + } + } + } + numPrachRb = numRbForPrachTable[idx][3]; + dataType |= SCH_DATATYPE_PRACH; + /* Considering first slot in the frame for PRACH */ + idx = 0; + schUlSlotInfo->assignedPrb[idx] = freqStart+numPrachRb; + } + ulSchedInfo->dataType = dataType; + /* prach info */ + ulSchedInfo->prachSchInfo.numPrachOcas = prachOcas; + ulSchedInfo->prachSchInfo.prachFormat = prachFormat; + ulSchedInfo->prachSchInfo.numRa = numRa; + ulSchedInfo->prachSchInfo.prachStartSymb = prachStartSymbol; + DU_LOG("\nINFO --> SCH : RACH occassion set for slot %d", prachOccasionTimingInfo.slot); } - ulSchedInfo->dataType = dataType; - /* prach info */ - ulSchedInfo->prachSchInfo.numPrachOcas = prachOcas; - ulSchedInfo->prachSchInfo.prachFormat = prachFormat; - ulSchedInfo->prachSchInfo.numRa = numRa; - ulSchedInfo->prachSchInfo.prachStartSymb = prachStartSymbol; } }