X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_common.c;h=2d0370202fcc70e0d8820aa5599ada9fce29daa0;hb=49dc0e36836dc940ec40dea3a475ff067177819a;hp=4907c773cc43e5ae45df7e4f7da8d81b308db100;hpb=3a5197157c8a4ff70f26254c70ea0bbb2482423b;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_common.c b/src/5gnrsch/sch_common.c index 4907c773c..2d0370202 100644 --- a/src/5gnrsch/sch_common.c +++ b/src/5gnrsch/sch_common.c @@ -2098,7 +2098,41 @@ void updateBsrAndLcList(CmLListCp *lcLL, BsrInfo *bsrInfo, uint8_t status) } node = next; } -} +} + +/******************************************************************************** + * + * @brief Increment the Slot by a input factor + * + * @details + * + * Function : schIncrSlot + * + * Functionality: + * Increment the slot by a input factor till num of Slots configured in a + * Radio Frame. If it exceeds, move to next sfn. + * + * @params[in/out] SlotTimingInfo timingInfo + * [in] uint8_t incr [Increment factor] + * [in] numSlotsPerRF [Number of Slots configured per RF as per + * numerology] + * @return ROK - success + * RFAILED - failure + * + *******************************************************************/ +void schIncrSlot(SlotTimingInfo *timingInfo, uint8_t incr, uint16_t numSlotsPerRF) +{ + timingInfo->slot += incr; + if(timingInfo->slot >= numSlotsPerRF) + { + timingInfo->sfn += timingInfo->slot/numSlotsPerRF; + timingInfo->slot %= numSlotsPerRF; + if(timingInfo->sfn > MAX_SFN) + { + timingInfo->sfn %= MAX_SFN; + } + } +} /********************************************************************** End of file **********************************************************************/