diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 7a554b36ca..3dea85f77f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -386,8 +386,7 @@ int get_first_ul_slot(const frame_structure_t *fs, bool mixed) if (fs->is_tdd) { for (int i = 0; i < fs->numb_slots_period; i++) { - bool is_mixed = fs->period_cfg.tdd_slot_bitmap[i].num_ul_symbols && fs->period_cfg.tdd_slot_bitmap[i].slot_type == TDD_NR_MIXED_SLOT; - if ((mixed && is_mixed) || fs->period_cfg.tdd_slot_bitmap[i].slot_type == TDD_NR_UPLINK_SLOT) { + if ((mixed && is_ul_slot(i, fs)) || fs->period_cfg.tdd_slot_bitmap[i].slot_type == TDD_NR_UPLINK_SLOT) { return i; } } @@ -486,8 +485,7 @@ int get_ul_slot_offset(const frame_structure_t *fs, int idx, bool count_mixed) /* Populate the indices of UL slots in the TDD period from the bitmap count also mixed slots with UL symbols if flag count_mixed is present */ for (int i = 0; i < fs->numb_slots_period; i++) { - bool is_mixed = (fs->period_cfg.tdd_slot_bitmap[i].num_ul_symbols > 1) && (fs->period_cfg.tdd_slot_bitmap[i].slot_type == TDD_NR_MIXED_SLOT); - if ((count_mixed && is_mixed) || fs->period_cfg.tdd_slot_bitmap[i].slot_type == TDD_NR_UPLINK_SLOT) { + if ((count_mixed && is_ul_slot(i, fs)) || fs->period_cfg.tdd_slot_bitmap[i].slot_type == TDD_NR_UPLINK_SLOT) { ul_slot_idxs[ul_slot_count++] = i; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 277348b02e..753b587a9f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -982,7 +982,7 @@ static bool get_feasible_msg3_tda(const NR_ServingCellConfigCommon_t *scc, const tdd_bitmap_t *tdd_slot_bitmap = fs->period_cfg.tdd_slot_bitmap; int s = get_slot_idx_in_period(temp_slot, fs); // check if enough symbols in case of mixed slot - bool is_mixed = (tdd_slot_bitmap[s].slot_type == TDD_NR_MIXED_SLOT); + bool is_mixed = is_mixed_slot(s, fs); // if the mixed slot has not enough symbols, skip if (is_mixed && tdd_slot_bitmap[s].num_ul_symbols < 3) continue; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index c890d6b32b..9bd1cedebd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -65,7 +65,7 @@ int get_dl_tda(const gNB_MAC_INST *nrmac, int slot) int s = get_slot_idx_in_period(slot, fs); // if there is a mixed slot where we can transmit DL const tdd_bitmap_t *tdd_slot_bitmap = fs->period_cfg.tdd_slot_bitmap; - if (tdd_slot_bitmap[s].num_dl_symbols > 1 && (tdd_slot_bitmap[s].slot_type == TDD_NR_MIXED_SLOT)) { + if (tdd_slot_bitmap[s].num_dl_symbols > 1 && is_mixed_slot(s, fs)) { return 2; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 1048982539..d4b44ebed4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -52,8 +52,7 @@ int get_ul_tda(gNB_MAC_INST *nrmac, int frame, int slot) // if there is uplink symbols in mixed slot int s = get_slot_idx_in_period(slot, fs); tdd_bitmap_t *tdd_slot_bitmap = fs->period_cfg.tdd_slot_bitmap; - if ((tdd_slot_bitmap[s].num_ul_symbols > 1) - && (tdd_slot_bitmap[s].slot_type == TDD_NR_MIXED_SLOT)) { + if ((tdd_slot_bitmap[s].num_ul_symbols > 1) && is_mixed_slot(s, fs)) { return 2; } }