srsgnb,cfg_parser: adding parsing for SA SRB configs

This commit is contained in:
Pedro Alvarez 2022-04-28 18:07:20 +01:00
parent d2b27a6f7d
commit 36354ef6ff
5 changed files with 94 additions and 14 deletions

View File

@ -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;
};

View File

@ -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;
// };
// };
// }

View File

@ -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<asn1::rrc_nr::t_poll_retx_e> 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<asn1::rrc_nr::poll_pdu_e> 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<asn1::rrc_nr::poll_byte_e> 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<asn1::rrc_nr::ul_am_rlc_s::max_retx_thres_e_> 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<asn1::rrc_nr::t_reassembly_e> 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<asn1::rrc_nr::t_status_prohibit_e> 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();

View File

@ -193,6 +193,18 @@ private:
std::map<uint32_t, rrc_cfg_qci_t>& 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:

View File

@ -45,6 +45,12 @@ struct rrc_cell_cfg_nr_t {
typedef std::vector<rrc_cell_cfg_nr_t> 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;