mirror of https://github.com/PentHertz/srsLTE.git
Added RLC SRB1 and SRB2 configuration ability.
The configuration was added to drb.conf
This commit is contained in:
parent
1fd9d4300c
commit
72cf3a1cec
|
@ -1,5 +1,38 @@
|
||||||
|
|
||||||
// All times are in ms. Use -1 for infinity, where available
|
// All times are in ms. Use -1 for infinity, where available
|
||||||
|
srb1_config = (
|
||||||
|
{
|
||||||
|
rlc_config = {
|
||||||
|
ul_am = {
|
||||||
|
t_poll_retx = 45;
|
||||||
|
poll_pdu = -1;
|
||||||
|
poll_byte = -1;
|
||||||
|
max_retx_thresh = 4;
|
||||||
|
};
|
||||||
|
dl_am = {
|
||||||
|
t_reordering = 35;
|
||||||
|
t_status_prohibit = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
srb2_config = (
|
||||||
|
{
|
||||||
|
rlc_config = {
|
||||||
|
ul_am = {
|
||||||
|
t_poll_retx = 45;
|
||||||
|
poll_pdu = -1;
|
||||||
|
poll_byte = -1;
|
||||||
|
max_retx_thresh = 4;
|
||||||
|
};
|
||||||
|
dl_am = {
|
||||||
|
t_reordering = 35;
|
||||||
|
t_status_prohibit = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
qci_config = (
|
qci_config = (
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,8 @@ struct rrc_cfg_t {
|
||||||
uint32_t max_mac_dl_kos;
|
uint32_t max_mac_dl_kos;
|
||||||
uint32_t max_mac_ul_kos;
|
uint32_t max_mac_ul_kos;
|
||||||
uint32_t rlf_release_timer_ms;
|
uint32_t rlf_release_timer_ms;
|
||||||
|
asn1::rrc::rlc_cfg_c srb1_cfg;
|
||||||
|
asn1::rrc::rlc_cfg_c srb2_cfg;
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr uint32_t UE_PCELL_CC_IDX = 0;
|
constexpr uint32_t UE_PCELL_CC_IDX = 0;
|
||||||
|
|
|
@ -397,6 +397,69 @@ int phr_cnfg_parser::parse(libconfig::Setting& root)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int field_srb::parse(libconfig::Setting& root)
|
||||||
|
{
|
||||||
|
libconfig::Setting& q = root[0];
|
||||||
|
|
||||||
|
// Parse RLC AM section
|
||||||
|
rlc_cfg_c* rlc_cfg = &cfg;
|
||||||
|
if (q["rlc_config"].exists("ul_am") && q["rlc_config"].exists("dl_am")) {
|
||||||
|
rlc_cfg->set_am();
|
||||||
|
}
|
||||||
|
|
||||||
|
// RLC-UM Should not exist section
|
||||||
|
if (q["rlc_config"].exists("ul_um") || q["rlc_config"].exists("dl_um")) {
|
||||||
|
ERROR("Error SRBs must be AM.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse RLC-AM section
|
||||||
|
if (q["rlc_config"].exists("ul_am")) {
|
||||||
|
ul_am_rlc_s* am_rlc = &rlc_cfg->am().ul_am_rlc;
|
||||||
|
|
||||||
|
field_asn1_enum_number<t_poll_retx_e> t_poll_retx("t_poll_retx", &am_rlc->t_poll_retx);
|
||||||
|
if (t_poll_retx.parse(q["rlc_config"]["ul_am"])) {
|
||||||
|
ERROR("Error can't find t_poll_retx in section ul_am");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
field_asn1_enum_number<poll_pdu_e> poll_pdu("poll_pdu", &am_rlc->poll_pdu);
|
||||||
|
if (poll_pdu.parse(q["rlc_config"]["ul_am"])) {
|
||||||
|
ERROR("Error can't find poll_pdu in section ul_am");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
field_asn1_enum_number<poll_byte_e> poll_byte("poll_byte", &am_rlc->poll_byte);
|
||||||
|
if (poll_byte.parse(q["rlc_config"]["ul_am"])) {
|
||||||
|
ERROR("Error can't find poll_byte in section ul_am");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
field_asn1_enum_number<ul_am_rlc_s::max_retx_thres_e_> max_retx_thresh("max_retx_thresh", &am_rlc->max_retx_thres);
|
||||||
|
if (max_retx_thresh.parse(q["rlc_config"]["ul_am"])) {
|
||||||
|
ERROR("Error can't find max_retx_thresh in section ul_am");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (q["rlc_config"].exists("dl_am")) {
|
||||||
|
dl_am_rlc_s* am_rlc = &rlc_cfg->am().dl_am_rlc;
|
||||||
|
|
||||||
|
field_asn1_enum_number<t_reordering_e> t_reordering("t_reordering", &am_rlc->t_reordering);
|
||||||
|
if (t_reordering.parse(q["rlc_config"]["dl_am"])) {
|
||||||
|
ERROR("Error can't find t_reordering in section dl_am");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
field_asn1_enum_number<t_status_prohibit_e> t_status_prohibit("t_status_prohibit", &am_rlc->t_status_prohibit);
|
||||||
|
if (t_status_prohibit.parse(q["rlc_config"]["dl_am"])) {
|
||||||
|
ERROR("Error can't find t_status_prohibit in section dl_am");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int field_qci::parse(libconfig::Setting& root)
|
int field_qci::parse(libconfig::Setting& root)
|
||||||
{
|
{
|
||||||
auto nof_qci = (uint32_t)root.getLength();
|
auto nof_qci = (uint32_t)root.getLength();
|
||||||
|
@ -1664,9 +1727,20 @@ namespace drb_sections {
|
||||||
|
|
||||||
int parse_drb(all_args_t* args_, rrc_cfg_t* rrc_cfg_)
|
int parse_drb(all_args_t* args_, rrc_cfg_t* rrc_cfg_)
|
||||||
{
|
{
|
||||||
|
parser::section srb1("srb1_config");
|
||||||
|
srb1.add_field(new field_srb(rrc_cfg_->srb1_cfg));
|
||||||
|
parser::section srb2("srb2_config");
|
||||||
|
srb1.add_field(new field_srb(rrc_cfg_->srb2_cfg));
|
||||||
parser::section qci("qci_config");
|
parser::section qci("qci_config");
|
||||||
qci.add_field(new field_qci(rrc_cfg_->qci_cfg));
|
qci.add_field(new field_qci(rrc_cfg_->qci_cfg));
|
||||||
return parser::parse_section(args_->enb_files.drb_config, &qci);
|
|
||||||
|
// Run parser with two sections
|
||||||
|
parser p(args_->enb_files.drb_config);
|
||||||
|
p.add_section(&srb1);
|
||||||
|
p.add_section(&srb2);
|
||||||
|
p.add_section(&qci);
|
||||||
|
|
||||||
|
return p.parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace drb_sections
|
} // namespace drb_sections
|
||||||
|
|
|
@ -146,6 +146,18 @@ private:
|
||||||
uint32_t default_offset;
|
uint32_t default_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class field_srb final : public parser::field_itf
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit field_srb(asn1::rrc::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;
|
||||||
|
};
|
||||||
|
|
||||||
class field_qci final : public parser::field_itf
|
class field_qci final : public parser::field_itf
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -103,6 +103,16 @@ int32_t rrc::init(const rrc_cfg_t& cfg_,
|
||||||
|
|
||||||
running = true;
|
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 (logger.debug.enabled()) {
|
||||||
|
asn1::json_writer js{};
|
||||||
|
cfg.srb2_cfg.to_json(js);
|
||||||
|
logger.debug("SRB2 configuration: %s", js.to_string().c_str());
|
||||||
|
}
|
||||||
return SRSRAN_SUCCESS;
|
return SRSRAN_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1411,7 +1411,13 @@ void rrc::ue::apply_pdcp_drb_updates(const rr_cfg_ded_s& pending_rr_cfg)
|
||||||
void rrc::ue::apply_rlc_rb_updates(const rr_cfg_ded_s& pending_rr_cfg)
|
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) {
|
for (const srb_to_add_mod_s& srb : pending_rr_cfg.srb_to_add_mod_list) {
|
||||||
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::rlc_config_t::srb_config(srb.srb_id));
|
if (srb.srb_id == 1) {
|
||||||
|
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::make_rlc_config_t(parent->cfg.srb1_cfg));
|
||||||
|
} else if (srb.srb_id == 2) {
|
||||||
|
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::make_rlc_config_t(parent->cfg.srb2_cfg));
|
||||||
|
} else {
|
||||||
|
parent->rlc->add_bearer(rnti, srb.srb_id, srsran::rlc_config_t::srb_config(srb.srb_id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (pending_rr_cfg.drb_to_release_list.size() > 0) {
|
if (pending_rr_cfg.drb_to_release_list.size() > 0) {
|
||||||
for (uint8_t drb_id : pending_rr_cfg.drb_to_release_list) {
|
for (uint8_t drb_id : pending_rr_cfg.drb_to_release_list) {
|
||||||
|
|
Loading…
Reference in New Issue