diff --git a/lib/src/phy/enb/enb_dl.c b/lib/src/phy/enb/enb_dl.c index c03e8af3d..593f412e5 100644 --- a/lib/src/phy/enb/enb_dl.c +++ b/lib/src/phy/enb/enb_dl.c @@ -513,12 +513,10 @@ static void enb_dl_get_ack_fdd_all_spatial_bundling(const srslte_uci_value_t* uc { for (uint32_t cc_idx = 0; cc_idx < pdsch_ack->nof_cc; cc_idx++) { if (pdsch_ack->cc[cc_idx].m[0].present) { - if (uci_value->ack.ack_value[cc_idx] == 1) { - for (uint32_t tb = 0; tb < nof_tb; tb++) { - // Check that TB was transmitted - if (pdsch_ack->cc[cc_idx].m[0].value[tb] != 2) { - pdsch_ack->cc[cc_idx].m[0].value[tb] = uci_value->ack.ack_value[cc_idx]; - } + for (uint32_t tb = 0; tb < nof_tb; tb++) { + // Check that TB was transmitted + if (pdsch_ack->cc[cc_idx].m[0].value[tb] != 2) { + pdsch_ack->cc[cc_idx].m[0].value[tb] = uci_value->ack.ack_value[cc_idx]; } } } @@ -528,13 +526,12 @@ static void enb_dl_get_ack_fdd_all_spatial_bundling(const srslte_uci_value_t* uc static void enb_dl_get_ack_fdd_pcell_skip_drx(const srslte_uci_value_t* uci_value, srslte_pdsch_ack_t* pdsch_ack, uint32_t nof_tb) { + uint32_t ack_idx = 0; if (pdsch_ack->cc[0].m[0].present) { - if (uci_value->ack.ack_value[0] == 1) { - for (uint32_t tb = 0; tb < nof_tb; tb++) { - // Check that TB was transmitted - if (pdsch_ack->cc[0].m[0].value[tb] != 2) { - pdsch_ack->cc[0].m[0].value[tb] = uci_value->ack.ack_value[0]; - } + for (uint32_t tb = 0; tb < nof_tb; tb++) { + // Check that TB was transmitted + if (pdsch_ack->cc[0].m[0].value[tb] != 2) { + pdsch_ack->cc[0].m[0].value[tb] = uci_value->ack.ack_value[ack_idx++]; } } } @@ -545,12 +542,10 @@ enb_dl_get_ack_fdd_all_keep_drx(const srslte_uci_value_t* uci_value, srslte_pdsc { for (uint32_t cc_idx = 0; cc_idx < pdsch_ack->nof_cc; cc_idx++) { if (pdsch_ack->cc[cc_idx].m[0].present) { - if (uci_value->ack.ack_value[cc_idx] == 1) { - for (uint32_t tb = 0; tb < nof_tb; tb++) { - // Check that TB was transmitted - if (pdsch_ack->cc[cc_idx].m[0].value[tb] != 2) { - pdsch_ack->cc[cc_idx].m[0].value[tb] = uci_value->ack.ack_value[cc_idx * nof_tb + tb]; - } + for (uint32_t tb = 0; tb < nof_tb; tb++) { + // Check that TB was transmitted + if (pdsch_ack->cc[cc_idx].m[0].value[tb] != 2) { + pdsch_ack->cc[cc_idx].m[0].value[tb] = uci_value->ack.ack_value[cc_idx * nof_tb + tb]; } } } diff --git a/lib/src/phy/enb/enb_ul.c b/lib/src/phy/enb/enb_ul.c index 77779b227..40ba4a8ba 100644 --- a/lib/src/phy/enb/enb_ul.c +++ b/lib/src/phy/enb/enb_ul.c @@ -217,7 +217,8 @@ static int get_pucch(srslte_enb_ul_t* q, srslte_ul_sf_cfg_t* ul_sf, srslte_pucch // Get PUCCH Format 1b with channel selection if used if (uci_cfg_total_ack > 0 && cfg->format == SRSLTE_PUCCH_FORMAT_1B && - cfg->ack_nack_feedback_mode == SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_CS) { + cfg->ack_nack_feedback_mode == SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_CS && + !cfg->uci_cfg.is_scheduling_request_tti) { uint8_t b[2] = {pucch_res.uci_data.ack.ack_value[0], pucch_res.uci_data.ack.ack_value[1]}; srslte_pucch_cs_get_ack(cfg, &cfg->uci_cfg, i, b, &pucch_res.uci_data); } diff --git a/srsenb/test/phy/enb_phy_test.cc b/srsenb/test/phy/enb_phy_test.cc index 60af5898c..af8005e74 100644 --- a/srsenb/test/phy/enb_phy_test.cc +++ b/srsenb/test/phy/enb_phy_test.cc @@ -32,6 +32,11 @@ #include #include +static inline bool dl_ack_value(uint32_t ue_cc_idx, uint32_t tti) +{ + return (tti % SRSLTE_MAX_CARRIERS) != ue_cc_idx; +} + #define CALLBACK(NAME) \ private: \ bool received_##NAME = false; \ @@ -494,7 +499,7 @@ public: dl_sched_res[0].cfi = cfi; // Iterate for each carrier - uint32_t scell_idx = 0; + uint32_t ue_cc_idx = 0; for (uint32_t& cc_idx : active_cell_list) { auto& dl_sched = dl_sched_res[cc_idx]; @@ -507,7 +512,7 @@ public: sched_tb[0] = srslte_random_bool(random_gen, prob_dl_grant); // Schedule second TB for TM3 or TM4 - if (phy_rrc[scell_idx].phy_cfg.dl_cfg.tm == SRSLTE_TM3 or phy_rrc[scell_idx].phy_cfg.dl_cfg.tm == SRSLTE_TM4) { + if (phy_rrc[ue_cc_idx].phy_cfg.dl_cfg.tm == SRSLTE_TM3 or phy_rrc[ue_cc_idx].phy_cfg.dl_cfg.tm == SRSLTE_TM4) { sched_tb[1] = srslte_random_bool(random_gen, prob_dl_grant); } @@ -556,7 +561,7 @@ public: tti_dl_info.tti = tti; tti_dl_info.cc_idx = cc_idx; tti_dl_info.tb_idx = 0; - tti_dl_info.ack = true; + tti_dl_info.ack = dl_ack_value(ue_cc_idx, tti); // Schedule TB uint32_t cw_count = 0; @@ -585,7 +590,7 @@ public: dl_sched.nof_grants = 0; } - scell_idx++; + ue_cc_idx++; } return 0; @@ -900,12 +905,12 @@ public: TESTASSERT(radio->read_tx(buffers, sf_len) >= SRSLTE_SUCCESS); // Get grants DL/UL, we do not care about Decoding PDSCH - for (uint32_t i = 0; i < phy_rrc_cfg.size(); i++) { - uint32_t cc_idx = phy_rrc_cfg[i].enb_cc_idx; - srslte::phy_cfg_t& dedicated = phy_rrc_cfg[i].phy_cfg; + for (uint32_t ue_cc_idx = 0; ue_cc_idx < phy_rrc_cfg.size(); ue_cc_idx++) { + uint32_t cc_idx = phy_rrc_cfg[ue_cc_idx].enb_cc_idx; + srslte::phy_cfg_t& dedicated = phy_rrc_cfg[ue_cc_idx].phy_cfg; /// Set UCI configuration from PCell only - if (i == 0) { + if (ue_cc_idx == 0) { uci_data.cfg = dedicated.ul_cfg.pucch.uci_cfg; pdsch_ack.ack_nack_feedback_mode = dedicated.ul_cfg.pucch.ack_nack_feedback_mode; @@ -921,8 +926,8 @@ public: ue_dl_cfg.cfg.pdsch.rnti = rnti; int report_ri_cc_idx = -1; - if (last_ri.count(i)) { - ue_dl_cfg.last_ri = last_ri[i]; + if (last_ri.count(ue_cc_idx)) { + ue_dl_cfg.last_ri = last_ri[ue_cc_idx]; } srslte_ue_dl_decode_fft_estimate(ue_dl_v[cc_idx], &sf_dl_cfg, &ue_dl_cfg); @@ -945,25 +950,25 @@ public: srslte_pdsch_tx_info(&ue_dl_cfg.cfg.pdsch, str, 512); - log_h.info("[DL PDSCH %d] cc=%d, %s\n", i, cc_idx, str); + log_h.info("[DL PDSCH %d] cc=%d, %s\n", sf_dl_cfg.tti, cc_idx, str); - pdsch_ack.cc[i].M = 1; - pdsch_ack.cc[i].m[0].present = true; - pdsch_ack.cc[i].m[0].resource.v_dai_dl = dci_dl->dai; - pdsch_ack.cc[i].m[0].resource.n_cce = dci_dl->location.ncce; - pdsch_ack.cc[i].m[0].resource.grant_cc_idx = i; - pdsch_ack.cc[i].m[0].resource.tpc_for_pucch = dci_dl->tpc_pucch; + pdsch_ack.cc[ue_cc_idx].M = 1; + pdsch_ack.cc[ue_cc_idx].m[0].present = true; + pdsch_ack.cc[ue_cc_idx].m[0].resource.v_dai_dl = dci_dl->dai; + pdsch_ack.cc[ue_cc_idx].m[0].resource.n_cce = dci_dl->location.ncce; + pdsch_ack.cc[ue_cc_idx].m[0].resource.grant_cc_idx = ue_cc_idx; + pdsch_ack.cc[ue_cc_idx].m[0].resource.tpc_for_pucch = dci_dl->tpc_pucch; for (uint32_t tb_idx = 0; tb_idx < SRSLTE_MAX_TB; tb_idx++) { if (ue_dl_cfg.cfg.pdsch.grant.tb[tb_idx].enabled) { - pdsch_ack.cc[i].m[0].value[tb_idx] = 1; + pdsch_ack.cc[ue_cc_idx].m[0].value[tb_idx] = dl_ack_value(ue_cc_idx, sf_dl_cfg.tti); } else { - pdsch_ack.cc[i].m[0].value[tb_idx] = 2; + pdsch_ack.cc[ue_cc_idx].m[0].value[tb_idx] = 2; } } } else { - pdsch_ack.cc[i].M = 1; - pdsch_ack.cc[i].m[0].present = false; + pdsch_ack.cc[ue_cc_idx].M = 1; + pdsch_ack.cc[ue_cc_idx].m[0].present = false; } // Generate CQI periodic if required @@ -971,7 +976,7 @@ public: if (srslte_cqi_periodic_ri_send(&ue_dl_cfg.cfg.cqi_report, sf_ul_cfg.tti, ue_dl_v[cc_idx]->cell.frame_type) && uci_data.cfg.cqi.ri_len) { - uci_data.cfg.cqi.scell_index = i; + uci_data.cfg.cqi.scell_index = ue_cc_idx; } } @@ -1276,8 +1281,6 @@ public: { int ret = SRSLTE_SUCCESS; - stack->tti_clock(); - // If no assertion enabled, clear radio link failure to avoid errors in cell transitions if (change_state != change_state_assert) { stack->clear_rl_failure();