Maded SRB configuration optional in rb.conf

master
Pedro Alvarez 3 years ago committed by Ismael Gomez
parent f0a28ebc88
commit 8d41c0d476

@ -132,7 +132,9 @@ srsran::rlc_config_t make_rlc_config_t(const asn1::rrc::rlc_cfg_c& asn1_type)
rlc_cfg.rlc_mode = rlc_mode_t::am;
rlc_cfg.am.t_poll_retx = asn1_type.am().ul_am_rlc.t_poll_retx.to_number();
rlc_cfg.am.poll_pdu = asn1_type.am().ul_am_rlc.poll_pdu.to_number();
rlc_cfg.am.poll_byte = asn1_type.am().ul_am_rlc.poll_byte.to_number() * 1000; // KB
rlc_cfg.am.poll_byte = asn1_type.am().ul_am_rlc.poll_byte.to_number() < 0
? -1
: asn1_type.am().ul_am_rlc.poll_byte.to_number() * 1000; // KB
rlc_cfg.am.max_retx_thresh = asn1_type.am().ul_am_rlc.max_retx_thres.to_number();
rlc_cfg.am.t_reordering = asn1_type.am().dl_am_rlc.t_reordering.to_number();
rlc_cfg.am.t_status_prohibit = asn1_type.am().dl_am_rlc.t_status_prohibit.to_number();

@ -62,8 +62,8 @@ struct rrc_cfg_t {
uint32_t max_mac_dl_kos;
uint32_t max_mac_ul_kos;
uint32_t rlf_release_timer_ms;
asn1::rrc::rlc_cfg_c srb1_cfg;
asn1::rrc::rlc_cfg_c srb2_cfg;
asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_ srb1_cfg;
asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_ srb2_cfg;
};
constexpr uint32_t UE_PCELL_CC_IDX = 0;

@ -402,7 +402,7 @@ int field_srb::parse(libconfig::Setting& root)
libconfig::Setting& q = root[0];
// Parse RLC AM section
rlc_cfg_c* rlc_cfg = &cfg;
rlc_cfg_c* rlc_cfg = &cfg.set_explicit_value();
if (q["rlc_config"].exists("ul_am") && q["rlc_config"].exists("dl_am")) {
rlc_cfg->set_am();
}
@ -1728,9 +1728,15 @@ namespace drb_sections {
int parse_drb(all_args_t* args_, rrc_cfg_t* rrc_cfg_)
{
parser::section srb1("srb1_config");
bool srb1_present = false;
srb1.set_optional(&srb1_present);
srb1.add_field(new field_srb(rrc_cfg_->srb1_cfg));
parser::section srb2("srb2_config");
bool srb2_present = false;
srb2.set_optional(&srb2_present);
srb2.add_field(new field_srb(rrc_cfg_->srb2_cfg));
parser::section qci("qci_config");
qci.add_field(new field_qci(rrc_cfg_->qci_cfg));
@ -1740,7 +1746,15 @@ int parse_drb(all_args_t* args_, rrc_cfg_t* rrc_cfg_)
p.add_section(&srb2);
p.add_section(&qci);
return p.parse();
int ret = p.parse();
if (not srb1_present) {
rrc_cfg_->srb1_cfg.set_default_value();
}
if (not srb2_present) {
rrc_cfg_->srb2_cfg.set_default_value();
}
return ret;
}
} // namespace drb_sections

@ -149,13 +149,13 @@ private:
class field_srb final : public parser::field_itf
{
public:
explicit field_srb(asn1::rrc::rlc_cfg_c& cfg_) : cfg(cfg_) {}
explicit field_srb(asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_& cfg_) : cfg(cfg_) {}
const char* get_name() override { return "field_srb"; }
int parse(Setting& root) override;
private:
asn1::rrc::rlc_cfg_c& cfg;
asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_& cfg;
};
class field_qci final : public parser::field_itf

@ -103,15 +103,24 @@ int32_t rrc::init(const rrc_cfg_t& cfg_,
running = true;
if (logger.debug.enabled()) {
asn1::json_writer js{};
cfg.srb1_cfg.to_json(js);
logger.debug("SRB1 configuration: %s", js.to_string().c_str());
if (cfg.srb1_cfg.type() == srb_to_add_mod_s::rlc_cfg_c_::types::explicit_value) {
if (logger.debug.enabled()) {
asn1::json_writer js{};
cfg.srb1_cfg.to_json(js);
logger.debug("SRB1 explicit configuration: %s", js.to_string().c_str());
}
} else {
logger.debug("SRB1 default configuration");
}
if (logger.debug.enabled()) {
asn1::json_writer js{};
cfg.srb2_cfg.to_json(js);
logger.debug("SRB2 configuration: %s", js.to_string().c_str());
if (cfg.srb2_cfg.type() == srb_to_add_mod_s::rlc_cfg_c_::types::explicit_value) {
if (logger.debug.enabled()) {
asn1::json_writer js{};
cfg.srb2_cfg.to_json(js);
logger.debug("SRB2 configuration: %s", js.to_string().c_str());
}
} else {
logger.debug("SRB2 default configuration");
}
return SRSRAN_SUCCESS;
}

@ -1412,9 +1412,17 @@ void rrc::ue::apply_rlc_rb_updates(const rr_cfg_ded_s& pending_rr_cfg)
{
for (const srb_to_add_mod_s& srb : pending_rr_cfg.srb_to_add_mod_list) {
if (srb.srb_id == 1) {
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::make_rlc_config_t(parent->cfg.srb1_cfg));
if (parent->cfg.srb1_cfg.type() == srb_to_add_mod_s::rlc_cfg_c_::types_opts::explicit_value) {
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::make_rlc_config_t(parent->cfg.srb1_cfg.explicit_value()));
} else {
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::rlc_config_t::srb_config(srb.srb_id));
}
} else if (srb.srb_id == 2) {
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::make_rlc_config_t(parent->cfg.srb2_cfg));
if (parent->cfg.srb2_cfg.type() == srb_to_add_mod_s::rlc_cfg_c_::types_opts::explicit_value) {
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::make_rlc_config_t(parent->cfg.srb2_cfg.explicit_value()));
} else {
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::rlc_config_t::srb_config(srb.srb_id));
}
} else {
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::rlc_config_t::srb_config(srb.srb_id));
}

@ -33,7 +33,8 @@ namespace srsenb {
* SRBs / DRBs
*****************************/
srb_to_add_mod_s* add_srb(srb_to_add_mod_list_l& srbs, uint8_t srb_id, const asn1::rrc::rlc_cfg_c& srb_cfg)
srb_to_add_mod_s*
add_srb(srb_to_add_mod_list_l& srbs, uint8_t srb_id, const asn1::rrc::srb_to_add_mod_s::rlc_cfg_c_& srb_cfg)
{
if (srb_id > 2 or srb_id == 0) {
srslog::fetch_basic_logger("RRC").error("Invalid SRB id=%d", srb_id);
@ -45,8 +46,7 @@ srb_to_add_mod_s* add_srb(srb_to_add_mod_list_l& srbs, uint8_t srb_id, const asn
srb_it->lc_ch_cfg_present = true;
srb_it->lc_ch_cfg.set(srb_to_add_mod_s::lc_ch_cfg_c_::types_opts::default_value);
srb_it->rlc_cfg_present = true;
srb_it->rlc_cfg.set(srb_to_add_mod_s::rlc_cfg_c_::types_opts::explicit_value);
srb_it->rlc_cfg.explicit_value() = srb_cfg;
srb_it->rlc_cfg = srb_cfg;
return srb_it;
}

Loading…
Cancel
Save