From ca2fddc5110980f8d70557e51041381e91a93663 Mon Sep 17 00:00:00 2001 From: ismagom Date: Thu, 2 Jul 2015 17:42:53 +0200 Subject: [PATCH] Fixed bug transmitting SR with HARQ --- srsapps/ue/phy/src/ul_buffer.cc | 2 +- srslte/lib/ue/src/ue_ul.c | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/srsapps/ue/phy/src/ul_buffer.cc b/srsapps/ue/phy/src/ul_buffer.cc index 34a4e70d7..0745ea629 100644 --- a/srsapps/ue/phy/src/ul_buffer.cc +++ b/srsapps/ue/phy/src/ul_buffer.cc @@ -256,7 +256,7 @@ bool ul_buffer::generate_data(ul_sched_grant *grant, srslte_softbuffer_tx_t *sof } else if (uci_data.scheduling_request || uci_data.uci_cqi_len > 0 || uci_data.uci_ack_len) { - n = srslte_ue_ul_pucch_encode(&ue_ul, uci_data, tti%10, signal_buffer); + n = srslte_ue_ul_pucch_encode(&ue_ul, uci_data, tti, signal_buffer); Info("PUCCH: TTI=%d, CFO= %.1f KHz n_cce=%d, ack=%s, sr=%s, shortened=%s\n", tti, cfo*15e3, last_n_cce, uci_data.uci_ack_len>0?(uci_data.uci_ack?"1":"0"):"no",uci_data.scheduling_request?"yes":"no", diff --git a/srslte/lib/ue/src/ue_ul.c b/srslte/lib/ue/src/ue_ul.c index 21a7e97d4..b9192e312 100644 --- a/srslte/lib/ue/src/ue_ul.c +++ b/srslte/lib/ue/src/ue_ul.c @@ -208,24 +208,18 @@ int srslte_ue_ul_pucch_encode(srslte_ue_ul_t *q, srslte_uci_data_t uci_data, bzero(pucch_bits, SRSLTE_PUCCH_MAX_BITS*sizeof(uint8_t)); bzero(pucch2_bits, 2*sizeof(uint8_t)); - // 1-bit ACK + SR + // 1-bit ACK + optional SR if (uci_data.uci_ack_len == 1) { format = SRSLTE_PUCCH_FORMAT_1A; pucch_bits[0] = uci_data.uci_ack; } - // 2-bit ACK + SR - else if (uci_data.uci_ack_len == 2 && uci_data.scheduling_request) { + // 2-bit ACK + optional SR + else if (uci_data.uci_ack_len == 2) { format = SRSLTE_PUCCH_FORMAT_1B; pucch_bits[0] = uci_data.uci_ack; pucch_bits[1] = uci_data.uci_ack_2; } - // 2-bit ACK with channel selection - else if (uci_data.uci_ack_len == 2 && uci_data.channel_selection) { - format = SRSLTE_PUCCH_FORMAT_1B; - pucch_bits[0] = uci_data.uci_ack; - pucch_bits[1] = uci_data.uci_ack_2; - } - // scheduling_request + // SR only else if (uci_data.scheduling_request) { format = SRSLTE_PUCCH_FORMAT_1; } @@ -260,7 +254,7 @@ int srslte_ue_ul_pucch_encode(srslte_ue_ul_t *q, srslte_uci_data_t uci_data, // Choose n_pucch uint32_t n_pucch = 0; - if (format == SRSLTE_PUCCH_FORMAT_1) { + if (uci_data.scheduling_request) { n_pucch = q->pucch_sched.n_pucch_sr; } else if (format < SRSLTE_PUCCH_FORMAT_2) { if (q->pucch_sched.sps_enabled) {