From 4b00908abb9bd65484cdc44aa9de74cf8a734852 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 6 Sep 2017 14:45:34 +0200 Subject: [PATCH] Removed bug in dl_harq for multiple TB --- srsue/hdr/mac/dl_harq.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/srsue/hdr/mac/dl_harq.h b/srsue/hdr/mac/dl_harq.h index d79c230f5..e897ac76f 100644 --- a/srsue/hdr/mac/dl_harq.h +++ b/srsue/hdr/mac/dl_harq.h @@ -166,8 +166,17 @@ private: } void new_grant_dl(Tgrant grant, Taction *action) { - for (uint32_t tb = 0; tb < grant.phy_grant.dl.nof_tb; tb++) { - subproc[tb].new_grant_dl(grant, action); + /* Fill action structure */ + bzero(action, sizeof(Taction)); + action->default_ack = false; + action->generate_ack = true; + action->decode_enabled = false; + + /* For each subprocess... */ + for (uint32_t tb = 0; tb < SRSLTE_MAX_TB; tb++) { + if (grant.tb_en[tb]) { + subproc[tb].new_grant_dl(grant, action); + } } } @@ -241,12 +250,6 @@ private: grant.last_tti = cur_grant.tti; memcpy(&cur_grant, &grant, sizeof(Tgrant)); - // Fill action structure - bzero(action, sizeof(Taction)); - action->default_ack = ack; - action->generate_ack = true; - action->decode_enabled = false; - // If data has not yet been successfully decoded if (!ack) { @@ -268,6 +271,7 @@ private: } else { Warning("DL PID %d: Received duplicate TB. Discarting and retransmitting ACK\n", pid); + action->phy_grant.dl.tb_en[tid] = false; } if (pid == HARQ_BCCH_PID || harq_entity->timers_db->get(TIME_ALIGNMENT)->is_expired()) {