From b9583d4182f707e9bef1ab7344677148c2174fe0 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 23 Apr 2020 18:43:52 +0200 Subject: [PATCH] Fix Extended CSI request bits in DCI --- lib/include/srslte/interfaces/enb_interfaces.h | 2 -- lib/src/phy/phch/dci.c | 12 +++++++++++- srsenb/src/phy/cc_worker.cc | 6 ++++-- srsenb/src/phy/phy_ue_db.cc | 13 +++++++++++++ srsenb/test/phy/enb_phy_test.cc | 5 +++++ 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index c19665035..2d899523f 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -48,7 +48,6 @@ public: */ typedef struct { srslte_dci_dl_t dci; - srslte_dci_cfg_t dci_cfg; uint8_t* data[SRSLTE_MAX_TB]; srslte_softbuffer_tx_t* softbuffer_tx[SRSLTE_MAX_TB]; } dl_sched_grant_t; @@ -77,7 +76,6 @@ public: */ typedef struct { srslte_dci_ul_t dci; - srslte_dci_cfg_t dci_cfg; uint32_t current_tx_nb; uint8_t* data; bool needs_pdcch; diff --git a/lib/src/phy/phch/dci.c b/lib/src/phy/phch/dci.c index c39df14a8..a6440c3a2 100644 --- a/lib/src/phy/phch/dci.c +++ b/lib/src/phy/phch/dci.c @@ -461,7 +461,17 @@ static int dci_format0_pack(srslte_cell_t* cell, srslte_bit_unpack(dci->n_dmrs, &y, 3); // CQI request - *y++ = dci->cqi_request; + if (cfg->multiple_csi_request_enabled) { + *y++ = dci->cqi_request; + *y++ = 0; + } else { + *y++ = dci->cqi_request; + } + + // SRS request + if (cfg->srs_request_enabled) { + *y++ = dci->srs_request && dci->srs_request_present; + } // Padding with zeros uint32_t n = srslte_dci_format_sizeof(cell, sf, cfg, SRSLTE_DCI_FORMAT0); diff --git a/srsenb/src/phy/cc_worker.cc b/srsenb/src/phy/cc_worker.cc index 967afe3b4..7114e1f28 100644 --- a/srsenb/src/phy/cc_worker.cc +++ b/srsenb/src/phy/cc_worker.cc @@ -432,7 +432,8 @@ int cc_worker::encode_pdcch_ul(stack_interface_phy_lte::ul_sched_grant_t* grants { for (uint32_t i = 0; i < nof_grants; i++) { if (grants[i].needs_pdcch) { - if (srslte_enb_dl_put_pdcch_ul(&enb_dl, &grants[i].dci_cfg, &grants[i].dci)) { + srslte_dci_cfg_t dci_cfg = phy->ue_db.get_config(grants[i].dci.rnti, cc_idx).dl_cfg.dci; + if (srslte_enb_dl_put_pdcch_ul(&enb_dl, &dci_cfg, &grants[i].dci)) { ERROR("Error putting PUSCH %d\n", i); return SRSLTE_ERROR; } @@ -453,7 +454,8 @@ int cc_worker::encode_pdcch_dl(stack_interface_phy_lte::dl_sched_grant_t* grants for (uint32_t i = 0; i < nof_grants; i++) { uint16_t rnti = grants[i].dci.rnti; if (rnti) { - if (srslte_enb_dl_put_pdcch_dl(&enb_dl, &grants[i].dci_cfg, &grants[i].dci)) { + srslte_dci_cfg_t dci_cfg = phy->ue_db.get_config(rnti, cc_idx).dl_cfg.dci; + if (srslte_enb_dl_put_pdcch_dl(&enb_dl, &dci_cfg, &grants[i].dci)) { ERROR("Error putting PDCCH %d\n", i); return SRSLTE_ERROR; } diff --git a/srsenb/src/phy/phy_ue_db.cc b/srsenb/src/phy/phy_ue_db.cc index d5e0d8658..9f2f3c9a5 100644 --- a/srsenb/src/phy/phy_ue_db.cc +++ b/srsenb/src/phy/phy_ue_db.cc @@ -255,6 +255,9 @@ void phy_ue_db::addmod_rnti(uint16_t // Get UE by reference common_ue& ue = ue_db[rnti]; + // Number of configured serving cells + uint32_t nof_configured_scell = 0; + // Iterate PHY RRC configuration for each UE cell/carrier for (uint32_t ue_cc_idx = 0; ue_cc_idx < phy_rrc_dedicated_list.size() && ue_cc_idx < SRSLTE_MAX_CARRIERS; ue_cc_idx++) { @@ -274,6 +277,9 @@ void phy_ue_db::addmod_rnti(uint16_t if (cell_info.state != cell_state_primary) { cell_info.state = cell_state_secondary_inactive; } + + // Count Serving cell + nof_configured_scell++; } else { // Cell without configuration (except PCell) cell_info.state = cell_state_none; @@ -284,6 +290,13 @@ void phy_ue_db::addmod_rnti(uint16_t for (uint32_t cell_idx = phy_rrc_dedicated_list.size(); cell_idx < SRSLTE_MAX_CARRIERS; cell_idx++) { ue.cell_info[cell_idx].state = cell_state_none; } + + // Enable/Disable extended CSI field in DCI according to 3GPP 36.212 R10 5.3.3.1.1 Format 0 + for (uint32_t ue_cc_idx = 0; ue_cc_idx < SRSLTE_MAX_CARRIERS; ue_cc_idx++) { + if (ue.cell_info[ue_cc_idx].state != cell_state_none) { + ue.cell_info[ue_cc_idx].phy_cfg.dl_cfg.dci.multiple_csi_request_enabled = (nof_configured_scell > 1); + } + } } void phy_ue_db::rem_rnti(uint16_t rnti) diff --git a/srsenb/test/phy/enb_phy_test.cc b/srsenb/test/phy/enb_phy_test.cc index c1482527d..4e5fb9c34 100644 --- a/srsenb/test/phy/enb_phy_test.cc +++ b/srsenb/test/phy/enb_phy_test.cc @@ -771,6 +771,11 @@ public: sf_len = static_cast(SRSLTE_SF_LEN_PRB(cell_list[0].cell.nof_prb)); rnti = rnti_; + // Enable Extended CSI request bits in DCI format 0 according to 3GPP 36.212 R10 5.3.3.1.1 + for (auto& e : phy_rrc_cfg) { + e.phy_cfg.dl_cfg.dci.multiple_csi_request_enabled = (phy_rrc_cfg.size() > 1); + } + log_h.set_level(std::move(log_level)); // Initialise one buffer per eNb