From 75820422a43db97e839ba92df999ed4867863075 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 20 Nov 2025 10:46:44 +0100 Subject: [PATCH] check if CSET0 exceeds upper BW limit --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 6 ++++++ openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c | 1 + openair2/LAYER2/NR_MAC_gNB/config.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 3 ++- 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index f25d6283aa..b932d80e6f 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -3556,6 +3556,7 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD NR_SubcarrierSpacing_t scs_ssb, frequency_range_t frequency_range, int nr_band, + int grid_size, uint32_t ssb_index, uint32_t ssb_period, uint32_t ssb_offset_point_a) @@ -3885,6 +3886,11 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD type0_PDCCH_CSS_config->cset_start_rb, ssb_offset_point_a, type0_PDCCH_CSS_config->rb_offset); + AssertFatal(type0_PDCCH_CSS_config->cset_start_rb + type0_PDCCH_CSS_config->num_rbs <= grid_size, + "Invalid combination of start PRB %d and size %d of CSET0. Exceeds full BW %d\n", + type0_PDCCH_CSS_config->cset_start_rb, + type0_PDCCH_CSS_config->num_rbs, + grid_size); } void fill_coresetZero(NR_ControlResourceSet_t *coreset0, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index 8f795452b8..728ea74238 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -244,6 +244,7 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD NR_SubcarrierSpacing_t scs_ssb, frequency_range_t frequency_range, int nr_band, + int grid_size, uint32_t ssb_index, uint32_t ssb_period, uint32_t ssb_offset_point_a); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index 477e39a60a..dc82e5d308 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -449,6 +449,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl scs, mac->frequency_range, mac->nr_band, + 273, // at this point UE in principle doesn't know the grid size (we assume the largest) mac->mib_ssb, 1, // If the UE is not configured with a periodicity, the UE assumes a periodicity of a half frame ssb_offset_point_a); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index ed4d902345..80401de63a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -789,6 +789,7 @@ static void config_sched_ctrlCommon(gNB_MAC_INST *nr_mac) NR_SubcarrierSpacing_t scs = *scc->ssbSubcarrierSpacing; const long band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + const int bw = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; uint16_t ssb_start_symbol = get_ssb_start_symbol(band, scs, 0); int8_t ssb_period = *scc->ssb_periodicityServingCell; @@ -810,6 +811,7 @@ static void config_sched_ctrlCommon(gNB_MAC_INST *nr_mac) scs, frequency_range, band, + bw, 0, ssb_frame_periodicity, prb_offset); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 9f661984d0..12d09426a9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -134,7 +134,7 @@ static void schedule_one_ssb(gNB_MAC_INST *gNB, const NR_MIB_t *mib = cc->mib->message.choice.mib; uint32_t mib_pdu = (*(uint32_t *)cc->MIB_pdu) & ((1 << 24) - 1); uint8_t ssbSubcarrierOffset = gNB->ssb_SubcarrierOffset; - + const int bw = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; uint16_t ssb_start_symbol = get_ssb_start_symbol(band, scs, i_ssb); NR_beam_alloc_t beam = beam_allocation_procedure(&gNB->beam_info, frameP, slotP, get_beam_from_ssbidx(gNB, i_ssb), slots_per_frame); @@ -159,6 +159,7 @@ static void schedule_one_ssb(gNB_MAC_INST *gNB, scs, FR, band, + bw, i_ssb, ssb_frame_periodicity, prb_offset);