From e75399707c6a9e8d36310111afd52e224115e97d Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Tue, 6 Jan 2026 11:11:30 +0100 Subject: [PATCH] RRC multi-cell (finalise): add informative comments and logging This commit adds documentation comments and logging to improve code readability and debugging capabilities for the multi-cell architecture. Changes: - gnb_config.c: Add logging when configuring DU with cell ID and PCI - rrc_gNB_du.c: Add documentation comment for ssb_arfcn_mtc() - rrc_gNB_du.c: Add documentation comment for dump_du_info() --- openair2/GNB_APP/gnb_config.c | 1 + openair2/RRC/NR/rrc_gNB_du.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 338f9ad8a5..b84f927f82 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1684,6 +1684,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) seq_arr_t *du_SIBs = RC.nrmac[0]->common_channels[0].du_SIBs; f1ap_setup_req_t *req = RC_read_F1Setup(gnb_du_id, name, &info, scc, mib, sib1, du_SIBs); AssertFatal(req != NULL, "could not read F1 Setup information\n"); + LOG_I(GNB_APP, "Configured DU: cell ID %lu, PCI %d\n", info.nr_cellid, info.nr_pci); RC.nrmac[0]->f1_config.setup_req = req; RC.nrmac[0]->f1_config.gnb_id = gnb_id; diff --git a/openair2/RRC/NR/rrc_gNB_du.c b/openair2/RRC/NR/rrc_gNB_du.c index f2e66257f6..10d2e4131c 100644 --- a/openair2/RRC/NR/rrc_gNB_du.c +++ b/openair2/RRC/NR/rrc_gNB_du.c @@ -72,6 +72,9 @@ static NR_SSB_MTC_t *get_ssb_mtc(const NR_MeasurementTimingConfiguration_t *mtc) return ssb_mtc; } +/** @brief Return the frequency of the SS block of the cell for which this message is included, + * or of other SS blocks within the same carrier. MeasurementTimingConfiguration message is + * used to convey assistance information for measurement timing between nodes (e.g F1 setup) */ static int ssb_arfcn_mtc(const NR_MeasurementTimingConfiguration_t *mtc) { /* format has been verified when accepting MeasurementTimingConfiguration */ @@ -728,6 +731,11 @@ nr_rrc_du_container_t *get_du_for_ue(gNB_RRC_INST *rrc, uint32_t ue_id) return get_du_by_assoc_id(rrc, ue_data.du_assoc_id); } +/** @brief Dump DU and cell information to file + * @param[in] rrc RRC instance + * @param[in] f File handle to write to + * @note Complexity: O(d + N_CELL) = O(N_CELL) where d = number of DUs, N_CELL = total number of cells across all DUs + * @note Called periodically (every 1 second) for stats logging */ void dump_du_info(const gNB_RRC_INST *rrc, FILE *f) { fprintf(f, "%ld connected DUs \n", rrc->num_dus);