fix compile warnings

This commit is contained in:
Andre Puschmann 2017-05-31 13:45:01 +02:00
parent bcecdf292b
commit c51c4d2a38
35 changed files with 151 additions and 119 deletions

View File

@ -121,8 +121,12 @@ struct LIBLTE_BYTE_MSG_STRUCT{
}
LIBLTE_BYTE_MSG_STRUCT & operator= (const LIBLTE_BYTE_MSG_STRUCT & buf)
{
// avoid self assignment
if (&buf == this)
return *this;
N_bytes = buf.N_bytes;
memcpy(msg, buf.msg, N_bytes);
return *this;
}
uint32 get_headroom()
{
@ -152,8 +156,12 @@ struct LIBLTE_BIT_MSG_STRUCT{
memcpy(msg, buf.msg, N_bits);
}
LIBLTE_BIT_MSG_STRUCT & operator= (const LIBLTE_BIT_MSG_STRUCT & buf){
// avoid self assignment
if (&buf == this)
return *this;
N_bits = buf.N_bits;
memcpy(msg, buf.msg, N_bits);
return *this;
}
uint32 get_headroom()
{

View File

@ -4494,7 +4494,7 @@ typedef enum{
}LIBLTE_RRC_MAX_RETX_THRESHOLD_ENUM;
static const char liblte_rrc_max_retx_threshold_text[LIBLTE_RRC_MAX_RETX_THRESHOLD_N_ITEMS][20] = { "t1", "t2", "t3", "t4",
"t6", "t8", "t16", "t32"};
static const int32 liblte_rrc_max_retx_threshold_num[LIBLTE_RRC_MAX_RETX_THRESHOLD_N_ITEMS] = { 1, 2, 3, 4,
static const uint32_t liblte_rrc_max_retx_threshold_num[LIBLTE_RRC_MAX_RETX_THRESHOLD_N_ITEMS] = { 1, 2, 3, 4,
6, 8, 16, 32};
typedef enum{
LIBLTE_RRC_T_REORDERING_MS0 = 0,

View File

@ -57,7 +57,7 @@ public:
buffer_pool(uint32_t nof_buffers = POOL_SIZE)
{
pthread_mutex_init(&mutex, NULL);
for(int i=0;i<nof_buffers;i++) {
for(uint32_t i=0;i<nof_buffers;i++) {
buffer_t *b = new buffer_t;
available.push(b);
}

View File

@ -126,8 +126,12 @@ public:
}
byte_buffer_t & operator= (const byte_buffer_t & buf)
{
// avoid self assignment
if (&buf == this)
return *this;
N_bytes = buf.N_bytes;
memcpy(msg, buf.msg, N_bytes);
return *this;
}
void reset()
{
@ -187,8 +191,12 @@ struct bit_buffer_t{
memcpy(msg, buf.msg, N_bits);
}
bit_buffer_t & operator= (const bit_buffer_t & buf){
// avoid self assignment
if (&buf == this)
return *this;
N_bits = buf.N_bits;
memcpy(msg, buf.msg, N_bits);
return *this;
}
void reset()
{

View File

@ -83,7 +83,7 @@ public:
}
bool new_subh() {
if (nof_subheaders < max_subheaders - 1 && rem_len > 0) {
if (nof_subheaders < (int)max_subheaders - 1 && rem_len > 0) {
nof_subheaders++;
next();
return true;
@ -148,7 +148,7 @@ protected:
uint32_t pdu_len;
uint32_t rem_len;
int cur_idx;
int nof_subheaders;
int nof_subheaders;
uint32_t max_subheaders;
bool pdu_is_ul;
uint8_t* buffer_tx;
@ -169,7 +169,7 @@ private:
total_sdu_len = 0;
last_sdu_idx = -1;
reset();
for (int i=0;i<max_subheaders;i++) {
for (uint32_t i=0;i<max_subheaders;i++) {
subheaders[i].parent = this;
subheaders[i].init();
}

View File

@ -106,22 +106,22 @@ public:
}
void step_all() {
for (int i=0;i<nof_timers;i++) {
for (uint32_t i=0;i<nof_timers;i++) {
get(i)->step();
}
}
void stop_all() {
for (int i=0;i<nof_timers;i++) {
for (uint32_t i=0;i<nof_timers;i++) {
get(i)->stop();
}
}
void run_all() {
for (int i=0;i<nof_timers;i++) {
for (uint32_t i=0;i<nof_timers;i++) {
get(i)->run();
}
}
void reset_all() {
for (int i=0;i<nof_timers;i++) {
for (uint32_t i=0;i<nof_timers;i++) {
get(i)->reset();
}
}

View File

@ -134,7 +134,7 @@ private:
int32_t t_poll_retx; // Poll retx timeout (ms)
int32_t poll_pdu; // Insert poll bit after this many PDUs
int32_t poll_byte; // Insert poll bit after this much data (KB)
int32_t max_retx_thresh; // Max number of retx
uint32_t max_retx_thresh; // Max number of retx
// RX configs
int32_t t_reordering; // Timer used by rx to detect PDU loss (ms)

View File

@ -126,7 +126,7 @@ struct rlc_amd_pdu_header_t{
lsf = h.lsf;
so = h.so;
N_li = h.N_li;
for(int i=0;i<h.N_li;i++)
for(uint32_t i=0;i<h.N_li;i++)
li[i] = h.li[i];
}
};

View File

@ -58,11 +58,11 @@ void mac_pcap::pack_and_write(uint8_t* pdu, uint32_t pdu_len_bytes, uint32_t reT
{
FDD_RADIO, direction, rnti_type,
crnti, /* RNTI */
ue_id, /* UEId */
reTX, /* Retx */
(uint16_t)ue_id, /* UEId */
(uint8_t)reTX, /* Retx */
crc_ok, /* CRC Stsatus (i.e. OK) */
tti/10, /* Sysframe number */
tti%10 /* Subframe number */
(uint16_t)(tti/10), /* Sysframe number */
(uint16_t)(tti%10) /* Subframe number */
};
if (pdu) {
MAC_LTE_PCAP_WritePDU(pcap_file, &context, pdu, pdu_len_bytes);

View File

@ -176,7 +176,7 @@ uint8_t* sch_pdu::write_packet(srslte::log *log_h)
uint8_t *pdu_start_ptr = ptr;
// Add single/two byte padding first
for (int i=0;i<onetwo_padding;i++) {
for (uint32_t i=0;i<onetwo_padding;i++) {
padding.write_subheader(&ptr, false);
}
// Then write subheaders for MAC CE
@ -244,7 +244,7 @@ uint8_t* sch_pdu::write_packet(srslte::log *log_h)
return NULL;
}
if (header_sz + ce_payload_sz != (int) (ptr - pdu_start_ptr)) {
if ((int)(header_sz + ce_payload_sz) != (int) (ptr - pdu_start_ptr)) {
fprintf(stderr, "Expected a header and CE payload of %d bytes but wrote %d\n",
header_sz+ce_payload_sz,(int) (ptr - pdu_start_ptr));
return NULL;
@ -291,7 +291,13 @@ bool sch_pdu::update_space_ce(uint32_t nbytes)
bool sch_pdu::has_space_sdu(uint32_t nbytes)
{
return get_sdu_space() >= nbytes;
int s = get_sdu_space();
if (s < 0) {
return false;
} else {
return (uint32_t)s >= nbytes;
}
}
bool sch_pdu::update_space_sdu(uint32_t nbytes)
@ -495,7 +501,7 @@ bool sch_subh::set_bsr(uint32_t buff_size[4], sch_subh::cetype format)
w_payload_ce[1] = (buff_size_table(buff_size[1])&0xf) << 4 | (buff_size_table(buff_size[2])&0xf0)>>4;
w_payload_ce[2] = (buff_size_table(buff_size[2])&0x3) << 6 | (buff_size_table(buff_size[3])&0x3f);
} else {
w_payload_ce[0] = (nonzero_lcg&0x3)<<6 | buff_size_table(buff_size[nonzero_lcg])&0x3f;
w_payload_ce[0] = (nonzero_lcg&0x3)<<6 | (buff_size_table(buff_size[nonzero_lcg])&0x3f);
}
lcid = format;
((sch_pdu*)parent)->update_space_ce(ce_size);
@ -569,7 +575,7 @@ int sch_subh::set_sdu(uint32_t lcid_, uint32_t requested_bytes, read_pdu_interfa
payload = ((sch_pdu*)parent)->get_current_sdu_ptr();
// Copy data and get final number of bytes written to the MAC PDU
int sdu_sz = sdu_itf->read_pdu(lcid, payload, requested_bytes);
uint32_t sdu_sz = sdu_itf->read_pdu(lcid, payload, requested_bytes);
if (sdu_sz < 0 || sdu_sz > requested_bytes) {
return -1;
@ -652,7 +658,7 @@ bool sch_subh::read_subheader(uint8_t** ptr)
nof_bytes = (uint32_t)*(*ptr) & 0x7f;
*ptr += 1;
if (F_bit) {
nof_bytes = nof_bytes<<8 | (uint32_t) *(*ptr) & 0xff;
nof_bytes = nof_bytes<<8 | ((uint32_t) *(*ptr) & 0xff);
*ptr += 1;
}
} else {
@ -807,7 +813,7 @@ void rar_subh::set_temp_crnti(uint16_t temp_rnti_)
// Section 6.2.2
void rar_subh::write_subheader(uint8_t** ptr, bool is_last)
{
*(*ptr) = (uint8_t) (!is_last<<7 | 1<<6 | preamble & 0x3f);
*(*ptr) = (uint8_t) (!is_last<<7 | 1<<6 | (preamble & 0x3f));
*ptr += 1;
}
// Section 6.2.3

View File

@ -84,7 +84,7 @@ thread_pool::thread_pool(uint32_t max_workers_) :
{
max_workers = max_workers_;
for (int i=0;i<max_workers;i++) {
for (uint32_t i=0;i<max_workers;i++) {
workers[i] = NULL;
status[i] = IDLE;
pthread_mutex_init(&mutex[i], NULL);
@ -177,7 +177,7 @@ thread_pool::worker* thread_pool::wait_worker()
}
bool thread_pool::find_finished_worker(uint32_t tti, uint32_t *id) {
for(int i=0;i<nof_workers;i++) {
for(uint32_t i=0;i<nof_workers;i++) {
if (status[i] == IDLE) {
*id = i;
return true;

View File

@ -698,7 +698,7 @@ void srslte_vec_arg_cf(cf_t *x, float *arg, uint32_t len) {
uint32_t srslte_vec_max_fi(float *x, uint32_t len) {
#ifdef HAVE_VOLK_MAX_FUNCTION
uint32_t target=0;
uint16_t target=0;
volk_32f_index_max_16u(&target,x,len);
return target;
@ -763,7 +763,7 @@ void srslte_vec_max_fff(float *x, float *y, float *z, uint32_t len) {
uint32_t srslte_vec_max_abs_ci(cf_t *x, uint32_t len) {
#ifdef HAVE_VOLK_MAX_ABS_FUNCTION
uint32_t target=0;
uint16_t target=0;
volk_32fc_index_max_16u(&target,x,len);
return target;

View File

@ -115,7 +115,7 @@ void gw::write_pdu(uint32_t lcid, srslte::byte_buffer_t *pdu)
gw_log->warning("TUN/TAP not up - dropping gw RX message\n");
}else{
int n = write(tun_fd, pdu->msg, pdu->N_bytes);
if(pdu->N_bytes != n)
if(n > 0 && (pdu->N_bytes != (uint32_t)n))
{
gw_log->warning("DL TUN/TAP write failure\n");
}

View File

@ -372,9 +372,9 @@ void rlc_am::check_reordering_timeout()
bool rlc_am::poll_required()
{
if(poll_pdu > 0 && pdu_without_poll > poll_pdu)
if(poll_pdu > 0 && pdu_without_poll > (uint32_t)poll_pdu)
return true;
if(poll_byte > 0 && byte_without_poll > poll_byte)
if(poll_byte > 0 && byte_without_poll > (uint32_t)poll_byte)
return true;
if(poll_retx())
return true;
@ -402,7 +402,7 @@ int rlc_am::prepare_status()
int rlc_am::build_status_pdu(uint8_t *payload, uint32_t nof_bytes)
{
int pdu_len = rlc_am_packed_length(&status);
if(nof_bytes >= pdu_len)
if(pdu_len > 0 && nof_bytes >= (uint32_t)pdu_len)
{
log->info("%s Tx status PDU - %s\n",
rb_id_text[lcid], rlc_am_to_string(&status).c_str());
@ -432,7 +432,7 @@ int rlc_am::build_retx_pdu(uint8_t *payload, uint32_t nof_bytes)
}
// Is resegmentation needed?
if(retx.is_segment || required_buffer_size(retx) > nof_bytes) {
if(retx.is_segment || required_buffer_size(retx) > (int)nof_bytes) {
log->debug("%s build_retx_pdu - resegmentation required\n", rb_id_text[lcid]);
return build_segment(payload, nof_bytes, retx);
}
@ -506,7 +506,7 @@ int rlc_am::build_segment(uint8_t *payload, uint32_t nof_bytes, rlc_amd_retx_t r
uint32_t upper = 0;
uint32_t li = 0;
for(int i=0; i<old_header.N_li; i++) {
for(uint32_t i=0; i<old_header.N_li; i++) {
if(lower >= retx.so_end)
break;
@ -561,7 +561,7 @@ int rlc_am::build_segment(uint8_t *payload, uint32_t nof_bytes, rlc_amd_retx_t r
debug_state();
int pdu_len = (ptr-payload) + len;
if(pdu_len > nof_bytes) {
if(pdu_len > (int)nof_bytes) {
log->error("%s Retx PDU segment length error. Available: %d, Used: %d\n",
rb_id_text[lcid], nof_bytes, pdu_len);
log->debug("%s Retx PDU segment length error. Header len: %d, Payload len: %d, N_li: %d\n",
@ -784,8 +784,8 @@ void rlc_am::handle_data_pdu(uint8_t *payload, uint32_t nof_bytes, rlc_amd_pdu_h
if(
vr_x == vr_r ||
(RX_MOD_BASE(vr_x) < RX_MOD_BASE(vr_r) ||
RX_MOD_BASE(vr_x) > RX_MOD_BASE(vr_mr) &&
vr_x != vr_mr)
(RX_MOD_BASE(vr_x) > RX_MOD_BASE(vr_mr) &&
vr_x != vr_mr))
)
{
reordering_timeout.reset();
@ -902,7 +902,7 @@ void rlc_am::handle_control_pdu(uint8_t *payload, uint32_t nof_bytes)
std::map<uint32_t, rlc_amd_tx_pdu_t>::iterator it;
bool nack = false;
for(int j=0;j<status.N_nack;j++) {
for(uint32_t j=0;j<status.N_nack;j++) {
if(status.nacks[j].nack_sn == i) {
nack = true;
update_vt_a = false;
@ -963,7 +963,7 @@ void rlc_am::reassemble_rx_sdus()
while(rx_window.end() != rx_window.find(vr_r))
{
// Handle any SDU segments
for(int i=0; i<rx_window[vr_r].header.N_li; i++)
for(uint32_t i=0; i<rx_window[vr_r].header.N_li; i++)
{
int len = rx_window[vr_r].header.li[i];
memcpy(&rx_sdu->msg[rx_sdu->N_bytes], rx_window[vr_r].buf->msg, len);
@ -1076,7 +1076,7 @@ bool rlc_am::add_segment_and_check(rlc_amd_rx_pdu_segments_t *pdu, rlc_amd_rx_pd
if(it->header.N_li > 0) {
header.li[header.N_li++] = it->header.li[0] + carryover;
count += it->header.li[0];
for(int i=1; i<it->header.N_li; i++) {
for(uint32_t i=1; i<it->header.N_li; i++) {
header.li[header.N_li++] = it->header.li[i];
count += it->header.li[i];
}
@ -1134,7 +1134,7 @@ int rlc_am::required_buffer_size(rlc_amd_retx_t retx)
uint32_t upper = 0;
uint32_t li = 0;
for(int i=0; i<old_header.N_li; i++) {
for(uint32_t i=0; i<old_header.N_li; i++) {
if(lower >= retx.so_end)
break;
@ -1448,7 +1448,7 @@ std::string rlc_am_to_string(rlc_status_pdu_t *status)
if(status->N_nack > 0)
{
ss << ", NACK_SN = ";
for(int i=0; i<status->N_nack; i++)
for(uint32_t i=0; i<status->N_nack; i++)
{
if(status->nacks[i].has_so) {
ss << "[" << status->nacks[i].nack_sn << " " << status->nacks[i].so_start \

View File

@ -295,7 +295,8 @@ int rlc_um::build_data_pdu(uint8_t *payload, uint32_t nof_bytes)
// Check for SDU segment
if(tx_sdu)
{
to_move = ((pdu_space-head_len) >= tx_sdu->N_bytes) ? tx_sdu->N_bytes : pdu_space-head_len;
uint32_t space = pdu_space-head_len;
to_move = space >= tx_sdu->N_bytes ? tx_sdu->N_bytes : space;
log->debug("%s adding remainder of SDU segment - %d bytes of %d remaining\n",
rb_id_text[lcid], to_move, tx_sdu->N_bytes);
memcpy(pdu_ptr, tx_sdu->msg, to_move);
@ -323,7 +324,8 @@ int rlc_um::build_data_pdu(uint8_t *payload, uint32_t nof_bytes)
header.li[header.N_li++] = last_li;
head_len = rlc_um_packed_length(&header);
tx_sdu_queue.read(&tx_sdu);
to_move = ((pdu_space-head_len) >= tx_sdu->N_bytes) ? tx_sdu->N_bytes : pdu_space-head_len;
uint32_t space = pdu_space-head_len;
to_move = space >= tx_sdu->N_bytes ? tx_sdu->N_bytes : space;
log->debug("%s adding new SDU segment - %d bytes of %d remaining\n",
rb_id_text[lcid], to_move, tx_sdu->N_bytes);
memcpy(pdu_ptr, tx_sdu->msg, to_move);
@ -445,14 +447,14 @@ void rlc_um::reassemble_rx_sdus()
rx_sdu->reset();
}else{
// Handle any SDU segments
for(int i=0; i<rx_window[vr_ur].header.N_li; i++)
for(uint32_t i=0; i<rx_window[vr_ur].header.N_li; i++)
{
int len = rx_window[vr_ur].header.li[i];
memcpy(&rx_sdu->msg[rx_sdu->N_bytes], rx_window[vr_ur].buf->msg, len);
rx_sdu->N_bytes += len;
rx_window[vr_ur].buf->msg += len;
rx_window[vr_ur].buf->N_bytes -= len;
if(pdu_lost && !rlc_um_start_aligned(rx_window[vr_ur].header.fi) || vr_ur != ((vr_ur_in_rx_sdu+1)%rx_mod)) {
if((pdu_lost && !rlc_um_start_aligned(rx_window[vr_ur].header.fi)) || (vr_ur != ((vr_ur_in_rx_sdu+1)%rx_mod))) {
log->warning("Dropping remainder of lost PDU (lower edge middle segments, vr_ur=%d, vr_ur_in_rx_sdu=%d)\n", vr_ur, vr_ur_in_rx_sdu);
rx_sdu->reset();
} else {
@ -497,7 +499,7 @@ void rlc_um::reassemble_rx_sdus()
while(rx_window.end() != rx_window.find(vr_ur))
{
// Handle any SDU segments
for(int i=0; i<rx_window[vr_ur].header.N_li; i++)
for(uint32_t i=0; i<rx_window[vr_ur].header.N_li; i++)
{
int len = rx_window[vr_ur].header.li[i];
memcpy(&rx_sdu->msg[rx_sdu->N_bytes], rx_window[vr_ur].buf->msg, len);
@ -506,7 +508,7 @@ void rlc_um::reassemble_rx_sdus()
rx_sdu->N_bytes += len;
rx_window[vr_ur].buf->msg += len;
rx_window[vr_ur].buf->N_bytes -= len;
if(pdu_lost && !rlc_um_start_aligned(rx_window[vr_ur].header.fi) || vr_ur != ((vr_ur_in_rx_sdu+1)%rx_mod)) {
if((pdu_lost && !rlc_um_start_aligned(rx_window[vr_ur].header.fi)) || (vr_ur != ((vr_ur_in_rx_sdu+1)%rx_mod))) {
log->warning("Dropping remainder of lost PDU (update vr_ur middle segments, vr_ur=%d, vr_ur_in_rx_sdu=%d)\n", vr_ur, vr_ur_in_rx_sdu);
rx_sdu->reset();
} else {

View File

@ -282,7 +282,7 @@ void rrc::write_pdu_bcch_dlsch(byte_buffer_t *pdu)
liblte_rrc_si_window_length_num[sib1.si_window_length],
liblte_rrc_si_periodicity_num[sib1.sched_info[0].si_periodicity]);
std::stringstream ss;
for(int i=0;i<sib1.N_plmn_ids;i++){
for(uint32_t i=0;i<sib1.N_plmn_ids;i++){
std::string mcc;
std::string mnc;
mcc_to_string(sib1.plmn_id[i].id.mcc, &mcc);
@ -340,7 +340,7 @@ void rrc::write_pdu_pcch(byte_buffer_t *pdu)
}
LIBLTE_RRC_S_TMSI_STRUCT *s_tmsi_paged;
for (int i=0;i<pcch_msg.paging_record_list_size;i++) {
for (uint32_t i=0;i<pcch_msg.paging_record_list_size;i++) {
s_tmsi_paged = &pcch_msg.paging_record_list[i].ue_identity.s_tmsi;
rrc_log->info("Received paging (%d/%d) for UE 0x%x\n", i+1, pcch_msg.paging_record_list_size,
pcch_msg.paging_record_list[i].ue_identity.s_tmsi);
@ -396,7 +396,7 @@ void rrc::send_con_request()
// Byte align and pack the message bits for PDCP
if((bit_buf.N_bits % 8) != 0)
{
for(int i=0; i<8-(bit_buf.N_bits % 8); i++)
for(uint32_t i=0; i<8-(bit_buf.N_bits % 8); i++)
bit_buf.msg[bit_buf.N_bits + i] = 0;
bit_buf.N_bits += 8 - (bit_buf.N_bits % 8);
}
@ -409,7 +409,7 @@ void rrc::send_con_request()
uint64_t uecri=0;
uint8_t *ue_cri_ptr = (uint8_t*) &uecri;
uint32_t nbytes = 6;
for (int i=0;i<nbytes;i++) {
for (uint32_t i=0;i<nbytes;i++) {
ue_cri_ptr[nbytes-i-1] = pdcp_buf->msg[i];
}
rrc_log->debug("Setting UE contention resolution ID: %d\n", uecri);
@ -490,7 +490,7 @@ void rrc::send_con_restablish_request()
// Byte align and pack the message bits for PDCP
if((bit_buf.N_bits % 8) != 0)
{
for(int i=0; i<8-(bit_buf.N_bits % 8); i++)
for(uint32_t i=0; i<8-(bit_buf.N_bits % 8); i++)
bit_buf.msg[bit_buf.N_bits + i] = 0;
bit_buf.N_bits += 8 - (bit_buf.N_bits % 8);
}
@ -502,7 +502,7 @@ void rrc::send_con_restablish_request()
uint64_t uecri=0;
uint8_t *ue_cri_ptr = (uint8_t*) &uecri;
uint32_t nbytes = 6;
for (int i=0;i<nbytes;i++) {
for (uint32_t i=0;i<nbytes;i++) {
ue_cri_ptr[nbytes-i-1] = pdcp_buf->msg[i];
}
rrc_log->debug("Setting UE contention resolution ID: %d\n", uecri);
@ -527,7 +527,7 @@ void rrc::send_con_restablish_complete()
// Byte align and pack the message bits for PDCP
if((bit_buf.N_bits % 8) != 0)
{
for(int i=0; i<8-(bit_buf.N_bits % 8); i++)
for(uint32_t i=0; i<8-(bit_buf.N_bits % 8); i++)
bit_buf.msg[bit_buf.N_bits + i] = 0;
bit_buf.N_bits += 8 - (bit_buf.N_bits % 8);
}
@ -558,7 +558,7 @@ void rrc::send_con_setup_complete(byte_buffer_t *nas_msg)
// Byte align and pack the message bits for PDCP
if((bit_buf.N_bits % 8) != 0)
{
for(int i=0; i<8-(bit_buf.N_bits % 8); i++)
for(uint32_t i=0; i<8-(bit_buf.N_bits % 8); i++)
bit_buf.msg[bit_buf.N_bits + i] = 0;
bit_buf.N_bits += 8 - (bit_buf.N_bits % 8);
}
@ -592,7 +592,7 @@ void rrc::send_ul_info_transfer(uint32_t lcid, byte_buffer_t *sdu)
// Byte align and pack the message bits for PDCP
if((bit_buf.N_bits % 8) != 0)
{
for(int i=0; i<8-(bit_buf.N_bits % 8); i++)
for(uint32_t i=0; i<8-(bit_buf.N_bits % 8); i++)
bit_buf.msg[bit_buf.N_bits + i] = 0;
bit_buf.N_bits += 8 - (bit_buf.N_bits % 8);
}
@ -616,7 +616,7 @@ void rrc::send_security_mode_complete(uint32_t lcid, byte_buffer_t *pdu)
// Byte align and pack the message bits for PDCP
if((bit_buf.N_bits % 8) != 0)
{
for(int i=0; i<8-(bit_buf.N_bits % 8); i++)
for(uint32_t i=0; i<8-(bit_buf.N_bits % 8); i++)
bit_buf.msg[bit_buf.N_bits + i] = 0;
bit_buf.N_bits += 8 - (bit_buf.N_bits % 8);
}
@ -640,7 +640,7 @@ void rrc::send_rrc_con_reconfig_complete(uint32_t lcid, byte_buffer_t *pdu)
// Byte align and pack the message bits for PDCP
if((bit_buf.N_bits % 8) != 0)
{
for(int i=0; i<8-(bit_buf.N_bits % 8); i++)
for(uint32_t i=0; i<8-(bit_buf.N_bits % 8); i++)
bit_buf.msg[bit_buf.N_bits + i] = 0;
bit_buf.N_bits += 8 - (bit_buf.N_bits % 8);
}
@ -727,7 +727,7 @@ void rrc::send_rrc_ue_cap_info(uint32_t lcid, byte_buffer_t *pdu)
// Byte align and pack the message bits for PDCP
if((bit_buf.N_bits % 8) != 0)
{
for(int i=0; i<8-(bit_buf.N_bits % 8); i++)
for(uint32_t i=0; i<8-(bit_buf.N_bits % 8); i++)
bit_buf.msg[bit_buf.N_bits + i] = 0;
bit_buf.N_bits += 8 - (bit_buf.N_bits % 8);
}
@ -823,7 +823,7 @@ void rrc::parse_dl_dcch(uint32_t lcid, byte_buffer_t *pdu)
break;
case LIBLTE_RRC_DL_DCCH_MSG_TYPE_UE_CAPABILITY_ENQUIRY:
transaction_id = dl_dcch_msg.msg.ue_cap_enquiry.rrc_transaction_id;
for(int i=0; i<dl_dcch_msg.msg.ue_cap_enquiry.N_ue_cap_reqs; i++)
for(uint32_t i=0; i<dl_dcch_msg.msg.ue_cap_enquiry.N_ue_cap_reqs; i++)
{
if(LIBLTE_RRC_RAT_TYPE_EUTRA == dl_dcch_msg.msg.ue_cap_enquiry.ue_capability_request[i])
{
@ -1251,14 +1251,14 @@ void rrc::apply_rr_config_dedicated(LIBLTE_RRC_RR_CONFIG_DEDICATED_STRUCT *cnfg)
if(cnfg->rlf_timers_and_constants_present) {
//TODO
}
for(int i=0; i<cnfg->srb_to_add_mod_list_size; i++) {
for(uint32_t i=0; i<cnfg->srb_to_add_mod_list_size; i++) {
// TODO: handle SRB modification
add_srb(&cnfg->srb_to_add_mod_list[i]);
}
for(int i=0; i<cnfg->drb_to_release_list_size; i++) {
for(uint32_t i=0; i<cnfg->drb_to_release_list_size; i++) {
release_drb(cnfg->drb_to_release_list[i]);
}
for(int i=0; i<cnfg->drb_to_add_mod_list_size; i++) {
for(uint32_t i=0; i<cnfg->drb_to_add_mod_list_size; i++) {
// TODO: handle DRB modification
add_drb(&cnfg->drb_to_add_mod_list[i]);
}

View File

@ -52,6 +52,7 @@ void* thread_loop(void *a) {
filter.info("Thread %d: %d", args->thread_id, i);
filter.debug("Thread %d: %d", args->thread_id, i);
}
return NULL;
}
void* thread_loop_hex(void *a) {

View File

@ -47,7 +47,7 @@ int main(int argc, char **argv) {
assert(s.N_nack == 0);
rlc_am_write_status_pdu(&s, &b2);
assert(b2.N_bytes == PDU1_LEN);
for(int i=0;i<b2.N_bytes;i++)
for(uint32_t i=0;i<b2.N_bytes;i++)
assert(b2.msg[i] == b1.msg[i]);
b1.reset();
@ -65,6 +65,6 @@ int main(int argc, char **argv) {
assert(s.nacks[3].nack_sn == 4);
rlc_am_write_status_pdu(&s, &b2);
assert(b2.N_bytes == PDU2_LEN);
for(int i=0;i<b2.N_bytes;i++)
for(uint32_t i=0;i<b2.N_bytes;i++)
assert(b2.msg[i] == b1.msg[i]);
}

View File

@ -59,7 +59,7 @@ int main(int argc, char **argv) {
assert(6 == h.sn);
rlc_am_write_data_pdu_header(&h, &b2);
assert(b2.N_bytes == PDU1_LEN);
for(int i=0;i<b2.N_bytes;i++)
for(uint32_t i=0;i<b2.N_bytes;i++)
assert(b2.msg[i] == b1.msg[i]);
b1.reset();
@ -81,7 +81,7 @@ int main(int argc, char **argv) {
assert(0 == h.sn);
rlc_am_write_data_pdu_header(&h, &b2);
assert(b2.N_bytes == PDU2_LEN);
for(int i=0;i<b2.N_bytes;i++)
for(uint32_t i=0;i<b2.N_bytes;i++)
assert(b2.msg[i] == b1.msg[i]);
b1.reset();
@ -104,6 +104,6 @@ int main(int argc, char **argv) {
assert(0 == h.sn);
rlc_am_write_data_pdu_header(&h, &b2);
assert(b2.N_bytes == PDU3_LEN);
for(int i=0;i<b2.N_bytes;i++)
for(uint32_t i=0;i<b2.N_bytes;i++)
assert(b2.msg[i] == b1.msg[i]);
}

View File

@ -50,7 +50,7 @@ int main(int argc, char **argv) {
assert(226 == h.sn);
rlc_um_write_data_pdu_header(&h, &b2);
assert(b2.N_bytes == PDU1_LEN);
for(int i=0;i<b2.N_bytes;i++)
for(uint32_t i=0;i<b2.N_bytes;i++)
assert(b2.msg[i] == b1.msg[i]);
b1.reset();
@ -66,6 +66,6 @@ int main(int argc, char **argv) {
assert(104 == h.li[0]);
rlc_um_write_data_pdu_header(&h, &b2);
assert(b2.N_bytes == PDU2_LEN);
for(int i=0;i<b2.N_bytes;i++)
for(uint32_t i=0;i<b2.N_bytes;i++)
assert(b2.msg[i] == b1.msg[i]);
}

View File

@ -41,7 +41,7 @@
typedef struct {
int id;
uint32_t id;
int Bj;
int PBR; // -1 sets to infinity
uint32_t BSD;

View File

@ -160,7 +160,7 @@ public:
private:
static ue *instance;
ue();
~ue();
virtual ~ue();
srslte::radio_multi radio;
srsue::phy phy;

View File

@ -158,7 +158,7 @@ void demux::process_sch_pdu(srslte::sch_pdu *pdu_msg)
if (pdu_msg->get()->get_sdu_lcid() == 0) {
uint8_t *x = pdu_msg->get()->get_sdu_ptr();
uint32_t sum = 0;
for (int i=0;i<pdu_msg->get()->get_payload_size();i++) {
for (uint32_t i=0;i<pdu_msg->get()->get_payload_size();i++) {
sum += x[i];
}
if (sum == 0) {

View File

@ -197,7 +197,7 @@ bool dl_harq_entity::dl_harq_process::is_sps()
bool dl_harq_entity::dl_harq_process::calc_is_new_transmission(mac_interface_phy::mac_grant_t grant) {
bool is_new_tb = true;
if (srslte_tti_interval(grant.tti, cur_grant.tti) <= 8 && grant.n_bytes == cur_grant.n_bytes ||
if ((srslte_tti_interval(grant.tti, cur_grant.tti) <= 8 && (grant.n_bytes == cur_grant.n_bytes)) ||
pid == HARQ_BCCH_PID)
{
is_new_tb = false;

View File

@ -68,7 +68,7 @@ void mux::reset()
bool mux::is_pending_any_sdu()
{
for (int i=0;i<lch.size();i++) {
for (uint32_t i=0;i<lch.size();i++) {
if (rlc->get_buffer_state(lch[i].id)) {
return true;
}
@ -82,7 +82,7 @@ bool mux::is_pending_sdu(uint32_t lch_id) {
int mux::find_lchid(uint32_t lcid)
{
for (int i=0;i<lch.size();i++) {
for (uint32_t i=0;i<lch.size();i++) {
if(lch[i].id == lcid) {
return i;
}
@ -131,10 +131,11 @@ srslte::sch_subh::cetype bsr_format_convert(bsr_proc::bsr_format_t format) {
switch(format) {
case bsr_proc::LONG_BSR:
return srslte::sch_subh::LONG_BSR;
case bsr_proc::SHORT_BSR:
case bsr_proc::TRUNC_BSR:
return srslte::sch_subh::TRUNC_BSR;
case bsr_proc::SHORT_BSR:
default:
return srslte::sch_subh::SHORT_BSR;
case bsr_proc::TRUNC_BSR:
return srslte::sch_subh::TRUNC_BSR;
}
}
@ -151,12 +152,12 @@ uint8_t* mux::pdu_get(uint8_t *payload, uint32_t pdu_sz, uint32_t tx_tti, uint32
pthread_mutex_lock(&mutex);
// Update Bj
for (int i=0;i<lch.size();i++) {
for (uint32_t i=0;i<lch.size();i++) {
// Add PRB unless it's infinity
if (lch[i].PBR >= 0) {
lch[i].Bj += lch[i].PBR;
}
if (lch[i].Bj >= lch[i].BSD) {
if (lch[i].Bj >= (int)lch[i].BSD) {
lch[i].Bj = lch[i].BSD*lch[i].PBR;
}
}
@ -197,14 +198,14 @@ uint8_t* mux::pdu_get(uint8_t *payload, uint32_t pdu_sz, uint32_t tx_tti, uint32
}
// Update buffer states for all logical channels
int sdu_space = pdu_msg.get_sdu_space();
for (int i=0;i<lch.size();i++) {
for (uint32_t i=0;i<lch.size();i++) {
lch[i].buffer_len = rlc->get_buffer_state(lch[i].id);
lch[i].sched_len = 0;
}
// data from any Logical Channel, except data from UL-CCCH;
// first only those with positive Bj
for (int i=0;i<lch.size();i++) {
for (uint32_t i=0;i<lch.size();i++) {
if (lch[i].id != 0) {
if (sched_sdu(&lch[i], &sdu_space, (lch[i].PBR<0)?-1:lch[i].Bj) && lch[i].PBR >= 0) {
lch[i].Bj -= lch[i].sched_len;
@ -213,7 +214,7 @@ uint8_t* mux::pdu_get(uint8_t *payload, uint32_t pdu_sz, uint32_t tx_tti, uint32
}
// If resources remain, allocate regardless of their Bj value
for (int i=0;i<lch.size();i++) {
for (uint32_t i=0;i<lch.size();i++) {
if (lch[i].id != 0) {
sched_sdu(&lch[i], &sdu_space, -1);
}
@ -221,7 +222,7 @@ uint8_t* mux::pdu_get(uint8_t *payload, uint32_t pdu_sz, uint32_t tx_tti, uint32
// Maximize the grant utilization
if (lch.size() > 0) {
for (int i=lch.size()-1;i--;i>=0) {
for (int i=(int)lch.size()-1;i>=0;i--) {
if (lch[i].sched_len > 0) {
lch[i].sched_len = -1;
break;
@ -229,7 +230,7 @@ uint8_t* mux::pdu_get(uint8_t *payload, uint32_t pdu_sz, uint32_t tx_tti, uint32
}
}
// Now allocate the SDUs from the RLC
for (int i=0;i<lch.size();i++) {
for (uint32_t i=0;i<lch.size();i++) {
if (lch[i].sched_len != 0) {
log_h->info("Allocating scheduled lch=%d len=%d\n", lch[i].id, lch[i].sched_len);
allocate_sdu(lch[i].id, &pdu_msg, lch[i].sched_len);

View File

@ -222,14 +222,14 @@ void bsr_proc::step(uint32_t tti)
}
int periodic = liblte_rrc_periodic_bsr_timer_num[mac_cfg->main.ulsch_cnfg.periodic_bsr_timer];
if (periodic != timers_db->get(mac::BSR_TIMER_PERIODIC)->get_timeout() && periodic > 0)
if (periodic > 0 && (uint32_t)periodic != timers_db->get(mac::BSR_TIMER_PERIODIC)->get_timeout())
{
timers_db->get(mac::BSR_TIMER_PERIODIC)->set(this, periodic);
timers_db->get(mac::BSR_TIMER_PERIODIC)->run();
Info("BSR: Configured timer periodic %d ms\n", periodic);
}
int retx = liblte_rrc_retransmission_bsr_timer_num[mac_cfg->main.ulsch_cnfg.retx_bsr_timer];
if (retx != timers_db->get(mac::BSR_TIMER_RETX)->get_timeout() && retx > 0)
if (retx > 0 && (uint32_t)retx != timers_db->get(mac::BSR_TIMER_RETX)->get_timeout())
{
timers_db->get(mac::BSR_TIMER_RETX)->set(this, retx);
timers_db->get(mac::BSR_TIMER_RETX)->run();
@ -279,6 +279,8 @@ char* bsr_proc::bsr_format_tostring(bsr_format_t format) {
return (char*) "Short";
case bsr_proc::TRUNC_BSR:
return (char*) "Truncated";
default:
return (char*) "Short";
}
}
@ -290,7 +292,7 @@ bool bsr_proc::need_to_send_bsr_on_ul_grant(uint32_t grant_size, bsr_t *bsr)
if (triggered_bsr_type == PERIODIC || triggered_bsr_type == REGULAR) {
/* Check if grant + MAC SDU headers is enough to accomodate all pending data */
int total_data = 0;
for (int i=0;i<MAX_LCID && total_data < grant_size;i++) {
for (int i=0;i<MAX_LCID && total_data < (int)grant_size;i++) {
total_data += srslte::sch_pdu::size_header_sdu(rlc->get_buffer_state(i))+rlc->get_buffer_state(i);
}
total_data--; // Because last SDU has no size header
@ -300,7 +302,7 @@ bool bsr_proc::need_to_send_bsr_on_ul_grant(uint32_t grant_size, bsr_t *bsr)
*/
generate_bsr(bsr, 0);
bsr_sz = bsr->format==LONG_BSR?3:1;
if (total_data <= grant_size && total_data + 1 + bsr_sz > grant_size) {
if (total_data <= (int)grant_size && total_data + 1 + bsr_sz > grant_size) {
Debug("Grant is not enough to accomodate the BSR MAC CE\n");
} else {
Debug("BSR: Including Regular BSR: grant_size=%d, total_data=%d, bsr_sz=%d\n",
@ -390,7 +392,8 @@ void bsr_proc::set_priority(uint32_t lcid, uint32_t priority) {
}
uint32_t bsr_proc::find_max_priority_lcid() {
uint32_t max_prio = 0, max_idx = 0;
int32_t max_prio = 0;
uint32_t max_idx = 0;
for (int i=0;i<MAX_LCID;i++) {
if (priorities[i] > max_prio) {
max_prio = priorities[i];

View File

@ -450,7 +450,7 @@ void ra_proc::step_contention_resolution() {
{
// Random Access with transmission of MAC C-RNTI CE
if ((!started_by_pdcch && pdcch_to_crnti_received == PDCCH_CRNTI_UL_GRANT) ||
started_by_pdcch && pdcch_to_crnti_received != PDCCH_CRNTI_NOT_RECEIVED)
(started_by_pdcch && pdcch_to_crnti_received != PDCCH_CRNTI_NOT_RECEIVED))
{
rDebug("PDCCH for C-RNTI received\n");
timers_db->get(mac::CONTENTION_TIMER)->stop();
@ -515,6 +515,7 @@ void ra_proc::step(uint32_t tti_)
case COMPLETION:
step_completition();
case COMPLETION_DONE:
case RA_PROBLEM:
break;
}
}

View File

@ -57,7 +57,7 @@ bool sr_proc::need_tx(uint32_t tti)
{
int last_tx_tti = phy_h->sr_last_tx_tti();
if (last_tx_tti >= 0) {
if (tti > last_tx_tti) {
if (tti > (uint32_t)last_tx_tti) {
if (tti - last_tx_tti > 8) {
return true;
}

View File

@ -95,7 +95,7 @@ void ul_harq_entity::set_ack(uint32_t tti, bool ack) {
tti_harq += 10240;
}
uint32_t pid_harq = pidof(tti_harq);
if (proc[pid_harq].has_grant() && proc[pid_harq].last_tx_tti() <= tti_harq) {
if (proc[pid_harq].has_grant() && (proc[pid_harq].last_tx_tti() <= (uint32_t)tti_harq)) {
proc[pid_harq].set_harq_feedback(ack);
}
}
@ -228,7 +228,7 @@ void ul_harq_entity::ul_harq_process::run_tti(uint32_t tti_tx, mac_interface_phy
{
int max_retx;
uint32_t max_retx;
if (is_msg3) {
max_retx = harq_entity->mac_cfg->rach.max_harq_msg3_tx;
} else {
@ -238,7 +238,7 @@ void ul_harq_entity::ul_harq_process::run_tti(uint32_t tti_tx, mac_interface_phy
// Receive and route HARQ feedbacks
if (grant) {
if ((!grant->rnti_type == SRSLTE_RNTI_TEMP && grant->ndi != get_ndi()) ||
if ((!(grant->rnti_type == SRSLTE_RNTI_TEMP) && grant->ndi != get_ndi()) ||
(grant->rnti_type == SRSLTE_RNTI_USER && !has_grant()) ||
grant->is_from_rar)
{

View File

@ -84,7 +84,7 @@ void phch_common::init(phy_interface_rrc::phy_cfg_t *_config, phy_args_t *_args,
is_first_tx = true;
sr_last_tx_tti = -1;
for (int i=0;i<nof_mutex;i++) {
for (uint32_t i=0;i<nof_mutex;i++) {
pthread_mutex_init(&tx_mutex[i], NULL);
}
}
@ -95,8 +95,8 @@ void phch_common::set_nof_mutex(uint32_t nof_mutex_) {
}
bool phch_common::ul_rnti_active(uint32_t tti) {
if ((tti >= ul_rnti_start && ul_rnti_start >= 0 || ul_rnti_start < 0) &&
(tti < ul_rnti_end && ul_rnti_end >= 0 || ul_rnti_end < 0))
if ((((int)tti >= ul_rnti_start && ul_rnti_start >= 0) || ul_rnti_start < 0) &&
(((int)tti < ul_rnti_end && ul_rnti_end >= 0) || ul_rnti_end < 0))
{
return true;
} else {
@ -106,8 +106,8 @@ bool phch_common::ul_rnti_active(uint32_t tti) {
bool phch_common::dl_rnti_active(uint32_t tti) {
Debug("tti=%d, dl_rnti_start=%d, dl_rnti_end=%d, dl_rnti=0x%x\n", tti, dl_rnti_start, dl_rnti_end, dl_rnti);
if (((tti >= dl_rnti_start && dl_rnti_start >= 0) || dl_rnti_start < 0) &&
((tti < dl_rnti_end && dl_rnti_end >= 0) || dl_rnti_end < 0))
if ((((int)tti >= dl_rnti_start && dl_rnti_start >= 0) || dl_rnti_start < 0) &&
(((int)tti < dl_rnti_end && dl_rnti_end >= 0) || dl_rnti_end < 0))
{
bool ret = true;
// FIXME: This scheduling decision belongs to RRC
@ -325,7 +325,7 @@ void phch_common::reset_ul()
{
is_first_tx = true;
is_first_of_burst = true;
for (int i=0;i<nof_mutex;i++) {
for (uint32_t i=0;i<nof_mutex;i++) {
pthread_mutex_trylock(&tx_mutex[i]);
pthread_mutex_unlock(&tx_mutex[i]);
}

View File

@ -63,7 +63,7 @@ void phch_recv::init(srslte::radio_multi* _radio_handler, mac_interface_phy *_ma
cell_is_set = false;
sync_sfn_cnt = 0;
for (int i=0;i<nof_rx_antennas;i++) {
for (uint32_t i=0;i<nof_rx_antennas;i++) {
sf_buffer_sfn[i] = (cf_t*) srslte_vec_malloc(sizeof(cf_t)*3*SRSLTE_SF_LEN_PRB(100));
}
@ -81,7 +81,7 @@ void phch_recv::init(srslte::radio_multi* _radio_handler, mac_interface_phy *_ma
void phch_recv::stop() {
running = false;
wait_thread_finish();
for (int i=0;i<nof_rx_antennas;i++) {
for (uint32_t i=0;i<nof_rx_antennas;i++) {
if (sf_buffer_sfn[i]) {
free(sf_buffer_sfn[i]);
}
@ -156,7 +156,7 @@ bool phch_recv::init_cell() {
// Set options defined in expert section
set_ue_sync_opts(&ue_sync);
for (int i=0;i<workers_pool->get_nof_workers();i++) {
for (uint32_t i=0;i<workers_pool->get_nof_workers();i++) {
if (!((phch_worker*) workers_pool->get_worker(i))->init_cell(cell)) {
Error("Error setting cell: initiating PHCH worker\n");
return false;
@ -180,7 +180,7 @@ bool phch_recv::init_cell() {
void phch_recv::free_cell()
{
if (cell_is_set) {
for (int i=0;i<workers_pool->get_nof_workers();i++) {
for (uint32_t i=0;i<workers_pool->get_nof_workers();i++) {
((phch_worker*) workers_pool->get_worker(i))->free_cell();
}
prach_buffer->free_cell();
@ -402,7 +402,7 @@ void phch_recv::run_thread()
worker = (phch_worker*) workers_pool->wait_worker(tti);
sync_res = 0;
if (worker) {
for (int i=0;i<nof_rx_antennas;i++) {
for (uint32_t i=0;i<nof_rx_antennas;i++) {
buffer[i] = worker->get_buffer(i);
}

View File

@ -93,7 +93,7 @@ bool phch_worker::init_cell(srslte_cell_t cell_)
memcpy(&cell, &cell_, sizeof(srslte_cell_t));
// ue_sync in phy.cc requires a buffer for 3 subframes
for (int i=0;i<phy->args->nof_rx_ant;i++) {
for (uint32_t i=0;i<phy->args->nof_rx_ant;i++) {
signal_buffer[i] = (cf_t*) srslte_vec_malloc(3 * sizeof(cf_t) * SRSLTE_SF_LEN_PRB(cell.nof_prb));
if (!signal_buffer[i]) {
Error("Allocating memory\n");
@ -121,7 +121,7 @@ bool phch_worker::init_cell(srslte_cell_t cell_)
void phch_worker::free_cell()
{
if (cell_initiated) {
for (int i=0;i<phy->args->nof_rx_ant;i++) {
for (uint32_t i=0;i<phy->args->nof_rx_ant;i++) {
if (signal_buffer[i]) {
free(signal_buffer[i]);
}
@ -950,7 +950,7 @@ void phch_worker::start_plot() {
}
int phch_worker::read_ce_abs(float *ce_abs) {
int i=0;
uint32_t i=0;
int sz = srslte_symbol_sz(cell.nof_prb);
bzero(ce_abs, sizeof(float)*sz);
int g = (sz - 12*cell.nof_prb)/2;

View File

@ -118,7 +118,7 @@ bool phy::init(srslte::radio_multi* radio_handler_, mac_interface_phy *mac, rrc_
nof_workers = args->nof_phy_threads;
// Add workers to workers pool and start threads
for (int i=0;i<nof_workers;i++) {
for (uint32_t i=0;i<nof_workers;i++) {
workers[i].set_common(&workers_common);
workers_pool.init_worker(i, &workers[i], WORKERS_THREAD_PRIO, args->worker_cpu_mask);
}
@ -141,14 +141,14 @@ void phy::set_agc_enable(bool enabled)
void phy::start_trace()
{
for (int i=0;i<nof_workers;i++) {
for (uint32_t i=0;i<nof_workers;i++) {
workers[i].start_trace();
}
}
void phy::write_trace(std::string filename)
{
for (int i=0;i<nof_workers;i++) {
for (uint32_t i=0;i<nof_workers;i++) {
string i_str = static_cast<ostringstream*>( &(ostringstream() << i) )->str();
workers[i].write_trace(filename + "_" + i_str);
}
@ -200,7 +200,7 @@ void phy::configure_prach_params()
void phy::configure_ul_params(bool pregen_disabled)
{
Info("PHY: Configuring UL parameters\n");
for (int i=0;i<nof_workers;i++) {
for (uint32_t i=0;i<nof_workers;i++) {
workers[i].set_ul_params(pregen_disabled);
}
}

View File

@ -200,7 +200,7 @@ void process_connsetup(LIBLTE_RRC_CONNECTION_SETUP_STRUCT *msg, srsue::mac *mac,
phy->configure_ul_params();
// Setup radio bearers
for (int i=0;i<msg->rr_cnfg.srb_to_add_mod_list_size;i++) {
for (uint32_t i=0;i<msg->rr_cnfg.srb_to_add_mod_list_size;i++) {
if (msg->rr_cnfg.srb_to_add_mod_list[i].lc_default_cnfg_present) {
printf("Setting up Default Configuration for SRB%d \n", msg->rr_cnfg.srb_to_add_mod_list[i].srb_id);
switch(msg->rr_cnfg.srb_to_add_mod_list[i].srb_id) {
@ -315,7 +315,7 @@ public:
uint8_t *ue_cri_ptr = (uint8_t*) &uecri;
uint32_t nbytes = bit_msg.N_bits/8;
uint8_t *ptr = bit_msg.msg;
for (int i=0;i<nbytes;i++) {
for (uint32_t i=0;i<nbytes;i++) {
ue_cri_ptr[nbytes-i-1] = (uint8_t) srslte_bit_pack(&ptr, 8);
}
printf("Setting UE contention resolution ID: %lu\n", uecri);
@ -370,6 +370,8 @@ public:
connsetup_decoded = true;
break;
case LIBLTE_RRC_DL_CCCH_MSG_TYPE_RRC_CON_REJ:
case LIBLTE_RRC_DL_CCCH_MSG_TYPE_RRC_CON_REEST:
case LIBLTE_RRC_DL_CCCH_MSG_TYPE_RRC_CON_REEST_REJ:
break;
}
} else if (lcid == 1) {

View File

@ -225,7 +225,7 @@ public:
liblte_rrc_si_window_length_num[sib1.si_window_length],
liblte_rrc_si_periodicity_num[sib1.sched_info[0].si_periodicity]);
std::stringstream ss;
for(int i=0;i<sib1.N_plmn_ids;i++){
for(uint32_t i=0;i<sib1.N_plmn_ids;i++){
ss << " PLMN Id: MCC " << sib1.plmn_id[i].id.mcc << " MNC " << sib1.plmn_id[i].id.mnc;
}
log_h->console("SIB1 received, CellID=%d, %s\n",
@ -250,13 +250,13 @@ public:
// Send Msg3
sdu->N_bytes = 10;
for (int i=0;i<sdu->N_bytes;i++) {
for (uint32_t i=0;i<sdu->N_bytes;i++) {
sdu->msg[i] = i+1;
}
uint64_t uecri = 0;
uint8_t *ue_cri_ptr = (uint8_t*) &uecri;
uint32_t nbytes = 6;
for (int i=0;i<nbytes;i++) {
for (uint32_t i=0;i<nbytes;i++) {
ue_cri_ptr[nbytes-i-1] = sdu->msg[i];
}
log_h->info("Setting UE contention resolution ID: %d\n", uecri);
@ -274,7 +274,7 @@ public:
void write_pdu(uint32_t lcid, srslte::byte_buffer_t *sdu)
{
int n=0;
uint32_t n=0;
switch(lcid) {
case LCID:
n = write(tun_fd, sdu->msg, sdu->N_bytes);