From 9b622b3bffd73a46dc5052191830ea8e9284f16f Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 24 Nov 2021 17:06:22 +0000 Subject: [PATCH] lib,rrc_nr: made separate function to create default PDCP SRB configs --- lib/include/srsran/asn1/rrc_nr_utils.h | 1 + lib/include/srsran/asn1/rrc_utils.h | 1 + lib/src/asn1/rrc_utils.cc | 26 ++++++++++++++++++++------ srsgnb/src/stack/rrc/rrc_nr_ue.cc | 2 +- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/include/srsran/asn1/rrc_nr_utils.h b/lib/include/srsran/asn1/rrc_nr_utils.h index 7fcda273a..24b5c6686 100644 --- a/lib/include/srsran/asn1/rrc_nr_utils.h +++ b/lib/include/srsran/asn1/rrc_nr_utils.h @@ -144,6 +144,7 @@ int make_rlc_config_t(const asn1::rrc_nr::rlc_cfg_c& asn1_type, uint8_t bearer_i * PDCP Config **************************/ pdcp_config_t make_srb_pdcp_config_t(const uint8_t bearer_id, bool is_ue); +pdcp_config_t make_nr_srb_pdcp_config_t(const uint8_t bearer_id, bool is_ue); pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue, const asn1::rrc_nr::pdcp_cfg_s& pdcp_cfg); } // namespace srsran diff --git a/lib/include/srsran/asn1/rrc_utils.h b/lib/include/srsran/asn1/rrc_utils.h index de7832f5d..8c7b2ed88 100644 --- a/lib/include/srsran/asn1/rrc_utils.h +++ b/lib/include/srsran/asn1/rrc_utils.h @@ -94,6 +94,7 @@ void to_asn1(asn1::rrc::rlc_cfg_c* asn1_type, const rlc_config_t& cfg); * PDCP Config **************************/ srsran::pdcp_config_t make_srb_pdcp_config_t(const uint8_t bearer_id, bool is_ue); +srsran::pdcp_config_t make_nr_srb_pdcp_config_t(const uint8_t bearer_id, bool is_ue); srsran::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue); uint8_t get_pdcp_drb_sn_len(const asn1::rrc::pdcp_cfg_s& pdcp_cfg); srsran::pdcp_config_t diff --git a/lib/src/asn1/rrc_utils.cc b/lib/src/asn1/rrc_utils.cc index cafe89082..30cebb583 100644 --- a/lib/src/asn1/rrc_utils.cc +++ b/lib/src/asn1/rrc_utils.cc @@ -130,12 +130,12 @@ srsran::rlc_config_t make_rlc_config_t(const asn1::rrc::rlc_cfg_c& asn1_type) srsran::rlc_config_t rlc_cfg; switch (asn1_type.type().value) { case asn1::rrc::rlc_cfg_c::types_opts::am: - 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() < 0 - ? -1 - : asn1_type.am().ul_am_rlc.poll_byte.to_number() * 1000; // KB + 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() < 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(); @@ -215,6 +215,20 @@ srsran::pdcp_config_t make_srb_pdcp_config_t(const uint8_t bearer_id, bool is_ue return cfg; } +srsran::pdcp_config_t make_nr_srb_pdcp_config_t(const uint8_t bearer_id, bool is_ue) +{ + pdcp_config_t cfg(bearer_id, + PDCP_RB_IS_SRB, + is_ue ? SECURITY_DIRECTION_UPLINK : SECURITY_DIRECTION_DOWNLINK, + is_ue ? SECURITY_DIRECTION_DOWNLINK : SECURITY_DIRECTION_UPLINK, + PDCP_SN_LEN_12, + pdcp_t_reordering_t::ms500, + pdcp_discard_timer_t::infinity, + false, + srsran_rat_t::lte); + return cfg; +} + srsran::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue) { pdcp_config_t cfg(bearer_id, diff --git a/srsgnb/src/stack/rrc/rrc_nr_ue.cc b/srsgnb/src/stack/rrc/rrc_nr_ue.cc index 828f908e3..f3abf19d7 100644 --- a/srsgnb/src/stack/rrc/rrc_nr_ue.cc +++ b/srsgnb/src/stack/rrc/rrc_nr_ue.cc @@ -1167,7 +1167,7 @@ int rrc_nr::ue::update_pdcp_bearers(const asn1::rrc_nr::radio_bearer_cfg_s& radi // add SRBs for (const srb_to_add_mod_s& srb : radio_bearer_diff.srb_to_add_mod_list) { - srsran::pdcp_config_t pdcp_cnfg = srsran::make_srb_pdcp_config_t(srb.srb_id, false); + srsran::pdcp_config_t pdcp_cnfg = srsran::make_nr_srb_pdcp_config_t(srb.srb_id, false); const rlc_bearer_cfg_s* rlc_bearer = nullptr; for (const rlc_bearer_cfg_s& item : cell_group_diff.rlc_bearer_to_add_mod_list) { if (item.served_radio_bearer.type().value == rlc_bearer_cfg_s::served_radio_bearer_c_::types_opts::srb_id and