wrong usage of extern declaration in C files, instead of headers, and fix hidden bugs by this wrong extern declaration duplication

Signed-off-by: Laurent THOMAS <laurent.thomas@open-cells.com>
This commit is contained in:
Laurent THOMAS
2026-05-21 15:53:40 +02:00
committed by Robert Schmidt
parent d8d4480b93
commit 3e6e6f0d27
43 changed files with 140 additions and 127 deletions

View File

@@ -36,7 +36,7 @@
#include "common/utils/LOG/log.h"
#define ASN_DEBUG(x...) do{ LOG_I(ASN1,x);LOG_I(ASN1,"\n"); } while(false)
#else
#define ASN_DEBUG(x...)
#define ASN_DEBUG(x...) do{}while(0)
#endif
#endif /* UTILS_CONFIG_H_ASN1 */

View File

@@ -28,8 +28,7 @@
#include "telnetsrv_cpumeasur_def.h"
#include "openair2/LAYER2/NR_MAC_UE/mac_defs.h"
#include "openair1/PHY/defs_nr_UE.h"
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
#include "openair1/PHY/phy_extern_nr_ue.h"
void measurcmd_display_macstats(telnet_printfunc_t prnt);
void measurcmd_display_macstats_ue(telnet_printfunc_t prnt);
@@ -64,7 +63,7 @@ int get_measurgroups(telnet_measurgroupdef_t **measurgroups) {
void measurcmd_display_phycpu(telnet_printfunc_t prnt) {
PHY_VARS_NR_UE *UE = PHY_vars_UE_g[0][0];
PHY_VARS_NR_UE *UE = nrPHY_vars_UE_g[0][0];
telnet_cpumeasurdef_t cpumeasur[MAX_CPU_STAT_TYPE] = {};
for (int i = 0; i < MAX_CPU_STAT_TYPE; i++) {
sprintf(cpumeasur[i].statname, "%s", UE->phy_cpu_stats.cpu_time_stats[i].meas_name);
@@ -80,7 +79,7 @@ void measurcmd_display_phycpu(telnet_printfunc_t prnt) {
}
void measurcmd_display_phyta(telnet_printfunc_t prnt)
{
PHY_VARS_NR_UE *UE = PHY_vars_UE_g[0][0];
PHY_VARS_NR_UE *UE = nrPHY_vars_UE_g[0][0];
prnt("%s PHY TA stats\n", HDR);
prnt("N_TA_offset %d\n", UE->N_TA_offset);
prnt("TA command %d\n", UE->ta_command);

View File

@@ -24,7 +24,7 @@
#include "openair2/LAYER2/NR_MAC_gNB/mac_config.h"
#include "openair2/RRC/NR/rrc_gNB_mobility.h"
#include "openair3/NGAP/ngap_gNB_ue_context.h"
#include "openair2/RRC/NR/rrc_gNB_du.h"
#define TELNETSERVERCODE
#include "telnetsrv.h"
@@ -132,8 +132,6 @@ int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt)
return 0;
}
extern nr_rrc_du_container_t *get_du_for_ue(gNB_RRC_INST *rrc, uint32_t ue_id);
/** @brief Get connected DU by the UE ID */
int fetch_du_by_ue_id(char *buf, int debug, telnet_printfunc_t prnt)
{
@@ -163,7 +161,6 @@ int fetch_du_by_ue_id(char *buf, int debug, telnet_printfunc_t prnt)
}
}
extern void nr_HO_F1_trigger_telnet(gNB_RRC_INST *rrc, uint32_t rrc_ue_id);
/**
* @brief Trigger F1 handover for UE
* @param buf: RRC UE ID or NULL for the first UE in list
@@ -194,8 +191,6 @@ int rrc_gNB_trigger_f1_ho(char *buf, int debug, telnet_printfunc_t prnt)
return 0;
}
extern void nr_HO_N2_trigger_telnet(gNB_RRC_INST *rrc, uint32_t neighbour_pci, uint32_t rrc_ue_id);
/** @brief Trigger N2 handover for UE
* @param buf: Neighbour PCI, SCell PCI, RRC UE ID
* @param debug: Debug flag

View File

@@ -19,14 +19,13 @@
#include "openair1/PHY/defs_nr_common.h"
#include "openair1/PHY/defs_nr_UE.h"
#include "openair3/NAS/NR_UE/nr_nas_msg.h"
#include "openair1/PHY/phy_extern_nr_ue.h"
#define TELNETSERVERCODE
#include "telnetsrv.h"
#define ERROR_MSG_RET(mSG, aRGS...) do { prnt(mSG, ##aRGS); return 1; } while (0)
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
/* UE L2 state string */
const char* NR_UE_L2_STATE_STR[] = {
#define UE_STATE(state) #state,
@@ -125,7 +124,7 @@ static int get_dl_toa(char *buf, int debug, telnet_printfunc_t prnt)
int rsc_id = 0;
int ant = 0;
PHY_VARS_NR_UE *UE = PHY_vars_UE_g[0][0];
PHY_VARS_NR_UE *UE = nrPHY_vars_UE_g[0][0];
if (!UE || !UE->prs_vars[gNB_id])
ERROR_MSG_RET("no UE/prs_vars found!\n");
NR_PRS_RESOURCE_t *prs_res = &UE->prs_vars[gNB_id]->prs_resource[rsc_id];

View File

@@ -20,8 +20,6 @@
#include "openair1/PHY/TOOLS/phy_scope_interface.h"
#include "common/utils/load_module_shlib.h"
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
static websrv_scope_params_t scope_params = {0, 1000, NULL, NULL, 65535};
static websrv_params_t *websrvparams_ptr;