+ /* Allocate the rarInfo, this pointer will be checked at schProcessSlotInd function */
+ SCH_ALLOC(rarInfo, sizeof(RarInfo));
+ if(rarInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Memory Allocation failed for rarInfo");
+ return RFAILED;
+ }
+
+ schDlSlotInfo->rarInfo = rarInfo;
+
+ /* create raCb at SCH */
+ createSchRaCb(cell->raReq[ueIdx]->rachInd->crnti, cell->instIdx);
+
+ /* allocate resources for msg3 */
+ msg3PuschInfo = schAllocMsg3Pusch(cell->instIdx, rarSlot, cell->raReq[ueIdx]->rachInd->crnti, msg3Slot);
+ if(msg3PuschInfo)
+ {
+ /* fill RAR info */
+ rarInfo->raRnti = cell->raReq[ueIdx]->raRnti;
+ rarInfo->tcrnti = cell->raReq[ueIdx]->rachInd->crnti;
+ rarInfo->RAPID = cell->raReq[ueIdx]->rachInd->preambleIdx;
+ rarInfo->ta = cell->raReq[ueIdx]->rachInd->timingAdv;
+ rarInfo->ulGrant.bwpSize = cell->cellCfg.schInitialUlBwp.bwp.freqAlloc.numPrb;
+ /* Spec 38.213, section 8.2, 0 : MSG3 PUSCH will be transmitted without frequency hopping */
+ rarInfo->ulGrant.freqHopFlag = 0;
+ rarInfo->ulGrant.msg3FreqAlloc.startPrb = msg3PuschInfo->fdAlloc.startPrb;
+ rarInfo->ulGrant.msg3FreqAlloc.numPrb = msg3PuschInfo->fdAlloc.numPrb;
+ rarInfo->ulGrant.k2Index = k2Index;
+ rarInfo->ulGrant.mcs = msg3PuschInfo->tbInfo.mcs;
+ rarInfo->ulGrant.tpc = 3; /* TODO : Check appropriate value to be filled */
+ /* Spec 38.213, section 8.2 : In a contention based random access
+ * procedure, the CSI request field is reserved. */
+ rarInfo->ulGrant.csiReq = 0;
+ }
+
+ SCH_FREE(cell->raReq[ueIdx]->rachInd, sizeof(RachIndInfo));
+ SCH_FREE(cell->raReq[ueIdx], sizeof(SchRaReq));
+ ueIdx++;
+
+ } /* End of while(ueIdx < MAX_NUM_UE) */
+}
+
+/**
+ * @brief process rach indication function.
+ *
+ * @details
+ *
+ * Function : schProcessRachInd
+ *
+ * This function process rach indication
+ *
+ * @param[in] rachInd parameters
+ * @param[in] shed instance
+ * @return ROK
+ **/
+uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst)
+{
+ SchCellCb *cell = schCb[schInst].cells[schInst];
+ SchRaReq *raReq = NULLP;
+ float slotDuration;
+ uint8_t winNumSlots;
+ uint8_t ueIdx;
+
+ SCH_ALLOC(raReq, sizeof(SchRaReq));
+ if(!raReq)