consolidating RRC eMBMS configuration into single function, setting some parameters to const

master
yagoda 4 years ago committed by Andre Puschmann
parent b90574975b
commit bdc1964335

@ -284,11 +284,11 @@ public:
virtual int bearer_ue_cfg(uint16_t rnti, uint32_t lc_id, sched_interface::ue_bearer_cfg_t* cfg) = 0; virtual int bearer_ue_cfg(uint16_t rnti, uint32_t lc_id, sched_interface::ue_bearer_cfg_t* cfg) = 0;
virtual int bearer_ue_rem(uint16_t rnti, uint32_t lc_id) = 0; virtual int bearer_ue_rem(uint16_t rnti, uint32_t lc_id) = 0;
virtual void phy_config_enabled(uint16_t rnti, bool enabled) = 0; virtual void phy_config_enabled(uint16_t rnti, bool enabled) = 0;
virtual void write_mcch(srslte::sib2_mbms_t* sib2_, virtual void write_mcch(const srslte::sib2_mbms_t* sib2_,
srslte::sib13_t* sib13_, const srslte::sib13_t* sib13_,
srslte::mcch_msg_t* mcch_, const srslte::mcch_msg_t* mcch_,
uint8_t* mcch_payload, const uint8_t* mcch_payload,
uint8_t mcch_payload_length) = 0; const uint8_t mcch_payload_length) = 0;
/** /**
* Allocate a C-RNTI for a new user, without adding it to the phy layer and scheduler yet * Allocate a C-RNTI for a new user, without adding it to the phy layer and scheduler yet

@ -99,11 +99,11 @@ public:
bool process_pdus(); bool process_pdus();
void get_metrics(mac_metrics_t metrics[ENB_METRICS_MAX_USERS]); void get_metrics(mac_metrics_t metrics[ENB_METRICS_MAX_USERS]);
void write_mcch(srslte::sib2_mbms_t* sib2_, void write_mcch(const srslte::sib2_mbms_t* sib2_,
srslte::sib13_t* sib13_, const srslte::sib13_t* sib13_,
srslte::mcch_msg_t* mcch_, const srslte::mcch_msg_t* mcch_,
uint8_t* mcch_payload, const uint8_t* mcch_payload,
uint8_t mcch_payload_length) override; const uint8_t mcch_payload_length) override;
private: private:
static const uint32_t cfi = 3; static const uint32_t cfi = 3;

@ -152,7 +152,7 @@ private:
void process_release_complete(uint16_t rnti); void process_release_complete(uint16_t rnti);
void rem_user(uint16_t rnti); void rem_user(uint16_t rnti);
uint32_t generate_sibs(); uint32_t generate_sibs();
void configure_mbsfn_sibs(srslte::sib2_mbms_t* sib2_, srslte::sib13_t* sib13_); void configure_mbsfn_sibs();
int pack_mcch(); int pack_mcch();
void config_mac(); void config_mac();

@ -924,11 +924,11 @@ bool mac::process_pdus()
return ret; return ret;
} }
void mac::write_mcch(srslte::sib2_mbms_t* sib2_, void mac::write_mcch(const srslte::sib2_mbms_t* sib2_,
srslte::sib13_t* sib13_, const srslte::sib13_t* sib13_,
srslte::mcch_msg_t* mcch_, const srslte::mcch_msg_t* mcch_,
uint8_t* mcch_payload, const uint8_t* mcch_payload,
uint8_t mcch_payload_length) const uint8_t mcch_payload_length)
{ {
mcch = *mcch_; mcch = *mcch_;
mch.num_mtch_sched = this->mcch.pmch_info_list[0].nof_mbms_session_info; mch.num_mtch_sched = this->mcch.pmch_info_list[0].nof_mbms_session_info;

@ -65,53 +65,7 @@ void rrc::init(const rrc_cfg_t& cfg_,
if (cfg.sibs[12].type() == asn1::rrc::sys_info_r8_ies_s::sib_type_and_info_item_c_::types::sib13_v920 && if (cfg.sibs[12].type() == asn1::rrc::sys_info_r8_ies_s::sib_type_and_info_item_c_::types::sib13_v920 &&
cfg.enable_mbsfn) { cfg.enable_mbsfn) {
srslte::sib2_mbms_t sibs2; configure_mbsfn_sibs();
sibs2.mbsfn_sf_cfg_list_present = cfg.sibs[1].sib2().mbsfn_sf_cfg_list_present;
sibs2.nof_mbsfn_sf_cfg = cfg.sibs[1].sib2().mbsfn_sf_cfg_list.size();
for (int i = 0; i < sibs2.nof_mbsfn_sf_cfg; i++) {
sibs2.mbsfn_sf_cfg_list[i].nof_alloc_subfrs = srslte::mbsfn_sf_cfg_t::sf_alloc_type_t::one_frame;
sibs2.mbsfn_sf_cfg_list[i].radioframe_alloc_offset =
cfg.sibs[1].sib2().mbsfn_sf_cfg_list[i].radioframe_alloc_offset;
sibs2.mbsfn_sf_cfg_list[i].radioframe_alloc_period =
(srslte::mbsfn_sf_cfg_t::alloc_period_t)cfg.sibs[1].sib2().mbsfn_sf_cfg_list[i].radioframe_alloc_period.value;
sibs2.mbsfn_sf_cfg_list[i].sf_alloc =
(uint32_t)cfg.sibs[1].sib2().mbsfn_sf_cfg_list[i].sf_alloc.one_frame().to_number();
}
srslte::sib13_t sibs13;
sibs13.notif_cfg.notif_offset = cfg.sibs[12].sib13_v920().notif_cfg_r9.notif_offset_r9;
sibs13.notif_cfg.notif_repeat_coeff =
(srslte::mbms_notif_cfg_t::coeff_t)cfg.sibs[12].sib13_v920().notif_cfg_r9.notif_repeat_coeff_r9.value;
sibs13.notif_cfg.notif_sf_idx = cfg.sibs[12].sib13_v920().notif_cfg_r9.notif_sf_idx_r9;
sibs13.nof_mbsfn_area_info = cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9.size();
for (uint32_t i = 0; i < sibs13.nof_mbsfn_area_info; i++) {
sibs13.mbsfn_area_info_list[i].mbsfn_area_id =
cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].mbsfn_area_id_r9;
sibs13.mbsfn_area_info_list[i].notif_ind = cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].notif_ind_r9;
sibs13.mbsfn_area_info_list[i].mcch_cfg.sig_mcs = (srslte::mbsfn_area_info_t::mcch_cfg_t::sig_mcs_t)cfg.sibs[12]
.sib13_v920()
.mbsfn_area_info_list_r9[i]
.mcch_cfg_r9.sig_mcs_r9.value;
sibs13.mbsfn_area_info_list[i].mcch_cfg.sf_alloc_info =
cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].mcch_cfg_r9.sf_alloc_info_r9.to_number();
sibs13.mbsfn_area_info_list[i].mcch_cfg.mcch_repeat_period =
(srslte::mbsfn_area_info_t::mcch_cfg_t::repeat_period_t)cfg.sibs[12]
.sib13_v920()
.mbsfn_area_info_list_r9[i]
.mcch_cfg_r9.mcch_repeat_period_r9.value;
sibs13.mbsfn_area_info_list[i].mcch_cfg.mcch_offset =
cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].mcch_cfg_r9.mcch_offset_r9;
sibs13.mbsfn_area_info_list[i].mcch_cfg.mcch_mod_period =
(srslte::mbsfn_area_info_t::mcch_cfg_t::mod_period_t)cfg.sibs[12]
.sib13_v920()
.mbsfn_area_info_list_r9[i]
.mcch_cfg_r9.mcch_mod_period_r9.value;
sibs13.mbsfn_area_info_list[i].non_mbsfn_region_len = (srslte::mbsfn_area_info_t::region_len_t)cfg.sibs[12]
.sib13_v920()
.mbsfn_area_info_list_r9[i]
.non_mbsfn_region_len.value;
sibs13.mbsfn_area_info_list[i].notif_ind = cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].notif_ind_r9;
}
configure_mbsfn_sibs(&sibs2, &sibs13);
} }
cell_res_list.reset(new freq_res_common_list{cfg}); cell_res_list.reset(new freq_res_common_list{cfg});
@ -748,8 +702,58 @@ uint32_t rrc::generate_sibs()
return nof_messages; return nof_messages;
} }
void rrc::configure_mbsfn_sibs(srslte::sib2_mbms_t* sib2_, srslte::sib13_t* sib13_) void rrc::configure_mbsfn_sibs()
{ {
// populate struct with sib2 values needed in PHY/MAC
srslte::sib2_mbms_t sibs2;
sibs2.mbsfn_sf_cfg_list_present = cfg.sibs[1].sib2().mbsfn_sf_cfg_list_present;
sibs2.nof_mbsfn_sf_cfg = cfg.sibs[1].sib2().mbsfn_sf_cfg_list.size();
for (int i = 0; i < sibs2.nof_mbsfn_sf_cfg; i++) {
sibs2.mbsfn_sf_cfg_list[i].nof_alloc_subfrs = srslte::mbsfn_sf_cfg_t::sf_alloc_type_t::one_frame;
sibs2.mbsfn_sf_cfg_list[i].radioframe_alloc_offset =
cfg.sibs[1].sib2().mbsfn_sf_cfg_list[i].radioframe_alloc_offset;
sibs2.mbsfn_sf_cfg_list[i].radioframe_alloc_period =
(srslte::mbsfn_sf_cfg_t::alloc_period_t)cfg.sibs[1].sib2().mbsfn_sf_cfg_list[i].radioframe_alloc_period.value;
sibs2.mbsfn_sf_cfg_list[i].sf_alloc =
(uint32_t)cfg.sibs[1].sib2().mbsfn_sf_cfg_list[i].sf_alloc.one_frame().to_number();
}
// populate struct with sib13 values needed for PHY/MAC
srslte::sib13_t sibs13;
sibs13.notif_cfg.notif_offset = cfg.sibs[12].sib13_v920().notif_cfg_r9.notif_offset_r9;
sibs13.notif_cfg.notif_repeat_coeff =
(srslte::mbms_notif_cfg_t::coeff_t)cfg.sibs[12].sib13_v920().notif_cfg_r9.notif_repeat_coeff_r9.value;
sibs13.notif_cfg.notif_sf_idx = cfg.sibs[12].sib13_v920().notif_cfg_r9.notif_sf_idx_r9;
sibs13.nof_mbsfn_area_info = cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9.size();
for (uint32_t i = 0; i < sibs13.nof_mbsfn_area_info; i++) {
sibs13.mbsfn_area_info_list[i].mbsfn_area_id =
cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].mbsfn_area_id_r9;
sibs13.mbsfn_area_info_list[i].notif_ind = cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].notif_ind_r9;
sibs13.mbsfn_area_info_list[i].mcch_cfg.sig_mcs = (srslte::mbsfn_area_info_t::mcch_cfg_t::sig_mcs_t)cfg.sibs[12]
.sib13_v920()
.mbsfn_area_info_list_r9[i]
.mcch_cfg_r9.sig_mcs_r9.value;
sibs13.mbsfn_area_info_list[i].mcch_cfg.sf_alloc_info =
cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].mcch_cfg_r9.sf_alloc_info_r9.to_number();
sibs13.mbsfn_area_info_list[i].mcch_cfg.mcch_repeat_period =
(srslte::mbsfn_area_info_t::mcch_cfg_t::repeat_period_t)cfg.sibs[12]
.sib13_v920()
.mbsfn_area_info_list_r9[i]
.mcch_cfg_r9.mcch_repeat_period_r9.value;
sibs13.mbsfn_area_info_list[i].mcch_cfg.mcch_offset =
cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].mcch_cfg_r9.mcch_offset_r9;
sibs13.mbsfn_area_info_list[i].mcch_cfg.mcch_mod_period =
(srslte::mbsfn_area_info_t::mcch_cfg_t::mod_period_t)cfg.sibs[12]
.sib13_v920()
.mbsfn_area_info_list_r9[i]
.mcch_cfg_r9.mcch_mod_period_r9.value;
sibs13.mbsfn_area_info_list[i].non_mbsfn_region_len = (srslte::mbsfn_area_info_t::region_len_t)cfg.sibs[12]
.sib13_v920()
.mbsfn_area_info_list_r9[i]
.non_mbsfn_region_len.value;
sibs13.mbsfn_area_info_list[i].notif_ind = cfg.sibs[12].sib13_v920().mbsfn_area_info_list_r9[i].notif_ind_r9;
}
// pack MCCH for transmission and pass relevant MCCH values to PHY/MAC
pack_mcch(); pack_mcch();
srslte::mcch_msg_t mcch_t; srslte::mcch_msg_t mcch_t;
mcch_t.common_sf_alloc_period = srslte::mcch_msg_t::common_sf_alloc_period_t::rf64; mcch_t.common_sf_alloc_period = srslte::mcch_msg_t::common_sf_alloc_period_t::rf64;
@ -775,14 +779,13 @@ void rrc::configure_mbsfn_sibs(srslte::sib2_mbms_t* sib2_, srslte::sib13_t* sib1
pmch_item->data_mcs = mbms_mcs; pmch_item->data_mcs = mbms_mcs;
pmch_item->mch_sched_period = srslte::pmch_info_t::mch_sched_period_t::rf64; pmch_item->mch_sched_period = srslte::pmch_info_t::mch_sched_period_t::rf64;
pmch_item->sf_alloc_end = 64 * 6; pmch_item->sf_alloc_end = 64 * 6;
phy->configure_mbsfn(sib2_, sib13_, mcch_t); phy->configure_mbsfn(&sibs2, &sibs13, mcch_t);
mac->write_mcch(sib2_, sib13_, &mcch_t, mcch_payload_buffer, current_mcch_length); mac->write_mcch(&sibs2, &sibs13, &mcch_t, mcch_payload_buffer, current_mcch_length);
} }
int rrc::pack_mcch() int rrc::pack_mcch()
{ {
mcch.msg.set_c1();
mcch.msg.set_c1(); mcch.msg.set_c1();
mbsfn_area_cfg_r9_s& area_cfg_r9 = mcch.msg.c1().mbsfn_area_cfg_r9(); mbsfn_area_cfg_r9_s& area_cfg_r9 = mcch.msg.c1().mbsfn_area_cfg_r9();
area_cfg_r9.common_sf_alloc_period_r9 = mbsfn_area_cfg_r9_s::common_sf_alloc_period_r9_e_::rf64; area_cfg_r9.common_sf_alloc_period_r9 = mbsfn_area_cfg_r9_s::common_sf_alloc_period_r9_e_::rf64;

@ -37,11 +37,11 @@ public:
int bearer_ue_cfg(uint16_t rnti, uint32_t lc_id, sched_interface::ue_bearer_cfg_t* cfg) override { return 0; } int bearer_ue_cfg(uint16_t rnti, uint32_t lc_id, sched_interface::ue_bearer_cfg_t* cfg) override { return 0; }
int bearer_ue_rem(uint16_t rnti, uint32_t lc_id) override { return 0; } int bearer_ue_rem(uint16_t rnti, uint32_t lc_id) override { return 0; }
void phy_config_enabled(uint16_t rnti, bool enabled) override {} void phy_config_enabled(uint16_t rnti, bool enabled) override {}
void write_mcch(srslte::sib2_mbms_t* sib2_, void write_mcch(const srslte::sib2_mbms_t* sib2_,
srslte::sib13_t* sib13_, const srslte::sib13_t* sib13_,
srslte::mcch_msg_t* mcch_, const srslte::mcch_msg_t* mcch_,
uint8_t* mcch_payload, const uint8_t* mcch_payload,
uint8_t mcch_payload_length) override const uint8_t mcch_payload_length) override
{} {}
uint16_t reserve_new_crnti(const sched_interface::ue_cfg_t& ue_cfg) override { return last_rnti++; } uint16_t reserve_new_crnti(const sched_interface::ue_cfg_t& ue_cfg) override { return last_rnti++; }

Loading…
Cancel
Save