From efbdd92694edcccaae042f492d861655b900791a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Apr 2025 09:25:19 +0200 Subject: [PATCH] Move get_default_reconfig() to rrc_gNB_nsa.c --- CMakeLists.txt | 1 - doc/Doxyfile | 1 - openair2/RRC/NR/nr_rrc_proto.h | 2 - openair2/RRC/NR/rrc_gNB_nsa.c | 18 ++++++++ openair2/RRC/NR/rrc_gNB_reconfig.c | 66 ------------------------------ 5 files changed, 18 insertions(+), 70 deletions(-) delete mode 100644 openair2/RRC/NR/rrc_gNB_reconfig.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f77734be1..25d8d29bde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1139,7 +1139,6 @@ set(L2_NR_SRC ${NR_RRC_DIR}/nr_rrc_config.c ${NR_RRC_DIR}/rrc_gNB_nsa.c ${NR_RRC_DIR}/rrc_gNB_internode.c - ${NR_RRC_DIR}/rrc_gNB_reconfig.c ${NR_RRC_DIR}/rrc_gNB_UE_context.c ${NR_RRC_DIR}/rrc_gNB_NGAP.c ${NR_RRC_DIR}/rrc_gNB_radio_bearers.c diff --git a/doc/Doxyfile b/doc/Doxyfile index 991a0bf734..5b20232c20 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -1861,7 +1861,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/nr_rrc_config.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_radio_bearers.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_reconfig.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_NGAP.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/mac_rrc_dl_f1ap.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/mac_rrc_dl.h \ diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index dbe1202e8c..fe544b7767 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -47,8 +47,6 @@ void rrc_add_nsa_user_resp(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const f1ap_ue_co void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti); void rrc_remove_ue(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p); -NR_RRCReconfiguration_IEs_t *get_default_reconfig(const NR_CellGroupConfig_t *secondaryCellGroup); - NR_CG_Config_t *generate_CG_Config(const NR_RRCReconfiguration_t *reconfig, const NR_RadioBearerConfig_t *rbconfig); int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2ap_ENDC_sgnb_addition_req_t *m); diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index ea70d9f8f5..1f89fe818d 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -295,6 +295,24 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, x2ap_ENDC_sgnb_addition_req_t *m) rrc->mac_rrc.ue_context_setup_request(ue_data.du_assoc_id, &req); } +static NR_RRCReconfiguration_IEs_t *get_default_reconfig(const NR_CellGroupConfig_t *secondaryCellGroup) +{ + NR_RRCReconfiguration_IEs_t *reconfig = calloc(1, sizeof(NR_RRCReconfiguration_IEs_t)); + AssertFatal(reconfig != NULL, "out of memory\n"); + AssertFatal(secondaryCellGroup != NULL, "secondaryCellGroup is null\n"); + reconfig->radioBearerConfig = NULL; + + char scg_buffer[1024]; + asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, (void *)secondaryCellGroup, scg_buffer, 1024); + AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", enc_rval.failed_type->name, enc_rval.encoded); + reconfig->secondaryCellGroup = calloc(1, sizeof(*reconfig->secondaryCellGroup)); + OCTET_STRING_fromBuf(reconfig->secondaryCellGroup, (const char *)scg_buffer, (enc_rval.encoded + 7) >> 3); + reconfig->measConfig = NULL; + reconfig->lateNonCriticalExtension = NULL; + reconfig->nonCriticalExtension = NULL; + return reconfig; +} + void rrc_add_nsa_user_resp(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const f1ap_ue_context_setup_t *resp) { DevAssert(resp->crnti != NULL); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c deleted file mode 100644 index 57e9b28dc6..0000000000 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file rrc_gNB_reconfig.c - * \brief rrc gNB RRCreconfiguration support routines - * \author Raymond Knopp - * \date 2019 - * \version 1.0 - * \company Eurecom - * \email: raymond.knopp@eurecom.fr - */ -#ifndef RRC_GNB_NSA_C -#define RRC_GNB_NSA_C - -#include - -#include "OCTET_STRING.h" -#include "RRC/NR/nr_rrc_proto.h" -#include "asn_codecs.h" -#include "assertions.h" -#include "constr_TYPE.h" -#include "oai_asn1.h" -#include "uper_encoder.h" - -NR_RRCReconfiguration_IEs_t *get_default_reconfig(const NR_CellGroupConfig_t *secondaryCellGroup) -{ - NR_RRCReconfiguration_IEs_t *reconfig = calloc(1, sizeof(NR_RRCReconfiguration_IEs_t)); - AssertFatal(reconfig != NULL, "out of memory\n"); - AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n"); - // radioBearerConfig - reconfig->radioBearerConfig=NULL; - - char scg_buffer[1024]; - asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, (void *)secondaryCellGroup, scg_buffer, 1024); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", enc_rval.failed_type->name, enc_rval.encoded); - reconfig->secondaryCellGroup = calloc(1,sizeof(*reconfig->secondaryCellGroup)); - OCTET_STRING_fromBuf(reconfig->secondaryCellGroup, - (const char *)scg_buffer, - (enc_rval.encoded+7)>>3); - // measConfig - reconfig->measConfig=NULL; - // lateNonCriticalExtension - reconfig->lateNonCriticalExtension = NULL; - // nonCriticalExtension - reconfig->nonCriticalExtension = NULL; - return reconfig; -} -#endif