SchDlHqEnt *hqEnt;
uint8_t maxHqTxPerHqP;
CmLList dlHqEntLnk;
- CmLList ulSlotLnk;
+ CmLList dlSlotLnk;
SchDlHqTbCb tbInfo[2];
uint8_t k1;
void *schSpcDlHqProcCb; /*!< Scheduler specific HARQ Proc CB */
bool schCheckPrachOcc(SchCellCb *cell, SlotTimingInfo prachOccasionTimingInfo);
uint8_t schCalcPrachNumRb(SchCellCb *cell);
void schPrachResAlloc(SchCellCb *cell, UlSchedInfo *ulSchedInfo, SlotTimingInfo prachOccasionTimingInfo);
-uint16_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, uint16_t crnti,SchUeCb *ueCb, bool isRetx, SchDlHqProcCb *hqP);
+uint8_t schAllocPucchResource(SchCellCb *cell, SlotTimingInfo pucchTime, SchUeCb *ueCb, bool isRetx, SchDlHqProcCb *hqP);
uint8_t schFillUlDci(SchUeCb *ueCb, SchPuschInfo *puschInfo, DciInfo *dciInfo, bool isRetx, SchUlHqProcCb *hqP);
uint8_t schFillPuschAlloc(SchUeCb *ueCb, SlotTimingInfo puschTime, uint32_t tbSize,
uint8_t startSymb, uint8_t symbLen, uint16_t startPrb, bool isRetx, SchUlHqProcCb *hqP);
* @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)
{
hqP->maxHqTxPerHqP = hqE->maxHqTx;
hqP->dlHqEntLnk.node = (PTR)hqP;
hqP->dlHqProcLink.node = (PTR)hqP;
- hqP->ulSlotLnk.node = (PTR)hqP;
+ hqP->dlSlotLnk.node = (PTR)hqP;
cellCb->api->SchInitDlHqProcCb(hqP);
schDlHqAddToFreeList(hqP);
}
uint8_t k0TblIdx = 0, k1TblIdx = 0, k2TblIdx = 0;
uint8_t k0Index = 0, k1Index = 0, k2Index = 0;
uint8_t k0 = 0, k1 = 0, k2 = 0;
- uint8_t numK1 = 0;
+ uint8_t numK1 = 0, ret = OK;
uint8_t puschMu = 0;
uint8_t msg3Delta = 0, msg3MinSchTime = 0;
#ifdef NR_TDD
if(cell->raReq[ueId-1]->isCFRA)
{
/* Allocate resources for PUCCH */
- schAllocPucchResource(cell, pucchTime, cell->raReq[ueId-1]->rachInd->crnti,NULLP, FALSE, NULLP);
+ cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
+ ret = schAllocPucchResource(cell, pucchTime, NULLP, FALSE, NULLP);
+ if(ret == RFAILED)
+ {
+ SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
+ cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+ DU_LOG("\nERROR --> SCH : Resource allocation for PUCCH failed for CFRA!");
+ return false;
+
+ }
}
else
{
+ cell->schUlSlotInfo[msg3Time.slot]->puschUe = ueId;
/* Allocate resources for msg3 */
msg3PuschInfo = schAllocMsg3Pusch(schInst, cell->raReq[ueId-1]->rachInd->crnti, k2Index, msg3Time, &(cell->raCb[ueId-1].msg3HqProc), FALSE);
if(msg3PuschInfo)
}
cell->schDlSlotInfo[dciSlot]->pdcchUe = ueId;
- if(cell->raReq[ueId-1]->isCFRA)
- cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
- else
- cell->schUlSlotInfo[msg3Time.slot]->puschUe = ueId;
/* Create raCb at SCH */
createSchRaCb(ueId, cell->raReq[ueId-1], schInst);
}
}
- schAllocPucchResource(cell, pucchTime, crnti, ueCb, isRetx, *hqP);
-
cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
/*Re-setting the BO's of all DL LCs in this UE*/
{
uint8_t numK0 = 0, k0TblIdx = 0, k0Val = 0, k0Index =0 ;
uint8_t k1TblIdx = 0, k1Index = 0, k1Val = 0, numK1 = 0;
+ uint8_t ret = RFAILED;
SchUeCb *ueCb = NULLP;
SchK0K1TimingInfoTbl *k0K1InfoTbl;
}
#endif
+ ueCb = &cell->ueCb[ueId-1];
if(dedMsg == true)
{
- ueCb = &cell->ueCb[ueId-1];
k0K1InfoTbl = &ueCb->k0K1InfoTbl;
if(schDlCandidateSelection(ueCb, *pdcchTime, pdcchAllocInfo) == false)
{
- DU_LOG("\nDEBUG --> SCH: DL candidate Selection failed bcz PDCCH is unavailable for this slot");
- return false;
+ DU_LOG("\nDEBUG --> SCH: DL candidate Selection failed bcz PDCCH is unavailable for this slot");
+ return false;
}
}
else
pdcchTime->cellId = cell->cellId;
pdschTime->cellId = cell->cellId;
+ cell->schUlSlotInfo[pucchTime->slot]->pucchUe = ueId;
+
+ /*Availability of PUCCH for HARQ resources*/
+ ret = schAllocPucchResource(cell, *pucchTime, ueCb, isRetx, hqP);
+ if(ret == RFAILED)
+ {
+ /*DL allocation can't go through as PUCCH is unavailable*/
+ return false;
+ }
return true;
}
}
+
+
/*
* Number of symbols in case of retransmisson should be same as it was in
* original transmisson. Symbol availablity checks need to be added.
{
SchDlHqProcCb *hqP;
SchHqDlMap *hqDlMap;
- CmLList *node;
+ CmLList *node = NULLP;
uint8_t fdbkPos = 0;
hqDlMap = ueCb->hqDlmap[slotInd->slot];
{
return;
}
- if (ueCb->cellCb->raCb[ueCb->ueId-1].raState != SCH_RA_STATE_MSG4_PENDING)
+
+ while(fdbkPos < numHarq)
{
node = hqDlMap->hqList.first;
- while(node)
+ if(node == NULLP)
+ {
+ DU_LOG("\nERROR : SCH --> DL HARQ list is empty thus no need to process the dl harq feedback!");
+ return;
+ }
+ if (ueCb->cellCb->raCb[ueCb->ueId-1].raState != SCH_RA_STATE_MSG4_PENDING)
+ {
+ while(node)
+ {
+ hqP = (SchDlHqProcCb*)node->node;
+ node = node->next;
+ cmLListDelFrm(&hqDlMap->hqList, &hqP->dlSlotLnk);
+ /*
+ Decode harq feedback if needed post FAPI message decoding also or check how to decode this FAPI msg.
+ case 1 semi static harq Ack/Nack codebook //Supported
+ case 2 dynamic harq ACK/NACK codebook //Not supported
+ */
+ schDlHqFeedbackUpdate(hqP, harqPayload[fdbkPos++], HQ_TB_ACKED);//Marking 2nd TB as ACKED for now as only one TB to be used
+ }
+ }
+ else
{
hqP = (SchDlHqProcCb*)node->node;
- node = node->next;
- cmLListDelFrm(&hqDlMap->hqList, &hqP->ulSlotLnk);
- /*
- Decode harq feedback if needed post FAPI message decoding also or check how to decode this FAPI msg.
- case 1 semi static harq Ack/Nack codebook //Supported
- case 2 dynamic harq ACK/NACK codebook //Not supported
- */
- schDlHqFeedbackUpdate(hqP, harqPayload[fdbkPos++], HQ_TB_ACKED);//Marking 2nd TB as ACKED for now as only one TB to be used
+ cmLListDelFrm(&hqDlMap->hqList, &hqP->dlSlotLnk);
+ schMsg4FeedbackUpdate(hqP, harqPayload[fdbkPos++]);
}
}
- else
- {
- node = hqDlMap->hqList.first;
- hqP = (SchDlHqProcCb*)node->node;
- cmLListDelFrm(&hqDlMap->hqList, &hqP->ulSlotLnk);
- schMsg4FeedbackUpdate(hqP, harqPayload[fdbkPos++]);
- }
}
/**********************************************************************
End of file