+
+ /* Add HARQ Proc to DL HARQ Proc Entity in UE */
+ addDlHqProcInUe(currDlSlot->dlInfo.schSlotValue.dlMsgTime, &macCb.macCell[cellIdx]->ueCb[ueIdx], \
+ dlSchedInfo->dlMsgAlloc[ueIdx]);
+ }
+ }
+ else
+ {
+ /* For retransmission, fetch PDU to be retransmitted from DL HARQ entity and schedule on corresponding slot */
+
+ /* As of now this loop will run only once for one TB.
+ * TODO : update handling of fetched TB appropriately when support for two TB is added
+ */
+ for(cwIdx = 0; cwIdx < dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg->numCodewords; cwIdx++)
+ {
+ /* Fetch TB to be retransmitted */
+ txPduLen = dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg->codeword[cwIdx].tbSize;
+ retxTb = fetchTbfromDlHarqProc(currDlSlot->dlInfo.schSlotValue.dlMsgTime, \
+ &macCb.macCell[cellIdx]->ueCb[ueIdx], \
+ dlSchedInfo->dlMsgAlloc[ueIdx]->harqProcNum, txPduLen);
+
+ /* Store PDU in corresponding DL slot */
+ MAC_ALLOC(txPdu, txPduLen);
+ if(!txPdu)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcDlAlloc");
+ return RFAILED;
+ }
+ memcpy(txPdu, retxTb, txPduLen);
+
+ currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPduLen = txPduLen;
+ currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu = txPdu;
+ }