From 35995c8a10c4c591e0bbd07ef67e3c3fec8f86e2 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 4 Oct 2024 19:38:12 +0200 Subject: [PATCH] Move RETURN_IF_INVALID_ASSOC_ID() to header for use elsewhere RETURN_IF_INVALID_ASSOC_ID() checks if an assoc_id (of a DU) is valid. It will be also used in the mobility RRC module later. Move it to the DU header (where it logically belongs) to move it from there. --- openair2/RRC/NR/rrc_gNB.c | 10 ---------- openair2/RRC/NR/rrc_gNB_du.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 9e3cd6aa1d..840844a0ec 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -112,16 +112,6 @@ extern RAN_CONTEXT_t RC; mui_t rrc_gNB_mui = 0; -// the assoc_id might be 0 (if the DU goes offline). Below helper macro to -// print an error and return from the function in that case -#define RETURN_IF_INVALID_ASSOC_ID(assoc_id) \ - { \ - if (assoc_id == 0) { \ - LOG_E(NR_RRC, "cannot send data: invalid assoc_id 0, DU offline\n"); \ - return; \ - } \ - } - ///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------/// diff --git a/openair2/RRC/NR/rrc_gNB_du.h b/openair2/RRC/NR/rrc_gNB_du.h index 3ee0b611ef..2c0b5574ce 100644 --- a/openair2/RRC/NR/rrc_gNB_du.h +++ b/openair2/RRC/NR/rrc_gNB_du.h @@ -48,4 +48,14 @@ int get_dl_band(const struct f1ap_served_cell_info_t *cell_info); int get_ssb_scs(const struct f1ap_served_cell_info_t *cell_info); int get_ssb_arfcn(const struct nr_rrc_du_container_t *du); +// the assoc_id might be 0 (if the DU goes offline). Below helper macro to +// print an error and return from the function in that case +#define RETURN_IF_INVALID_ASSOC_ID(assoc_id) \ + { \ + if (assoc_id == 0) { \ + LOG_E(NR_RRC, "cannot send data: invalid assoc_id 0, DU offline\n"); \ + return; \ + } \ + } + #endif /* RRC_GNB_DU_H_ */