diff --git a/lib/include/srsran/phy/common/phy_common.h b/lib/include/srsran/phy/common/phy_common.h index 54dae9eb06..12426f91fb 100644 --- a/lib/include/srsran/phy/common/phy_common.h +++ b/lib/include/srsran/phy/common/phy_common.h @@ -82,7 +82,8 @@ extern "C" { typedef enum { SRSRAN_CP_NORM = 0, SRSRAN_CP_EXT } srsran_cp_t; typedef enum { SRSRAN_SF_NORM = 0, SRSRAN_SF_MBSFN } srsran_sf_t; -typedef enum { SRSRAN_SCS_15KHZ = 0, SRSRAN_SCS_7KHZ5, SRSRAN_SCS_1KHZ25 } srsran_scs_t; +//typedef enum { SRSRAN_SCS_15KHZ = 0, SRSRAN_SCS_7KHZ5, SRSRAN_SCS_2KHZ5, SRSRAN_SCS_1KHZ25, SRSRAN_SCS_0KHZ37 } srsran_scs_t; +typedef enum { SRSRAN_SCS_15KHZ = 0, SRSRAN_SCS_7KHZ5, SRSRAN_SCS_1KHZ25 } srsran_scs_t; #define SRSRAN_INVALID_RNTI 0x0 // TS 36.321 - Table 7.1-1 RNTI 0x0 isn't a valid DL RNTI #define SRSRAN_CRNTI_START 0x000B @@ -272,6 +273,7 @@ typedef struct SRSRAN_API { uint8_t additional_non_mbms_frames; uint8_t mbsfn_prb; uint32_t semi_static_cfi; + bool has_pbch_repetition_r16; } srsran_cell_t; // Common downlink properties that may change every subframe diff --git a/lib/src/phy/phch/pdsch.c b/lib/src/phy/phch/pdsch.c index 56eb005f1f..4c97d919e8 100644 --- a/lib/src/phy/phch/pdsch.c +++ b/lib/src/phy/phch/pdsch.c @@ -94,6 +94,13 @@ static inline bool pdsch_cp_skip_symbol(const srsran_cell_t* cell, if (s == 0 && (sf_idx == 0 || sf_idx == 5) && (l >= grant->nof_symb_slot[s] - 2)) { return true; } + if (cell->mbms_dedicated && cell->nof_prb > 6 && + cell->has_pbch_repetition_r16 && sf_idx == 0 && + ( (s == 0 && l == 3) || + (s == 1 && l == 4) || + (s == 1 && l == 5))) { + return true; + } } else { // TDD SSS if (s == 1 && (sf_idx == 0 || sf_idx == 5) && (l >= grant->nof_symb_slot[s] - 1)) { diff --git a/lib/src/phy/phch/ra_dl.c b/lib/src/phy/phch/ra_dl.c index ed5c95fac4..da051e4094 100644 --- a/lib/src/phy/phch/ra_dl.c +++ b/lib/src/phy/phch/ra_dl.c @@ -70,18 +70,27 @@ uint32_t ra_re_x_prb(const srsran_cell_t* cell, srsran_dl_sf_cfg_t* sf, uint32_t } /* if it's the prb in the middle, there are less RE due to PBCH and PSS/SSS */ + + /* when nof_prb > 6, the cell is MBMS dedicated and PBCH repetiton is configured, + * 3 REs will be used for repeated PBCH symbols. Subtract them as well. */ + bool has_pbch_repetition = cell->mbms_dedicated && cell->nof_prb > 6 && cell->has_pbch_repetition_r16; + if (cell->frame_type == SRSRAN_FDD) { if ((subframe == 0 || subframe == 5) && (prb_idx >= cell->nof_prb / 2 - 3 && prb_idx < cell->nof_prb / 2 + 3 + (cell->nof_prb % 2))) { if (subframe == 0) { if (slot == 0) { - re = (nof_symbols - nof_ctrl_symbols - 2) * SRSRAN_NRE; + re = (nof_symbols - nof_ctrl_symbols - (has_pbch_repetition ? 3 : 2)) * SRSRAN_NRE; + if (has_pbch_repetition) { + skip_refs = false; + } } else { if (SRSRAN_CP_ISEXT(cp_)) { - re = (nof_symbols - 4) * SRSRAN_NRE; + re = (nof_symbols - (has_pbch_repetition ? 6 : 4)) * SRSRAN_NRE; skip_refs = false; } else { re = (nof_symbols - 4) * SRSRAN_NRE + 2 * cell->nof_ports; + } } } else if (subframe == 5) { @@ -91,9 +100,12 @@ uint32_t ra_re_x_prb(const srsran_cell_t* cell, srsran_dl_sf_cfg_t* sf, uint32_t } if ((cell->nof_prb % 2) && (prb_idx == cell->nof_prb / 2 - 3 || prb_idx == cell->nof_prb / 2 + 3)) { if (slot == 0) { - re += 2 * SRSRAN_NRE / 2; + re += (has_pbch_repetition ? 3 : 2) * SRSRAN_NRE / 2; + if (has_pbch_repetition) { + re -= cell->nof_ports > 2 ? 2 : cell->nof_ports; + } } else if (subframe == 0) { - re += 4 * SRSRAN_NRE / 2 - cell->nof_ports; + re += (has_pbch_repetition ? 6 : 4) * SRSRAN_NRE / 2 - cell->nof_ports; if (SRSRAN_CP_ISEXT(cp_)) { re -= cell->nof_ports > 2 ? 2 : cell->nof_ports; } diff --git a/lib/src/phy/ue/ue_mib.c b/lib/src/phy/ue/ue_mib.c index 85f37cfd17..486dc573ea 100644 --- a/lib/src/phy/ue/ue_mib.c +++ b/lib/src/phy/ue/ue_mib.c @@ -290,8 +290,7 @@ int srsran_ue_mib_sync_decode_prb(srsran_ue_mib_sync_t* q, return -1; } - if (srsran_ue_sync_get_sfn(&q->ue_sync)%4 == 0 && srsran_ue_sync_get_sfidx(&q->ue_sync) == 0) { - // if (srsran_ue_sync_get_sfidx(&q->ue_sync) == 0 ) { // [TODO] fix for mixed-mode + if (srsran_ue_sync_get_sfidx(&q->ue_sync) == 0 ) { if (ret == 1) { mib_ret = srsran_ue_mib_decode(&q->ue_mib, bch_payload, nof_tx_ports, sfn_offset); } else {