X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch.c;h=3be7fba08258e8f90c396be33c8d9dc6f4513c65;hb=3c9a60ea3d2abf5e22f741f268bdfc37a09743ef;hp=f68015dcf287f15892ec8f191f82a81496052193;hpb=ef723e2e773fc6a6dcff43005569e509201df198;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index f68015dcf..3be7fba08 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -684,7 +684,8 @@ void fillSchSib1Cfg(uint8_t mu, uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg uint8_t mValue = 0; uint8_t firstSymbol = 0; /* need to calculate using formula mentioned in 38.213 */ uint8_t slotIndex = 0; - uint8_t FreqDomainResource[6] = {0}; + /* TODO : This should be filled through freqDomRscAllocType0() */ + uint8_t FreqDomainResource[6] = {15, 0, 0, 0, 0, 0}; uint16_t tbSize = 0; uint8_t numPdschSymbols = 11; /* considering pdsch region from symbols 3 to 13 */ uint8_t ssbIdx = 0; @@ -717,7 +718,7 @@ void fillSchSib1Cfg(uint8_t mu, uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg sib1SchCfg->n0 = slotIndex; /* calculate the PRBs */ - freqDomRscAllocType0(((offsetPointA-offset)/6), (numRbs/6), FreqDomainResource); + //freqDomRscAllocType0(((offsetPointA-offset)/6), (numRbs/6), FreqDomainResource); /* fill BWP */ switch(bandwidth) @@ -793,7 +794,7 @@ void fillSchSib1Cfg(uint8_t mu, uint8_t bandwidth, uint8_t numSlots, SchSib1Cfg pdsch->dmrs.dlDmrsScramblingId = pci; pdsch->dmrs.scid = 0; pdsch->dmrs.numDmrsCdmGrpsNoData = 1; - pdsch->dmrs.dmrsPorts = 0; + pdsch->dmrs.dmrsPorts = 0x0001; pdsch->dmrs.mappingType = DMRS_MAP_TYPE_A; /* Type-A */ pdsch->dmrs.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS; pdsch->dmrs.dmrsAddPos = DMRS_ADDITIONAL_POS; @@ -900,12 +901,18 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo) DU_LOG("\nDEBUG --> SCH : Received RLC BO Status indication"); cell = schCb[inst].cells[inst]; + if(cell == NULLP) + { + DU_LOG("\nERROR --> SCH : MacSchDlRlcBoInfo(): Cell does not exists"); + return RFAILED; + } + GET_UE_IDX(dlBoInfo->crnti, ueIdx); ueCb = &cell->ueCb[ueIdx-1]; lcId = dlBoInfo->lcId; if(lcId == SRB1_LCID || lcId == SRB2_LCID || lcId == SRB3_LCID || \ - (lcId >= MIN_DRB_LCID && lcId <= MAX_DRB_LCID)) + (lcId >= MIN_DRB_LCID && lcId <= MAX_DRB_LCID)) { SET_ONE_BIT(ueIdx, cell->boIndBitMap); ueCb->dlInfo.dlLcCtxt[lcId].bo = dlBoInfo->dataVolume; @@ -924,20 +931,27 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo) slotIdx++; if(slotIdx==cell->numSlots) { - DU_LOG("\nERROR --> SCH : No DL Slot available"); - return RFAILED; + 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->dlMsgInfo, sizeof(DlMsgInfo)); - if(!schDlSlotInfo->dlMsgInfo) + if(schDlSlotInfo->dlMsgInfo == NULLP) { DU_LOG("\nERROR --> SCH : Memory allocation failed for dlMsgInfo"); schDlSlotInfo = NULL; return RFAILED; } + schDlSlotInfo->dlMsgInfo->crnti = dlBoInfo->crnti; schDlSlotInfo->dlMsgInfo->ndi = 1; schDlSlotInfo->dlMsgInfo->harqProcNum = 0; @@ -947,8 +961,10 @@ uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo) schDlSlotInfo->dlMsgInfo->harqFeedbackInd = 0; schDlSlotInfo->dlMsgInfo->dciFormatId = 1; if(lcId == SRB0_LCID) + { schDlSlotInfo->dlMsgInfo->isMsg4Pdu = true; - + schDlSlotInfo->dlMsgInfo->dlMsgPduLen = dlBoInfo->dataVolume; + } return ROK; }