diff --git a/lib/examples/pdsch_enodeb.c b/lib/examples/pdsch_enodeb.c index 7445ac8b8..96107fc07 100644 --- a/lib/examples/pdsch_enodeb.c +++ b/lib/examples/pdsch_enodeb.c @@ -800,7 +800,7 @@ int main(int argc, char **argv) { } #endif - if (update_radl(sf_idx)) { + if (update_radl()) { exit(-1); } @@ -879,7 +879,7 @@ int main(int argc, char **argv) { srslte_pcfich_encode(&pcfich, &dl_sf, sf_symbols); /* Update DL resource allocation from control port */ - if (update_control(sf_idx)) { + if (update_control()) { ERROR("Error updating parameters from control port\n"); } diff --git a/lib/examples/usrp_capture_sync.c b/lib/examples/usrp_capture_sync.c index 1aa34686a..cf417e1f8 100644 --- a/lib/examples/usrp_capture_sync.c +++ b/lib/examples/usrp_capture_sync.c @@ -98,11 +98,12 @@ void parse_args(int argc, char **argv) { } } -int srslte_rf_recv_wrapper(void *h, cf_t *data[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t *t) { +int srslte_rf_recv_wrapper(void* h, cf_t* data_[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t* t) +{ DEBUG(" ---- Receive %d samples ---- \n", nsamples); void* ptr[SRSLTE_MAX_PORTS]; for (int i = 0; i < SRSLTE_MAX_PORTS; i++) { - ptr[i] = data[i]; + ptr[i] = data_[i]; } return srslte_rf_recv_with_time_multi(h, ptr, nsamples, true, NULL, NULL); } diff --git a/lib/src/phy/ch_estimation/chest_dl.c b/lib/src/phy/ch_estimation/chest_dl.c index 64edce975..38e73b656 100644 --- a/lib/src/phy/ch_estimation/chest_dl.c +++ b/lib/src/phy/ch_estimation/chest_dl.c @@ -519,7 +519,7 @@ static void average_pilots(srslte_chest_dl_t* q, float* filter, uint32_t filter_len) { - uint32_t nsymbols = (sf->sf_type == SRSLTE_SF_MBSFN) ? srslte_refsignal_mbsfn_nof_symbols(port_id) + uint32_t nsymbols = (sf->sf_type == SRSLTE_SF_MBSFN) ? srslte_refsignal_mbsfn_nof_symbols() : srslte_refsignal_cs_nof_symbols(&q->csr_refs, sf, port_id); uint32_t nref = (sf->sf_type == SRSLTE_SF_MBSFN) ? 6 * q->cell.nof_prb : 2 * q->cell.nof_prb; diff --git a/lib/src/phy/fec/rm_turbo.c b/lib/src/phy/fec/rm_turbo.c index da5e91500..ee2bfd8d1 100644 --- a/lib/src/phy/fec/rm_turbo.c +++ b/lib/src/phy/fec/rm_turbo.c @@ -88,7 +88,8 @@ static uint16_t deinterleaver_sb[NOF_DEINTER_TABLE_SB_IDX][192][4][18448]; static uint16_t temp_table1[3*6176], temp_table2[3*6176]; -static void srslte_rm_turbo_gentable_systematic(uint16_t *table_bits, int k0_vec[4][2], uint32_t nrows, int ndummy) { +static void srslte_rm_turbo_gentable_systematic(uint16_t* table_bits, int k0_vec_[4][2], uint32_t nrows, int ndummy) +{ bool last_is_null=true; int k_b=0, buff_idx=0; @@ -101,10 +102,10 @@ static void srslte_rm_turbo_gentable_systematic(uint16_t *table_bits, int k0_vec } else { last_is_null=true; } - for (int i=0;i<4;i++) { - if (k0_vec[i][1] == -1) { - if (k0_vec[i][0]%(3*nrows*NCOLS) <= buff_idx && !last_is_null) { - k0_vec[i][1] = k_b-1; + for (int k = 0; k < 4; k++) { + if (k0_vec_[k][1] == -1) { + if (k0_vec_[k][0] % (3 * nrows * NCOLS) <= buff_idx && !last_is_null) { + k0_vec_[k][1] = k_b - 1; } } } @@ -113,8 +114,10 @@ static void srslte_rm_turbo_gentable_systematic(uint16_t *table_bits, int k0_vec } } -static void srslte_rm_turbo_gentable_parity(uint16_t *table_parity, int k0_vec[4][2], int offset, uint16_t nrows, int ndummy) { - +static void +srslte_rm_turbo_gentable_parity(uint16_t* table_parity, int k0_vec_[4][2], int offset, uint16_t nrows, int ndummy) +{ + bool last_is_null=true; int k_b=0, buff_idx0=0; int K_p = nrows*NCOLS; @@ -128,10 +131,10 @@ static void srslte_rm_turbo_gentable_parity(uint16_t *table_parity, int k0_vec[4 } else { last_is_null=true; } - for (int i=0;i<4;i++) { - if (k0_vec[i][1] == -1) { - if (k0_vec[i][0]%(3*K_p) <= 2*buff_idx0+K_p && !last_is_null) { - k0_vec[i][1] = offset+k_b-1; + for (int k = 0; k < 4; k++) { + if (k0_vec_[k][1] == -1) { + if (k0_vec_[k][0] % (3 * K_p) <= 2 * buff_idx0 + K_p && !last_is_null) { + k0_vec_[k][1] = offset + k_b - 1; } } } @@ -145,10 +148,10 @@ static void srslte_rm_turbo_gentable_parity(uint16_t *table_parity, int k0_vec[4 } else { last_is_null=true; } - for (int i=0;i<4;i++) { - if (k0_vec[i][1] == -1) { - if (k0_vec[i][0]%(3*K_p) <= 2*buff_idx1+1+K_p && !last_is_null) { - k0_vec[i][1] = offset+k_b-1; + for (int k = 0; k < 4; k++) { + if (k0_vec_[k][1] == -1) { + if (k0_vec_[k][0] % (3 * K_p) <= 2 * buff_idx1 + 1 + K_p && !last_is_null) { + k0_vec_[k][1] = offset + k_b - 1; } } } diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 949d257df..444e08c97 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -416,8 +416,8 @@ private: // RRC constants and timers srslte::timer_handler* timers = nullptr; - uint32_t n310_cnt = 0, N310 = 0; - uint32_t n311_cnt = 0, N311 = 0; + uint32_t n310_cnt, N310 = 0; + uint32_t n311_cnt, N311 = 0; srslte::timer_handler::unique_timer t300, t301, t302, t310, t311, t304; // Radio bearers @@ -469,8 +469,12 @@ private: void delete_last_neighbour(); std::string print_neighbour_cells(); - bool initiated = false; - bool reestablishment_successful = false; + bool initiated = false; + asn1::rrc::reest_cause_e m_reest_cause = asn1::rrc::reest_cause_e::nulltype; + uint16_t m_reest_rnti = 0; + uint16_t m_reest_source_pci = 0; + bool reestablishment_started = false; + bool reestablishment_successful = false; // Measurements sub-class class rrc_meas diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index ffefbdd14..b4cad6b9e 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -3376,7 +3376,7 @@ uint8_t rrc::rrc_meas::value_to_range(quantity_t quant, float value) { case RSRP: if (value < -140) { range = 0; - } else if (-140 <= value && value < -44) { + } else if (value < -44) { range = 1u + (uint8_t)(value + 140); } else { range = 97; @@ -3385,7 +3385,7 @@ uint8_t rrc::rrc_meas::value_to_range(quantity_t quant, float value) { case RSRQ: if (value < -19.5) { range = 0; - } else if (-19.5 <= value && value < -3) { + } else if (value < -3) { range = 1u + (uint8_t)(2 * (value + 19.5)); } else { range = 34;