diff --git a/lib/include/srsran/phy/enb/enb_dl.h b/lib/include/srsran/phy/enb/enb_dl.h index 76c7a20c4..5c1c03010 100644 --- a/lib/include/srsran/phy/enb/enb_dl.h +++ b/lib/include/srsran/phy/enb/enb_dl.h @@ -93,7 +93,7 @@ SRSRAN_API void srsran_enb_dl_free(srsran_enb_dl_t* q); SRSRAN_API int srsran_enb_dl_set_cell(srsran_enb_dl_t* q, srsran_cell_t cell); -SRSRAN_API bool srsran_enb_dl_location_is_common_ncce(srsran_enb_dl_t* q, uint32_t ncce); +SRSRAN_API bool srsran_enb_dl_location_is_common_ncce(srsran_enb_dl_t* q, const srsran_dci_location_t* loc); SRSRAN_API void srsran_enb_dl_put_base(srsran_enb_dl_t* q, srsran_dl_sf_cfg_t* dl_sf); diff --git a/lib/include/srsran/phy/phch/dci.h b/lib/include/srsran/phy/phch/dci.h index 96f86a6ea..4469b5607 100644 --- a/lib/include/srsran/phy/phch/dci.h +++ b/lib/include/srsran/phy/phch/dci.h @@ -229,8 +229,9 @@ SRSRAN_API char* srsran_dci_format_string_short(srsran_dci_format_t format); SRSRAN_API bool srsran_location_find(const srsran_dci_location_t* locations, uint32_t nof_locations, srsran_dci_location_t x); -SRSRAN_API bool -srsran_location_find_ncce(const srsran_dci_location_t* locations, uint32_t nof_locations, uint32_t ncce); +SRSRAN_API bool srsran_location_find_location(const srsran_dci_location_t* locations, + uint32_t nof_locations, + const srsran_dci_location_t* location); SRSRAN_API int srsran_dci_location_set(srsran_dci_location_t* c, uint32_t L, uint32_t nCCE); diff --git a/lib/src/phy/enb/enb_dl.c b/lib/src/phy/enb/enb_dl.c index 91eb8b0b2..c9b240b2f 100644 --- a/lib/src/phy/enb/enb_dl.c +++ b/lib/src/phy/enb/enb_dl.c @@ -356,11 +356,11 @@ void srsran_enb_dl_put_phich(srsran_enb_dl_t* q, srsran_phich_grant_t* grant, bo srsran_phich_encode(&q->phich, &q->dl_sf, resource, ack, q->sf_symbols); } -bool srsran_enb_dl_location_is_common_ncce(srsran_enb_dl_t* q, uint32_t ncce) +bool srsran_enb_dl_location_is_common_ncce(srsran_enb_dl_t* q, const srsran_dci_location_t* loc) { if (SRSRAN_CFI_ISVALID(q->dl_sf.cfi)) { - return srsran_location_find_ncce( - q->common_locations[SRSRAN_CFI_IDX(q->dl_sf.cfi)], q->nof_common_locations[SRSRAN_CFI_IDX(q->dl_sf.cfi)], ncce); + return srsran_location_find_location( + q->common_locations[SRSRAN_CFI_IDX(q->dl_sf.cfi)], q->nof_common_locations[SRSRAN_CFI_IDX(q->dl_sf.cfi)], loc); } else { return false; } diff --git a/lib/src/phy/phch/dci.c b/lib/src/phy/phch/dci.c index 6c1cfd3d7..5db625ced 100644 --- a/lib/src/phy/phch/dci.c +++ b/lib/src/phy/phch/dci.c @@ -1380,10 +1380,12 @@ bool srsran_location_find(const srsran_dci_location_t* locations, uint32_t nof_l return false; } -bool srsran_location_find_ncce(const srsran_dci_location_t* locations, uint32_t nof_locations, uint32_t ncce) +bool srsran_location_find_location(const srsran_dci_location_t* locations, + uint32_t nof_locations, + const srsran_dci_location_t* location) { for (uint32_t i = 0; i < nof_locations; i++) { - if (locations[i].ncce == ncce) { + if (locations[i].ncce == location->ncce && locations[i].L == location->L) { return true; } } diff --git a/lib/src/phy/ue/ue_dl.c b/lib/src/phy/ue/ue_dl.c index 8159e4267..b60ebc661 100644 --- a/lib/src/phy/ue/ue_dl.c +++ b/lib/src/phy/ue/ue_dl.c @@ -452,8 +452,8 @@ static int dci_blind_search(srsran_ue_dl_t* q, * that only the PDCCH in the common search space is transmitted by the primary cell. */ // Find a matching ncce in the common SS - if (srsran_location_find_ncce( - q->current_ss_common.loc, q->current_ss_common.nof_locations, dci_msg[nof_dci].location.ncce)) { + if (srsran_location_find_location( + q->current_ss_common.loc, q->current_ss_common.nof_locations, &dci_msg[nof_dci].location)) { srsran_dci_cfg_t cfg = *dci_cfg; srsran_dci_cfg_set_common_ss(&cfg); // if the payload size is the same that it would have in the common SS (only Format0/1A is allowed there) diff --git a/srsenb/src/phy/lte/cc_worker.cc b/srsenb/src/phy/lte/cc_worker.cc index e424d9c53..1f817fe4e 100644 --- a/srsenb/src/phy/lte/cc_worker.cc +++ b/srsenb/src/phy/lte/cc_worker.cc @@ -463,7 +463,7 @@ int cc_worker::encode_pdcch_ul(stack_interface_phy_lte::ul_sched_grant_t* grants } if (SRSRAN_RNTI_ISUSER(grants[i].dci.rnti)) { - if (srsran_enb_dl_location_is_common_ncce(&enb_dl, grants[i].dci.location.ncce) && + if (srsran_enb_dl_location_is_common_ncce(&enb_dl, &grants[i].dci.location) && phy->ue_db.is_pcell(grants[i].dci.rnti, cc_idx)) { // Disable extended CSI request and SRS request in common SS srsran_dci_cfg_set_common_ss(&dci_cfg); @@ -498,8 +498,10 @@ int cc_worker::encode_pdcch_dl(stack_interface_phy_lte::dl_sched_grant_t* grants continue; } + // Detect if the DCI location is in common SS, if that is the case, flag it as common SS + // This makes possible UE specific DCI fields to be disabled, so it uses a fallback DCI size if (SRSRAN_RNTI_ISUSER(grants[i].dci.rnti) && grants[i].dci.format == SRSRAN_DCI_FORMAT1A) { - if (srsran_enb_dl_location_is_common_ncce(&enb_dl, grants[i].dci.location.ncce) && + if (srsran_enb_dl_location_is_common_ncce(&enb_dl, &grants[i].dci.location) && phy->ue_db.is_pcell(grants[i].dci.rnti, cc_idx)) { srsran_dci_cfg_set_common_ss(&dci_cfg); }