* @return ROK/RFAILED
**/
-uint16_t fillPucchResourceInfo(uint8_t ueId, SchPucchInfo *schPucchInfo, Inst inst, SlotTimingInfo slotInfo)
+uint16_t fillPucchResourceInfo(SchCellCb *cell, uint8_t ueId, SchPucchInfo *schPucchInfo, SlotTimingInfo slotInfo)
{
- uint8_t ret = ROK, ueIdx = 0, pucchIdx = 0;
- SchCellCb *cell = schCb[inst].cells[inst];
+ uint8_t ret = RFAILED, ueIdx = 0, pucchIdx = 0;
SchPucchCfgCmn *pucchCfg = NULLP;
SchBwpParams *ulBwp = NULLP;
#ifdef NR_DRX
{
/* fill pucch dedicated cfg */
ret = fillUlSchedPucchDedicatedCfg(cell,\
- &cell->ueCb[ueIdx].ueCfg.spCellCfg.servCellRecfg.initUlBwp.pucchCfg, &slotInfo, schPucchInfo);
+ &cell->ueCb[ueIdx].ueCfg.spCellCfg.servCellRecfg.initUlBwp.pucchCfg, &slotInfo, schPucchInfo);
if(ret == RFAILED)
{
memset(schPucchInfo, 0, sizeof(SchPucchInfo));
DU_LOG("\nERROR --> SCH : Filling PUCCH dedicated cfg failed at fillPucchResourceInfo()");
- return ret;
+ return ret;
}
}
else
schPucchInfo->srFlag = true;
}
}
- return ROK;
+ return ret;
}
/**
/* Schedule resources for PRACH */
if(cell->firstSib1Transmitted)
- schPrachResAlloc(cell, &ulSchedInfo, ulTimingInfo);
+ schPrachResAlloc(cell, &ulSchedInfo, ulTimingInfo);
schUlSlotInfo = cell->schUlSlotInfo[ulTimingInfo.slot];
if(schUlSlotInfo->schPuschInfo)
#endif
ulSchedInfo.dataType |= SCH_DATATYPE_PUSCH;
memcpy(&ulSchedInfo.schPuschInfo, schUlSlotInfo->schPuschInfo,
- sizeof(SchPuschInfo));
+ sizeof(SchPuschInfo));
SCH_FREE(schUlSlotInfo->schPuschInfo, sizeof(SchPuschInfo));
schUlSlotInfo->schPuschInfo = NULL;
}
if(schUlSlotInfo->pucchPres)
{
- GET_CRNTI(ulSchedInfo.crnti, schUlSlotInfo->pucchUe);
- ret = fillPucchResourceInfo(schUlSlotInfo->pucchUe, &schUlSlotInfo->schPucchInfo, schInst, ulTimingInfo);
- if (ret == ROK)
- {
- ulSchedInfo.dataType |= SCH_DATATYPE_UCI;
- memcpy(&ulSchedInfo.schPucchInfo, &schUlSlotInfo->schPucchInfo,
- sizeof(SchPucchInfo));
- }
- else
- {
- return RFAILED;
- }
+ GET_CRNTI(ulSchedInfo.crnti, schUlSlotInfo->pucchUe);
+ ulSchedInfo.dataType |= SCH_DATATYPE_UCI;
+ memcpy(&ulSchedInfo.schPucchInfo, &schUlSlotInfo->schPucchInfo,
+ sizeof(SchPucchInfo));
memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo));
}
*
*******************************************************************/
-uint16_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, uint16_t crnti,
+uint8_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime,
SchUeCb *ueCb, bool isRetx, SchDlHqProcCb *hqP)
{
+ uint8_t ret = RFAILED;
uint16_t pucchSlot = 0;
SchUlSlotInfo *schUlSlotInfo = NULLP;
schUlSlotInfo = cell->schUlSlotInfo[pucchSlot];
memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo));
+ ret = fillPucchResourceInfo(cell, schUlSlotInfo->pucchUe, &schUlSlotInfo->schPucchInfo, pucchTime);
+ if(ret != ROK)
+ {
+ return ret;
+ }
+
schUlSlotInfo->pucchPres = true;
+
if(ueCb != NULLP)
{
/* set HARQ flag to true */
schUlSlotInfo->schPucchInfo.harqInfo.harqBitLength = 1; /* 1 bit for HARQ */
ADD_DELTA_TO_TIME(pucchTime, pucchTime, 3, cell->numSlots); /* SLOT_DELAY=3 */
- cmLListAdd2Tail(&(ueCb->hqDlmap[pucchTime.slot]->hqList), &hqP->ulSlotLnk);
+ cmLListAdd2Tail(&(ueCb->hqDlmap[pucchTime.slot]->hqList), &hqP->dlSlotLnk);
}
return ROK;
}
}
}
- /* PUCCH resource */
- schAllocPucchResource(cell, pucchTime, cell->raCb[ueId-1].tcrnti, &cell->ueCb[ueId-1], isRetxMsg4, *msg4HqProc);
-
cell->schDlSlotInfo[pdcchTime.slot]->pdcchUe = ueId;
cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
+
cell->raCb[ueId-1].msg4recvd = FALSE;
if(isRetxMsg4)
{