Merge branch 'remove-warnings' into 'develop'

Remove warnings



See merge request !27
This commit is contained in:
Cedric Roux
2016-03-31 16:07:23 +02:00
102 changed files with 447 additions and 286 deletions
+2 -1
View File
@@ -147,7 +147,8 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf
int rc;
//ToDo: EXMIMO harmonization is not complete. That is the reason for this ifdef
#ifdef EXMIMO
device_init(device, openair0_cfg);
int device_init(openair0_device *device, openair0_config_t *openair0_cfg);
rc = device_init(device, openair0_cfg);
#else
rc=load_lib(device, openair0_cfg, NULL,BBU_LOCAL_RADIO_HEAD );
if ( rc >= 0) {
@@ -30,8 +30,10 @@
#define TARGET_RX_POWER 50 // Target digital power for the AGC
#define TARGET_RX_POWER_MAX 53 // Maximum digital power for AGC
#define TARGET_RX_POWER_MIN 48 // Minimum digital power for AGC
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
#endif
void gain_control_all (unsigned int rx_power_fil_dB, unsigned int card);
void gain_control (unsigned int rx_power_fil_dB, unsigned int ant, unsigned int card);
@@ -98,4 +98,6 @@ unsigned int *openair0_daq_cnt(void);
// set the TX and RX frequencies (card 0 only for now, to retain USRP compatibility)
int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config);
int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg);
#endif
+15 -9
View File
@@ -394,7 +394,7 @@ struct timespec clock_difftime(struct timespec start, struct timespec end)
return temp;
}
void print_difftimes()
void print_difftimes(void)
{
#ifdef DEBUG
printf("difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec);
@@ -1055,7 +1055,7 @@ static void* eNB_thread_tx( void* param )
static int eNB_thread_tx_status[NUM_ENB_THREADS];
eNB_proc_t *proc = (eNB_proc_t*)param;
FILE *tx_time_file;
FILE *tx_time_file = NULL;
char tx_time_name[101];
if (opp_enabled == 1) {
@@ -1274,9 +1274,9 @@ static void* eNB_thread_rx( void* param )
eNB_proc_t *proc = (eNB_proc_t*)param;
FILE *rx_time_file;
FILE *rx_time_file = NULL;
char rx_time_name[101];
int i;
//int i;
if (opp_enabled == 1){
snprintf(rx_time_name, 100,"/tmp/%s_rx_time_thread_sf_%d", "eNB", proc->subframe);
@@ -1638,6 +1638,11 @@ static void* eNB_thread( void* arg )
int CC_id=0;
struct timespec trx_time0, trx_time1, trx_time2;
/* avoid gcc warnings */
(void)trx_time0;
(void)trx_time1;
(void)trx_time2;
#ifdef RTAI
RT_TASK* task = rt_task_init_schmod(nam2num("eNBmain"), 0, 0, 0, SCHED_FIFO, 0xF);
#else
@@ -1681,7 +1686,7 @@ static void* eNB_thread( void* arg )
#ifdef RTAI
printf( "[SCHED][eNB] Started eNB main thread (id %p)\n", task );
#else
printf( "[SCHED][eNB] Started eNB main thread on CPU %d TID %d\n", sched_getcpu(), gettid());
printf( "[SCHED][eNB] Started eNB main thread on CPU %d TID %ld\n", sched_getcpu(), gettid());
#endif
#ifdef HARD_RT
@@ -3225,10 +3230,11 @@ int main( int argc, char **argv )
if (input_fd) {
printf("Reading in from file to antenna buffer %d\n",0);
fread(UE[0]->lte_ue_common_vars.rxdata[0],
sizeof(int32_t),
frame_parms[0]->samples_per_tti*10,
input_fd);
if (fread(UE[0]->lte_ue_common_vars.rxdata[0],
sizeof(int32_t),
frame_parms[0]->samples_per_tti*10,
input_fd) != frame_parms[0]->samples_per_tti*10)
printf("error reading from file\n");
}
//p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
} else {
+7 -7
View File
@@ -463,7 +463,7 @@ static void *UE_thread_synch(void *arg)
if( UE->mode == rx_dump_frame ){
FILE *fd;
if ((UE->frame_rx&1) == 0) { // this guarantees SIB1 is present
if (fd = fopen("rxsig_frame0.dat","w")) {
if ((fd = fopen("rxsig_frame0.dat","w")) != NULL) {
fwrite((void*)&UE->lte_ue_common_vars.rxdata[0][0],
sizeof(int32_t),
10*UE->lte_frame_parms.samples_per_tti,
@@ -607,7 +607,7 @@ static void *UE_thread_synch(void *arg)
static void *UE_thread_tx(void *arg)
{
static int UE_thread_tx_retval;
int ret;
//int ret;
PHY_VARS_UE *UE = (PHY_VARS_UE*)arg;
@@ -1401,14 +1401,14 @@ void *UE_thread(void *arg)
RT_TASK *task;
#endif
// RTIME in, out, diff;
int slot=0,frame=0,hw_slot,last_slot,next_slot;
int slot=0,frame=0,hw_slot;
// unsigned int aa;
int delay_cnt;
RTIME time_in;
int hw_slot_offset=0,rx_offset_mbox=0,mbox_target=0,mbox_current=0;
int /* hw_slot_offset=0, */ rx_offset_mbox=0,mbox_target=0,mbox_current=0;
int diff2;
int i, ret;
int CC_id,card;
int /* i, */ ret;
int /* CC_id, */ card;
volatile unsigned int *DAQ_MBOX = openair0_daq_cnt();
int wait_sync_cnt = 0;
@@ -1688,7 +1688,7 @@ void *UE_thread(void *arg)
frame++;
}
} else if (UE->is_synchronized == 0) { // we are not yet synchronized
hw_slot_offset = 0;
//hw_slot_offset = 0;
first_synch = 1;
slot = 0;
+5
View File
@@ -38,6 +38,10 @@
* \warning
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "rt_wrapper.h"
static int latency_target_fd = -1;
static int32_t latency_target_value = 0;
@@ -154,6 +158,7 @@ int fill_modeled_runtime_table(uint16_t runtime_phy_rx[29][6],
runtime_phy_tx[i][j] = cell_processing_dl[j] + platform_processing_dl + user_processing_dl_err[j] + user_processing_dl_a[j]*i+ user_processing_dl_b[j];
}
}
return 0;
}
// int runtime_upper_layers[6]; // values for different RBs
+2 -2
View File
@@ -97,7 +97,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
double rx_pwr;
int32_t rx_pwr2;
uint32_t i,aa;
uint32_t slot_offset,slot_offset_meas;
uint32_t slot_offset,slot_offset_meas = 0;
double min_path_loss=-200;
uint8_t hold_channel=0;
@@ -105,7 +105,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
uint8_t nb_antennas_rx = eNB2UE[0][0][CC_id]->nb_rx; // number of rx antennas at UE
uint8_t nb_antennas_tx = eNB2UE[0][0][CC_id]->nb_tx; // number of tx antennas at eNB
LTE_DL_FRAME_PARMS *fp;
//LTE_DL_FRAME_PARMS *fp;
// int subframe_sched = ((next_slot>>1) == 0) ? 9 : ((next_slot>>1)-1);
+4 -5
View File
@@ -208,15 +208,15 @@ void schedule_events()
a = 5;
uint16_t *priority[11];//={1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2};
//uint16_t *priority[11];//={1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2};
int tab[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
//int tab[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
Application_Config* application_config;
application_config = malloc(sizeof(Application_Config));
for(i=0; i<NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++) {
tab[i]=i;
//tab[i]=i;
application_config->customized_traffic.aggregation_level[i]=i;
}
@@ -249,7 +249,7 @@ void schedule_events()
//schedule(READ, MAC_ET, 500, NULL, "");
//schedule(WRITE, MAC_ET, 100, NULL, "");
//schedule(READ, TOPO_ET,110,NULL,"",0,0);
double b = (double) 45;
//double b = (double) 45;
//schedule(READ, APP_ET,111,NULL,"",0,0);
//schedule(READ, SYS_ET,112,NULL,"",0,0);
//schedule(READ, EMU_ET,113,NULL,"",-1,-1);
@@ -1844,7 +1844,6 @@ void update_emu_model(Event_t event)
printf("\n\n\nA NEW EMU MODEL\n\n\n");
OAI_Emulation *oai_emulation;
oai_emulation = get_OAI_emulation();
int i=0;
if(event.optype == READ) {
if(event.key == NULL) {
+2 -2
View File
@@ -211,11 +211,11 @@ PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
if (eMBMS_active_state == multicast_relay) {
for (i=0; i < 10 ; i++) { // num SF in a frame
PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS_MBSFN,NSOFT,frame_parms->N_RB_DL, 0);
PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL, 0);
LOG_D(PHY,"eNB %d : MCH[%d] %p\n",RN_id,i,PHY_vars_RN->dlsch_rn_MCH[i]);
}
} else {
PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,NSOFT,frame_parms->N_RB_DL, 0);
PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, 0);
LOG_D(PHY,"eNB %d : MCH[0] %p\n",RN_id,PHY_vars_RN->dlsch_rn_MCH[0]);
}
+15 -8
View File
@@ -458,6 +458,7 @@ l2l1_task (void *args_p)
char *xargv[1];
//#endif
#undef PRINT_STATS /* this undef is to avoid gcc warnings */
#define PRINT_STATS
#ifdef PRINT_STATS
int len;
@@ -530,19 +531,23 @@ l2l1_task (void *args_p)
if(abstraction_flag==0) {
for (UE_inst=0; UE_inst<NB_UE_INST; UE_inst++) {
sprintf(UE_stats_th_filename,"UE_stats_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode);
/* TODO: transmission_mode is defined per CC, we set 0 for now */
sprintf(UE_stats_th_filename,"UE_stats_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode[0]);
UE_stats_th[UE_inst] = fopen (UE_stats_th_filename, "w");
}
sprintf(eNB_stats_th_filename,"eNB_stats_th_tx%d.txt",oai_emulation.info.transmission_mode);
/* TODO: transmission_mode is defined per CC, we set 0 for now */
sprintf(eNB_stats_th_filename,"eNB_stats_th_tx%d.txt",oai_emulation.info.transmission_mode[0]);
eNB_avg_thr = fopen (eNB_stats_th_filename, "w");
} else {
for (UE_inst=0; UE_inst<NB_UE_INST; UE_inst++) {
sprintf(UE_stats_th_filename,"UE_stats_abs_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode);
/* TODO: transmission_mode is defined per CC, we set 0 for now */
sprintf(UE_stats_th_filename,"UE_stats_abs_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode[0]);
UE_stats_th[UE_inst] = fopen (UE_stats_th_filename, "w");
}
sprintf(eNB_stats_th_filename,"eNB_stats_abs_th_tx%d.txt",oai_emulation.info.transmission_mode);
/* TODO: transmission_mode is defined per CC, we set 0 for now */
sprintf(eNB_stats_th_filename,"eNB_stats_abs_th_tx%d.txt",oai_emulation.info.transmission_mode[0]);
eNB_avg_thr = fopen (eNB_stats_th_filename, "w");
}
@@ -977,7 +982,7 @@ l2l1_task (void *args_p)
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
#warning figure out what to do with UE frame_parms during initial_sync
//#warning figure out what to do with UE frame_parms during initial_sync
do_DL_sig (r_re0,
r_im0,
r_re,
@@ -1000,7 +1005,7 @@ l2l1_task (void *args_p)
start_meas (&ul_chan_stats);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
#warning figure out what to do with UE frame_parms during initial_sync
//#warning figure out what to do with UE frame_parms during initial_sync
do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB,
enb_data, ue_data, next_slot,
abstraction_flag,
@@ -1034,7 +1039,7 @@ l2l1_task (void *args_p)
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
#warning check dimensions of r_reN,r_imN for multiple CCs
//#warning check dimensions of r_reN,r_imN for multiple CCs
do_DL_sig (r_re0,
r_im0,
r_re,
@@ -1061,7 +1066,7 @@ l2l1_task (void *args_p)
start_meas (&ul_chan_stats);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
#warning check dimensions of r_reN,r_imN for multiple CCs
//#warning check dimensions of r_reN,r_imN for multiple CCs
do_UL_sig (r_re0,
r_im0,
r_re,
@@ -1770,6 +1775,7 @@ print_opp_meas (void)
}
#if !defined(ENABLE_ITTI)
static void *
sigh (void *arg)
{
@@ -1805,6 +1811,7 @@ sigh (void *arg)
pthread_exit (NULL);
}
#endif /* !defined(ENABLE_ITTI) */
void
oai_shutdown (void)
+7 -7
View File
@@ -957,7 +957,7 @@ void init_openair1(void)
openair_daq_vars.rx_gain_mode = DAQ_AGC_ON;
openair_daq_vars.dlsch_transmission_mode = oai_emulation.info.transmission_mode[0];
#warning "NN->FK: OAI EMU channel abstraction does not work for MCS higher than"
//#warning "NN->FK: OAI EMU channel abstraction does not work for MCS higher than"
openair_daq_vars.target_ue_dl_mcs = cmin(target_dl_mcs,16);
openair_daq_vars.target_ue_ul_mcs = target_ul_mcs;
openair_daq_vars.ue_dl_rb_alloc=0x1fff;
@@ -1049,7 +1049,7 @@ void init_openair2(void)
module_id_t enb_id;
module_id_t UE_id;
int CC_id;
#warning "eNB index is hard coded to zero"
//#warning "eNB index is hard coded to zero"
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
l2_init (&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
@@ -1270,10 +1270,10 @@ void update_ocm()
LOG_I(OCM,"Path loss (CCid %d) between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f, angle %f\n",
CC_id,eNB_id,enb_data[eNB_id]->x,enb_data[eNB_id]->y,UE_id,ue_data[UE_id]->x,ue_data[UE_id]->y,
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB, eNB2UE[eNB_id][UE_id][CC_id]->aoa);
double dx, dy, distance;
dx = enb_data[eNB_id]->x - ue_data[UE_id]->x;
dy = enb_data[eNB_id]->y - ue_data[UE_id]->y;
distance = sqrt(dx * dx + dy * dy);
//double dx, dy, distance;
//dx = enb_data[eNB_id]->x - ue_data[UE_id]->x;
//dy = enb_data[eNB_id]->y - ue_data[UE_id]->y;
//distance = sqrt(dx * dx + dy * dy);
/*LOG_D(LOCALIZE, " OCM distance between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f \n",
eNB_id, enb_data[eNB_id]->x,enb_data[eNB_id]->y,
UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
@@ -1313,7 +1313,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
#if defined(USER_MODE) && defined(OAI_EMU)
int rrc_state=0;
//int rrc_state=0;
if (oai_emulation.info.otg_enabled ==1 ) {