* @param[in] UlSchedInfo *ulSchedInfo, UL scheduling info
* @return void
**/
-int schPrachResAlloc(SchCellCb *cell, UlSchedInfo *ulSchedInfo, SlotIndInfo prachOccasionTimingInfo)
+void schPrachResAlloc(SchCellCb *cell, UlSchedInfo *ulSchedInfo, SlotIndInfo prachOccasionTimingInfo)
{
uint8_t puschScs;
uint8_t numPrachRb = 0;
y = prachCfgIdxTable[prachCfgIdx][2];
prachSubframe = prachCfgIdxTable[prachCfgIdx][3];
- if((prachOccasionTimingInfo.sfn%x) != y)
+ if((prachOccasionTimingInfo.sfn%x) == y)
{
- /* prach occasion does not lie in this SFN */
- DU_LOG("\nPRACH ocassion doesn't lie in this SFN");
- return RFAILED;
+ /* check for subFrame number */
+ if ((1 << prachOccasionTimingInfo.slot) & 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; idx<MAX_RACH_NUM_RB_IDX; idx++)
+ {
+ if(numRbForPrachTable[idx][0] == cell->cellCfg.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;
}
- /* check for subFrame number */
- if ((1 << prachOccasionTimingInfo.slot) & 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; idx<MAX_RACH_NUM_RB_IDX; idx++)
- {
- if(numRbForPrachTable[idx][0] == cell->cellCfg.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;
-
- return ROK;
}
/**