From 7ea883352901aae571248f68fc119cefe4122e4c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 28 Feb 2024 10:38:56 +0100 Subject: [PATCH] Use MAX_MOBILES_PER_GNB in 5G NR code NUMBER_OF_UE_MAX is a 4G constant, use 5G one instead --- openair1/PHY/TOOLS/nr_phy_scope.c | 14 +++++++------- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/RRC/NR/rrc_gNB.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index 79ac95ef73..f9abcf211b 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -614,8 +614,8 @@ static void pucchIQ (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { static void puschThroughtput (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { // PUSCH Throughput /* - float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; - float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; + float tput_time_enb[MAX_MOBILES_PER_GNB][TPUT_WINDOW_LENGTH] = {{0}}; + float tput_enb[MAX_MOBILES_PER_GNB][TPUT_WINDOW_LENGTH] = {{0}}; memmove( tput_time_enb[UE_id], &tput_time_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); memmove( tput_enb[UE_id], &tput_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); @@ -725,7 +725,7 @@ static void *scope_thread_gNB(void *arg) { int fl_argc=1; char *name="5G-gNB-scope"; fl_initialize (&fl_argc, &name, NULL, 0, 0); - int nb_ue=min(NUMBER_OF_UE_MAX, scope_enb_num_ue); + int nb_ue=min(MAX_MOBILES_PER_GNB, scope_enb_num_ue); OAI_phy_scope_t *form_gnb = create_phy_scope_gnb(); while (!oai_exit) { @@ -985,9 +985,9 @@ static void uePdschIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_ } static void uePdschThroughput (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { /* - float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; - float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; - float tput_ue_max[NUMBER_OF_UE_MAX] = {0}; + float tput_time_ue[MAX_MOBILES_PER_GNB][TPUT_WINDOW_LENGTH] = {{0}}; + float tput_ue[MAX_MOBILES_PER_GNB][TPUT_WINDOW_LENGTH] = {{0}}; + float tput_ue_max[MAX_MOBILES_PER_GNB] = {0}; // PDSCH Throughput @@ -1178,7 +1178,7 @@ static void reset_stats_gNB(FL_OBJECT *button, int i,k; //PHY_VARS_gNB *phy_vars_gNB = RC.gNB[0][0]; - for (i=0; idlsch[i][0]->Mlimit; j++) { phy_vars_gNB->UE_stats[i].dlsch_NAK[k][j]=0; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index f4f6e891b2..b252f1cdd4 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -136,7 +136,7 @@ nrUE_params_t *get_nrUE_params(void) { uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; -channel_desc_t *UE2gNB[NUMBER_OF_UE_MAX][NUMBER_OF_gNB_MAX]; +channel_desc_t *UE2gNB[MAX_MOBILES_PER_GNB][NUMBER_OF_gNB_MAX]; int NB_UE_INST = 1; configmodule_interface_t *uniqCfg = NULL; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 0dc77fcf09..f0df5996a3 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -317,7 +317,7 @@ static void rrc_gNB_CU_DU_init(gNB_RRC_INST *rrc) void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) { AssertFatal(rrc != NULL, "RC.nrrrc not initialized!"); - AssertFatal(NUMBER_OF_UE_MAX < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow"); + AssertFatal(MAX_MOBILES_PER_GNB < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow"); AssertFatal(configuration!=NULL,"configuration input is null\n"); rrc->module_id = 0; rrc_gNB_CU_DU_init(rrc);