consistenty use suffix _t for openair0_* types

This commit is contained in:
Thomas Schlichter
2026-01-23 18:30:39 +01:00
parent ed4cca814a
commit 75df29a333
38 changed files with 499 additions and 513 deletions
+1 -1
View File
@@ -320,7 +320,7 @@ uint32_t get_samples_symbol_timestamp(const NR_DL_FRAME_PARMS *fp, int slot, int
return get_samples_symbol_duration(fp, slot, 0, symbol);
}
uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, const NR_DL_FRAME_PARMS *fp)
uint32_t get_slot_from_timestamp(openair0_timestamp_t timestamp_rx, const NR_DL_FRAME_PARMS *fp)
{
timestamp_rx = timestamp_rx % fp->samples_per_frame;
if (timestamp_rx < fp->samples_per_slot0)
@@ -41,7 +41,7 @@ uint32_t ref_get_samples_slot_timestamp(NR_DL_FRAME_PARMS *fp, unsigned int slot
return samp_count;
}
uint32_t ref_get_slot_from_timestamp(openair0_timestamp ts, NR_DL_FRAME_PARMS *fp)
uint32_t ref_get_slot_from_timestamp(openair0_timestamp_t ts, NR_DL_FRAME_PARMS *fp)
{
uint32_t slot_idx = 0;
int samples_till_the_slot = get_samples_per_slot(slot_idx, fp) - 1;
@@ -75,7 +75,7 @@ void test_coherence_slot_api(NR_DL_FRAME_PARMS *fp)
EXPECT_EQ(get_samples_slot_timestamp(fp, slot), ref_get_samples_slot_timestamp(fp, slot));
}
openair0_timestamp ts = get_samples_per_slot(0, fp);
openair0_timestamp_t ts = get_samples_per_slot(0, fp);
// When timestamp is the last sample of the slot
EXPECT_EQ(get_slot_from_timestamp(ts - 1, fp), 0);
for (unsigned int slot = 0; slot < fp->slots_per_frame; slot++) {
@@ -174,4 +174,4 @@ int main(int argc, char **argv)
logInit();
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
}
+3 -2
View File
@@ -18,7 +18,7 @@ typedef struct {
#define SquaredNorm(VaR) ((VaR).r*(VaR).r+(VaR).i*(VaR).i)
typedef struct {
void ** samplesRx;
openair0_device *rfdevice;
openair0_device_t *rfdevice;
} calibData_t;
typedef struct OAIgraph {
@@ -384,7 +384,8 @@ static void *scopeThread(void *arg) {
return NULL;
}
void CalibrationInitScope(void ** samplesRx,openair0_device *rfdevice) {
void CalibrationInitScope(void **samplesRx, openair0_device_t *rfdevice)
{
pthread_t forms_thread;
calibData_t *tmp = (calibData_t *)malloc_or_fail(sizeof(*tmp));
tmp->samplesRx=samplesRx;
+1 -1
View File
@@ -1,5 +1,5 @@
#ifndef CALIB_SCOPE_H
#define CALIB_SCOPE_H
void CalibrationInitScope(void ** samplesRx,openair0_device *rfdevice);
void CalibrationInitScope(void **samplesRx, openair0_device_t *rfdevice);
#endif
+2 -2
View File
@@ -125,7 +125,7 @@ int main(int argc, char **argv) {
.samples_per_tti=0,
};
//-----------------------
openair0_device rfdevice= {
openair0_device_t rfdevice= {
/*!tx write thread*/
//.write_thread={0},
/*!brief Module ID of this device */
@@ -306,7 +306,7 @@ int main(int argc, char **argv) {
}
CalibrationInitScope(samplesRx, &rfdevice);
openair0_timestamp timestamp=0;
openair0_timestamp_t timestamp=0;
rfdevice.trx_start_func(&rfdevice);
while(!oai_exit) {
+11 -11
View File
@@ -222,7 +222,7 @@ typedef struct {
/// Context data structure for RX/TX portion of subframe processing
typedef struct {
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -273,9 +273,9 @@ typedef struct eNB_proc_NB_IoT_t_s {
/// thread index
int thread_index;
/// timestamp received from HW
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for reception
int subframe_rx;
/// symbol mask for IF4p5 reception per subframe
@@ -414,7 +414,7 @@ typedef struct {
/// index of the current UE RX/TX proc
int proc_id;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -445,7 +445,7 @@ typedef struct {
/// Context data structure for eNB subframe processing
typedef struct {
/// Last RX timestamp
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// pthread attributes for main UE thread
pthread_attr_t attr_ue;
/// scheduling parameters for main UE thread
@@ -484,9 +484,9 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
eth_params_t eth_params_n;
/// Ethernet parameters for fronthaul interface (upper L1 to Radio head)
eth_params_t eth_params;
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
int abstraction_flag;
openair0_timestamp ts_offset;
openair0_timestamp_t ts_offset;
// indicator for synchronization state of eNB
int in_synch;
// indicator for master/slave (RRU)
@@ -672,8 +672,8 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
/// RF and Interface devices per CC
openair0_device rfdevice;
openair0_device ifdevice;
openair0_device_t rfdevice;
openair0_device_t ifdevice;
/// Pointer for ifdevice buffer struct
if_buffer_t ifbuffer;
@@ -731,7 +731,7 @@ typedef struct {
/// \brief Module ID indicator for this instance
uint8_t Mod_id;
/// \brief Mapping of CC_id antennas to cards
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
//uint8_t local_flag;
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
runmode_NB_IoT_t mode;
@@ -956,7 +956,7 @@ typedef struct {
time_stats_t tx_prach;
/// RF and Interface devices per CC
openair0_device rfdevice;
openair0_device_t rfdevice;
time_stats_t dlsch_encoding_SIC_stats;
time_stats_t dlsch_scrambling_SIC_stats;
time_stats_t dlsch_modulation_SIC_stats;
+8 -8
View File
@@ -196,9 +196,9 @@ typedef struct RU_proc_t_s {
/// Pointer to associated RU descriptor
struct RU_t_s *ru;
/// timestamp received from HW
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe (LTE) / slot (NR) to act upon for reception
int tti_rx;
/// subframe (LTE) / slot (NR) to act upon for transmission
@@ -354,7 +354,7 @@ typedef struct RU_proc_t_s {
/// subframe to act upon for transmission
int subframe_phy_tx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_phy_tx;
openair0_timestamp_t timestamp_phy_tx;
/// pthread structure for RF TX thread
pthread_t pthread_rf_tx;
pthread_mutex_t mutex_rf_tx;
@@ -500,7 +500,7 @@ typedef struct RU_t_s {
/// "end of burst delay" used in TDD (unit: number of samples at 30.72MHz) (this is an expert option)
int end_of_burst_delay;
/// RF device descriptor
openair0_device rfdevice;
openair0_device_t rfdevice;
/// HW configuration
openair0_config_t openair0_cfg;
/// Number of NBs using this RU
@@ -510,9 +510,9 @@ typedef struct RU_t_s {
struct PHY_VARS_eNB_s *eNB_list[NUMBER_OF_eNB_MAX];
struct PHY_VARS_gNB_s *gNB_list[NUMBER_OF_gNB_MAX];
/// Mapping of antenna ports to RF chain index
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
/// IF device descriptor
openair0_device ifdevice;
openair0_device_t ifdevice;
/// Pointer for ifdevice buffer struct
if_buffer_t ifbuffer;
/// if prach processing is to be performed in RU
@@ -599,7 +599,7 @@ typedef struct RU_t_s {
/// sequence number for IF5
uint8_t seqno;
/// initial timestamp used as an offset make first real timestamp 0
openair0_timestamp ts_offset;
openair0_timestamp_t ts_offset;
/// Current state of the RU
rru_state_t state;
/// Command to do
@@ -758,7 +758,7 @@ typedef struct processingData_RU {
int frame_tx;
int slot_tx;
int next_slot;
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
RU_t *ru;
} processingData_RU_t;
#endif //__PHY_DEFS_RU__H__
+4 -4
View File
@@ -91,7 +91,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -148,7 +148,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// Last RX timestamp
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// pthread attributes for main UE thread
pthread_attr_t attr_ue;
/// scheduling parameters for main UE thread
@@ -550,7 +550,7 @@ typedef struct {
/// \brief Component carrier ID for this PHY instance
uint8_t CC_id;
/// \brief Mapping of CC_id antennas to cards
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
//uint8_t local_flag;
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
runmode_t mode;
@@ -817,7 +817,7 @@ typedef struct {
int instance_cnt_timer;
/// RF and Interface devices per CC
openair0_device rfdevice;
openair0_device_t rfdevice;
void *scopeData;
} PHY_VARS_UE;
+4 -4
View File
@@ -218,8 +218,8 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_tx;
openair0_timestamp_t timestamp_rx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -285,9 +285,9 @@ typedef struct L1_proc_t_s {
/// thread index
int thread_index;
/// timestamp received from HW
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// subframe to act upon for reception
int subframe_rx;
/// subframe to act upon for PRACH
+5 -5
View File
@@ -288,7 +288,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// slot to act upon for transmission
int slot_tx;
/// slot to act upon for reception
@@ -312,9 +312,9 @@ typedef struct gNB_L1_proc_t_s {
/// Component Carrier index
uint8_t CC_id;
/// timestamp received from HW
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
/// slot to act upon for reception
int slot_rx;
/// frame to act upon for reception
@@ -566,7 +566,7 @@ union ldpcReqUnion {
typedef struct processingData_L1 {
int frame_rx;
int slot_rx;
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
PHY_VARS_gNB *gNB;
notifiedFIFO_elt_t *elt;
} processingData_L1_t;
@@ -576,7 +576,7 @@ typedef struct processingData_L1tx {
int slot;
int frame_rx;
int slot_rx;
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
PHY_VARS_gNB *gNB;
} processingData_L1tx_t;
+4 -4
View File
@@ -113,7 +113,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// Last RX timestamp
openair0_timestamp timestamp_rx;
openair0_timestamp_t timestamp_rx;
} UE_nr_proc_t;
typedef enum {
@@ -350,7 +350,7 @@ typedef struct PHY_VARS_NR_UE_s {
/// \brief Component carrier ID for this PHY instance
uint8_t CC_id;
/// \brief Mapping of CC_id antennas to cards
openair0_rf_map rf_map;
openair0_rf_map_t rf_map;
/// \brief Indicator that UE should perform band scanning
int UE_scan;
/// \brief Indicator that UE should perform coarse scanning around carrier
@@ -508,7 +508,7 @@ typedef struct PHY_VARS_NR_UE_s {
nr_ue_phy_cpu_stat_t phy_cpu_stats;
/// RF and Interface devices per CC
openair0_device rfdevice;
openair0_device_t rfdevice;
/// Phase precompensation flag
bool no_phase_pre_comp;
@@ -540,7 +540,7 @@ typedef struct PHY_VARS_NR_UE_s {
} PHY_VARS_NR_UE;
typedef struct {
openair0_timestamp timestamp_tx;
openair0_timestamp_t timestamp_tx;
int gNB_id;
/// NR slot index within frame_tx [0 .. slots_per_frame - 1] to act upon for transmission
int nr_slot_tx;
+1 -1
View File
@@ -334,7 +334,7 @@ uint32_t get_samples_slot_duration(const NR_DL_FRAME_PARMS *fp, unsigned int sta
// Get timestamp of slot from start of frame
uint32_t get_samples_slot_timestamp(const NR_DL_FRAME_PARMS *fp, unsigned int slot);
// Get slot from timestamp
uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, const NR_DL_FRAME_PARMS *fp);
uint32_t get_slot_from_timestamp(openair0_timestamp_t timestamp_rx, const NR_DL_FRAME_PARMS *fp);
// Get number of samples in the slot
uint32_t get_samples_per_slot(int slot, const NR_DL_FRAME_PARMS *fp);
+1 -1
View File
@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
openair0_device openair0;
openair0_device_t openair0;
int oai_exit=0;
void exit_function(const char* file, const char* function, const int line,const char* s, const int assert) {
+2 -2
View File
@@ -328,8 +328,8 @@ typedef struct {
int RU_output_mask[NUMBER_OF_UE_MAX];
pthread_mutex_t RU_output_mutex[NUMBER_OF_UE_MAX];
pthread_mutex_t UE_output_mutex[NUMBER_OF_RU_MAX];
openair0_timestamp current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
openair0_timestamp current_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
openair0_timestamp_t current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
openair0_timestamp_t current_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
double ru_amp[NUMBER_OF_RU_MAX];
} sim_t;