- currDlSlot = &macCb.macCell[cellIdx]->\
- dlSlot[dlSchedInfo->schSlotValue.rarTime.slot];
- currDlSlot->dlInfo.rarAlloc = dlSchedInfo->rarAlloc;
-
- /* MUXing of RAR */
- fillRarPdu(&currDlSlot->dlInfo.rarAlloc->rarInfo);
+ if(dlSchedInfo->rarAlloc[ueIdx] != NULLP)
+ {
+ currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlSchedInfo->schSlotValue.rarTime.slot];
+ currDlSlot->dlInfo.rarAlloc[ueIdx] = dlSchedInfo->rarAlloc[ueIdx];
+
+ /* MUXing of RAR */
+ fillRarPdu(&currDlSlot->dlInfo.rarAlloc[ueIdx]->rarInfo);
+ }
+
+ if(dlSchedInfo->dlMsgAlloc[ueIdx] != NULLP)
+ {
+ currDlSlot = &macCb.macCell[cellIdx]->\
+ dlSlot[dlSchedInfo->schSlotValue.dlMsgTime.slot];
+ currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = dlSchedInfo->dlMsgAlloc[ueIdx]; /* copy msg4 alloc pointer in MAC slot info */
+ currDlSlot->dlInfo.cellId = dlSchedInfo->cellId;
+
+ /* Check if the downlink pdu is msg4 */
+ for(schInfoIdx=0; schInfoIdx < dlSchedInfo->dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++)
+ {
+ if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.isMsg4Pdu)
+ {
+ GET_UE_ID(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.crnti, ueId);
+ ueIdx = ueId -1;
+ macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TbSize = \
+ dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.codeword[0].tbSize;
+ }
+ else
+ {
+ memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
+ /* Send LC schedule result to RLC */
+ if((dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU) ||
+ (dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH))
+ sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime, ueIdx, schInfoIdx);
+ }
+ }
+ }