uint8_t *retxTb = NULLP, *txPdu = NULLP;
uint16_t txPduLen = 0;
MacDlSlot *currDlSlot = NULLP;
- DlMsgSchInfo schedInfo;
+ DlMsgSchInfo *schedInfo;
DlHarqProcCb *hqProcCb = NULLP;
#ifdef CALL_FLOW_DEBUG_LOG
dlSlot[dlSchedInfo->schSlotValue.broadcastTime.slot];
currDlSlot->dlInfo.isBroadcastPres = true;
memcpy(&currDlSlot->dlInfo.brdcstAlloc, &dlSchedInfo->brdcstAlloc, sizeof(DlBrdcstAlloc));
- currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg.dci.pdschCfg = \
- &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg;
}
for(ueIdx=0; ueIdx<MAX_NUM_UE; ueIdx++)
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;
+
+ if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdcchCfg && dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdcchCfg->coresetCfg.coreSetType == CORESET_TYPE0)
+ {
+ MAC_ALLOC(macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status, sizeof(bool));
+ }
/* Check if the downlink pdu is msg4 */
- for(schInfoIdx=0; schInfoIdx < dlSchedInfo->dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++)
+ if((macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status))
{
- if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.isMsg4Pdu)
- {
- GET_UE_ID(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.crnti, ueId);
- ueIdx = ueId -1;
- schedInfo = dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx];
- hqProcCb = &macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4HqInfo;
+ GET_UE_ID(dlSchedInfo->dlMsgAlloc[ueIdx]->crnti, ueId);
+ ueIdx = ueId -1;
+ schedInfo = dlSchedInfo->dlMsgAlloc[ueIdx];
+ hqProcCb = &macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4HqInfo;
- if(!dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].isRetx)
+ if(!dlSchedInfo->dlMsgAlloc[ueIdx]->transportBlock[0].ndi)
+ {
+ /* First transmission of MSG4 */
+ hqProcCb->procId = schedInfo->harqProcNum;
+ for(cwIdx = 0; cwIdx < schedInfo->dlMsgPdschCfg->numCodewords; cwIdx++)
{
- /* First transmission of MSG4 */
- hqProcCb->procId = schedInfo.dlMsgInfo.harqProcNum;
- for(cwIdx = 0; cwIdx < schedInfo.dlMsgPdschCfg.numCodewords; cwIdx++)
- {
- memcpy(&hqProcCb->tbInfo[hqProcCb->numTb].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
- sizeof(SlotTimingInfo));
- hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo.dlMsgPdschCfg.codeword[cwIdx].tbSize;
- hqProcCb->numTb++;
- }
+ memcpy(&hqProcCb->tbInfo[hqProcCb->numTb].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
+ sizeof(SlotTimingInfo));
+ hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo->dlMsgPdschCfg->codeword[cwIdx].tbSize;
+ hqProcCb->numTb++;
}
- else
+ }
+ else
+ {
+ /* MSG4 retransmission */
+ if(hqProcCb->procId == schedInfo->harqProcNum)
{
- /* MSG4 retransmission */
- if(hqProcCb->procId == schedInfo.dlMsgInfo.harqProcNum)
- {
- memcpy(&hqProcCb->tbInfo[0].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
- sizeof(SlotTimingInfo));
- }
+ memcpy(&hqProcCb->tbInfo[0].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
+ sizeof(SlotTimingInfo));
}
}
- else
+ }
+ else
+ {
+ memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
+
+ if(!dlSchedInfo->dlMsgAlloc[ueIdx]->transportBlock[0].ndi)
{
- memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
-
- if(!dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].isRetx)
+ /* If new data transmission is scheduled, send schedule results to RLC */
+ if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg)
{
- /* If new data transmission is scheduled, send schedule results 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);
+ sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime, ueIdx, schInfoIdx);
- /* Add HARQ Proc to DL HARQ Proc Entity in UE */
- addDlHqProcInUe(currDlSlot->dlInfo.schSlotValue.dlMsgTime, &macCb.macCell[cellIdx]->ueCb[ueIdx], \
- dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx]);
- }
+ /* Add HARQ Proc to DL HARQ Proc Entity in UE */
+ addDlHqProcInUe(currDlSlot->dlInfo.schSlotValue.dlMsgTime, &macCb.macCell[cellIdx]->ueCb[ueIdx], \
+ dlSchedInfo->dlMsgAlloc[ueIdx]);
}
- else
+ }
+ 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++)
{
- /* 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]->dlMsgSchedInfo[schInfoIdx].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)
{
- /* Fetch TB to be retransmitted */
- txPduLen = dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.codeword[cwIdx].tbSize;
- retxTb = fetchTbfromDlHarqProc(currDlSlot->dlInfo.schSlotValue.dlMsgTime, \
- &macCb.macCell[cellIdx]->ueCb[ueIdx], \
- dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.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]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPduLen = txPduLen;
- currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu = 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;
}
}
}
return RFAILED;
}
memcpy(currDlSlot->pageAllocInfo, dlPageAlloc, sizeof(DlPageAlloc));
- currDlSlot->pageAllocInfo->pagePdcchCfg.dci.pdschCfg = \
- &currDlSlot->pageAllocInfo->pagePdschCfg;
}
else
{
memset(&msg4DlData, 0, sizeof(MacDlData));
memset(&macCeData, 0, sizeof(MacCeInfo));
- GET_UE_ID(msg4SchInfo->dlMsgInfo.crnti, ueId);
+ GET_UE_ID(msg4SchInfo->crnti, ueId);
ueIdx = ueId -1;
if(macCb.macCell[cellIdx] == NULLP)
/* storing msg4 Pdu in macDlSlot */
if(hqProcCb->tbInfo[0].tb)
{
- msg4SchInfo->dlMsgInfo.dlMsgPduLen = msg4TxPduLen;
- MAC_ALLOC(msg4SchInfo->dlMsgInfo.dlMsgPdu, msg4SchInfo->dlMsgInfo.dlMsgPduLen);
- if(msg4SchInfo->dlMsgInfo.dlMsgPdu != NULLP)
+ msg4SchInfo->dlMsgPduLen = msg4TxPduLen;
+ MAC_ALLOC(msg4SchInfo->dlMsgPdu, msg4SchInfo->dlMsgPduLen);
+ if(msg4SchInfo->dlMsgPdu != NULLP)
{
- memcpy(msg4SchInfo->dlMsgInfo.dlMsgPdu, hqProcCb->tbInfo[0].tb, \
- msg4SchInfo->dlMsgInfo.dlMsgPduLen);
+ memcpy(msg4SchInfo->dlMsgPdu, hqProcCb->tbInfo[0].tb, \
+ msg4SchInfo->dlMsgPduLen);
}
}
else
void buildAndSendMuxPdu(SlotTimingInfo currTimingInfo)
{
uint8_t ueIdx;
- uint8_t schInfoIdx;
uint16_t cellIdx;
MacDlSlot *currDlSlot = NULLP;
SlotTimingInfo muxTimingInfo;
GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
- ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, PHY_DELTA_DL, macCb.macCell[cellIdx]->numOfSlots);
+ ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, gConfigInfo.gPhyDeltaDl, macCb.macCell[cellIdx]->numOfSlots);
currDlSlot = &macCb.macCell[cellIdx]->dlSlot[muxTimingInfo.slot];
for(ueIdx=0; ueIdx<MAX_NUM_UE; ueIdx++)
{
if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx])
{
- for(schInfoIdx=0; schInfoIdx<currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++)
+ if((macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status)&& (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg))
{
- if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.isMsg4Pdu) &&
- ((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU) ||
- (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH)))
- {
- fillMsg4Pdu(currTimingInfo.cellId, &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx]);
- }
+ fillMsg4Pdu(currTimingInfo.cellId, currDlSlot->dlInfo.dlMsgAlloc[ueIdx]);
}
}
}
#endif
/*starting Task*/
ODU_START_TASK(&startTime, PID_MAC_TTI_IND);
- gSlotCount++;
+ gConfigInfo.gSlotCount++;
- if(gSlotCount == 1)
+ if(gConfigInfo.gSlotCount == 1)
{
GET_CELL_IDX(slotInd->cellId, cellIdx);
macCb.macCell[cellIdx]->state = CELL_STATE_UP;
/*First Slot Ind is for CellUp. Any other Slot, will be notified to DUAPP as
* SLOT_IND*/
- if(gSlotCount == 1)
+ if(gConfigInfo.gSlotCount == 1)
{
/* send cell up indication to du app */
ret = sendCellUpIndMacToDuApp(slotInd->cellId);