- /* MUXing for msg4 */
- fillMacCe(&macCeData);
- macMuxPdu(&msg4DlData, &macCeData, macCb.macCell->macRaCb[0].msg4TbSize);
-
- /* storing msg4 Pdu in macDlSlot */
- if(macCb.macCell->macRaCb[0].msg4TxPdu)
- {
- msg4Alloc->msg4Info.msg4PduLen = macCb.macCell->macRaCb[0].msg4TbSize;
- MAC_ALLOC(msg4Alloc->msg4Info.msg4Pdu, msg4Alloc->msg4Info.msg4PduLen);
- if(msg4Alloc->msg4Info.msg4Pdu != NULLP)
- {
- memcpy(msg4Alloc->msg4Info.msg4Pdu, macCb.macCell->macRaCb[0].msg4TxPdu, \
- msg4Alloc->msg4Info.msg4PduLen);
- }
- }
- else
- {
- DU_LOG("\nMAC: Failed at macMuxPdu()");
- return RFAILED;
- }
- /* 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); */
+ /* storing msg4 Pdu in macDlSlot */
+ if(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu)
+ {
+ msg4Alloc->dlMsgInfo.dlMsgPduLen = msg4TxPduLen;
+ MAC_ALLOC(msg4Alloc->dlMsgInfo.dlMsgPdu, msg4Alloc->dlMsgInfo.dlMsgPduLen);
+ if(msg4Alloc->dlMsgInfo.dlMsgPdu != NULLP)
+ {
+ memcpy(msg4Alloc->dlMsgInfo.dlMsgPdu, macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu, \
+ msg4Alloc->dlMsgInfo.dlMsgPduLen);
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC: Failed at macMuxPdu()");
+ }
+}
+
+/**
+ * @brief Builds and Send the Muxed Pdu to Lower MAC
+ *
+ * @details
+ *
+ * Function : buildAndSendMuxPdu
+ *
+ * Build and Sends the Muxed Pdu to Lower MAC.
+ *
+ * @param[in] SlotIndInfo *slotInd
+ * @return void
+ **/
+
+void buildAndSendMuxPdu(SlotIndInfo currTimingInfo)
+{
+ uint16_t cellIdx;
+ MacDlSlot *currDlSlot = NULLP;
+ SlotIndInfo muxTimingInfo;
+ memset(&muxTimingInfo, 0, sizeof(SlotIndInfo));
+
+ GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
+
+ ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, PHY_DELTA_DL);
+ currDlSlot = &macCb.macCell[cellIdx]->dlSlot[muxTimingInfo.slot];
+ if(currDlSlot->dlInfo.dlMsgAlloc)
+ {
+ if(currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.isMsg4Pdu)
+ {
+ fillMsg4Pdu(currTimingInfo.cellId, currDlSlot->dlInfo.dlMsgAlloc);
+ currDlSlot = NULLP;