From 3289189a2d78ca2ea517debcfb1e36c03f3b73c7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 4 Apr 2024 09:37:21 +0200 Subject: [PATCH] Fix: Configure TDD beam association only in FR2; set to NULL otherwise Before this commit, there was data that was not initialized, resulting in Msg2 remaining unscheduled. --- openair2/LAYER2/NR_MAC_gNB/config.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 29b4434405..17fb37edba 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -654,11 +654,14 @@ static void config_common(gNB_MAC_INST *nrmac, nr_pdsch_AntennaPorts_t pdsch_Ant scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols); - if (periods_per_frame < 0) - LOG_E(NR_MAC, "TDD configuration can not be done\n"); - else { - LOG_I(NR_MAC, "TDD has been properly configurated\n"); - nrmac->tdd_beam_association = (int16_t *)malloc16(periods_per_frame * sizeof(int16_t)); + AssertFatal(periods_per_frame > 0, "TDD configuration cannot be configured\n"); + if (frequency_range == FR2) { + LOG_I(NR_MAC, "Configuring TDD beam association to default\n"); + nrmac->tdd_beam_association = malloc16(periods_per_frame * sizeof(int16_t)); + for (int i = 0; i < periods_per_frame; ++i) + nrmac->tdd_beam_association[i] = -1; /* default: beams not configured */ + } else { + nrmac->tdd_beam_association = NULL; /* default: no beams */ } }