From f00a75262859be8c2ab659ed9174663573c9323c Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 9 Nov 2017 16:08:18 +0100 Subject: [PATCH] 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();