Simplified use of nb_nr_inst

* nb_nr_inst represents the number of gNB instances and the number of RAN contexts
* it used also to count the number of RRC instances in the node
* it is set from config file in NRRCConfig, therefore redundant checks after
  this function have been removed
* redundant global variable NB_gNB_INST, set after nb_nr_inst, was removed
This commit is contained in:
Guido Casati
2024-11-06 10:15:42 +01:00
parent eaeae880d0
commit f80b09ac99
4 changed files with 10 additions and 19 deletions
-2
View File
@@ -54,8 +54,6 @@
#include "gnb_config.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
extern unsigned char NB_gNB_INST;
extern RAN_CONTEXT_t RC;
#define GNB_REGISTER_RETRY_DELAY 10
+5 -1
View File
@@ -2136,6 +2136,11 @@ void NRRCConfig(void) {
config_get(config_get_if(), GNBSParams, sizeofArray(GNBSParams), NULL);
RC.nb_nr_inst = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
AssertFatal(RC.nb_nr_inst == NUMBER_OF_gNB_MAX,
"Configuration error: RC.nb_nr_inst (%d) must equal NUMBER_OF_gNB_MAX (%d).\n"
"Currently, only one instance of each layer (L1, L2, L3) is supported.\n"
"Ensure that nb_nr_inst matches the maximum allowed gNB instances in this configuration.",
RC.nb_nr_inst, NUMBER_OF_gNB_MAX);
// Get num MACRLC instances
config_getlist(config_get_if(), &MACRLCParamList, NULL, 0, NULL);
@@ -2383,7 +2388,6 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
gnb_cu_cfg_update->num_cells_to_activate, RC.nb_nr_inst);
AssertFatal(gnb_cu_cfg_update->num_cells_to_activate == 1, "only one cell supported at the moment\n");
AssertFatal(RC.nb_nr_inst == 1, "expected one instance\n");
gNB_MAC_INST *mac = RC.nrmac[0];
NR_SCHED_LOCK(&mac->sched_lock);
for (j = 0; j < gnb_cu_cfg_update->num_cells_to_activate; j++) {