diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 3803c240acfe85fcb47a46f0d206f8bc4012399d..41bc61e0098884b0ef9923abeb0769298ee06173 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -55,20 +55,14 @@ const int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot) { - const NR_TDD_UL_DL_Pattern_t *tdd = - scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - - if (tdd) { - if (tdd->nrofDownlinkSymbols > 1) { // if there is a mixed slot where we can transmit DL - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + 1; - if ((slot%nr_slots_period) == tdd->nrofDownlinkSlots) - return 1; - } - } - else - // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration - AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n"); + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + AssertFatal(tdd || nrmac->common_channels->frame_type == FDD, "Dynamic TDD not handled yet\n"); + if (tdd && tdd->nrofDownlinkSymbols > 1) { // if there is a mixed slot where we can transmit DL + const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + 1; + if ((slot%nr_slots_period) == tdd->nrofDownlinkSlots) + return 1; + } return 0; // if FDD or not mixed slot in TDD, for now use default TDA (TODO handle CSI-RS slots) } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 975c056e49b46033e275b9e7a3e4a6dc6c0ffb2a..92823afa9b863b14b0a3d4b56e6b1bb354ae115f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -50,18 +50,13 @@ const int get_ul_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon /* there is a mixed slot only when in TDD */ const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + AssertFatal(tdd || nrmac->common_channels->frame_type == FDD, "Dynamic TDD not handled yet\n"); - if (tdd) { - if (tdd->nrofUplinkSymbols > 1) { // if there is uplink symbols in mixed slot - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + 1; - if ((slot%nr_slots_period) == tdd->nrofUplinkSlots) - return 1; - } + if (tdd && tdd->nrofUplinkSymbols > 1) { // if there is uplink symbols in mixed slot + const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + 1; + if ((slot%nr_slots_period) == tdd->nrofUplinkSlots) + return 1; } - else - // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration - AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n"); - return 0; // if FDD or not mixed slot in TDD, for now use default TDA (TODO handle CSI-RS slots) }