X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch.c;h=090d3896df6d055ceaa8ae5eed315231ebb08627;hb=8e6123e23f6d831b1fe972f8229e9594a2e92237;hp=c1c1a43284e323b23718407d864b454e5e47ced4;hpb=e6391c742645c17e4494d52f94fdeb66cfc99d1e;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index c1c1a4328..090d3896d 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -927,17 +927,12 @@ uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg) uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo) { uint8_t lcId = 0; - uint16_t ueIdx = 0; - uint16_t slot = 0; -#ifdef NR_TDD - uint16_t slotIdx = 0; -#endif + uint16_t ueId = 0; bool isLcIdValid = false; - DlMsgInfo dlMsgInfo; SchUeCb *ueCb = NULLP; SchCellCb *cell = NULLP; - SchDlSlotInfo *schDlSlotInfo = NULLP; Inst inst = pst->dstInst-SCH_INST_START; + CmLListCp *lcLL = NULLP; #ifdef CALL_FLOW_DEBUG_LOG DU_LOG("\nCall Flow: ENTMAC -> ENTSCH : EVENT_DL_RLC_BO_INFO_TO_SCH\n"); @@ -952,8 +947,8 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo) return RFAILED; } - GET_UE_IDX(dlBoInfo->crnti, ueIdx); - ueCb = &cell->ueCb[ueIdx-1]; + GET_UE_IDX(dlBoInfo->crnti, ueId); + ueCb = &cell->ueCb[ueId-1]; lcId = dlBoInfo->lcId; CHECK_LCID(lcId, isLcIdValid); if(isLcIdValid == FALSE) @@ -962,27 +957,36 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo) return RFAILED; } - memset(&dlMsgInfo, 0, sizeof(DlMsgInfo)); - dlMsgInfo.crnti = dlBoInfo->crnti; - dlMsgInfo.ndi = 1; - dlMsgInfo.harqProcNum = 0; - dlMsgInfo.dlAssignIdx = 0; - dlMsgInfo.pucchTpc = 0; - dlMsgInfo.pucchResInd = 0; - dlMsgInfo.harqFeedbackInd = 0; - dlMsgInfo.dciFormatId = 1; - + /*Expected when theres a case of Retransmission Failure or Resetablishment + *By Zero BO, the RLC is informing that previous data can be cleared out + *Thus clearing out the LC from the Lc priority list*/ + if(dlBoInfo->dataVolume == 0) + { + /*Check the LC is Dedicated or default and accordingly LCList will + * be used*/ + if(ueCb->dlInfo.dlLcCtxt[lcId].isDedicated) + { + lcLL = &(ueCb->dlLcPrbEst.dedLcInfo->dedLcList); + } + else + { + lcLL = &(ueCb->dlLcPrbEst.defLcList); + } + handleLcLList(lcLL, lcId, DELETE); + return ROK; + } + if(lcId == SRB0_LCID) { - cell->raCb[ueIdx -1].msg4recvd = true; - dlMsgInfo.dlMsgPduLen = dlBoInfo->dataVolume; - cell->raCb[ueIdx -1].dlMsgInfo = dlMsgInfo; + cell->raCb[ueId -1].msg4recvd = true; + cell->raCb[ueId -1].dlMsgPduLen = dlBoInfo->dataVolume; + } else { /* TODO : These part of changes will be corrected during DL scheduling as * per K0 - K1 -K2 */ - SET_ONE_BIT(ueIdx, cell->boIndBitMap); + SET_ONE_BIT(ueId, cell->boIndBitMap); if(ueCb->dlInfo.dlLcCtxt[lcId].lcId == lcId) { ueCb->dlInfo.dlLcCtxt[lcId].bo = dlBoInfo->dataVolume; @@ -992,38 +996,10 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo) DU_LOG("ERROR --> SCH: LCID:%d is not configured in SCH Cb",lcId); return RFAILED; } - - slot = (cell->slotInfo.slot + SCHED_DELTA + PHY_DELTA_DL + BO_DELTA) % cell->numSlots; -#ifdef NR_TDD - while(schGetSlotSymbFrmt(cell->slotFrmtBitMap, slot) != DL_SLOT) - { - slot = (slot + 1)%cell->numSlots; - slotIdx++; - if(slotIdx==cell->numSlots) - { - DU_LOG("\nERROR --> SCH : No DL Slot available"); - return RFAILED; - } - } -#endif - - schDlSlotInfo = cell->schDlSlotInfo[slot]; - if(schDlSlotInfo == NULLP) - { - DU_LOG("\nERROR --> SCH : MacSchDlRlcBoInfo(): schDlSlotInfo does not exists"); - return RFAILED; - } - - SCH_ALLOC(schDlSlotInfo->dlMsgAlloc, sizeof(DlMsgAlloc)); - if(schDlSlotInfo->dlMsgAlloc == NULLP) - { - DU_LOG("\nERROR --> SCH : Memory allocation failed for dlMsgInfo"); - schDlSlotInfo = NULL; - return RFAILED; - } - - schDlSlotInfo->dlMsgAlloc->dlMsgInfo = dlMsgInfo; } + + /* Adding UE Id to list of pending UEs to be scheduled */ + addUeToBeScheduled(cell, ueId); return ROK; }