From 344ace8f52289c50caf61459cb5ff6ddec891fe4 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Sun, 12 Nov 2017 11:43:56 +0100 Subject: [PATCH 1/2] Fix issue #120 --- lib/src/phy/phch/ra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/phy/phch/ra.c b/lib/src/phy/phch/ra.c index be10c304c..19b78c60a 100644 --- a/lib/src/phy/phch/ra.c +++ b/lib/src/phy/phch/ra.c @@ -663,7 +663,7 @@ uint32_t srslte_ra_type1_N_rb(uint32_t nof_prb) { /* Convert Type2 scheduling L_crb and RB_start to RIV value */ uint32_t srslte_ra_type2_to_riv(uint32_t L_crb, uint32_t RB_start, uint32_t nof_prb) { uint32_t riv; - if (L_crb <= nof_prb / 2) { + if ((L_crb - 1) <= nof_prb / 2) { riv = nof_prb * (L_crb - 1) + RB_start; } else { riv = nof_prb * (nof_prb - L_crb + 1) + nof_prb - 1 - RB_start; @@ -907,4 +907,4 @@ void srslte_ra_prb_fprint(FILE *f, srslte_ra_dl_grant_t *grant) { } } -} \ No newline at end of file +} From dff5a6f628a46ce3df2b2be35235413320061c75 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 13 Dec 2017 18:26:26 +0100 Subject: [PATCH 2/2] Initialize variables in rrc/enb. Fixes #122 --- srsenb/hdr/upper/rrc.h | 2 +- srsenb/src/upper/rrc.cc | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/srsenb/hdr/upper/rrc.h b/srsenb/hdr/upper/rrc.h index e0b9dd158..f30b91794 100644 --- a/srsenb/hdr/upper/rrc.h +++ b/srsenb/hdr/upper/rrc.h @@ -264,7 +264,7 @@ public: uint32_t cqi_idx; bool cqi_allocated; int cqi_sched_sf_idx; - bool cqi_sched_prb_idx; + int cqi_sched_prb_idx; int get_drbid_config(LIBLTE_RRC_DRB_TO_ADD_MOD_STRUCT *drb, int drbid); }; diff --git a/srsenb/src/upper/rrc.cc b/srsenb/src/upper/rrc.cc index e176e8ac5..9c0422357 100644 --- a/srsenb/src/upper/rrc.cc +++ b/srsenb/src/upper/rrc.cc @@ -699,10 +699,19 @@ rrc::ue::ue() { parent = NULL; set_activity(); - sr_allocated = false; has_tmsi = false; connect_notified = false; transaction_id = 0; + sr_allocated = false; + sr_sched_sf_idx = 0; + sr_sched_prb_idx = 0; + sr_N_pucch = 0; + sr_I = 0; + cqi_allocated = false; + cqi_pucch = 0; + cqi_idx = 0; + cqi_sched_sf_idx = 0; + cqi_sched_prb_idx = 0; state = RRC_STATE_IDLE; }