From 8cb3945886051dc95fbdd023a92366c7ccfdf3bf Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Fri, 4 Sep 2020 14:13:57 +0200 Subject: [PATCH] SRSUE: fix RV assertion for PUSCH --- lib/src/phy/phch/pusch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/phy/phch/pusch.c b/lib/src/phy/phch/pusch.c index 26b85bbb9..a59c6fd6a 100644 --- a/lib/src/phy/phch/pusch.c +++ b/lib/src/phy/phch/pusch.c @@ -342,14 +342,17 @@ static srslte_sequence_t* get_user_sequence(srslte_pusch_t* q, uint16_t rnti, ui int srslte_pusch_assert_grant(const srslte_pusch_grant_t* grant) { + // Check for valid number of PRB if (!srslte_dft_precoding_valid_prb(grant->L_prb)) { return SRSLTE_ERROR_INVALID_INPUTS; } - if (grant->tb.rv < 0 || grant->tb.rv > 3) { + // Check RV limits, -1 is for RAR, 0-3 normal HARQ + if (grant->tb.rv < -1 || grant->tb.rv > 3) { return SRSLTE_ERROR_OUT_OF_BOUNDS; } + // Check for positive TBS if (grant->tb.tbs < 0) { return SRSLTE_ERROR_OUT_OF_BOUNDS; }