diff --git a/lib/include/srsran/phy/common/phy_common.h b/lib/include/srsran/phy/common/phy_common.h index e839bea17b..54dae9eb06 100644 --- a/lib/include/srsran/phy/common/phy_common.h +++ b/lib/include/srsran/phy/common/phy_common.h @@ -271,6 +271,7 @@ typedef struct SRSRAN_API { bool mbms_dedicated; uint8_t additional_non_mbms_frames; uint8_t mbsfn_prb; + uint32_t semi_static_cfi; } srsran_cell_t; // Common downlink properties that may change every subframe diff --git a/lib/src/phy/phch/pbch.c b/lib/src/phy/phch/pbch.c index 9783728447..e062addd46 100644 --- a/lib/src/phy/phch/pbch.c +++ b/lib/src/phy/phch/pbch.c @@ -336,9 +336,12 @@ void srsran_pbch_mib_mbms_unpack(uint8_t* msg, srsran_cell_t* cell, uint32_t* sf *sfn = srsran_bit_pack(&msg, 6) << 4; } + uint32_t non_mbsfn_sf = srsran_bit_pack(&msg, 2); if (additional_non_mbsfn_subframes) { - *additional_non_mbsfn_subframes = *msg++; + *additional_non_mbsfn_subframes = non_mbsfn_sf; } + + cell->semi_static_cfi = srsran_bit_pack(&msg, 2); } /** diff --git a/lib/src/phy/ue/ue_dl.c b/lib/src/phy/ue/ue_dl.c index f10ee745b3..1622d4a090 100644 --- a/lib/src/phy/ue/ue_dl.c +++ b/lib/src/phy/ue/ue_dl.c @@ -351,10 +351,15 @@ static int estimate_pdcch_pcfich(srsran_ue_dl_t* q, srsran_dl_sf_cfg_t* sf, srsr /* Get channel estimates for each port */ srsran_chest_dl_estimate_cfg(&q->chest, sf, &cfg->chest_cfg, q->sf_symbols, &q->chest_res); - /* First decode PCFICH and obtain CFI */ - if (srsran_pcfich_decode(&q->pcfich, sf, &q->chest_res, q->sf_symbols, &cfi_corr) < 0) { - ERROR("Error decoding PCFICH"); - return SRSRAN_ERROR; + if (!sf->cfi) { + /* First decode PCFICH and obtain CFI */ + if (srsran_pcfich_decode(&q->pcfich, sf, &q->chest_res, q->sf_symbols, &cfi_corr) < 0) { + ERROR("Error decoding PCFICH"); + return SRSRAN_ERROR; + } + INFO("Decoded CFI=%d with correlation %.2f, sf_idx=%d", sf->cfi, cfi_corr, sf->tti % 10); + } else { + INFO("Using semi-static CFI=%d, sf_idx=%d", sf->cfi, sf->tti % 10); } if (q->cell.frame_type == SRSRAN_TDD && ((sf->tti % 10) == 1 || (sf->tti % 10) == 6) && sf->cfi == 3) { @@ -367,7 +372,6 @@ static int estimate_pdcch_pcfich(srsran_ue_dl_t* q, srsran_dl_sf_cfg_t* sf, srsr return false; } - INFO("Decoded CFI=%d with correlation %.2f, sf_idx=%d", sf->cfi, cfi_corr, sf->tti % 10); return SRSRAN_SUCCESS; } else {