- /* Fill PDCCH and PDSCH scheduling information for Msg4 */
- if((schDlRsrcAllocMsg4(cell, pdschTime, ueIdx, dciSlotAlloc, k0Index)) != ROK)
+ SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgAlloc));
+ if(dciSlotAlloc == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Memory Allocation failed for dciSlotAlloc");
+ return false;
+ }
+ cell->schDlSlotInfo[pdcchSlot]->dlMsgAlloc[ueId-1] = dciSlotAlloc;
+
+ /* Fill PDCCH and PDSCH scheduling information for Msg4 */
+ if((schDlRsrcAllocMsg4(cell, pdschTime, ueId, dciSlotAlloc, k0Index)) != ROK)
+ {
+ DU_LOG("\nERROR --> SCH: Scheduling of Msg4 failed in slot [%d]", pdschSlot);
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+ cell->schDlSlotInfo[pdcchSlot]->dlMsgAlloc[ueId-1] = NULLP;
+ return false;
+ }
+
+ /* Check if both DCI and RAR are sent in the same slot.
+ * If not, allocate memory RAR PDSCH slot to store RAR info
+ */
+ if(pdcchSlot == pdschSlot)
+ dciSlotAlloc->pduPres = BOTH;
+ else
+ {
+ /* Allocate memory to schedule rarSlot to send RAR, pointer will be checked at schProcessSlotInd() */
+ SCH_ALLOC(msg4SlotAlloc, sizeof(DlMsgAlloc));
+ if(msg4SlotAlloc == NULLP)