From a180b5ebacfdfa8f90add5f764608ee57be3a8fd Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 10 Oct 2017 12:06:24 +0200 Subject: [PATCH] Msg3 delay is added to harq delay --- lib/include/srslte/common/common.h | 2 +- srsenb/src/mac/scheduler.cc | 2 +- srsue/src/phy/phch_common.cc | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/include/srslte/common/common.h b/lib/include/srslte/common/common.h index fd785fbca..6372af73e 100644 --- a/lib/include/srslte/common/common.h +++ b/lib/include/srslte/common/common.h @@ -45,7 +45,7 @@ #define SRSLTE_N_RADIO_BEARERS 11 #define HARQ_DELAY_MS 4 -#define MSG3_DELAY_MS 6 +#define MSG3_DELAY_MS 2 // Delay added to HARQ_DELAY_MS #define TTI_TX(tti) ((tti+HARQ_DELAY_MS)%10240) #define TTI_RX_ACK(tti) ((tti+(2*HARQ_DELAY_MS))%10240) diff --git a/srsenb/src/mac/scheduler.cc b/srsenb/src/mac/scheduler.cc index 21d60652d..a7e3d12d6 100644 --- a/srsenb/src/mac/scheduler.cc +++ b/srsenb/src/mac/scheduler.cc @@ -541,7 +541,7 @@ int sched::dl_sched_rar(dl_sched_rar_t rar[MAX_RAR_LIST]) pending_rar[j].rar_tti = 0; // Save UL resources - uint32_t pending_tti=(current_tti+MSG3_DELAY_MS)%10; + uint32_t pending_tti=(current_tti+MSG3_DELAY_MS+HARQ_DELAY_MS)%10; pending_msg3[pending_tti].enabled = true; pending_msg3[pending_tti].rnti = pending_rar[j].rnti; pending_msg3[pending_tti].L = L_prb; diff --git a/srsue/src/phy/phch_common.cc b/srsue/src/phy/phch_common.cc index 549783fd9..7d2948c1a 100644 --- a/srsue/src/phy/phch_common.cc +++ b/srsue/src/phy/phch_common.cc @@ -137,15 +137,13 @@ void phch_common::set_rar_grant(uint32_t tti, uint8_t grant_payload[SRSLTE_RAR_G { srslte_dci_rar_grant_unpack(&rar_grant, grant_payload); rar_grant_pending = true; - int delay = MSG3_DELAY_MS-HARQ_DELAY_MS; - if (delay < 0) { - fprintf(stderr, "Error MSG3_DELAY_MS can't be lower than HARQ_DELAY_MS\n"); - delay = 0; + if (MSG3_DELAY_MS < 0) { + fprintf(stderr, "Error MSG3_DELAY_MS can't be negative\n"); } if (rar_grant.ul_delay) { - rar_grant_tti = (tti + delay + 1) % 10240; + rar_grant_tti = (tti + MSG3_DELAY_MS + 1) % 10240; } else { - rar_grant_tti = (tti + delay) % 10240; + rar_grant_tti = (tti + MSG3_DELAY_MS) % 10240; } }