X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_harq_dl.c;h=f058cdc0de5d4b9000a3cf1dba174a8f07c85e78;hb=f73456bd55152c329601f8286ae67fe9875025bc;hp=c5cebed368572c219aab47292201ebd5b3978f65;hpb=e0ab592152182a8a00aa8e7968209d2c4152e1e9;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_harq_dl.c b/src/5gnrsch/sch_harq_dl.c index c5cebed36..f058cdc0d 100644 --- a/src/5gnrsch/sch_harq_dl.c +++ b/src/5gnrsch/sch_harq_dl.c @@ -24,15 +24,12 @@ #include "du_app_mac_inf.h" #include "mac_sch_interface.h" #include "sch.h" +#include "sch_tmr.h" #include "sch_utils.h" #include "cm_llist.h" - -SchMacDlReleaseHarqFunc schMacDlReleaseHarqOpts[] = -{ - packSchMacDlReleaseHarq, - MacSchReleaseDlHarqProc, - packSchMacDlReleaseHarq -}; +#ifdef NR_DRX +#include "sch_drx.h" +#endif typedef struct schCellCb SchCellCb; typedef struct schUeCb SchUeCb; @@ -56,7 +53,7 @@ void schDlHqAddToFreeList(SchDlHqProcCb *hqP); void schDlHqEntInit(SchCellCb *cellCb, SchUeCb *ueCb) { ueCb->dlHqEnt.numHqPrcs = SCH_MAX_NUM_DL_HQ_PROC; - ueCb->dlHqEnt.maxHqTx = cellCb->cellCfg.schHqCfg.maxDlDataHqTx; + ueCb->dlHqEnt.maxHqTx = cellCb->schHqCfg.maxDlDataHqTx; ueCb->dlHqEnt.cell = cellCb; ueCb->dlHqEnt.ue =ueCb; schDlHqEntReset(cellCb, ueCb, &ueCb->dlHqEnt); @@ -92,6 +89,7 @@ void schDlHqEntReset(SchCellCb *cellCb, SchUeCb *ueCb, SchDlHqEnt *hqE) hqP->dlHqEntLnk.node = (PTR)hqP; hqP->dlHqProcLink.node = (PTR)hqP; hqP->ulSlotLnk.node = (PTR)hqP; + cellCb->api->SchInitDlHqProcCb(hqP); schDlHqAddToFreeList(hqP); } } @@ -212,10 +210,14 @@ uint8_t schDlGetAvlHqProcess(SchCellCb *cellCb, SchUeCb *ueCb, SchDlHqProcCb **h **/ void schDlReleaseHqProcess(SchDlHqProcCb *hqP) { - cmLListDeleteLList(&hqP->dlLcPrbEst.dedLcList); - cmLListDeleteLList(&hqP->dlLcPrbEst.defLcList); - schDlHqDeleteFromInUseList(hqP); - schDlHqAddToFreeList(hqP); + SchCellCb *cellCb = NULLP; + if(hqP) + { + cellCb = hqP->hqEnt->cell; + cellCb->api->SchFreeDlHqProcCb(hqP); + schDlHqDeleteFromInUseList(hqP); + schDlHqAddToFreeList(hqP); + } } /******************************************************************* @@ -250,7 +252,7 @@ uint8_t sendDlHarqProcReleaseToMac(SchDlHqProcCb *hqP, Inst inst) rlsHqInfo->ueHqInfo[0].crnti = hqP->hqEnt->ue->crnti; rlsHqInfo->ueHqInfo[0].hqProcId = hqP->procId; - return(*schMacDlReleaseHarqOpts[pst.selector])(&pst, rlsHqInfo); + return(MacMessageRouter(&pst, (void *)rlsHqInfo)); } /** * @brief Release Harq process TB from the DL Harq process @@ -312,7 +314,7 @@ void schDlHqTbFail(SchDlHqProcCb *hqP, uint8_t tbIdx, bool isMaxRetx) hqP->tbInfo[tbIdx].state = HQ_TB_NACKED; if (HQ_TB_WAITING == hqP->tbInfo[tbIdx^1].state) { - cmLListAdd2Tail( &(hqP->hqEnt->ue->dlRetxHqList), &hqP->dlHqProcLink); + hqP->hqEnt->cell->api->SchAddToDlHqRetxList(hqP); } } } @@ -342,17 +344,18 @@ void schMsg4FeedbackUpdate(SchDlHqProcCb *hqP, uint8_t fdbk) } else { - if( hqP->tbInfo[0].txCntr >= hqP->hqEnt->cell->cellCfg.schHqCfg.maxMsg4HqTx) + if( hqP->tbInfo[0].txCntr >= hqP->hqEnt->cell->schHqCfg.maxMsg4HqTx) { schDlReleaseHqProcess(hqP); - hqP->hqEnt->ue->msg4Proc = NULLP; + hqP->hqEnt->ue->msg4HqProc = NULLP; hqP->hqEnt->ue->retxMsg4HqProc = NULLP; /* Delete UE and RA context */ } - addUeToBeScheduled(hqP->hqEnt->cell,hqP->hqEnt->ue->ueId); + hqP->hqEnt->cell->api->SchAddUeToSchedule(hqP->hqEnt->cell,hqP->hqEnt->ue->ueId); hqP->hqEnt->ue->retxMsg4HqProc = hqP; } } + /** * @brief Handles Harq feedback for DL Data * @@ -392,12 +395,40 @@ void schDlHqFeedbackUpdate(SchDlHqProcCb *hqP, uint8_t fdbk1, uint8_t fdbk2) else { schDlHqTbFail(hqP, tbIdx, FALSE); - addUeToBeScheduled(hqP->hqEnt->cell, hqP->hqEnt->ue->ueId); } } } } } + +/** + * @brief Deletes HARQ Entity + * + * @details + * + * Function : schDlHqEntDelete + * + * This function deletes HARQ entity and its member paremeters + * + * @param[in] Pointer to UE + * @return + * -# void + **/ +void schDlHqEntDelete(SchUeCb *ueCb) +{ + uint8_t count; + SchDlHqProcCb *hqP; + + cmLListDeleteLList(&ueCb->dlHqEnt.free); + cmLListDeleteLList(&ueCb->dlHqEnt.inUse); + for(count=0; count < ueCb->dlHqEnt.numHqPrcs; count++) + { + hqP = &(ueCb->dlHqEnt.procs[count]); + ueCb->cellCb->api->SchDeleteDlHqProcCb(hqP); + } + memset(&ueCb->dlHqEnt, 0, sizeof(SchDlHqEnt)); +} + /********************************************************************** End of file **********************************************************************/