From ce30b7e1cec1125c4f7d72afe328c6563803a5c2 Mon Sep 17 00:00:00 2001 From: yagoda Date: Thu, 20 May 2021 18:58:08 +0200 Subject: [PATCH] fixing eMBMS after new ue_db architecture and scheduler changes --- CMakeLists.txt | 2 +- srsenb/src/stack/mac/mac.cc | 9 ++++++--- srsenb/src/stack/mac/schedulers/sched_time_pf.cc | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4109dd73e..a5cae6c3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,7 @@ option(ENABLE_SRSENB "Build srsENB application" ON) option(ENABLE_SRSEPC "Build srsEPC application" ON) option(DISABLE_SIMD "Disable SIMD instructions" OFF) option(AUTO_DETECT_ISA "Autodetect supported ISA extensions" ON) - + option(ENABLE_GUI "Enable GUI (using srsGUI)" ON) option(ENABLE_UHD "Enable UHD" ON) option(ENABLE_BLADERF "Enable BladeRF" ON) diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 430f7e493..2aafc7d90 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -976,9 +976,12 @@ 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; - ue_db[SRSRAN_MRNTI] = std::unique_ptr{ - new ue(SRSRAN_MRNTI, 0, &scheduler, rrc_h, rlc_h, phy_h, logger, cells.size(), softbuffer_pool.get())}; - + 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)); + if (!ret) { + logger.info("Failed to allocate rnti=0x%x.for eMBMS", SRSRAN_MRNTI); + } rrc_h->add_user(SRSRAN_MRNTI, {}); } diff --git a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc index 11a0f8aab..53de3621c 100644 --- a/srsenb/src/stack/mac/schedulers/sched_time_pf.cc +++ b/srsenb/src/stack/mac/schedulers/sched_time_pf.cc @@ -35,6 +35,12 @@ sched_time_pf::sched_time_pf(const sched_cell_params_t& cell_params_, const sche void sched_time_pf::new_tti(sched_ue_list& ue_db, sf_sched* tti_sched) { + while (not dl_queue.empty()) { + dl_queue.pop(); + } + while (not ul_queue.empty()) { + ul_queue.pop(); + } current_tti_rx = tti_point{tti_sched->get_tti_rx()}; // remove deleted users from history for (auto it = ue_history_db.begin(); it != ue_history_db.end();) {