From ac01fcc1b4998c2b7ea6fa171fe8bf2d05ef7f1f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 2 Jun 2025 11:24:20 +0200 Subject: [PATCH 1/4] Move RLC-BearerConfig file to nr_rrc_config.c One of the next commits moves nr_rrc_config.c "down to" the MAC/DU. The BearerConfig functions are only used at the DU, so move them here in the corresponding file. --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 112 ---------------------------- openair2/RRC/NR/MESSAGES/asn1_msg.h | 6 -- openair2/RRC/NR/nr_rrc_config.c | 111 ++++++++++++++++++++++++++- openair2/RRC/NR/nr_rrc_config.h | 3 + 4 files changed, 113 insertions(+), 119 deletions(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 586e2e7628..6a7ee77b52 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -269,118 +269,6 @@ int do_RRCReject(uint8_t *const buffer) return (enc_rval.encoded + 7) / 8; } -NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig(long channelId, - long priority, - e_NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration bucketSizeDuration) -{ - NR_RLC_BearerConfig_t *rlc_BearerConfig = NULL; - rlc_BearerConfig = calloc(1, sizeof(NR_RLC_BearerConfig_t)); - rlc_BearerConfig->logicalChannelIdentity = channelId; - rlc_BearerConfig->servedRadioBearer = calloc(1, sizeof(*rlc_BearerConfig->servedRadioBearer)); - rlc_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity; - rlc_BearerConfig->servedRadioBearer->choice.srb_Identity = channelId; - rlc_BearerConfig->reestablishRLC = NULL; - - NR_RLC_Config_t *rlc_Config = calloc(1, sizeof(NR_RLC_Config_t)); - rlc_Config->present = NR_RLC_Config_PR_am; - rlc_Config->choice.am = calloc(1, sizeof(*rlc_Config->choice.am)); - rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t)); - *(rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength) = NR_SN_FieldLengthAM_size12; - rlc_Config->choice.am->dl_AM_RLC.t_Reassembly = NR_T_Reassembly_ms35; - rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms0; - rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t)); - *(rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength) = NR_SN_FieldLengthAM_size12; - rlc_Config->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms45; - rlc_Config->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_infinity; - rlc_Config->choice.am->ul_AM_RLC.pollByte = NR_PollByte_infinity; - rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t8; - rlc_BearerConfig->rlc_Config = rlc_Config; - - NR_LogicalChannelConfig_t *logicalChannelConfig = calloc(1, sizeof(NR_LogicalChannelConfig_t)); - logicalChannelConfig->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig->ul_SpecificParameters)); - logicalChannelConfig->ul_SpecificParameters->priority = priority; - logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity; - logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration = bucketSizeDuration; - - long *logicalChannelGroup = CALLOC(1, sizeof(long)); - *logicalChannelGroup = 0; - logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = logicalChannelGroup; - logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = CALLOC(1, sizeof(*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID)); - *logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = 0; - logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = 0; - logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = 0; - rlc_BearerConfig->mac_LogicalChannelConfig = logicalChannelConfig; - - return rlc_BearerConfig; -} - -static void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config_pr) -{ - switch (rlc_config_pr) { - case NR_RLC_Config_PR_um_Bi_Directional: - // RLC UM Bi-directional Bearer configuration - LOG_I(RLC, "RLC UM Bi-directional Bearer configuration selected \n"); - rlc_Config->choice.um_Bi_Directional = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional)); - rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = - calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength)); - *rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12; - rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength = - calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength)); - *rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12; - rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.t_Reassembly = NR_T_Reassembly_ms15; - break; - case NR_RLC_Config_PR_am: - // RLC AM Bearer configuration - rlc_Config->choice.am = calloc(1, sizeof(*rlc_Config->choice.am)); - rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength)); - *rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = NR_SN_FieldLengthAM_size18; - rlc_Config->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms45; - rlc_Config->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_p64; - rlc_Config->choice.am->ul_AM_RLC.pollByte = NR_PollByte_kB500; - rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t32; - rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength)); - *rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = NR_SN_FieldLengthAM_size18; - rlc_Config->choice.am->dl_AM_RLC.t_Reassembly = NR_T_Reassembly_ms15; - rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms15; - break; - default: - AssertFatal(false, "RLC config type %d not handled\n", rlc_config_pr); - break; - } - rlc_Config->present = rlc_config_pr; -} - -NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR_RLC_Config_PR rlc_conf, long priority) -{ - NR_RLC_BearerConfig_t *rlc_BearerConfig = calloc(1, sizeof(NR_RLC_BearerConfig_t)); - rlc_BearerConfig->logicalChannelIdentity = lcChannelId; - rlc_BearerConfig->servedRadioBearer = calloc(1, sizeof(*rlc_BearerConfig->servedRadioBearer)); - rlc_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity; - rlc_BearerConfig->servedRadioBearer->choice.drb_Identity = drbId; - rlc_BearerConfig->reestablishRLC = NULL; - - NR_RLC_Config_t *rlc_Config = calloc(1, sizeof(NR_RLC_Config_t)); - nr_drb_config(rlc_Config, rlc_conf); - rlc_BearerConfig->rlc_Config = rlc_Config; - - NR_LogicalChannelConfig_t *logicalChannelConfig = calloc(1, sizeof(NR_LogicalChannelConfig_t)); - logicalChannelConfig->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig->ul_SpecificParameters)); - logicalChannelConfig->ul_SpecificParameters->priority = priority; - logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8; - logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration = NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms100; - - long *logicalChannelGroup = CALLOC(1, sizeof(long)); - *logicalChannelGroup = 1; - logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = logicalChannelGroup; - logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = CALLOC(1, sizeof(*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID)); - *logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = 0; - logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = 0; - logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = 0; - rlc_BearerConfig->mac_LogicalChannelConfig = logicalChannelConfig; - - return rlc_BearerConfig; -} - /* returns a default radio bearer config suitable for NSA etc */ NR_RadioBearerConfig_t *get_default_rbconfig(int eps_bearer_id, int rb_id, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 344659afbb..afc9226b17 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -69,12 +69,6 @@ int do_SIB2_NR(uint8_t **msg_SIB2, NR_SSB_MTC_t *ssbmtc); int do_RRCReject(uint8_t *const buffer); -NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig( - long channelId, - long priority, - e_NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration bucketSizeDuration); -NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR_RLC_Config_PR rlc_conf, long priority); - NR_RadioBearerConfig_t *get_default_rbconfig(int eps_bearer_id, int rb_id, e_NR_CipheringAlgorithm ciphering_algorithm, diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index dfb5b9e231..27b9775237 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -35,7 +35,6 @@ #include #include "BIT_STRING.h" #include "NULL.h" -#include "RRC/NR/MESSAGES/asn1_msg.h" #include "RRC/NR/nr_rrc_proto.h" #include "SIMULATION/TOOLS/sim.h" #include "T.h" @@ -3348,6 +3347,116 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid, return SpCellConfig; } +NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig(long channelId, long priority, long bucketSizeDuration) +{ + NR_RLC_BearerConfig_t *rlc_BearerConfig = NULL; + rlc_BearerConfig = calloc(1, sizeof(NR_RLC_BearerConfig_t)); + rlc_BearerConfig->logicalChannelIdentity = channelId; + rlc_BearerConfig->servedRadioBearer = calloc(1, sizeof(*rlc_BearerConfig->servedRadioBearer)); + rlc_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity; + rlc_BearerConfig->servedRadioBearer->choice.srb_Identity = channelId; + rlc_BearerConfig->reestablishRLC = NULL; + + NR_RLC_Config_t *rlc_Config = calloc(1, sizeof(NR_RLC_Config_t)); + rlc_Config->present = NR_RLC_Config_PR_am; + rlc_Config->choice.am = calloc(1, sizeof(*rlc_Config->choice.am)); + rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t)); + *(rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength) = NR_SN_FieldLengthAM_size12; + rlc_Config->choice.am->dl_AM_RLC.t_Reassembly = NR_T_Reassembly_ms35; + rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms0; + rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t)); + *(rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength) = NR_SN_FieldLengthAM_size12; + rlc_Config->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms45; + rlc_Config->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_infinity; + rlc_Config->choice.am->ul_AM_RLC.pollByte = NR_PollByte_infinity; + rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t8; + rlc_BearerConfig->rlc_Config = rlc_Config; + + NR_LogicalChannelConfig_t *logicalChannelConfig = calloc(1, sizeof(NR_LogicalChannelConfig_t)); + logicalChannelConfig->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig->ul_SpecificParameters)); + logicalChannelConfig->ul_SpecificParameters->priority = priority; + logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity; + logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration = bucketSizeDuration; + + long *logicalChannelGroup = CALLOC(1, sizeof(long)); + *logicalChannelGroup = 0; + logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = logicalChannelGroup; + logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = CALLOC(1, sizeof(*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID)); + *logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = 0; + logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = 0; + logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = 0; + rlc_BearerConfig->mac_LogicalChannelConfig = logicalChannelConfig; + + return rlc_BearerConfig; +} + +static void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config_pr) +{ + switch (rlc_config_pr) { + case NR_RLC_Config_PR_um_Bi_Directional: + // RLC UM Bi-directional Bearer configuration + LOG_I(RLC, "RLC UM Bi-directional Bearer configuration selected \n"); + rlc_Config->choice.um_Bi_Directional = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional)); + rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = + calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength)); + *rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12; + rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength = + calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength)); + *rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12; + rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.t_Reassembly = NR_T_Reassembly_ms15; + break; + case NR_RLC_Config_PR_am: + // RLC AM Bearer configuration + rlc_Config->choice.am = calloc(1, sizeof(*rlc_Config->choice.am)); + rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength)); + *rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = NR_SN_FieldLengthAM_size18; + rlc_Config->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms45; + rlc_Config->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_p64; + rlc_Config->choice.am->ul_AM_RLC.pollByte = NR_PollByte_kB500; + rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t32; + rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength)); + *rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = NR_SN_FieldLengthAM_size18; + rlc_Config->choice.am->dl_AM_RLC.t_Reassembly = NR_T_Reassembly_ms15; + rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms15; + break; + default: + AssertFatal(false, "RLC config type %d not handled\n", rlc_config_pr); + break; + } + rlc_Config->present = rlc_config_pr; +} + +NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR_RLC_Config_PR rlc_conf, long priority) +{ + NR_RLC_BearerConfig_t *rlc_BearerConfig = calloc(1, sizeof(NR_RLC_BearerConfig_t)); + rlc_BearerConfig->logicalChannelIdentity = lcChannelId; + rlc_BearerConfig->servedRadioBearer = calloc(1, sizeof(*rlc_BearerConfig->servedRadioBearer)); + rlc_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity; + rlc_BearerConfig->servedRadioBearer->choice.drb_Identity = drbId; + rlc_BearerConfig->reestablishRLC = NULL; + + NR_RLC_Config_t *rlc_Config = calloc(1, sizeof(NR_RLC_Config_t)); + nr_drb_config(rlc_Config, rlc_conf); + rlc_BearerConfig->rlc_Config = rlc_Config; + + NR_LogicalChannelConfig_t *logicalChannelConfig = calloc(1, sizeof(NR_LogicalChannelConfig_t)); + logicalChannelConfig->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig->ul_SpecificParameters)); + logicalChannelConfig->ul_SpecificParameters->priority = priority; + logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8; + logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration = NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms100; + + long *logicalChannelGroup = CALLOC(1, sizeof(long)); + *logicalChannelGroup = 1; + logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = logicalChannelGroup; + logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = CALLOC(1, sizeof(*logicalChannelConfig->ul_SpecificParameters->schedulingRequestID)); + *logicalChannelConfig->ul_SpecificParameters->schedulingRequestID = 0; + logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = 0; + logicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = 0; + rlc_BearerConfig->mac_LogicalChannelConfig = logicalChannelConfig; + + return rlc_BearerConfig; +} + NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid, const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfig_t *servingcellconfigdedicated, diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index c4189dcb21..b9b074d377 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -116,4 +116,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC NR_ReconfigurationWithSync_t *get_reconfiguration_with_sync(rnti_t rnti, uid_t uid, const NR_ServingCellConfigCommon_t *scc); +NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig(long channelId, long priority, long bucketSizeDuration); +NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR_RLC_Config_PR rlc_conf, long priority); + #endif From 8bf48f326aff5aa45ffa3fa27212f045b8fa82c4 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 2 Jun 2025 11:25:47 +0200 Subject: [PATCH 2/4] Move NR_MAX_SUPPORTED_DL_LAYERS to where it is used --- openair2/RRC/NR/nr_rrc_config.c | 2 ++ openair2/RRC/NR/nr_rrc_proto.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 27b9775237..ecf361df91 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -57,6 +57,8 @@ #include "utils.h" #include "xer_encoder.h" +#define NR_MAX_SUPPORTED_DL_LAYERS 4 + #define PUCCH2_SIZE 8 const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160}; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index c5627b6e55..4546f59723 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -39,8 +39,6 @@ #include "NR_CG-ConfigInfo.h" #include "NR_RRCReconfiguration.h" -#define NR_MAX_SUPPORTED_DL_LAYERS 4 - void rrc_add_nsa_user(gNB_RRC_INST *rrc, x2ap_ENDC_sgnb_addition_req_t *m, sctp_assoc_t assoc_id); void rrc_add_nsa_user_resp(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const f1ap_ue_context_setup_t *resp); void rrc_release_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context); From c334ad7f7cbdd5d8db2c117c4124fda3eba60567 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 2 Jun 2025 11:30:31 +0200 Subject: [PATCH 3/4] Remove unused, add necessary headers --- openair2/RRC/NR/nr_rrc_config.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index ecf361df91..385dd5bc2d 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -29,15 +29,13 @@ */ #include "nr_rrc_config.h" + #include #include #include #include #include "BIT_STRING.h" #include "NULL.h" -#include "RRC/NR/nr_rrc_proto.h" -#include "SIMULATION/TOOLS/sim.h" -#include "T.h" #include "asn_SET_OF.h" #include "asn_codecs.h" #include "asn_internal.h" @@ -48,10 +46,11 @@ #include "constr_TYPE.h" #include "executables/softmodem-common.h" #include "oai_asn1.h" -#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" #include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" #include "openair3/UTILS/conversions.h" + +#include "NR_MeasurementTimingConfiguration.h" #include "uper_decoder.h" #include "uper_encoder.h" #include "utils.h" From 4d755c9a1a5367061fbb68fbc621e62a35f2fe3a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 2 Jun 2025 11:39:33 +0200 Subject: [PATCH 4/4] Move nr_rrc_config.c to DU and rename nr_radio_config.c A number of radio-related RRC parameters, e.g., CellGroupConfig, "originate" at the DU and are sent to the CU for forwarding to the UE only. Similarly, there are additional parameters, e.g., RLC-BearerConfig (part of CellGroupConfig), that originate at the DU. Hence, the DU decides about these parameters, depending on the MAC state and capabilities. To clarify this, move the existing openair2/RRC/NR/nr_rrc_config.{c,h} => openair2/LAYER2/NR_MAC_gNB/nr_radio_config.{c,h} So that developers know that while those are RRC parameters, they originate at the DU. In other words, the CU/RRC is not supposed to use any of these functions in the RRC. Correspondingly, includes of this file have been cleaned up (and when they are not necessary at the MAC as well). --- CMakeLists.txt | 2 +- common/utils/telnetsrv/telnetsrv_o1.c | 2 +- doc/Doxyfile | 4 ++-- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/GNB_APP/gnb_config.c | 1 - openair2/LAYER2/NR_MAC_gNB/config.c | 1 - openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c | 1 + openair2/LAYER2/NR_MAC_gNB/main.c | 2 -- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 +- .../NR_MAC_gNB/nr_radio_config.c} | 11 +---------- .../NR_MAC_gNB/nr_radio_config.h} | 13 ++----------- openair2/RRC/NR/rrc_gNB_nsa.c | 1 - 13 files changed, 11 insertions(+), 33 deletions(-) rename openair2/{RRC/NR/nr_rrc_config.c => LAYER2/NR_MAC_gNB/nr_radio_config.c} (99%) rename openair2/{RRC/NR/nr_rrc_config.h => LAYER2/NR_MAC_gNB/nr_radio_config.h} (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b607056aa4..16dac5f2fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1147,7 +1147,6 @@ set(L2_NR_SRC ${NR_RRC_DIR}/rrc_gNB.c ${NR_RRC_DIR}/mac_rrc_dl_direct.c ${NR_RRC_DIR}/mac_rrc_dl_f1ap.c - ${NR_RRC_DIR}/nr_rrc_config.c ${NR_RRC_DIR}/rrc_gNB_nsa.c ${NR_RRC_DIR}/rrc_gNB_UE_context.c ${NR_RRC_DIR}/rrc_gNB_NGAP.c @@ -1230,6 +1229,7 @@ set (MAC_NR_SRC ${NR_GNB_MAC_DIR}/mac_rrc_dl_handler.c ${NR_GNB_MAC_DIR}/mac_rrc_ul_direct.c ${NR_GNB_MAC_DIR}/mac_rrc_ul_f1ap.c + ${NR_GNB_MAC_DIR}/nr_radio_config.c ) diff --git a/common/utils/telnetsrv/telnetsrv_o1.c b/common/utils/telnetsrv/telnetsrv_o1.c index 7136f5a1b7..ac368885f6 100644 --- a/common/utils/telnetsrv/telnetsrv_o1.c +++ b/common/utils/telnetsrv/telnetsrv_o1.c @@ -34,7 +34,7 @@ #include "openair2/RRC/NR/nr_rrc_defs.h" #include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" -#include "openair2/RRC/NR/nr_rrc_config.h" +#include "openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h" #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" #include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c" #include "common/utils/nr/nr_common.h" diff --git a/doc/Doxyfile b/doc/Doxyfile index 6b0b390f05..f128e3eb88 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -1677,6 +1677,7 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h \ @@ -1687,6 +1688,7 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/openair2_proc.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/RLC/rlc.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_UE/mac_tables.c \ @@ -1847,7 +1849,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/nr_rrc_defs.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/cucp_cuup_if.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/cucp_cuup_direct.c \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/nr_rrc_config.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/mac_rrc_dl_direct.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_radio_bearers.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_NGAP.h \ @@ -1858,7 +1859,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/rrc_gNB_UE_context.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/cucp_cuup_e1ap.c \ @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_NGAP.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/NR/mac_rrc_dl_f1ap.c \ diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index e36d50c6ad..6238c09a2e 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -37,6 +37,7 @@ #include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h" #include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" +#include "LAYER2/NR_MAC_gNB/nr_radio_config.h" #include "NR_BCCH-BCH-Message.h" #include "NR_BWP-Downlink.h" #include "NR_CellGroupConfig.h" @@ -61,7 +62,6 @@ #include "PHY/defs_nr_common.h" #include "PHY/impl_defs_nr.h" #include "PHY/phy_vars_nr_ue.h" -#include "RRC/NR/nr_rrc_config.h" #include "SCHED_NR/fapi_nr_l1.h" #include "SCHED_NR/sched_nr.h" #include "SCHED_NR_UE/defs.h" diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index da85ef0de4..4c12530f30 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -87,7 +87,7 @@ #include "openair1/SIMULATION/TOOLS/sim.h" #include "openair2/LAYER2/NR_MAC_UE/mac_proto.h" #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" -#include "openair2/RRC/NR/nr_rrc_config.h" +#include "openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h" #include "time_meas.h" #include "utils.h" diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 2c82a6eb6e..bc8a65b1e3 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -42,7 +42,6 @@ #include "PHY/INIT/nr_phy_init.h" #include "PHY/defs_gNB.h" #include "PHY/defs_nr_common.h" -#include "RRC/NR/nr_rrc_config.h" #include "RRC_nr_paramsvalues.h" #include "T.h" #include "asn_SEQUENCE_OF.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index aacae2bea1..43d48eeeeb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -44,7 +44,6 @@ #include "NR_BCCH-BCH-Message.h" #include "NR_ServingCellConfigCommon.h" #include "NR_MIB.h" -#include "RRC/NR/nr_rrc_config.h" #include "SCHED_NR/phy_frame_config_nr.h" #include "T.h" #include "asn_internal.h" 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 9928c168c1..28c129cb58 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -22,6 +22,7 @@ #include "mac_rrc_dl_handler.h" #include "mac_proto.h" +#include "nr_radio_config.h" #include "openair2/F1AP/f1ap_ids.h" #include "openair2/F1AP/f1ap_common.h" #include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 3137ce0902..9c8e414f52 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -53,8 +53,6 @@ #include "NR_ServingCellConfig.h" #include "NR_ServingCellConfigCommon.h" #include "NR_TAG.h" -#include "RRC/NR/MESSAGES/asn1_msg.h" -#include "RRC/NR/nr_rrc_config.h" #include "assertions.h" #include "common/ngran_types.h" #include "common/ran_context.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 0b977de276..d97783604f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -74,7 +74,7 @@ #include "NR_BCCH-BCH-Message.h" #include "NR_CellGroupConfig.h" #include "NR_BCCH-DL-SCH-Message.h" -#include "openair2/RRC/NR/nr_rrc_config.h" +#include "nr_radio_config.h" /* PHY */ #include "time_meas.h" diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c similarity index 99% rename from openair2/RRC/NR/nr_rrc_config.c rename to openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c index 385dd5bc2d..fe4b138f49 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c @@ -19,16 +19,7 @@ * contact@openairinterface.org */ -/*! \file nr_rrc_config.c - * \brief rrc config for gNB - * \author Raymond Knopp, WEI-TAI CHEN - * \date 2018 - * \version 1.0 - * \company Eurecom, NTUST - * \email: raymond.knopp@eurecom.fr, kroempa@gmail.com - */ - -#include "nr_rrc_config.h" +#include "nr_radio_config.h" #include #include diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h similarity index 95% rename from openair2/RRC/NR/nr_rrc_config.h rename to openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h index b9b074d377..d5a7f8d40a 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.h @@ -19,17 +19,8 @@ * contact@openairinterface.org */ -/*! \file nr_rrc_config.c - * \brief rrc config for gNB - * \author Raymond Knopp, WEI-TAI CHEN - * \date 2018 - * \version 1.0 - * \company Eurecom, NTUST - * \email: raymond.knopp@eurecom.fr, kroempa@gmail.com - */ - -#ifndef __NR_RRC_CONFIG_H__ -#define __NR_RRC_CONFIG_H__ +#ifndef __NR_MAC_RRC_CONFIG_H__ +#define __NR_MAC_RRC_CONFIG_H__ #include #include diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 120a400bbf..deabe38327 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -40,7 +40,6 @@ #include #include "MESSAGES/asn1_msg.h" #include "OCTET_STRING.h" -#include "RRC/NR/nr_rrc_config.h" #include "T.h" #include "asn_codecs.h" #include "asn_internal.h"