From f00a75262859be8c2ab659ed9174663573c9323c Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 9 Nov 2017 16:08:18 +0100 Subject: [PATCH 1/2] Fixed bug in PDSCH retx in srsENB --- srsenb/src/mac/scheduler_ue.cc | 47 +++++++++++++++------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/srsenb/src/mac/scheduler_ue.cc b/srsenb/src/mac/scheduler_ue.cc index 94056b990..7a810e2cc 100644 --- a/srsenb/src/mac/scheduler_ue.cc +++ b/srsenb/src/mac/scheduler_ue.cc @@ -25,11 +25,6 @@ */ #include -#include -#include -#include -#include -#include #include "srslte/srslte.h" #include "srslte/common/pdu.h" @@ -395,32 +390,32 @@ int sched_ue::generate_format1(dl_harq_proc *h, mcs = fixed_mcs_dl; } - h->new_tx(tti, mcs, tbs, data->dci_location.ncce); - + h->new_tx(tti, mcs, tbs, data->dci_location.ncce); + + // Allocate MAC ConRes CE + if (need_conres_ce) { + data->pdu[0].lcid = srslte::sch_subh::CON_RES_ID; + data->nof_pdu_elems++; + Info("SCHED: Added MAC Contention Resolution CE for rnti=0x%x\n", rnti); + } + + int rem_tbs = tbs; + int x = 0; + do { + x = alloc_pdu(rem_tbs, &data->pdu[data->nof_pdu_elems]); + rem_tbs -= x; + if (x) { + data->nof_pdu_elems++; + } + } while(rem_tbs > 0 && x > 0); + Debug("SCHED: Alloc format1 new mcs=%d, tbs=%d, nof_prb=%d, req_bytes=%d\n", mcs, tbs, nof_prb, req_bytes); } else { h->new_retx(tti, &mcs, &tbs); Debug("SCHED: Alloc format1 previous mcs=%d, tbs=%d\n", mcs, tbs); } - - // Allocate MAC ConRes CE - if (need_conres_ce) { - data->pdu[0].lcid = srslte::sch_subh::CON_RES_ID; - data->nof_pdu_elems++; - Info("SCHED: Added MAC Contention Resolution CE for rnti=0x%x\n", rnti); - } - - int rem_tbs = tbs; - int x = 0; - do { - x = alloc_pdu(rem_tbs, &data->pdu[data->nof_pdu_elems]); - rem_tbs -= x; - if (x) { - data->nof_pdu_elems++; - } - } while(rem_tbs > 0 && x > 0); - - data->rnti = rnti; + + data->rnti = rnti; if (tbs > 0) { dci->harq_process = h->get_id(); From 84db67860829397137c1a3af3b448d823a2b3bb1 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 9 Nov 2017 16:18:59 +0100 Subject: [PATCH 2/2] Fixed Format1C RV with P-RNTI --- lib/src/phy/phch/ra.c | 11 ++++++----- srsue/src/phy/phch_worker.cc | 5 ++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/src/phy/phch/ra.c b/lib/src/phy/phch/ra.c index 735794e35..17866f5d3 100644 --- a/lib/src/phy/phch/ra.c +++ b/lib/src/phy/phch/ra.c @@ -590,11 +590,12 @@ int srslte_ra_dl_dci_to_grant(srslte_ra_dl_dci_t *dci, ret = dl_dci_to_grant_mcs(dci, grant, crc_is_crnti); if (ret == SRSLTE_SUCCESS) { // Apply Section 7.1.7.3. If RA-RNTI and Format1C rv_idx=0 - if (msg_rnti >= SRSLTE_RARNTI_START && msg_rnti <= SRSLTE_RARNTI_END && - dci->dci_is_1c) - { - dci->rv_idx = 0; - } + if (dci->dci_is_1c) { + if ((msg_rnti >= SRSLTE_RARNTI_START && msg_rnti <= SRSLTE_RARNTI_END) || msg_rnti == SRSLTE_PRNTI) + { + dci->rv_idx = 0; + } + } } else { return SRSLTE_ERROR; } diff --git a/srsue/src/phy/phch_worker.cc b/srsue/src/phy/phch_worker.cc index cf0eab94c..3629424ac 100644 --- a/srsue/src/phy/phch_worker.cc +++ b/srsue/src/phy/phch_worker.cc @@ -535,7 +535,7 @@ int phch_worker::decode_pdsch(srslte_ra_dl_grant_t *grant, uint8_t *payload[SRSL for (uint32_t tb = 0; tb < SRSLTE_MAX_CODEWORDS; tb++) { if (grant->tb_en[tb] && (rv[tb] < 0 || rv[tb] > 3)) { valid_config = false; - Error("Wrong RV (%d) for TB index %d", rv[tb], tb); + Error("Wrong RV (%d) for TB index %d\n", rv[tb], tb); } } @@ -645,6 +645,9 @@ int phch_worker::decode_pdsch(srslte_ra_dl_grant_t *grant, uint8_t *payload[SRSL Error("Error configuring DL grant\n"); ret = SRSLTE_ERROR; } + } else { + Error("Error invalid DL config\n"); + ret = SRSLTE_ERROR; } return ret; }