From 0ba58d8d2445e723799c899c2c9779701266c14b Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Fri, 19 Jan 2018 16:31:13 +0100 Subject: [PATCH] Fixed PUSCH retransmissions for non-RRC configured rnti --- lib/include/srslte/common/pdu.h | 2 +- lib/src/common/pdu.cc | 2 +- srsenb/src/mac/ue.cc | 2 +- srsenb/src/phy/phch_common.cc | 12 +++++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/include/srslte/common/pdu.h b/lib/include/srslte/common/pdu.h index c3eb68ca7..5d37a0d63 100644 --- a/lib/include/srslte/common/pdu.h +++ b/lib/include/srslte/common/pdu.h @@ -224,7 +224,7 @@ public: bool read_subheader(uint8_t** ptr); void read_payload(uint8_t **ptr); uint32_t get_sdu_lcid(); - uint32_t get_payload_size(); + int get_payload_size(); uint32_t get_header_size(bool is_last); uint8_t* get_sdu_ptr(); diff --git a/lib/src/common/pdu.cc b/lib/src/common/pdu.cc index b8d17d984..69c19518c 100644 --- a/lib/src/common/pdu.cc +++ b/lib/src/common/pdu.cc @@ -458,7 +458,7 @@ uint32_t sch_subh::get_sdu_lcid() { return lcid; } -uint32_t sch_subh::get_payload_size() +int sch_subh::get_payload_size() { return nof_bytes; } diff --git a/srsenb/src/mac/ue.cc b/srsenb/src/mac/ue.cc index b50f8a325..a10886163 100644 --- a/srsenb/src/mac/ue.cc +++ b/srsenb/src/mac/ue.cc @@ -171,7 +171,7 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, uint32_t tstamp) if (mac_msg_ul.get()->get_sdu_lcid() == 0) { uint8_t *x = mac_msg_ul.get()->get_sdu_ptr(); uint32_t sum = 0; - for (uint32_t i = 0; i < mac_msg_ul.get()->get_payload_size(); i++) { + for (int i = 0; i < mac_msg_ul.get()->get_payload_size(); i++) { sum += x[i]; } if (sum == 0) { diff --git a/srsenb/src/phy/phch_common.cc b/srsenb/src/phy/phch_common.cc index 8a428d909..99bfc3d29 100644 --- a/srsenb/src/phy/phch_common.cc +++ b/srsenb/src/phy/phch_common.cc @@ -152,9 +152,10 @@ uint8_t phch_common::ue_db_get_ri(uint16_t rnti) { return ret; } void phch_common::ue_db_set_last_ul_mod(uint16_t rnti, uint32_t tti, srslte_mod_t mcs) { - if (common_ue_db.count(rnti)) { - common_ue_db[rnti].last_ul_mod[TTI_RX(tti)%(2*HARQ_DELAY_MS)] = mcs; + if (!common_ue_db.count(rnti)) { + ue_db_add_rnti(rnti); } + common_ue_db[rnti].last_ul_mod[TTI_RX(tti)%(2*HARQ_DELAY_MS)] = mcs; } srslte_mod_t phch_common::ue_db_get_last_ul_mod(uint16_t rnti, uint32_t tti) { srslte_mod_t ret = SRSLTE_MOD_BPSK; @@ -164,12 +165,13 @@ srslte_mod_t phch_common::ue_db_get_last_ul_mod(uint16_t rnti, uint32_t tti) { return ret; } void phch_common::ue_db_set_last_ul_tbs(uint16_t rnti, uint32_t tti, int tbs) { - if (common_ue_db.count(rnti)) { - common_ue_db[rnti].last_ul_tbs[TTI_RX(tti)%(2*HARQ_DELAY_MS)] = tbs; + if (!common_ue_db.count(rnti)) { + ue_db_add_rnti(rnti); } + common_ue_db[rnti].last_ul_tbs[TTI_RX(tti)%(2*HARQ_DELAY_MS)] = tbs; } int phch_common::ue_db_get_last_ul_tbs(uint16_t rnti, uint32_t tti) { - int ret = 0; + int ret = -1; if (common_ue_db.count(rnti)) { ret = common_ue_db[rnti].last_ul_tbs[TTI_RX(tti)%(2*HARQ_DELAY_MS)]; }