From 872e55a84eeb6c237f368e99bbdadc8d51fa8041 Mon Sep 17 00:00:00 2001 From: Robert Falkenberg Date: Fri, 8 Apr 2022 11:41:56 +0200 Subject: [PATCH] lib,rlc_am_nr_packing: reorder functions by importance --- lib/src/rlc/rlc_am_nr_packing.cc | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/src/rlc/rlc_am_nr_packing.cc b/lib/src/rlc/rlc_am_nr_packing.cc index 31cd2ba4a..0d718809b 100644 --- a/lib/src/rlc/rlc_am_nr_packing.cc +++ b/lib/src/rlc/rlc_am_nr_packing.cc @@ -19,27 +19,6 @@ namespace srsran { * Container implementation for pack/unpack functions ***************************************************************************/ -void rlc_am_nr_status_pdu_t::refresh_packed_size() -{ - uint32_t packed_size = rlc_am_nr_status_pdu_sizeof_header_ack_sn; - for (auto nack : nacks_) { - packed_size += nack_size(nack); - } -} - -uint32_t rlc_am_nr_status_pdu_t::nack_size(const rlc_status_nack_t& nack) const -{ - uint32_t result = sn_size == rlc_am_nr_sn_size_t::size12bits ? rlc_am_nr_status_pdu_sizeof_nack_sn_ext_12bit_sn - : rlc_am_nr_status_pdu_sizeof_nack_sn_ext_18bit_sn; - if (nack.has_so) { - result += rlc_am_nr_status_pdu_sizeof_nack_so; - } - if (nack.has_nack_range) { - result += rlc_am_nr_status_pdu_sizeof_nack_range; - } - return result; -} - rlc_am_nr_status_pdu_t::rlc_am_nr_status_pdu_t(rlc_am_nr_sn_size_t sn_size) : sn_size(sn_size), nacks_(0), @@ -90,6 +69,27 @@ bool rlc_am_nr_status_pdu_t::trim(uint32_t max_packed_size) return true; } +void rlc_am_nr_status_pdu_t::refresh_packed_size() +{ + uint32_t packed_size = rlc_am_nr_status_pdu_sizeof_header_ack_sn; + for (auto nack : nacks_) { + packed_size += nack_size(nack); + } +} + +uint32_t rlc_am_nr_status_pdu_t::nack_size(const rlc_status_nack_t& nack) const +{ + uint32_t result = sn_size == rlc_am_nr_sn_size_t::size12bits ? rlc_am_nr_status_pdu_sizeof_nack_sn_ext_12bit_sn + : rlc_am_nr_status_pdu_sizeof_nack_sn_ext_18bit_sn; + if (nack.has_so) { + result += rlc_am_nr_status_pdu_sizeof_nack_so; + } + if (nack.has_nack_range) { + result += rlc_am_nr_status_pdu_sizeof_nack_range; + } + return result; +} + /**************************************************************************** * Header pack/unpack helper functions * Ref: 3GPP TS 38.322 v15.3.0 Section 6.2.2.4