From dfbb6b1509be3ce935383ff5d91c074e3cfee492 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 10 Jul 2025 08:35:11 +0200 Subject: [PATCH] Handle Measurement Timing Configuration in DU/MAC handler --- openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c | 15 +++++++++++++-- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c index 30d3999f75..43b73705e9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -625,7 +625,9 @@ void ue_context_setup_request(const f1ap_ue_context_setup_req_t *req) } else if (cu2du->ue_cap != NULL) { ue_cap = get_ue_nr_cap(*req->gNB_DU_ue_id, cu2du->ue_cap->buf, cu2du->ue_cap->len); } - AssertFatal(cu2du->meas_config == NULL, "MeasConfig not handled\n"); + NR_MeasurementTimingConfiguration_t *mtc = NULL; + if (cu2du->meas_timing_config != NULL) + mtc = get_nr_mtc(cu2du->meas_timing_config->buf, cu2du->meas_timing_config->len); /* 38.473: "For DC operation, the CG-ConfigInfo IE shall be included in the CU * to DU RRC Information IE at the gNB acting as secondary node" As of now, @@ -696,6 +698,16 @@ void ue_context_setup_request(const f1ap_ue_context_setup_req_t *req) int ss_type = cg_configinfo ? NR_SearchSpace__searchSpaceType_PR_ue_Specific: NR_SearchSpace__searchSpaceType_PR_common; configure_UE_BWP(mac, scc, UE, false, ss_type, -1, -1); + if (mtc) { + /* creates a suitable measGap config to be used in the gNB */ + UE->measgap_config = create_measgap_config(mtc, UE->current_DL_BWP.scs, mac->radio_config.minRXTXTIME); + /* encodes the measGapConfig created, if useful (or not!) */ + byte_array_t *mgc = calloc_or_fail(1, sizeof(*mgc)); + mgc->buf = calloc_or_fail(1, 1024); + mgc->len = encode_measgap_config(&UE->measgap_config, mgc->buf); + resp.du_to_cu_rrc_info.meas_gap_config = mgc; + } + NR_SCHED_UNLOCK(&mac->sched_lock); mac->mac_rrc.ue_context_setup_response(&resp); @@ -720,7 +732,6 @@ void ue_context_modification_request(const f1ap_ue_context_mod_req_t *req) byte_array_t *b = req->cu_to_du_rrc_info->ue_cap; ue_cap = get_ue_nr_cap(req->gNB_DU_ue_id, b->buf, b->len); } - AssertFatal(req->cu_to_du_rrc_info->meas_config == NULL, "MeasConfig not handled\n"); } NR_SCHED_LOCK(&mac->sched_lock); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 477b9ce0c0..84be6f4b5a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -766,6 +766,7 @@ typedef struct { NR_SpCellConfig_t *reconfigSpCellConfig; interrupt_followup_action_t interrupt_action; NR_UE_NR_Capability_t *capability; + measgap_config_t measgap_config; // UE selected beam index uint8_t UE_beam_index; float ul_thr_ue;