+ if(dlSchedInfo->isBroadcastPres)
+ {
+ currDlSlot = &macCb.macCell->dlSlot[dlSchedInfo->schSlotValue.broadcastTime.slot];
+ currDlSlot->dlInfo.isBroadcastPres = true;
+ memcpy(&currDlSlot->dlInfo.brdcstAlloc, &dlSchedInfo->brdcstAlloc, sizeof(DlBrdcstAlloc));
+ }
+
+ if(dlSchedInfo->rarAlloc != NULLP)
+ {
+ currDlSlot = &macCb.macCell->dlSlot[dlSchedInfo->schSlotValue.rarTime.slot];
+ currDlSlot->dlInfo.rarAlloc = dlSchedInfo->rarAlloc;
+
+ /* MUXing of RAR */
+ fillRarPdu(&currDlSlot->dlInfo.rarAlloc->rarInfo);
+ }
+
+ if(dlSchedInfo->msg4Alloc != NULLP)
+ {
+ Msg4Alloc *msg4Alloc = NULLP;
+ MacDlData msg4DlData;
+ MacCeInfo macCeData;
+
+ currDlSlot = &macCb.macCell->dlSlot[dlSchedInfo->schSlotValue.msg4Time.slot];
+ currDlSlot->dlInfo.msg4Alloc = dlSchedInfo->msg4Alloc; /* copy msg4 alloc pointer in MAC slot info */
+ msg4Alloc = dlSchedInfo->msg4Alloc;
+
+ memset(&msg4DlData, 0, sizeof(MacDlData));
+ memset(&macCeData, 0, sizeof(MacCeInfo));
+
+ macCb.macCell->macRaCb[0].msg4TbSize = msg4Alloc->msg4PdschCfg.codeword[0].tbSize;
+
+ if(macCb.macCell->macRaCb[0].msg4Pdu != NULLP)
+ {
+ MAC_ALLOC(msg4DlData.pduInfo[0].dlPdu, \
+ macCb.macCell->macRaCb[0].msg4PduLen);
+ if(msg4DlData.pduInfo[0].dlPdu != NULLP)
+ {
+ fillMsg4DlData(&msg4DlData);
+ }
+ }
+
+ /* MUXing for msg4 */
+ fillMacCe(&macCeData);
+ macMuxPdu(&msg4DlData, &macCeData, macCb.macCell->macRaCb[0].msg4TbSize);
+
+ /* storing msg4 Pdu in macDlSlot */
+ MAC_ALLOC(msg4Alloc->msg4Info.msg4Pdu, macCb.macCell->macRaCb[0].msg4PduLen);
+ if(msg4Alloc->msg4Info.msg4Pdu != NULLP)
+ {
+ msg4Alloc->msg4Info.msg4Pdu = macCb.macCell->macRaCb[0].msg4Pdu;
+ msg4Alloc->msg4Info.msg4PduLen = macCb.macCell->macRaCb[0].msg4PduLen;
+ }
+
+ /* TODO: Free all allocated memory, after the usage */
+ /* MAC_FREE(macCb.macCell->macRaCb[0].msg4TxPdu, \
+ macCb.macCell->macRaCb[0].msg4TbSize); // TODO: To be freed after re-transmission is successful.
+ MAC_FREE(dlSchedInfo->msg4Alloc->msg4Info.msg4Pdu,\
+ macCb.macCell->macRaCb[0].msg4PduLen); //TODO: To be freed after lower-mac is succesfull
+ MAC_FREE(msg4DlData.pduInfo[0].dlPdu, macCb.macCell->macRaCb[0].msg4PduLen);
+ MAC_FREE(macCb.macCell->macRaCb[0].msg4Pdu, macCb.macCell->macRaCb[0].msg4PduLen); */
+ }