From bca9ef2454aea30d20079b33b59b63b5d13bcbd5 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 3 Dec 2021 14:44:10 +0000 Subject: [PATCH] lib,rlc_am_nr: made mod_nr configurable --- lib/include/srsran/rlc/rlc_am_nr.h | 4 ++-- lib/src/rlc/rlc_am_nr.cc | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/include/srsran/rlc/rlc_am_nr.h b/lib/include/srsran/rlc/rlc_am_nr.h index bc566b18a..bc644020f 100644 --- a/lib/include/srsran/rlc/rlc_am_nr.h +++ b/lib/include/srsran/rlc/rlc_am_nr.h @@ -25,8 +25,6 @@ #include #include -const uint32_t mod_nr = 4096; - namespace srsran { /****************************** @@ -106,6 +104,7 @@ private: rlc_am* parent = nullptr; rlc_am_nr_rx* rx = nullptr; + uint32_t mod_nr = 4096; inline int32_t tx_mod_base_nr(uint32_t sn) { return ((int32_t)sn - (int32_t)st.tx_next_ack) % mod_nr; } /**************************************************************************** @@ -170,6 +169,7 @@ private: rlc_am_nr_tx* tx = nullptr; byte_buffer_pool* pool = nullptr; + uint32_t mod_nr = 4096; inline int32_t rx_mod_base_nr(uint32_t sn) { return ((int32_t)sn - (int32_t)rx_next) % mod_nr; } // RX Window diff --git a/lib/src/rlc/rlc_am_nr.cc b/lib/src/rlc/rlc_am_nr.cc index ef3967d7b..ba24ea220 100644 --- a/lib/src/rlc/rlc_am_nr.cc +++ b/lib/src/rlc/rlc_am_nr.cc @@ -49,6 +49,9 @@ bool rlc_am_nr_tx::configure(const rlc_config_t& cfg_) return false; } */ + + mod_nr = (cfg.tx_sn_field_length == rlc_am_nr_sn_size_t::size12bits) ? 4096 : 262144; + tx_enabled = true; return true; @@ -426,6 +429,7 @@ bool rlc_am_nr_rx::configure(const rlc_config_t& cfg_) logger->info("Configured reassembly timer. t-Reassembly=%d ms", cfg.t_reassembly); } + mod_nr = (cfg.rx_sn_field_length == rlc_am_nr_sn_size_t::size12bits) ? 4096 : 262144; return true; }