Commit 299f627d authored by frtabu's avatar frtabu

more fixes for cppcheck, soon all the easiest ones completed (invalid printf format...)

parent 38bae9cc
Branches unavailable
2025.w12 2025.w11 2025.w10 2025.w09 2025.w08 2025.w07 2025.w06 2025.w05 2025.w04 2025.w03 2025.w02 2024.w51 2024.w50 2024.w49 2024.w48 2024.w47 2024.w46 2024.w45 2024.w44 2024.w43 2024.w42 2024.w41 2024.w40 2024.w39 2024.w38 2024.w36 2024.w35 2024.w34 2024.w33 2024.w32 2024.w31 2024.w30 2024.w29 2024.w28 2024.w27 2024.w26 2024.w25 2024.w24 2024.w23 2024.w22 2024.w21 2024.w18 2024.w17 2024.w16 2024.w15 2024.w14 2024.w13 2024.w12 2024.w11 2024.w10 2024.w09 2024.w08 2024.w06 2024.w05 2024.w04 2024.w03 2024.w02 2024.w01 2023.w51 2023.w50 2023.w49 2023.w48 2023.w47 2023.w45 2023.w43 2023.w42 2023.w41 2023.w40 2023.w39 2023.w38 2023.w37 2023.w36 2023.w34 2023.w33 2023.w32 2023.w31 2023.w30 2023.w29 2023.w28 2023.w27 2023.w26 2023.w25 2023.w24 2023.w23 2023.w22 2023.w21 2023.w20 2023.w19 2023.w18 2023.w18b 2023.w16 2023.w15 2023.w14 2023.w13 2023.w12 2023.w11 2023.w11b 2023.w10 2023.w10b 2023.w09 2023.w08 2023.w08b 2023.w07 2023.w06 2023.w05 2023.w03 2023.w02 2022.42 2022.41 2022.w51 2022.w50 2022.w49 2022.w48 2022.w47 2022.w46 2022.w45 2022.w43 2022.w42 2022.w42b 2022.w41 2022.w40 2022.w39 2022.w38 2022.w37 2022.w37b 2022.w36 2022.w35 2022.w33 2022.w32 2022.w31 2022.w31b 2022.w30 2022.w29 2022.w26 2022.w25 2022.w24 2022.w24b 2022.w23 2022.w22 2022.w21 2022.w20 2022.w19 2022.w18 2022.w17 2022.w15 2022.w15b 2022.w14a 2022.w13 2022.w13b 2022.w13a 2022.w12 2022.w10 2022.w09 2022.w09b 2022.w08 2022.w08b 2022.w07 2022.w07b 2022.w06 2022.w06a 2022.w05 2022.w05b 2022.w03_hotfix 2022.w03_b 2022.w02 2022.w01 2021.wk46 2021.wk14_a 2021.wk13_d 2021.wk13_c 2021.w51_c 2021.w51_a 2021.w50_a 2021.w49_b 2021.w49_a 2021.w48 2021.w47 2021.w46 2021.w46-powder 2021.w45 2021.w45_b 2021.w44 2021.w43 2021.w42 2021.w37 2021.w36 2021.w35 2021.w34 2021.w33 2021.w32 2021.w31 2021.w30 2021.w29 2021.w28 2021.w27 2021.w26 2021.w25 2021.w24 2021.w23 2021.w22 2021.w20 2021.w19 2021.w18_b 2021.w18_a 2021.w17_b 2021.w16 2021.w15 2021.w14 2021.w13_a 2021.w12 2021.w11 2021.w10 2021.w09 2021.w08 2021.w06 2021.w05 2021.w04 2021.w02 2020.w51_2 2020.w51 2020.w50 2020.w49 2020.w48_2 2020.w48 2020.w47 2020.w46_2 2020.w46 2020.w45_2 2020.w45 2020.w44 2020.w42_2 2020.w42 2020.w41 2020.w39 2020.w38 2020.w37 2020.w36 2020.w34 2020.w33 2020.w31 2020.w30 2020.w29 2020.w28 2020.w26 2020.w25 2020.w24 2020.w23 2020.w22 2020.w19 2020.w17 2020.w16 2020.w15 2020.w11 2020.w09 2020.w06 2020.w05 2020.w04 2020.w03 2019.w51 2019.w44 2019.w41 2019.w36 2019.w30 2019.w28 2019.w27 2019.w25 2019.w23 2019.w21 2019.w17 2019.w15 2019.w13 2019.w11 2019.w10 2019.w09 2019.w08 2019.w07 v2.2.0 v2.1.0 v2.0.0 v1.2.2 v1.2.1 v1.2.0 v1.1.1 v1.1.0 setparam nr-ip-over-lte-v.1.5 nr-ip-over-lte-v.1.4 nr-ip-over-lte-v.1.3 nr-ip-over-lte-v.1.2 nr-ip-over-lte-v.1.1 nr-ip-over-lte-v.1.0 flexran-eol develop-nr-2020w03 develop-nr-2020w02 develop-nr-2019w51 develop-nr-2019w50 develop-nr-2019w48 develop-nr-2019w47 develop-nr-2019w45 develop-nr-2019w43 develop-nr-2019w42 develop-nr-2019w40 benetel_phase_rotation benetel_gnb_rel_2.0 benetel_gnb_rel_1.0 benetel_enb_rel_2.0 benetel_enb_rel_1.0 ARC_1.3
No related merge requests found
// suppress error about keysP memory leak, free must be done by calling func */ // suppress error about keysP memory leak, free must be done by calling func */
memleak: memleak:common/utils/hashtable/obj_hashtable.c
common/utils/hashtable/obj_hashtable.c
// suppress error about keys memory leak, free must be done by calling func */ // suppress error about keys memory leak, free must be done by calling func */
memleak: memleak:openair2/UTIL/OMG/omg_hashtable.c
openair2/UTIL/OMG/omg_hashtable.c
// followings errors are in file not used in oai exec's included in CI // followings errors are in file not used in oai exec's included in CI
invalidPrintfArgType_sint: invalidPrintfArgType_sint:openair1/PHY/CODING/TESTBENCH/ltetest.c
openair1/PHY/CODING/TESTBENCH/ltetest.c memleak:openair1/PHY/CODING/TESTBENCH/ltetest.c
memleak: invalidPrintfArgType_sint:openair1/PHY/CODING/TESTBENCH/pdcch_test.c
openair1/PHY/CODING/TESTBENCH/ltetest.c
invalidPrintfArgType_sint:
openair1/PHY/CODING/TESTBENCH/pdcch_test.c
...@@ -305,10 +305,10 @@ unsigned char *packet_gen( ...@@ -305,10 +305,10 @@ unsigned char *packet_gen(
otg_info->tx_num_pkt[src_instance][dst_instance][otg_info->traffic_type[src_instance][dst_instance]]+=1; otg_info->tx_num_pkt[src_instance][dst_instance][otg_info->traffic_type[src_instance][dst_instance]]+=1;
if (size!=strlen(payload)) if (size!=strlen(payload))
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %zu, seq_num %d packet: |%s|%s| \n", LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %u, strlen %zu, seq_num %u packet: |%s|%s| \n",
src_instance, dst_instance, flag, size, strlen(payload), seq_num, header, payload); src_instance, dst_instance, flag, size, strlen(payload), seq_num, header, payload);
else else
LOG_D(OTG,"[%d][%d] 0x %x][m2m Aggre %d][Flow %d][Type %d/%s] TX INFO pkt at time %d Size= [payload %d] [Total %zu] with seq num %d, state=%d : |%s|%s| \n", LOG_D(OTG,"[%d][%d] 0x %x][m2m Aggre %u][Flow %u][Type %u/%s] TX INFO pkt at time %d Size= [payload %u] [Total %zu] with seq num %u, state=%u : |%s|%s| \n",
src_instance, dst_instance, flag, src_instance, dst_instance, flag,
otg_info->m2m_aggregation[src_instance][dst_instance], otg_info->m2m_aggregation[src_instance][dst_instance],
otg_info->flow_id[src_instance][dst_instance], otg_info->flow_id[src_instance][dst_instance],
...@@ -316,7 +316,7 @@ unsigned char *packet_gen( ...@@ -316,7 +316,7 @@ unsigned char *packet_gen(
map_int_to_str(otg_app_type_names,otg_info->traffic_type[src_instance][dst_instance]), map_int_to_str(otg_app_type_names,otg_info->traffic_type[src_instance][dst_instance]),
ctime, size, header_size+strlen(payload), seq_num,state, header, payload); ctime, size, header_size+strlen(payload), seq_num,state, header, payload);
LOG_D(OTG, "[%d]MY_SEQ %d \n", otg_info->traffic_type[src_instance][dst_instance], otg_info->seq_num[src_instance][dst_instance][otg_info->traffic_type[src_instance][dst_instance]] ); LOG_D(OTG, "[%u]MY_SEQ %d \n", otg_info->traffic_type[src_instance][dst_instance], otg_info->seq_num[src_instance][dst_instance][otg_info->traffic_type[src_instance][dst_instance]] );
} else { } else {
if ((g_otg->aggregation_level[src_instance][dst_instance][application]*otg_info->size_background[src_instance][dst_instance])<=PAYLOAD_MAX) if ((g_otg->aggregation_level[src_instance][dst_instance][application]*otg_info->size_background[src_instance][dst_instance])<=PAYLOAD_MAX)
otg_info->size_background[src_instance][dst_instance]=g_otg->aggregation_level[src_instance][dst_instance][application]*otg_info->size_background[src_instance][dst_instance]; otg_info->size_background[src_instance][dst_instance]=g_otg->aggregation_level[src_instance][dst_instance][application]*otg_info->size_background[src_instance][dst_instance];
...@@ -335,7 +335,7 @@ unsigned char *packet_gen( ...@@ -335,7 +335,7 @@ unsigned char *packet_gen(
otg_info->seq_num_background[src_instance][dst_instance]+=1; otg_info->seq_num_background[src_instance][dst_instance]+=1;
if (otg_info->size_background[src_instance][dst_instance]!=strlen(payload)) if (otg_info->size_background[src_instance][dst_instance]!=strlen(payload))
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %zu, seq num %d, packet |%s|%s| \n", LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %zu, seq num %u, packet |%s|%s| \n",
src_instance, src_instance,
dst_instance, dst_instance,
flag, flag,
...@@ -345,7 +345,7 @@ unsigned char *packet_gen( ...@@ -345,7 +345,7 @@ unsigned char *packet_gen(
header, header,
payload); payload);
else else
LOG_D(OTG,"[%d][%d][0x %x][%d] TX INFO pkt at time %s size is %d with seq num %d, state=%d : |%s|%s| \n", LOG_D(OTG,"[%d][%d][0x %x][%d] TX INFO pkt at time %s size is %d with seq num %u, state=%u : |%s|%s| \n",
src_instance, src_instance,
dst_instance, dst_instance,
flag, flag,
...@@ -367,7 +367,7 @@ unsigned char *packet_gen( ...@@ -367,7 +367,7 @@ unsigned char *packet_gen(
otg_info->tx_total_bytes_ul+=buffer_size; otg_info->tx_total_bytes_ul+=buffer_size;
if (otg_info->traffic_type[src_instance][dst_instance] > MAX_NUM_APPLICATION) { if (otg_info->traffic_type[src_instance][dst_instance] > MAX_NUM_APPLICATION) {
LOG_W(OTG,"application type out of range %d for the pair of (src %d, dst %d) \n", LOG_W(OTG,"application type out of range %u for the pair of (src %d, dst %d) \n",
otg_info->traffic_type[src_instance][dst_instance], src_instance, dst_instance); otg_info->traffic_type[src_instance][dst_instance], src_instance, dst_instance);
otg_info->traffic_type[src_instance][dst_instance]=0; otg_info->traffic_type[src_instance][dst_instance]=0;
} }
...@@ -425,7 +425,7 @@ unsigned char *packet_gen_multicast( ...@@ -425,7 +425,7 @@ unsigned char *packet_gen_multicast(
g_otg_multicast->idt_max[src_instance][dst_instance][app])); g_otg_multicast->idt_max[src_instance][dst_instance][app]));
size = ceil(uniform_dist(g_otg_multicast->size_min[src_instance][dst_instance][app], size = ceil(uniform_dist(g_otg_multicast->size_min[src_instance][dst_instance][app],
g_otg_multicast->size_max[src_instance][dst_instance][app])); g_otg_multicast->size_max[src_instance][dst_instance][app]));
LOG_D(OTG, "ptime %d, ctime %d idt %d (min %d, max %d) size %d (min %d, max %d)\n", LOG_D(OTG, "ptime %d, ctime %d idt %d (min %d, max %d) size %u (min %d, max %d)\n",
otg_multicast_info->ptime[src_instance][dst_instance][application], otg_multicast_info->ptime[src_instance][dst_instance][application],
ctime, ctime,
otg_multicast_info->idt[src_instance][dst_instance][app], otg_multicast_info->idt[src_instance][dst_instance][app],
...@@ -459,10 +459,10 @@ unsigned char *packet_gen_multicast( ...@@ -459,10 +459,10 @@ unsigned char *packet_gen_multicast(
otg_multicast_info->tx_num_bytes[src_instance][dst_instance][app]); otg_multicast_info->tx_num_bytes[src_instance][dst_instance][app]);
if (size!=strlen(payload)) if (size!=strlen(payload))
LOG_E(OTG,"[src %d][dst %d] The expected packet size does not match the payload size : size %d, strlen %zu \n", LOG_E(OTG,"[src %d][dst %d] The expected packet size does not match the payload size : size %u, strlen %zu \n",
src_instance, dst_instance, size, strlen(payload)); src_instance, dst_instance, size, strlen(payload));
else { else {
LOG_I(OTG,"[src %d][dst %d]TX INFO pkt at time %d Size= [payload %d] [Total %zu] with seq num %d: |%s|%s| \n", LOG_I(OTG,"[src %d][dst %d]TX INFO pkt at time %d Size= [payload %u] [Total %zu] with seq num %d: |%s|%s| \n",
src_instance, src_instance,
dst_instance, dst_instance,
ctime, ctime,
...@@ -557,7 +557,7 @@ int check_data_transmit( ...@@ -557,7 +557,7 @@ int check_data_transmit(
// for (application=0; application<g_otg->application_idx[src_instance][dst_instance]; application++){ // for (application=0; application<g_otg->application_idx[src_instance][dst_instance]; application++){
otg_info->gen_pkts=0; otg_info->gen_pkts=0;
LOG_T(OTG,"FLOW_INFO [src %d][dst %d] [IDX %d] [APPLICATION TYPE %d] MAX %d [M2M %d ]\n", LOG_T(OTG,"FLOW_INFO [src %d][dst %d] [IDX %d] [APPLICATION TYPE %d] MAX %u [M2M %u ]\n",
src_instance, dst_instance, app, src_instance, dst_instance, app,
g_otg->application_type[src_instance][dst_instance][app], g_otg->application_type[src_instance][dst_instance][app],
g_otg->application_idx[src_instance][dst_instance], g_otg->application_idx[src_instance][dst_instance],
...@@ -605,7 +605,7 @@ int check_data_transmit( ...@@ -605,7 +605,7 @@ int check_data_transmit(
if (((state==PU_STATE)||(state==ED_STATE))|| (otg_info->idt[src_instance][dst_instance][app]==0) if (((state==PU_STATE)||(state==ED_STATE))|| (otg_info->idt[src_instance][dst_instance][app]==0)
|| (( (ctime-otg_info->ptime[src_instance][dst_instance][app]) >= otg_info->idt[src_instance][dst_instance][app] ) )) { || (( (ctime-otg_info->ptime[src_instance][dst_instance][app]) >= otg_info->idt[src_instance][dst_instance][app] ) )) {
LOG_D(OTG,"[TX] OTG packet: Time To Transmit::OK (Source= %d, Destination= %d, Application %d, State= %d) , (IDT= %d ,ctime= %d, ptime= %d) \n", LOG_D(OTG,"[TX] OTG packet: Time To Transmit::OK (Source= %d, Destination= %d, Application %d, State= %u) , (IDT= %d ,ctime= %d, ptime= %d) \n",
src_instance, src_instance,
dst_instance , dst_instance ,
app, app,
...@@ -654,7 +654,7 @@ int check_data_transmit( ...@@ -654,7 +654,7 @@ int check_data_transmit(
if (g_otg->m2m[src_instance][dst_instance][app]==M2M) if (g_otg->m2m[src_instance][dst_instance][app]==M2M)
otg_info->traffic_type[src_instance][dst_instance]=app;//g_otg->application_idx[src_instance][dst_instance];//M2M; otg_info->traffic_type[src_instance][dst_instance]=app;//g_otg->application_idx[src_instance][dst_instance];//M2M;
LOG_D(OTG,"[BACKGROUND=%d] Time To Transmit [SRC %d][DST %d][APPLI %d] \n", otg_info->traffic_type_background[src_instance][dst_instance], src_instance, dst_instance, app); LOG_D(OTG,"[BACKGROUND=%u] Time To Transmit [SRC %d][DST %d][APPLI %d] \n", otg_info->traffic_type_background[src_instance][dst_instance], src_instance, dst_instance, app);
} }
} }
...@@ -720,7 +720,7 @@ void header_size_gen( ...@@ -720,7 +720,7 @@ void header_size_gen(
if ((g_otg->application_type[src_instance][dst_instance][application]==VOIP_G711)||(g_otg->application_type[src_instance][dst_instance][application]==VOIP_G729)) if ((g_otg->application_type[src_instance][dst_instance][application]==VOIP_G711)||(g_otg->application_type[src_instance][dst_instance][application]==VOIP_G729))
size_header+=RTP_HEADER; size_header+=RTP_HEADER;
LOG_D(OTG,"Header size is %d [IP V=%d][PROTO=%d]\n", size_header, g_otg->ip_v[src_instance][dst_instance][application],g_otg->trans_proto[src_instance][dst_instance][application]); LOG_D(OTG,"Header size is %u [IP V=%d][PROTO=%d]\n", size_header, g_otg->ip_v[src_instance][dst_instance][application],g_otg->trans_proto[src_instance][dst_instance][application]);
otg_info->header_size_app[src_instance][dst_instance][application]=size_header; otg_info->header_size_app[src_instance][dst_instance][application]=size_header;
} }
} }
...@@ -889,7 +889,7 @@ unsigned char * serialize_buffer( ...@@ -889,7 +889,7 @@ unsigned char * serialize_buffer(
otg_hdr_p->traffic_type=traffic_type; otg_hdr_p->traffic_type=traffic_type;
byte_tx_count += sizeof(otg_hdr_t); byte_tx_count += sizeof(otg_hdr_t);
LOG_I(OTG,"traffic type %d\n",otg_hdr_p->traffic_type); LOG_I(OTG,"traffic type %u\n",otg_hdr_p->traffic_type);
// copy the header first // copy the header first
memcpy(&tx_buffer[byte_tx_count], header, strlen(header)); memcpy(&tx_buffer[byte_tx_count], header, strlen(header));
byte_tx_count += strlen(header); byte_tx_count += strlen(header);
...@@ -1953,7 +1953,7 @@ int header_size_gen_background( ...@@ -1953,7 +1953,7 @@ int header_size_gen_background(
otg_info->header_size_background[src_instance][dst_instance]=size_header; otg_info->header_size_background[src_instance][dst_instance]=size_header;
} }
LOG_D(OTG," [SRC %d][DST %d] BACKGROUND TRAFFIC:: size header %d \n", src_instance, dst_instance, otg_info->header_size_background[src_instance][dst_instance]); LOG_D(OTG," [SRC %d][DST %d] BACKGROUND TRAFFIC:: size header %u \n", src_instance, dst_instance, otg_info->header_size_background[src_instance][dst_instance]);
return otg_info->header_size_background[src_instance][dst_instance]; return otg_info->header_size_background[src_instance][dst_instance];
} }
...@@ -1987,7 +1987,7 @@ void state_management( ...@@ -1987,7 +1987,7 @@ void state_management(
if (ctime>otg_info->start_holding_time_off[src_instance][dst_instance][application]) { if (ctime>otg_info->start_holding_time_off[src_instance][dst_instance][application]) {
otg_info->c_holding_time_off[src_instance][dst_instance][application]= ctime - otg_info->start_holding_time_off[src_instance][dst_instance][application]; otg_info->c_holding_time_off[src_instance][dst_instance][application]= ctime - otg_info->start_holding_time_off[src_instance][dst_instance][application];
LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%d] STATE:: OFF Holding Time %d (%d, %d)\n", src_instance, dst_instance,application , g_otg->aggregation_level[src_instance][dst_instance][application], LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%u] STATE:: OFF Holding Time %u (%d, %u)\n", src_instance, dst_instance,application , g_otg->aggregation_level[src_instance][dst_instance][application],
otg_info->c_holding_time_off[src_instance][dst_instance][application], ctime, otg_info->start_holding_time_off[src_instance][dst_instance][application]); otg_info->c_holding_time_off[src_instance][dst_instance][application], ctime, otg_info->start_holding_time_off[src_instance][dst_instance][application]);
} }
...@@ -1997,7 +1997,7 @@ void state_management( ...@@ -1997,7 +1997,7 @@ void state_management(
+g_otg->prob_off_pe[src_instance][dst_instance][application]))) +g_otg->prob_off_pe[src_instance][dst_instance][application])))
&& (otg_info->c_holding_time_off[src_instance][dst_instance][application]>=g_otg->holding_time_off_pu[src_instance][dst_instance][application])) { && (otg_info->c_holding_time_off[src_instance][dst_instance][application]>=g_otg->holding_time_off_pu[src_instance][dst_instance][application])) {
otg_info->state[src_instance][dst_instance][application]=PU_STATE; otg_info->state[src_instance][dst_instance][application]=PU_STATE;
LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: OFF-->PU %d (ctime %d, start %d )\n", src_instance, dst_instance,application, LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: OFF-->PU %u (ctime %d, start %u )\n", src_instance, dst_instance,application,
g_otg->aggregation_level[src_instance][dst_instance][application], otg_info->c_holding_time_off[src_instance][dst_instance][application], ctime, g_otg->aggregation_level[src_instance][dst_instance][application], otg_info->c_holding_time_off[src_instance][dst_instance][application], ctime,
otg_info->start_holding_time_off[src_instance][dst_instance][application]); otg_info->start_holding_time_off[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
...@@ -2007,7 +2007,7 @@ void state_management( ...@@ -2007,7 +2007,7 @@ void state_management(
&& (otg_info->state_transition_prob[src_instance][dst_instance][application]< 1-g_otg->prob_off_pe[src_instance][dst_instance][application])) && (otg_info->state_transition_prob[src_instance][dst_instance][application]< 1-g_otg->prob_off_pe[src_instance][dst_instance][application]))
&& (otg_info->c_holding_time_off[src_instance][dst_instance][application]>=g_otg->holding_time_off_ed[src_instance][dst_instance][application])) { && (otg_info->c_holding_time_off[src_instance][dst_instance][application]>=g_otg->holding_time_off_ed[src_instance][dst_instance][application])) {
otg_info->state[src_instance][dst_instance][application]=ED_STATE; otg_info->state[src_instance][dst_instance][application]=ED_STATE;
LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: OFF-->ED \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: OFF-->ED \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
} }
...@@ -2015,13 +2015,13 @@ void state_management( ...@@ -2015,13 +2015,13 @@ void state_management(
&& (otg_info->state_transition_prob[src_instance][dst_instance][application]<=1)) && (otg_info->state_transition_prob[src_instance][dst_instance][application]<=1))
&& (otg_info->c_holding_time_off[src_instance][dst_instance]>=g_otg->holding_time_off_pe[src_instance][dst_instance])) { && (otg_info->c_holding_time_off[src_instance][dst_instance]>=g_otg->holding_time_off_pe[src_instance][dst_instance])) {
otg_info->state[src_instance][dst_instance][application]=PE_STATE; otg_info->state[src_instance][dst_instance][application]=PE_STATE;
LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: OFF-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: OFF-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
} else { } else {
otg_info->c_holding_time_off[src_instance][dst_instance][application]= ctime - otg_info->start_holding_time_off[src_instance][dst_instance][application]; otg_info->c_holding_time_off[src_instance][dst_instance][application]= ctime - otg_info->start_holding_time_off[src_instance][dst_instance][application];
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%d] STATE:: OFF\n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%u] STATE:: OFF\n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
} }
break; break;
...@@ -2033,20 +2033,20 @@ void state_management( ...@@ -2033,20 +2033,20 @@ void state_management(
otg_info->state[src_instance][dst_instance][application]=OFF_STATE; otg_info->state[src_instance][dst_instance][application]=OFF_STATE;
otg_info->start_holding_time_off[src_instance][dst_instance][application]=ctime; otg_info->start_holding_time_off[src_instance][dst_instance][application]=ctime;
otg_info->c_holding_time_off[src_instance][dst_instance][application]=0; otg_info->c_holding_time_off[src_instance][dst_instance][application]=0;
LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: PU-->OFF \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: PU-->OFF \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
} else if ((otg_info->state_transition_prob[src_instance][dst_instance][application]<=1-g_otg->prob_pu_pe[src_instance][dst_instance][application]) } else if ((otg_info->state_transition_prob[src_instance][dst_instance][application]<=1-g_otg->prob_pu_pe[src_instance][dst_instance][application])
&& (otg_info->state_transition_prob[src_instance][dst_instance][application]>1-(g_otg->prob_pu_ed[src_instance][dst_instance][application] && (otg_info->state_transition_prob[src_instance][dst_instance][application]>1-(g_otg->prob_pu_ed[src_instance][dst_instance][application]
+g_otg->prob_pu_pe[src_instance][dst_instance][application]))) { +g_otg->prob_pu_pe[src_instance][dst_instance][application]))) {
//otg_info->state[src_instance][dst_instance]=ON_STATE; //otg_info->state[src_instance][dst_instance]=ON_STATE;
otg_info->state[src_instance][dst_instance][application]=ED_STATE; otg_info->state[src_instance][dst_instance][application]=ED_STATE;
LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: PU-->ED \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: PU-->ED \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
} else { /*if (otg_info->state_transition_prob[src_instance][dst_instance]>=g_otg->prob_pu_ed)*/ } else { /*if (otg_info->state_transition_prob[src_instance][dst_instance]>=g_otg->prob_pu_ed)*/
//otg_info->state[src_instance][dst_instance]=ON_STATE; //otg_info->state[src_instance][dst_instance]=ON_STATE;
otg_info->state[src_instance][dst_instance][application]=PE_STATE; otg_info->state[src_instance][dst_instance][application]=PE_STATE;
otg_info->start_holding_time_pe_off[src_instance][dst_instance][application]=ctime; otg_info->start_holding_time_pe_off[src_instance][dst_instance][application]=ctime;
LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: PU-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: PU-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
} }
...@@ -2059,20 +2059,20 @@ void state_management( ...@@ -2059,20 +2059,20 @@ void state_management(
otg_info->state[src_instance][dst_instance][application]=OFF_STATE; otg_info->state[src_instance][dst_instance][application]=OFF_STATE;
otg_info->start_holding_time_off[src_instance][dst_instance][application]=ctime; otg_info->start_holding_time_off[src_instance][dst_instance][application]=ctime;
otg_info->c_holding_time_off[src_instance][dst_instance][application]=0; otg_info->c_holding_time_off[src_instance][dst_instance][application]=0;
LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: ED-->OFF \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: ED-->OFF \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
} else if ((otg_info->state_transition_prob[src_instance][dst_instance][application]>=1-(g_otg->prob_ed_pu[src_instance][dst_instance][application] + } else if ((otg_info->state_transition_prob[src_instance][dst_instance][application]>=1-(g_otg->prob_ed_pu[src_instance][dst_instance][application] +
g_otg->prob_ed_pe[src_instance][dst_instance][application] )) g_otg->prob_ed_pe[src_instance][dst_instance][application] ))
&& (otg_info->state_transition_prob[src_instance][dst_instance][application]<1-g_otg->prob_ed_pe[src_instance][dst_instance][application])) { && (otg_info->state_transition_prob[src_instance][dst_instance][application]<1-g_otg->prob_ed_pe[src_instance][dst_instance][application])) {
//otg_info->state[src_instance][dst_instance]=ON_STATE; //otg_info->state[src_instance][dst_instance]=ON_STATE;
otg_info->state[src_instance][dst_instance][application]=PE_STATE; otg_info->state[src_instance][dst_instance][application]=PE_STATE;
LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: ED-->PU \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: ED-->PU \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
} else { /*if ((otg_info->state_transition_prob[src_instance][dst_instance]>=1-g_otg->prob_ed_pe)&&(otg_info->state_transition_prob[src_instance][dst_instance]<=1)) */ } else { /*if ((otg_info->state_transition_prob[src_instance][dst_instance]>=1-g_otg->prob_ed_pe)&&(otg_info->state_transition_prob[src_instance][dst_instance]<=1)) */
//otg_info->state[src_instance][dst_instance]=ON_STATE; //otg_info->state[src_instance][dst_instance]=ON_STATE;
otg_info->state[src_instance][dst_instance][application]=PE_STATE; otg_info->state[src_instance][dst_instance][application]=PE_STATE;
otg_info->start_holding_time_pe_off[src_instance][dst_instance][application]=ctime; otg_info->start_holding_time_pe_off[src_instance][dst_instance][application]=ctime;
LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: ED-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: ED-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
} }
...@@ -2082,7 +2082,7 @@ void state_management( ...@@ -2082,7 +2082,7 @@ void state_management(
if (g_otg->holding_time_pe_off[src_instance][dst_instance][application]<=otg_info->c_holding_time_pe_off[src_instance][dst_instance][application]) { if (g_otg->holding_time_pe_off[src_instance][dst_instance][application]<=otg_info->c_holding_time_pe_off[src_instance][dst_instance][application]) {
//otg_info->state[src_instance][dst_instance]=OFF_STATE; //otg_info->state[src_instance][dst_instance]=OFF_STATE;
otg_info->state[src_instance][dst_instance][application]=OFF_STATE; otg_info->state[src_instance][dst_instance][application]=OFF_STATE;
LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: PE->OFF\n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]); LOG_D(OTG,"[%d][%d][Appli id %d][Agg Level=%u] NEW STATE:: PE->OFF\n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->c_holding_time_pe_off[src_instance][dst_instance][application]=0; otg_info->c_holding_time_pe_off[src_instance][dst_instance][application]=0;
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1); otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
otg_info->start_holding_time_off[src_instance][dst_instance][application]=ctime; otg_info->start_holding_time_off[src_instance][dst_instance][application]=ctime;
...@@ -2097,7 +2097,7 @@ void state_management( ...@@ -2097,7 +2097,7 @@ void state_management(
break; break;
default: default:
LOG_W(OTG,"Unknown state(%d) \n", otg_info->state[src_instance][dst_instance][application]); LOG_W(OTG,"Unknown state(%u) \n", otg_info->state[src_instance][dst_instance][application]);
otg_info->state[src_instance][dst_instance][application]= OFF_STATE; // switch to default state otg_info->state[src_instance][dst_instance][application]= OFF_STATE; // switch to default state
break; break;
...@@ -2145,13 +2145,13 @@ void voip_traffic( ...@@ -2145,13 +2145,13 @@ void voip_traffic(
if (ctime>otg_info->start_voip_silence[src_instance][dst_instance][application]) if (ctime>otg_info->start_voip_silence[src_instance][dst_instance][application])
otg_info->c_holding_time_silence[src_instance][dst_instance][application]= ctime - otg_info->start_voip_silence[src_instance][dst_instance][application]; otg_info->c_holding_time_silence[src_instance][dst_instance][application]= ctime - otg_info->start_voip_silence[src_instance][dst_instance][application];
LOG_D(OTG,"[%d][%d][Appli id %d] VOIP STATE:: SILENCE %d (ctime=%d, start=%d)\n", src_instance, dst_instance,application, LOG_D(OTG,"[%d][%d][Appli id %d] VOIP STATE:: SILENCE %u (ctime=%d, start=%u)\n", src_instance, dst_instance,application,
otg_info->c_holding_time_silence[src_instance][dst_instance][application], ctime, otg_info->start_voip_silence[src_instance][dst_instance][application]); otg_info->c_holding_time_silence[src_instance][dst_instance][application], ctime, otg_info->start_voip_silence[src_instance][dst_instance][application]);
} }
if (otg_info->c_holding_time_silence[src_instance][dst_instance][application]>=otg_info->silence_time[src_instance][dst_instance][application]) { if (otg_info->c_holding_time_silence[src_instance][dst_instance][application]>=otg_info->silence_time[src_instance][dst_instance][application]) {
otg_info->voip_state[src_instance][dst_instance][application]=SIMPLE_TALK; otg_info->voip_state[src_instance][dst_instance][application]=SIMPLE_TALK;
LOG_I(OTG,"[%d][%d][Appli id %d] NEW VOIP STATE :: SILENCE-->TALK %d (ctime=%d, start=%d )\n", src_instance, dst_instance,application , LOG_I(OTG,"[%d][%d][Appli id %d] NEW VOIP STATE :: SILENCE-->TALK %u (ctime=%d, start=%u )\n", src_instance, dst_instance,application ,
otg_info->c_holding_time_silence[src_instance][dst_instance][application], ctime, otg_info->start_voip_silence[src_instance][dst_instance][application]); otg_info->c_holding_time_silence[src_instance][dst_instance][application], ctime, otg_info->start_voip_silence[src_instance][dst_instance][application]);
otg_info->start_voip_talk[src_instance][dst_instance][application]=ctime; otg_info->start_voip_talk[src_instance][dst_instance][application]=ctime;
otg_info->c_holding_time_talk[src_instance][dst_instance][application]=0; otg_info->c_holding_time_talk[src_instance][dst_instance][application]=0;
...@@ -2160,7 +2160,7 @@ void voip_traffic( ...@@ -2160,7 +2160,7 @@ void voip_traffic(
if (ctime>otg_info->start_voip_silence[src_instance][dst_instance][application]) if (ctime>otg_info->start_voip_silence[src_instance][dst_instance][application])
otg_info->c_holding_time_silence[src_instance][dst_instance][application]= ctime - otg_info->start_voip_silence[src_instance][dst_instance][application]; otg_info->c_holding_time_silence[src_instance][dst_instance][application]= ctime - otg_info->start_voip_silence[src_instance][dst_instance][application];
LOG_I(OTG,"[%d][%d][Appli id %d] STATE:: SILENCE [timer:%d] \n", src_instance, dst_instance,application, otg_info->c_holding_time_silence[src_instance][dst_instance][application]); LOG_I(OTG,"[%d][%d][Appli id %d] STATE:: SILENCE [timer:%u] \n", src_instance, dst_instance,application, otg_info->c_holding_time_silence[src_instance][dst_instance][application]);
} }
break; break;
...@@ -2168,7 +2168,7 @@ void voip_traffic( ...@@ -2168,7 +2168,7 @@ void voip_traffic(
case SIMPLE_TALK: case SIMPLE_TALK:
if (otg_info->c_holding_time_talk[src_instance][dst_instance][application]>=otg_info->simple_talk_time[src_instance][dst_instance][application]) { if (otg_info->c_holding_time_talk[src_instance][dst_instance][application]>=otg_info->simple_talk_time[src_instance][dst_instance][application]) {
otg_info->voip_state[src_instance][dst_instance][application]=SILENCE; otg_info->voip_state[src_instance][dst_instance][application]=SILENCE;
LOG_I(OTG,"[%d][%d][Appli id %d] NEW VOIP STATE:: TALK-->SILENCE %d (ctime=%d, start=%d )\n", src_instance, dst_instance,application , LOG_I(OTG,"[%d][%d][Appli id %d] NEW VOIP STATE:: TALK-->SILENCE %u (ctime=%d, start=%u )\n", src_instance, dst_instance,application ,
otg_info->c_holding_time_talk[src_instance][dst_instance][application], ctime, otg_info->start_voip_talk[src_instance][dst_instance][application]); otg_info->c_holding_time_talk[src_instance][dst_instance][application], ctime, otg_info->start_voip_talk[src_instance][dst_instance][application]);
otg_info->start_voip_silence[src_instance][dst_instance][application]=ctime; otg_info->start_voip_silence[src_instance][dst_instance][application]=ctime;
otg_info->c_holding_time_silence[src_instance][dst_instance][application]=0; otg_info->c_holding_time_silence[src_instance][dst_instance][application]=0;
...@@ -2177,15 +2177,15 @@ void voip_traffic( ...@@ -2177,15 +2177,15 @@ void voip_traffic(
if (ctime>otg_info->start_voip_talk[src_instance][dst_instance][application]) if (ctime>otg_info->start_voip_talk[src_instance][dst_instance][application])
otg_info->c_holding_time_talk[src_instance][dst_instance][application]= ctime - otg_info->start_voip_talk[src_instance][dst_instance][application]; otg_info->c_holding_time_talk[src_instance][dst_instance][application]= ctime - otg_info->start_voip_talk[src_instance][dst_instance][application];
LOG_I(OTG,"[%d][%d][Appli id %d] VOIP STATE:: TALK [timer:%d]\n", src_instance, dst_instance,application, otg_info->c_holding_time_talk[src_instance][dst_instance][application]); LOG_I(OTG,"[%d][%d][Appli id %d] VOIP STATE:: TALK [timer:%u]\n", src_instance, dst_instance,application, otg_info->c_holding_time_talk[src_instance][dst_instance][application]);
LOG_I(OTG, "test_talk [ctime %d] [start talk %d] [%d] \n",ctime, otg_info->start_voip_talk[src_instance][dst_instance][application], LOG_I(OTG, "test_talk [ctime %d] [start talk %u] [%u] \n",ctime, otg_info->start_voip_talk[src_instance][dst_instance][application],
otg_info->c_holding_time_talk[src_instance][dst_instance][application] ); otg_info->c_holding_time_talk[src_instance][dst_instance][application] );
} }
break; break;
default: default:
LOG_W(OTG,"Unknown VOIP state(%d) \n", otg_info->voip_state[src_instance][dst_instance][application]); LOG_W(OTG,"Unknown VOIP state(%u) \n", otg_info->voip_state[src_instance][dst_instance][application]);
otg_info->voip_state[src_instance][dst_instance][application]= SILENCE; // switch to default state otg_info->voip_state[src_instance][dst_instance][application]= SILENCE; // switch to default state
break; break;
......
...@@ -214,6 +214,10 @@ void client_socket_udp_ip4(int src, int dst, int state,int ctime) { ...@@ -214,6 +214,10 @@ void client_socket_udp_ip4(int src, int dst, int state,int ctime) {
// Data serialization // Data serialization
char *tx_buffer; char *tx_buffer;
tx_buffer= (char *)malloc(PAYLOAD_MAX); tx_buffer= (char *)malloc(PAYLOAD_MAX);
if (tx_buffer == NULL || payload == NULL) {
LOG_E(OTG,"Memory allocation failed\n");
return;
}
payload->control_hdr=otg_info_hdr_gen(src, dst, UDP, IPV4); payload->control_hdr=otg_info_hdr_gen(src, dst, UDP, IPV4);
payload->payload_rest=payload_rest; payload->payload_rest=payload_rest;
memcpy(tx_buffer, payload->control_hdr, sizeof (control_hdr_t)); memcpy(tx_buffer, payload->control_hdr, sizeof (control_hdr_t));
...@@ -226,15 +230,8 @@ void client_socket_udp_ip4(int src, int dst, int state,int ctime) { ...@@ -226,15 +230,8 @@ void client_socket_udp_ip4(int src, int dst, int state,int ctime) {
//otg_info->rx_num_bytes[src][dst]+= udp_send + (HDR_IP_v4 + HDR_UDP); //otg_info->rx_num_bytes[src][dst]+= udp_send + (HDR_IP_v4 + HDR_UDP);
// //
if (NULL != payload) {
payload=NULL;
free(payload); free(payload);
}
if (NULL != tx_buffer) {
free(tx_buffer); free(tx_buffer);
tx_buffer=NULL;
}
} }
if(udp_send == -1) { if(udp_send == -1) {
......
...@@ -219,7 +219,10 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance, ...@@ -219,7 +219,10 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance,
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupRequest_IEs_t, ie, x2SetupRequest, X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupRequest_IEs_t, ie, x2SetupRequest,
X2AP_ProtocolIE_ID_id_GlobalENB_ID, true); X2AP_ProtocolIE_ID_id_GlobalENB_ID, true);
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
return -1;
} else {
if (ie->value.choice.GlobalENB_ID.eNB_ID.present == X2AP_ENB_ID_PR_home_eNB_ID) { if (ie->value.choice.GlobalENB_ID.eNB_ID.present == X2AP_ENB_ID_PR_home_eNB_ID) {
// Home eNB ID = 28 bits // Home eNB ID = 28 bits
uint8_t *eNB_id_buf = ie->value.choice.GlobalENB_ID.eNB_ID.choice.home_eNB_ID.buf; uint8_t *eNB_id_buf = ie->value.choice.GlobalENB_ID.eNB_ID.choice.home_eNB_ID.buf;
...@@ -241,6 +244,7 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance, ...@@ -241,6 +244,7 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance,
eNB_id = (eNB_id_buf[0] << 12) + (eNB_id_buf[1] << 4) + ((eNB_id_buf[2] & 0xf0) >> 4); eNB_id = (eNB_id_buf[0] << 12) + (eNB_id_buf[1] << 4) + ((eNB_id_buf[2] & 0xf0) >> 4);
X2AP_DEBUG("macro eNB id: %05x\n", eNB_id); X2AP_DEBUG("macro eNB id: %05x\n", eNB_id);
} }
}
X2AP_DEBUG("Adding eNB to the list of associated eNBs\n"); X2AP_DEBUG("Adding eNB to the list of associated eNBs\n");
...@@ -322,6 +326,10 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance, ...@@ -322,6 +326,10 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance,
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupResponse_IEs_t, ie, x2SetupResponse, X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupResponse_IEs_t, ie, x2SetupResponse,
X2AP_ProtocolIE_ID_id_GlobalENB_ID, true); X2AP_ProtocolIE_ID_id_GlobalENB_ID, true);
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
return -1;
}
if (ie->value.choice.GlobalENB_ID.eNB_ID.present == X2AP_ENB_ID_PR_home_eNB_ID) { if (ie->value.choice.GlobalENB_ID.eNB_ID.present == X2AP_ENB_ID_PR_home_eNB_ID) {
// Home eNB ID = 28 bits // Home eNB ID = 28 bits
uint8_t *eNB_id_buf = ie->value.choice.GlobalENB_ID.eNB_ID.choice.home_eNB_ID.buf; uint8_t *eNB_id_buf = ie->value.choice.GlobalENB_ID.eNB_ID.choice.home_eNB_ID.buf;
...@@ -416,7 +424,10 @@ int x2ap_eNB_handle_x2_setup_failure(instance_t instance, ...@@ -416,7 +424,10 @@ int x2ap_eNB_handle_x2_setup_failure(instance_t instance,
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupFailure_IEs_t, ie, x2SetupFailure, X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupFailure_IEs_t, ie, x2SetupFailure,
X2AP_ProtocolIE_ID_id_Cause, true); X2AP_ProtocolIE_ID_id_Cause, true);
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
return -1;
}
// need a FSM to handle all cases // need a FSM to handle all cases
if ((ie->value.choice.Cause.present == X2AP_Cause_PR_misc) && if ((ie->value.choice.Cause.present == X2AP_Cause_PR_misc) &&
(ie->value.choice.Cause.choice.misc == X2AP_CauseMisc_unspecified)) { (ie->value.choice.Cause.choice.misc == X2AP_CauseMisc_unspecified)) {
......
...@@ -95,7 +95,7 @@ void gtpu_print_hex_octets(unsigned char* dataP, unsigned long sizeP) ...@@ -95,7 +95,7 @@ void gtpu_print_hex_octets(unsigned char* dataP, unsigned long sizeP)
h = tv.tv_sec/3600/24; h = tv.tv_sec/3600/24;
m = (tv.tv_sec / 60) % 60; m = (tv.tv_sec / 60) % 60;
s = tv.tv_sec % 60; s = tv.tv_sec % 60;
snprintf(timeofday, 64, "%02d:%02d:%02d.%06d", h,m,s,tv.tv_usec); snprintf(timeofday, 64, "%02u:%02u:%02u.%06d", h,m,s,tv.tv_usec);
GTPU_DEBUG("%s------+-------------------------------------------------|\n",timeofday); GTPU_DEBUG("%s------+-------------------------------------------------|\n",timeofday);
GTPU_DEBUG("%s | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n",timeofday); GTPU_DEBUG("%s | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n",timeofday);
...@@ -116,7 +116,7 @@ void gtpu_print_hex_octets(unsigned char* dataP, unsigned long sizeP) ...@@ -116,7 +116,7 @@ void gtpu_print_hex_octets(unsigned char* dataP, unsigned long sizeP)
buffer_marker = 0; buffer_marker = 0;
} }
buffer_marker+=snprintf(&gtpu_2_print_buffer[buffer_marker], GTPU_2_PRINT_BUFFER_LEN - buffer_marker, " %04ld |", octet_index); buffer_marker+=snprintf(&gtpu_2_print_buffer[buffer_marker], GTPU_2_PRINT_BUFFER_LEN - buffer_marker, " %04lu |", octet_index);
} }
/* /*
......
...@@ -689,9 +689,9 @@ nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, uint32_t st ...@@ -689,9 +689,9 @@ nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, uint32_t st
NwGtpv1uStackT *thiz; NwGtpv1uStackT *thiz;
thiz = (NwGtpv1uStackT *) malloc( sizeof(NwGtpv1uStackT)); thiz = (NwGtpv1uStackT *) malloc( sizeof(NwGtpv1uStackT));
memset(thiz, 0, sizeof(NwGtpv1uStackT));
if(thiz) { if(thiz) {
memset(thiz, 0, sizeof(NwGtpv1uStackT));
thiz->id = (NwPtrT)thiz; thiz->id = (NwPtrT)thiz;
thiz->stackType = stackType; thiz->stackType = stackType;
thiz->seq = (uint16_t) ((uintptr_t)thiz) ; // FIXME interesting casts... don't know what this is good for... thiz->seq = (uint16_t) ((uintptr_t)thiz) ; // FIXME interesting casts... don't know what this is good for...
......
...@@ -444,7 +444,7 @@ static void *watchdog_thread(void *arg) { ...@@ -444,7 +444,7 @@ static void *watchdog_thread(void *arg) {
(diff > 16)&& (diff > 16)&&
(first_acquisition==0)) {// we're too late so exit (first_acquisition==0)) {// we're too late so exit
exm->watchdog_exit = 1; exm->watchdog_exit = 1;
printf("exiting, too late to keep up - diff = %d\n", diff); printf("exiting, too late to keep up - diff = %u\n", diff);
} }
first_acquisition=0; first_acquisition=0;
...@@ -625,7 +625,7 @@ int trx_exmimo_read(openair0_device *device, openair0_timestamp *ptimestamp, voi ...@@ -625,7 +625,7 @@ int trx_exmimo_read(openair0_device *device, openair0_timestamp *ptimestamp, voi
if (cfg->mmapped_dma == 0) { // if buff is not the dma buffer, do a memcpy, otherwise do nothing if (cfg->mmapped_dma == 0) { // if buff is not the dma buffer, do a memcpy, otherwise do nothing
for (i=0;i<cc;i++) { for (i=0;i<cc;i++) {
#ifdef DEBUG_EXMIMO #ifdef DEBUG_EXMIMO
printf("copying to %p (%lu), from %llu\n",buff[i]+(ntot*sizeof(int)),ntot*sizeof(int),(exm->last_ts_rx % exm->samples_per_frame)); printf("copying to %p (%zu), from %llu\n",buff[i]+(ntot*sizeof(int)),ntot*sizeof(int),(exm->last_ts_rx % exm->samples_per_frame));
#endif #endif
if ((n+(exm->last_ts_rx%exm->samples_per_frame))<exm->samples_per_frame) { if ((n+(exm->last_ts_rx%exm->samples_per_frame))<exm->samples_per_frame) {
memcpy(buff[i]+(ntot*sizeof(int)), memcpy(buff[i]+(ntot*sizeof(int)),
...@@ -733,7 +733,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -733,7 +733,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
if (ret == -3) if (ret == -3)
printf("Error mapping RX or TX buffer"); printf("Error mapping RX or TX buffer");
free(exm);
return(ret); return(ret);
} }
...@@ -752,6 +752,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -752,6 +752,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
// check if the software matches firmware // check if the software matches firmware
if (p_exmimo_id->board_swrev!=BOARD_SWREV_CNTL2) { if (p_exmimo_id->board_swrev!=BOARD_SWREV_CNTL2) {
printf("Software revision %d and firmware revision %d do not match. Please update either the firmware or the software!\n",BOARD_SWREV_CNTL2,p_exmimo_id->board_swrev); printf("Software revision %d and firmware revision %d do not match. Please update either the firmware or the software!\n",BOARD_SWREV_CNTL2,p_exmimo_id->board_swrev);
free(exm);
return(-1); return(-1);
} }
} }
...@@ -905,7 +906,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -905,7 +906,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
p_exmimo_config->rf.rx_gain[ant][0] = 30 - (rxg_max[ant] - (int)openair0_cfg[card].rx_gain[ant]); //was measured at rxgain=30; p_exmimo_config->rf.rx_gain[ant][0] = 30 - (rxg_max[ant] - (int)openair0_cfg[card].rx_gain[ant]); //was measured at rxgain=30;
} }
else { else {
printf("openair0: RX RF gain too high, reduce by %d dB\n", (int)openair0_cfg[card].rx_gain[ant]-rxg_max[ant]); printf("openair0: RX RF gain too high, reduce by %u dB\n", (int)openair0_cfg[card].rx_gain[ant]-rxg_max[ant]);
exit(-1); exit(-1);
} }
break; break;
...@@ -916,7 +917,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -916,7 +917,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
p_exmimo_config->rf.rx_gain[ant][0] = 30 - (rxg_med[ant] - (int)openair0_cfg[card].rx_gain[ant]); //was measured at rxgain=30; p_exmimo_config->rf.rx_gain[ant][0] = 30 - (rxg_med[ant] - (int)openair0_cfg[card].rx_gain[ant]); //was measured at rxgain=30;
} }
else { else {
printf("openair0: RX RF gain too high, reduce by %d dB\n", (int)openair0_cfg[card].rx_gain[ant]-rxg_med[ant]); printf("openair0: RX RF gain too high, reduce by %u dB\n", (int)openair0_cfg[card].rx_gain[ant]-rxg_med[ant]);
exit(-1); exit(-1);
} }
break; break;
...@@ -927,7 +928,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -927,7 +928,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
p_exmimo_config->rf.rx_gain[ant][0] = 30 - (rxg_byp[ant] - (int)openair0_cfg[card].rx_gain[ant]); //was measured at rxgain=30; p_exmimo_config->rf.rx_gain[ant][0] = 30 - (rxg_byp[ant] - (int)openair0_cfg[card].rx_gain[ant]); //was measured at rxgain=30;
} }
else { else {
printf("openair0: RX RF gain too high, reduce by %d dB\n", (int)openair0_cfg[card].rx_gain[ant]-rxg_byp[ant]); printf("openair0: RX RF gain too high, reduce by %u dB\n", (int)openair0_cfg[card].rx_gain[ant]-rxg_byp[ant]);
exit(-1); exit(-1);
} }
break; break;
......
...@@ -211,22 +211,25 @@ void find_and_transfer_section(char* section_name, unsigned int verboselevel) { ...@@ -211,22 +211,25 @@ void find_and_transfer_section(char* section_name, unsigned int verboselevel) {
int nbread; int nbread;
unsigned int secnb = 0; unsigned int secnb = 0;
if(p_elfimage == NULL) {
fprintf(stderr, "%s %d:Error, firmware file not opened\n",__FILE__,__LINE__);
}
for (secnb = 0 ; secnb < elf_Ehdr.e_shnum; secnb++) { for (secnb = 0 ; secnb < elf_Ehdr.e_shnum; secnb++) {
get_elf_section_header(&elf_Shdr, p_elfimage, secnb); get_elf_section_header(&elf_Shdr, p_elfimage, secnb);
if (!strcmp(SecNameStnTable + elf_Shdr.sh_name, section_name)) { if (!strcmp(SecNameStnTable + elf_Shdr.sh_name, section_name)) {
if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS) if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS)
printf("Info: ok, found section %s (as section nb. %d)\n", SecNameStnTable + elf_Shdr.sh_name, secnb); printf("Info: ok, found section %s (as section nb. %u)\n", SecNameStnTable + elf_Shdr.sh_name, secnb);
/* Check that section size is a multiple of 4 bytes. */ /* Check that section size is a multiple of 4 bytes. */
if (elf_Shdr.sh_size % 4) { if (elf_Shdr.sh_size % 4) {
fprintf(stderr, "Error: section %s has a non-multiple-of-4-bytes size (%d).\n", fprintf(stderr, "Error: section %s has a non-multiple-of-4-bytes size (%lu).\n",
SecNameStnTable + elf_Shdr.sh_name, elf_Shdr.sh_size); SecNameStnTable + elf_Shdr.sh_name, (unsigned long)elf_Shdr.sh_size);
fclose(p_elfimage); fclose(p_elfimage);
exit(-1); exit(-1);
} else if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS) { } else if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS) {
printf("Info: ok, section %s has size %d bytes (multiple of 4 bytes).\n", printf("Info: ok, section %s has size %lu bytes (multiple of 4 bytes).\n",
SecNameStnTable + elf_Shdr.sh_name, elf_Shdr.sh_size); SecNameStnTable + elf_Shdr.sh_name, (unsigned long)elf_Shdr.sh_size);
} }
/* Dynamically allocate a chunk of memory to store the section into. */ /* Dynamically allocate a chunk of memory to store the section into. */
...@@ -245,13 +248,13 @@ void find_and_transfer_section(char* section_name, unsigned int verboselevel) { ...@@ -245,13 +248,13 @@ void find_and_transfer_section(char* section_name, unsigned int verboselevel) {
} }
if (!section_content) { if (!section_content) {
fprintf(stderr, "Error: could not dynamically allocate %d bytes for section %s.\n", fprintf(stderr, "Error: could not dynamically allocate %lu bytes for section %s.\n",
elf_Shdr.sh_size, SecNameStnTable + elf_Shdr.sh_name); (unsigned long)elf_Shdr.sh_size, (SecNameStnTable + elf_Shdr.sh_name));
fclose(p_elfimage); fclose(p_elfimage);
exit(-1); exit(-1);
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) { } else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
printf("Info: ok, dynamically allocated a %d bytes buffer for section %s.\n", printf("Info: ok, dynamically allocated a %lu bytes buffer for section %s.\n",
elf_Shdr.sh_size, SecNameStnTable + elf_Shdr.sh_name); (unsigned long)elf_Shdr.sh_size, SecNameStnTable + elf_Shdr.sh_name);
} }
/* Position the file cursor at the begining of proper section. */ /* Position the file cursor at the begining of proper section. */
...@@ -260,13 +263,13 @@ void find_and_transfer_section(char* section_name, unsigned int verboselevel) { ...@@ -260,13 +263,13 @@ void find_and_transfer_section(char* section_name, unsigned int verboselevel) {
nbread = fread(section_content, elf_Shdr.sh_size, 1, p_elfimage); nbread = fread(section_content, elf_Shdr.sh_size, 1, p_elfimage);
if (nbread != 1) { if (nbread != 1) {
fprintf(stderr, "Error: could not read %d bytes from ELF file into dynamic buffer.\n", elf_Shdr.sh_size); fprintf(stderr, "Error: could not read %lu bytes from ELF file into dynamic buffer.\n", (unsigned long)elf_Shdr.sh_size);
free(section_content); free(section_content);
fclose(p_elfimage); fclose(p_elfimage);
exit(-1); exit(-1);
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) { } else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
printf("Info: ok, copied content of section %s into dynamic buffer (%d bytes copied).\n", printf("Info: ok, copied content of section %s into dynamic buffer (%lu bytes copied).\n",
SecNameStnTable + elf_Shdr.sh_name, elf_Shdr.sh_size); SecNameStnTable + elf_Shdr.sh_name, (unsigned long)elf_Shdr.sh_size);
} }
/* Open the special device file. */ /* Open the special device file. */
...@@ -324,12 +327,15 @@ void find_and_clear_section_bss(unsigned int verboselevel) { ...@@ -324,12 +327,15 @@ void find_and_clear_section_bss(unsigned int verboselevel) {
int ifile; int ifile;
unsigned int secnb = 0; unsigned int secnb = 0;
if(p_elfimage == NULL) {
fprintf(stderr, "%s %d:Error, firmware file not opened\n",__FILE__,__LINE__);
}
for (secnb = 0 ; secnb < elf_Ehdr.e_shnum; secnb++) { for (secnb = 0 ; secnb < elf_Ehdr.e_shnum; secnb++) {
get_elf_section_header(&elf_Shdr, p_elfimage, secnb); get_elf_section_header(&elf_Shdr, p_elfimage, secnb);
if (!strcmp(SecNameStnTable + elf_Shdr.sh_name, ".bss")) { if (!strcmp(SecNameStnTable + elf_Shdr.sh_name, ".bss")) {
if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS) if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS)
printf("Info: ok, found section %s (as section nb. %d)\n", SecNameStnTable + elf_Shdr.sh_name, secnb); printf("Info: ok, found section %s (as section nb. %u)\n", SecNameStnTable + elf_Shdr.sh_name, secnb);
/* Open the special device file. */ /* Open the special device file. */
if (!pflag) { if (!pflag) {
...@@ -491,6 +497,10 @@ int main(int argc, char** argv) { ...@@ -491,6 +497,10 @@ int main(int argc, char** argv) {
/* Open firmware file in READ_ONLY mode. */ /* Open firmware file in READ_ONLY mode. */
filename = p_str_fwn; filename = p_str_fwn;
if (filename == NULL) {
fprintf(stderr, "%s %d: No filename specified\n", __FILE__, __LINE__);
exit(-1);
}
p_elfimage = fopen(filename, READ_FILE_MODE); p_elfimage = fopen(filename, READ_FILE_MODE);
if (p_elfimage == NULL) { if (p_elfimage == NULL) {
...@@ -505,6 +515,7 @@ int main(int argc, char** argv) { ...@@ -505,6 +515,7 @@ int main(int argc, char** argv) {
/* Get informations from header file */ /* Get informations from header file */
if (!(get_elf_header(&elf_Ehdr, p_elfimage))) { if (!(get_elf_header(&elf_Ehdr, p_elfimage))) {
fprintf(stderr, "Error : file doesn't match expected format.\n"); fprintf(stderr, "Error : file doesn't match expected format.\n");
fclose(p_elfimage);
exit(-1); exit(-1);
} }
...@@ -522,9 +533,10 @@ int main(int argc, char** argv) { ...@@ -522,9 +533,10 @@ int main(int argc, char** argv) {
/* copy the string table into global variable */ /* copy the string table into global variable */
if (StringSec_size > MAX_SIZE_STRING_TABLE) { if (StringSec_size > MAX_SIZE_STRING_TABLE) {
fprintf(stderr, "Error: section name string table too big (%d > %d);" fprintf(stderr, "Error: section name string table too big (%ld > %d);"
" increase max. allowed value in source code and recompile\n", " increase max. allowed value in source code and recompile\n",
StringSec_size, MAX_SIZE_STRING_TABLE); StringSec_size, MAX_SIZE_STRING_TABLE);
fclose(p_elfimage);
exit(-1); exit(-1);
} }
...@@ -626,7 +638,7 @@ int main(int argc, char** argv) { ...@@ -626,7 +638,7 @@ int main(int argc, char** argv) {
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: entering action #5 (Jump to firmware/set stack-pointer).\n"); if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: entering action #5 (Jump to firmware/set stack-pointer).\n");
if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS) if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS)
printf("Info: Firmware entry point = 0x%08x, setting stack pointer = 0x%08x.\n", elf_Ehdr.e_entry, stackpointer); printf("Info: Firmware entry point = 0x%08x, setting stack pointer = 0x%08x.\n", (unsigned int)elf_Ehdr.e_entry, stackpointer);
/* Open the special device file. */ /* Open the special device file. */
if (!pflag) { if (!pflag) {
......
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
#define SAMPLE_RATE_DOWN 1 #define SAMPLE_RATE_DOWN 1
/*! \brief Iris Configuration */ /*! \brief Iris Configuration */
typedef struct { extern "C" {
typedef struct {
// -------------------------------- // --------------------------------
// variables for Iris configuration // variables for Iris configuration
...@@ -78,8 +79,8 @@ typedef struct { ...@@ -78,8 +79,8 @@ typedef struct {
//! timestamp of RX packet //! timestamp of RX packet
openair0_timestamp rx_timestamp; openair0_timestamp rx_timestamp;
} iris_state_t; } iris_state_t;
}
/*! \brief Called to start the Iris lime transceiver. Return 0 if OK, < 0 if error /*! \brief Called to start the Iris lime transceiver. Return 0 if OK, < 0 if error
@param device pointer to the device structure specific to the RF hardware target @param device pointer to the device structure specific to the RF hardware target
*/ */
...@@ -151,13 +152,15 @@ trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buf ...@@ -151,13 +152,15 @@ trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buf
iris_state_t *s = (iris_state_t *) device->priv; iris_state_t *s = (iris_state_t *) device->priv;
int nsamps2; // aligned to upper 32 or 16 byte boundary int nsamps2; // aligned to upper 32 or 16 byte boundary
#if defined(__x86_64) || defined(__i386__) #if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
nsamps2 = (nsamps+7)>>3; nsamps2 = (nsamps+7)>>3;
__m256i buff_tx[2][nsamps2]; __m256i buff_tx[2][nsamps2];
#else #else
nsamps2 = (nsamps+3)>>2; nsamps2 = (nsamps+3)>>2;
__m128i buff_tx[2][nsamps2]; __m128i buff_tx[2][nsamps2];
#endif #endif
#else
#error unsupported CPU architecture, iris device cannot be built
#endif #endif
// bring RX data into 12 LSBs for softmodem RX // bring RX data into 12 LSBs for softmodem RX
...@@ -705,7 +708,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -705,7 +708,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
for (i = 0; i < s->tx_num_channels; i++) { for (i = 0; i < s->tx_num_channels; i++) {
if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) {
s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, tx_filt_bw); s->iris[r]->setBandwidth(SOAPY_SDR_TX, i, tx_filt_bw);
printf("Setting tx bandwidth on channel %lu/%lu: BW %f (readback %f)\n", i, printf("Setting tx bandwidth on channel %zu/%lu: BW %f (readback %f)\n", i,
s->iris[r]->getNumChannels(SOAPY_SDR_TX), tx_filt_bw / 1e6, s->iris[r]->getNumChannels(SOAPY_SDR_TX), tx_filt_bw / 1e6,
s->iris[r]->getBandwidth(SOAPY_SDR_TX, i) / 1e6); s->iris[r]->getBandwidth(SOAPY_SDR_TX, i) / 1e6);
} }
...@@ -713,7 +716,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -713,7 +716,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
for (i = 0; i < s->rx_num_channels; i++) { for (i = 0; i < s->rx_num_channels; i++) {
if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) {
s->iris[r]->setBandwidth(SOAPY_SDR_RX, i, rx_filt_bw); s->iris[r]->setBandwidth(SOAPY_SDR_RX, i, rx_filt_bw);
printf("Setting rx bandwidth on channel %lu/%lu : BW %f (readback %f)\n", i, printf("Setting rx bandwidth on channel %zu/%lu : BW %f (readback %f)\n", i,
s->iris[r]->getNumChannels(SOAPY_SDR_RX), rx_filt_bw / 1e6, s->iris[r]->getNumChannels(SOAPY_SDR_RX), rx_filt_bw / 1e6,
s->iris[r]->getBandwidth(SOAPY_SDR_RX, i) / 1e6); s->iris[r]->getBandwidth(SOAPY_SDR_RX, i) / 1e6);
} }
...@@ -776,7 +779,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -776,7 +779,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
std::cout << "Front end detected: " << s->iris[r]->getHardwareInfo()["frontend"] << "\n"; std::cout << "Front end detected: " << s->iris[r]->getHardwareInfo()["frontend"] << "\n";
for (i = 0; i < s->rx_num_channels; i++) { for (i = 0; i < s->rx_num_channels; i++) {
if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) { if (i < s->iris[r]->getNumChannels(SOAPY_SDR_RX)) {
printf("RX Channel %lu\n", i); printf("RX Channel %zu\n", i);
printf("Actual RX sample rate: %fMSps...\n", (s->iris[r]->getSampleRate(SOAPY_SDR_RX, i) / 1e6)); printf("Actual RX sample rate: %fMSps...\n", (s->iris[r]->getSampleRate(SOAPY_SDR_RX, i) / 1e6));
printf("Actual RX frequency: %fGHz...\n", (s->iris[r]->getFrequency(SOAPY_SDR_RX, i) / 1e9)); printf("Actual RX frequency: %fGHz...\n", (s->iris[r]->getFrequency(SOAPY_SDR_RX, i) / 1e9));
printf("Actual RX gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_RX, i))); printf("Actual RX gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_RX, i)));
...@@ -794,7 +797,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -794,7 +797,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
for (i = 0; i < s->tx_num_channels; i++) { for (i = 0; i < s->tx_num_channels; i++) {
if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) { if (i < s->iris[r]->getNumChannels(SOAPY_SDR_TX)) {
printf("TX Channel %lu\n", i); printf("TX Channel %zu\n", i);
printf("Actual TX sample rate: %fMSps...\n", (s->iris[r]->getSampleRate(SOAPY_SDR_TX, i) / 1e6)); printf("Actual TX sample rate: %fMSps...\n", (s->iris[r]->getSampleRate(SOAPY_SDR_TX, i) / 1e6));
printf("Actual TX frequency: %fGHz...\n", (s->iris[r]->getFrequency(SOAPY_SDR_TX, i) / 1e9)); printf("Actual TX frequency: %fGHz...\n", (s->iris[r]->getFrequency(SOAPY_SDR_TX, i) / 1e9));
printf("Actual TX gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_TX, i))); printf("Actual TX gain: %f...\n", (s->iris[r]->getGain(SOAPY_SDR_TX, i)));
......
...@@ -438,16 +438,18 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -438,16 +438,18 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
int nsamps2; // aligned to upper 32 or 16 byte boundary int nsamps2; // aligned to upper 32 or 16 byte boundary
#if defined(__x86_64) || defined(__i386__) #if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
nsamps2 = (nsamps+7)>>3; nsamps2 = (nsamps+7)>>3;
__m256i buff_tx[2][nsamps2]; __m256i buff_tx[2][nsamps2];
#else #else
nsamps2 = (nsamps+3)>>2; nsamps2 = (nsamps+3)>>2;
__m128i buff_tx[2][nsamps2]; __m128i buff_tx[2][nsamps2];
#endif #endif
#elif defined(__arm__) #elif defined(__arm__)
nsamps2 = (nsamps+3)>>2; nsamps2 = (nsamps+3)>>2;
int16x8_t buff_tx[2][nsamps2]; int16x8_t buff_tx[2][nsamps2];
#else
#error Unsupported CPU architecture, USRP device cannot be built
#endif #endif
// bring RX data into 12 LSBs for softmodem RX // bring RX data into 12 LSBs for softmodem RX
......
...@@ -167,7 +167,10 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name ...@@ -167,7 +167,10 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
RU_t *ru = RC.ru[0]; RU_t *ru = RC.ru[0];
#endif #endif
if (eNB ==NULL) {
LOG_D(PHY,"%s:%d: rxtx invalid argument, eNB pointer is NULL",__FILE__,__LINE__);
return -1;
}
if (nfapi_mode == 1) { if (nfapi_mode == 1) {
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick // I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
uint16_t frame = proc->frame_rx; uint16_t frame = proc->frame_rx;
...@@ -206,7 +209,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name ...@@ -206,7 +209,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx)); T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx));
// if this is IF5 or 3GPP_eNB // if this is IF5 or 3GPP_eNB
if (eNB && eNB->RU_list && eNB->RU_list[0] && eNB->RU_list[0]->function < NGFI_RAU_IF4p5) { if (eNB->RU_list && eNB->RU_list[0] && eNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
wakeup_prach_eNB(eNB,NULL,proc->frame_rx,proc->subframe_rx); wakeup_prach_eNB(eNB,NULL,proc->frame_rx,proc->subframe_rx);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
wakeup_prach_eNB_br(eNB,NULL,proc->frame_rx,proc->subframe_rx); wakeup_prach_eNB_br(eNB,NULL,proc->frame_rx,proc->subframe_rx);
......
...@@ -1456,7 +1456,7 @@ int setup_RU_buffers(RU_t *ru) { ...@@ -1456,7 +1456,7 @@ int setup_RU_buffers(RU_t *ru) {
frame_parms = &ru->frame_parms; frame_parms = &ru->frame_parms;
printf("setup_RU_buffers: frame_parms = %p\n",frame_parms); printf("setup_RU_buffers: frame_parms = %p\n",frame_parms);
} else { } else {
printf("RU[%d] not initialized\n", ru->idx); printf("RU not initialized (NULL pointer)\n");
return(-1); return(-1);
} }
...@@ -2469,8 +2469,8 @@ void configure_ru(int idx, ...@@ -2469,8 +2469,8 @@ void configure_ru(int idx,
if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]); if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]);
ret=check_capabilities(ru,capabilities);
AssertFatal((ret=check_capabilities(ru,capabilities)) == 0, AssertFatal((ret == 0),
"Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret); "Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret);
// take antenna capabilities of RRU // take antenna capabilities of RRU
ru->nb_tx = capabilities->nb_tx[0]; ru->nb_tx = capabilities->nb_tx[0];
......
...@@ -125,7 +125,7 @@ void check_clock(void) ...@@ -125,7 +125,7 @@ void check_clock(void)
if (clock_getres(clock_id, &res)) { if (clock_getres(clock_id, &res)) {
printf("clock_getres failed"); printf("clock_getres failed");
} else { } else {
printf("reported resolution = %llu ns\n", (long long int) ((int) 1e9 * res.tv_sec) + (long long int) res.tv_nsec); printf("reported resolution = %lld ns\n", (long long int) ((int) 1e9 * res.tv_sec) + (long long int) res.tv_nsec);
} }
} }
......
...@@ -166,7 +166,8 @@ int input_text(char *file,char *sdu) ...@@ -166,7 +166,8 @@ int input_text(char *file,char *sdu)
printf("byte %d: %x (%s%s)\n",b_ind,byte,binary_table[byte>>4],binary_table[byte&0xf]); printf("byte %d: %x (%s%s)\n",b_ind,byte,binary_table[byte>>4],binary_table[byte&0xf]);
b_ind++; b_ind++;
} }
if (fd)
fclose(fd);
return(b_ind); return(b_ind);
} }
...@@ -220,14 +221,14 @@ int parse_args(int argc, char** argv, args_t* args) ...@@ -220,14 +221,14 @@ int parse_args(int argc, char** argv, args_t* args)
case 'I': case 'I':
strcpy(args->input1_file,optarg); strcpy(args->input1_file,optarg);
args->input1_sdu_len = input_text(args->input1_file,args->input1_sdu); args->input1_sdu_len = input_text(args->input1_file,args->input1_sdu);
printf("Got sdu1 of length %d bytes\n",args->input1_sdu_len); printf("Got sdu1 of length %u bytes\n",args->input1_sdu_len);
args->input1_sdu_flag=1; args->input1_sdu_flag=1;
break; break;
case 'J': case 'J':
strcpy(args->input2_file,optarg); strcpy(args->input2_file,optarg);
args->input2_sdu_len = input_text(args->input2_file,args->input2_sdu); args->input2_sdu_len = input_text(args->input2_file,args->input2_sdu);
printf("Got sdu2 of length %d bytes\n",args->input2_sdu_len); printf("Got sdu2 of length %u bytes\n",args->input2_sdu_len);
args->input2_sdu_flag=1; args->input2_sdu_flag=1;
break; break;
...@@ -530,7 +531,8 @@ int main (int argc, char **argv) ...@@ -530,7 +531,8 @@ int main (int argc, char **argv)
if (args.input_sib == 0) { if (args.input_sib == 0) {
openair_rrc_lite_eNB_init(0); openair_rrc_lite_eNB_init(0);
} else { } else {
printf("Got SI from files (%d,%d,%d,%d,%d)\n",args.input_sib,args.input1_sdu_flag,args.input2_sdu_flag); printf("Got SI from files (%d,%d,%d)\n",
args.input_sib,args.input1_sdu_flag,args.input2_sdu_flag);
} }
openair_rrc_on(0,0); openair_rrc_on(0,0);
......
...@@ -249,7 +249,7 @@ BOOL test_pdcp_data_req(void) ...@@ -249,7 +249,7 @@ BOOL test_pdcp_data_req(void)
* information if we pass mem_block_ts via a linked list? * information if we pass mem_block_ts via a linked list?
*/ */
if (pdcp_test_pdu_buffer_size == 0 || pdcp_test_pdu_buffer == NULL) { if (pdcp_test_pdu_buffer_size == 0 ) {
msg("[TEST] PDU created by pdcp_data_req() is invalid!\n"); msg("[TEST] PDU created by pdcp_data_req() is invalid!\n");
return FALSE; return FALSE;
} }
......
...@@ -125,7 +125,7 @@ void pdcp_rlc_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct mac_dat ...@@ -125,7 +125,7 @@ void pdcp_rlc_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct mac_dat
if (tb_src != NULL) { if (tb_src != NULL) {
tb_size = ((struct mac_tb_req *) (tb_src->data))->tb_size_in_bits >> 3; tb_size = ((struct mac_tb_req *) (tb_src->data))->tb_size_in_bits >> 3;
printf("[RLC-LOOP] FOUND TB SIZE IN BITS %d IN BYTES %d sizeof (mac_rlc_max_rx_header_size_t) %d\n", printf("[RLC-LOOP] FOUND TB SIZE IN BITS %d IN BYTES %u sizeof (mac_rlc_max_rx_header_size_t) %d\n",
((struct mac_tb_req *) (tb_src->data))->tb_size_in_bits, ((struct mac_tb_req *) (tb_src->data))->tb_size_in_bits,
tb_size, sizeof (mac_rlc_max_rx_header_size_t)); tb_size, sizeof (mac_rlc_max_rx_header_size_t));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment