From 7a7ffc18e2341a206ac6ca240b887c5ca2a8cb6c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 7 Feb 2026 13:20:04 +0100 Subject: [PATCH 01/13] Move reverse_bits*() to separate source file reversing bits is not NR specific. Think of it like this: LTE code might use reverse_bits*() as well, but in the old location, it would pull in a bunch of NR dependencies that are superfluous. --- common/utils/CMakeLists.txt | 2 +- common/utils/nr/nr_common.c | 66 ------------- common/utils/nr/nr_common.h | 3 - common/utils/reverse_bits.c | 92 +++++++++++++++++++ common/utils/reverse_bits.h | 31 +++++++ .../nrLDPC_coding_aal/nrLDPC_coding_aal.c | 1 + .../nrPolar_tools/nr_polar_procedures.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_pbch.c | 1 + openair1/PHY/NR_TRANSPORT/pucch_rx.c | 1 + openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 1 + openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 1 + openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c | 1 + openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 1 + 14 files changed, 133 insertions(+), 71 deletions(-) create mode 100644 common/utils/reverse_bits.c create mode 100644 common/utils/reverse_bits.h diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt index 395139132d..84668852ae 100644 --- a/common/utils/CMakeLists.txt +++ b/common/utils/CMakeLists.txt @@ -14,7 +14,7 @@ add_subdirectory(nr) add_subdirectory(LOG) add_subdirectory(threadPool) add_subdirectory(time_manager) -add_library(utils utils.c system.c time_meas.c time_stat.c tuntap_if.c) +add_library(utils utils.c system.c time_meas.c time_stat.c tuntap_if.c reverse_bits.c) target_include_directories(utils PUBLIC .) target_link_libraries(utils PRIVATE ${T_LIB}) if (ENABLE_TESTS) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 96b8681cff..b91ea4e708 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -37,7 +37,6 @@ #include "nr_common.h" #include #include -#include #define C_SRS_NUMBER (64) #define B_SRS_NUMBER (4) @@ -112,46 +111,6 @@ static const unsigned short srs_bandwidth_config[C_SRS_NUMBER][B_SRS_NUMBER][2] /* 63 */ {{272, 1}, {16, 17}, {8, 2}, {4, 2}}, }; -static const uint8_t bit_reverse_table_256[] = { - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, - 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, - 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, - 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, - 0x31, 0xB1, 0x71, 0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, - 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, - 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF}; - -void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out) -{ - DevAssert(in != NULL); - DevAssert(out != NULL); - -// Bit reversal implementation based on https://wunkolo.github.io/post/2020/11/gf2p8affineqb-bit-reversal/ -#if defined(__GFNI__) && defined(__AVX512F__) - int simde_sz = 64; - int i = 0; - int simde_bound = sz - simde_sz; - for (; i <= simde_bound; i += simde_sz) { - __m512i input = _mm512_loadu_epi8(&in[i]); - __m512i reversed = _mm512_gf2p8affine_epi64_epi8(input, _mm512_set1_epi64(0x8040201008040201), 0); - _mm512_storeu_epi8(&out[i], reversed); - } - - for (; i < sz; ++i) { - out[i] = bit_reverse_table_256[in[i]]; - } -#else - for(size_t i = 0; i < sz; ++i) - out[i] = bit_reverse_table_256[in[i]]; -#endif -} - /** @brief 3GPP TS 38.133 Table 10.1.6.1-1 mapping from dBm to RSRP index */ uint8_t get_rsrp_index(int rsrp_dBm) { @@ -163,31 +122,6 @@ uint8_t get_rsrp_index(int rsrp_dBm) return (uint8_t)index; } -// Reverse bits implementation based on http://graphics.stanford.edu/~seander/bithacks.html -uint64_t reverse_bits(uint64_t in, int n_bits) -{ - // Reverse n_bits in uint64_t variable, example: - // n_bits: 10 - // in: 10 0000 1111 - // return: 11 1100 0001 - - AssertFatal(n_bits <= 64, "Maximum bits to reverse is 64, impossible to reverse %d bits!\n", n_bits); - uint64_t rev_bits = 0; - uint8_t *p = (uint8_t *)∈ - uint8_t *q = (uint8_t *)&rev_bits; - int n_bytes = n_bits >> 3; - for (int n = 0; n < n_bytes; n++) { - q[n_bytes - 1 - n] = bit_reverse_table_256[p[n]]; - } - - // Reverse remaining bits (not aligned with 8-bit) - rev_bits = rev_bits << (n_bits % 8); - for (int i = n_bytes * 8; i < n_bits; i++) { - rev_bits |= ((in >> i) & 0x1) << (n_bits - i - 1); - } - return rev_bits; -} - #define NUM_BW_ENTRIES 15 static const int tables_5_3_2[5][NUM_BW_ENTRIES] = { diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index e62d66658c..0d15e83f9d 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -286,9 +286,6 @@ static inline void warn_higher_threequarter_fs(const int n_rb, const int mu) mu); } -uint64_t reverse_bits(uint64_t in, int n_bits); -void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out); - uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn); uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw); diff --git a/common/utils/reverse_bits.c b/common/utils/reverse_bits.c new file mode 100644 index 0000000000..525929c557 --- /dev/null +++ b/common/utils/reverse_bits.c @@ -0,0 +1,92 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +#include "reverse_bits.h" +// we avoid assertions.h as it necessitates othe dependencies (e.g., exit_function) +#include +#include + +static const uint8_t bit_reverse_table_256[] = { + 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, + 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, + 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, + 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, + 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, + 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, + 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, + 0x31, 0xB1, 0x71, 0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, + 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, + 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, + 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, + 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, + 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF}; + +void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out) +{ + assert(in != NULL); + assert(out != NULL); + +// Bit reversal implementation based on https://wunkolo.github.io/post/2020/11/gf2p8affineqb-bit-reversal/ +#if defined(__GFNI__) && defined(__AVX512F__) + int simde_sz = 64; + int i = 0; + int simde_bound = sz - simde_sz; + for (; i <= simde_bound; i += simde_sz) { + __m512i input = _mm512_loadu_epi8(&in[i]); + __m512i reversed = _mm512_gf2p8affine_epi64_epi8(input, _mm512_set1_epi64(0x8040201008040201), 0); + _mm512_storeu_epi8(&out[i], reversed); + } + + for (; i < sz; ++i) { + out[i] = bit_reverse_table_256[in[i]]; + } +#else + for(size_t i = 0; i < sz; ++i) + out[i] = bit_reverse_table_256[in[i]]; +#endif +} + + +// Reverse bits implementation based on http://graphics.stanford.edu/~seander/bithacks.html +uint64_t reverse_bits(uint64_t in, int n_bits) +{ + // Reverse n_bits in uint64_t variable, example: + // n_bits: 10 + // in: 10 0000 1111 + // return: 11 1100 0001 + + assert(n_bits <= 64); // Maximum bits to reverse is 64 + uint64_t rev_bits = 0; + uint8_t *p = (uint8_t *)∈ + uint8_t *q = (uint8_t *)&rev_bits; + int n_bytes = n_bits >> 3; + for (int n = 0; n < n_bytes; n++) { + q[n_bytes - 1 - n] = bit_reverse_table_256[p[n]]; + } + + // Reverse remaining bits (not aligned with 8-bit) + rev_bits = rev_bits << (n_bits % 8); + for (int i = n_bytes * 8; i < n_bits; i++) { + rev_bits |= ((in >> i) & 0x1) << (n_bits - i - 1); + } + return rev_bits; +} + diff --git a/common/utils/reverse_bits.h b/common/utils/reverse_bits.h new file mode 100644 index 0000000000..5627ba4b6d --- /dev/null +++ b/common/utils/reverse_bits.h @@ -0,0 +1,31 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +#ifndef REVERSE_BITS_H_ +#define REVERSE_BITS_H_ + +#include +#include + +uint64_t reverse_bits(uint64_t in, int n_bits); +void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out); + +#endif /* REVERSE_BITS_H_ */ diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c index 31ca0b387b..89f16bb706 100644 --- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c +++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c @@ -5,6 +5,7 @@ #include "../nrLDPC_coding_interface.h" #include "nrLDPC_coding_aal.h" #include "PHY/sse_intrin.h" +#include "reverse_bits.h" #include #define NR_LDPC_ENABLE_PARITY_CHECK diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c index cf1df52ac0..506d185e89 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c @@ -30,8 +30,8 @@ * \warning */ -#include "common/utils/nr/nr_common.h" #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" +#include "reverse_bits.h" #include #include #include diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index c5edd4cfde..2aa2a113ad 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -35,6 +35,7 @@ #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "PHY/sse_intrin.h" #include "executables/softmodem-common.h" +#include "reverse_bits.h" #include "openair1/PHY/NR_REFSIG/nr_refsig_common.h" #include "openair1/PHY/NR_REFSIG/nr_mod_table.h" #include "openair1/PHY/TOOLS/tools_defs.h" diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 8e2076df2f..c3874fe93d 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -50,6 +50,7 @@ #include "nfapi/oai_integration/vendor_ext.h" #include "nfapi/oai_integration/vendor_ext.h" #include "SCHED_NR/sched_nr.h" +#include "reverse_bits.h" #include "T.h" #include "nr_phy_common.h" diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 8d3ac6db21..613e70be0d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -38,6 +38,7 @@ #include #include "openair1/PHY/NR_REFSIG/nr_refsig_common.h" #include "PHY/nr_phy_common/inc/nr_phy_common.h" +#include "reverse_bits.h" #include "instrumentation.h" //#define DEBUG_PBCH //#define DEBUG_PBCH_ENCODING diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index b6b20cefaf..73f9f8e061 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -40,6 +40,7 @@ #include #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" +#include "reverse_bits.h" #include "openair1/PHY/NR_REFSIG/nr_refsig.h" #include "T.h" diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 672bc3c3a2..0d463f39e4 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -51,6 +51,7 @@ /* utils */ #include "assertions.h" +#include "reverse_bits.h" #include "oai_asn1.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c index 71547f85e7..7549ab56a8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c +++ b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c @@ -41,6 +41,7 @@ #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" #include "openair3/UTILS/conversions.h" #include "LAYER2/nr_rlc/nr_rlc_asn1_utils.h" +#include "reverse_bits.h" #include "NR_MeasurementTimingConfiguration.h" #include "uper_decoder.h" diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 42030133af..73845551af 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -35,6 +35,7 @@ #include "NR_MAC_UE/mac_proto.h" #include "assertions.h" #include "SCHED_NR_UE/fapi_nr_ue_l1.h" +#include "reverse_bits.h" #include "openair2/RRC/NR_UE/L2_interface_ue.h" #define MAX_IF_MODULES 100 From cc33a01cee54ff99a723c49f635cce9770605bed Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 7 Feb 2026 12:04:28 +0100 Subject: [PATCH 02/13] Remove unused -lz from simulators We don't use zlib in the simulators, we don't need this. --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bae1c590bc..abfc8fa7c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2016,7 +2016,7 @@ add_executable(nr_psbchsim ${PHY_INTERFACE_DIR}/queue_t.c ) target_link_libraries(nr_psbchsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -Wl,--end-group m pthread ${T_LIB} ITTI dl shlib_loader physim_common ) target_link_libraries(nr_psbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2036,14 +2036,14 @@ add_executable(nr_dlsim ${PHY_INTERFACE_DIR}/queue_t.c ) target_link_libraries(nr_dlsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -Wl,--end-group m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common ) target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_prachsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c) target_link_libraries(nr_prachsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -Wl,--end-group m pthread ${T_LIB} ITTI dl shlib_loader physim_common) target_link_libraries(nr_prachsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2066,7 +2066,7 @@ add_executable(nr_ulsim ) target_link_libraries(nr_ulsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -Wl,--end-group m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common ) target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2080,7 +2080,7 @@ add_executable(nr_srssim ) target_link_libraries(nr_srssim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc L2_NR -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc L2_NR -Wl,--end-group m pthread ITTI dl nr_ue_phy_meas physim_common ) From 76a5aad7c48d60c982f3158c632fdb7f099c59a4 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 7 Feb 2026 13:23:59 +0100 Subject: [PATCH 03/13] Move polar coding cmake code to subdirectory --- CMakeLists.txt | 20 ++----------------- openair1/PHY/CODING/CMakeLists.txt | 1 + .../PHY/CODING/nrPolar_tools/CMakeLists.txt | 15 ++++++++++++++ 3 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 openair1/PHY/CODING/nrPolar_tools/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index abfc8fa7c0..2c7776c94a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -780,20 +780,6 @@ include_directories(${NFAPI_USER_DIR}) # Layer 1 ############################# -set(PHY_POLARSRC - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_init.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_bitwise_operations.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_crc_byte.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_decoder.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_encoder.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_interleaving_pattern.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_kronecker_power_matrices.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_matrix_and_array.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_procedures.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_sequence_pattern.c -) set(PHY_SMALLBLOCKSRC ${OPENAIR1_DIR}/PHY/CODING/nrSmallBlock/encodeSmallBlock.c ${OPENAIR1_DIR}/PHY/CODING/nrSmallBlock/decodeSmallBlock.c @@ -978,7 +964,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c ${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c - ${PHY_POLARSRC} ${PHY_SMALLBLOCKSRC} ${PHY_NRLDPC_CODINGIF} ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c @@ -1029,7 +1014,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c ${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c - ${PHY_POLARSRC} ${PHY_SMALLBLOCKSRC} ${PHY_NRLDPC_CODINGIF} ) @@ -1064,14 +1048,14 @@ add_library(PHY_NR_COMMON ${PHY_NR_SRC_COMMON}) target_link_libraries(PHY_NR_COMMON PUBLIC UTIL) add_library(PHY_NR ${PHY_NR_SRC}) -target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5) +target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5 polar) add_library(PHY_NR_NO_AVX_256 ${PHY_NR_SRC}) target_link_libraries(PHY_NR_NO_AVX_256 nr_phy_common nr_common) target_compile_definitions(PHY_NR_NO_AVX_256 PUBLIC USE_128BIT) add_library(PHY_NR_UE ${PHY_NR_UE_SRC}) -target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc_hdrs nr_phy_common nr_common UTIL) +target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc_hdrs nr_phy_common nr_common UTIL polar) add_library(PHY_RU ${PHY_SRC_RU}) target_link_libraries(PHY_RU PRIVATE asn1_lte_rrc_hdrs UTIL) diff --git a/openair1/PHY/CODING/CMakeLists.txt b/openair1/PHY/CODING/CMakeLists.txt index f696c71213..bbc5184418 100644 --- a/openair1/PHY/CODING/CMakeLists.txt +++ b/openair1/PHY/CODING/CMakeLists.txt @@ -68,3 +68,4 @@ endif() add_subdirectory(nrLDPC_coding) add_subdirectory(nrLDPC_decoder) +add_subdirectory(nrPolar_tools) diff --git a/openair1/PHY/CODING/nrPolar_tools/CMakeLists.txt b/openair1/PHY/CODING/nrPolar_tools/CMakeLists.txt new file mode 100644 index 0000000000..14e3e816e1 --- /dev/null +++ b/openair1/PHY/CODING/nrPolar_tools/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(polar STATIC + nr_polar_init.c + nr_bitwise_operations.c + nr_crc_byte.c + nr_polar_decoder.c + nr_polar_decoding_tools.c + nr_polar_encoder.c + nr_polar_interleaving_pattern.c + nr_polar_kernal_operation.c + nr_polar_kronecker_power_matrices.c + nr_polar_matrix_and_array.c + nr_polar_procedures.c + nr_polar_sequence_pattern.c +) +target_link_libraries(polar PRIVATE utils) From f159d2249985970c364323d543b7d8afd4728f3d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Feb 2026 07:53:59 +0100 Subject: [PATCH 04/13] Move crc_byte cmake code to subdirectory --- CMakeLists.txt | 2 -- openair1/PHY/CODING/CMakeLists.txt | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c7776c94a..5ca8d55995 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -794,8 +794,6 @@ set(PHY_NRLDPC_CODINGIF add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts_neon.c) -add_library(crc_byte OBJECT ${OPENAIR1_DIR}/PHY/CODING/crc_byte.c) - set(PHY_SRC_COMMON ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c diff --git a/openair1/PHY/CODING/CMakeLists.txt b/openair1/PHY/CODING/CMakeLists.txt index bbc5184418..8c3108910b 100644 --- a/openair1/PHY/CODING/CMakeLists.txt +++ b/openair1/PHY/CODING/CMakeLists.txt @@ -66,6 +66,8 @@ if (ENABLE_LDPC_CUDA) add_dependencies(nr_dlschsim ldpc_cuda) endif() +add_library(crc_byte OBJECT crc_byte.c) + add_subdirectory(nrLDPC_coding) add_subdirectory(nrLDPC_decoder) add_subdirectory(nrPolar_tools) From 49eeba339a54611c6ffbb64e42fb570621e68660 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Feb 2026 07:54:41 +0100 Subject: [PATCH 05/13] Move smallblock cmake code to subdirectory --- CMakeLists.txt | 10 ++-------- openair1/PHY/CODING/CMakeLists.txt | 1 + openair1/PHY/CODING/nrSmallBlock/CMakeLists.txt | 1 + 3 files changed, 4 insertions(+), 8 deletions(-) create mode 100644 openair1/PHY/CODING/nrSmallBlock/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ca8d55995..8d3c9e5390 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -780,10 +780,6 @@ include_directories(${NFAPI_USER_DIR}) # Layer 1 ############################# -set(PHY_SMALLBLOCKSRC - ${OPENAIR1_DIR}/PHY/CODING/nrSmallBlock/encodeSmallBlock.c - ${OPENAIR1_DIR}/PHY/CODING/nrSmallBlock/decodeSmallBlock.c -) set(PHY_TURBOIF ${OPENAIR1_DIR}/PHY/CODING/coding_load.c ) @@ -962,7 +958,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c ${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c - ${PHY_SMALLBLOCKSRC} ${PHY_NRLDPC_CODINGIF} ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/srs_rx.c @@ -1012,7 +1007,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c ${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c - ${PHY_SMALLBLOCKSRC} ${PHY_NRLDPC_CODINGIF} ) @@ -1046,14 +1040,14 @@ add_library(PHY_NR_COMMON ${PHY_NR_SRC_COMMON}) target_link_libraries(PHY_NR_COMMON PUBLIC UTIL) add_library(PHY_NR ${PHY_NR_SRC}) -target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5 polar) +target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5 polar smallblock) add_library(PHY_NR_NO_AVX_256 ${PHY_NR_SRC}) target_link_libraries(PHY_NR_NO_AVX_256 nr_phy_common nr_common) target_compile_definitions(PHY_NR_NO_AVX_256 PUBLIC USE_128BIT) add_library(PHY_NR_UE ${PHY_NR_UE_SRC}) -target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc_hdrs nr_phy_common nr_common UTIL polar) +target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc_hdrs nr_phy_common nr_common UTIL polar smallblock) add_library(PHY_RU ${PHY_SRC_RU}) target_link_libraries(PHY_RU PRIVATE asn1_lte_rrc_hdrs UTIL) diff --git a/openair1/PHY/CODING/CMakeLists.txt b/openair1/PHY/CODING/CMakeLists.txt index 8c3108910b..cdfbbf6f6f 100644 --- a/openair1/PHY/CODING/CMakeLists.txt +++ b/openair1/PHY/CODING/CMakeLists.txt @@ -71,3 +71,4 @@ add_library(crc_byte OBJECT crc_byte.c) add_subdirectory(nrLDPC_coding) add_subdirectory(nrLDPC_decoder) add_subdirectory(nrPolar_tools) +add_subdirectory(nrSmallBlock) diff --git a/openair1/PHY/CODING/nrSmallBlock/CMakeLists.txt b/openair1/PHY/CODING/nrSmallBlock/CMakeLists.txt new file mode 100644 index 0000000000..63f0361c74 --- /dev/null +++ b/openair1/PHY/CODING/nrSmallBlock/CMakeLists.txt @@ -0,0 +1 @@ +add_library(smallblock STATIC encodeSmallBlock.c decodeSmallBlock.c) From ee1f9dfedeafc8ce80af0825c716ede7a1656fbb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 8 Feb 2026 16:02:27 +0100 Subject: [PATCH 06/13] Move hashtable to ds/ folder Notably, remove the include_directories(), which is not necessary, as most files do not actually use this. --- CMakeLists.txt | 22 +++++++------------ common/utils/CMakeLists.txt | 3 --- common/utils/ds/CMakeLists.txt | 2 ++ common/utils/{hashtable => ds}/hashtable.c | 0 common/utils/{hashtable => ds}/hashtable.h | 0 .../utils/{hashtable => ds}/obj_hashtable.c | 0 .../utils/{hashtable => ds}/obj_hashtable.h | 0 common/utils/ds/tests/CMakeLists.txt | 6 +++++ .../tests/test_hashtable.cpp | 0 common/utils/hashtable/tests/CMakeLists.txt | 5 ----- openair2/F1AP/CMakeLists.txt | 2 +- openair2/F1AP/f1ap_ids.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 2 +- openair2/LAYER2/RLC/rlc.h | 2 +- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 2 +- openair2/RRC/LTE/rrc_UE.c | 2 +- 16 files changed, 22 insertions(+), 28 deletions(-) rename common/utils/{hashtable => ds}/hashtable.c (100%) rename common/utils/{hashtable => ds}/hashtable.h (100%) rename common/utils/{hashtable => ds}/obj_hashtable.c (100%) rename common/utils/{hashtable => ds}/obj_hashtable.h (100%) rename common/utils/{hashtable => ds}/tests/test_hashtable.cpp (100%) delete mode 100644 common/utils/hashtable/tests/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d3c9e5390..da1a10adb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -477,7 +477,7 @@ add_library(f1ap ${F1AP_DIR}/f1ap_itti_messaging.c) target_include_directories(f1ap PUBLIC F1AP_DIR) target_link_libraries(f1ap PUBLIC asn1_f1ap GTPV1U) -target_link_libraries(f1ap PRIVATE ngap nr_rrc HASHTABLE f1ap_lib) +target_link_libraries(f1ap PRIVATE ngap nr_rrc ds f1ap_lib) target_include_directories(f1ap PRIVATE ${F1AP_DIR}/lib) if(E2_AGENT) target_compile_definitions(f1ap PRIVATE E2_AGENT) @@ -617,12 +617,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/utils/T # set the T_LIB name to T if the target exists, otherwise leave empty set(T_LIB $) -add_library(HASHTABLE - ${OPENAIR_DIR}/common/utils/hashtable/hashtable.c - ${OPENAIR_DIR}/common/utils/hashtable/obj_hashtable.c -) -include_directories(${OPENAIR_DIR}/common/utils/hashtable) - add_library(UTIL ${OPENAIR_DIR}/common/utils/LOG/vcd_signal_dumper.c ${OPENAIR2_DIR}/UTIL/OPT/probe.c @@ -1709,7 +1703,7 @@ add_dependencies(lte-softmodem oai_iqplayer) target_link_libraries(lte-softmodem PRIVATE -Wl,--start-group - lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECURITY UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB + lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECURITY UTIL SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB ${NAS_UE_LIB} ITTI SIMU shlib_loader -Wl,--end-group z dl) @@ -1766,7 +1760,7 @@ add_executable(lte-uesoftmodem target_link_libraries(lte-uesoftmodem PRIVATE -Wl,--start-group lte_rrc nr_rrc s1ap x2ap m2ap m3ap - SECURITY UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON + SECURITY UTIL SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU L2_UE L2_LTE SIMU NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB ${NAS_UE_LIB} ITTI shlib_loader -Wl,--end-group z dl) @@ -1819,7 +1813,7 @@ add_executable(nr-softmodem target_link_libraries(nr-softmodem PRIVATE -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECURITY + UTIL SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECURITY ITTI ${NAS_UE_LIB} lte_rrc nr_rrc ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU x2ap f1ap m2ap m3ap e1ap shlib_loader @@ -1894,7 +1888,7 @@ add_executable(nr-uesoftmodem target_link_libraries(nr-uesoftmodem PRIVATE -Wl,--start-group - nr_rrc SECURITY UTIL HASHTABLE SCHED_RU_LIB SCHED_NR_UE_LIB + nr_rrc SECURITY UTIL SCHED_RU_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE MAC_NR_COMMON NFAPI_LIB ITTI SIMU shlib_loader time_management @@ -2012,7 +2006,7 @@ add_executable(nr_dlsim ${PHY_INTERFACE_DIR}/queue_t.c ) target_link_libraries(nr_dlsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common ) target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2042,7 +2036,7 @@ add_executable(nr_ulsim ) target_link_libraries(nr_ulsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common ) target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2112,7 +2106,7 @@ if (${T_TRACER}) #all "add_library" definitions ITTI lte_rrc nr_rrc s1ap x2ap m2ap m3ap f1ap params_libconfig - oai_eth_transpro HASHTABLE UTIL + oai_eth_transpro UTIL SECURITY SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt index 84668852ae..f4611914d4 100644 --- a/common/utils/CMakeLists.txt +++ b/common/utils/CMakeLists.txt @@ -17,9 +17,6 @@ add_subdirectory(time_manager) add_library(utils utils.c system.c time_meas.c time_stat.c tuntap_if.c reverse_bits.c) target_include_directories(utils PUBLIC .) target_link_libraries(utils PRIVATE ${T_LIB}) -if (ENABLE_TESTS) - add_subdirectory(hashtable/tests) -endif() add_subdirectory(barrier) add_subdirectory(actor) add_subdirectory(shm_iq_channel) diff --git a/common/utils/ds/CMakeLists.txt b/common/utils/ds/CMakeLists.txt index b5f5efb47a..22dc7a3c63 100644 --- a/common/utils/ds/CMakeLists.txt +++ b/common/utils/ds/CMakeLists.txt @@ -2,6 +2,8 @@ add_library(ds OBJECT byte_array.c byte_array_producer.c seq_arr.c + hashtable.c + obj_hashtable.c ) target_include_directories(ds PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/common/utils/hashtable/hashtable.c b/common/utils/ds/hashtable.c similarity index 100% rename from common/utils/hashtable/hashtable.c rename to common/utils/ds/hashtable.c diff --git a/common/utils/hashtable/hashtable.h b/common/utils/ds/hashtable.h similarity index 100% rename from common/utils/hashtable/hashtable.h rename to common/utils/ds/hashtable.h diff --git a/common/utils/hashtable/obj_hashtable.c b/common/utils/ds/obj_hashtable.c similarity index 100% rename from common/utils/hashtable/obj_hashtable.c rename to common/utils/ds/obj_hashtable.c diff --git a/common/utils/hashtable/obj_hashtable.h b/common/utils/ds/obj_hashtable.h similarity index 100% rename from common/utils/hashtable/obj_hashtable.h rename to common/utils/ds/obj_hashtable.h diff --git a/common/utils/ds/tests/CMakeLists.txt b/common/utils/ds/tests/CMakeLists.txt index a3ef512f09..a38fba2dab 100644 --- a/common/utils/ds/tests/CMakeLists.txt +++ b/common/utils/ds/tests/CMakeLists.txt @@ -2,3 +2,9 @@ add_executable(test_seq_arr test_seq_array.c) target_link_libraries(test_seq_arr ds alg) add_dependencies(tests test_seq_arr) add_test(NAME test_seq_arr COMMAND test_seq_arr) # no options required + +add_executable(test_hashtable test_hashtable.cpp) +add_dependencies(tests test_hashtable) +target_link_libraries(test_hashtable PRIVATE ds GTest::gtest) +add_test(NAME test_hashtable + COMMAND ./test_hashtable) diff --git a/common/utils/hashtable/tests/test_hashtable.cpp b/common/utils/ds/tests/test_hashtable.cpp similarity index 100% rename from common/utils/hashtable/tests/test_hashtable.cpp rename to common/utils/ds/tests/test_hashtable.cpp diff --git a/common/utils/hashtable/tests/CMakeLists.txt b/common/utils/hashtable/tests/CMakeLists.txt deleted file mode 100644 index baf2461262..0000000000 --- a/common/utils/hashtable/tests/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_executable(test_hashtable test_hashtable.cpp) -add_dependencies(tests test_hashtable) -target_link_libraries(test_hashtable PRIVATE HASHTABLE GTest::gtest) -add_test(NAME test_hashtable - COMMAND ./test_hashtable) diff --git a/openair2/F1AP/CMakeLists.txt b/openair2/F1AP/CMakeLists.txt index 53ab2823ed..052964b3e1 100644 --- a/openair2/F1AP/CMakeLists.txt +++ b/openair2/F1AP/CMakeLists.txt @@ -3,7 +3,7 @@ add_subdirectory(MESSAGES) if(ENABLE_TESTS) add_executable(f1ap_ids_test f1ap_ids_test.c f1ap_ids.c) - target_link_libraries(f1ap_ids_test HASHTABLE minimal_lib) + target_link_libraries(f1ap_ids_test ds minimal_lib) add_dependencies(tests f1ap_ids_test) add_test(NAME F1AP_ID_test COMMAND f1ap_ids_test) diff --git a/openair2/F1AP/f1ap_ids.c b/openair2/F1AP/f1ap_ids.c index 5569d60c48..d222d9e35a 100644 --- a/openair2/F1AP/f1ap_ids.c +++ b/openair2/F1AP/f1ap_ids.c @@ -25,7 +25,7 @@ #include "f1ap_ids.h" #include -#include "common/utils/hashtable/hashtable.h" +#include "ds/hashtable.h" #include "common/utils/assertions.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 03b8ecc2d3..fdb5204081 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -32,7 +32,7 @@ #define MBMS_MULTICAST_OUT #include "assertions.h" -#include "hashtable.h" +#include "ds/hashtable.h" #include "pdcp.h" #include "pdcp_util.h" #include "pdcp_sequence_manager.h" diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h index 4559eb3273..cd9f34b750 100644 --- a/openair2/LAYER2/RLC/rlc.h +++ b/openair2/LAYER2/RLC/rlc.h @@ -37,7 +37,7 @@ #include "common/platform_types.h" #include "common/platform_constants.h" -# include "hashtable.h" +#include "ds/hashtable.h" # include "LTE_asn_constant.h" # include "common/utils/LOG/log.h" #include "intertask_interface.h" diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index e588c2665b..aefe34eec3 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -53,7 +53,7 @@ #include "f1ap_messages_types.h" #include "gnb_config.h" #include "gtpv1_u_messages_types.h" -#include "hashtable.h" +#include "ds/hashtable.h" #include "intertask_interface.h" #include "common/utils/LOG/log.h" #include "nfapi/oai_integration/vendor_ext.h" diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index c8ea0fa878..6b327d92bc 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -35,7 +35,7 @@ #include #include "assertions.h" -#include "hashtable.h" +#include "ds/hashtable.h" #include "oai_asn1.h" #include "rrc_defs.h" #include "rrc_extern.h" From e1736b2fb592836ba3f56f509d653fca95eddce1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Feb 2026 08:03:10 +0100 Subject: [PATCH 07/13] Move softmodem-common.c to separate library This potentially reduces multiple compilation of the same file. --- CMakeLists.txt | 39 ++++++++++++++++---------------------- executables/CMakeLists.txt | 2 ++ 2 files changed, 18 insertions(+), 23 deletions(-) create mode 100644 executables/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index da1a10adb1..ec0b683fc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1687,7 +1687,6 @@ add_executable(lte-softmodem ${OPENAIR_DIR}/executables/lte-ru.c ${OPENAIR_DIR}/executables/ru_control.c ${OPENAIR_DIR}/executables/lte-softmodem.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR_DIR}/executables/create_tasks.c ${OPENAIR_DIR}/executables/create_tasks_mbms.c @@ -1705,7 +1704,7 @@ target_link_libraries(lte-softmodem PRIVATE -Wl,--start-group lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECURITY UTIL SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${NAS_UE_LIB} ITTI SIMU shlib_loader + ${NAS_UE_LIB} ITTI SIMU shlib_loader softmodem_common -Wl,--end-group z dl) target_link_libraries(lte-softmodem PRIVATE pthread m CONFIG_LIB rt) @@ -1723,14 +1722,13 @@ add_executable(oairu ${OPENAIR_DIR}/executables/ru_control.c ${OPENAIR_DIR}/radio/COMMON/common_lib.c ${OPENAIR_DIR}/radio/COMMON/record_player.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c ${OPENAIR_DIR}/executables/main_ru.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ) target_link_libraries(oairu PRIVATE -Wl,--start-group - SCHED_RU_LIB PHY_COMMON PHY_RU UTIL shlib_loader + SCHED_RU_LIB PHY_COMMON PHY_RU UTIL shlib_loader softmodem_common -Wl,--end-group z dl) target_link_libraries(oairu PRIVATE pthread m CONFIG_LIB rt ${T_LIB}) @@ -1747,7 +1745,6 @@ target_link_libraries(lte-softmodem PRIVATE add_executable(lte-uesoftmodem ${OPENAIR_DIR}/executables/lte-ue.c ${OPENAIR_DIR}/executables/lte-uesoftmodem.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/executables/create_tasks_ue.c ${OPENAIR_DIR}/radio/COMMON/common_lib.c ${OPENAIR_DIR}/radio/COMMON/record_player.c @@ -1762,7 +1759,7 @@ target_link_libraries(lte-uesoftmodem PRIVATE lte_rrc nr_rrc s1ap x2ap m2ap m3ap SECURITY UTIL SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU L2_UE L2_LTE SIMU NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${NAS_UE_LIB} ITTI shlib_loader + ${NAS_UE_LIB} ITTI shlib_loader softmodem_common -Wl,--end-group z dl) target_link_libraries(lte-uesoftmodem PRIVATE pthread m CONFIG_LIB rt) @@ -1783,11 +1780,11 @@ add_executable(nr-oru ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c ${OPENAIR_DIR}/radio/COMMON/common_lib.c ${OPENAIR_DIR}/radio/COMMON/record_player.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/executables/main_nr_ru.c ) target_link_libraries(nr-oru PRIVATE - UTIL SCHED_RU_LIB PHY_COMMON PHY_RU PHY_NR shlib_loader z dl) + UTIL SCHED_RU_LIB PHY_COMMON PHY_RU PHY_NR shlib_loader z dl + softmodem_common) target_link_libraries(nr-oru PRIVATE pthread m CONFIG_LIB rt ${T_LIB} utils barrier actor) target_link_libraries(nr-oru PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs nr_phy_common time_management) @@ -1802,7 +1799,6 @@ add_executable(nr-softmodem ${OPENAIR_DIR}/executables/nr-gnb.c ${OPENAIR_DIR}/executables/nr-ru.c ${OPENAIR_DIR}/executables/nr-softmodem.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/radio/COMMON/common_lib.c ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c @@ -1817,7 +1813,7 @@ target_link_libraries(nr-softmodem PRIVATE ITTI ${NAS_UE_LIB} lte_rrc nr_rrc ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU x2ap f1ap m2ap m3ap e1ap shlib_loader - time_management + time_management softmodem_common -Wl,--end-group z dl) target_link_libraries(nr-softmodem PRIVATE pthread m CONFIG_LIB rt) @@ -1847,7 +1843,6 @@ target_link_libraries(nr-softmodem PRIVATE add_executable(nr-cuup executables/nr-cuup.c - executables/softmodem-common.c ${NR_RRC_DIR}/rrc_gNB_UE_context.c ${OPENAIR2_DIR}/E1AP/e1ap_setup.c ${NR_PDCP_SRC} @@ -1857,7 +1852,7 @@ add_executable(nr-cuup target_link_libraries(nr-cuup PRIVATE CONFIG_LIB ITTI SCTP_CLIENT GTPV1U e1ap f1ap - time_management + time_management softmodem_common alg z dl pthread shlib_loader ${T_LIB}) target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) @@ -1876,7 +1871,6 @@ add_executable(nr-uesoftmodem ${OPENAIR_DIR}/executables/position_interface.c ${OPENAIR_DIR}/executables/nr-ue.c ${OPENAIR_DIR}/executables/nr-ue-ru.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/radio/COMMON/common_lib.c ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -1891,7 +1885,7 @@ target_link_libraries(nr-uesoftmodem PRIVATE nr_rrc SECURITY UTIL SCHED_RU_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE MAC_NR_COMMON NFAPI_LIB ITTI SIMU shlib_loader - time_management + time_management softmodem_common -Wl,--end-group z dl) target_link_libraries(nr-uesoftmodem PRIVATE pthread m CONFIG_LIB rt nr_ue_phy_meas) @@ -1925,9 +1919,10 @@ add_executable(rftest ${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_test.c ${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_scope.c ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/executables/softmodem-common.c ) -target_link_libraries(rftest PRIVATE minimal_lib PHY_NR_COMMON UTIL forms pthread dl m ${T_LIB} shlib_loader) +target_link_libraries(rftest PRIVATE + minimal_lib PHY_NR_COMMON UTIL forms pthread dl m ${T_LIB} + shlib_loader softmodem_common) target_link_libraries(rftest PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_executable(polartest @@ -1980,14 +1975,13 @@ target_link_libraries(nr_pbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_psbchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/psbchsim.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c ) target_link_libraries(nr_psbchsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader physim_common + m pthread ${T_LIB} ITTI dl shlib_loader physim_common softmodem_common ) target_link_libraries(nr_psbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2000,7 +1994,6 @@ target_link_libraries(nr_pucchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_dlsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlsim.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c @@ -2008,6 +2001,7 @@ add_executable(nr_dlsim target_link_libraries(nr_dlsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common + softmodem_common ) target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2029,7 +2023,6 @@ target_link_libraries(nr_ulschsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_ulsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulsim.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c @@ -2037,13 +2030,12 @@ add_executable(nr_ulsim target_link_libraries(nr_ulsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common + m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common softmodem_common ) target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_srssim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/srssim.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c @@ -2051,7 +2043,7 @@ add_executable(nr_srssim target_link_libraries(nr_srssim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc L2_NR -Wl,--end-group - m pthread ITTI dl nr_ue_phy_meas physim_common + m pthread ITTI dl nr_ue_phy_meas physim_common softmodem_common ) # these simulators do not compile: @@ -2159,6 +2151,7 @@ if(ENABLE_TESTS) endif() add_subdirectory(common) +add_subdirectory(executables) add_subdirectory(doc) add_subdirectory(nfapi) add_subdirectory(openair1) diff --git a/executables/CMakeLists.txt b/executables/CMakeLists.txt new file mode 100644 index 0000000000..d3b925bb02 --- /dev/null +++ b/executables/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(softmodem_common STATIC softmodem-common.c) +target_link_libraries(softmodem_common PUBLIC shlib_loader) From 7da5d3889fbc828ec4ce8daf6bc8705410253196 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Feb 2026 08:09:54 +0100 Subject: [PATCH 08/13] Split common_lib.c in separate compilation unit This avoids double compilation. --- CMakeLists.txt | 53 +++++++++++++------------------------ radio/CMakeLists.txt | 2 ++ radio/COMMON/CMakeLists.txt | 3 +++ radio/COMMON/common_lib.c | 1 - 4 files changed, 24 insertions(+), 35 deletions(-) create mode 100644 radio/COMMON/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index ec0b683fc8..a11137d1ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -515,8 +515,6 @@ target_link_libraries(params_libconfig PRIVATE config_internals ${libconfig_LIBR add_library(shlib_loader OBJECT common/utils/load_module_shlib.c) target_link_libraries(shlib_loader PRIVATE CONFIG_LIB) -include_directories ("${OPENAIR_DIR}/radio/COMMON") - ############################################################## # ???!!! TO BE DOCUMENTED OPTIONS !!!??? ############################################################## @@ -1690,8 +1688,6 @@ add_executable(lte-softmodem ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR_DIR}/executables/create_tasks.c ${OPENAIR_DIR}/executables/create_tasks_mbms.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${PHY_INTERFACE_DIR}/queue_t.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c @@ -1704,7 +1700,7 @@ target_link_libraries(lte-softmodem PRIVATE -Wl,--start-group lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECURITY UTIL SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${NAS_UE_LIB} ITTI SIMU shlib_loader softmodem_common + ${NAS_UE_LIB} ITTI SIMU radio_common softmodem_common -Wl,--end-group z dl) target_link_libraries(lte-softmodem PRIVATE pthread m CONFIG_LIB rt) @@ -1720,15 +1716,13 @@ endif() add_executable(oairu ${OPENAIR_DIR}/executables/lte-ru.c ${OPENAIR_DIR}/executables/ru_control.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c ${OPENAIR_DIR}/executables/main_ru.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ) target_link_libraries(oairu PRIVATE -Wl,--start-group - SCHED_RU_LIB PHY_COMMON PHY_RU UTIL shlib_loader softmodem_common + SCHED_RU_LIB PHY_COMMON PHY_RU UTIL radio_common softmodem_common -Wl,--end-group z dl) target_link_libraries(oairu PRIVATE pthread m CONFIG_LIB rt ${T_LIB}) @@ -1746,8 +1740,6 @@ add_executable(lte-uesoftmodem ${OPENAIR_DIR}/executables/lte-ue.c ${OPENAIR_DIR}/executables/lte-uesoftmodem.c ${OPENAIR_DIR}/executables/create_tasks_ue.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c @@ -1759,7 +1751,7 @@ target_link_libraries(lte-uesoftmodem PRIVATE lte_rrc nr_rrc s1ap x2ap m2ap m3ap SECURITY UTIL SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU L2_UE L2_LTE SIMU NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${NAS_UE_LIB} ITTI shlib_loader softmodem_common + ${NAS_UE_LIB} ITTI radio_common softmodem_common -Wl,--end-group z dl) target_link_libraries(lte-uesoftmodem PRIVATE pthread m CONFIG_LIB rt) @@ -1778,13 +1770,11 @@ add_executable(nr-oru ${OPENAIR_DIR}/openair1/SCHED_NR/phy_frame_config_nr.c ${OPENAIR_DIR}/openair1/SCHED_NR/nr_prach_procedures.c ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR_DIR}/executables/main_nr_ru.c ) target_link_libraries(nr-oru PRIVATE UTIL SCHED_RU_LIB PHY_COMMON PHY_RU PHY_NR shlib_loader z dl - softmodem_common) + radio_common softmodem_common) target_link_libraries(nr-oru PRIVATE pthread m CONFIG_LIB rt ${T_LIB} utils barrier actor) target_link_libraries(nr-oru PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs nr_phy_common time_management) @@ -1799,8 +1789,6 @@ add_executable(nr-softmodem ${OPENAIR_DIR}/executables/nr-gnb.c ${OPENAIR_DIR}/executables/nr-ru.c ${OPENAIR_DIR}/executables/nr-softmodem.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${PHY_INTERFACE_DIR}/queue_t.c @@ -1812,7 +1800,7 @@ target_link_libraries(nr-softmodem PRIVATE UTIL SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECURITY ITTI ${NAS_UE_LIB} lte_rrc nr_rrc ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU - x2ap f1ap m2ap m3ap e1ap shlib_loader + x2ap f1ap m2ap m3ap e1ap radio_common time_management softmodem_common -Wl,--end-group z dl) @@ -1854,7 +1842,7 @@ target_link_libraries(nr-cuup PRIVATE GTPV1U e1ap f1ap time_management softmodem_common alg - z dl pthread shlib_loader ${T_LIB}) + z dl pthread ${T_LIB}) target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) if(E2_AGENT) target_link_libraries(nr-cuup PRIVATE e2_agent e2_agent_arg e2_ran_func_cuup) @@ -1871,8 +1859,6 @@ add_executable(nr-uesoftmodem ${OPENAIR_DIR}/executables/position_interface.c ${OPENAIR_DIR}/executables/nr-ue.c ${OPENAIR_DIR}/executables/nr-ue-ru.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common_tdd.c ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c @@ -1884,7 +1870,7 @@ target_link_libraries(nr-uesoftmodem PRIVATE -Wl,--start-group nr_rrc SECURITY UTIL SCHED_RU_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE MAC_NR_COMMON NFAPI_LIB - ITTI SIMU shlib_loader + ITTI SIMU radio_common time_management softmodem_common -Wl,--end-group z dl) @@ -1918,11 +1904,10 @@ target_link_libraries(nr-uesoftmodem PRIVATE add_executable(rftest ${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_test.c ${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_scope.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c ) target_link_libraries(rftest PRIVATE minimal_lib PHY_NR_COMMON UTIL forms pthread dl m ${T_LIB} - shlib_loader softmodem_common) + radio_common softmodem_common) target_link_libraries(rftest PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_executable(polartest @@ -1939,7 +1924,7 @@ add_executable(smallblocktest target_link_libraries(smallblocktest PRIVATE -Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON -Wl,--end-group - m pthread dl shlib_loader ${T_LIB} + m pthread dl ${T_LIB} ) @@ -1949,7 +1934,7 @@ add_executable(ldpctest ) target_link_libraries(ldpctest PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON -Wl,--end-group - m pthread dl shlib_loader ${T_LIB} + m pthread dl ${T_LIB} # link 'check_crc' to make it resolved in the LDPC coding libraries # 'check_crc' is not used in ldpctest so it is not linked in the executable by default # --whole-archive links 'check_crc' in the executable even though it is note used, see 'man ld' @@ -1962,14 +1947,14 @@ target_link_libraries(physim_common PRIVATE UTIL) add_executable(nr_dlschsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c) target_link_libraries(nr_dlschsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader physim_common + m pthread ${T_LIB} ITTI dl physim_common ) target_link_libraries(nr_dlschsim PRIVATE asn1_nr_rrc_hdrs) add_executable(nr_pbchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c) target_link_libraries(nr_pbchsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader physim_common + m pthread ${T_LIB} ITTI dl physim_common ) target_link_libraries(nr_pbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -1981,14 +1966,14 @@ add_executable(nr_psbchsim ) target_link_libraries(nr_psbchsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader physim_common softmodem_common + m pthread ${T_LIB} ITTI dl physim_common softmodem_common ) target_link_libraries(nr_psbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_pucchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c) target_link_libraries(nr_pucchsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader physim_common + m pthread ${T_LIB} ITTI dl physim_common ) target_link_libraries(nr_pucchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2000,7 +1985,7 @@ add_executable(nr_dlsim ) target_link_libraries(nr_dlsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common + m pthread ${T_LIB} ITTI dl nr_ue_phy_meas physim_common softmodem_common ) target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2008,7 +1993,7 @@ target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_prachsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c) target_link_libraries(nr_prachsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader physim_common) + m pthread ${T_LIB} ITTI dl physim_common) target_link_libraries(nr_prachsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_ulschsim @@ -2017,7 +2002,7 @@ add_executable(nr_ulschsim ) target_link_libraries(nr_ulschsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader physim_common + m pthread ${T_LIB} ITTI dl physim_common ) target_link_libraries(nr_ulschsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2030,7 +2015,7 @@ add_executable(nr_ulsim target_link_libraries(nr_ulsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common softmodem_common + m pthread ${T_LIB} ITTI dl nr_ue_phy_meas physim_common softmodem_common ) target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2059,7 +2044,7 @@ foreach(myExe dlsim ulsim) ) target_link_libraries (${myExe} PRIVATE -Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU ITTI -Wl,--end-group - pthread m rt CONFIG_LIB ${T_LIB} dl shlib_loader + pthread m rt CONFIG_LIB ${T_LIB} dl ) target_link_libraries(${myExe} PRIVATE asn1_lte_rrc_hdrs) add_dependencies(${myExe} coding) diff --git a/radio/CMakeLists.txt b/radio/CMakeLists.txt index 1159416afa..c5da06ffde 100644 --- a/radio/CMakeLists.txt +++ b/radio/CMakeLists.txt @@ -1,3 +1,5 @@ +add_subdirectory(COMMON) + add_boolean_option(OAI_AW2SORI OFF "Activate OAI's AW2S driver" OFF) if(OAI_AW2SORI) add_subdirectory(AW2SORI) diff --git a/radio/COMMON/CMakeLists.txt b/radio/COMMON/CMakeLists.txt new file mode 100644 index 0000000000..af70ac4047 --- /dev/null +++ b/radio/COMMON/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(radio_common STATIC common_lib.c record_player.c) +target_include_directories(radio_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(radio_common PUBLIC dl log_headers shlib_loader) diff --git a/radio/COMMON/common_lib.c b/radio/COMMON/common_lib.c index 7b70dc20fa..4720347f20 100644 --- a/radio/COMMON/common_lib.c +++ b/radio/COMMON/common_lib.c @@ -40,7 +40,6 @@ #include "assertions.h" #include "common/utils/load_module_shlib.h" #include "common/utils/LOG/log.h" -//#include "targets/RT/USER/lte-softmodem.h" #include "executables/softmodem-common.h" #define MAX_GAP 100ULL From b14127b3ffb2d3b507a6d47022809ba38e8b8980 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 8 Feb 2026 16:23:33 +0100 Subject: [PATCH 09/13] Remove double-declared C files Is already linked in through MAC_NR_COMMON. --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a11137d1ef..441713eb6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1859,8 +1859,6 @@ add_executable(nr-uesoftmodem ${OPENAIR_DIR}/executables/position_interface.c ${OPENAIR_DIR}/executables/nr-ue.c ${OPENAIR_DIR}/executables/nr-ue-ru.c - ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c - ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common_tdd.c ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c ${NFAPI_USER_DIR}/nfapi.c ${PHY_INTERFACE_DIR}/queue_t.c From d1aa6b1d7c0a7a4b08a70886bd85ed81de96e6f1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Feb 2026 08:25:35 +0100 Subject: [PATCH 10/13] Remove unused headers --- openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c | 1 - openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c b/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c index ecdf3dfd72..3291a74719 100644 --- a/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c +++ b/openair2/LAYER2/nr_pdcp/cucp_cuup_handler.c @@ -37,7 +37,6 @@ #include "common/utils/oai_asn1.h" #include "constr_TYPE.h" #include "cuup_cucp_if.h" -#include "gtpv1_u_messages_types.h" #include "nr_pdcp/nr_pdcp_entity.h" #include "nr_pdcp_oai_api.h" #include "openair2/COMMON/e1ap_messages_types.h" diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index aefe34eec3..fdc0c57fe4 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -31,11 +31,6 @@ #include #include #include -#include "LAYER2/MAC/mac_extern.h" -#include "LTE_DRB-ToAddModList.h" -#include "LTE_DRB-ToReleaseList.h" -#include "LTE_PMCH-InfoList-r9.h" -#include "LTE_SRB-ToAddModList.h" #include "NR_DRB-ToAddMod.h" #include "NR_QFI.h" #include "NR_SDAP-Config.h" From 12e9ab1412d54e255829c7347e1eaec6475f5d69 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Feb 2026 08:31:55 +0100 Subject: [PATCH 11/13] Remove unused type --- openair2/COMMON/rrc_messages_types.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index cfc6914f4b..ee848f6f06 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -425,12 +425,6 @@ typedef struct NRRrcConfigurationReq_s { int drbs; } gNB_RrcConfigurationReq; -typedef struct NRDuDlReq_s { - rnti_t rnti; - uint8_t *buf; - uint64_t srb_id; -} NRDuDlReq_t; - // eNB: realtime -> RRC messages typedef struct rrc_subframe_process_s { protocol_ctxt_t ctxt; From 4d4d0d4dd4548ed15519212e55c93be030d1e0f4 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Feb 2026 08:38:22 +0100 Subject: [PATCH 12/13] Move RRC config to RRC header, rename openair2/COMMON/rrc_messages_types.h has mostly 4G types. The only 5G (gNB) RRC type is gNB_RrcConfigurationReq, which we can move to a header in the corresponding directory (where it is used). This allows to separate 5G gNB RRC module from the 4G types in rrc_messages_types.h in the next commit. --- openair2/COMMON/rrc_messages_types.h | 11 ----------- openair2/GNB_APP/gnb_config.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 1 - openair2/RRC/NR/MESSAGES/asn1_msg.h | 1 - openair2/RRC/NR/nr_rrc_defs.h | 12 +++++++++++- openair2/RRC/NR/nr_rrc_proto.h | 2 +- openair2/RRC/NR/rrc_gNB.c | 4 ++-- openair2/RRC/NR/rrc_gNB_NGAP.c | 2 +- openair2/RRC/NR/rrc_gNB_du.c | 2 +- 9 files changed, 17 insertions(+), 20 deletions(-) diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index ee848f6f06..d11e6573c7 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -414,17 +414,6 @@ typedef struct NbIoTRrcConfigurationReq_s { long ue_TimersAndConstants_n311_NB; } NbIoTRrcConfigurationReq; -// gNB: GNB_APP -> RRC messages -typedef struct NRRrcConfigurationReq_s { - uint32_t tac; - plmn_id_t plmn[PLMN_LIST_MAX_SIZE]; - uint8_t num_plmn; - - bool um_on_default_drb; - bool enable_sdap; - int drbs; -} gNB_RrcConfigurationReq; - // eNB: realtime -> RRC messages typedef struct rrc_subframe_process_s { protocol_ctxt_t ctxt; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 0b3845f5b9..8e1c4637b7 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -2068,7 +2068,7 @@ gNB_RRC_INST *RCconfig_NRRRC() // search if in active list - gNB_RrcConfigurationReq nrrrc_config = {0}; + nr_rrc_config_t nrrrc_config = {0}; for (k=0; k xids[xid] = RRC_SETUP; NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, false); - int size = do_RRCSetup(buf, sizeof(buf), xid, masterCellGroup, masterCellGroup_len, &rrc->configuration, SRBs); + int size = do_RRCSetup(buf, sizeof(buf), xid, masterCellGroup, masterCellGroup_len, SRBs); AssertFatal(size > 0, "do_RRCSetup failed\n"); AssertFatal(size <= 1024, "memory corruption\n"); diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index bf8a797a49..d9928e1abd 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1590,7 +1590,7 @@ int rrc_gNB_process_PAGING_IND(MessageDef *msg_p, instance_t instance) p->mnc_digit_length, p->mnc, msg->tac[tai_size]); - gNB_RrcConfigurationReq *req = &RC.nrrrc[instance]->configuration; + nr_rrc_config_t *req = &RC.nrrrc[instance]->configuration; for (uint8_t j = 0; j < req->num_plmn; j++) { plmn_id_t *req_plmn = &req->plmn[j]; if (req_plmn->mcc == p->mcc && req_plmn->mnc == p->mnc && req->tac == msg->tac[tai_size]) { diff --git a/openair2/RRC/NR/rrc_gNB_du.c b/openair2/RRC/NR/rrc_gNB_du.c index 246df60626..b2aa18158f 100644 --- a/openair2/RRC/NR/rrc_gNB_du.c +++ b/openair2/RRC/NR/rrc_gNB_du.c @@ -98,7 +98,7 @@ RB_GENERATE/*_STATIC*/(rrc_du_tree, nr_rrc_du_container_t, entries, du_compare); static bool rrc_gNB_plmn_matches(const gNB_RRC_INST *rrc, const f1ap_served_cell_info_t *info) { - const gNB_RrcConfigurationReq *conf = &rrc->configuration; + const nr_rrc_config_t *conf = &rrc->configuration; return conf->num_plmn == 1 // F1 supports only one && conf->plmn[0].mcc == info->plmn.mcc && conf->plmn[0].mnc == info->plmn.mnc; } From 0464329eed8d52fca13f5f777685b30157dc2960 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Feb 2026 08:40:44 +0100 Subject: [PATCH 13/13] Make 5G RRC not depend on LTE code --- openair2/RRC/NR/MESSAGES/asn1_msg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index e9257504cb..d6783211a6 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -32,6 +32,7 @@ #define __RRC_NR_MESSAGES_ASN1_MSG__H__ #include +#include "common/platform_constants.h" #include #include #include "NR_ARFCN-ValueNR.h" @@ -52,10 +53,10 @@ #include "NR_SecurityConfig.h" #include "NR_MeasurementReport.h" #include "NR_MeasurementTimingConfiguration.h" +#include "NR_UE-NR-Capability.h" #include "NR_UE-CapabilityRAT-ContainerList.h" #include "ds/seq_arr.h" #include "ds/byte_array.h" -#include "rrc_messages_types.h" #include "openair2/LAYER2/nr_pdcp/nr_pdcp_configuration.h" #include "common/utils/nr/nr_common.h" struct asn_TYPE_descriptor_s;