From 0b00e6d94af339673f96636002a7eb9679b2d175 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 10 Oct 2019 17:33:09 +0200 Subject: [PATCH] SRSUE: fixed CSI and HARQ collision for CA --- lib/src/phy/phch/pdcch.c | 4 +++- lib/src/phy/ue/ue_dl.c | 35 +++++++++++++++++++++++++++++++++++ srsue/src/phy/cc_worker.cc | 2 ++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/lib/src/phy/phch/pdcch.c b/lib/src/phy/phch/pdcch.c index 10d429948..9f7fb1792 100644 --- a/lib/src/phy/phch/pdcch.c +++ b/lib/src/phy/phch/pdcch.c @@ -296,7 +296,9 @@ uint32_t srslte_pdcch_common_locations_ncce(uint32_t nof_cce, srslte_dci_locatio for (l = 3; l > 1; l--) { L = (1 << l); for (i = 0; i < SRSLTE_MIN(nof_cce, 16) / (L); i++) { - uint32_t ncce = (L) * (i % (nof_cce / (L))); + // Simplified expression, derived from: + // L * ((Yk + m) % (N_cce / L)) + i + uint32_t ncce = L * i; if (k < max_candidates && ncce + L <= nof_cce) { c[k].L = l; c[k].ncce = ncce; diff --git a/lib/src/phy/ue/ue_dl.c b/lib/src/phy/ue/ue_dl.c index 59150ae72..e975ca8c6 100644 --- a/lib/src/phy/ue/ue_dl.c +++ b/lib/src/phy/ue/ue_dl.c @@ -957,6 +957,7 @@ static void gen_ack_fdd(srslte_pdsch_ack_t* ack_info, srslte_uci_data_t* uci_dat } else { // By default, in FDD we just pass through all HARQ-ACK bits uint32_t tb_count = 0; + uint32_t tb_count_cc0 = 0; uint32_t n = 0; for (uint32_t cc_idx = 0; cc_idx < ack_info->nof_cc; cc_idx++) { for (uint32_t tb = 0; tb < nof_tb; tb++, n++) { @@ -964,11 +965,45 @@ static void gen_ack_fdd(srslte_pdsch_ack_t* ack_info, srslte_uci_data_t* uci_dat if (ack_info->cc[cc_idx].m[0].present && ack_info->cc[cc_idx].m[0].value[tb] != 2) { tb_count++; } + + // Save primary cell number of TB + if (cc_idx == 0) { + tb_count_cc0 = tb_count; + } } } if (ack_info->nof_cc == 1) { // If only 1 configured cell, report 1 or 2 bits depending on number of detected TB uci_data->cfg.ack[0].nof_acks = tb_count; + } else if (uci_data->cfg.cqi.data_enable && !ack_info->is_pusch_available) { + // 3GPP 36.213 R.15 Section 10.1.1: + // For FDD or for FDD-TDD and primary cell frame structure type 1 and for a UE that is configured with more than + // one serving cell, in case of collision between a periodic CSI report and an HARQ-ACK in a same subframe without + // PUSCH, + if (tb_count_cc0 == tb_count && ack_info->simul_cqi_ack) { + // - if the parameter simultaneousAckNackAndCQI provided by higher layers is set TRUE and if the HARQ-ACK + // corresponds to a PDSCH transmission or PDCCH/EPDCCH indicating downlink SPS release only on the + // primary cell, then the periodic CSI report is multiplexed with HARQ-ACK on PUCCH using PUCCH format 2/2a/2b + uci_data->cfg.ack[0].nof_acks = tb_count_cc0; +#if 0 + } else if (ack_info->simul_cqi_ack_pucch3 && + tb_count + srslte_cqi_size(&uci_data->cfg.cqi) + uci_data->value.scheduling_request ? 1 : 0 <= 22) { + // - else if the UE is configured with PUCCH format 3 and if the parameter simultaneousAckNackAndCQI-Format3- + // r11 provided by higher layers is set TRUE, and if PUCCH resource is determined according to subclause + // 10.1.2.2.2, and + // - if the total number of bits in the subframe corresponding to HARQ-ACKs, SR (if any), and the CSI is not + // larger than 22 or + // - if the total number of bits in the subframe corresponding to spatially bundled HARQ-ACKs, SR (if any), and + // the CSI is not larger than 22 then the periodic CSI report is multiplexed with HARQ-ACK on PUCCH using + // the determined PUCCH format 3 resource according to [4] + for (int i = 0; i < ack_info->nof_cc; i++) { + uci_data->cfg.ack[i].nof_acks = (tb_count != 0) ? nof_tb : 0; + } +#endif + } else { + // - otherwise, CSI is dropped + uci_data->cfg.cqi.data_enable = false; + } } else { // For 2 or more configured cells, report nof_tb per carrier except if there are no HARQ-ACK bits to report, in // which case we set to 0 diff --git a/srsue/src/phy/cc_worker.cc b/srsue/src/phy/cc_worker.cc index f780addf4..2687e72d2 100644 --- a/srsue/src/phy/cc_worker.cc +++ b/srsue/src/phy/cc_worker.cc @@ -634,6 +634,8 @@ bool cc_worker::work_ul(srslte_uci_data_t* uci_data) } else { /* Check PCell and enabled secondary cells */ if (cc_idx == 0 || phy->scell_cfg[cc_idx].enabled) { + // 3GPP 36.213 Section 7.2 + // If the UE is configured with more than one serving cell, it transmits CSI for activated serving cell(s) only. set_uci_periodic_cqi(uci_data); } }