diff --git a/srsenb/hdr/stack/rrc/rrc_config.h b/srsenb/hdr/stack/rrc/rrc_config.h index aa402b37b..b6feefe1a 100644 --- a/srsenb/hdr/stack/rrc/rrc_config.h +++ b/srsenb/hdr/stack/rrc/rrc_config.h @@ -76,12 +76,12 @@ struct rrc_cfg_t { bool meas_cfg_present = false; srsran_cell_t cell; cell_list_t cell_list; - uint32_t num_nr_cells = 0; /// number of configured NR cells (used to configure RF) - uint32_t max_mac_dl_kos; - uint32_t max_mac_ul_kos; - uint32_t rlf_release_timer_ms; - srb_cfg_t srb1_cfg; - srb_cfg_t srb2_cfg; + uint32_t num_nr_cells = 0; /// number of configured NR cells (used to configure RF) + uint32_t max_mac_dl_kos; + uint32_t max_mac_ul_kos; + uint32_t rlf_release_timer_ms; + srb_cfg_t srb1_cfg; + srb_cfg_t srb2_cfg; rrc_endc_cfg_t endc_cfg; }; diff --git a/srsenb/rb.conf.example b/srsenb/rb.conf.example index 3203c2fe2..dc19c63f3 100644 --- a/srsenb/rb.conf.example +++ b/srsenb/rb.conf.example @@ -5,17 +5,16 @@ // srb1_config = { // rlc_config = { // ul_am = { +// sn_field_len = 12; // t_poll_retx = 45; // poll_pdu = -1; // poll_byte = -1; // max_retx_thresh = 4; // }; // dl_am = { -// t_reordering = 35; -// t_status_prohibit = 0; -// }; -// enb_specific = { -// dl_max_retx_thresh = 32; +// sn_field_len = 12; +// t_reassembly = 50; +// t_status_prohibit = 50; // }; // }; // } @@ -23,6 +22,7 @@ // srb2_config = { // rlc_config = { // ul_am = { +// sn_field_len = 12; // t_poll_retx = 45; // poll_pdu = -1; // poll_byte = -1; @@ -32,9 +32,6 @@ // t_reordering = 35; // t_status_prohibit = 0; // }; -// enb_specific = { -// dl_max_retx_thresh = 32; -// }; // }; // } diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index 8fd77c89d..d531b1019 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -635,6 +635,71 @@ int field_qci::parse(libconfig::Setting& root) return 0; } +int field_5g_srb::parse(libconfig::Setting& root) +{ + // Parse RLC AM section + asn1::rrc_nr::rlc_cfg_c* rlc_cfg = &cfg.rlc_cfg; + if (root.exists("ul_am") && root.exists("dl_am")) { + rlc_cfg->set_am(); + cfg.present = true; + } + + // RLC-UM Should not exist section + if (root.exists("ul_um") || root.exists("dl_um")) { + ERROR("Error SRBs must be AM."); + return SRSRAN_ERROR; + } + + // Parse RLC-AM section + if (root.exists("ul_am")) { + asn1::rrc_nr::ul_am_rlc_s& ul_am_rlc = rlc_cfg->am().ul_am_rlc; + + field_asn1_enum_number t_poll_retx("t_poll_retx", &ul_am_rlc.t_poll_retx); + if (t_poll_retx.parse(root["ul_am"])) { + ERROR("Error can't find t_poll_retx in section ul_am"); + return SRSRAN_ERROR; + } + + field_asn1_enum_number poll_pdu("poll_pdu", &ul_am_rlc.poll_pdu); + if (poll_pdu.parse(root["ul_am"])) { + ERROR("Error can't find poll_pdu in section ul_am"); + return SRSRAN_ERROR; + } + + field_asn1_enum_number poll_byte("poll_byte", &ul_am_rlc.poll_byte); + if (poll_byte.parse(root["ul_am"])) { + ERROR("Error can't find poll_byte in section ul_am"); + return SRSRAN_ERROR; + } + + field_asn1_enum_number max_retx_thresh("max_retx_thresh", + &ul_am_rlc.max_retx_thres); + if (max_retx_thresh.parse(root["ul_am"])) { + ERROR("Error can't find max_retx_thresh in section ul_am"); + return SRSRAN_ERROR; + } + } + + if (root.exists("dl_am")) { + asn1::rrc_nr::dl_am_rlc_s& dl_am_rlc = rlc_cfg->am().dl_am_rlc; + + field_asn1_enum_number t_reassembly("t_reassembly", &dl_am_rlc.t_reassembly); + if (t_reassembly.parse(root["dl_am"])) { + ERROR("Error can't find t_reordering in section dl_am"); + return SRSRAN_ERROR; + } + + field_asn1_enum_number t_status_prohibit("t_status_prohibit", + &dl_am_rlc.t_status_prohibit); + if (t_status_prohibit.parse(root["dl_am"])) { + ERROR("Error can't find t_status_prohibit in section dl_am"); + return SRSRAN_ERROR; + } + } + + return 0; +} + int field_five_qi::parse(libconfig::Setting& root) { uint32_t nof_five_qi = (uint32_t)root.getLength(); diff --git a/srsenb/src/enb_cfg_parser.h b/srsenb/src/enb_cfg_parser.h index 10b19ed6f..d1f0ae0ae 100644 --- a/srsenb/src/enb_cfg_parser.h +++ b/srsenb/src/enb_cfg_parser.h @@ -193,6 +193,18 @@ private: std::map& cfg; }; +class field_5g_srb final : public parser::field_itf +{ +public: + explicit field_5g_srb(srb_5g_cfg_t& cfg_) : cfg(cfg_) {} + const char* get_name() override { return "field_5g_srb"; } + + int parse(Setting& root) override; + +private: + srb_5g_cfg_t& cfg; +}; + class field_five_qi final : public parser::field_itf { public: diff --git a/srsgnb/hdr/stack/rrc/rrc_nr_config.h b/srsgnb/hdr/stack/rrc/rrc_nr_config.h index b4c7848f5..aedf3ad1c 100644 --- a/srsgnb/hdr/stack/rrc/rrc_nr_config.h +++ b/srsgnb/hdr/stack/rrc/rrc_nr_config.h @@ -45,6 +45,12 @@ struct rrc_cell_cfg_nr_t { typedef std::vector rrc_cell_list_nr_t; +struct srb_5g_cfg_t { + int enb_dl_max_retx_thres = -1; + bool present = false; + asn1::rrc_nr::rlc_cfg_c rlc_cfg; +}; + struct rrc_nr_cfg_five_qi_t { bool configured = false; asn1::rrc_nr::pdcp_cfg_s pdcp_cfg;