X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_utils.c;h=600297da83a691e0697c2c93b0761b93b793921b;hb=488f5ed56e82148cd09eb8c4e62ad6f0009d6761;hp=1e4cab23a1c0f1a4f54e8c63f1e481164befc86c;hpb=ff564d395659e1a7175787af8237d17c665c9660;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_utils.c b/src/5gnrsch/sch_utils.c index 1e4cab23a..600297da8 100644 --- a/src/5gnrsch/sch_utils.c +++ b/src/5gnrsch/sch_utils.c @@ -765,6 +765,7 @@ uint8_t pucchResourceSet[MAX_PUCCH_RES_SET_IDX][4] = { { 1, 0, 14, 0 }, /* index 15 */ }; +uint8_t defaultUlAckTbl[DEFAULT_UL_ACK_LIST_COUNT]= {1, 2, 3 , 4, 5, 6, 7, 8}; /** * @brief frequency domain allocation function. * @@ -1015,10 +1016,13 @@ void schInitDlSlot(SchDlSlotInfo *schDlSlotInfo) **/ SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap) { + uint32_t offset = (slot)*2; + return (bitMap & 0x3<>offset; +#if 0 SlotConfig slotFrmt; int mask1 = 0, mask2 = 0; - slot = (slot%10)*2; + slot = (slot%n)*2;//n num of slots in defined periodicity or num of symbols mask1 = 1<<(slot); mask2 = 1<<(slot+1); slotFrmt = ((mask1 & bitMap)>>slot) + (2*((mask2 & bitMap)>>(slot+1))); @@ -1026,8 +1030,72 @@ SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap) //printf("\n\n\n\n*****FormatType:%d Slot:%d****\n\n\n\n", slotFrmt, slot/2); return slotFrmt; +#endif } +/** + * @brief Determine total length of configured slot pattern for specific + * periodicity for TDD + * + * @details + * + * Function : calculateSlotPatternLength + * + * Determine total length of configured slot pattern for specific periodicity based + * on slot duration for TDD + * + * @param[in] uint8_t scs, uint8_t periodicity + * + * @return uint8_t slotPatternLength + **/ + +uint8_t calculateSlotPatternLength(uint8_t scs, uint8_t periodicity) +{ + uint8_t slotPatternLength =0; + float slotDuration = 0; + + /* Calculating the slot duration with the help of SCS. + * This will provides the slot duration in ms like 1, 0.5, 0.25, 0.125. + * If scs value is SCS_30KHZ its enum value is 1, + * slotDuration = pow(0.5, 1); + * slotDuration = 0.5 */ + + slotDuration = pow(0.5,scs); + + /* Calculating length of pattern based on Transmission Periodicity. + * If periodicity = TX_PRDCTY_MS_5, + * slotPatternLength = 5/0.5 + * slotPatternLength = 10 i.e. {length of slot pattern DDDDDDDFUU}*/ + + switch(periodicity) + { + case TX_PRDCTY_MS_0P5: + slotPatternLength = 0.5/slotDuration; + break; + case TX_PRDCTY_MS_0P625: + slotPatternLength = 0.625/slotDuration; + break; + case TX_PRDCTY_MS_1: + slotPatternLength = 1/slotDuration; + break; + case TX_PRDCTY_MS_1P25: + slotPatternLength = 1.25/slotDuration; + break; + case TX_PRDCTY_MS_2: + slotPatternLength = 2/slotDuration; + break; + case TX_PRDCTY_MS_2P5: + slotPatternLength = 2.5/slotDuration; + break; + case TX_PRDCTY_MS_5: + slotPatternLength = 5/slotDuration; + break; + case TX_PRDCTY_MS_10: + slotPatternLength = 10/slotDuration; + break; + } + return slotPatternLength; +} #endif /********************************************************************** End of file