X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch.c;h=aa937129c2304906416f7e912fdabc3cc9647de1;hb=a2484c58e5beeb1ab9e1c86104cf9d9bc56750d1;hp=d401bc5c5d8206c16065ee579f7270c384d30c1b;hpb=8d9ebf64c8a64bf1346685833fe79970c4ef3d14;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index d401bc5c5..aa937129c 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -66,8 +66,6 @@ #include "sch_utils.h" #include "du_log.h" extern SchCb schCb[SCH_MAX_INST]; -extern int8_t coresetIdxTable[MAX_CORESET_INDEX][4]; -extern int8_t searchSpaceIdxTable[MAX_SEARCH_SPACE_INDEX][4]; void SchFillCfmPst(Pst *reqPst,Pst *cfmPst,RgMngmt *cfm); /* local defines */ SchCellCfgCfmFunc SchCellCfgCfmOpts[] = @@ -330,6 +328,41 @@ int macSchRachInd(Pst *pst, RachIndInfo *rachInd) return ROK; } +/******************************************************************* + * + * @brief Processes CRC indication from MAC + * + * @details + * + * Function : macSchCrcInd + * + * Functionality: + * Processes CRC indication from MAC + * + * @params[in] Post structure + * Crc Indication + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +int macSchCrcInd(Pst *pst, CrcIndInfo *crcInd) +{ + switch(crcInd->crcInd[0]) + { + case CRC_FAILED: + DU_LOG("\nSCH : Received CRC indication. CRC Status [FAILURE]"); + break; + case CRC_PASSED: + DU_LOG("\nSCH : Received CRC indication. CRC Status [PASS]"); + break; + default: + DU_LOG("\nSCH : Invalid CRC state %d", crcInd->crcInd[0]); + return RFAILED; + } + return ROK; +} + + /** * @brief inti cellCb based on cellCfg * @@ -396,6 +429,7 @@ int InitSchCellCb(Inst inst, SchCellCfg *schCellCfg) schDlAlloc->assignedPrb[itr] = 0; schUlAlloc->assignedPrb[itr] = 0; } + schUlAlloc->schPuschInfo = NULLP; for(uint8_t itr=0; itrn0 = slotIndex; /* calculate the PRBs */ - freqDomResourceAlloc( ((offsetPointA-offset)/6), (numRbs/6), FreqDomainResource); + calculatePRB( ((offsetPointA-offset)/6), (numRbs/6), FreqDomainResource); /* fill the PDCCH PDU */ pdcch->pdcchBwpCfg.BWPSize = MAX_NUM_RB; /* whole of BW */ @@ -509,7 +543,8 @@ uint8_t offsetPointA pdsch->codeword[cwCount].mcsIndex = sib1SchCfg->sib1Mcs; pdsch->codeword[cwCount].mcsTable = 0; /* notqam256 */ pdsch->codeword[cwCount].rvIndex = 0; - pdsch->codeword[cwCount].tbSize = 768; + pdsch->codeword[cwCount].tbSize = 768/8; /* 38.214: Table 5.1.3.2-1, + devided by 8 to get the value in bytes */ } pdsch->dataScramblingId = pci; pdsch->numLayers = 1; @@ -592,6 +627,57 @@ SchCellCfg *schCellCfg } +/******************************************************************* + * + * @brief Processes DL RLC BO info from MAC + * + * @details + * + * Function : macSchDlRlcBoInfo + * + * Functionality: + * Processes DL RLC BO info from MAC + * + * @params[in] + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t macSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo) +{ + uint16_t lcIdx; + Inst inst = pst->dstInst-SCH_INST_START; + DU_LOG("\nSCH : Received RLC BO Status indication"); + + SchCellCb *cell = schCb[inst].cells[inst]; + SchDlAlloc *dlAlloc = \ + cell->dlAlloc[(cell->slotInfo.slot + SCHED_DELTA) % SCH_NUM_SLOTS]; + + for(lcIdx = 0; lcIdx < dlBoInfo->numLc; lcIdx++) + { + if(dlBoInfo->boInfo[lcIdx].lcId == CCCH_LCID) + { + SCH_ALLOC(dlAlloc->msg4Info, sizeof(Msg4Info)); + if(!dlAlloc->msg4Info) + { + DU_LOG("\nSCH : Memory allocation failed for msg4Info"); + dlAlloc = NULL; + return RFAILED; + } + dlAlloc->msg4Info->crnti = dlBoInfo->crnti; + dlAlloc->msg4Info->ndi = 1; + dlAlloc->msg4Info->harqProcNum = 0; + dlAlloc->msg4Info->dlAssignIdx = 0; + dlAlloc->msg4Info->pucchTpc = 0; + dlAlloc->msg4Info->pucchResInd = 0; + dlAlloc->msg4Info->harqFeedbackInd = 0; + dlAlloc->msg4Info->dciFormatId = 1; + } + } + + return ROK; +} + /********************************************************************** End of file **********************************************************************/