X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch.c;h=a0ff7760396088e1ff26f609635398b83b18f486;hb=49dc0e36836dc940ec40dea3a475ff067177819a;hp=fc845eb1d43129c5b4ba9d4a0868ae94beae3b4e;hpb=3a5197157c8a4ff70f26254c70ea0bbb2482423b;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index fc845eb1d..a0ff77603 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -887,7 +887,10 @@ uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg) fillSchSib1Cfg(schCellCfg->numerology, schCellCfg->bandwidth, cellCb->numSlots, &(schCellCfg->sib1SchCfg), schCellCfg->phyCellId, schCellCfg->ssbSchCfg.ssbOffsetPointA); + + memcpy(&cellCb->cellCfg, schCellCfg, sizeof(SchCellCfg)); + schProcPagingCfg(cellCb); /* Fill coreset frequencyDomainResource bitmap */ coreset0Idx = cellCb->cellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.coresetId; @@ -1972,6 +1975,118 @@ uint8_t MacSchSliceReCfgReq(Pst *pst, SchSliceCfgReq *schSliceReCfgReq) return ROK; } +/**************************************************************************** + * + * @brief Stores the Paging Configuration from DU APP in CellCb + * + * @details + * + * Function : schProcPagingParam + * + * Functionality: + * Process the Paging Configuration when FirstPDCCHMonitoring for + * Paging Ocassion is not present. + * + * As per 38.304 Sec 7.1, + * "When firstPDCCH-MonitoringOccasionOfPO is present, the + * starting PDCCH monitoring occasion number of (i_s + 1)th PO is the + * (i_s + 1)th value of the firstPDCCHMonitoringOccasionOfPO + * parameter; otherwise, it is equal to i_s * S." + * "S = number of actual transmitted SSBs determined according + * to ssb-PositionsInBurst in SIB1" + * + * @params[in] SchCellCb *cell + * + * @return void + * + *************************************************************************/ +void schProcPagingCfg(SchCellCb *cell) +{ + PageCfg *pageCfgRcvd = NULL; + uint8_t i_sIdx = 0; + + pageCfgRcvd = &(cell->cellCfg.sib1SchCfg.pageCfg); + + if(pageCfgRcvd->poPresent == TRUE) + { + /*Fetching first Pdcch Monitoring Occasion for SFN (i_s + 1)th*/ + for(i_sIdx = 0; i_sIdx < pageCfgRcvd->numPO; i_sIdx++) + { + cell->pageCb.pagMonOcc[i_sIdx].pagingOccSlot = pageCfgRcvd->pagingOcc[i_sIdx] / MAX_SYMB_PER_SLOT ; + if ((pageCfgRcvd->pagingOcc[i_sIdx] % MAX_SYMB_PER_SLOT) != 0 ) + { + cell->pageCb.pagMonOcc[i_sIdx].pagingOccSlot++; + } + + cell->pageCb.pagMonOcc[i_sIdx].frameOffset = 0; + + } + } + else + { + schCfgPdcchMonOccOfPO(cell); + } +} + +/**************************************************************************** + * + * @brief Calculate PO if not present in Configuration + * + * @details + * + * Function : schCfgPdcchMonOccOfPO + * + * Functionality: In this function, PO are calculated i_s * S because + * FirstPDCCHMonitoring_ForPO is not present. + * + * @params[in] SchCellCb *cellCb + * + * @return void + * + *************************************************************************/ +void schCfgPdcchMonOccOfPO(SchCellCb *cell) +{ + uint8_t cnt = 0, incr = 1, i_sIdx = 0, frameOffSet = 0; + uint8_t nsValue = cell->cellCfg.sib1SchCfg.pageCfg.numPO; + uint8_t totalNumSsb = cell->cellCfg.ssbSchCfg.totNumSsb; + SlotTimingInfo tmpTimingInfo, pdcchTime; + + /*Starting with First Sfn and slot*/ + tmpTimingInfo.sfn = 0; + tmpTimingInfo.slot = 0; + + pdcchTime = tmpTimingInfo; + + while(i_sIdx < nsValue) + { + /*Increment frame Offset if PO falls on next SFN*/ + if(pdcchTime.sfn != tmpTimingInfo.sfn) + { + frameOffSet++; + } + pdcchTime = tmpTimingInfo; + schIncrSlot(&(tmpTimingInfo), incr, cell->numSlots); + + if (i_sIdx == 0) + { + cell->pageCb.pagMonOcc[i_sIdx].pagingOccSlot = pdcchTime.slot; + cell->pageCb.pagMonOcc[i_sIdx].frameOffset = frameOffSet; + i_sIdx++; + } + else + { + cnt++; + if((cnt == totalNumSsb) && (i_sIdx < MAX_PO_PER_PF)) + { + cell->pageCb.pagMonOcc[i_sIdx].pagingOccSlot = pdcchTime.slot; + cell->pageCb.pagMonOcc[i_sIdx].frameOffset = frameOffSet; + cnt = 0; + i_sIdx++; + } + } + } +} + /********************************************************************** End of file **********************************************************************/