Merge remote-tracking branch 'origin/remove-dead-code' into integration_2026_w05 (!3831)

semi-manual remove of not used #define commands

As i was upset to see all these #define with no code under, i made a
global pass to remove the obvious cases semi-manual remove of not used
bodies

manual script, then a lot of manual review

    grep -IRs "#define" ../openair* ../common/* ../executables/ ../nfapi/ ../radio/ | \
        fgrep -v '(' | fgrep -v '//' |awk '{print $2}' | egrep -v "#define *$n"| \
            while read n ; do
              grep -IRs $n ../openair* ../common/* ../executables/ ../nfapi/ ../radio/  | grep -v "#define *$n" | grep -q $n || echo $n;
            done

will give a decent list of #define never used.  Then, I think we should
keep lists of # define when it comes from standards, even if the code
doesn't use it right now
This commit is contained in:
Robert Schmidt
2026-01-29 08:23:41 +01:00
172 changed files with 32 additions and 2467 deletions
+2 -38
View File
@@ -116,7 +116,6 @@ typedef enum {
MAX_TRANSP_TYPE
} transport_type_t;
/*!\brief openair0 device host type */
typedef enum {
MIN_HOST_TYPE = 0,
@@ -210,18 +209,12 @@ typedef struct split7_config {
/*! \brief RF frontend parameters set by application */
typedef struct openair0_config {
//! Module ID for this configuration
int Mod_id;
//! RU ID of this device
int ru_id;
//! duplexing mode
duplex_mode_t duplex_mode;
//! number of downlink resource blocks
int num_rb_dl;
//! number of samples per frame
unsigned int samples_per_frame;
//! the sample rate for both transmit and receive.
double sample_rate;
int num_rb_dl; double sample_rate;
//! flag to indicate that the device is doing mmapped DMA transfers
int mmapped_dma;
//! offset in samples between TX and RX paths
@@ -255,8 +248,6 @@ typedef struct openair0_config {
//! \brief memory
//! \brief Pointer to Calibration table for RX gains
rx_gain_calib_table_t *rx_gain_calib_table;
//! mode for rxgain (ExpressMIMO2)
rx_gain_t rxg_mode[8];
//! \brief Gain for RX in dB.
//! index: [0..rx_num_channels]
double rx_gain[8];
@@ -282,8 +273,6 @@ typedef struct openair0_config {
//! record player configuration, definition in record_player.h
uint32_t recplay_mode;
recplay_conf_t *recplay_conf;
//! number of samples per tti
unsigned int samples_per_tti;
//! Flag to indicate this configuration is for NR
int nr_flag;
//! NR band number
@@ -394,17 +383,11 @@ typedef struct {
} queue[WRITE_QUEUE_SZ];
} re_order_t;
/*!\brief structure holds the parameters to configure USRP devices */
/*!\brief structure holds the parameters to configure RF devices */
struct openair0_device {
/*!tx write thread*/
openair0_thread_t write_thread;
/*!brief Module ID of this device */
int Mod_id;
/*!brief Component Carrier ID of this device */
int CC_id;
/*!brief Type of this device */
dev_type_t type;
@@ -429,17 +412,12 @@ struct openair0_device {
recplay_state_t *recplay_state;
/* !brief Indicates if device already initialized */
int is_init;
/*!brief Can be used by driver to hold internal structure*/
void *priv;
/*!brief pointer to FH state, used in ECPRI split 8*/
fhstate_t fhstate;
/*!brief message response for notification fifo*/
notifiedFIFO_t *respudpTX;
/*!brief UDP TX thread context*/
udp_ctx_t **utx;
@@ -682,14 +660,6 @@ struct openair0_device {
re_order_t reOrder;
};
/* type of device init function, implemented in shared lib */
typedef int (*oai_device_initfunc_t)(openair0_device_t *device, openair0_config_t *openair0_cfg);
/* type of transport init function, implemented in shared lib */
typedef int (*oai_transport_initfunc_t)(openair0_device_t *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params);
#define OPTION_LZ4 0x00000001 // LZ4 compression (option_value is set to compressed size)
typedef struct {
uint32_t size; // Number of samples per antenna to follow this header
uint32_t nbAnt; // Total number of antennas following this header
@@ -710,7 +680,6 @@ extern "C"
#define DEVICE_SECTION "device"
#define CONFIG_HLP_DEVICE "Identifies the oai device (the interface to RF) to use, the shared lib \"lib_<name>.so\" will be loaded"
#define CONFIG_DEVICEOPT_NAME "name"
/* inclusion for device configuration */
@@ -731,11 +700,6 @@ int openair0_device_load(openair0_device_t *device, openair0_config_t *openair0_
/*! \brief Initialize transport protocol . It returns 0 if OK */
int openair0_transport_load(openair0_device_t *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params);
/*! \brief Get current timestamp of USRP
* \param device the hardware to use
*/
openair0_timestamp_t get_usrp_time(openair0_device_t *device);
/*! \brief Set RX frequencies
* \param device the hardware to use
* \param openair0_cfg RF frontend parameters set by application
+3 -7
View File
@@ -127,9 +127,6 @@ int trx_eth_start(openair0_device_t *device)
}
device->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
initTpool(pool, device->threadPool, cpumeas(CPUMEAS_GETSTATE));
// ULSCH decoder result FIFO
device->respudpTX = (notifiedFIFO_elt_t*) malloc(sizeof(notifiedFIFO_elt_t));
initNotifiedFIFO(device->respudpTX);
#endif
}
/* initialize socket */
@@ -484,7 +481,6 @@ int transport_init(openair0_device_t *device, openair0_config_t *openair0_cfg, e
printf("[ETHERNET]: Initializing openair0_device_t for %s ...\n", ((device->host_type == RAU_HOST) ? "RAU" : "RRU"));
printf("[ETHERNET]: num_fd %d\n",eth->num_fd);
device->Mod_id = 0;//num_devices_eth++;
device->transp_type = ETHERNET_TP;
device->trx_start_func = trx_eth_start;
device->trx_get_stats_func = trx_eth_get_stats;
@@ -567,7 +563,7 @@ void dump_dev(openair0_device_t *device)
{
eth_state_t *eth = (eth_state_t*)device->priv;
printf("Ethernet device interface %i configuration:\n" ,device->openair0_cfg->Mod_id);
printf("Ethernet device configuration:\n");
printf(" RB number: %i, sample rate: %lf \n" ,
device->openair0_cfg->num_rb_dl, device->openair0_cfg->sample_rate);
printf(" RAU configured for %i tx/%i rx channels)\n",
@@ -582,14 +578,14 @@ void dump_dev(openair0_device_t *device)
void inline dump_txcounters(openair0_device_t *device)
{
eth_state_t *eth = (eth_state_t*)device->priv;
printf(" Ethernet device interface %i, tx counters:\n" ,device->openair0_cfg->Mod_id);
printf(" Ethernet device interface tx counters:\n");
printf(" Sent packets: %llu send errors: %i\n", (long long unsigned int)eth->tx_count, eth->num_tx_errors);
}
void inline dump_rxcounters(openair0_device_t *device)
{
eth_state_t *eth = (eth_state_t*)device->priv;
printf(" Ethernet device interface %i rx counters:\n" ,device->openair0_cfg->Mod_id);
printf(" Ethernet device interface rx counters:\n");
printf(" Received packets: %llu missed packets errors: %i\n", (long long unsigned int)eth->rx_count, eth->num_underflows);
}
-1
View File
@@ -43,7 +43,6 @@
#include <netinet/ether.h>
#define MAX_INST 4
#define DEFAULT_IF "lo"
#define TX_FLAG 1
#define RX_FLAG 0
-1
View File
@@ -83,6 +83,5 @@
// Mobipass packet sizes
#define RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES 1280
#define RAW_IF5_MOBIPASS_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES)
#define PAYLOAD_MOBIPASS_NUM_SAMPLES 640
#endif
-1
View File
@@ -401,7 +401,6 @@ __attribute__((__visibility__("default"))) int transport_init(openair0_device_t
eth->e.if_name = eth_params->local_if_name;
eth->last_msg = (rru_config_msg_type_t)-1;
device->Mod_id = 0;
device->transp_type = ETHERNET_TP;
device->trx_start_func = trx_oran_start;
device->trx_get_stats_func = trx_oran_get_stats;
-2
View File
@@ -23,8 +23,6 @@
*
* \author:FrancoisTaburet: francois.taburet@nokia-bell-labs.com
*/
#define _LARGEFILE_SOURCE
#define _FILE_OFFSET_BITS 64
#include <string.h>
#include <pthread.h>
#include <unistd.h>
-1
View File
@@ -49,7 +49,6 @@
#include <common/utils/telnetsrv/telnetsrv.h>
#include <common/config/config_userapi.h>
#include "common_lib.h"
#define CHANNELMOD_DYNAMICLOAD
extern "C" {
#include <common/utils/load_module_shlib.h>
#include <openair1/SIMULATION/TOOLS/sim.h>