diff --git a/lib/src/phy/phch/pmch.c b/lib/src/phy/phch/pmch.c index 3c6b7dc07..a70df895d 100644 --- a/lib/src/phy/phch/pmch.c +++ b/lib/src/phy/phch/pmch.c @@ -375,6 +375,7 @@ int srsran_pmch_decode(srsran_pmch_t* q, void srsran_configure_pmch(srsran_pmch_cfg_t* pmch_cfg, srsran_cell_t* cell, srsran_mbsfn_cfg_t* mbsfn_cfg) { pmch_cfg->area_id = 1; + pmch_cfg->pdsch_cfg.rnti = SRSRAN_MRNTI; pmch_cfg->pdsch_cfg.grant.nof_layers = 1; pmch_cfg->pdsch_cfg.grant.nof_prb = cell->nof_prb; pmch_cfg->pdsch_cfg.grant.tb[0].mcs_idx = mbsfn_cfg->mbsfn_mcs; diff --git a/srsenb/src/phy/phy_common.cc b/srsenb/src/phy/phy_common.cc index 89d67190e..7e2968ece 100644 --- a/srsenb/src/phy/phy_common.cc +++ b/srsenb/src/phy/phy_common.cc @@ -59,6 +59,10 @@ bool phy_common::init(const phy_cell_cfg_list_t& cell_list_, // Set UE PHY data-base stack and configuration ue_db.init(stack, params, cell_list_lte); + if (mcch_configured) { + build_mch_table(); + build_mcch_table(); + } reset(); return true; @@ -164,10 +168,7 @@ void phy_common::set_mch_period_stop(uint32_t stop) void phy_common::configure_mbsfn(srsran::phy_cfg_mbsfn_t* cfg) { - mbsfn = *cfg; - - build_mch_table(); - build_mcch_table(); + mbsfn = *cfg; sib13_configured = true; mcch_configured = true; } diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index ebf520449..deaf36a53 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -177,11 +177,13 @@ int mac::ue_cfg(uint16_t rnti, const sched_interface::ue_cfg_t* cfg) ue_ptr->start_ta(); // Update Scheduler configuration - if (scheduler.ue_cfg(rnti, *cfg) == SRSRAN_ERROR) { - logger.error("Registering UE rnti=0x%x to SCHED", rnti); - return SRSRAN_ERROR; + if (cfg) { + if (scheduler.ue_cfg(rnti, *cfg) == SRSRAN_ERROR) { + logger.error("Registering UE rnti=0x%x to SCHED", rnti); + return SRSRAN_ERROR; + } + ue_ptr->ue_cfg(*cfg); } - ue_ptr->ue_cfg(*cfg); return SRSRAN_SUCCESS; } @@ -984,9 +986,11 @@ void mac::write_mcch(const srsran::sib2_mbms_t* sib2_, sib13 = *sib13_; memcpy(mcch_payload_buffer, mcch_payload, mcch_payload_length * sizeof(uint8_t)); current_mcch_length = mcch_payload_length; - std::unique_ptr ptr = std::unique_ptr{ - new ue(SRSRAN_MRNTI, args.nof_prb, &scheduler, rrc_h, rlc_h, phy_h, logger, cells.size(), softbuffer_pool.get())}; - auto ret = ue_db.insert(SRSRAN_MRNTI, std::move(ptr)); + + unique_rnti_ptr ue_ptr = make_rnti_obj( + SRSRAN_MRNTI, SRSRAN_MRNTI, 0, &scheduler, rrc_h, rlc_h, phy_h, logger, cells.size(), softbuffer_pool.get()); + + auto ret = ue_db.insert(SRSRAN_MRNTI, std::move(ue_ptr)); if (!ret) { logger.info("Failed to allocate rnti=0x%x.for eMBMS", SRSRAN_MRNTI); } diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index a8e523301..277f3c2f1 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -247,8 +247,8 @@ int rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg) uint32_t lcid = mbms_item.lc_ch_id_r9; uint32_t addr_in; // adding UE object to MAC for MRNTI without scheduling configuration (broadcast not part of regular scheduling) - mac->ue_cfg(SRSRAN_MRNTI, NULL); rlc->add_bearer_mrb(SRSRAN_MRNTI, lcid); + bearer_manager.add_eps_bearer(SRSRAN_MRNTI, 1, srsran::srsran_rat_t::lte, lcid); pdcp->add_bearer(SRSRAN_MRNTI, lcid, srsran::make_drb_pdcp_config_t(1, false)); gtpu->add_bearer(SRSRAN_MRNTI, lcid, 1, 1, addr_in); }