X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_common.c;h=6931f7c44d97fb4dc71252de54870916cacc3321;hb=8fb71c0f3edcf97717a64bc7629cf93da00e18e5;hp=05037858a027c268147433f2a21ba5d43e20b742;hpb=9fc4986e02c1ab2be2a9276cdfbf049c55af88e6;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index 05037858a..6931f7c44 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -82,8 +82,7 @@ SchMacUlSchInfoFunc schMacUlSchInfoOpts[] = * * This function handles common scheduling for DL * - * @param[in] schCellCb *cell, cell cb - * @param[in] DlBrdcstAlloc *dlBrdcstAlloc, DL brdcst allocation + * @param[in] uint8_t scs, uint8_t *ssbStartSym * @return void **/ void ssbDlTdAlloc(uint8_t scs, uint8_t *ssbStartSymb) @@ -114,7 +113,7 @@ void ssbDlTdAlloc(uint8_t scs, uint8_t *ssbStartSymb) * * @details * - * Function : schCmnDlAlloc + * Function : schBroadcastAlloc * * This function handles common scheduling for DL * @@ -122,7 +121,8 @@ void ssbDlTdAlloc(uint8_t scs, uint8_t *ssbStartSymb) * @param[in] DlBrdcstAlloc *dlBrdcstAlloc, DL brdcst allocation * @return void **/ -uint8_t schCmnDlAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc) +uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc, + uint16_t slot) { /* schedule SSB */ uint8_t scs, ssbStartPrb, ssbStartSymb, idx; @@ -130,12 +130,11 @@ uint8_t schCmnDlAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc) SchDlAlloc *dlAlloc; SsbInfo ssbInfo; - dlAlloc = cell->dlAlloc[cell->slotInfo.slot]; + dlAlloc = cell->dlAlloc[slot]; if(dlBrdcstAlloc->ssbTrans) { scs = cell->cellCfg.ssbSchCfg.scsCommon; - ssbStartPrb = \ - (cell->cellCfg.ssbSchCfg.ssbOffsetPointA)/SCH_NUM_SC_PRB; + ssbStartPrb = cell->cellCfg.ssbSchCfg.ssbOffsetPointA; memset(ssbStartSymbArr, 0, SCH_MAX_SSB_BEAM); ssbDlTdAlloc(scs, ssbStartSymbArr); @@ -157,7 +156,7 @@ uint8_t schCmnDlAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc) dlAlloc->ssbIdxSupported = dlBrdcstAlloc->ssbIdxSupported; for(idx=ssbStartSymb; idxassignedPrb[idx] = SCH_SSB_PRB_DURATION + 1; /* +1 for kSsb */ + dlAlloc->assignedPrb[idx] = ssbStartPrb + SCH_SSB_PRB_DURATION + 1; /* +1 for kSsb */ } } @@ -165,8 +164,13 @@ uint8_t schCmnDlAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc) /* SIB1 allocation */ if(dlBrdcstAlloc->sib1Trans) { - memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->cellCfg.sib1SchCfg.sib1PdcchCfg, sizeof(Sib1PdcchCfg)); - memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdschCfg, &cell->cellCfg.sib1SchCfg.sib1PdschCfg, sizeof(Sib1PdschCfg)); + dlAlloc->sib1Pres = true; + for(idx=0; idxassignedPrb[idx] = ssbStartPrb + SCH_SSB_PRB_DURATION + 1 + 10; /* 10 PRBs for sib1 */ + } + memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->cellCfg.sib1SchCfg.sib1PdcchCfg, sizeof(PdcchCfg)); + memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdschCfg, &cell->cellCfg.sib1SchCfg.sib1PdschCfg, sizeof(PdschCfg)); } return ROK; } @@ -213,11 +217,11 @@ int sendUlSchInfoToMac(UlSchInfo *ulSchInfo, Inst inst) **/ int schPrachResAlloc(SchCellCb *cell, UlSchInfo *ulSchInfo) { - uint8_t numPrachRb; - uint8_t numRa; - uint8_t freqStart; - uint16_t sfn; - uint16_t slot; + uint8_t numPrachRb = 0; + uint8_t numRa = 0; + uint8_t freqStart = 0; + uint16_t sfn = 0; + uint16_t slot = 0; uint8_t prachCfgIdx = 0; uint8_t prachFormat = 0; uint8_t x = 0; @@ -265,6 +269,7 @@ int schPrachResAlloc(SchCellCb *cell, UlSchInfo *ulSchInfo) break; } numPrachRb = numRbForPrachTable[idx][3]; + dataType |= SCH_DATATYPE_PRACH; /* Considering first slot in the frame for PRACH */ idx = 0; ulAlloc->assignedPrb[idx] = freqStart+numPrachRb; @@ -274,7 +279,7 @@ int schPrachResAlloc(SchCellCb *cell, UlSchInfo *ulSchInfo) ulSchInfo->cellId = cell->cellId; ulSchInfo->slotIndInfo.sfn = sfn; ulSchInfo->slotIndInfo.slot = slot; - ulSchInfo->dataType = dataType | SCH_DATATYPE_PRACH; + ulSchInfo->dataType = dataType; /* prach info */ ulSchInfo->prachSchInfo.numPrachOcas = prachOcas; ulSchInfo->prachSchInfo.prachFormat = prachFormat; @@ -296,7 +301,7 @@ int schPrachResAlloc(SchCellCb *cell, UlSchInfo *ulSchInfo) * @param[in] SchCellCb *cell, cellCb * @return void **/ -int schUlResAlloc(SchCellCb *cell, Inst schInst) +uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst) { int ret = ROK; UlSchInfo ulSchInfo;