diff --git a/.gitignore b/.gitignore
index d1c6979e76..0733b4c180 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,14 @@ GRTAGS
GTAGS
tags
+# Package conffiles
+
+tools/packages/oai-lte/conffiles
+tools/packages/oai-nr/conffiles
+tools/packages/liboai-common/conffiles
+tools/packages/liboai-usrp/conffiles
+
+
# others
nfapi_nr_interface_scf
*.log
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 14d90a4c3b..bae1c590bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,7 @@
cmake_minimum_required (VERSION 3.16)
project (OpenAirInterface LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
+set(OAI_VERSION 2.4.0)
#########################################################
# Base directories, compatible with legacy OAI building #
@@ -61,6 +62,15 @@ endif()
###################################
include(FindPkgConfig)
+
+option(PACKAGING_RPM "By default will create debian packages, with this option willl create rpm packages" OFF)
+option(PACKAGING_NR "Will produce a package containing nr target, configuration files and docs" OFF)
+option(PACKAGING_LTE "Will produce a package containing lte target, configuration files and docs" OFF)
+option(PACKAGING_COMMON "Will produce a package containing common target, configuration files and docs" OFF)
+option(PACKAGING_USRP "Will produce a package containing usrp target, configuration files and docs" OFF)
+option(PACKAGING_PHYSIM "Will produce a package containing physim target, configuration files and docs" OFF)
+
+
# Check if asn1c is installed, and check if it supports all options we need
# a user can provide ASN1C_EXEC to override an asn1c to use (e.g., parallel
# installation)
@@ -87,8 +97,6 @@ set (NFAPI_USER_DIR ${OPENAIR_DIR}/nfapi/oai_integration)
set (OPENAIR1_DIR ${OPENAIR_DIR}/openair1)
set (OPENAIR2_DIR ${OPENAIR_DIR}/openair2)
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
-set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
-set (OPENAIR_CMAKE ${OPENAIR_DIR}/cmake_targets)
project (OpenAirInterface)
@@ -222,9 +230,16 @@ endif()
add_definitions("-DASN_DISABLE_OER_SUPPORT -DHAVE_CONFIG_H -DHAVE_CONFIG_H_")
-#########################
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb2 -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
-#########################
+set(CMAKE_SKIP_BUILD_RPATH FALSE)
+set(CMAKE_BUILD_RPATH ${CMAKE_CURRENT_BINARY_DIR})
+set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+set(CMAKE_INSTALL_RPATH "")
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
+
+if(PACKAGING_LTE OR PACKAGING_NR OR PACKAGING_COMMON OR PACKAGING_USRP OR PACKAGING_PHYSIM)
+ set(CMAKE_SKIP_INSTALL_RPATH TRUE)
+endif()
+
# set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files
set(debugOpt "-ggdb2 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks")
@@ -1789,6 +1804,24 @@ target_link_libraries(lte-uesoftmodem PRIVATE ${blas_LIBRARIES} ${cblas_LIBRARIE
target_link_libraries(lte-uesoftmodem PRIVATE
asn1_lte_rrc asn1_s1ap asn1_m2ap asn1_m3ap asn1_x2ap)
+# nr RRU
+add_executable(nr-oru
+ ${OPENAIR_DIR}/executables/nr-ru.c
+ ${OPENAIR_DIR}/openair1/PHY/INIT/nr_parms.c
+ ${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/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)
+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)
+
# nr-softmodem
###################################################
@@ -1872,6 +1905,7 @@ add_executable(nr-uesoftmodem
${OPENAIR_DIR}/executables/nr-uesoftmodem.c
${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
@@ -2162,3 +2196,8 @@ add_subdirectory(openair2)
add_subdirectory(openair3)
add_subdirectory(radio)
add_subdirectory(tests)
+
+
+if(PACKAGING_LTE OR PACKAGING_NR OR PACKAGING_COMMON OR PACKAGING_USRP OR PACKAGING_PHYSIM)
+ include("tools/packages/packages.cmake")
+endif()
diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py
index d20bac6f44..7826a32a61 100644
--- a/ci-scripts/cls_containerize.py
+++ b/ci-scripts/cls_containerize.py
@@ -324,6 +324,7 @@ class Containerize():
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
imageNames.append(('ran-build-fhi72', 'build.fhi72', 'ran-build-fhi72', ''))
imageNames.append(('oai-gnb', 'gNB.fhi72', 'oai-gnb-fhi72', ''))
+ imageNames.append(('oai-nr-oru', 'nrORU.fhi72', 'oai-nr-oru', ''))
result = re.search('build_cross_arm64', self.imageKind)
if result is not None:
self.dockerfileprefix = '.ubuntu.cross-arm64'
@@ -412,18 +413,18 @@ class Containerize():
# target images should use the proper ran-build image
if image != 'ran-build' and "-asan" in name:
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build-asan:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
- elif "fhi72" in name:
+ elif "fhi72" in name or name == "oai-nr-oru":
cmd.run(f'sed -i -e "s#ran-build-fhi72:latest#ran-build-fhi72:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
elif image != 'ran-build':
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
if image == 'oai-gnb-aerial':
- cmd.run('cp -f /opt/nvidia-ipc/nvipc_src.2025.10.09.tar.gz .')
+ cmd.run('cp -f /opt/nvidia-ipc/nvipc_src.2026.01.07.tar.gz .')
logfile = f'{lSourcePath}/cmake_targets/log/{name}.docker.log'
ret = cmd.run(f'{self.cli} build {self.cliBuildOptions} --target {image} --tag {name}:{imageTag} --file docker/Dockerfile.{pattern}{self.dockerfileprefix} {option} . > {logfile} 2>&1', timeout=1200)
t = (name, archiveArtifact(cmd, ctx, logfile))
log_files.append(t)
if image == 'oai-gnb-aerial':
- cmd.run('rm -f nvipc_src.2025.10.09.tar.gz')
+ cmd.run('rm -f nvipc_src.2026.01.07.tar.gz')
# check the status of the build
ret = cmd.run(f"{self.cli} image inspect --format=\'Size = {{{{.Size}}}} bytes\' {name}:{imageTag}")
if ret.returncode != 0:
diff --git a/ci-scripts/conf_files/enb.band38.25prb.rfsim.conf b/ci-scripts/conf_files/enb.band38.25prb.rfsim.conf
index c98544557b..e92d666f2a 100644
--- a/ci-scripts/conf_files/enb.band38.25prb.rfsim.conf
+++ b/ci-scripts/conf_files/enb.band38.25prb.rfsim.conf
@@ -200,9 +200,11 @@ RUs = (
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
THREAD_STRUCT = (
{
diff --git a/ci-scripts/conf_files/enb.band7.100prb.rfsim.conf b/ci-scripts/conf_files/enb.band7.100prb.rfsim.conf
index aa110bbf95..b5fc72c839 100644
--- a/ci-scripts/conf_files/enb.band7.100prb.rfsim.conf
+++ b/ci-scripts/conf_files/enb.band7.100prb.rfsim.conf
@@ -233,9 +233,11 @@ RUs =
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
THREAD_STRUCT =
(
diff --git a/ci-scripts/conf_files/enb.band7.25prb.rfsim.conf b/ci-scripts/conf_files/enb.band7.25prb.rfsim.conf
index cc7c74cd35..043fad4cae 100644
--- a/ci-scripts/conf_files/enb.band7.25prb.rfsim.conf
+++ b/ci-scripts/conf_files/enb.band7.25prb.rfsim.conf
@@ -233,9 +233,11 @@ RUs =
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
THREAD_STRUCT =
(
diff --git a/ci-scripts/conf_files/enb.band7.25prb.rfsim.nos1.conf b/ci-scripts/conf_files/enb.band7.25prb.rfsim.nos1.conf
index cc7c74cd35..043fad4cae 100644
--- a/ci-scripts/conf_files/enb.band7.25prb.rfsim.nos1.conf
+++ b/ci-scripts/conf_files/enb.band7.25prb.rfsim.nos1.conf
@@ -233,9 +233,11 @@ RUs =
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
THREAD_STRUCT =
(
diff --git a/ci-scripts/conf_files/enb.band7.50prb.rfsim.conf b/ci-scripts/conf_files/enb.band7.50prb.rfsim.conf
index f55adad153..5c9e7a7f41 100644
--- a/ci-scripts/conf_files/enb.band7.50prb.rfsim.conf
+++ b/ci-scripts/conf_files/enb.band7.50prb.rfsim.conf
@@ -233,9 +233,11 @@ RUs =
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
THREAD_STRUCT =
(
diff --git a/ci-scripts/conf_files/enb.band7.tm1.25prb.rfsim.mbms.conf b/ci-scripts/conf_files/enb.band7.tm1.25prb.rfsim.mbms.conf
index 4e0b0fa089..5b996ca9a2 100644
--- a/ci-scripts/conf_files/enb.band7.tm1.25prb.rfsim.mbms.conf
+++ b/ci-scripts/conf_files/enb.band7.tm1.25prb.rfsim.mbms.conf
@@ -362,9 +362,11 @@ RUs = (
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
THREAD_STRUCT = (
{
diff --git a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf
index fbc6de9b5e..56eef38c0a 100644
--- a/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf
+++ b/ci-scripts/conf_files/gnb-du.sa.band78.106prb.rfsim.conf
@@ -197,13 +197,15 @@ RUs = (
}
);
-rfsimulator: {
-serveraddr = "server";
+rfsimulator = (
+ {
+ serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
- IQfile = "/tmp/rfsimulator.iqs"
-}
+ IQfile = "/tmp/rfsimulator.iqs";
+ }
+);
log_config: {
global_log_level = "info";
diff --git a/ci-scripts/conf_files/gnb-pnf.band66.rfsim.conf b/ci-scripts/conf_files/gnb-pnf.band66.rfsim.conf
index d61d3032be..785a47022a 100644
--- a/ci-scripts/conf_files/gnb-pnf.band66.rfsim.conf
+++ b/ci-scripts/conf_files/gnb-pnf.band66.rfsim.conf
@@ -27,14 +27,15 @@ RUs = ({
eNB_instances = [0];
});
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
log_config: {
global_log_level = "info";
diff --git a/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.conf b/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.conf
index 9e95918e6f..1d99a472c4 100644
--- a/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.conf
+++ b/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.conf
@@ -13,16 +13,7 @@ gNBs =
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
- plmn_list = ({
- mcc = 208;
- mnc = 97;
- mnc_length = 2;
- snssaiList = (
- {
- sst = 1;
- }
- );
- });
+ plmn_list = ({ mcc = 208; mnc = 97; mnc_length = 2; snssaiList = ({ sst = 1; }) });
nr_cellid = 12345678L;
@@ -186,19 +177,19 @@ gNBs =
MACRLCs = (
{
- num_cc = 1;
- remote_s_address = "127.0.0.1"; // pnf addr [!]
- local_s_address = "127.0.0.2"; // vnf addr
- local_s_portc = 50001; // vnf p5 port
- remote_s_portc = 50000; // pnf p5 port [!]
- local_s_portd = 50011; // vnf p7 port [!]
- remote_s_portd = 50010; // pnf p7 port [!]
- tr_s_preference = "aerial";
- tr_n_preference = "local_RRC";
- pusch_TargetSNRx10 = 280; # 150;
- pucch_TargetSNRx10 = 200; #200;
- dl_max_mcs = 28;
- ul_max_mcs = 28;
+ num_cc = 1;
+ remote_s_address = "127.0.0.1"; // pnf addr [!]
+ local_s_address = "127.0.0.2"; // vnf addr
+ local_s_portc = 50001; // vnf p5 port
+ remote_s_portc = 50000; // pnf p5 port [!]
+ local_s_portd = 50011; // vnf p7 port [!]
+ remote_s_portd = 50010; // pnf p7 port [!]
+ tr_s_preference = "aerial";
+ tr_n_preference = "local_RRC";
+ pusch_TargetSNRx10 = 280; # 150;
+ pucch_TargetSNRx10 = 200; #200;
+ dl_max_mcs = 28;
+ ul_max_mcs = 28;
}
);
@@ -222,13 +213,13 @@ security = {
log_config :
{
- global_log_level ="info";
- hw_log_level ="info";
- phy_log_level ="info";
- mac_log_level ="info";
- rlc_log_level ="info";
- pdcp_log_level ="info";
- rrc_log_level ="info";
- ngap_log_level ="debug";
- f1ap_log_level ="debug";
+ global_log_level ="info";
+ hw_log_level ="info";
+ phy_log_level ="info";
+ mac_log_level ="info";
+ rlc_log_level ="info";
+ pdcp_log_level ="info";
+ rrc_log_level ="info";
+ ngap_log_level ="debug";
+ f1ap_log_level ="debug";
};
diff --git a/ci-scripts/conf_files/gnb.band66.106prb.rfsim.phytest-dora.conf b/ci-scripts/conf_files/gnb.band66.106prb.rfsim.phytest-dora.conf
index e69fee4722..0c62f664ce 100644
--- a/ci-scripts/conf_files/gnb.band66.106prb.rfsim.phytest-dora.conf
+++ b/ci-scripts/conf_files/gnb.band66.106prb.rfsim.phytest-dora.conf
@@ -191,10 +191,11 @@ RUs = (
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
-
+ }
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.band78.106prb.rfsim.phytest-dora.conf b/ci-scripts/conf_files/gnb.band78.106prb.rfsim.phytest-dora.conf
index 737ef0aadf..689dc92f2b 100644
--- a/ci-scripts/conf_files/gnb.band78.106prb.rfsim.phytest-dora.conf
+++ b/ci-scripts/conf_files/gnb.band78.106prb.rfsim.phytest-dora.conf
@@ -200,10 +200,11 @@ RUs = (
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
-
+ }
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf
index 8d71434f66..73f92960ca 100644
--- a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf
+++ b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf
@@ -234,14 +234,15 @@ RUs = (
}
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = ("chanmod"); #("saviq"); or/and "chanmod"
prop_delay = 20;
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
channelmod = {
max_chan=10;
diff --git a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf
index b3884a3d31..83e6ec3983 100644
--- a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf
+++ b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf
@@ -242,14 +242,15 @@ RUs = (
}
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
prop_delay = 238.74;
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band257.u3.66prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band257.u3.66prb.rfsim.conf
index d7c0e1a307..0c1ca120d5 100644
--- a/ci-scripts/conf_files/gnb.sa.band257.u3.66prb.rfsim.conf
+++ b/ci-scripts/conf_files/gnb.sa.band257.u3.66prb.rfsim.conf
@@ -202,9 +202,11 @@ RUs = ({
eNB_instances = [0];
});
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band66.106prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band66.106prb.rfsim.conf
index 95384a0ae1..bae2bc15ff 100644
--- a/ci-scripts/conf_files/gnb.sa.band66.106prb.rfsim.conf
+++ b/ci-scripts/conf_files/gnb.sa.band66.106prb.rfsim.conf
@@ -205,14 +205,15 @@ RUs = (
);
-rfsimulator :
-{
+rfsimulator = (
+ {
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+ }
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf b/ci-scripts/conf_files/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf
index b066c27810..c01c9afc79 100644
--- a/ci-scripts/conf_files/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf
+++ b/ci-scripts/conf_files/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf
@@ -251,7 +251,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("98:ae:71:04:83:e3", "98:ae:71:04:83:e3");
- mtu = 9600;
+ mtu = 9216;
fh_config = ({
T1a_cp_dl = (285, 470);
T1a_cp_ul = (285, 429);
diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf
index c297e40311..47c16c16d8 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.conf
@@ -208,9 +208,11 @@ RUs = (
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf
index c54af1a4bb..a3f338f719 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf
@@ -197,9 +197,11 @@ RUs = (
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf
index 7bfceaf620..d4c7a4e0cd 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.neighbour.conf
@@ -204,13 +204,15 @@ RUs = ({
});
-rfsimulator: {
+rfsimulator = (
+{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
}
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.prs.conf b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.prs.conf
index 3b6b591d85..05733fb397 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.prs.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.prs.conf
@@ -155,8 +155,8 @@ gNBs =
NETWORK_INTERFACES :
{
- GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
- GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.71.140";
+ GNB_IPV4_ADDRESS_FOR_NGU = "192.168.71.140";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
@@ -217,14 +217,15 @@ RUs = (
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.yaml b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.yaml
index d67f5f5cc7..c72e2a30ce 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.yaml
+++ b/ci-scripts/conf_files/gnb.sa.band78.106prb.rfsim.yaml
@@ -168,7 +168,7 @@ RUs:
sdr_addrs: serial=XXXXXXX
rfsimulator:
- serveraddr: server
+ - serveraddr: server
security:
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band78.24prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band78.24prb.rfsim.conf
index 7153c90421..ea51e351c5 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.24prb.rfsim.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.24prb.rfsim.conf
@@ -203,10 +203,11 @@ RUs = (
}
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
-
+ }
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf b/ci-scripts/conf_files/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf
index ee2930f8ad..885f561bec 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf
@@ -258,7 +258,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("70:b3:d5:e1:5b:81", "70:b3:d5:e1:5b:81");
- mtu = 9600;
+ mtu = 9216;
fh_config = ({
T1a_cp_dl = (419, 470);
T1a_cp_ul = (285, 336);
diff --git a/ci-scripts/conf_files/gnb.sa.band78.273prb.rfsim.2x2.conf b/ci-scripts/conf_files/gnb.sa.band78.273prb.rfsim.2x2.conf
index cd949fe8d0..b224bb1f69 100644
--- a/ci-scripts/conf_files/gnb.sa.band78.273prb.rfsim.2x2.conf
+++ b/ci-scripts/conf_files/gnb.sa.band78.273prb.rfsim.2x2.conf
@@ -203,14 +203,15 @@ RUs = (
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/lteue.rfsim.conf b/ci-scripts/conf_files/lteue.rfsim.conf
new file mode 100644
index 0000000000..683714fb40
--- /dev/null
+++ b/ci-scripts/conf_files/lteue.rfsim.conf
@@ -0,0 +1,5 @@
+rfsimulator = (
+ {
+ serveraddr = "127.0.0.1";
+ }
+);
diff --git a/ci-scripts/conf_files/nrue.band78.106prb.l2sim.conf b/ci-scripts/conf_files/nrue.band78.106prb.l2sim.conf
index 0dfd31a789..4c382c4c37 100644
--- a/ci-scripts/conf_files/nrue.band78.106prb.l2sim.conf
+++ b/ci-scripts/conf_files/nrue.band78.106prb.l2sim.conf
@@ -12,8 +12,7 @@ uicc0 = {
imsi = "208990100001100";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
-dnn= "oai";
-nssai_sst=1;
+pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
MACRLCs = (
diff --git a/ci-scripts/conf_files/nrue.band78.106prb.prs.conf b/ci-scripts/conf_files/nrue.band78.106prb.prs.conf
index 1bf92fd0d6..a2348d75d4 100644
--- a/ci-scripts/conf_files/nrue.band78.106prb.prs.conf
+++ b/ci-scripts/conf_files/nrue.band78.106prb.prs.conf
@@ -87,3 +87,9 @@ PRSs =
);
}
);
+
+rfsimulator = (
+ {
+ serveraddr = "127.0.0.1";
+ }
+);
diff --git a/ci-scripts/conf_files/nrue.uicc.2pdu.conf b/ci-scripts/conf_files/nrue.uicc.2pdu.conf
new file mode 100644
index 0000000000..541e3c7d11
--- /dev/null
+++ b/ci-scripts/conf_files/nrue.uicc.2pdu.conf
@@ -0,0 +1,17 @@
+uicc0 = {
+ imsi = "208990100001100";
+ key = "fec86ba6eb707ed08905757b1bb44b8f";
+ opc= "C42449363BBAD02B66D16BC975D77CC1";
+ pdu_sessions = (
+ { id = 1; dnn = "oai"; nssai_sst = 1; },
+ { id = 2; dnn = "oai"; nssai_sst = 1; }
+ )
+}
+
+thread-pool = "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
+
+rfsimulator = (
+ {
+ serveraddr = "127.0.0.1";
+ }
+);
diff --git a/ci-scripts/conf_files/nrue.uicc.conf b/ci-scripts/conf_files/nrue.uicc.conf
index 5424abe30f..e9c0855d88 100644
--- a/ci-scripts/conf_files/nrue.uicc.conf
+++ b/ci-scripts/conf_files/nrue.uicc.conf
@@ -2,8 +2,7 @@ uicc0 = {
imsi = "208990100001100";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
position0 = {
@@ -14,6 +13,12 @@ position0 = {
thread-pool = "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
+rfsimulator = (
+ {
+ serveraddr = "127.0.0.1";
+ }
+);
+
#/* configuration for channel modelisation */
#/* To be included in main config file when */
#/* channel modelisation is used (rfsimulator with chanmod options enabled) */
@@ -40,4 +45,4 @@ channelmod = {
ds_tdl = 0;
}
);
-};
\ No newline at end of file
+};
diff --git a/ci-scripts/conf_files/nrue.uicc.ntn-leo.conf b/ci-scripts/conf_files/nrue.uicc.ntn-leo.conf
index d8ad297180..8e0baab5cd 100644
--- a/ci-scripts/conf_files/nrue.uicc.ntn-leo.conf
+++ b/ci-scripts/conf_files/nrue.uicc.ntn-leo.conf
@@ -2,8 +2,7 @@ uicc0 = {
imsi = "208990100001100";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
position0 = {
@@ -14,6 +13,40 @@ position0 = {
thread-pool = "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
+rfsimulator = (
+ {
+ prop_delay = 20;
+ options = ("chanmod");
+ }
+);
+
+RUs = (
+ {
+ nb_tx = 1;
+ nb_rx = 1;
+ att_tx = 0;
+ att_rx = 0;
+ max_rxgain = 114;
+ sdr_addrs = "type=x300";
+ clock_src = "internal";
+ time_src = "internal";
+ # if_freq = 3700000000L;
+ # if_offset = 1000000;
+ }
+);
+
+cells = (
+ {
+ ru_id = 0;
+ band = 254;
+ rf_freq = 2488400000L;
+ rf_offset = -873500000L;
+ numerology = 0;
+ N_RB_DL = 25;
+ ssb_start = 60;
+ }
+);
+
#/* configuration for channel modelisation */
#/* To be included in main config file when */
#/* channel modelisation is used (rfsimulator with chanmod options enabled) */
diff --git a/ci-scripts/conf_files/nrue.uicc.yaml b/ci-scripts/conf_files/nrue.uicc.yaml
index da3b7e7e19..40d9947f88 100644
--- a/ci-scripts/conf_files/nrue.uicc.yaml
+++ b/ci-scripts/conf_files/nrue.uicc.yaml
@@ -2,11 +2,15 @@ uicc0:
imsi: 208990100001100
key: fec86ba6eb707ed08905757b1bb44b8f
opc: C42449363BBAD02B66D16BC975D77CC1
- dnn: oai
- nssai_sst: 1
+ pdu_sessions:
+ - dnn: oai
+ nssai_sst: 1
thread-pool: "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
+rfsimulator:
+ - serveraddr: "127.0.0.1"
+
#/* configuration for channel modelisation */
#/* To be included in main config file when */
#/* channel modelisation is used (rfsimulator with chanmod options enabled) */
diff --git a/ci-scripts/conf_files/nrue.vrtsim.chanmod.yaml b/ci-scripts/conf_files/nrue.vrtsim.chanmod.yaml
index a9488007d7..6be862e432 100644
--- a/ci-scripts/conf_files/nrue.vrtsim.chanmod.yaml
+++ b/ci-scripts/conf_files/nrue.vrtsim.chanmod.yaml
@@ -2,8 +2,9 @@ uicc0:
imsi: 208990100001100
key: fec86ba6eb707ed08905757b1bb44b8f
opc: C42449363BBAD02B66D16BC975D77CC1
- dnn: oai
- nssai_sst: 1
+ pdu_sessions:
+ - dnn: oai
+ nssai_sst: 1
thread-pool: "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
diff --git a/ci-scripts/conf_files/ue.sa.conf b/ci-scripts/conf_files/ue.sa.conf
index dc744fb732..d02095ac61 100644
--- a/ci-scripts/conf_files/ue.sa.conf
+++ b/ci-scripts/conf_files/ue.sa.conf
@@ -2,8 +2,7 @@ uicc0 = {
imsi = "208970100001127";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "c42449363bbad02b66d16bc975d77cc1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
thread-pool = "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
diff --git a/ci-scripts/conf_files/untested/episci/episci_nr-ue.nfapi.conf b/ci-scripts/conf_files/untested/episci/episci_nr-ue.nfapi.conf
index fcdce84334..4603651eb0 100644
--- a/ci-scripts/conf_files/untested/episci/episci_nr-ue.nfapi.conf
+++ b/ci-scripts/conf_files/untested/episci/episci_nr-ue.nfapi.conf
@@ -12,9 +12,7 @@ uicc0 = {
imsi = "208950000000031";
key = "0c0a34601d4f07677303652c0462535b";
opc= "63bfa50ee6523365ff14c1f45f88737d";
-dnn= "oai";
-nssai_sst=222;
-nssai_sd=123;
+pdu_sessions = ({ dnn = "oai"; nssai_sst = 222; nssai_sd = 123; });
}
MACRLCs = (
diff --git a/ci-scripts/conf_files/untested/episci/proxy_nr-ue.nfapi.conf b/ci-scripts/conf_files/untested/episci/proxy_nr-ue.nfapi.conf
index 8d6cca014f..b297e509c9 100644
--- a/ci-scripts/conf_files/untested/episci/proxy_nr-ue.nfapi.conf
+++ b/ci-scripts/conf_files/untested/episci/proxy_nr-ue.nfapi.conf
@@ -12,9 +12,7 @@ uicc0 = {
imsi = "2089900007487";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
-dnn= "oai";
-nssai_sst=1;
-nssai_sd=1;
+pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; nssai_sd = 1; });
}
MACRLCs = (
diff --git a/ci-scripts/conf_files/untested/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/untested/gnb.sa.band66.fr1.106PRB.usrpn300.conf
index 36a79087ae..6715202229 100644
--- a/ci-scripts/conf_files/untested/gnb.sa.band66.fr1.106PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/untested/gnb.sa.band66.fr1.106PRB.usrpn300.conf
@@ -205,14 +205,15 @@ RUs = (
);
-rfsimulator :
-{
+rfsimulator = (
+ {
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+ }
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/conf_files/untested/gnb.sa.band78.fr1.51PRB.usrpb210.conf b/ci-scripts/conf_files/untested/gnb.sa.band78.fr1.51PRB.usrpb210.conf
index 7bdbe7127c..c6a0156162 100644
--- a/ci-scripts/conf_files/untested/gnb.sa.band78.fr1.51PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/untested/gnb.sa.band78.fr1.51PRB.usrpb210.conf
@@ -200,14 +200,15 @@ RUs = (
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml
index 1ffba40f77..7385daacfc 100644
--- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml
+++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml
@@ -240,7 +240,7 @@
Custom_Command
UE (1) connected to DU-PCI 1?
localhost
- echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.150 9090 | grep "3585"
+ echo ci fetch_du_by_ue_id | ncat 192.168.71.150 9090 | grep "3585"
@@ -271,7 +271,7 @@
Custom_Command
UE (1) connected to DU-PCI 0?
localhost
- echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.150 9090 | grep "3584"
+ echo ci fetch_du_by_ue_id | ncat 192.168.71.150 9090 | grep "3584"
@@ -302,7 +302,7 @@
Custom_Command
UE (1) connected to DU-PCI 1?
localhost
- echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.150 9090 | grep "3585"
+ echo ci fetch_du_by_ue_id | ncat 192.168.71.150 9090 | grep "3585"
diff --git a/ci-scripts/xml_files/container_5g_rfsim_n2_ho.xml b/ci-scripts/xml_files/container_5g_rfsim_n2_ho.xml
index 6a4d43f93a..9ef14478b1 100644
--- a/ci-scripts/xml_files/container_5g_rfsim_n2_ho.xml
+++ b/ci-scripts/xml_files/container_5g_rfsim_n2_ho.xml
@@ -120,7 +120,7 @@
Custom_Command
UE (1) connected to DU-PCI 1?
localhost
- echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.180 9090 | grep "1234"
+ echo ci fetch_du_by_ue_id | ncat 192.168.71.180 9090 | grep "1234"
@@ -181,7 +181,7 @@
Custom_Command
UE (1) connected to DU-PCI 0?
localhost
- echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.150 9090 | grep "3584"
+ echo ci fetch_du_by_ue_id | ncat 192.168.71.150 9090 | grep "3584"
@@ -218,7 +218,7 @@
Custom_Command
UE (1) connected to DU-PCI 1?
localhost
- echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.180 9090 | grep "1234"
+ echo ci fetch_du_by_ue_id | ncat 192.168.71.180 9090 | grep "1234"
diff --git a/ci-scripts/xml_files/container_sa_aerial_quectel.xml b/ci-scripts/xml_files/container_sa_aerial_quectel.xml
index b5a2e11e50..7282513bb8 100644
--- a/ci-scripts/xml_files/container_sa_aerial_quectel.xml
+++ b/ci-scripts/xml_files/container_sa_aerial_quectel.xml
@@ -80,7 +80,7 @@
Iperf
iperf (DL/UDP/800M)(30 sec)(single-ue profile)
- -u -b 800M -t 30 -R
+ -u -b 800M -t 30 -R -l 1428
oc-cn5g-20897-aerial
up2-aerial
25
@@ -101,7 +101,7 @@
Iperf
Optional iperf (DL/UDP/1000M)(30 sec)(single-ue profile)
true
- -u -b 1000M -t 30 -R
+ -u -b 1000M -t 30 -R -l 1428
oc-cn5g-20897-aerial
up2-aerial
25
diff --git a/ci-scripts/xml_files/container_sa_aerial_quectel_ul_heavy.xml b/ci-scripts/xml_files/container_sa_aerial_quectel_ul_heavy.xml
index c577236887..8367316e3a 100644
--- a/ci-scripts/xml_files/container_sa_aerial_quectel_ul_heavy.xml
+++ b/ci-scripts/xml_files/container_sa_aerial_quectel_ul_heavy.xml
@@ -101,7 +101,7 @@
Iperf
iperf (DL/UDP/200M)(30 sec)(single-ue profile)
- -u -b 200M -t 30 -R
+ -u -b 200M -t 30 -R -l 1428
oc-cn5g-20897-aerial
up2-aerial
25
diff --git a/ci-scripts/xml_files/container_sa_f1_ho_b210_quectel.xml b/ci-scripts/xml_files/container_sa_f1_ho_b210_quectel.xml
index ff36947a57..2804e3c14e 100644
--- a/ci-scripts/xml_files/container_sa_f1_ho_b210_quectel.xml
+++ b/ci-scripts/xml_files/container_sa_f1_ho_b210_quectel.xml
@@ -129,7 +129,7 @@
Custom_Command
UE connected to DU1?
groot
- echo ci fetch_du_by_ue_id 1 | ncat 127.0.0.1 9090 | grep "3585"
+ echo ci fetch_du_by_ue_id | ncat 127.0.0.1 9090 | grep "3585"
@@ -152,7 +152,7 @@
Custom_Command
UE connected to DU0?
groot
- echo ci fetch_du_by_ue_id 1 | ncat 127.0.0.1 9090 | grep "3584"
+ echo ci fetch_du_by_ue_id | ncat 127.0.0.1 9090 | grep "3584"
@@ -175,7 +175,7 @@
Custom_Command
UE connected to DU1?
groot
- echo ci fetch_du_by_ue_id 1 | ncat 127.0.0.1 9090 | grep "3585"
+ echo ci fetch_du_by_ue_id | ncat 127.0.0.1 9090 | grep "3585"
diff --git a/ci-scripts/xml_files/container_sa_n2_ho_b210_quectel.xml b/ci-scripts/xml_files/container_sa_n2_ho_b210_quectel.xml
index 84c5a5bea5..1f4c7c1981 100644
--- a/ci-scripts/xml_files/container_sa_n2_ho_b210_quectel.xml
+++ b/ci-scripts/xml_files/container_sa_n2_ho_b210_quectel.xml
@@ -121,7 +121,7 @@
Custom_Command
UE connected to gNB-PCI1?
rocket
- echo ci fetch_du_by_ue_id 1 | ncat 127.0.0.1 9090 | grep "3585"
+ echo ci fetch_du_by_ue_id | ncat 127.0.0.1 9090 | grep "3585"
@@ -144,7 +144,7 @@
Custom_Command
UE connected to gNB-PCI0?
groot
- echo ci fetch_du_by_ue_id 1 | ncat 127.0.0.1 9090 | grep "3584"
+ echo ci fetch_du_by_ue_id | ncat 127.0.0.1 9090 | grep "3584"
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml
index 5461f37a10..0abb3bf529 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml
@@ -208,9 +208,10 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
- USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
+ - ../../conf_files/lteue.rfsim.conf:/opt/oai-lte-ue/etc/ue.conf
healthcheck:
test: /bin/bash -c "pgrep lte-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml
index ab07314c91..fec01a0ab8 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml
@@ -30,9 +30,10 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
- USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
+ USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
+ - ../../conf_files/lteue.rfsim.conf:/opt/oai-lte-ue/etc/ue.conf
healthcheck:
test: /bin/bash -c "pgrep lte-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml
index 856428f728..4af54c40df 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml
@@ -208,9 +208,10 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
- USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 50 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 50 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
+ - ../../conf_files/lteue.rfsim.conf:/opt/oai-lte-ue/etc/ue.conf
healthcheck:
test: /bin/bash -c "pgrep lte-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml
index 3458c4f11b..c58abb866e 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml
@@ -208,9 +208,10 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
- USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 100 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 100 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
+ - ../../conf_files/lteue.rfsim.conf:/opt/oai-lte-ue/etc/ue.conf
healthcheck:
test: /bin/bash -c "pgrep lte-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fembms/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fembms/docker-compose.yml
index cadb22236a..afed1395e1 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_fembms/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fembms/docker-compose.yml
@@ -28,9 +28,10 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
- USE_ADDITIONAL_OPTIONS: -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsim --noS1 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
+ USE_ADDITIONAL_OPTIONS: -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsim --noS1 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
volumes:
- ../../conf_files/lteue.usim-mbs.conf:/opt/oai-lte-ue/etc/ue_usim.conf
+ - ../../conf_files/lteue.rfsim.conf:/opt/oai-lte-ue/etc/ue.conf
healthcheck:
test: /bin/bash -c "pgrep lte-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_mbms/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_mbms/docker-compose.yml
index 027644d9a1..7528467a4b 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_mbms/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_mbms/docker-compose.yml
@@ -33,9 +33,10 @@ services:
TZ: Europe/Paris
HOSTNAME: oai_ue0
ASAN_OPTIONS: detect_leaks=0
- USE_ADDITIONAL_OPTIONS: -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsim --noS1 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
+ USE_ADDITIONAL_OPTIONS: -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsim --noS1 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time --noS1
volumes:
- ../../conf_files/lteue.usim-mbs.conf:/opt/oai-lte-ue/etc/ue_usim.conf
+ - ../../conf_files/lteue.rfsim.conf:/opt/oai-lte-ue/etc/ue.conf
healthcheck:
test: /bin/bash -c "pgrep lte-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml
index 24acd9c676..d0c6655c7b 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml
@@ -208,9 +208,10 @@ services:
environment:
TZ: Europe/Paris
ASAN_OPTIONS: detect_leaks=0
- USE_ADDITIONAL_OPTIONS: --rfsim -T -C 2605000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --rfsim -T -C 2605000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --rfsimulator.[0].serveraddr 192.168.61.20 --log_config.global_log_options level,nocolor,time
volumes:
- ../../conf_files/lteue.usim-ci.conf:/opt/oai-lte-ue/etc/ue_usim.conf
+ - ../../conf_files/lteue.rfsim.conf:/opt/oai-lte-ue/etc/ue.conf
healthcheck:
test: /bin/bash -c "pgrep lte-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml
index 49dcf0e450..98eb1fb54c 100644
--- a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml
@@ -130,10 +130,10 @@ services:
environment:
USE_ADDITIONAL_OPTIONS: --rfsim
--log_config.global_log_options level,nocolor,time
- --rfsimulator.options chanmod
+ --rfsimulator.[0].options chanmod
--telnetsrv --telnetsrv.listenaddr 192.168.71.171
--telnetsrv.shrmod ci
- --rfsimulator.serveraddr 192.168.71.181
+ --rfsimulator.[0].serveraddr 192.168.71.181
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
- oai-cu
@@ -168,7 +168,7 @@ services:
--gNBs.[0].servingCellConfigCommon.[0].dl_absoluteFrequencyPointA 642024
--gNBs.[0].servingCellConfigCommon.[0].ssb_PositionsInBurst_Bitmap 3
--MACRLCs.[0].local_n_address 192.168.71.172
- --rfsimulator.serveraddr 192.168.71.181
+ --rfsimulator.[0].serveraddr 192.168.71.181
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
- oai-cu
@@ -199,8 +199,8 @@ services:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
-r 106 --numerology 1 -C 3619200000
--uicc0.imsi 208990100001100
- --rfsimulator.options chanmod
- --rfsimulator.serveraddr server
+ --rfsimulator.[0].options chanmod
+ --rfsimulator.[0].serveraddr server
--telnetsrv --telnetsrv.shrmod ciUE --telnetsrv.listenaddr 192.168.71.181 --telnetsrv.listenport 8091
--channelmod.modellist_rfsimu_1.[0].model_name rfsimu_channel_ue0
--channelmod.modellist_rfsimu_1.[1].model_name rfsimu_channel_ue1
diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md
index 629d0860fd..dd114ad667 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator/README.md
+++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md
@@ -256,7 +256,7 @@ Create the entry for the second UE in `docker-compose.yaml` file as follows:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
devices:
@@ -518,8 +518,7 @@ uicc0 = {
imsi = "208990100001100";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
```
diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml
index 97dcce4d49..db9cc3e11e 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml
@@ -123,7 +123,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -150,7 +150,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -177,7 +177,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -204,7 +204,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001103 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001103 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -231,7 +231,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001104 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001104 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -258,7 +258,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001105 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001105 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -285,7 +285,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001106 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001106 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -312,7 +312,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001107 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001107 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -339,7 +339,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001108 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001108 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -366,7 +366,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001109 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001109 -C 3319680000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
diff --git a/ci-scripts/yaml_files/5g_rfsimulator/local-override-ue-gdb.yaml b/ci-scripts/yaml_files/5g_rfsimulator/local-override-ue-gdb.yaml
index 0b2b60210a..99d97240ad 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator/local-override-ue-gdb.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator/local-override-ue-gdb.yaml
@@ -3,4 +3,4 @@ services:
privileged: true
stdin_open: true
tty: true
- command: gdb --args /opt/oai-nr-ue/bin/nr-uesoftmodem -O /opt/oai-nr-ue/etc/nr-ue.conf -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3619200000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ command: gdb --args /opt/oai-nr-ue/bin/nr-uesoftmodem -O /opt/oai-nr-ue/etc/nr-ue.conf -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3619200000 --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml
index b5b9684626..3b41894045 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_24prb/docker-compose.yaml
@@ -121,7 +121,7 @@ services:
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --rfsim -r 24 --ssb 24 --numerology 1 -C 3604800000 --uicc0.imsi 208990100001100
- --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
--telnetsrv --telnetsrv.shrmod ciUE --telnetsrv.listenaddr 192.168.71.150 --telnetsrv.listenport 8091
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml
index f3482280bd..90a3625b85 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_2x2/docker-compose.yaml
@@ -124,7 +124,7 @@ services:
- NET_RAW # for ping
- SYS_NICE
environment:
- USE_ADDITIONAL_OPTIONS: --rfsim -r 273 --numerology 1 --band 78 -C 3450720000 --ssb 1518 --ue-nb-ant-tx 2 --uicc0.imsi 208990100001100 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --rfsim -r 273 --numerology 1 --band 78 -C 3450720000 --ssb 1518 --ue-nb-ant-tx 2 --uicc0.imsi 208990100001100 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_e1/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_e1/docker-compose.yaml
index 200a1b6e3a..e2cb9d6c7c 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_e1/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_e1/docker-compose.yaml
@@ -309,7 +309,7 @@ services:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
-r 106 --numerology 1 -C 3619200000
--uicc0.imsi 208990100001100
- --rfsimulator.serveraddr oai-du
+ --rfsimulator.[0].serveraddr oai-du
depends_on:
- oai-du
networks:
@@ -338,8 +338,8 @@ services:
environment:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
-r 106 --numerology 1 -C 3619200000
- --uicc0.imsi 208990100001101 --uicc0.nssai_sst 2
- --rfsimulator.serveraddr 192.168.78.3
+ --uicc0.imsi 208990100001101 --uicc0.pdu_sessions.[0].nssai_sst 2
+ --rfsimulator.[0].serveraddr 192.168.78.3
depends_on:
- oai-du2
networks:
@@ -368,8 +368,8 @@ services:
environment:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
-r 106 --numerology 1 -C 3619200000
- --uicc0.imsi 208990100001102 --uicc0.nssai_sst 3
- --rfsimulator.serveraddr 192.168.78.4
+ --uicc0.imsi 208990100001102 --uicc0.pdu_sessions.[0].nssai_sst 3
+ --rfsimulator.[0].serveraddr 192.168.78.4
ASAN_OPTIONS: detect_leaks=0
depends_on:
- oai-du3
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml
index 533c5d576c..9bed16bc6e 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_fdd_phytest/docker-compose.yaml
@@ -8,7 +8,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
- USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --rfsimulator.[0].wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
networks:
public_net:
@@ -33,7 +33,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
- USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --phy-test --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
devices:
- /dev/net/tun:/dev/net/tun
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml b/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml
index 5bb8d0246d..84f8f4c89e 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml
@@ -105,7 +105,7 @@ services:
privileged: true
container_name: rfsim5g-oai-nr-ue
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --uicc0.imsi 001010000000003 --rfsimulator.serveraddr 192.168.70.151 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --uicc0.imsi 001010000000003 --rfsimulator.[0].serveraddr 192.168.70.151 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
@@ -124,7 +124,7 @@ services:
privileged: true
container_name: rfsim5g-oai-nr-ue2
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --uicc0.imsi 001010000000004 --rfsimulator.serveraddr 192.168.70.151 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 -C 3619200000 --uicc0.imsi 001010000000004 --rfsimulator.[0].serveraddr 192.168.70.151 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_fr2_66prb/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_fr2_66prb/docker-compose.yaml
index 972dd56010..48fac60f20 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_fr2_66prb/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_fr2_66prb/docker-compose.yaml
@@ -121,7 +121,7 @@ services:
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --rfsim
- --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
-C 27975360000 -r 66 --numerology 3 --ssb 48 --band 257
ASAN_OPTIONS: detect_leaks=0
devices:
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_multiue/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_multiue/docker-compose.yaml
index b44178a3f5..6dae12a972 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_multiue/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_multiue/docker-compose.yaml
@@ -111,7 +111,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
- USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time --num-ues 10
+ USE_ADDITIONAL_OPTIONS: -E --rfsim --log_config.global_log_options level,nocolor,time --num-ues 10
depends_on:
- oai-gnb
networks:
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf b/ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf
index 92ccf9dca2..f346c1a44d 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf
+++ b/ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf
@@ -2,74 +2,193 @@ uicc0 = {
imsi = "208990100001100";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
uicc1 = {
imsi = "208990100001101";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
uicc2 = {
imsi = "208990100001102";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
uicc3 = {
imsi = "208990100001103";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
uicc4 = {
imsi = "208990100001104";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
uicc5 = {
imsi = "208990100001105";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
uicc6 = {
imsi = "208990100001106";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
uicc7 = {
imsi = "208990100001107";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
uicc8 = {
imsi = "208990100001108";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
uicc9 = {
imsi = "208990100001109";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
- dnn= "oai";
- nssai_sst=1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
-
-
thread-pool: "-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
+rfsimulator = (
+ {
+ serveraddr = "192.168.71.140";
+ }, {
+ serveraddr = "192.168.71.140";
+ }, {
+ serveraddr = "192.168.71.140";
+ }, {
+ serveraddr = "192.168.71.140";
+ }, {
+ serveraddr = "192.168.71.140";
+ }, {
+ serveraddr = "192.168.71.140";
+ }, {
+ serveraddr = "192.168.71.140";
+ }, {
+ serveraddr = "192.168.71.140";
+ }, {
+ serveraddr = "192.168.71.140";
+ }, {
+ serveraddr = "192.168.71.140";
+ }
+);
+
+RUs = (
+ {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }
+);
+
+cells = (
+ {
+ ru_id = 0;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 1;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 2;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 3;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 4;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 5;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 6;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 7;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 8;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 9;
+ band = 78;
+ rf_freq = 3319680000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }
+);
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_n2_ho/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_n2_ho/docker-compose.yaml
index ad171109c7..87fee22e6d 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_n2_ho/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_n2_ho/docker-compose.yaml
@@ -149,7 +149,7 @@ services:
--gNBs.[0].nr_cellid 0
--telnetsrv --telnetsrv.listenaddr 192.168.71.171
--telnetsrv.shrmod ci
- --rfsimulator.serveraddr 192.168.71.190
+ --rfsimulator.[0].serveraddr 192.168.71.190
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
- oai-cucp-0
@@ -176,7 +176,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
- USE_ADDITIONAL_OPTIONS: --rfsim --rfsimulator.serveraddr server
+ USE_ADDITIONAL_OPTIONS: --rfsim --rfsimulator.[0].serveraddr server
--band 78 -C 3619200000 -r 106 --numerology 1 --ssb 516
--uicc0.imsi 208990100001100
--log_config.global_log_options level,nocolor,time
@@ -259,7 +259,7 @@ services:
- ALL
environment:
USE_ADDITIONAL_OPTIONS: --rfsim
- --rfsimulator.serveraddr 192.168.71.190
+ --rfsimulator.[0].serveraddr 192.168.71.190
--log_config.global_log_options level,nocolor,time
--gNBs.[0].gNB_DU_ID 1234
--gNBs.[0].gNB_ID 0xb00
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_ntn_geo/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_ntn_geo/docker-compose.yaml
index 731b833f08..3ffa8290e9 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_ntn_geo/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_ntn_geo/docker-compose.yaml
@@ -123,7 +123,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
- USE_ADDITIONAL_OPTIONS: --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.prop_delay 238.74 --rfsimulator.serveraddr 192.168.71.140 --num-ul-actors 1 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 238.74 --rfsimulator.[0].serveraddr 192.168.71.140 --num-ul-actors 1 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-gnb
networks:
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_ntn_leo/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_ntn_leo/docker-compose.yaml
index a3f8ec2a7e..5cc17ce721 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_ntn_leo/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_ntn_leo/docker-compose.yaml
@@ -121,13 +121,10 @@ services:
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS:
- --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60
- --rfsim --rfsimulator.prop_delay 20 --rfsimulator.options chanmod
- --rfsimulator.serveraddr 192.168.71.140
+ --rfsim --rfsimulator.[0].serveraddr 192.168.71.140
--time-sync-I 0.1 --ntn-initial-time-drift -46
- --initial-fo 57340 --cont-fo-comp 2
+ --initial-fo 57340 --cont-fo-comp 3
--log_config.global_log_options level,nocolor,time
- --num-ul-actors 1
depends_on:
- oai-gnb
networks:
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_prs/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_prs/docker-compose.yaml
index c6b6c338de..8eb887f3d8 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_prs/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_prs/docker-compose.yaml
@@ -36,7 +36,7 @@ services:
environment:
USE_ADDITIONAL_OPTIONS: --phy-test --rfsim -E
--reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw
- --rfsimulator.serveraddr 192.168.71.140
+ --rfsimulator.[0].serveraddr 192.168.71.140
--log_config.global_log_options level,nocolor,time
--telnetsrv --telnetsrv.listenaddr 192.168.71.150 --telnetsrv.listenport 8091
--telnetsrv.shrmod ciUE
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_sidelink/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_sidelink/docker-compose.yaml
index 5d8de35ac8..e1689da4ef 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_sidelink/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_sidelink/docker-compose.yaml
@@ -8,7 +8,7 @@ services:
- NET_ADMIN
- NET_RAW
environment:
- USE_ADDITIONAL_OPTIONS: --sl-mode 2 --sync-ref 4 --rfsim --rfsimulator.serveraddr server --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --sl-mode 2 --sync-ref 4 --rfsim --rfsimulator.[0].serveraddr server --log_config.global_log_options level,nocolor,time
networks:
public_net:
ipv4_address: 192.168.71.140
@@ -33,7 +33,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
- USE_ADDITIONAL_OPTIONS: --sl-mode 2 --rfsim --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --sl-mode 2 --rfsim --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-nr-ue-1
networks:
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml
index 60484914a6..760c019398 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_tdd_dora/docker-compose.yaml
@@ -8,7 +8,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
- USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --rfsimulator.wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --rfsimulator.[0].wait_timeout 20 --noS1 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
networks:
public_net:
@@ -33,7 +33,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
- USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --do-ra --rfsim --noS1 --reconfig-file etc/rrc/reconfig.raw --rbconfig-file etc/rrc/rbconfig.raw --rfsimulator.[0].serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
devices:
- /dev/net/tun:/dev/net/tun
diff --git a/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml
index c4a4e2ebea..0a02976868 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator_u0_25prb/docker-compose.yaml
@@ -149,7 +149,7 @@ services:
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --rfsim -r 25 --numerology 0 --uicc0.imsi 208990100001100 --band 66 -C 2152680000 --CO -400000000 --ssb 48
- --rfsimulator.serveraddr 192.168.71.141 --extra-pdu-id 2 --log_config.global_log_options level,nocolor,time
+ --rfsimulator.[0].serveraddr 192.168.71.141 --log_config.global_log_options level,nocolor,time
--telnetsrv --telnetsrv.shrmod ciUE --telnetsrv.listenaddr 192.168.71.150 --telnetsrv.listenport 8091
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0
depends_on:
@@ -160,7 +160,7 @@ services:
devices:
- /dev/net/tun:/dev/net/tun
volumes:
- - ../../conf_files/nrue.uicc.conf:/opt/oai-nr-ue/etc/nr-ue.conf
+ - ../../conf_files/nrue.uicc.2pdu.conf:/opt/oai-nr-ue/etc/nr-ue.conf
healthcheck:
test: /bin/bash -c "pgrep nr-uesoftmodem"
start_period: 10s
diff --git a/ci-scripts/yaml_files/sa_gnb_aerial/aerial_l1_entrypoint.sh b/ci-scripts/yaml_files/sa_gnb_aerial/aerial_l1_entrypoint.sh
index e0fea22190..c8bac9eb3e 100755
--- a/ci-scripts/yaml_files/sa_gnb_aerial/aerial_l1_entrypoint.sh
+++ b/ci-scripts/yaml_files/sa_gnb_aerial/aerial_l1_entrypoint.sh
@@ -4,8 +4,6 @@
cuBB_Path="${cuBB_SDK:-/opt/nvidia/cuBB}"
cd "$cuBB_Path" || exit 1
-# Add gdrcopy to LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/opt/mellanox/dpdk/lib/x86_64-linux-gnu:/opt/mellanox/doca/lib/x86_64-linux-gnu:/opt/nvidia/cuBB/cuPHY-CP/external/gdrcopy/build/x86_64/
# Restart MPS
# Export variables
@@ -14,7 +12,7 @@ export CUDA_MPS_PIPE_DIRECTORY=/var
export CUDA_MPS_LOG_DIRECTORY=/var
# Stop existing MPS
-sudo -E echo quit | sudo -E nvidia-cuda-mps-control
+echo quit | sudo -E nvidia-cuda-mps-control
# Start MPS
sudo -E nvidia-cuda-mps-control -d
@@ -24,11 +22,11 @@ sudo -E echo start_server -uid 0 | sudo -E nvidia-cuda-mps-control
# Check if an argument is provided
if [ $# -eq 0 ]; then
# No argument provided, use default value
- argument="P5G_FXN_GH"
+ argument="P5G_WNC_GH"
else
# Argument provided, use it
argument="$1"
fi
-sudo -E "$cuBB_Path"/build/cuPHY-CP/cuphycontroller/examples/cuphycontroller_scf "$argument"
-sudo -E ./build/cuPHY-CP/gt_common_libs/nvIPC/tests/pcap/pcap_collect
+sudo -E "$cuBB_Path"/build.$(uname -m)/cuPHY-CP/cuphycontroller/examples/cuphycontroller_scf "$argument"
+sudo -E ./build.$(uname -m)/cuPHY-CP/gt_common_libs/nvIPC/tests/pcap/pcap_collect
diff --git a/ci-scripts/yaml_files/sa_gnb_aerial/cuphycontroller_P5G_WNC_GH.yaml b/ci-scripts/yaml_files/sa_gnb_aerial/cuphycontroller_P5G_WNC_GH.yaml
new file mode 100644
index 0000000000..9fe8cc3d6c
--- /dev/null
+++ b/ci-scripts/yaml_files/sa_gnb_aerial/cuphycontroller_P5G_WNC_GH.yaml
@@ -0,0 +1,243 @@
+# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+aerial_sdk_version: 25-3-cubb
+l2adapter_filename: l2_adapter_config_P5G_GH.yaml
+aerial_metrics_backend_address: 127.0.0.1:8081
+
+# CPU core shared by all low-priority threads
+low_priority_core: 10
+enable_ptp_svc_monitoring: 0
+ptp_rms_threshold: 20 #ns
+nic_tput_alert_threshold_mbps: 85000
+
+cuphydriver_config:
+ standalone: 0
+ validation: 0
+ num_slots: 8
+ log_level: DBG
+ profiler_sec: 0
+ dpdk_thread: 10
+ dpdk_verbose_logs: 0
+ accu_tx_sched_res_ns: 500
+ accu_tx_sched_disable: 0 #Flag applicable only for CX6-DX : BF3/CX7 HW and beyond support accurate send scheduling directly on timestamp, for CX6-DX this is implemented via software emulation
+ fh_stats_dump_cpu_core: -1
+ pdump_client_thread: -1
+ use_green_contexts: 0
+ use_batched_memcpy: 0 # Experimental feature; requires >= CUDA 12.8
+ mps_sm_pusch: 100
+ mps_sm_pucch: 2
+ mps_sm_prach: 2
+ mps_sm_ul_order: 20
+ mps_sm_pdsch: 102
+ mps_sm_pdcch: 10
+ mps_sm_pbch: 2
+ mps_sm_gpu_comms: 16
+ mps_sm_srs: 16
+ pdsch_fallback: 0
+ dpdk_file_prefix: cuphycontroller
+ nics:
+ - nic: '0000:01:00.0'
+ mtu: 9216
+ cpu_mbufs: 196608
+ uplane_tx_handles: 64
+ txq_size: 8192
+ rxq_size: 16384
+ gpu: 0
+ cus_port_failover: 0
+ gpus:
+ - 0
+ # Set GPUID to the GPU sharing the PCIe switch as NIC
+ # run nvidia-smi topo -m to find out which GPU
+ workers_ul: [4,5]
+ workers_dl: [6,7,8]
+ debug_worker: -1
+ workers_sched_priority: 95
+ prometheus_thread: -1
+ start_section_id_srs: 3072
+ start_section_id_prach: 2048
+ enable_ul_cuphy_graphs: 1
+ enable_dl_cuphy_graphs: 1
+ ul_order_kernel_mode: 0 # 0: Ping-Pong, 1: dual CTA
+ ul_order_timeout_cpu_ns: 8000000
+ ul_order_timeout_log_interval_ns: 1000000000
+ ul_order_timeout_gpu_ns: 3000000
+ ul_order_timeout_gpu_srs_ns: 5200000
+ ul_srs_aggr3_task_launch_offset_ns: 500000
+ ul_order_timeout_gpu_log_enable: 0
+ ul_order_max_rx_pkts: 512
+ ul_order_rx_pkts_timeout_ns: 100000
+ cplane_disable: 0
+ gpu_init_comms_dl: 1
+ cell_group: 1
+ cell_group_num: 1
+ fix_beta_dl: 0
+ bfw_beta_prescaler: 16384
+ pusch_workCancelMode: 2 # set cuphyPuschStatPrms_t workCancelMode field to PUSCH_DEVICE_GRAPHS; this only sets the mode and does not cancel work;
+ # work cancellation (i.e., not launching some of the device graphs) can only occur after an explicit internal
+ # memory write is timely observed by a PUSCH graph.
+ pusch_sinr: 2
+ pusch_rssi: 1
+ pusch_tdi: 1
+ pusch_cfo: 1
+ pusch_dftsofdm: 0
+ pusch_to: 1
+ pusch_select_eqcoeffalgo: 3
+ pusch_select_chestalgo: 1
+ pusch_enable_perprgchest: 0
+ pusch_tbsizecheck: 1
+ pusch_deviceGraphLaunchEn: 1
+ pusch_waitTimeOutPreEarlyHarqUs: 3000
+ pusch_waitTimeOutPostEarlyHarqUs: 3000
+ puxch_polarDcdrListSz: 8
+ enable_cpu_task_tracing: 0
+ enable_prepare_tracing: 0
+ disable_empw: 0 #1=>Disables Multi packet WQE feature
+ cqe_tracer_config:
+ enable_dl_cqe_tracing: 0
+ cqe_trace_cell_mask: 1 #[64 bit mask: Bit0->Cell0, Bit1->Cell1...]
+ cqe_trace_slot_mask: 196800 #[20 bit mask: Bit0->Slot0, Bit1->Slot1...] 196800=>All *6,*7 DL Slots
+ ul_rx_pkt_tracing_level: 0
+ ul_rx_pkt_tracing_level_srs: 0
+ pmu_metrics: 0 #Enable and select PMU metrics, 0=disabled, 1=General Counters (platform agnostic), 2=Topdown Metrics (Grace only), 3=Cache Metrics (Grace only)
+ enable_h2d_copy_thread: 1
+ h2d_copy_thread_cpu_affinity : 11
+ h2d_copy_thread_sched_priority : 95 #0->SCHED_OTHER, >0->Actual
+ split_ul_cuda_streams: 0 # 1=Put UL slot 4 and slot 5 on different streams for DDDSUUDDDD pattern
+ serialize_pucch_pusch: 0 # 1=Force serialization of PUSCH/PUCCH
+ # Note: for Early Harq (EH) order is PUSCH EH -> PUCCH -> PUSCH non EH
+ # for non-Early Harq order is PUCCH -> all PUSCH processing
+ aggr_obj_non_avail_th: 5 # Threshold for consecutive non-availability of Aggregated objects(UL/DL) or DL/UL buffers
+ dl_wait_th_ns:
+ - 500000 #H2D copy wait threshold
+ - 4000000 #cuPHY DL channel wait threshold
+ sendCPlane_timing_error_th_ns : 0
+ sendCPlane_ulbfw_backoff_th_ns: 300000 # ULBFW must be completed by cplane send time - this is the backoff time
+ sendCPlane_dlbfw_backoff_th_ns: 300000 # DLBFW must be completed by cplane send time - this is the backoff time
+ pusch_forcedNumCsi2Bits: 0
+ mMIMO_enable: 0
+ enable_srs: 1
+ ue_mode: 0
+ mCh_segment_proc_enable: 0
+ pusch_aggr_per_ctx: 3
+ prach_aggr_per_ctx: 2
+ pucch_aggr_per_ctx: 4
+ srs_aggr_per_ctx: 3
+ ul_input_buffer_per_cell: 10
+ ul_input_buffer_per_cell_srs: 6
+ max_harq_pools: 384
+ max_harq_tx_count_bundled: 10
+ max_harq_tx_count_non_bundled: 4
+ ok_testbench_config:
+ enable_ok_tb: 0
+ num_ok_tb_slot: 0 #Presently not used
+ max_ru_unhealthy_ul_slots: 100
+ srs_chest_algo_type: 0
+ srs_chest_tol2_normalization_algo_type: 1
+ srs_chest_tol2_constant_scaler: 32768.0
+ bfw_power_normalization_alg_selector: 1
+ total_num_srs_chest_buffers: 6144
+ send_static_bfw_wt_all_cplane: 1
+ ul_pcap_capture_enable: 0
+ ul_pcap_capture_thread_cpu_affinity: 10
+ ul_pcap_capture_thread_sched_priority: 95
+ pcap_logger_ul_cplane_enable: 0
+ pcap_logger_dl_cplane_enable: 0
+ pcap_logger_thread_cpu_affinity: 10
+ pcap_logger_thread_sched_prio: 95
+ pcap_logger_file_save_dir: ./
+ dlc_bfw_enable_divide_per_cell: 0 # Enable/disable dividing DL BFW C-Plane transmission window among multiple cells in a slot
+ ulc_bfw_enable_divide_per_cell: 0 # Enable/disable dividing UL BFW C-Plane transmission window among multiple cells in a slot
+ dlc_alloc_cplane_bfw_txq: 0 # Allocates a second separate queue for BFW DL C-Plane transmission
+ ulc_alloc_cplane_bfw_txq: 1 # Allocates a second separate queue for BFW UL C-Plane transmission
+ #static beam id range
+ static_beam_id_start: 1
+ static_beam_id_end: 16527
+ #dynamic beam id range
+ dynamic_beam_id_start: 16528 #Dynamic beam ID start should be after static beam ID end
+ dynamic_beam_id_end: 32767 #15bit max value
+ bfw_c_plane_chaining_mode: 0 # 0: Default memcpy of BFW weights, 1: CPU mbuf chaining of BFW weights, 2: GPU mbuf chaining
+ enable_l1_param_sanity_check: 0
+ pusch_nMaxLdpcHetConfigs: 32
+ notify_ul_harq_buffer_release: 0
+
+ # data_config:
+ # datalake_core: 12 # This must be set for Data Lake and/or E3 Agent to be used
+ # datalake_db_write_enable: 1 # Enable/disable ClickHouse writes based on datalake_data_types
+ # datalake_samples: 1000000
+ # datalake_address: localhost
+ # datalake_engine: "MergeTree() PRIMARY KEY (TsTaiNs)"
+ # # datalake_drop_tables: 0 # Set to 1 to drop Clickhouse tables at startup
+ # datalake_data_types: [fh, pusch, hest] # Data types to write to ClickHouse DB (all types always collected in memory for E3 Agent):
+ # fh = Fronthaul IQ samples,pusch = PUSCH/FAPI data, hest = channel estimates
+ # datalake_store_failed_pdu: 0 # Set to 1 to store PDU data even when CRC fails
+ # e3_agent_enable: 0 # Enable/disable E3 Agent and dApp capabilities
+ # num_rows_fh: 120
+ # num_rows_pusch: 200
+ # num_rows_hest: 140
+ # e3_pub_port: 5555 # E3 publisher port for indication messages
+ # e3_rep_port: 5556 # E3 reply port for E3AP requests
+ # e3_sub_port: 5560 # E3 subscriber port for Manager messages
+
+ cells:
+ - name: O-RU 0
+ cell_id: 1
+ ru_type: 1
+ # set to 00:00:00:00:00:00 to use the MAC address of the NIC port to use
+ src_mac_addr: 00:00:00:00:00:00
+ dst_mac_addr: e8:c7:cf:ad:12:0b #WNC n78
+ nic: '0000:01:00.0'
+ vlan: 500
+ pcp: 7
+ txq_count_uplane: 1
+ eAxC_id_ssb_pbch: [0, 1, 2, 3]
+ eAxC_id_pdcch: [0, 1, 2, 3]
+ eAxC_id_pdsch: [0, 1, 2, 3]
+ eAxC_id_csirs: [0, 1, 2, 3]
+ eAxC_id_pusch: [0, 1, 2, 3]
+ eAxC_id_pucch: [0, 1, 2, 3]
+ eAxC_id_srs: [8, 9, 10, 11]
+ eAxC_id_prach: [4, 5, 6, 7]
+ dl_iq_data_fmt: {comp_meth: 1, bit_width: 9}
+ ul_iq_data_fmt: {comp_meth: 1, bit_width: 9}
+ section_3_time_offset: 484
+ fs_offset_dl: 7
+ exponent_dl: 4
+ ref_dl: 0
+ fs_offset_ul: -5
+ exponent_ul: 4
+ max_amp_ul: 65504
+ mu: 1
+ T1a_max_up_ns: 280000
+ T1a_max_cp_ul_ns: 405000
+ Ta4_min_ns: 50000
+ Ta4_max_ns: 331000
+ Tcp_adv_dl_ns: 125000
+ ul_u_plane_tx_offset_ns: 280000
+ fh_len_range: 0
+ pusch_prb_stride: 273
+ prach_prb_stride: 12
+ srs_prb_stride: 273
+ pusch_ldpc_max_num_itr_algo_type: 1
+ pusch_fixed_max_num_ldpc_itrs: 10
+ pusch_ldpc_early_termination: 0
+ pusch_ldpc_algo_index: 0
+ pusch_ldpc_flags: 2
+ pusch_ldpc_use_half: 1
+ pusch_nMaxPrb: 273
+ pusch_nMaxRx: 4
+ ul_gain_calibration: 78.68
+ lower_guard_bw: 845
+ tv_pusch: cuPhyChEstCoeffs.h5
diff --git a/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml b/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml
index 4050fa5310..985fe9a6a3 100644
--- a/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml
+++ b/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml
@@ -18,12 +18,13 @@ services:
- /lib/modules:/lib/modules
- /dev/hugepages:/dev/hugepages
- /usr/src:/usr/src
+ - ./cuphycontroller_P5G_WNC_GH.yaml:/opt/nvidia/cuBB/cuPHY-CP/cuphycontroller/config/cuphycontroller_P5G_WNC_GH.yaml
- ./aerial_l1_entrypoint.sh:/opt/nvidia/cuBB/aerial_l1_entrypoint.sh
- /var/log/aerial:/var/log/aerial
- ../../../cmake_targets/share:/opt/cuBB/share
userns_mode: host
ipc: "shareable"
- image: cubb-build:25-2.1
+ image: cubb-build:25-3
environment:
- cuBB_SDK=/opt/nvidia/cuBB
command: bash -c "sudo rm -rf /tmp/phy.log && sudo chmod +x /opt/nvidia/cuBB/aerial_l1_entrypoint.sh && /opt/nvidia/cuBB/aerial_l1_entrypoint.sh"
@@ -45,7 +46,7 @@ services:
- IPC_LOCK
ipc: "container:nv-cubb"
environment:
- USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,utc_time
deploy:
resources:
reservations:
diff --git a/ci-scripts/yaml_files/sa_gnb_aerial_ul/aerial_l1_entrypoint.sh b/ci-scripts/yaml_files/sa_gnb_aerial_ul/aerial_l1_entrypoint.sh
index e0fea22190..c8bac9eb3e 100755
--- a/ci-scripts/yaml_files/sa_gnb_aerial_ul/aerial_l1_entrypoint.sh
+++ b/ci-scripts/yaml_files/sa_gnb_aerial_ul/aerial_l1_entrypoint.sh
@@ -4,8 +4,6 @@
cuBB_Path="${cuBB_SDK:-/opt/nvidia/cuBB}"
cd "$cuBB_Path" || exit 1
-# Add gdrcopy to LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/opt/mellanox/dpdk/lib/x86_64-linux-gnu:/opt/mellanox/doca/lib/x86_64-linux-gnu:/opt/nvidia/cuBB/cuPHY-CP/external/gdrcopy/build/x86_64/
# Restart MPS
# Export variables
@@ -14,7 +12,7 @@ export CUDA_MPS_PIPE_DIRECTORY=/var
export CUDA_MPS_LOG_DIRECTORY=/var
# Stop existing MPS
-sudo -E echo quit | sudo -E nvidia-cuda-mps-control
+echo quit | sudo -E nvidia-cuda-mps-control
# Start MPS
sudo -E nvidia-cuda-mps-control -d
@@ -24,11 +22,11 @@ sudo -E echo start_server -uid 0 | sudo -E nvidia-cuda-mps-control
# Check if an argument is provided
if [ $# -eq 0 ]; then
# No argument provided, use default value
- argument="P5G_FXN_GH"
+ argument="P5G_WNC_GH"
else
# Argument provided, use it
argument="$1"
fi
-sudo -E "$cuBB_Path"/build/cuPHY-CP/cuphycontroller/examples/cuphycontroller_scf "$argument"
-sudo -E ./build/cuPHY-CP/gt_common_libs/nvIPC/tests/pcap/pcap_collect
+sudo -E "$cuBB_Path"/build.$(uname -m)/cuPHY-CP/cuphycontroller/examples/cuphycontroller_scf "$argument"
+sudo -E ./build.$(uname -m)/cuPHY-CP/gt_common_libs/nvIPC/tests/pcap/pcap_collect
diff --git a/ci-scripts/yaml_files/sa_gnb_aerial_ul/cuphycontroller_P5G_WNC_GH_ul.yaml b/ci-scripts/yaml_files/sa_gnb_aerial_ul/cuphycontroller_P5G_WNC_GH_ul.yaml
new file mode 100644
index 0000000000..4866ae1ce1
--- /dev/null
+++ b/ci-scripts/yaml_files/sa_gnb_aerial_ul/cuphycontroller_P5G_WNC_GH_ul.yaml
@@ -0,0 +1,243 @@
+# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+aerial_sdk_version: 25-3-cubb
+l2adapter_filename: l2_adapter_config_P5G_GH.yaml
+aerial_metrics_backend_address: 127.0.0.1:8081
+
+# CPU core shared by all low-priority threads
+low_priority_core: 10
+enable_ptp_svc_monitoring: 0
+ptp_rms_threshold: 20 #ns
+nic_tput_alert_threshold_mbps: 85000
+
+cuphydriver_config:
+ standalone: 0
+ validation: 0
+ num_slots: 8
+ log_level: DBG
+ profiler_sec: 0
+ dpdk_thread: 10
+ dpdk_verbose_logs: 0
+ accu_tx_sched_res_ns: 500
+ accu_tx_sched_disable: 0 #Flag applicable only for CX6-DX : BF3/CX7 HW and beyond support accurate send scheduling directly on timestamp, for CX6-DX this is implemented via software emulation
+ fh_stats_dump_cpu_core: -1
+ pdump_client_thread: -1
+ use_green_contexts: 0
+ use_batched_memcpy: 0 # Experimental feature; requires >= CUDA 12.8
+ mps_sm_pusch: 100
+ mps_sm_pucch: 2
+ mps_sm_prach: 2
+ mps_sm_ul_order: 20
+ mps_sm_pdsch: 102
+ mps_sm_pdcch: 10
+ mps_sm_pbch: 2
+ mps_sm_gpu_comms: 16
+ mps_sm_srs: 16
+ pdsch_fallback: 0
+ dpdk_file_prefix: cuphycontroller
+ nics:
+ - nic: '0000:01:00.0'
+ mtu: 9216
+ cpu_mbufs: 196608
+ uplane_tx_handles: 64
+ txq_size: 8192
+ rxq_size: 16384
+ gpu: 0
+ cus_port_failover: 0
+ gpus:
+ - 0
+ # Set GPUID to the GPU sharing the PCIe switch as NIC
+ # run nvidia-smi topo -m to find out which GPU
+ workers_ul: [4,5]
+ workers_dl: [6,7,8]
+ debug_worker: -1
+ workers_sched_priority: 95
+ prometheus_thread: -1
+ start_section_id_srs: 3072
+ start_section_id_prach: 2048
+ enable_ul_cuphy_graphs: 1
+ enable_dl_cuphy_graphs: 1
+ ul_order_kernel_mode: 0 # 0: Ping-Pong, 1: dual CTA
+ ul_order_timeout_cpu_ns: 8000000
+ ul_order_timeout_log_interval_ns: 1000000000
+ ul_order_timeout_gpu_ns: 3000000
+ ul_order_timeout_gpu_srs_ns: 5200000
+ ul_srs_aggr3_task_launch_offset_ns: 500000
+ ul_order_timeout_gpu_log_enable: 0
+ ul_order_max_rx_pkts: 512
+ ul_order_rx_pkts_timeout_ns: 100000
+ cplane_disable: 0
+ gpu_init_comms_dl: 1
+ cell_group: 1
+ cell_group_num: 1
+ fix_beta_dl: 0
+ bfw_beta_prescaler: 16384
+ pusch_workCancelMode: 2 # set cuphyPuschStatPrms_t workCancelMode field to PUSCH_DEVICE_GRAPHS; this only sets the mode and does not cancel work;
+ # work cancellation (i.e., not launching some of the device graphs) can only occur after an explicit internal
+ # memory write is timely observed by a PUSCH graph.
+ pusch_sinr: 2
+ pusch_rssi: 1
+ pusch_tdi: 1
+ pusch_cfo: 1
+ pusch_dftsofdm: 0
+ pusch_to: 1
+ pusch_select_eqcoeffalgo: 3
+ pusch_select_chestalgo: 1
+ pusch_enable_perprgchest: 0
+ pusch_tbsizecheck: 1
+ pusch_deviceGraphLaunchEn: 1
+ pusch_waitTimeOutPreEarlyHarqUs: 3000
+ pusch_waitTimeOutPostEarlyHarqUs: 3000
+ puxch_polarDcdrListSz: 8
+ enable_cpu_task_tracing: 0
+ enable_prepare_tracing: 0
+ disable_empw: 0 #1=>Disables Multi packet WQE feature
+ cqe_tracer_config:
+ enable_dl_cqe_tracing: 0
+ cqe_trace_cell_mask: 1 #[64 bit mask: Bit0->Cell0, Bit1->Cell1...]
+ cqe_trace_slot_mask: 196800 #[20 bit mask: Bit0->Slot0, Bit1->Slot1...] 196800=>All *6,*7 DL Slots
+ ul_rx_pkt_tracing_level: 0
+ ul_rx_pkt_tracing_level_srs: 0
+ pmu_metrics: 0 #Enable and select PMU metrics, 0=disabled, 1=General Counters (platform agnostic), 2=Topdown Metrics (Grace only), 3=Cache Metrics (Grace only)
+ enable_h2d_copy_thread: 1
+ h2d_copy_thread_cpu_affinity : 11
+ h2d_copy_thread_sched_priority : 95 #0->SCHED_OTHER, >0->Actual
+ split_ul_cuda_streams: 0 # 1=Put UL slot 4 and slot 5 on different streams for DDDSUUDDDD pattern
+ serialize_pucch_pusch: 0 # 1=Force serialization of PUSCH/PUCCH
+ # Note: for Early Harq (EH) order is PUSCH EH -> PUCCH -> PUSCH non EH
+ # for non-Early Harq order is PUCCH -> all PUSCH processing
+ aggr_obj_non_avail_th: 5 # Threshold for consecutive non-availability of Aggregated objects(UL/DL) or DL/UL buffers
+ dl_wait_th_ns:
+ - 500000 #H2D copy wait threshold
+ - 4000000 #cuPHY DL channel wait threshold
+ sendCPlane_timing_error_th_ns : 0
+ sendCPlane_ulbfw_backoff_th_ns: 300000 # ULBFW must be completed by cplane send time - this is the backoff time
+ sendCPlane_dlbfw_backoff_th_ns: 300000 # DLBFW must be completed by cplane send time - this is the backoff time
+ pusch_forcedNumCsi2Bits: 0
+ mMIMO_enable: 0
+ enable_srs: 1
+ ue_mode: 0
+ mCh_segment_proc_enable: 0
+ pusch_aggr_per_ctx: 9 #3
+ prach_aggr_per_ctx: 2
+ pucch_aggr_per_ctx: 4
+ srs_aggr_per_ctx: 3
+ ul_input_buffer_per_cell: 10
+ ul_input_buffer_per_cell_srs: 6
+ max_harq_pools: 384
+ max_harq_tx_count_bundled: 10
+ max_harq_tx_count_non_bundled: 4
+ ok_testbench_config:
+ enable_ok_tb: 0
+ num_ok_tb_slot: 0 #Presently not used
+ max_ru_unhealthy_ul_slots: 100
+ srs_chest_algo_type: 0
+ srs_chest_tol2_normalization_algo_type: 1
+ srs_chest_tol2_constant_scaler: 32768.0
+ bfw_power_normalization_alg_selector: 1
+ total_num_srs_chest_buffers: 6144
+ send_static_bfw_wt_all_cplane: 1
+ ul_pcap_capture_enable: 0
+ ul_pcap_capture_thread_cpu_affinity: 10
+ ul_pcap_capture_thread_sched_priority: 95
+ pcap_logger_ul_cplane_enable: 0
+ pcap_logger_dl_cplane_enable: 0
+ pcap_logger_thread_cpu_affinity: 10
+ pcap_logger_thread_sched_prio: 95
+ pcap_logger_file_save_dir: ./
+ dlc_bfw_enable_divide_per_cell: 0 # Enable/disable dividing DL BFW C-Plane transmission window among multiple cells in a slot
+ ulc_bfw_enable_divide_per_cell: 0 # Enable/disable dividing UL BFW C-Plane transmission window among multiple cells in a slot
+ dlc_alloc_cplane_bfw_txq: 0 # Allocates a second separate queue for BFW DL C-Plane transmission
+ ulc_alloc_cplane_bfw_txq: 1 # Allocates a second separate queue for BFW UL C-Plane transmission
+ #static beam id range
+ static_beam_id_start: 1
+ static_beam_id_end: 16527
+ #dynamic beam id range
+ dynamic_beam_id_start: 16528 #Dynamic beam ID start should be after static beam ID end
+ dynamic_beam_id_end: 32767 #15bit max value
+ bfw_c_plane_chaining_mode: 0 # 0: Default memcpy of BFW weights, 1: CPU mbuf chaining of BFW weights, 2: GPU mbuf chaining
+ enable_l1_param_sanity_check: 0
+ pusch_nMaxLdpcHetConfigs: 32
+ notify_ul_harq_buffer_release: 0
+
+ # data_config:
+ # datalake_core: 12 # This must be set for Data Lake and/or E3 Agent to be used
+ # datalake_db_write_enable: 1 # Enable/disable ClickHouse writes based on datalake_data_types
+ # datalake_samples: 1000000
+ # datalake_address: localhost
+ # datalake_engine: "MergeTree() PRIMARY KEY (TsTaiNs)"
+ # # datalake_drop_tables: 0 # Set to 1 to drop Clickhouse tables at startup
+ # datalake_data_types: [fh, pusch, hest] # Data types to write to ClickHouse DB (all types always collected in memory for E3 Agent):
+ # fh = Fronthaul IQ samples,pusch = PUSCH/FAPI data, hest = channel estimates
+ # datalake_store_failed_pdu: 0 # Set to 1 to store PDU data even when CRC fails
+ # e3_agent_enable: 0 # Enable/disable E3 Agent and dApp capabilities
+ # num_rows_fh: 120
+ # num_rows_pusch: 200
+ # num_rows_hest: 140
+ # e3_pub_port: 5555 # E3 publisher port for indication messages
+ # e3_rep_port: 5556 # E3 reply port for E3AP requests
+ # e3_sub_port: 5560 # E3 subscriber port for Manager messages
+
+ cells:
+ - name: O-RU 0
+ cell_id: 1
+ ru_type: 1
+ # set to 00:00:00:00:00:00 to use the MAC address of the NIC port to use
+ src_mac_addr: 00:00:00:00:00:00
+ dst_mac_addr: e8:c7:cf:ad:12:0b #WNC n78
+ nic: '0000:01:00.0'
+ vlan: 500
+ pcp: 7
+ txq_count_uplane: 1
+ eAxC_id_ssb_pbch: [0, 1, 2, 3]
+ eAxC_id_pdcch: [0, 1, 2, 3]
+ eAxC_id_pdsch: [0, 1, 2, 3]
+ eAxC_id_csirs: [0, 1, 2, 3]
+ eAxC_id_pusch: [0, 1, 2, 3]
+ eAxC_id_pucch: [0, 1, 2, 3]
+ eAxC_id_srs: [8, 9, 10, 11]
+ eAxC_id_prach: [4, 5, 6, 7]
+ dl_iq_data_fmt: {comp_meth: 1, bit_width: 9}
+ ul_iq_data_fmt: {comp_meth: 1, bit_width: 9}
+ section_3_time_offset: 484
+ fs_offset_dl: 7
+ exponent_dl: 4
+ ref_dl: 0
+ fs_offset_ul: -5
+ exponent_ul: 4
+ max_amp_ul: 65504
+ mu: 1
+ T1a_max_up_ns: 280000
+ T1a_max_cp_ul_ns: 405000
+ Ta4_min_ns: 50000
+ Ta4_max_ns: 331000
+ Tcp_adv_dl_ns: 125000
+ ul_u_plane_tx_offset_ns: 280000
+ fh_len_range: 0
+ pusch_prb_stride: 273
+ prach_prb_stride: 12
+ srs_prb_stride: 273
+ pusch_ldpc_max_num_itr_algo_type: 1
+ pusch_fixed_max_num_ldpc_itrs: 10
+ pusch_ldpc_early_termination: 0
+ pusch_ldpc_algo_index: 0
+ pusch_ldpc_flags: 2
+ pusch_ldpc_use_half: 1
+ pusch_nMaxPrb: 273
+ pusch_nMaxRx: 4
+ ul_gain_calibration: 78.68
+ lower_guard_bw: 845
+ tv_pusch: cuPhyChEstCoeffs.h5
diff --git a/ci-scripts/yaml_files/sa_gnb_aerial_ul/docker-compose.yaml b/ci-scripts/yaml_files/sa_gnb_aerial_ul/docker-compose.yaml
index c0b3e6f81d..7276cfdebd 100644
--- a/ci-scripts/yaml_files/sa_gnb_aerial_ul/docker-compose.yaml
+++ b/ci-scripts/yaml_files/sa_gnb_aerial_ul/docker-compose.yaml
@@ -18,12 +18,13 @@ services:
- /lib/modules:/lib/modules
- /dev/hugepages:/dev/hugepages
- /usr/src:/usr/src
+ - ./cuphycontroller_P5G_WNC_GH_ul.yaml:/opt/nvidia/cuBB/cuPHY-CP/cuphycontroller/config/cuphycontroller_P5G_WNC_GH.yaml
- ./aerial_l1_entrypoint.sh:/opt/nvidia/cuBB/aerial_l1_entrypoint.sh
- /var/log/aerial:/var/log/aerial
- ../../../cmake_targets/share:/opt/cuBB/share
userns_mode: host
ipc: "shareable"
- image: cubb-build:25-2.1_srs-ul-heavy
+ image: cubb-build:25-3
environment:
- cuBB_SDK=/opt/nvidia/cuBB
command: bash -c "sudo rm -rf /tmp/phy.log && sudo chmod +x /opt/nvidia/cuBB/aerial_l1_entrypoint.sh && /opt/nvidia/cuBB/aerial_l1_entrypoint.sh"
@@ -45,7 +46,7 @@ services:
- IPC_LOCK
ipc: "container:nv-cubb"
environment:
- USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time
+ USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,utc_time
deploy:
resources:
reservations:
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 0e4d092916..c6d1276e88 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -82,6 +82,8 @@ Options:
Makes the NR softmodem
--RU
Makes the OAI RRU
+--nrRU
+ Makes the NR RRU
--UE
Makes the UE specific parts (usim, nvram) from the given configuration file
--nrUE
@@ -227,6 +229,11 @@ function main() {
TARGET_LIST="$TARGET_LIST oairu"
echo_info "Will compile RRU"
shift;;
+ --nrRU)
+ NRRU=1
+ TARGET_LIST="$TARGET_LIST nr-oru"
+ echo_info "Will compile NR O-RU"
+ shift;;
--UE)
UE=1
TARGET_LIST="$TARGET_LIST lte-uesoftmodem conf2uedata usim nvram"
@@ -452,7 +459,7 @@ function main() {
if [[ $TARGET_LIST != "" ]] && [[ -f $OPENAIR_DIR/CMakeLists.txt ]]; then
# add some default libraries that should always be built
# for eNB, gNB, UEs, simulators
- if [[ $gNB == 1 || $eNB == 1 || $UE == 1 || $nrUE == 1 || $SIMUS_PHY == 1 || $RU == 1 ]]; then
+ if [[ $gNB == 1 || $eNB == 1 || $UE == 1 || $nrUE == 1 || $SIMUS_PHY == 1 || $RU == 1 || $NRRU == 1 ]]; then
TARGET_LIST="$TARGET_LIST params_libconfig coding rfsimulator dfts params_yaml vrtsim rf_emulator"
fi
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index eeffc9d4f1..3443d06c43 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -278,7 +278,7 @@ check_install_usrp_uhd_driver(){
x=$((x + 1))
done
$SUDO apt-get update
- $SUDO apt-get -y install python-tk $boost_libs_ubuntu libusb-1.0-0-dev
+ $SUDO apt-get -y install python3-tk $boost_libs_ubuntu libusb-1.0-0-dev
case "$(get_distribution_release)" in
"ubuntu20.04" | "ubuntu22.04")
$SUDO apt-get -y install libuhd-dev libuhd4.5.0 uhd-host
@@ -288,7 +288,7 @@ check_install_usrp_uhd_driver(){
boost_libs_fedora="boost-chrono boost-date-time boost-filesystem boost-program-options boost-thread boost-test boost-regex boost-devel"
if [ $IS_CONTAINER -eq 0 ]
then
- $SUDO $INSTALLER -y install python3 $boost_libs_fedora libusb-devel libusbx-devel python3-mako python3-docutils python3-pip $CMAKE
+ $SUDO $INSTALLER -y install python3 $boost_libs_fedora libusb1-devel libusbx-devel python3-mako python3-docutils python3-pip $CMAKE
$SUDO pip3 install requests
else
$SUDO $INSTALLER -y install $boost_libs_fedora $CMAKE
diff --git a/cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch b/cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch
index 6d68225bbf..ba10bf38af 100644
--- a/cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch
+++ b/cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch
@@ -1,5 +1,5 @@
diff --git a/fhi_lib/app/src/common.h b/fhi_lib/app/src/common.h
-index ac5f471..94c2d7c 100644
+index ac5f471..ed9ab7d 100644
--- a/fhi_lib/app/src/common.h
+++ b/fhi_lib/app/src/common.h
@@ -28,7 +28,7 @@
@@ -7,7 +7,7 @@ index ac5f471..94c2d7c 100644
#include
-#define VERSIONX "oran_f_release_v1.0"
-+#define VERSIONX "oran_f_release_v1.6"
++#define VERSIONX "oran_f_release_v1.7"
#define APP_O_DU 0
#define APP_O_RU 1
@@ -173,7 +173,7 @@ index eccc4ae..a97fdc6 100644
CPP_FLAGS_FULL := $(CPP_FLAGS) $(CPP_COMP) $(INC) $(DEF)
CPP_FLAGS_FULL_SNC := $(CPP_FLAGS) $(CPP_COMP_SNC) $(INC) $(DEF)
diff --git a/fhi_lib/lib/api/xran_fh_o_du.h b/fhi_lib/lib/api/xran_fh_o_du.h
-index bacf597..2aeaaae 100644
+index bacf597..18597d6 100644
--- a/fhi_lib/lib/api/xran_fh_o_du.h
+++ b/fhi_lib/lib/api/xran_fh_o_du.h
@@ -141,8 +141,8 @@ extern "C" {
@@ -182,7 +182,7 @@ index bacf597..2aeaaae 100644
-#define XRAN_MAX_FRAGMENT (4) /**< Max number of fragmentations in single symbol */
-#define XRAN_MAX_SET_BFWS (64) /**< Assumed 64Ant, BFP 9bit with 9K jumbo frame */
-+#define XRAN_MAX_FRAGMENT (6) /**< Max number of fragmentations in single symbol */
++#define XRAN_MAX_FRAGMENT (7) /**< Max number of fragmentations in single symbol */
+#define XRAN_MAX_SET_BFWS (1) //(64) /**< Assumed 64Ant, BFP 9bit with 9K jumbo frame */
#define XRAN_MAX_PKT_BURST (448+4) /**< 4x14x8 symbols per ms */
diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c
index 5d8bb2cfcc..14f4a4c81d 100644
--- a/common/config/config_load_configmodule.c
+++ b/common/config/config_load_configmodule.c
@@ -38,7 +38,6 @@
#include
#include "common/platform_types.h"
-#define CONFIG_LOADCONFIG_MAIN
#include "config_load_configmodule.h"
#include "config_userapi.h"
#include "../utils/LOG/log.h"
@@ -144,7 +143,7 @@ int config_cmdlineonly_getlist(configmodule_interface_t *cfg,
paramlist_def_t *ParamList,
paramdef_t *params,
int numparams,
- char *prefix)
+ const char *prefix)
{
ParamList->numelt = 0;
return 0;
diff --git a/common/config/config_load_configmodule.h b/common/config/config_load_configmodule.h
index 2c45f788d4..93753ef358 100644
--- a/common/config/config_load_configmodule.h
+++ b/common/config/config_load_configmodule.h
@@ -61,7 +61,7 @@
struct configmodule_interface;
typedef int (*configmodule_getfunc_t)(struct configmodule_interface *, paramdef_t *, int numparams, const char *prefix);
typedef int (
- *configmodule_getlistfunc_t)(struct configmodule_interface *, paramlist_def_t *, paramdef_t *, int numparams, char *prefix);
+ *configmodule_getlistfunc_t)(struct configmodule_interface *, paramlist_def_t *, paramdef_t *, int numparams, const char *prefix);
typedef int (*configmodule_setfunc_t)(paramdef_t *cfgoptions, int numoptions, const char *prefix);
typedef void (*configmodule_endfunc_t)(struct configmodule_interface *cfg);
diff --git a/common/config/config_userapi.c b/common/config/config_userapi.c
index 7c92a611de..271b9ba0a9 100644
--- a/common/config/config_userapi.c
+++ b/common/config/config_userapi.c
@@ -142,7 +142,7 @@ int config_get(configmodule_interface_t *cfgif, paramdef_t *params, int numparam
return ret;
}
-int config_getlist(configmodule_interface_t *cfg, paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix)
+int config_getlist(configmodule_interface_t *cfg, paramlist_def_t *ParamList, paramdef_t *params, int numparams, const char *prefix)
{
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
fprintf(stderr,"[CONFIG] config_get skipped, config module not properly initialized\n");
diff --git a/common/config/config_userapi.h b/common/config/config_userapi.h
index 3aeeeec3c1..57d738ae83 100644
--- a/common/config/config_userapi.h
+++ b/common/config/config_userapi.h
@@ -62,7 +62,7 @@ int config_assign_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions
#define CONFIG_CHECKALLSECTIONS "ALLSECTIONS"
int config_check_unknown_cmdlineopt(configmodule_interface_t *cfg, char *prefix);
int config_get(configmodule_interface_t *cfg, paramdef_t *params, int numparams, const char *prefix);
-int config_getlist(configmodule_interface_t *cfg, paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix);
+int config_getlist(configmodule_interface_t *cfg, paramlist_def_t *ParamList, paramdef_t *params, int numparams, const char *prefix);
/* apis to set some of the paramdef_t fields before using the get/getlist api's */
void config_set_checkfunctions(paramdef_t *params, checkedparam_t *checkfunctions, int numparams);
diff --git a/common/openairinterface5g_limits.h b/common/openairinterface5g_limits.h
index d2f44a6195..1470270db4 100644
--- a/common/openairinterface5g_limits.h
+++ b/common/openairinterface5g_limits.h
@@ -12,8 +12,6 @@
# define NUMBER_OF_SRS_MAX 16
# define NUMBER_OF_SCH_STATS_MAX 16
-#define MAX_MANAGED_ENB_PER_MOBILE 2
-#define MAX_MANAGED_GNB_PER_MOBILE 2
# ifndef PHYSIM
# ifndef UE_EXPANSION
diff --git a/common/platform_constants.h b/common/platform_constants.h
index 2faadc3dcd..b424e80f7d 100644
--- a/common/platform_constants.h
+++ b/common/platform_constants.h
@@ -27,39 +27,30 @@
#ifdef LARGE_SCALE
#define NB_MODULES_MAX 128
-#define NB_NODE_MAX 128
#else
#define NB_MODULES_MAX 32
-#define NB_NODE_MAX 32
#endif
#define MAX_IP_PACKET_SIZE 10000 // 9000
#define MAX_MODULES NB_MODULES_MAX
-#define MAX_NR_RRC_UE_CONTEXTS 64
#ifndef UE_EXPANSION
#ifdef LARGE_SCALE
#define MAX_MOBILES_PER_ENB 128
#define MAX_MOBILES_PER_ENB_NB_IoT 128
#define MAX_eNB 2
-#define MAX_gNB 2
#else
#define MAX_MOBILES_PER_ENB 40
#define MAX_MOBILES_PER_ENB_NB_IoT 40
#define MAX_eNB 2
-#define MAX_gNB 2
#endif
#else
#define MAX_MOBILES_PER_ENB 256
#define MAX_MOBILES_PER_ENB_NB_IoT 256
#define MAX_eNB 2
-#define MAX_gNB 2
#endif
-#define NUMBER_OF_NR_UCI_STATS_MAX 16
-#define MAX_MANAGED_ENB_PER_MOBILE 2
-#define MAX_MANAGED_GNB_PER_MOBILE 2
/// NB-IOT
#define NB_RB_MAX_NB_IOT (2 + 3) /* 2 from LTE_maxDRB_NB_r13 in LTE_asn_constant.h + 3 SRBs */
@@ -85,12 +76,10 @@
// RLC Entity
#define RLC_TX_MAXSIZE 10000000
#define RLC_RX_MAXSIZE 10000000
-#define SEND_MRW_ON 240
#define MAX_ANT 8
// CBA constant
#define NUM_MAX_CBA_GROUP 4
-#define printk printf
#define RETURNok (0)
#define RETURNerror (-1)
#define DEFAULT_NAS_PATH "PWD"
@@ -100,5 +89,8 @@
// SDAP
#define MAX_QOS_FLOWS 64
+// SDAP/5G NAS NOS1
+#define DEFAULT_NOS1_PDU_ID 10
+
#define SPEED_OF_LIGHT 299792458 // in m/s
#endif /* __PLATFORM_CONSTANTS_H__ */
diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
index dc997db6c7..395139132d 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 tun_if.c)
+add_library(utils utils.c system.c time_meas.c time_stat.c tuntap_if.c)
target_include_directories(utils PUBLIC .)
target_link_libraries(utils PRIVATE ${T_LIB})
if (ENABLE_TESTS)
diff --git a/common/utils/LOG/DOC/lttng_logs.md b/common/utils/LOG/DOC/lttng_logs.md
index 8918cbffe4..3baa9c04b2 100644
--- a/common/utils/LOG/DOC/lttng_logs.md
+++ b/common/utils/LOG/DOC/lttng_logs.md
@@ -65,7 +65,7 @@ Note: only LTTng 2.3.8 is supported.
1. **Run gNB:**
```bash
- ./$binary_path -O $configuration_file PARALLEL_SINGLE_THREAD --rfsimulator.serveraddr server --rfsim -E
+ ./$binary_path -O $configuration_file PARALLEL_SINGLE_THREAD --rfsimulator.[0].serveraddr server --rfsim -E
```
## Verifying Tracepoints
diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c
index 23aa075ca1..99b1f140bc 100644
--- a/common/utils/LOG/log.c
+++ b/common/utils/LOG/log.c
@@ -31,8 +31,6 @@
#define _GNU_SOURCE /* required for pthread_getname_np */
//#define LOG_TEST 1
-#define COMPONENT_LOG
-#define COMPONENT_LOG_IF
#include
#define LOG_MAIN
#include "log.h"
diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h
index 312f2c9510..a9db2e9c5c 100644
--- a/common/utils/LOG/log.h
+++ b/common/utils/LOG/log.h
@@ -302,22 +302,6 @@ void close_log_mem(void);
@param multiVec create new file or append to existing (useful for writing multiple vectors to same file. Just call the function multiple times with same file name and with this parameter set to 1)
*/
#define MATLAB_RAW (1U<<31)
-#define MATLAB_SHORT 0
-#define MATLAB_CSHORT 1
-#define MATLAB_INT 2
-#define MATLAB_CINT 3
-#define MATLAB_INT8 4
-#define MATLAB_CINT8 5
-#define MATLAB_LLONG 6
-#define MATLAB_DOUBLE 7
-#define MATLAB_CDOUBLE 8
-#define MATLAB_UINT8 9
-#define MATLEB_EREN1 10
-#define MATLEB_EREN2 11
-#define MATLEB_EREN3 12
-#define MATLAB_CSHORT_BRACKET1 13
-#define MATLAB_CSHORT_BRACKET2 14
-#define MATLAB_CSHORT_BRACKET3 15
int32_t write_file_matlab(const char *fname,
const char *vname,
@@ -333,7 +317,6 @@ int32_t write_file_matlab(const char *fname,
#define LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level"
#define LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE "global_log_online"
-#define LOG_CONFIG_STRING_GLOBAL_LOG_INFILE "global_log_infile"
#define LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS "global_log_options"
#define LOG_CONFIG_LEVEL_FORMAT "%s_log_level"
diff --git a/common/utils/T/T.h b/common/utils/T/T.h
index c78b99632a..ab90dd5907 100644
--- a/common/utils/T/T.h
+++ b/common/utils/T/T.h
@@ -14,7 +14,6 @@
/* T message IDs */
#include "T_IDs.h"
-#define T_ACTIVE_STDOUT 2
/* known type - this is where you add new types */
#define T_INT(x) int, (x)
diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c
index 6d0a564ab8..831488d485 100644
--- a/common/utils/T/tracer/macpdu2wireshark.c
+++ b/common/utils/T/tracer/macpdu2wireshark.c
@@ -387,7 +387,6 @@ void sr(void *_d, event e)
#define MAC_NR_HARQID 0x06
#define MAC_NR_FRAME_SLOT_TAG 0x07
-#define NR_FDD_RADIO 1
#define NR_TDD_RADIO 2
#define NR_DIRECTION_UPLINK 0
diff --git a/common/utils/load_module_shlib.c b/common/utils/load_module_shlib.c
index 13eec39776..2f97879c1e 100644
--- a/common/utils/load_module_shlib.c
+++ b/common/utils/load_module_shlib.c
@@ -39,7 +39,6 @@
#include
#include "openair1/PHY/defs_common.h"
#include "common/oai_version.h"
-#define LOAD_MODULE_SHLIB_MAIN
#include "common/config/config_userapi.h"
#include "load_module_shlib.h"
diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c
index 64902c6be2..96b8681cff 100644
--- a/common/utils/nr/nr_common.c
+++ b/common/utils/nr/nr_common.c
@@ -866,7 +866,6 @@ void get_samplerate_and_bw(int mu,
int n_rb,
int8_t threequarter_fs,
double *sample_rate,
- unsigned int *samples_per_frame,
double *tx_bw,
double *rx_bw) {
@@ -876,12 +875,10 @@ void get_samplerate_and_bw(int mu,
if (threequarter_fs) {
warn_higher_threequarter_fs(n_rb, mu);
*sample_rate=92.16e6;
- *samples_per_frame = 921600;
*tx_bw = 50e6;
*rx_bw = 50e6;
} else {
*sample_rate=61.44e6;
- *samples_per_frame = 614400;
*tx_bw = 50e6;
*rx_bw = 50e6;
}
@@ -890,10 +887,8 @@ void get_samplerate_and_bw(int mu,
case 188: // 35Mhz
if (threequarter_fs) {
*sample_rate = 46.08e6;
- *samples_per_frame = 460800;
} else {
*sample_rate = 61.44e6;
- *samples_per_frame = 614400;
}
*tx_bw = (n_rb == 242) ? 45e6 : 35e6;
*rx_bw = (n_rb == 242) ? 45e6 : 35e6;
@@ -901,13 +896,11 @@ void get_samplerate_and_bw(int mu,
case 216:
if (threequarter_fs) {
*sample_rate=46.08e6;
- *samples_per_frame = 460800;
*tx_bw = 40e6;
*rx_bw = 40e6;
}
else {
*sample_rate=61.44e6;
- *samples_per_frame = 614400;
*tx_bw = 40e6;
*rx_bw = 40e6;
}
@@ -919,7 +912,6 @@ void get_samplerate_and_bw(int mu,
}
else {
*sample_rate=30.72e6;
- *samples_per_frame = 307200;
*tx_bw = 20e6;
*rx_bw = 20e6;
}
@@ -927,13 +919,11 @@ void get_samplerate_and_bw(int mu,
case 106:
if (threequarter_fs) {
*sample_rate=23.04e6;
- *samples_per_frame = 230400;
*tx_bw = 20e6;
*rx_bw = 20e6;
}
else {
*sample_rate=30.72e6;
- *samples_per_frame = 307200;
*tx_bw = 20e6;
*rx_bw = 20e6;
}
@@ -941,13 +931,11 @@ void get_samplerate_and_bw(int mu,
case 52:
if (threequarter_fs) {
*sample_rate=11.52e6;
- *samples_per_frame = 115200;
*tx_bw = 10e6;
*rx_bw = 10e6;
}
else {
*sample_rate=15.36e6;
- *samples_per_frame = 153600;
*tx_bw = 10e6;
*rx_bw = 10e6;
}
@@ -955,13 +943,11 @@ void get_samplerate_and_bw(int mu,
case 25:
if (threequarter_fs) {
*sample_rate=5.76e6;
- *samples_per_frame = 57600;
*tx_bw = 5e6;
*rx_bw = 5e6;
}
else {
*sample_rate=7.68e6;
- *samples_per_frame = 76800;
*tx_bw = 5e6;
*rx_bw = 5e6;
}
@@ -976,12 +962,10 @@ void get_samplerate_and_bw(int mu,
if (threequarter_fs) {
warn_higher_threequarter_fs(n_rb, mu);
*sample_rate=184.32e6;
- *samples_per_frame = 1843200;
*tx_bw = 100e6;
*rx_bw = 100e6;
} else {
*sample_rate=122.88e6;
- *samples_per_frame = 1228800;
*tx_bw = 100e6;
*rx_bw = 100e6;
}
@@ -989,12 +973,10 @@ void get_samplerate_and_bw(int mu,
case 217:
if (threequarter_fs) {
*sample_rate=92.16e6;
- *samples_per_frame = 921600;
*tx_bw = 80e6;
*rx_bw = 80e6;
} else {
*sample_rate=122.88e6;
- *samples_per_frame = 1228800;
*tx_bw = 80e6;
*rx_bw = 80e6;
}
@@ -1002,10 +984,8 @@ void get_samplerate_and_bw(int mu,
case 189:
if (threequarter_fs) {
*sample_rate = 92.16e6;
- *samples_per_frame = 921600;
} else {
*sample_rate = 122.88e6;
- *samples_per_frame = 1228800;
}
*tx_bw = 70e6;
*rx_bw = 70e6;
@@ -1016,7 +996,6 @@ void get_samplerate_and_bw(int mu,
}
else {
*sample_rate=61.44e6;
- *samples_per_frame = 614400;
*tx_bw = 60e6;
*rx_bw = 60e6;
}
@@ -1029,7 +1008,6 @@ void get_samplerate_and_bw(int mu,
}
else {
*sample_rate=61.44e6;
- *samples_per_frame = 614400;
*tx_bw = 50e6;
*rx_bw = 50e6;
}
@@ -1040,10 +1018,8 @@ void get_samplerate_and_bw(int mu,
case 92: // 35Mhz
if (threequarter_fs) {
*sample_rate = 46.08e6;
- *samples_per_frame = 460800;
} else {
*sample_rate = 61.44e6;
- *samples_per_frame = 614400;
}
*tx_bw = (n_rb == 119) ? 45e6 : 35e6;
*rx_bw = (n_rb == 119) ? 45e6 : 35e6;
@@ -1052,13 +1028,11 @@ void get_samplerate_and_bw(int mu,
case 106:
if (threequarter_fs) {
*sample_rate=46.08e6;
- *samples_per_frame = 460800;
*tx_bw = 40e6;
*rx_bw = 40e6;
}
else {
*sample_rate=61.44e6;
- *samples_per_frame = 614400;
*tx_bw = 40e6;
*rx_bw = 40e6;
}
@@ -1066,13 +1040,11 @@ void get_samplerate_and_bw(int mu,
case 51:
if (threequarter_fs) {
*sample_rate=23.04e6;
- *samples_per_frame = 230400;
*tx_bw = 20e6;
*rx_bw = 20e6;
}
else {
*sample_rate=30.72e6;
- *samples_per_frame = 307200;
*tx_bw = 20e6;
*rx_bw = 20e6;
}
@@ -1080,13 +1052,11 @@ void get_samplerate_and_bw(int mu,
case 24:
if (threequarter_fs) {
*sample_rate=11.52e6;
- *samples_per_frame = 115200;
*tx_bw = 10e6;
*rx_bw = 10e6;
}
else {
*sample_rate=15.36e6;
- *samples_per_frame = 153600;
*tx_bw = 10e6;
*rx_bw = 10e6;
}
@@ -1100,12 +1070,10 @@ void get_samplerate_and_bw(int mu,
case 128:
if (threequarter_fs) {
*sample_rate=184.32e6;
- *samples_per_frame = 1843200;
*tx_bw = 200e6;
*rx_bw = 200e6;
} else {
*sample_rate = 245.76e6;
- *samples_per_frame = 2457600;
*tx_bw = 200e6;
*rx_bw = 200e6;
}
@@ -1115,12 +1083,10 @@ void get_samplerate_and_bw(int mu,
case 64:
if (threequarter_fs) {
*sample_rate=92.16e6;
- *samples_per_frame = 921600;
*tx_bw = 100e6;
*rx_bw = 100e6;
} else {
*sample_rate = 122.88e6;
- *samples_per_frame = 1228800;
*tx_bw = 100e6;
*rx_bw = 100e6;
}
@@ -1129,12 +1095,10 @@ void get_samplerate_and_bw(int mu,
case 32:
if (threequarter_fs) {
*sample_rate=92.16e6;
- *samples_per_frame = 921600;
*tx_bw = 50e6;
*rx_bw = 50e6;
} else {
*sample_rate=61.44e6;
- *samples_per_frame = 614400;
*tx_bw = 50e6;
*rx_bw = 50e6;
}
diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h
index 732e24e501..e62d66658c 100644
--- a/common/utils/nr/nr_common.h
+++ b/common/utils/nr/nr_common.h
@@ -317,7 +317,6 @@ void get_samplerate_and_bw(int mu,
int n_rb,
int8_t threequarter_fs,
double *sample_rate,
- unsigned int *samples_per_frame,
double *tx_bw,
double *rx_bw);
uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB,
diff --git a/common/utils/ocp_itti/all_msg.h b/common/utils/ocp_itti/all_msg.h
index eb484ce8f1..377bfc4343 100644
--- a/common/utils/ocp_itti/all_msg.h
+++ b/common/utils/ocp_itti/all_msg.h
@@ -4,9 +4,6 @@
#include "openair2/COMMON/pdcp_messages_def.h"
#include "openair2/COMMON/rrc_messages_def.h"
#include "openair2/COMMON/nas_messages_def.h"
-#if ENABLE_RAL
- #include "openair2/COMMON/ral_messages_def.h"
-#endif
#include "openair2/COMMON/s1ap_messages_def.h"
#include "openair2/COMMON/x2ap_messages_def.h"
#include "openair2/COMMON/m2ap_messages_def.h"
diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h
index 8f4e25d8b1..d23e62365d 100644
--- a/common/utils/ocp_itti/intertask_interface.h
+++ b/common/utils/ocp_itti/intertask_interface.h
@@ -222,9 +222,6 @@ typedef struct IttiMsgText_s {
#include
#include
-#if ENABLE_RAL
- #include
-#endif
#include
#include
#include
diff --git a/common/utils/shm_iq_channel/shm_td_iq_channel.c b/common/utils/shm_iq_channel/shm_td_iq_channel.c
index ecebbaf494..169eb9f3f2 100644
--- a/common/utils/shm_iq_channel/shm_td_iq_channel.c
+++ b/common/utils/shm_iq_channel/shm_td_iq_channel.c
@@ -208,8 +208,11 @@ IQChannelErrorType shm_td_iq_channel_rx(ShmTDIQChannel *channel,
size_t num_samples_first_copy = CIRCULAR_BUFFER_SIZE - first_sample;
memcpy(tx_iq_data, base_ptr + first_sample, num_samples_first_copy * sizeof(sample_t));
memcpy(tx_iq_data + num_samples_first_copy, base_ptr, (num_samples - num_samples_first_copy) * sizeof(sample_t));
+ memset(base_ptr + first_sample, 0, num_samples_first_copy * sizeof(sample_t));
+ memset(base_ptr, 0, (num_samples - num_samples_first_copy) * sizeof(sample_t));
} else {
memcpy(tx_iq_data, base_ptr + first_sample, num_samples * sizeof(sample_t));
+ memset(base_ptr + first_sample, 0, num_samples * sizeof(sample_t));
}
return CHANNEL_NO_ERROR;
}
diff --git a/common/utils/telnetsrv/telnetsrv.h b/common/utils/telnetsrv/telnetsrv.h
index 82f2eba3ec..ab866c88fb 100644
--- a/common/utils/telnetsrv/telnetsrv.h
+++ b/common/utils/telnetsrv/telnetsrv.h
@@ -32,9 +32,7 @@
#define TELNETSRV_H
#include
-#define TELNETSRV_MODNAME "telnetsrv"
-#define TELNET_PORT 9090
#define TELNET_MAX_MSGLENGTH 2048
#define TELNET_PROMPT_PREFIX "softmodem"
#define TELNET_MAXCMD 20
diff --git a/common/utils/telnetsrv/telnetsrv_ci.c b/common/utils/telnetsrv/telnetsrv_ci.c
index 10f9626ef0..a2bcccd150 100644
--- a/common/utils/telnetsrv/telnetsrv_ci.c
+++ b/common/utils/telnetsrv/telnetsrv_ci.c
@@ -154,10 +154,17 @@ int fetch_du_by_ue_id(char *buf, int debug, telnet_printfunc_t prnt)
if (!RC.nrrrc)
ERROR_MSG_RET("no RRC present, cannot list counts\n");
- ue_id_t ue_id = 1;
+ ue_id_t ue_id;
if (buf) {
ue_id = strtol(buf, NULL, 10);
+ } else {
+ // No UE ID provided: find the connected UE first
+ rrc_gNB_ue_context_t *ue = get_single_rrc_ue();
+ if (!ue)
+ ERROR_MSG_RET("no single UE in RRC present\n");
+ ue_id = ue->ue_context.rrc_ue_id;
}
+
nr_rrc_du_container_t *du = get_du_for_ue(RC.nrrrc[0], ue_id);
if (du) {
diff --git a/common/utils/telnetsrv/telnetsrv_ciUE.c b/common/utils/telnetsrv/telnetsrv_ciUE.c
index cc580b1a83..457ba77b4b 100644
--- a/common/utils/telnetsrv/telnetsrv_ciUE.c
+++ b/common/utils/telnetsrv/telnetsrv_ciUE.c
@@ -172,7 +172,11 @@ static int add_pdu_session(char *buf, int debug, telnet_printfunc_t prnt)
if (!nas)
ERROR_MSG_RET("No NAS context found for UE_ID %d\n", ue_id);
- request_pdusession(nas, pdusession_id);
+ DevAssert(nas->uicc);
+ nssai_t nssai = {nas->uicc->nssai_sst, nas->uicc->nssai_sd};
+ pdu_session_config_t c = {pdusession_id, 1 /* = PDU_SESSION_TYPE_IPV4 */, nssai, nas->uicc->dnnStr};
+ nas->uicc->pdu_sessions[nas->uicc->n_pdu_sessions++] = c;
+ request_pdusession(nas, &c);
prnt("Triggered PDU session request for UE %d with ID %d\n", ue_id, pdusession_id);
return 0;
}
diff --git a/common/utils/telnetsrv/telnetsrv_measurements.h b/common/utils/telnetsrv/telnetsrv_measurements.h
index 351b27c1f1..4c9d36b9b2 100644
--- a/common/utils/telnetsrv/telnetsrv_measurements.h
+++ b/common/utils/telnetsrv/telnetsrv_measurements.h
@@ -42,7 +42,6 @@
#define TELNET_MAXMEASURNAME_LEN 30
-#define TELNET_MAXMEASURGROUPS 10
#define PRINT_CPUMEAS_STATE ((cpumeas(CPUMEAS_GETSTATE))?"enabled":"disabled")
typedef struct cpumeasurdef {
@@ -77,8 +76,6 @@ typedef struct mesurgroupdef {
} telnet_measurgroupdef_t;
#define MACSTATS_NAME(valptr) #valptr
-#define LTEMAC_MEASURGROUP_NAME "ltemac"
-#define PHYCPU_MEASURGROUP_NAME "phycpu"
#ifdef TELNETSRV_MEASURMENTS_MAIN
int measurcmd_show(char *buf, int debug, telnet_printfunc_t prnt);
diff --git a/common/utils/telnetsrv/telnetsrv_phycmd.h b/common/utils/telnetsrv/telnetsrv_phycmd.h
index b999436395..cdceedb1df 100644
--- a/common/utils/telnetsrv/telnetsrv_phycmd.h
+++ b/common/utils/telnetsrv/telnetsrv_phycmd.h
@@ -41,8 +41,6 @@
#include "openair1/PHY/phy_extern.h"
-#define TELNETVAR_PHYCC0 0
-#define TELNETVAR_PHYCC1 1
telnetshell_vardef_t phy_vardef[] = {{"", 0, 0, NULL}};
diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.c b/common/utils/telnetsrv/telnetsrv_proccmd.c
index f79e9f5287..bdaaa37a05 100644
--- a/common/utils/telnetsrv/telnetsrv_proccmd.c
+++ b/common/utils/telnetsrv/telnetsrv_proccmd.c
@@ -48,7 +48,6 @@
#include
#include
-#define READCFG_DYNLOAD
#define TELNETSERVERCODE
#include "telnetsrv.h"
diff --git a/common/utils/tun_if.c b/common/utils/tuntap_if.c
similarity index 73%
rename from common/utils/tun_if.c
rename to common/utils/tuntap_if.c
index f74ab3c7f2..b4722d69f1 100644
--- a/common/utils/tun_if.c
+++ b/common/utils/tuntap_if.c
@@ -27,10 +27,9 @@
#include
#include
#include
-#include
#include
-#include "tun_if.h"
+#include "tuntap_if.h"
#include "common/platform_constants.h"
#include "common/utils/LOG/log.h"
#include "common/utils/system.h"
@@ -38,7 +37,7 @@
int nas_sock_fd[MAX_MOBILES_PER_ENB * 2]; // Allocated for both LTE UE and NR UE.
int nas_sock_mbms_fd;
-int tun_alloc(const char *dev)
+int tuntap_alloc(int flag, const char *dev)
{
struct ifreq ifr;
int fd, err;
@@ -54,7 +53,8 @@ int tun_alloc(const char *dev)
*
* IFF_NO_PI - Do not provide packet information
*/
- ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
+ DevAssert(flag == IFF_TUN || flag == IFF_TAP);
+ ifr.ifr_flags = flag | IFF_NO_PI;
strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name) - 1);
if ((err = ioctl(fd, TUNSETIFF, (void *)&ifr)) < 0) {
close(fd);
@@ -76,7 +76,7 @@ int tun_alloc(const char *dev)
int tun_init_mbms(char *ifname)
{
- nas_sock_mbms_fd = tun_alloc(ifname);
+ nas_sock_mbms_fd = tuntap_alloc(IFF_TUN, ifname);
if (nas_sock_mbms_fd == -1) {
LOG_E(UTIL, "Error opening mbms socket %s (%d:%s)\n", ifname, errno, strerror(errno));
@@ -96,7 +96,7 @@ int tun_init_mbms(char *ifname)
int tun_init(const char *ifname, int instance_id)
{
- nas_sock_fd[instance_id] = tun_alloc(ifname);
+ nas_sock_fd[instance_id] = tuntap_alloc(IFF_TUN, ifname);
if (nas_sock_fd[instance_id] == -1) {
LOG_E(UTIL, "Error opening socket %s (%d:%s)\n", ifname, errno, strerror(errno));
@@ -158,42 +158,47 @@ static bool setInterfaceParameter(int sock_fd, const char *ifn, int af, const ch
}
-typedef enum { INTERFACE_DOWN, INTERFACE_UP } if_action_t;
/*
-* \brief bring interface up (up != 0) or down (up == 0)
+* \brief Get an interface's flags.
+* \param[in] sock_fd socket to use for getting the flags
+* \param[in] ifn the interface name for which to get flags
+* \param[out] flags the flags of the interface
+* \return true on success, false otherwise
*/
-static bool change_interface_state(int sock_fd, const char *ifn, if_action_t if_action)
+static bool get_if_flags(int sock_fd, const char *ifn, short *flags)
{
- const char *action = if_action == INTERFACE_DOWN ? "DOWN" : "UP";
-
struct ifreq ifr = {0};
strncpy(ifr.ifr_name, ifn, sizeof(ifr.ifr_name) - 1);
/* get flags of this interface: see netdevice(7) */
- bool success = ioctl(sock_fd, SIOCGIFFLAGS, (caddr_t)&ifr) == 0;
- if (!success && if_action == INTERFACE_DOWN && errno == ENODEV) {
- LOG_W(OIP, "trying to remove non-existant device %s\n", ifn);
- return true;
+ int success = ioctl(sock_fd, SIOCGIFFLAGS, (caddr_t)&ifr) == 0;
+ if (!success) {
+ LOG_W(OIP, "On interface %s: ioctl() failed: %d, %s\n", ifn, errno, strerror(errno));
+ return false;
}
- LOG_D(OIP, "Got flags for %s: 0x%x (action: %s)\n", ifn, ifr.ifr_flags, action);
-
- if (if_action == INTERFACE_UP) {
- ifr.ifr_flags |= IFF_UP | IFF_NOARP | IFF_POINTOPOINT;
- ifr.ifr_flags &= ~IFF_MULTICAST;
- } else {
- ifr.ifr_flags &= ~IFF_UP;
- }
-
- success = ioctl(sock_fd, SIOCSIFFLAGS, (caddr_t)&ifr) == 0;
- if (!success)
- goto fail_interface_state;
- LOG_D(OIP, "Interface %s successfully set %s\n", ifn, action);
-
+ *flags = ifr.ifr_flags;
return true;
+}
-fail_interface_state:
- LOG_E(OIP, "Bringing interface %s for %s: ioctl call failed: %d, %s\n", action, ifn, errno, strerror(errno));
- return false;
+/*
+ * \brief Set an interface's flags.
+* \param[in] sock_fd socket to use for setting the flags
+* \param[in] ifn the interface name for which to set flags
+* \param[in] flags the flags to set for the interface
+* \return true on success, false otherwise
+ */
+static bool set_if_flags(int sock_fd, const char *ifn, short flags)
+{
+ struct ifreq ifr = {0};
+ strncpy(ifr.ifr_name, ifn, sizeof(ifr.ifr_name) - 1);
+ ifr.ifr_flags = flags;
+
+ int success = ioctl(sock_fd, SIOCSIFFLAGS, (caddr_t)&ifr) == 0;
+ if (!success) {
+ LOG_W(OIP, "On interface %s: ioctl() failed: %d, %s\n", ifn, errno, strerror(errno));
+ return false;
+ }
+ return true;
}
@@ -227,11 +232,13 @@ bool tun_config(const char* ifname, const char *ipv4, const char *ipv6)
close(sock_fd);
}
+ // if successfully set IP addresses: set iterface up, disable ARP, no
+ // multicast, point-to-point
if (success)
- success = change_interface_state(sock_fd, ifname, INTERFACE_UP);
+ success = set_if_flags(sock_fd, ifname, (IFF_UP | IFF_NOARP | IFF_POINTOPOINT) & ~IFF_MULTICAST);
if (success)
- LOG_I(OIP, "Interface %s successfully configured, IPv4 %s, IPv6 %s\n", ifname, ipv4, ipv6);
+ LOG_A(OIP, "TUN Interface %s successfully configured, IPv4 %s, IPv6 %s\n", ifname, ipv4, ipv6);
else
LOG_E(OIP, "Interface %s couldn't be configured (IPv4 %s, IPv6 %s)\n", ifname, ipv4, ipv6);
@@ -239,6 +246,25 @@ bool tun_config(const char* ifname, const char *ipv4, const char *ipv6)
return success;
}
+bool tap_config(const char* ifname)
+{
+ int sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock_fd < 0) {
+ LOG_E(UTIL, "Failed creating socket for interface management: %d, %s\n", errno, strerror(errno));
+ return false;
+ }
+
+ bool success = set_if_flags(sock_fd, ifname, IFF_UP);
+
+ if (success)
+ LOG_A(OIP, "TAP interface %s successfully configured\n", ifname);
+ else
+ LOG_E(OIP, "Tap interface %s couldn't be configured\n", ifname);
+
+ close(sock_fd);
+ return success;
+}
+
void setup_ue_ipv4_route(const char* ifname, int instance_id, const char *ipv4)
{
int table_id = instance_id - 1 + 10000;
@@ -267,14 +293,16 @@ int tun_generate_ifname(char *ifname, const char *ifprefix, int instance_id)
return snprintf(ifname, IFNAMSIZ, "%s%d", ifprefix, instance_id + 1);
}
-int tun_generate_ue_ifname(char *ifname, int instance_id, int pdu_session_id)
+int tuntap_generate_ue_ifname(char *ifname, int flag, int instance_id, int pdu_session_id)
{
+ DevAssert(flag == IFF_TUN || flag == IFF_TAP);
char pdu_session_string[10];
snprintf(pdu_session_string, sizeof(pdu_session_string), "p%d", pdu_session_id);
- return snprintf(ifname, IFNAMSIZ, "%s%d%s", "oaitun_ue", instance_id + 1, pdu_session_id == -1 ? "" : pdu_session_string);
+ const char *basename = flag == IFF_TUN ? "oaitun_ue" : "oaitap_ue";
+ return snprintf(ifname, IFNAMSIZ, "%s%d%s", basename, instance_id + 1, pdu_session_id == -1 ? "" : pdu_session_string);
}
-void tun_destroy(const char *dev)
+void tuntap_destroy(const char *dev)
{
// Use a new socket for ioctl operations
int fd = socket(AF_INET, SOCK_DGRAM, 0);
@@ -283,11 +311,12 @@ void tun_destroy(const char *dev)
return;
}
- bool success = change_interface_state(fd, dev, INTERFACE_DOWN);
+ // interface not up => down
+ short flags;
+ bool success = get_if_flags(fd, dev, &flags);
+ success = success && set_if_flags(fd, dev, flags & ~IFF_UP);
if (success) {
LOG_I(UTIL, "Interface %s is now down.\n", dev);
- } else {
- LOG_E(UTIL, "Could not bring interface %s down.\n", dev);
- }
+ } // no else: get_if_flags()/set_if_flags() should have printed error
close(fd);
}
diff --git a/common/utils/tun_if.h b/common/utils/tuntap_if.h
similarity index 73%
rename from common/utils/tun_if.h
rename to common/utils/tuntap_if.h
index 8e1463624f..152cc5064f 100644
--- a/common/utils/tun_if.h
+++ b/common/utils/tuntap_if.h
@@ -24,6 +24,7 @@
#include
#include
+#include
/*!
* \brief This function generates the name of the interface based on the prefix and
@@ -34,7 +35,17 @@
* \param[in] instance_id unique instance number
*/
int tun_generate_ifname(char *ifname, const char *ifprefix, int instance_id);
-int tun_generate_ue_ifname(char *ifname, int instance_id, int pdu_session_id);
+
+/*!
+ * \brief This function generates the name of the interface based on the prefix and
+ * the instance id for a UE.
+ *
+ * \param[in,out] ifname name of the interface
+ * \param[in] flag IFF_TUN (for TUN device) or IFF_TAP (for TAP device)
+ * \param[in] ifprefix prefix of the interface
+ * \param[in] instance_id unique instance number
+ */
+int tuntap_generate_ue_ifname(char *ifname, int flag, int instance_id, int pdu_session_id);
/*!
* \brief This function initializes the TUN interface
@@ -50,9 +61,8 @@ int tun_init(const char *ifname, int instance_id);
int tun_init_mbms(char *ifname);
/*!
- * \brief This function initializes the nasmesh interface using the basic values,
- * basic address, network mask and broadcast address, as the default configured
- * ones
+ * \brief Initializes the TUN interface with an IPv4 or IPv6 address and
+ * activates the interface.
* \param[in] ifname name of the interface
* \param[in] ipv4 IPv4 address of this interface as a string
* \param[in] ipv6 IPv6 address of this interface as a string
@@ -62,6 +72,15 @@ int tun_init_mbms(char *ifname);
*/
bool tun_config(const char* ifname, const char *ipv4, const char *ipv6);
+/*!
+ * \brief Initializes and activates the TAP interface.
+ * \param[in] ifname name of the interface
+ * \return true on success, otherwise false
+ * \note
+ * @ingroup _nas
+ */
+bool tap_config(const char* ifname);
+
/*!
* \brief Setup a IPv4 rule in table (interface_id - 1 + 10000) and route to
* force packets coming into interface back through it, and workaround
@@ -75,16 +94,17 @@ bool tun_config(const char* ifname, const char *ipv4, const char *ipv6);
void setup_ue_ipv4_route(const char* ifname, int instance_id, const char *ipv4);
/*!
- * \brief This function allocates a TUN interface
+ * \brief This function allocates a TUN or TAP interface
+ * \param[in] flag IFF_TUN (for TUN device) or IFF_TAP (for TAP device)
* \param[in] dev name of the interface
* \return file descriptor of the allocated interface
*/
-int tun_alloc(const char *dev);
+int tuntap_alloc(int flag, const char *dev);
/*!
- * \brief This function destroys the TUN interface
+ * \brief This function destroys the TUN or TAP interface
* \param[in] dev name of the interface
*/
-void tun_destroy(const char *dev);
+void tuntap_destroy(const char *dev);
#endif /*TUN_IF_H_*/
diff --git a/common/utils/utils.h b/common/utils/utils.h
index ede5cf7a84..fecf0eb3ad 100644
--- a/common/utils/utils.h
+++ b/common/utils/utils.h
@@ -50,8 +50,6 @@ extern "C" {
# define malloc16(x) memalign(32,x+32)
#endif
#define free16(y,x) free(y)
-#define bigmalloc malloc
-#define bigmalloc16 malloc16
#define openair_free(y,x) free((y))
#define PAGE_SIZE 4096
@@ -101,12 +99,9 @@ static inline void *malloc_or_fail(size_t size)
#endif
#define free16(y,x) free(y)
-#define bigmalloc malloc
-#define bigmalloc16 malloc16
#define openair_free(y,x) free((y))
#define PAGE_SIZE 4096
-#define PAGE_MASK 0xfffff000
#define virt_to_phys(x) (x)
// Converts an hexadecimal ASCII coded digit into its value. **
diff --git a/common/utils/websrv/DOC/websrvuse.md b/common/utils/websrv/DOC/websrvuse.md
index 5e3b4dac21..90b867b207 100644
--- a/common/utils/websrv/DOC/websrvuse.md
+++ b/common/utils/websrv/DOC/websrvuse.md
@@ -275,9 +275,9 @@ The web server back-end is using the [oai configuration module](Config/Rtusage).
## running the back-end
To trigger the back-end use the `--websrv` option, possibly modifying the parameters as explained in the [previous section](./websrvuse.md#web-server-parameters). The two following commands allow starting the oai gNB and the oai 5G UE on the same computer, starting the telnet server and the web interface on both executables.
-`./nr-softmodem -O /usr/local/oai/conf/gnb.band78.sa.fr1.106PRB.usrpb210.conf --rfsim --rfsimulator.serveraddr server --telnetsrv --telnetsrv.listenstdin --websrv --rfsimulator.options chanmod`
+`./nr-softmodem -O /usr/local/oai/conf/gnb.band78.sa.fr1.106PRB.usrpb210.conf --rfsim --rfsimulator.[0].serveraddr server --telnetsrv --telnetsrv.listenstdin --websrv --rfsimulator.[0].options chanmod`
-`./nr-uesoftmodem -O /usr/local/oai/conf/nrue_sim.conf --numerology 1 -r 106 -C 3649440000 --rfsim --rfsimulator.serveraddr 127.0.0.1 --websrv --telnetsrv --websrv.listenport 8092 --telnetsrv.listenport 8091`
+`./nr-uesoftmodem -O /usr/local/oai/conf/nrue_sim.conf --numerology 1 -r 106 -C 3649440000 --rfsim --rfsimulator.[0].serveraddr 127.0.0.1 --websrv --telnetsrv --websrv.listenport 8092 --telnetsrv.listenport 8091`
diff --git a/common/utils/websrv/websrv.h b/common/utils/websrv/websrv.h
index 610eff917e..944b6761e7 100644
--- a/common/utils/websrv/websrv.h
+++ b/common/utils/websrv/websrv.h
@@ -33,9 +33,7 @@
#ifndef WEBSRV_H
#define WEBSRV_H
-#define WEBSRV_MODNAME "websrv"
-#define WEBSRV_PORT 8090
/* websrv_params_t is an internal structure storing all the current parameters and */
/* global variables used by the web server */
diff --git a/common/utils/websrv/websrv_noforms.h b/common/utils/websrv/websrv_noforms.h
index c3d3af78d6..05c43f57c1 100644
--- a/common/utils/websrv/websrv_noforms.h
+++ b/common/utils/websrv/websrv_noforms.h
@@ -35,7 +35,6 @@
#define FL_VERSION 1
#define FL_REVISION 2
-#define FL_FIXLEVEL "3"
#define FL_INCLUDE_VERSION (FL_VERSION * 1000 + FL_REVISION)
#include
@@ -194,15 +193,10 @@ typedef enum {
FL_CLASS_END /* sentinel */
} FL_CLASS;
-#define FL_BEGIN_GROUP 10000
-#define FL_END_GROUP 20000
-#define FL_USER_CLASS_START 1001 /* min. user class value */
-#define FL_USER_CLASS_END 9999 /* max. user class value */
/* Maximum border width (in pixel) */
-#define FL_MAX_BW 10
/* How to display a form onto screen */
@@ -332,21 +326,11 @@ enum { FL_MBUTTON1 = 1, FL_MBUTTON2, FL_MBUTTON3, FL_MBUTTON4, FL_MBUTTON5 };
#define FL_SCROLLUP_MOUSE FL_MBUTTON4
#define FL_SCROLLDOWN_MOUSE FL_MBUTTON5
-#define FL_LEFTMOUSE FL_LEFT_MOUSE
-#define FL_MIDDLEMOUSE FL_MIDDLE_MOUSE
-#define FL_RIGHTMOUSE FL_RIGHT_MOUSE
-#define FL_SCROLLUPMOUSE FL_SCROLLUP_MOUSE
-#define FL_SCROLLDOWNMOUSE FL_SCROLLDOWN_MOUSE
/* control when to return input, slider and dial etc. object. */
-#define FL_RETURN_NONE 0U
-#define FL_RETURN_CHANGED 1U
#define FL_RETURN_END 2U
#define FL_RETURN_END_CHANGED 4U
-#define FL_RETURN_SELECTION 8U
-#define FL_RETURN_DESELECTION 16U
-#define FL_RETURN_TRIGGERED 1024U
#define FL_RETURN_ALWAYS (~FL_RETURN_END_CHANGED)
/* Some special color indices for FL private colormap. It does not matter
@@ -532,22 +516,13 @@ typedef enum {
} FL_PD_COL;
#define FL_BUILT_IN_COLS (FL_YELLOWGREEN + 1)
-#define FL_INACTIVE_COL FL_INACTIVE
/* Some aliases for a number of colors */
-#define FL_GRAY16 FL_RIGHT_BCOL
-#define FL_GRAY35 FL_BOTTOM_BCOL
-#define FL_GRAY80 FL_TOP_BCOL
-#define FL_GRAY90 FL_LEFT_BCOL
-#define FL_GRAY63 FL_COL1
-#define FL_GRAY75 FL_MCOL
#define FL_LCOL FL_BLACK
-#define FL_NoColor FL_NOCOLOR
/* An alias probably for an earlier typo */
-#define FL_DOGERBLUE FL_DODGERBLUE
/* Events that a form reacts to */
@@ -609,9 +584,7 @@ typedef enum {
#define FL_ALT_MASK (1L << 25) /* alt + Key --> FL_ALT_MASK + key */
#define FL_CONTROL_MASK (1L << 26)
#define FL_SHIFT_MASK (1L << 27)
-#define FL_ALT_VAL FL_ALT_MASK /* Don' use! */
-#define MAX_SHORTCUTS 8
/* Pop-up menu item attributes. NOTE if more than 8, need to change
* choice and menu class where mode is kept by a single byte */
@@ -619,8 +592,6 @@ typedef enum {
enum { FL_PUP_NONE, FL_PUP_GREY = 1, FL_PUP_BOX = 2, FL_PUP_CHECK = 4, FL_PUP_RADIO = 8 };
#define FL_PUP_GRAY FL_PUP_GREY
-#define FL_PUP_TOGGLE FL_PUP_BOX /* not used anymore */
-#define FL_PUP_INACTIVE FL_PUP_GREY
/* Popup and menu entries */
@@ -633,7 +604,6 @@ typedef struct {
int mode; /* FL_PUP_GRAY, FL_PUP_CHECK etc */
} FL_PUP_ENTRY;
-#define FL_MENU_ENTRY FL_PUP_ENTRY
/*******************************************************************
* FONTS
@@ -670,7 +640,6 @@ typedef enum {
FL_EMBOSSED_STYLE = (1 << 11)
} FL_TEXT_STYLE;
-#define FL_FONT_STYLE FL_TEXT_STYLE
#define special_style(a) ((a) >= FL_SHADOW_STYLE && (a) <= (FL_EMBOSSED_STYLE + FL_MAXFONTS))
@@ -683,26 +652,16 @@ typedef enum {
#define FL_LARGE_SIZE 18
#define FL_HUGE_SIZE 24
-#define FL_DEFAULT_SIZE FL_SMALL_SIZE
/* Defines for compatibility */
-#define FL_TINY_FONT FL_TINY_SIZE
#define FL_SMALL_FONT FL_SMALL_SIZE
-#define FL_NORMAL_FONT FL_NORMAL_SIZE
-#define FL_MEDIUM_FONT FL_MEDIUM_SIZE
-#define FL_LARGE_FONT FL_LARGE_SIZE
-#define FL_HUGE_FONT FL_HUGE_SIZE
-#define FL_NORMAL_FONT1 FL_SMALL_FONT
-#define FL_NORMAL_FONT2 FL_NORMAL_FONT
-#define FL_DEFAULT_FONT FL_SMALL_FONT
#define FL_BOUND_WIDTH (FL_Coord)1 /* Border width of boxes */
/* Definition of basic struct that holds an object */
-#define FL_CLICK_TIMEOUT 400 /* double click interval */
typedef struct FL_FORM_ FL_FORM;
typedef struct FL_OBJECT_ FL_OBJECT;
@@ -969,7 +928,6 @@ FL_EXPORT FL_OBJECT *fl_get_focus_object(FL_FORM *form)
FL_EXPORT void fl_reset_focus_object(FL_OBJECT *ob){};
-#define fl_set_object_focus fl_set_focus_object
FL_EXPORT FL_FORM_ATCLOSE fl_set_form_atclose(FL_FORM *form, FL_FORM_ATCLOSE fmclose, void *data){};
@@ -1014,7 +972,6 @@ FL_EXPORT void fl_set_app_nomainform(int flag){};
FL_EXPORT void fl_set_form_callback(FL_FORM *form, FL_FORMCALLBACKPTR callback, void *d){};
-#define fl_set_form_call_back fl_set_form_callback
FL_EXPORT void fl_set_form_size(FL_FORM *form, FL_Coord w, FL_Coord h){};
@@ -1036,7 +993,6 @@ FL_EXPORT unsigned long fl_get_form_event_cmask(FL_FORM *form){};
FL_EXPORT void fl_set_form_geometry(FL_FORM *form, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h){};
-#define fl_set_initial_placement fl_set_form_geometry
FL_EXPORT Window fl_show_form(FL_FORM *form, int place, int border, const char *name)
{
@@ -1088,7 +1044,6 @@ FL_EXPORT int fl_form_is_iconified(FL_FORM *form)
FL_EXPORT FL_RAW_CALLBACK fl_register_raw_callback(FL_FORM *form, unsigned long mask, FL_RAW_CALLBACK rcb){};
-#define fl_register_call_back fl_register_raw_callback
FL_EXPORT FL_OBJECT *fl_bgn_group(void)
{
@@ -1204,7 +1159,6 @@ FL_EXPORT FL_OBJECT *fl_get_object_component(FL_OBJECT *composite, int objclass,
FL_EXPORT void fl_for_all_objects(FL_FORM *form, int (*cb)(FL_OBJECT *, void *), void *v){};
-#define fl_draw_object_outside_label fl_draw_object_label_outside
FL_EXPORT void fl_set_object_dblclick(FL_OBJECT *obj, unsigned long timeout){};
@@ -1218,7 +1172,6 @@ FL_EXPORT void fl_set_object_geometry(FL_OBJECT *obj, FL_Coord x, FL_Coord y, FL
FL_EXPORT void fl_move_object(FL_OBJECT *obj, FL_Coord dx, FL_Coord dy){};
#define fl_set_object_lcolor fl_set_object_lcol
-#define fl_get_object_lcolor fl_get_object_lcol
FL_EXPORT void fl_fit_object_label(FL_OBJECT *obj, FL_Coord xmargin, FL_Coord ymargin){};
@@ -1233,7 +1186,6 @@ FL_EXPORT void fl_get_object_bbox(FL_OBJECT *obj, FL_Coord *x, FL_Coord *y, FL_C
*x = *y = *w = *h = 0;
};
-#define fl_compute_object_geometry fl_get_object_bbox
FL_EXPORT void fl_call_object_callback(FL_OBJECT *ob){};
@@ -1243,8 +1195,6 @@ FL_EXPORT FL_HANDLEPTR fl_set_object_posthandler(FL_OBJECT *ob, FL_HANDLEPTR pos
FL_EXPORT FL_CALLBACKPTR fl_set_object_callback(FL_OBJECT *obj, FL_CALLBACKPTR callback, long argument){};
-#define fl_set_object_align fl_set_object_lalign
-#define fl_set_call_back fl_set_object_callback
FL_EXPORT void fl_redraw_object(FL_OBJECT *obj){};
@@ -1320,7 +1270,6 @@ FL_EXPORT int fl_get_string_widthTAB(int style, int size, const char *s, int len
FL_EXPORT void fl_get_string_dimension(int fntstyle, int fntsize, const char *s, int len, int *width, int *height){};
-#define fl_get_string_size fl_get_string_dimension
FL_EXPORT void fl_get_align_xy(int align, int x, int y, int w, int h, int xsize, int ysize, int xoff, int yoff, int *xx, int *yy){};
@@ -1364,7 +1313,6 @@ FL_EXPORT long fl_mapcolorname(FL_COLOR col, const char *name)
return 0;
};
-#define fl_mapcolor_name fl_mapcolorname
FL_EXPORT void fl_free_colors(FL_COLOR *c, int n){};
@@ -1382,7 +1330,6 @@ FL_EXPORT unsigned long fl_get_pixel(FL_COLOR col)
return 0;
};
-#define fl_get_flcolor fl_get_pixel
FL_EXPORT void fl_get_icm_color(FL_COLOR col, int *r, int *g, int *b){};
@@ -1489,7 +1436,6 @@ FL_EXPORT char **fl_get_cmdline_args(int *ia)
#define fl_set_error_logfp fl_set_err_logfp
-#define fl_mousebutton fl_mouse_button
/* These give more flexibility for future changes. Also application
* can re-assign these pointers to whatever function it wants, e.g.,
@@ -1510,7 +1456,6 @@ FL_EXPORT int fl_msleep(unsigned long msec)
return 0;
};
-#define FL_MAX_MENU_CHOICE_ITEMS 128
typedef const char *(*FL_VAL_FILTER)(FL_OBJECT *, double, int);
@@ -1535,7 +1480,6 @@ FL_EXPORT int fl_is_same_object(FL_OBJECT *obj1, FL_OBJECT *obj2)
enum { FL_XOR = 0, FL_COPY = 1, FL_AND = 2 };
-#define FL_MINDEPTH 1
/* FL_xxx does not do anything anymore, but kept for compatibility */
@@ -1554,7 +1498,6 @@ enum { FL_North = 0, FL_NorthEast, FL_NorthWest, FL_South, FL_SouthEast, FL_Sout
#ifndef GreyScale
#define GreyScale GrayScale
-#define StaticGrey StaticGray
#endif
#define FL_is_gray(v) ((v) == GrayScale || (v) == StaticGray)
@@ -1589,7 +1532,6 @@ typedef struct {
unsigned int bshift, bmask, bbits;
} FL_State;
-#define FL_STATE FL_State /* for compatibility */
/***** Global variables ******/
@@ -1689,7 +1631,6 @@ FL_EXPORT void fl_point(FL_Coord x, FL_Coord y, FL_COLOR c){};
FL_EXPORT void fl_points(FL_POINT *p, int np, FL_COLOR c){};
-#define fl_simple_line fl_line
FL_EXPORT void fl_dashedlinestyle(const char *dash, int ndash){};
@@ -1722,9 +1663,6 @@ FL_EXPORT int fl_get_drawmode(void)
return 0;
};
-#define fl_set_linewidth fl_linewidth
-#define fl_set_linestyle fl_linestyle
-#define fl_set_drawmode fl_drawmode
/*
* Interfaces
@@ -1733,7 +1671,6 @@ FL_EXPORT int fl_get_drawmode(void)
FL_EXPORT XFontStruct *fl_get_fontstruct(int style, int size){};
#define fl_get_font_struct fl_get_fontstruct
-#define fl_get_fntstruct fl_get_font_struct
FL_EXPORT Window fl_get_mouse(FL_Coord *x, FL_Coord *y, unsigned int *keymask)
{
@@ -1839,9 +1776,6 @@ FL_EXPORT void fl_winicontitle_f(Window win, const char *fmt, ...){};
FL_EXPORT void fl_winposition(FL_Coord x, FL_Coord y){};
#define fl_pref_winposition fl_winposition
-#define fl_win_background fl_winbackground
-#define fl_winstepunit fl_winstepsize
-#define fl_set_winstepunit fl_winstepsize
FL_EXPORT void fl_winminsize(Window win, FL_Coord w, FL_Coord h){};
@@ -1855,7 +1789,6 @@ FL_EXPORT void fl_winsize(FL_Coord w, FL_Coord h){};
FL_EXPORT void fl_initial_winsize(FL_Coord w, FL_Coord h){};
-#define fl_pref_winsize fl_winsize
FL_EXPORT void fl_initial_winstate(int state){};
@@ -1863,7 +1796,6 @@ FL_EXPORT Colormap fl_create_colormap(XVisualInfo *xv, int nfill){};
FL_EXPORT void fl_wingeometry(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h){};
-#define fl_pref_wingeometry fl_wingeometry
FL_EXPORT void fl_initial_wingeometry(FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h){};
@@ -1879,10 +1811,6 @@ FL_EXPORT void fl_get_wingeometry(Window win, FL_Coord *x, FL_Coord *y, FL_Coord
/* For compatibility */
-#define fl_get_win_size fl_get_winsize
-#define fl_get_win_origin fl_get_winorigin
-#define fl_get_win_geometry fl_get_wingeometry
-#define fl_initial_winposition fl_pref_winposition
#define fl_get_display() fl_display
#define FL_FormDisplay(form) fl_display
@@ -1895,7 +1823,6 @@ FL_EXPORT void fl_get_wingeometry(Window win, FL_Coord *x, FL_Coord *y, FL_Coord
FL_EXPORT Window fl_get_real_object_window(FL_OBJECT *ob){};
-#define FL_OBJECT_WID FL_ObjWin
/* All registerable events, including Client Message */
@@ -1941,7 +1868,6 @@ FL_EXPORT long fl_remove_selected_xevent(Window win, long mask)
return 0;
};
-#define fl_add_selected_xevent fl_addto_selected_xevent
FL_EXPORT void fl_set_idle_delta(long delta){};
@@ -1960,7 +1886,6 @@ FL_EXPORT void fl_XFlush(void){};
#define controlkey_down(mask) ((mask)&ControlMask)
#define button_down(mask) (((mask)&Button1Mask) || ((mask)&Button2Mask) || ((mask)&Button3Mask) || ((mask)&Button4Mask) || ((mask)&Button5Mask))
-#define fl_keypressed fl_keysym_pressed
/****************** Resources ***************/
@@ -1975,7 +1900,6 @@ typedef struct {
int nbytes; /* used only for strings */
} FL_RESOURCE;
-#define FL_resource FL_RESOURCE
#define FL_CMD_OPT XrmOptionDescRec
@@ -2002,9 +1926,6 @@ FL_EXPORT int fl_keysym_pressed(KeySym k)
return 0;
};
-#define buttonLabelSize buttonFontSize
-#define sliderLabelSize sliderFontSize
-#define inputLabelSize inputFontSize
/* All Form control variables. Named closely as its resource name */
@@ -2035,9 +1956,6 @@ typedef struct {
char vname[24];
} FL_IOPT;
-#define FL_PDButtonLabelSize FL_PDButtonFontSize
-#define FL_PDSliderLabelSize FL_PDSliderFontSize
-#define FL_PDInputLabelSize FL_PDInputFontSize
/* Program default masks */
@@ -2068,7 +1986,6 @@ enum {
FL_PDLabelFontSize = (1 << 24)
};
-#define FL_PDButtonLabel FL_PDButtonLabelSize
FL_EXPORT void fl_set_defaults(unsigned long mask, FL_IOPT *cntl){};
@@ -2133,11 +2050,8 @@ typedef unsigned int FL_PACKED4;
#define FL_RMASK 0x000000ff
#define FL_RSHIFT 0
-#define FL_GMASK 0x0000ff00
#define FL_GSHIFT 8
-#define FL_BMASK 0x00ff0000
#define FL_BSHIFT 16
-#define FL_AMASK 0xff000000
#define FL_ASHIFT 24
/* If PCBITS is not 8, we need to apply the RGBmask */
@@ -2225,8 +2139,6 @@ typedef int (*FL_MODIFY_CANVAS_PROP)(FL_OBJECT *);
/******************** Default *********************/
-#define FL_CANVAS_BOXTYPE FL_DOWN_BOX /* really the decoration frame */
-#define FL_CANVAS_ALIGN FL_ALIGN_TOP
/************ Interfaces ************************/
@@ -2244,7 +2156,6 @@ FL_EXPORT FL_OBJECT *fl_create_canvas(int type, FL_Coord x, FL_Coord y, FL_Coord
/* backward compatibility */
-#define fl_set_canvas_decoration fl_set_object_boxtype
FL_EXPORT void fl_set_canvas_colormap(FL_OBJECT *ob, Colormap colormap){};
@@ -2306,10 +2217,6 @@ FL_EXPORT void fl_canvas_yield_to_shortcut(FL_OBJECT *ob, int yes){};
enum { FL_NORMAL_TEXT };
-#define FL_TEXT_BOXTYPE FL_FLAT_BOX
-#define FL_TEXT_COL1 FL_COL1
-#define FL_TEXT_COL2 FL_MCOL
-#define FL_TEXT_LCOL FL_LCOL
#define FL_TEXT_ALIGN (FL_ALIGN_LEFT | FL_ALIGN_INSIDE)
FL_EXPORT FL_OBJECT *fl_create_text(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label)
@@ -2356,10 +2263,6 @@ enum { FL_GRID_NONE = 0, FL_GRID_MAJOR = 1, FL_GRID_MINOR = 2 };
/***** Defaults *****/
-#define FL_XYPLOT_BOXTYPE FL_FLAT_BOX
-#define FL_XYPLOT_COL1 FL_COL1
-#define FL_XYPLOT_LCOL FL_LCOL
-#define FL_XYPLOT_ALIGN FL_ALIGN_BOTTOM
#define FL_MAX_XYPLOTOVERLAY 32
/***** Others *****/
@@ -2382,7 +2285,6 @@ FL_EXPORT int fl_set_xyplot_file(FL_OBJECT *ob, const char *f, const char *title
FL_EXPORT void fl_insert_xyplot_data(FL_OBJECT *ob, int id, int n, double x, double y){};
-#define fl_set_xyplot_datafile fl_set_xyplot_file
FL_EXPORT void fl_add_xyplot_text(FL_OBJECT *ob, double x, double y, const char *text, int al, FL_COLOR col){};
diff --git a/doc/Aerial_FAPI_Split_Tutorial.md b/doc/Aerial_FAPI_Split_Tutorial.md
index 58380ba611..24a085c8e4 100644
--- a/doc/Aerial_FAPI_Split_Tutorial.md
+++ b/doc/Aerial_FAPI_Split_Tutorial.md
@@ -1,4 +1,4 @@
-# OAI 7.2 Fronthaul Interface 5G SA Tutorial
+# OAI - Aerial FAPI Split Tutorial
**Table of Contents**
@@ -14,9 +14,12 @@ The hardware on which we have tried this tutorial:
| Dell PowerEdge R750 (Dual Intel Xeon Gold 6336Y CPU @ 2.4G, 24C/48T (185W), 512GB RDIMM, 3200MT/s) |Ubuntu 22.04.3 LTS (5.15.0-72-lowlatency)| NVIDIA Converged Accelerator A100X (24.39.2048) |
| Supermicro Grace Hopper MGX ARS-111GL-NHR (Neoverse-V2, 3.4GHz, 72C/72T, 576GB LPDDR5) | Ubuntu 22.04.5 LTS (6.5.0-1019-nvidia-64k) |NVIDIA BlueField3 (32.41.1000)|
-**NOTE**:
-- These are not minimum hardware requirements. This is the configuration of our servers. The NIC card should support hardware PTP time stamping.
-- Starting from tag [2025.w13](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/2025.w13?ref_type=tags) of OAI, we are only testing with the Grace Hopper server.
+**Note**:
+- These are not minimum hardware requirements. This is the configuration of our
+ servers. The NIC card should support hardware PTP time stamping.
+- Starting from tag
+ [2025.w13](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/2025.w13?ref_type=tags)
+ of OAI, we are only testing with the Grace Hopper server.
PTP enabled switches and grandmaster clock we have tested with:
@@ -54,10 +57,10 @@ The UEs that have been tested and confirmed working with Aerial are the followin
To set up the L1 and install the components manually refer to this [instructions page](https://docs.nvidia.com/aerial/cuda-accelerated-ran/index.html).
**Note**:
-- As of wk36, the L1 must be compiled with the following CMake flag: `-DSCF_FAPI_10_04_SRS=ON` , this is due to the usage
-of the FAPI 10.04 version of the SRS PDU, and RX_Beamforming PDU.
-- To configure the Gigabyte server please refer to these [instructions](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/2025.w13/doc/Aerial_FAPI_Split_Tutorial.md)
-- The last release to support the Gigabyte server is **Aerial CUDA-Accelerated RAN 24-1**.
+- To configure the Gigabyte server please refer to these
+ [instructions](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/2025.w13/doc/Aerial_FAPI_Split_Tutorial.md)
+- The last release to support the Gigabyte server is **Aerial CUDA-Accelerated
+ RAN 24-1**.
#### CPU allocation
@@ -67,21 +70,43 @@ of the FAPI 10.04 version of the SRS PDU, and RX_Beamforming PDU.
**Grace Hopper MGX ARS-111GL-NHR**
-| Applicative Threads | Allocated CPUs |
-|------------------------|----------------|
-| PTP & PHC2SYS Services | 41 |
-| OAI `nr-softmodem` | 13-16 |
+| Applicative Threads | Allocated CPUs |
+|--------------------------------------|--------------------------------|
+| `workers_ul` | 4, 5 |
+| `workers_dl` | 6, 7, 8 |
+| `timer_thread_config` | 9 |
+| `message_thread_config` | 9 |
+| `pcap_shm_caching_cpu_core` | 10 |
+| `pcap_file_saving_cpu_core` | 10 |
+| `dpdk_thread` | 10 |
+| `ul_pcap_capture_thread_cpu_affinity`| 10 |
+| `pcap_logger_thread_cpu_affinity` | 10 |
+| `h2d_copy_thread_cpu_affinity` | 11 |
+| `fh_stats_dump_cpu_core` | -1 |
+| `pdump_client_thread` | -1 |
+| `debug_worker` | -1 |
+| `prometheus_thread` | -1 |
+| | |
+| OAI `nr-softmodem` | 13,14,15,16 |
-### PTP configuration
+**Note**:
+- `-1` indicates that no explicit CPU pinning is applied and the thread
+is scheduled by the Linux kernel.
+- core 10 is a `low_priority_core` and it is shared by all low-priority threads.
-1. You need to install the `linuxptp` debian package. It will install both ptp4l and phc2sys.
+#### PTP configuration
+
+1. Install the `linuxptp` debian package. It will install both
+ ptp4l and phc2sys.
```bash
#Ubuntu
sudo apt install linuxptp -y
```
-Once installed you can use this configuration file for ptp4l (`/etc/ptp4l.conf`). Here the clock domain is 24 so you can adjust it according to your PTP GM clock domain
+Once installed you can use this configuration file for ptp4l
+(`/etc/ptp4l.conf`). Here the clock domain is 24 so you can adjust it according
+to your PTP GM clock domain
```
[global]
@@ -94,25 +119,27 @@ tx_timestamp_timeout 30
network_transport L2
```
+The service of ptp4l (`/lib/systemd/system/ptp4l.service`) should be configured
+as below:
-The service of ptp4l (`/lib/systemd/system/ptp4l.service`) should be configured as below:
```
-[Unit]
-Description=Precision Time Protocol (PTP) service
+[Unit] Description=Precision Time Protocol (PTP) service
Documentation=man:ptp4l
[Service]
Restart=always
RestartSec=5s
Type=simple
-ExecStart=taskset -c 41 /usr/sbin/ptp4l -f /etc/ptp.conf
+ExecStart=/usr/sbin/ptp4l -f /etc/ptp.conf
[Install]
WantedBy=multi-user.target
```
-and service of phc2sys (`/lib/systemd/system/phc2sys.service`) should be configured as below:
+and service of phc2sys (`/lib/systemd/system/phc2sys.service`) should be
+configured as below:
+
```
[Unit]
Description=Synchronize system clock or PTP hardware clock (PHC)
@@ -131,10 +158,25 @@ ExecStart=/usr/sbin/phc2sys -a -r -n 24
WantedBy=multi-user.target
```
+**Note**: As of release 25-3 there's no need to allocate a core for PTP.
+
+## Prepare the L1
+
+- Follow these
+ [instructions](https://github.com/NVIDIA/aerial-cuda-accelerated-ran) to
+ clone the `aerial-cuda-accelerated-ran` repository, pull and build the cuBB
+ image.
+- The CMake flags we use to compile the L1 are:
+ - `-DSCF_FAPI_10_04_SRS=ON` this flag must be used as of OAI tag `2025.w36`
+ and this is due to the usage of the FAPI 10.04 version of the SRS PDU, and
+ RX_Beamforming PDU.
+ - `-DENABLE_CONFORMANCE_TM_PDSCH_PDCCH=OFF` this option should only be
+ enabled when doing conformance testing with testmac.
## Build OAI gNB
If it's not already cloned, the first step is to clone OAI repository
+
```bash
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git ~/openairinterface5g
cd ~/openairinterface5g/
@@ -142,65 +184,42 @@ cd ~/openairinterface5g/
### Get nvIPC sources from the L1 container
-The library used for communication between L1 and L2 components is called nvIPC, and is developed by NVIDIA. It is not open-source and can't be freely distributed.
-In order to achieve this communication, we need to obtain the nvIPC source files from the L1 container (cuBB) and place it in the gNB project directory `~/openairinterface5g`.
-This allows us to build and install this library when building the L2 docker container.
-
-Check whether your L1 container is running:
-```bash
-~$ docker container ls -a
-CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-a9681a0c4a10 14dca2002237 "/opt/nvidia/nvidia_…" 3 months ago Exited (137) 10 days ago cuBB
-
-```
-If it is not running, you may start it and logging into the container by running the following:
-```bash
-~$ docker start cuBB
-cuBB
-~$ docker exec -it cuBB bash
-aerial@c_aerial_aerial:/opt/nvidia/cuBB#
-```
-
-After logging into the container, you need to pack the nvIPC sources and copy them to the host ( the command creates a `tar.gz` file with the following name format: `nvipc_src.YYYY.MM.DD.tar.gz`)
-```bash
-~$ docker exec -it cuBB bash
-aerial@c_aerial_aerial:/opt/nvidia/cuBB# cd cuPHY-CP/gt_common_libs
-aerial@c_aerial_aerial:/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs#./pack_nvipc.sh
-nvipc_src.YYYY.MM.DD/
-...
----------------------------------------------
-Pack nvipc source code finished:
-/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs/nvipc_src.YYYY.MM.DD.tar.gz
-aerial@c_aerial_aerial:/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs# sudo cp nvipc_src.yyyy.mm.dd.tar.gz /opt/cuBB/share/
-aerial@c_aerial_aerial:/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs# exit
-```
-
-The file should now be present in the `~/openairinterface5g/ci-scripts/yaml_files/sa_gnb_aerial/` directory, from where it is moved into `~/openairinterface5g`
-```bash
-~$ mv ~/openairinterface5g/ci-scripts/yaml_files/sa_gnb_aerial/nvipc_src.YYYY.MM.DD.tar.gz ~/openairinterface5g/
-```
-
-Alternatively, after running `./pack_nvipc.sh` , you can exit the container and copy `nvipc_src.YYYY.MM.DD.tar.gz` using `docker cp`
+The library used for communication between L1 and L2 components is called
+nvIPC, and is developed by NVIDIA. In order to achieve this communication, we
+need to obtain the nvIPC source files from the L1 container (cuBB) and place it
+in the gNB project directory `~/openairinterface5g`. This allows us to build
+and install this library when building the L2 docker image.
```bash
-~$ docker exec -it cuBB bash
-aerial@c_aerial_aerial:/opt/nvidia/cuBB# cd cuPHY-CP/gt_common_libs
-aerial@c_aerial_aerial:/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs#./pack_nvipc.sh
-nvipc_src.YYYY.MM.DD/
-...
----------------------------------------------
-Pack nvipc source code finished:
-/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs/nvipc_src.YYYY.MM.DD.tar.gz
-aerial@c_aerial_aerial:/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs# exit
-~$ docker cp nv-cubb:/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs/nvipc_src.YYYY.MM.DD.tar.gz ~/openairinterface5g
+# Start interactive development container
+./cuPHY-CP/container/run_aerial.sh
+
+# Pack the nvIPC sources and copy them to the host ( the command creates a `tar.gz` file with the following name format: `nvipc_src.YYYY.MM.DD.tar.gz`)
+aerial@c_aerial_oaicicd:/opt/nvidia/cuBB# cd cuPHY-CP/gt_common_libs
+aerial@c_aerial_oaicicd:/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs#./pack_nvipc.sh
+nvipc_src.YYYY.MM.DD/ ... --------------------------------------------- Pack
+nvipc source code finished:/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs/nvipc_src.YYYY.MM.DD.tar.gz
```
-*Important note:* For using docker cp, make sure to copy the entire name of the created nvipc_src tar.gz file.
+
+Keep the interactive development container open and in another terminal use
+`docker cp` to copy the library
+
+```bash
+docker cp c_aerial_oaicicd:/opt/nvidia/cuBB/cuPHY-CP/gt_common_libs/nvipc_src.YYYY.MM.DD.tar.gz ~/openairinterface/
+```
+*Important note:* For using docker cp, make sure to
+copy the entire name of the created nvipc_src tar.gz file.
+
+You can now exit the interactive development container.
+
+With the nvIPC sources in the project directory, the L2 docker image can be built.
-With the nvIPC sources in the project directory, the docker image can be built.
### Building OAI gNB docker image
-In order to build the target image (`oai-gnb-aerial`), first you should build a common shared image (`ran-base`)
+In order to build the target image (`oai-gnb-aerial`), first you should build a
+common shared image (`ran-base`)
+
```bash
~$ cd ~/openairinterface5g/
~/openairinterface5g$ docker build . -f docker/Dockerfile.base.ubuntu --tag ran-base:latest
@@ -210,52 +229,113 @@ In order to build the target image (`oai-gnb-aerial`), first you should build a
## Running the setup
-In order to use Docker Compose to automatically start and stop the setup, we first need to create a pre-built image of L1 after compiling the L1 software and making the necessary adjustments to its configuration files.
-The process of preparing L1 is covered in NVIDIA's documentation and falls outside the scope of this document.
-
-### Prepare the L1 image
-After preparing the L1 software, the container needs to be committed to create an image where L1 is ready for execution, which can later be referenced by a `docker-compose.yaml` file.
-
-*Note:* The default L1 configuration file is `cuphycontroller_P5G_FXN_GH.yaml`, located in `/opt/nvidia/cuBB/cuPHY-CP/cuphycontroller/config/`.
-In this file the RU MAC address needs to be specified before commiting the image.
-
-```bash
-~$ docker commit nv-cubb cubb-build:25-2.1
-~$ docker image ls
-..
-cubb-build 25-2.1 824156e0334c 2 weeks ago 23.9GB
--..
-```
-
### Adapt the OAI-gNB configuration file to your system/workspace
-Edit the sample OAI gNB configuration file and check following parameters:
+Edit the [OAI gNB configuration file](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/ci-scripts/conf_files/gnb-vnf.sa.band78.273prb.aerial.conf?ref_type=heads)
+and check the following parameters:
* `gNBs` section
* The PLMN section shall match the one defined in the AMF
+ * To calculate the `absoluteFrequencySSB` and `dl_absoluteFrequencyPointA`,
+ please follow these
+ [instructions](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/gNB_frequency_setup.md)
* `amf_ip_address` shall be the correct AMF IP address in your system
* `GNB_IPV4_ADDRESS_FOR_NG_AMF` shall match your DU N2 interface IP address
* `GNB_IPV4_ADDRESS_FOR_NGU` shall match your DU N3 interface IP address
-The default amf_ip_address:ipv4 value is 192.168.70.132, when installing the CN5G following [this tutorial](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_OAI_CN5G.md)
-Both 'GNB_IPV4_ADDRESS_FOR_NG_AMF' and 'GNB_IPV4_ADDRESS_FOR_NGU' need to be set to the IP address of the NIC referenced previously.
+The default amf_ip_address:ipv4 value is 192.168.70.132, when installing the
+CN5G following [this
+tutorial](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_OAI_CN5G.md)
+Both `GNB_IPV4_ADDRESS_FOR_NG_AMF` and `GNB_IPV4_ADDRESS_FOR_NGU` need to be
+set to the IP address of the NIC referenced previously.
+**Note**: If the Core Network is running on the same server, 3 cores should be
+allocated to it. 2 for the UPF and 1 for the all the remaining services as shown
+below.
-### Running docker compose
-#### Aerial L1 entrypoint script
-The `aerial_l1_entrypoint` script is used by the L1 container to start the L1 software and is called in the Docker Compose file.
-It begins by setting up environment variables, restarting NVIDIA MPS, and finally running `cuphycontroller_scf`.
+```patch
+diff --git a/docker-compose/docker-compose-basic-nrf.yaml b/docker-compose/docker-compose-basic-nrf.yaml
+index 7fbefc9..d5ef964 100644
+--- a/docker-compose/docker-compose-basic-nrf.yaml
++++ b/docker-compose/docker-compose-basic-nrf.yaml
+@@ -28,6 +28,7 @@ services:
+ - 8080/tcp
+ volumes:
+ - ./conf/basic_nrf_config.yaml:/openair-udr/etc/config.yaml
++ cpuset: "15"
+ environment:
+ - TZ=Europe/Paris
+ depends_on:
+```
-The L1 software is executed with an argument that specifies which configuration file to use. If not modified, the default argument is set to `P5G_FXN_GH`.
+### Aerial L1 entrypoint script
-After building the gNB image, and preparing the configuration file, the setup can be run with the following command:
+The `aerial_l1_entrypoint` script is used by the L1 container to start the L1
+software and is mounted in the Docker Compose file. It begins by setting up
+environment variables, restarting NVIDIA MPS, and finally running
+`cuphycontroller_scf`.
+
+The L1 software is executed with an argument that specifies which configuration
+file to use. If not modified, the default argument is set to `P5G_WNC_GH`.
+
+### Aerial L1 configuration
+
+```bash
+cd ~/aerial-cuda-accelerated-ran/cuPHY-CP/cuphycontroller/config/
+```
+
+Choose the configuration file that matches your setup and make the necessary
+changes. We currently use `cuphycontroller_P5G_WNC_GH.yaml`.
+
+Make sure that the following parameters are modified:
+
+```
+dst_mac_addr:
+nic:
+vlan:
+```
+
+### Docker compose
+
+We recommend the user to apply the patch below for `docker-compose.yaml`.
+```patch
+diff --git a/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml b/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml
+index 985fe9a6a3..0774d826ac 100644
+--- a/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml
++++ b/ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml
+@@ -15,10 +15,10 @@ services:
+ stdin_open: true
+ tty: true
+ volumes:
++ - ~/aerial-cuda-accelerated-ran:/opt/nvidia/cuBB/
+ - /lib/modules:/lib/modules
+ - /dev/hugepages:/dev/hugepages
+ - /usr/src:/usr/src
+- - ./cuphycontroller_P5G_WNC_GH.yaml:/opt/nvidia/cuBB/cuPHY-CP/cuphycontroller/config/cuphycontroller_P5G_WNC_GH.yaml
+ - ./aerial_l1_entrypoint.sh:/opt/nvidia/cuBB/aerial_l1_entrypoint.sh
+ - /var/log/aerial:/var/log/aerial
+ - ../../../cmake_targets/share:/opt/cuBB/share
+```
+
+By applying this change, it would easier for the user to modify the L1 code or
+configuration files directly from the `aerial-cuda-accelerated-ran` repository.
+
+`ci-scripts/yaml_files/sa_gnb_aerial/docker-compose.yaml` is tailored for our
+CI.
+We copy the `aerial-cuda-accelerated-ran` repository inside the cuBB
+docker image using `docker cp` and commit the changes using `docker commit`.
+We mount the `cuphycontroller_P5G_WNC_GH.yaml` in the `nv-cubb` volumes so
+that it would override some parameters depending on the setup being run on CI.
+
+After building the gNB image, and preparing the configuration file, the setup
+can be run with the following command:
```bash
cd ci-scripts/yaml_files/sa_gnb_aerial/
docker compose up -d
-
```
-This will start both containers, beginning with `nv-cubb`, and `oai-gnb-aerial` will start only after it is ready.
+This will start both containers, beginning with `nv-cubb`, and
+`oai-gnb-aerial` will start only after it is ready.
The logs can be followed using these commands:
@@ -263,8 +343,13 @@ The logs can be followed using these commands:
docker logs -f oai-gnb-aerial
docker logs -f nv-cubb
```
+
#### Running with multiple L2s
-One L1 instance can support multiple L2 instances. See also the [aerial documentation](https://developer.nvidia.com/docs/gputelecom/aerial-sdk/text/cubb_quickstart/running_cubb-end-to-end.html#run-multiple-l2-instances-with-single-l1-instance) for more details.
+
+One L1 instance can support multiple L2 instances. See also
+the [aerial
+documentation](https://docs.nvidia.com/aerial/cuda-accelerated-ran/latest/quickstart_guide/running_cubb-end-to-end.html#run-multiple-l2-instances-with-single-l1-instance)
+for more details.
In OAI the shared memory prefix must be configured in the configuration file.
@@ -274,11 +359,12 @@ In OAI the shared memory prefix must be configured in the configuration file.
```
-### Stopping the setup
+#### Stopping the setup
+
+Run the following command to stop and remove both containers, leaving the
+system ready to be restarted later:
-Run the following command to stop and remove both containers, leaving the system ready to be restarted later:
```bash
cd ci-scripts/yaml_files/sa_gnb_aerial/
docker compose down
-
```
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 39c7983e72..961ab2fcf9 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -866,8 +866,8 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../common/config/config_cmdline.c \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/time_meas.c \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/time_meas.h \
-@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/tun_if.h \
-@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/tun_if.c \
+@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/tuntap_if.h \
+@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/tuntap_if.c \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/utils.c \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/oai_asn1.h \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/system.h \
@@ -1892,7 +1892,6 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/RRC/LTE/rrc_eNB_S1AP.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/ENB_APP/enb_paramdef_emtc.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/ENB_APP/enb_config.c \
-@CMAKE_CURRENT_SOURCE_DIR@/../openair2/ENB_APP/enb_paramdef_mme.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/ENB_APP/enb_paramdef_mce.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/ENB_APP/L1_paramdef.h \
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/ENB_APP/enb_app.h \
diff --git a/doc/E1AP/E1-design.md b/doc/E1AP/E1-design.md
index d9a7131393..c9465e696a 100644
--- a/doc/E1AP/E1-design.md
+++ b/doc/E1AP/E1-design.md
@@ -162,7 +162,7 @@ You need to use `--rfsim` if you are running the test with rfsimulator.
OAI UE:
```
-sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --rfsimulator.serveraddr 127.0.0.1
+sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --rfsimulator.[0].serveraddr 127.0.0.1
```
## 3. Configuration file IP addresses of network functions
diff --git a/doc/LDPC_XDMA_offload_setup.md b/doc/LDPC_XDMA_offload_setup.md
index e32a414f88..c06c2eef5d 100644
--- a/doc/LDPC_XDMA_offload_setup.md
+++ b/doc/LDPC_XDMA_offload_setup.md
@@ -149,13 +149,13 @@ Example command using rfsim:
```bash
cd ~/openairinterface5g/cmake_targets/ran_build/build
-sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.serveraddr 10.201.1.100 --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
+sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.[0].serveraddr 10.201.1.100 --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
```
or
```bash
-sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.serveraddr 10.201.1.100
+sudo ./nr-uesoftmodem --rfsim -r 106 --numerology 1 --band 78 -C 3319680000 --ue-nb-ant-tx 1 --ue-nb-ant-rx 1 -O ../../../ci-scripts/conf_files/nrue1.uicc.cluCN.conf --rfsimulator.[0].serveraddr 10.201.1.100
```
if you have added the configuration to the `.conf` file.
diff --git a/doc/NR_SA_Tutorial_OAI_multi_UE.md b/doc/NR_SA_Tutorial_OAI_multi_UE.md
index b8dd003e98..435d544606 100644
--- a/doc/NR_SA_Tutorial_OAI_multi_UE.md
+++ b/doc/NR_SA_Tutorial_OAI_multi_UE.md
@@ -39,7 +39,7 @@ Important notes:
2. After entering the bash environment, run the following command to deploy your first UE
```bash
- sudo ./nr-uesoftmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.options chanmod --rfsimulator.serveraddr 10.201.1.100 --telnetsrv --telnetsrv.listenport 9095
+ sudo ./nr-uesoftmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.[0].options chanmod --rfsimulator.[0].serveraddr 10.201.1.100 --telnetsrv --telnetsrv.listenport 9095
```
3. For the second UE, create the namespace ue2 (`-c2`), then execute shell inside (`-o2`, "open"):
@@ -52,7 +52,7 @@ Important notes:
4. After entering the bash environment, run the following command to deploy your second UE:
```bash
- sudo ./nr-uesoftmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000002 --rfsimulator.options chanmod --rfsimulator.serveraddr 10.202.1.100 --telnetsrv --telnetsrv.listenport 9096
+ sudo ./nr-uesoftmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000002 --rfsimulator.[0].options chanmod --rfsimulator.[0].serveraddr 10.202.1.100 --telnetsrv --telnetsrv.listenport 9096
```
in the command above, please note that the IMSI and the telnet port changed.
diff --git a/doc/NR_SA_Tutorial_OAI_nrUE.md b/doc/NR_SA_Tutorial_OAI_nrUE.md
index 3a6a949505..4b0d8be96d 100644
--- a/doc/NR_SA_Tutorial_OAI_nrUE.md
+++ b/doc/NR_SA_Tutorial_OAI_nrUE.md
@@ -173,8 +173,7 @@ uicc0 = {
imsi = "001010000000001";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc = "C42449363BBAD02B66D16BC975D77CC1";
- dnn = "oai";
- nssai_sst = 1;
+ pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; });
}
```
@@ -183,15 +182,30 @@ uicc0 = {
| **IMSI** | Unique identifier for the UE within the mobile network. Used by the network to identify the UE during authentication. It ensures that the UE is correctly identified by the network. | 001010000000001 |
| **key** | Cryptographic key shared between the UE and the network, used for encryption during the authentication process. | `fec86ba6eb707ed08905757b1bb44b8f` |
| **OPC** | Operator key for the Milenage Authentication and Key Agreement algorithm used for encryption during the authentication process. | Ensures secure communication between the UE and the network by matching the encryption keys. | `C42449363BBAD02B66D16BC975D77CC1` |
-| **DNN** | Specifies the name of the data network the UE wishes to connect to, similar to an APN in 4G networks. | `oai` |
-| **NSSAI** | Allows the UE to select the appropriate network slice, which provides different QoS. | `1` |
+| **DNN** | _Deprecated_: Specifies the name of the data network the UE wishes to connect to, similar to an APN in 4G networks. | `oai` |
+| **NSSAI** | _Deprecated_: Allows the UE to select the appropriate network slice, which provides different QoS. | `1` |
+| **pdu_sessions** | list of PDU sessions to request | empty array (no PDU session) |
+
+Note that DNN and NSSAI parameters are deprecated, and `pdu_sessions` should be
+used. If the `pdu_sessions` array is present, DNN and NSSAI are ignored.
+
+Each element within the `pdu_sessions` array takes the following parameters.
+Multiple PDU sessions can be requested.
+
+| **Parameter** | **Description** | **Default Value** |
+|---------------|-----------------|-------------------|
+| `id` | ID of the PDU session to request | index of the current element (1..16) |
+| `type` | Type of the PDU session to request (allowed: `IPv4`, `IPv6`, `IPv4v6`, `Ethernet` | `IPv4` |
+| `dnn` | Specifies the name of the data network the UE wishes to connect to | `oai` |
+| `nssai_sst` | Slice Service Type to request (1=eMBB, 2=URLLC, 3=mMTC) | `1` |
+| `nssai_sd` | Slice Differentiator to request | `0xffffff` (meaning "no SD") |
The UE configuration must match the one of the network's AMF. The nrUE can connect by default to OAI CN5G with no need to provide the configuration file.
When running the `nr-uesoftmodem`, one can specify the nrUE configuration file using the `-O` option. E.g.:
```bash
-sudo ./nr-uesoftmodem --rfsim --rfsimulator.serveraddr 127.0.0.1 -r 106 --numerology 1 --band 78 -C 3619200000 -O ~/nrue.uicc.conf
+sudo ./nr-uesoftmodem --rfsim --rfsimulator.[0].serveraddr 127.0.0.1 -r 106 --numerology 1 --band 78 -C 3619200000 -O ~/nrue.uicc.conf
```
The CL option `--uicc0.imsi` can override the IMSI value in the configuration file if necessary (e.g. when running multiple UEs): `--uicc0.imsi 001010000000001`.
diff --git a/doc/ORAN_FHI7.2_Tutorial.md b/doc/ORAN_FHI7.2_Tutorial.md
index 0443089e47..e3bb8e44c1 100644
--- a/doc/ORAN_FHI7.2_Tutorial.md
+++ b/doc/ORAN_FHI7.2_Tutorial.md
@@ -526,7 +526,7 @@ Contact the RU vendor and get the configuration manual to understand the below c
The OAI configuration file [`gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf) corresponds to:
- TDD pattern `DDDSU`, 2.5ms
- Bandwidth 100MHz
-- MTU 9600
+- MTU 9216
- 4TX4R
##### RU configuration
@@ -552,7 +552,7 @@ dl_ul_tuning_special_slot=0xfd00000
The OAI configuration file [`gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf) corresponds to:
- TDD pattern `DDDDDDDSUU`, 5ms
- Bandwidth 100MHz
-- MTU 9600
+- MTU 9216
- 4TX4R
##### RU configuration
@@ -579,7 +579,7 @@ The OAI configuration file [`gnb.sa.band78.273prb.fhi72.4x4-liteon.conf`](../tar
- TDD pattern `DDDSU`, 2.5ms
- Bandwidth 100MHz
- MTU 1500
-- MTU 9600: v02.00.10
+- MTU 9216: v02.00.10
##### RU configuration
@@ -618,7 +618,7 @@ jumboframe 1 # enable jumbo frame
The OAI configuration file [`gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf) corresponds to:
- TDD pattern `DDDSU`, 2.5ms
- Bandwidth 100MHz
-- MTU 9600
+- MTU 9216
##### RU configuration
@@ -692,7 +692,7 @@ At this stage, RU must be rebooted so the changes apply.
The OAI configuration file [`gnb.sa.band78.273prb.fhi72.4X4-foxconn.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4X4-foxconn.conf) corresponds to:
- TDD pattern `DDDSU`, 2.5ms
- Bandwidth 100MHz
-- MTU 9600
+- MTU 9216
##### RU configuration
@@ -895,7 +895,7 @@ We recommand to put the above four steps into one script file to quickly repeat
set -x
IF_NAME=eno12409
MAX_RING_BUFFER_SIZE=4096
-MTU=9600
+MTU=9216
DU_U_PLANE_MAC_ADD=00:11:22:33:44:66
DU_C_PLANE_MAC_ADD=00:11:22:33:44:67
VLAN=3
@@ -931,12 +931,13 @@ Sample configuration files for OAI gNB, specific to the manufacturer of the radi
2. VVDN RU:
[`gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf)
[`gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf)
-[`gnb.sa.band77.273prb.fhi72.2x2-vvdn.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn.conf)
+[`gnb.sa.band77.273prb.fhi72.2x2-vvdn-16b.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn-16b.conf)
3. Benetel 650 RU:
[`gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf)
4. Benetel 550 RU:
[`gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf)
[`gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf)
+[`gnb.sa.band78.273prb.fhi72.2x2-benetel550-16b.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.2x2-benetel550-16b.conf) - only with E release; with F, UL U-plane fragmentation is not correct
5. Metanoia RU:
[`gnb.sa.band78.273prb.fhi72.4x4-metanoia.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-metanoia.conf)
@@ -970,7 +971,7 @@ Edit the sample OAI gNB configuration file and check following parameters:
* `io_core`: absolute CPU core ID for XRAN library, it should be an isolated core, in our environment we are using CPU 4
* `worker_cores`: array of absolute CPU core IDs for XRAN library, they should be isolated cores, in our environment we are using CPU 2
* `ru_addr`: RU U- and C-plane MAC-addresses (format `UU:VV:WW:XX:YY:ZZ`, hexadecimal numbers)
- * `mtu`: Maximum Transmission Unit for the RU, specified by RU vendor; either 1500 or 9600 B (Jumbo Frames); if not set, 1500 is used
+ * `mtu`: Maximum Transmission Unit for the RU, specified by RU vendor; either 1500 or 9600 B (Jumbo Frames); if not set, 1500 is used; if the testbed contains a switch, and its max supported MTU < 9600, then please set the same value in the config file as well
* `file_prefix` : used to specify a unique prefix for shared memory and files created by multiple DPDK processes; if not set, default value of `wls_0` is used
* `dpdk_mem_size`: the huge page size that should be pre-allocated by DPDK
_for NUMA node 0_; by default, this is 8192 MiB (corresponding to 8 huge
@@ -1171,7 +1172,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("8c:1f:64:d1:10:46","8c:1f:64:d1:10:46","8c:1f:64:d1:10:43","8c:1f:64:d1:10:43")
- mtu = 9600;
+ mtu = 9216;
fh_config = (
# RAN650 #1
{
@@ -1587,11 +1588,11 @@ sequenceDiagram
[HW] [MPLANE] Watchdog timer answer:
2025-03-30T08:52:31+02:00
-[HW] [MPLANE] Interface MTU 1500 unreliable/not correctly reported by Benetel O-RU, hardcoding to 9600.
+[HW] [MPLANE] Interface MTU 1500 unreliable/not correctly reported by Benetel O-RU, hardcoding to 9216.
[HW] [MPLANE] IQ bitwidth 16 unreliable/not correctly reported by Benetel O-RU, hardcoding to 9.
[HW] [MPLANE] Storing the following information to forward to xran:
RU MAC address 8c:1f:64:d1:11:c0
- MTU 9600
+ MTU 9216
IQ bitwidth 9
PRACH offset 4
DU port bitmask 61440
@@ -2238,11 +2239,11 @@ sequenceDiagram
[HW] [MPLANE] Watchdog timer answer:
2025-08-29T06:49:32+02:00
-[HW] [MPLANE] Interface MTU 1500 unreliable/not correctly reported by Benetel O-RU, hardcoding to 9600.
+[HW] [MPLANE] Interface MTU 1500 unreliable/not correctly reported by Benetel O-RU, hardcoding to 9216.
[HW] [MPLANE] IQ bitwidth 16 unreliable/not correctly reported by Benetel O-RU, hardcoding to 9.
[HW] [MPLANE] Storing the following information to forward to xran:
RU MAC address 70:b3:d5:e1:5b:81
- MTU 9600
+ MTU 9216
IQ bitwidth 9
PRACH offset 4
DU port bitmask 61440
diff --git a/doc/README.md b/doc/README.md
index a4cfe19a2c..022174a4e7 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -57,6 +57,7 @@ There is some general information in the [OpenAirInterface Gitlab Wiki](https://
- [How to do a handover](./handover-tutorial.md)
- [How to setup gNB frequency](./gNB_frequency_setup.md)
- [How to use the RT data recording app](./data_recording.md)
+- [How to use packages](./packages.md)
Legacy unmaintained files:
- [`L2NFAPI_NOS1.md`](./L2NFAPI_NOS1.md), [`L2NFAPI_S1.md`](./L2NFAPI_S1.md):
diff --git a/doc/RRC/rrc-dev.md b/doc/RRC/rrc-dev.md
index 534d55be37..f5c4956c9d 100644
--- a/doc/RRC/rrc-dev.md
+++ b/doc/RRC/rrc-dev.md
@@ -175,6 +175,12 @@ with the reestablishment procedure; if any check fails, the CU-CP tries to
release the old UE at the AMF, and continues with the "normal" connection setup
(registration/service request) described above.
+The re-establishment flow implements transparent forwarding of CellGroupConfig
+per TS 38.473: the CU requests CellGroupConfig from the DU via UE Context
+Modification Request with `gNB_DU_Configuration_Query=true`, and the DU responds
+with an encoded CellGroupConfig that the CU forwards to the UE without
+decode/re-encode cycles.
+
```mermaid
sequenceDiagram
participant ue as UE
@@ -185,24 +191,45 @@ sequenceDiagram
ue->>du: Msg1/Preamble
du->>ue: Msg2/RAR
- ue->>du: Msg3 w/ RRC Reestabishment Request (old C-RNTI/PCI)
+ ue->>du: Msg3 w/ RRC Reestablishment Request (old C-RNTI/PCI)
Note over du: DU creates UE context for new RNTI
du->>cucp: F1AP Initial UL RRC Msg Tr (RRC Reestab Req, in Msg3)
Note over cucp: rrc_handle_RRCReestablishmentRequest()
- alt UE known and at the original DU
- Note over cucp: rrc_gNB_generate_RRCReestablishment()
SRB1 PDCP reestablishment
- cucp->>du: F1AP DL RRC Msg Tr (old gNB-DU-UE ID)
- Note over du: Reuse configuration of and delete old UE
(in dl_rrc_message_transfer())
+ alt UE known
+ opt PCI mismatch AND Association ID mismatch
+ Note over cucp: Detect different DU (assoc_id != du_assoc_id)
Update du_assoc_id, set f1_ue_context_active=false
+ end
+ Note over cucp: rrc_gNB_generate_RRCReestablishment()
SRB1 PDCP reestablishment
+ cucp->>du: F1AP DL RRC Msg Tr (gNB-DU-UE ID)
+ Note over du: dl_rrc_message_transfer()
+ alt Old UE found
+ Note over du: Reuse configuration of and delete old UE
+ else Old UE not found
+ Note over du: do nothing
+ end
+ Note over du: Set reestablishRLC=true
+ Note over du: - Store CellGroup in reconfigCellGroup
- Remove spCellConfig from CellGroup
du->>ue: RRC Reestablishment
ue->>du: RRC Reestablishment Complete
du->>cucp: F1AP UL RRC Msg Tr (RRC Reestab Complete)
Note over cucp: handle_rrcReestablishmentComplete()
- Note over cucp: cuup_notify_reestablishment()
- cucp->>cuup: E1AP Bearer Context Modification Req
- cucp->>ue: F1AP DL RRC Msg Transfer (RRC Reconfiguration)
- cuup->>cucp: E1AP Bearer Context Modification Resp
+ Note over cucp: rrc_gNB_process_RRCReestablishmentComplete()
Re-establish SRB2 PDCP
+ Note over cucp: cuup_notify_reestablishment()
Notify CU-UP for DRB re-establishment
+ cucp->>cuup: E1AP Bearer Context Modification Req
+ cuup->>cucp: E1AP Bearer Context Modification Resp (asynchronous)
+ alt on the original DU
+ Note over cucp: Send UE Context Modification Request
with gNB_DU_Configuration_Query=true
+ cucp->>du: F1AP UE Context Modification Req
+ du->>cucp: F1AP UE Context Modification Resp
(CellGroupConfig with spCellConfig and reestablishRLC flags)
+ else on a different DU
+ Note over cucp: Detect different DU (!f1_ue_context_active)
Trigger UE Context Setup on new DU
+ cucp->>du: F1AP UE Context Setup Request
+ du->>cucp: F1AP UE Context Setup Response
(CellGroupConfig with spCellConfig and reestablishRLC flags)
+ end
+ Note over cucp: rrc_CU_process_ue_context_setup/modification_response()
Detect re-establishment via rrc_detect_reestablishment()
rrc_gNB_generate_dedicatedRRCReconfiguration()
(with is_reestablishment=true)
+ cucp->>ue: F1AP DL RRC Msg Transfer (RRC Reconfiguration
with transparent CellGroupConfig)
ue->>cucp: F1AP UL RRC Msg Transfer (RRC Reconfiguration Complete)
- Note over cucp: handle_rrcReestablishmentComplete()
+ Note over cucp: handle_rrcReconfigurationComplete()
else Fallback*
cucp->>amf: NGAP UE Context Release Request
Note over cucp: rrc_gNB_generate_RRCSetup()
@@ -210,6 +237,14 @@ sequenceDiagram
end
```
+Note on re-establishment on different DU: The "UE known and on a different DU"
+case is shown in the sequence diagram above. When a UE re-establishes on a
+different DU than the original one (detected by comparing `du_assoc_id` at
+RRCReestablishmentRequest), the CU updates `du_assoc_id` and sets
+`f1_ue_context_active=false`. At RRCReestablishmentComplete, if
+`f1_ue_context_active` is false, the CU triggers UE Context Setup on the new
+DU per TS 38.401 §8.7.
+
### Inter-DU Handover (F1)
The basic handover (HO) structure is as follows. In order to support various
diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md
index 7660e74adb..1515172b24 100644
--- a/doc/RUNMODEM.md
+++ b/doc/RUNMODEM.md
@@ -140,6 +140,104 @@ You can view all available options by typing:
```shell
./nr-uesoftmodem --help
```
+
+### NR UE: Configure multiple RF-frontends (RUs)
+
+Multiple RF-frontends (also called RUs) can be defined for the nr-uesoftmodem.
+Therefore, two sections in the NR UE configuration file are used:
+- `RUs`
+- `cells`
+
+The `RUs` section in the NR UE configuration file contains an array of elements, where each element has these properies:
+
+| Property name | Type | Default value | Description |
+| ---------------- | -------------- | ------------- | ------------------------------------ |
+| nb_tx | integer | 1 | Number of TX Antennas |
+| nb_rx | integer | 1 | Number of RX Antennas |
+| att_tx | integer | 0 | TX Attenuation in dB |
+| att_rx | integer | 0 | RX Attenuation in dB |
+| max_rxgain | integer | 120 | Maximum RX Gain at 0 dB Attenuation |
+| sdr_addrs | string | type=b200 | SDR Parameter String |
+| tx_subdev | string | | SDR TX Subdevice |
+| rx_subdev | string | | SDR RX Subdevice |
+| clock_src | string | internal | SDR Clock Source |
+| time_src | string | internal | SDR Time Source |
+| tune_offset | floating point | 0.0 | SDR Tune Offset in Hz |
+| if_freq | integer | 0 | DL Intermediate Frequency in Hz |
+| if_offset | integer | 0 | UL Intermediate Frequency Offset in Hz |
+
+The `cells` section in the NR UE configuration file contains an array of elements, where each element has these properies:
+
+| Property name | Type | Default value | Description |
+| ---------------- | ------- | ------------- | ---------------------------------------- |
+| ru_id | integer | 0 | ID of the associated RU from the `RUs` section |
+| band | integer | 78 | 5G NR Band |
+| rf_freq | integer | 0 | DL Carrier Centre Frequency in Hz |
+| rf_offset | integer | 0 | DL Carrier Centre Frequency Offset in Hz |
+| numerology | integer | 1 | 5G NR Numerology (µ) |
+| N_RB_DL | integer | 106 | Number of DL Carrier Ressource Blocks |
+| ssb_start | integer | 516 | Ressource Element where the SSB Starts |
+
+There are different scenarios where multiple RF-frontends (also called RUs) are beneficial for the NR UE:
+
+1. RF-Simulator Inter-Frequency Handover between multiple cells
+2. Multiple UEs in one instance, each using their own RF-frontend (RF-Simulator connection)
+3. Different Antennas connected to different RF-ports
+4. Concurrent connection to multiple carriers (carrier aggregation CA)
+
+This would be and example configuration for the 1. scenario:
+
+```
+rfsimulator = (
+ {
+ serveraddr = "127.0.0.2";
+ serverport = 4043;
+ }, {
+ serveraddr = "127.0.0.3";
+ serverport = 4044;
+ }
+);
+
+RUs = (
+ {
+ nb_tx = 1;
+ nb_rx = 1;
+ }, {
+ nb_tx = 1;
+ nb_rx = 1;
+ }
+);
+
+cells = (
+ {
+ ru_id = 0;
+ band = 78;
+ rf_freq = 3619200000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }, {
+ ru_id = 1;
+ band = 78;
+ rf_freq = 3649440000L;
+ numerology = 1;
+ N_RB_DL = 106;
+ ssb_start = 516;
+ }
+);
+```
+
+An example for the 2. scenario can be found in the file [ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf](../ci-scripts/yaml_files/5g_rfsimulator_multiue/nrue.uicc.conf).
+
+The 3. scenario is similar to 1., but instead of providing RF-Simulator parameters, actual SDR parameters have to be provided.
+
+The 4. scenario is not supported, as the NR UE does not implement CA, yet.
+
+Current Limitations:
+- Each RU can be used by only one cell.
+- Each RU and cell can be used by only one UE (no RU sharing implemented, yet).
+- The sampling rates of all RUs must be the same.
+
### Common gNB and NR UE command line options
#### Three-quarter sampling
@@ -174,7 +272,7 @@ Therefore either SDR boards and a dedicated NTN channel emulator are required, o
As shown on the [rfsimulator page](../radio/rfsimulator/README.md), RFsimulator provides different possibilities.
E.g. to perform a simple simulation of a satellite in geostationary orbit (GEO), these parameters should be added to both gNB and UE command lines:
```
---rfsimulator.prop_delay 238.74
+--rfsimulator.[0].prop_delay 238.74
```
For simulation of a satellite in low earth orbit (LEO), two channel models have been added to rfsimulator:
@@ -210,7 +308,7 @@ This can be done by either providing this line in the conf file in section `rfsi
```
Or by providing this the the command line parameters:
```
---rfsimulator.options chanmod
+--rfsimulator.[0].options chanmod
```
#### gNB
@@ -338,7 +436,7 @@ position0 = {
So an example NR UE command for FDD, 5MHz BW, 15 kHz SCS, transparent GEO satellite 5G NR NTN is this:
```
cd cmake_targets
-sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.prop_delay 238.74
+sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 238.74
```
For LEO satellite scenarios, the parameter `--ntn-initial-time-drift` must be provided via command line, as the UE needs this value to compensate for the time drift during initial sync, before SIB19 was received.
@@ -356,7 +454,7 @@ For other information on optional NR UE command line options, please refer [here
So an example NR UE command for FDD, 5MHz BW, 15 kHz SCS, transparent LEO satellite 5G NR NTN is this:
```
cd cmake_targets
-sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.prop_delay 20 --rfsimulator.options chanmod --time-sync-I 0.1 --ntn-initial-time-drift -46 --initial-fo 57340 --cont-fo-comp 2
+sudo ./ran_build/build/nr-uesoftmodem -O ../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --band 254 -C 2488400000 --CO -873500000 -r 25 --numerology 0 --ssb 60 --rfsim --rfsimulator.[0].prop_delay 20 --rfsimulator.[0].options chanmod --time-sync-I 0.1 --ntn-initial-time-drift -46 --initial-fo 57340 --cont-fo-comp 2
```
## Specific OAI modes
@@ -381,7 +479,7 @@ sudo ./nr-uesoftmodem --phy-test [--reconfig-file ../../../ci-scripts/rrc-files/
In summary:
- If you are running on the same machine and launched the 2 executables (`nr-softmodem` and `nr-uesoftmodem`) from the same directory, nothing has to be done.
- If you launched the 2 executables from 2 different folders, just point to the location where you launched the `nr-softmodem`:
- * `sudo ./nr-uesoftmodem --rfsim --phy-test --reconfig-file /the/path/where/you/launched/nr-softmodem/reconfig-file --rbconfig-file /the/path/where/you/launched/nr-softmodem/rbconfig-file --rfsimulator.serveraddr `
+ * `sudo ./nr-uesoftmodem --rfsim --phy-test --reconfig-file /the/path/where/you/launched/nr-softmodem/reconfig-file --rbconfig-file /the/path/where/you/launched/nr-softmodem/rbconfig-file --rfsimulator.[0].serveraddr `
- If you are not running on the same machine, you need to **COPY** the two raw files
* `scp usera@machineA:/the/path/where/you/launched/nr-softmodem/r*config.raw userb@machineB:/the/path/where/you/will/launch/nr-uesoftmodem/`
* Obviously this operation should be done before launching the `nr-uesoftmodem` executable.
@@ -428,7 +526,7 @@ To run using the RFsimulator:
```bash
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra --rfsim
-sudo ./nr-uesoftmodem --do-ra --rfsim --rfsimulator.serveraddr 127.0.0.1
+sudo ./nr-uesoftmodem --do-ra --rfsim --rfsimulator.[0].serveraddr 127.0.0.1
```
Using USRPs:
diff --git a/doc/RUN_NR_PRS.md b/doc/RUN_NR_PRS.md
index 68c7145fd3..d4bdf38f2c 100644
--- a/doc/RUN_NR_PRS.md
+++ b/doc/RUN_NR_PRS.md
@@ -101,7 +101,7 @@ If **N310 USRPs** are used, then run above command `without -E option` i.e witho
To run using **rfsimulator** with local ETH IF `127.0.0.1`, execute following command:
```
-sudo ./nr-uesoftmodem --rfsim --phy-test --noS1 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf --rfsimulator.serveraddr 127.0.0.1
+sudo ./nr-uesoftmodem --rfsim --phy-test --noS1 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf --rfsimulator.[0].serveraddr 127.0.0.1
```
### FR2 test
@@ -115,7 +115,7 @@ If RF beamforming module is NOT present, nrUE can still be launched with USRP al
To run using **rfsimulator** with local ETH IF `127.0.0.1`, execute following command:
```
-sudo ./nr-uesoftmodem --rfsim --phy-test --noS1 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf --rfsimulator.serveraddr 127.0.0.1
+sudo ./nr-uesoftmodem --rfsim --phy-test --noS1 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf --rfsimulator.[0].serveraddr 127.0.0.1
```
### Multiple gNB scenario
diff --git a/doc/data_recording.md b/doc/data_recording.md
index 8b0469906c..75f4a54bbb 100644
--- a/doc/data_recording.md
+++ b/doc/data_recording.md
@@ -239,7 +239,7 @@ sudo ./cmake_targets/ran_build/build/nr-softmodem -O ./targets/PROJECTS/GENERIC-
```
Run NR gNB Softmodem in RF Simulation:
```
-sudo ./cmake_targets/ran_build/build/nr-softmodem -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.1x1.usrpx410_3300MHz.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.serveraddr server --phy-test -d --T_stdout 2 --T_nowait
+sudo ./cmake_targets/ran_build/build/nr-softmodem -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.1x1.usrpx410_3300MHz.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.[0].serveraddr server --phy-test -d --T_stdout 2 --T_nowait
```
> **Note:** User needs to change the name of gNB config file to your gNB config file.
@@ -265,7 +265,7 @@ sudo ./cmake_targets/ran_build/build/nr-uesoftmodem --usrp-args "type=x4xx,addr=
Run OAI Soft UE in RF Simulation, assume the IP address of gNB server is `192.168.100.2`:
```
-sudo ./cmake_targets/ran_build/build/nr-uesoftmodem --rfsim --rfsimulator.serveraddr 192.168.100.2 --phy-test -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --reconfig-file /home/user/workarea/rrc_files/reconfig.raw --rbconfig-file /home/user/workarea/rrc_files/rbconfig.raw --T_stdout 2 --T_nowait --T_port 2023
+sudo ./cmake_targets/ran_build/build/nr-uesoftmodem --rfsim --rfsimulator.[0].serveraddr 192.168.100.2 --phy-test -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --reconfig-file /home/user/workarea/rrc_files/reconfig.raw --rbconfig-file /home/user/workarea/rrc_files/rbconfig.raw --T_stdout 2 --T_nowait --T_port 2023
```
### Step3: Run Data Recording Application Services
diff --git a/doc/handover-tutorial.md b/doc/handover-tutorial.md
index a4edecd193..58c0808108 100644
--- a/doc/handover-tutorial.md
+++ b/doc/handover-tutorial.md
@@ -76,7 +76,7 @@ Start the CU including telnet support:
Start DU0:
- sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf --rfsimulator.serveraddr 127.0.0.1
+ sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf --rfsimulator.[0].serveraddr 127.0.0.1
This will show an error `[HW] connect() to 127.0.0.1:4043 failed,
errno(111)`. _This is expected_, because the RFsim server is at the UE (to be
@@ -84,7 +84,7 @@ able to serve two RFsim clients, one DU each; see below for more info). Proceed
by starting the UE, and let it connect completely (this should make the error
go away):
- sudo ./nr-uesoftmodem -C 3450720000 -r 106 --numerology 1 --ssb 516 -O --rfsim --rfsimulator.serveraddr server
+ sudo ./nr-uesoftmodem -C 3450720000 -r 106 --numerology 1 --ssb 516 -O --rfsim --rfsimulator.[0].serveraddr server
Note how the RFsimulator roles have been switched, and RFsim server is at the
UE side; _this is important_. Replace `` with the UE configuration
@@ -93,7 +93,7 @@ matching your core. If you followed the CN and oaiUE tutorials, you can remove
Once the UE is connected, start DU1:
- sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf --rfsimulator.serveraddr 127.0.0.1
+ sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf --rfsimulator.[0].serveraddr 127.0.0.1
Once DU1 is online, you can trigger a handover by issuing this command
@@ -461,13 +461,13 @@ Run the 5G Core Network if not already running.
2. Start the source gNB (gNB-PCI0) e.g.
```sh
-sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf --telnetsrv --telnetsrv.shrmod ci --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.serveraddr 127.0.0.1
+sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf --telnetsrv --telnetsrv.shrmod ci --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.[0].serveraddr 127.0.0.1
```
3. Start the UE e.g.
```sh
-sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 -O ../../../ci-scripts/conf_files/nrue.uicc.conf --rfsimulator.serveraddr server
+sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 -O ../../../ci-scripts/conf_files/nrue.uicc.conf --rfsimulator.[0].serveraddr server
```
Ensure the UE successfully registers with the network.
@@ -475,7 +475,7 @@ Ensure the UE successfully registers with the network.
4. Start the target gNB (gNB-PCI1) e.g.
```sh
-sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf --rfsim --telnetsrv --telnetsrv.shrmod ci --gNBs.[0].min_rxtxtime 6 --rfsimulator.serveraddr 127.0.0.1
+sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf --rfsim --telnetsrv --telnetsrv.shrmod ci --gNBs.[0].min_rxtxtime 6 --rfsimulator.[0].serveraddr 127.0.0.1
```
**Note for same-machine setup:** When running both gNBs on the same machine,
diff --git a/doc/nfapi.md b/doc/nfapi.md
index 159255f4cf..4929b656f7 100644
--- a/doc/nfapi.md
+++ b/doc/nfapi.md
@@ -238,7 +238,7 @@ Run cu_stu and ric_stub in separate terminals
Run the OAI PNF first, as it is the WLS memory master
- sudo NFAPI_TRACE_LEVEL=info ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.2x2.conf --nfapi PNF --rfsim --rfsimulator.serveraddr server
+ sudo NFAPI_TRACE_LEVEL=info ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.2x2.conf --nfapi PNF --rfsim --rfsimulator.[0].serveraddr server
Run the O-DU over GDB
diff --git a/doc/packages.md b/doc/packages.md
new file mode 100644
index 0000000000..701d8ebac5
--- /dev/null
+++ b/doc/packages.md
@@ -0,0 +1,139 @@
+# OpenAirInterface Packages
+
+This document describes how to build Deb/RPM packages with OAI's build system, cmake.
+
+[[_TOC_]]
+
+## Create packages
+
+Packages are created by running `cpack` after configuring OAI with the appropriate options and building the executables.
+
+First, configure the project with `cmake` and select which type of package you want to build. Then, compile, and finally run `cpack`:
+
+```bash
+cd ~/openairinterface5g
+mkdir build && cd build
+cmake .. -GNinja
+ninja
+cpack
+```
+
+where `` is for:
+
+- packaging **USRP**: `-DOAI_USRP=ON -DPACKAGING_USRP=ON`
+- packaging **LTE**: `-DPACKAGING_LTE=ON`
+- packaging **NR**: `-DPACKAGING_NR=ON`
+- packaging **COMMON**: `-DPACKAGING_COMMON=ON -DENABLE_TELNETSRV=ON`
+- packaging **PHYSIM**: `-DPACKAGING_PHYSIM=ON`
+
+By default, deb packages are built. If you want to build for RPM, also provide `-DPACKAGING_RPM=ON`
+
+For example, to package all available packages, run:
+
+```bash
+cmake .. -GNinja -DOAI_USRP=ON -DPACKAGING_USRP=ON -DPACKAGING_LTE=ON -DPACKAGING_NR=ON -DPACKAGING_COMMON=ON -DENABLE_TELNETSRV=ON -DPACKAGING_PHYSIM=ON
+ninja
+cpack
+```
+
+## Package installation
+
+In order to install the packages, run:
+
+### Ubuntu/Debian
+
+ dpkg -i liboai-common.deb liboai-usrp.deb oai-lte.deb oai-nr.deb oai-physim.deb
+
+### Rhel/Fedora
+
+ rpm -i liboai-common.rpm liboai-usrp.rpm oai-lte.rpm oai-nr.rpm oai-physim.rpm
+
+
+**NOTE**: After oai-nr and oai-lte installation, you'll have services running in systemd, for more information check Systemd paragraph.
+
+
+## Usage
+
+### Use debug symbols
+
+- Install gdb with `apt` or `dnf`
+- Install both stripped package and the corresponding debug symbol one
+- Use gbd on you executable, example: ```gdb --args /usr/bin/nr-softmodem -O
+ /etc/openairinterface/nr/gnb.sa.band78.fr1.106PRB.usrpb210.conf -E
+ --continuous-tx -A -2 --device.name oai_usrpdevif```
+- Then use ```run```
+
+### Systemd
+
+Once installed, oai-nr and oai-lte have **services** which run in systemd
+(`nr-softmodem` and `nr-cuup` for oai-nr and `lte-softmodem` for oai-lte),
+here is a list of useful **commands**:
+
+- start
+- stop
+- restart
+- reload
+- status
+- enable (enable service at boot)
+- disable (disable service at boot)
+- is-enabled
+
+To use them:
+
+ sudo systemctl [command] [service]
+
+By default, following configuration files are selected:
+- **nr-softmodem**: `gnb.sa.band78.fr1.106PRB.usrpb210.conf`
+- **nr-cuup**: `gnb-cuup.sa.f1.conf`
+- **lte-softmodem**: `enb.band7.tm1.50PRB.usrpb210.conf`
+
+To modify the configuration:
+- Select the configuration file you wish from the following locations:
+ - `/etc/openairinterface/nr`
+ - `/etc/openairinterface/lte`
+ - Or any custom configuration file you have created.
+- Edit the service configuration under `/lib/systemd/system`.
+
+Main lines to be modified are
+
+ ExecStart=/usr/bin/nr-softmodem -O /etc/openairinterface/nr/gnb.sa.band78.fr1.106PRB.usrpb210.conf -E --continuous-tx -A -2 --device.name oai_usrpdevif
+
+This line specifies the command and its parameters that the service will execute.
+
+ Restart=on-failure
+ RestartSec=5s
+
+These directives define the service’s behavior in case of failure, including whether it should restart and the delay before restarting.
+
+**NOTE**: Additional configuration options are available for further customization.
+For full customization please check [systemd services documentation](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html)
+
+After making your changes, apply them by running:
+
+ sudo systemctl daemon-reload && sudo systemctl restart nr-softmodem.service
+
+For instructions on using a custom configuration file, see the [setup documentation](./gNB_frequency_setup.md).
+
+
+
+To access service logs:
+
+ sudo journalctl -u [service] --since "today"
+
+
+To follow service logs:
+
+ sudo journalctl -u [service] --follow
+
+
+## Purge
+
+To uninstall packages and automatically stop and remove services in systemd, run:
+
+### Ubuntu/Debian
+
+ dpkg -r liboai-common liboai-usrp oai-lte oai-nr oai-physim
+
+### Rhel/Fedora
+
+ rpm -e liboai-common liboai-usrp oai-lte oai-nr oai-physim
diff --git a/docker/Dockerfile.build.fhi72.ubuntu b/docker/Dockerfile.build.fhi72.ubuntu
index 7b3ade05b0..3d483618cd 100644
--- a/docker/Dockerfile.build.fhi72.ubuntu
+++ b/docker/Dockerfile.build.fhi72.ubuntu
@@ -68,7 +68,7 @@ RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai \
- --ninja --gNB \
+ --ninja --gNB --nrRU \
--build-lib "telnetsrv enbscope uescope nrscope" \
-t oran_fhlib_5g --cmake-opt -Dxran_LOCATION=/opt/phy/fhi_lib/lib \
--build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
diff --git a/docker/Dockerfile.nrORU.fhi72.ubuntu b/docker/Dockerfile.nrORU.fhi72.ubuntu
new file mode 100644
index 0000000000..0db881c734
--- /dev/null
+++ b/docker/Dockerfile.nrORU.fhi72.ubuntu
@@ -0,0 +1,98 @@
+#/*
+# * 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
+# */
+
+FROM ran-base:latest AS ran-base
+
+FROM ran-build-fhi72:latest AS ran-build
+
+#start from scratch for target executable
+FROM ubuntu:noble AS oai-nr-oru
+ARG BUILD_OPTION
+ENV DEBIAN_FRONTEND=noninteractive
+ENV TZ=Europe
+
+RUN apt-get update && \
+ apt-get upgrade --yes && \
+ apt-get install --yes \
+ software-properties-common \
+ procps \
+ pkg-config \
+ libsctp1 \
+ tzdata \
+ libblas3 \
+ libconfig9 \
+ openssl \
+ net-tools \
+ iperf \
+ iproute2 \
+ iputils-ping \
+ gdb \
+ pciutils \
+ libpcap-dev \
+ xz-utils \
+ libnuma-dev \
+ libyaml-cpp-dev && \
+# if the --sanitize option was used to build, additional packages are required
+ /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
+ libasan8 \
+ libubsan1 \
+ liblapacke; fi' && \
+ rm -rf /var/lib/apt/lists/*
+
+WORKDIR /opt/nr-oru/bin
+COPY --from=ran-build \
+ /oai-ran/cmake_targets/ran_build/build/nr-oru ./
+COPY ./docker/scripts/nr_oru_entrypoint.sh ./entrypoint.sh
+
+COPY --from=ran-build \
+ /oai-ran/cmake_targets/ran_build/build/liboai_transpro.so \
+ /oai-ran/cmake_targets/ran_build/build/libcoding.so \
+ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \
+ /oai-ran/cmake_targets/ran_build/build/libdfts.so \
+ /oai-ran/cmake_targets/ran_build/build/libldpc*.so \
+ /oai-ran/cmake_targets/ran_build/build/libparams_yaml.so \
+ /usr/local/lib/
+
+## Libxran library
+COPY --from=ran-build \
+ /opt/phy/fhi_lib/lib/build/libxran.so \
+ /opt/phy/fhi_lib/lib/build/
+
+## Copy all DPDK libraries as liboran_fhlib_5g.so require most of them
+COPY --from=ran-build /usr/local/lib/x86_64-linux-gnu /usr/local/lib/x86_64-linux-gnu/
+
+RUN ldconfig && \
+ echo "---- ldd on nr-oru ----" && \
+ ldd /opt/nr-oru/bin/nr-oru && \
+ echo "---- ldd on shared libraries ----" && \
+ ldd /usr/local/lib/liboai_transpro.so \
+ /usr/local/lib/libcoding.so \
+ /usr/local/lib/libparams_libconfig.so \
+ /usr/local/lib/libdfts.so \
+ /usr/local/lib/libldpc*.so \
+ /opt/phy/fhi_lib/lib/build/libxran.so
+
+WORKDIR /opt/nr-oru
+
+COPY --from=ran-base /usr/local/bin/yq /usr/local/bin/yq
+COPY --from=ran-base /tini /tini
+ENTRYPOINT ["/tini", "-v", "--", "/opt/nr-oru/bin/entrypoint.sh"]
+CMD ["/opt/nr-oru/bin/nr-oru"]
diff --git a/docker/Dockerfile.nrUE.ubuntu b/docker/Dockerfile.nrUE.ubuntu
index 806e2b635f..7c8b15d013 100644
--- a/docker/Dockerfile.nrUE.ubuntu
+++ b/docker/Dockerfile.nrUE.ubuntu
@@ -39,6 +39,7 @@ ENV TZ=Europe/Paris
RUN apt-get update && \
apt-get upgrade --yes && \
apt-get install --yes \
+ arping \
software-properties-common \
procps \
libsctp1 \
diff --git a/docker/scripts/nr_oru_entrypoint.sh b/docker/scripts/nr_oru_entrypoint.sh
new file mode 100755
index 0000000000..dbfdbfa58d
--- /dev/null
+++ b/docker/scripts/nr_oru_entrypoint.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+set -uo pipefail
+
+PREFIX=/opt/nr-oru
+CONFIGFILE=$PREFIX/etc/nr-oru.conf
+
+echo "=================================="
+echo "/proc/sys/kernel/core_pattern=$(cat /proc/sys/kernel/core_pattern)"
+
+if [ ! -f $CONFIGFILE ]; then
+ echo "No configuration file $CONFIGFILE found: attempting to find YAML config"
+ YAML_CONFIGFILE=$PREFIX/etc/nr-oru.yaml
+ if [ ! -f $YAML_CONFIGFILE ]; then
+ echo "No configuration file $YAML_CONFIGFILE found. Please mount either at $CONFIGFILE or $YAML_CONFIGFILE"
+ exit 255
+ fi
+ CONFIGFILE=$YAML_CONFIGFILE
+fi
+
+echo "=================================="
+echo "== Configuration file:"
+cat $CONFIGFILE
+
+new_args=()
+
+while [[ $# -gt 0 ]]; do
+ new_args+=("$1")
+ shift
+done
+
+new_args+=("-O")
+new_args+=("$CONFIGFILE")
+
+# Load the USRP binaries
+echo "=================================="
+echo "== Load USRP binaries"
+if [[ -v USE_B2XX ]]; then
+ $PREFIX/bin/uhd_images_downloader.py -t b2xx
+elif [[ -v USE_X3XX ]]; then
+ $PREFIX/bin/uhd_images_downloader.py -t x3xx
+elif [[ -v USE_N3XX ]]; then
+ $PREFIX/bin/uhd_images_downloader.py -t n3xx
+fi
+
+# enable printing of stack traces on assert
+export OAI_GDBSTACKS=1
+
+echo "=================================="
+echo "== Starting O-RU "
+if [[ -v USE_ADDITIONAL_OPTIONS ]]; then
+ echo "Additional option(s): ${USE_ADDITIONAL_OPTIONS}"
+ while [[ $# -gt 0 ]]; do
+ new_args+=("$1")
+ shift
+ done
+ for word in ${USE_ADDITIONAL_OPTIONS}; do
+ new_args+=("$word")
+ done
+ echo "${new_args[@]}"
+ exec "${new_args[@]}"
+else
+ echo "${new_args[@]}"
+ exec "${new_args[@]}"
+fi
diff --git a/executables/create_tasks.c b/executables/create_tasks.c
index a36cf410e5..6f73d625a0 100644
--- a/executables/create_tasks.c
+++ b/executables/create_tasks.c
@@ -29,10 +29,6 @@
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "openair3/ocp-gtpu/gtp_itf.h"
- #if ENABLE_RAL
- #include "lteRALue.h"
- #include "lteRALenb.h"
- #endif
#include "RRC/LTE/rrc_defs.h"
# include "enb_app.h"
# include "openair2/LAYER2/MAC/mac_proto.h"
diff --git a/executables/create_tasks_mbms.c b/executables/create_tasks_mbms.c
index f595dc1095..c6fd2ea452 100644
--- a/executables/create_tasks_mbms.c
+++ b/executables/create_tasks_mbms.c
@@ -33,10 +33,6 @@
#include "m2ap_MCE.h"
#include "m3ap_MME.h"
#include "m3ap_MCE.h"
- #if ENABLE_RAL
- #include "lteRALue.h"
- #include "lteRALenb.h"
- #endif
#include "RRC/LTE/rrc_defs.h"
# include "enb_app.h"
# include "mce_app.h"
diff --git a/executables/create_tasks_ue.c b/executables/create_tasks_ue.c
index 46b80a0496..89d4c5179f 100644
--- a/executables/create_tasks_ue.c
+++ b/executables/create_tasks_ue.c
@@ -27,10 +27,6 @@
#include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "openair3/NAS/UE/nas_ue_task.h"
- #if ENABLE_RAL
- #include "lteRALue.h"
- #include "lteRALenb.h"
- #endif
#include "RRC/LTE/rrc_defs.h"
# include "enb_app.h"
diff --git a/executables/lte-enb.c b/executables/lte-enb.c
index c86a916c7a..259154004c 100644
--- a/executables/lte-enb.c
+++ b/executables/lte-enb.c
@@ -80,9 +80,6 @@
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
-//#define DEBUG_THREADS 1
-
-//#define USRP_DEBUG 1
struct timing_info_t {
//unsigned int frame, hw_slot, last_slot, next_slot;
//unsigned int mbox0, mbox1, mbox2, mbox_target;
@@ -115,10 +112,6 @@ static struct {
volatile uint8_t phy_proc_CC_id;
} sync_phy_proc;
-extern double cpuf;
-
-
-void init_eNB();
void stop_eNB(int nb_inst);
int wakeup_tx(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, int frame_tx, int subframe_tx, uint64_t timestamp_tx);
diff --git a/executables/lte-ru.c b/executables/lte-ru.c
index 9c47c92a0d..cd6dc9672d 100644
--- a/executables/lte-ru.c
+++ b/executables/lte-ru.c
@@ -390,7 +390,7 @@ void fh_if5_north_asynch_in(RU_t *ru,
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
RU_proc_t *proc = &ru->proc;
int tti_tx,frame_tx;
- openair0_timestamp timestamp_tx=0;
+ openair0_timestamp_t timestamp_tx = 0;
//recv_IF5(ru, ×tamp_tx, *subframe, IF5_RRH_GW_DL);
// LOG_I(PHY,"Received subframe %d (TS %llu) from RCC\n",tti_tx,timestamp_tx);
tti_tx = (timestamp_tx/fp->samples_per_tti)%10;
@@ -540,7 +540,7 @@ void rx_rf(RU_t *ru,
unsigned int rxs;
int i;
int resynch=0;
- openair0_timestamp ts=0,old_ts=0;
+ openair0_timestamp_t ts = 0, old_ts = 0;
for (i=0; inb_rx; i++)
rxp[i] = (void *)&ru->common.rxdata[i][*subframe*fp->samples_per_tti];
@@ -1251,45 +1251,37 @@ void fill_rf_config(RU_t *ru,
if(ru->numerology == 0) {
if (fp->threequarter_fs) {
cfg->sample_rate=23.04e6;
- cfg->samples_per_frame = 230400;
cfg->tx_bw = 20e6;
cfg->rx_bw = 20e6;
} else {
cfg->sample_rate=30.72e6;
- cfg->samples_per_frame = 307200;
cfg->tx_bw = 20e6;
cfg->rx_bw = 20e6;
}
} else if(ru->numerology == 1) {
cfg->sample_rate=61.44e6;
- cfg->samples_per_frame = 307200;
cfg->tx_bw = 20e6;
cfg->rx_bw = 20e6;
} else if(ru->numerology == 2) {
cfg->sample_rate=122.88e6;
- cfg->samples_per_frame = 307200;
cfg->tx_bw = 40e6;
cfg->rx_bw = 40e6;
} else {
LOG_I(PHY,"Wrong input for numerology %d\n setting to 20MHz normal CP configuration",numerology);
cfg->sample_rate=30.72e6;
- cfg->samples_per_frame = 307200;
cfg->tx_bw = 10e6;
cfg->rx_bw = 10e6;
}
} else if(fp->N_RB_DL == 50) {
cfg->sample_rate=15.36e6;
- cfg->samples_per_frame = 153600;
cfg->tx_bw = 10e6;
cfg->rx_bw = 10e6;
} else if (fp->N_RB_DL == 25) {
cfg->sample_rate=7.68e6;
- cfg->samples_per_frame = 76800;
cfg->tx_bw = 5e6;
cfg->rx_bw = 5e6;
} else if (fp->N_RB_DL == 6) {
cfg->sample_rate=1.92e6;
- cfg->samples_per_frame = 19200;
cfg->tx_bw = 1.5e6;
cfg->rx_bw = 1.5e6;
} else AssertFatal(1==0,"Unknown N_RB_DL %d\n",fp->N_RB_DL);
@@ -1299,7 +1291,6 @@ void fill_rf_config(RU_t *ru,
else //FDD
cfg->duplex_mode = duplex_mode_FDD;
- cfg->Mod_id = 0;
cfg->num_rb_dl=fp->N_RB_DL;
cfg->tx_num_channels=ru->nb_tx;
cfg->rx_num_channels=ru->nb_rx;
diff --git a/executables/lte-softmodem.h b/executables/lte-softmodem.h
index db6136c351..6642141526 100644
--- a/executables/lte-softmodem.h
+++ b/executables/lte-softmodem.h
@@ -53,13 +53,10 @@
#define CMDLINE_DEBUGUEPRACH_IDX 3
#define CMDLINE_NOL2CONNECT_IDX 4
#define CMDLINE_CALIBPRACHTX_IDX 5
-#define CMDLINE_MEMLOOP_IDX 6
-#define CMDLINE_DUMPMEMORY_IDX 7
+
/*------------------------------------------------------------------------------------------------------------------------------------------*/
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
-
-#define CONFIG_HLP_SIML1 "activate RF simulator instead of HW\n"
#define CONFIG_HLP_NUMUE "number of UE instances\n"
#define CONFIG_HLP_UERXG "set UE RX gain\n"
#define CONFIG_HLP_UERXGOFF "external UE amplifier offset\n"
@@ -125,7 +122,6 @@ extern pthread_cond_t sync_cond;
extern pthread_mutex_t sync_mutex;
extern int sync_var;
extern int transmission_mode;
-extern double cpuf;
extern int numerology;
extern int usrp_tx_thread;
diff --git a/executables/lte-ue.c b/executables/lte-ue.c
index 2d7338c410..1a187ad51f 100644
--- a/executables/lte-ue.c
+++ b/executables/lte-ue.c
@@ -59,11 +59,7 @@
#include "common/config/config_userapi.h"
#include "T.h"
-extern double cpuf;
-
-
#define FRAME_PERIOD 100000000ULL
-#define DAQ_PERIOD 66667ULL
#define FIFO_PRIORITY 40
#define NB_THREAD_INST 1
typedef enum {
@@ -1686,7 +1682,8 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg)
* \param arg unused
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
*/
-void write_dummy(PHY_VARS_UE *UE, openair0_timestamp timestamp) {
+void write_dummy(PHY_VARS_UE *UE, openair0_timestamp_t timestamp)
+{
// we have to write to tell explicitly to the eNB, else it will wait for us forever
// we write the next subframe (always write in future of what we received)
//
@@ -1709,7 +1706,7 @@ void *UE_thread(void *arg) {
PHY_VARS_UE *UE = (PHY_VARS_UE *) arg;
// int tx_enabled = 0;
int dummy_rx[UE->frame_parms.nb_antennas_rx][UE->frame_parms.samples_per_tti] __attribute__((aligned(32)));
- openair0_timestamp timestamp,timestamp1;
+ openair0_timestamp_t timestamp, timestamp1;
void *rxp[NB_ANTENNAS_RX], *txp[NB_ANTENNAS_TX];
int start_rx_stream = 0;
int i;
diff --git a/executables/lte-uesoftmodem.c b/executables/lte-uesoftmodem.c
index fc741ec300..322fecae98 100644
--- a/executables/lte-uesoftmodem.c
+++ b/executables/lte-uesoftmodem.c
@@ -343,28 +343,23 @@ static void init_openair0(LTE_DL_FRAME_PARMS *frame_parms, int rxgain)
if(frame_parms->N_RB_DL == 100) {
if (frame_parms->threequarter_fs) {
openair0_cfg[card].sample_rate=23.04e6;
- openair0_cfg[card].samples_per_frame = 230400;
openair0_cfg[card].tx_bw = 10e6;
openair0_cfg[card].rx_bw = 10e6;
} else {
openair0_cfg[card].sample_rate=30.72e6;
- openair0_cfg[card].samples_per_frame = 307200;
openair0_cfg[card].tx_bw = 10e6;
openair0_cfg[card].rx_bw = 10e6;
}
} else if(frame_parms->N_RB_DL == 50) {
openair0_cfg[card].sample_rate=15.36e6;
- openair0_cfg[card].samples_per_frame = 153600;
openair0_cfg[card].tx_bw = 5e6;
openair0_cfg[card].rx_bw = 5e6;
} else if (frame_parms->N_RB_DL == 25) {
openair0_cfg[card].sample_rate=7.68e6;
- openair0_cfg[card].samples_per_frame = 76800;
openair0_cfg[card].tx_bw = 2.5e6;
openair0_cfg[card].rx_bw = 2.5e6;
} else if (frame_parms->N_RB_DL == 6) {
openair0_cfg[card].sample_rate=1.92e6;
- openair0_cfg[card].samples_per_frame = 19200;
openair0_cfg[card].tx_bw = 1.5e6;
openair0_cfg[card].rx_bw = 1.5e6;
}
@@ -374,7 +369,6 @@ static void init_openair0(LTE_DL_FRAME_PARMS *frame_parms, int rxgain)
else //FDD
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
- openair0_cfg[card].Mod_id = 0;
openair0_cfg[card].num_rb_dl=frame_parms->N_RB_DL;
openair0_cfg[card].clock_source = get_softmodem_params()->clock_source;
openair0_cfg[card].time_source = get_softmodem_params()->timing_source;
diff --git a/executables/main_nr_ru.c b/executables/main_nr_ru.c
new file mode 100644
index 0000000000..d8f2a02235
--- /dev/null
+++ b/executables/main_nr_ru.c
@@ -0,0 +1,220 @@
+/*
+ * 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
+#include "assertions.h"
+#include "PHY/types.h"
+#include "PHY/defs_RU.h"
+#include "common/oai_version.h"
+#include "common/config/config_userapi.h"
+#include "common/utils/load_module_shlib.h"
+#include "common/ran_context.h"
+#include "radio/COMMON/common_lib.h"
+#include "radio/ETHERNET/if_defs.h"
+#include "PHY/phy_vars.h"
+#include "PHY/phy_extern.h"
+#include "PHY/TOOLS/phy_scope_interface.h"
+#include "common/utils/LOG/log.h"
+#include "common/utils/LOG/vcd_signal_dumper.h"
+// #include "PHY/INIT/phy_init.h"
+#include "openair2/ENB_APP/enb_paramdef.h"
+#include "system.h"
+#include "nfapi/oai_integration/vendor_ext.h"
+#include
+#include
+
+pthread_cond_t sync_cond;
+pthread_mutex_t sync_mutex;
+int sync_var = -1; //!< protected by mutex \ref sync_mutex.
+int config_sync_var = -1;
+
+int oai_exit = 0;
+int sf_ahead = 4;
+int emulate_rf = 0;
+
+RAN_CONTEXT_t RC;
+
+extern void kill_NR_RU_proc(int inst);
+extern void set_function_spec_param(RU_t *ru);
+extern void start_NR_RU();
+extern void init_NR_RU(configmodule_interface_t *cfg, char *);
+
+int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
+
+void nfapi_setmode(nfapi_mode_t nfapi_mode)
+{
+ return;
+}
+void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
+{
+ if (s != NULL) {
+ printf("%s:%d %s() Exiting OAI softmodem: %s\n", file, line, function, s);
+ }
+ close_log_mem();
+ oai_exit = 1;
+ RU_t *ru = RC.ru[0];
+
+ if (ru->rfdevice.trx_end_func) {
+ ru->rfdevice.trx_end_func(&ru->rfdevice);
+ ru->rfdevice.trx_end_func = NULL;
+ }
+
+ if (ru->ifdevice.trx_end_func) {
+ ru->ifdevice.trx_end_func(&ru->ifdevice);
+ ru->ifdevice.trx_end_func = NULL;
+ }
+
+ pthread_mutex_destroy(ru->ru_mutex);
+ pthread_cond_destroy(ru->ru_cond);
+ if (assert) {
+ abort();
+ } else {
+ sleep(1); // allow lte-softmodem threads to exit first
+ exit(EXIT_SUCCESS);
+ }
+}
+
+static void get_options(configmodule_interface_t *cfg)
+{
+ CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
+ get_common_options(cfg);
+ CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
+
+ // NRCConfig();
+}
+
+nfapi_mode_t nfapi_getmode(void)
+{
+ return (NFAPI_MODE_PNF);
+}
+
+void oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind)
+{
+ AssertFatal(1 == 0, "This is bad ... please check why we get here\n");
+}
+
+void wait_eNBs(void)
+{
+ return;
+}
+void wait_gNBs(void)
+{
+ return;
+}
+
+struct timespec timespec_add(struct timespec, struct timespec)
+{
+ struct timespec t = {0};
+ return t;
+};
+struct timespec timespec_sub(struct timespec, struct timespec)
+{
+ struct timespec t = {0};
+ return t;
+};
+
+void perform_symbol_rotation(NR_DL_FRAME_PARMS *fp, double f0, c16_t *symbol_rotation)
+{
+ return;
+}
+void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp)
+{
+ return;
+};
+int beam_index_allocation(bool das,
+ int fapi_beam_index,
+ NR_gNB_COMMON *common_vars,
+ int slot,
+ int symbols_per_slot,
+ int bitmap_symbols)
+{
+ return 0;
+}
+void nr_fill_du(uint16_t N_ZC, const uint16_t *prach_root_sequence_map, uint16_t nr_du[NR_PRACH_SEQ_LEN_L - 1])
+{
+ return;
+};
+uint16_t nr_du[838];
+
+uint64_t downlink_frequency[MAX_NUM_CCs][4];
+
+configmodule_interface_t *uniqCfg = NULL;
+THREAD_STRUCT thread_struct;
+
+int main(int argc, char **argv)
+{
+ memset(&RC, 0, sizeof(RC));
+ if ((uniqCfg = load_configmodule(argc, argv, 0)) == NULL) {
+ exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
+ }
+
+ logInit();
+ LOG_W(PHY, "%s is experimental software and at this point is not an implementation of a 7.2 O-RAN RU\n", argv[0]);
+ printf("Reading in command-line options\n");
+ get_options(uniqCfg);
+
+ if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
+ fprintf(stderr, "Getting configuration failed\n");
+ exit(-1);
+ }
+
+#if T_TRACER
+ T_Config_Init();
+#endif
+ printf("configuring for RRU\n");
+ // strdup to put the sring in the core file for post mortem identification
+ LOG_I(HW, "Version: %s\n", strdup(OAI_PACKAGE_VERSION));
+
+ /* Read configuration */
+
+ printf("About to Init RU threads\n");
+
+ lock_memory_to_ram();
+
+ RC.nb_RU = 1;
+ RC.ru = malloc(sizeof(RC.ru));
+
+ init_NR_RU(config_get_if(), NULL);
+
+ RU_t *ru = RC.ru[0];
+
+ while (oai_exit == 0)
+ sleep(1);
+ // stop threads
+
+ kill_NR_RU_proc(0);
+
+ end_configmodule(uniqCfg);
+
+ if (ru->rfdevice.trx_end_func) {
+ ru->rfdevice.trx_end_func(&ru->rfdevice);
+ ru->rfdevice.trx_end_func = NULL;
+ }
+
+ if (ru->ifdevice.trx_end_func) {
+ ru->ifdevice.trx_end_func(&ru->ifdevice);
+ ru->ifdevice.trx_end_func = NULL;
+ }
+
+ logClean();
+ printf("Bye.\n");
+ return 0;
+}
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index 7d96eb6772..f8d44ff4c0 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -570,10 +570,10 @@ static void rx_rf(RU_t *ru, int *frame, int *slot)
rxp[i] = (void *)&ru->common.rxdata[i][get_samples_slot_timestamp(fp, *slot)];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1);
- openair0_timestamp old_ts = proc->timestamp_rx;
+ openair0_timestamp_t old_ts = proc->timestamp_rx;
LOG_D(PHY,"Reading %d samples for slot %d (%p)\n", samples_per_slot, *slot, rxp[0]);
- openair0_timestamp ts;
+ openair0_timestamp_t ts;
unsigned int rxs;
rxs = ru->rfdevice.trx_read_func(&ru->rfdevice, &ts, rxp, samples_per_slot, nb);
@@ -819,7 +819,6 @@ static void fill_rf_config(RU_t *ru, char *rf_config_file)
N_RB,
fp->threequarter_fs,
&cfg->sample_rate,
- &cfg->samples_per_frame,
&cfg->tx_bw,
&cfg->rx_bw);
@@ -833,7 +832,6 @@ static void fill_rf_config(RU_t *ru, char *rf_config_file)
AssertFatal(ru->nb_tx > 0 && ru->nb_tx <= 8, "openair0 does not support more than 8 antennas\n");
AssertFatal(ru->nb_rx > 0 && ru->nb_rx <= 8, "openair0 does not support more than 8 antennas\n");
- cfg->Mod_id = 0;
cfg->num_rb_dl = N_RB;
cfg->tx_num_channels = ru->nb_tx * ru->num_beams_period;
cfg->rx_num_channels = ru->nb_rx * ru->num_beams_period;
@@ -1555,8 +1553,13 @@ void init_NR_RU(configmodule_interface_t *cfg, char *rf_config_file)
}
}
- PHY_VARS_gNB *gNB_RC = RC.gNB[0];
- PHY_VARS_gNB *gNB0 = ru->gNB_list[0];
+
+ PHY_VARS_gNB *gNB_RC = NULL;
+ PHY_VARS_gNB *gNB0 = NULL;
+ if (RC.nb_nr_L1_inst > 0) {
+ gNB_RC = RC.gNB[0];
+ gNB0 = ru->gNB_list[0];
+ }
LOG_D(PHY, "RU FUnction:%d ru->if_south:%d\n", ru->function, ru->if_south);
if (gNB0) {
diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h
index 8541135bb6..bcbd138128 100644
--- a/executables/nr-softmodem-common.h
+++ b/executables/nr-softmodem-common.h
@@ -29,110 +29,31 @@
#include "PHY/types.h"
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
-#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
-#define CONFIG_HLP_ULMAXE "set the eNodeB max ULSCH erros\n"
-#define CONFIG_HLP_CALUER "set UE RX calibration\n"
-#define CONFIG_HLP_CALUERM ""
-#define CONFIG_HLP_CALUERB ""
-#define CONFIG_HLP_DBGUEPR "UE run normal prach power ramping, but don't continue random-access\n"
-#define CONFIG_HLP_CALPRACH "UE run normal prach with maximum power, but don't continue random-access\n"
-#define CONFIG_HLP_NOL2CN "bypass L2 and upper layers\n"
+#define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n"
+#define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n"
+#define CONFIG_HLP_ULNL_PHYTEST "Set the uplink nrOfLayers for PHYTEST mode\n"
+#define CONFIG_HLP_DLBW_PHYTEST "Set the number of PRBs used for DLSCH in PHYTEST mode\n"
+#define CONFIG_HLP_ULBW_PHYTEST "Set the number of PRBs used for ULSCH in PHYTEST mode\n"
+#define CONFIG_HLP_UECAP_FILE "path for UE Capabilities file\n"
+#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
+#define CONFIG_HLP_TX_SUBDEV "set the arguments to select tx_subdev (same syntax as in UHD)\n"
+#define CONFIG_HLP_RX_SUBDEV "set the arguments to select rx_subdev (same syntax as in UHD)\n"
+#define CONFIG_HLP_VCD "Enable VCD (generated file will is named openair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n"
+#define CONFIG_HLP_RE_CFG_FILE "filename for reconfig.raw in phy-test mode\n"
+#define CONFIG_HLP_RB_CFG_FILE "filename for rbconfig.raw in phy-test mode\n"
#define CONFIG_HLP_UERXG "set UE RX gain\n"
-#define CONFIG_HLP_UERXGOFF "external UE amplifier offset\n"
#define CONFIG_HLP_UETXG "set UE TX gain\n"
#define CONFIG_HLP_UENANTR "set UE number of rx antennas\n"
#define CONFIG_HLP_UENANTT "set UE number of tx antennas\n"
#define CONFIG_HLP_UESCAN "set UE to scan all possible GSCN in current bandwidth\n"
#define CONFIG_HLP_UEFO "set UE to enable estimation and compensation of frequency offset\n"
-#define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n"
-#define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n"
-#define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n"
-#define CONFIG_HLP_DMAMAP "use DMA memory mapping\n"
-#define CONFIG_HLP_EXCCLK "tells hardware to use a clock reference (0:internal(default), 1:external, 2:gpsdo)\n"
-#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n"
-#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n"
-#define CONFIG_HLP_ULOFF "Set the uplink frequnecy offset for all component carriers\n"
-#define CONFIG_HLP_CHOFF "Channel id offset\n"
-#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n"
-#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
-#define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n"
-#define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n"
-#define CONFIG_HLP_ULNL_PHYTEST "Set the uplink nrOfLayers for PHYTEST mode\n"
-#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
-#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
+#define CONFIG_HLP_PRB_SA "Set the number of PRBs for SA\n"
+#define CONFIG_HLP_SSC "Set the start subcarrier \n"
+#define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n"
#define CONFIG_HLP_ULMCS_PHYTEST "Set the uplink MCS for PHYTEST mode\n"
#define CONFIG_HLP_DLBW_PHYTEST "Set the number of PRBs used for DLSCH in PHYTEST mode\n"
#define CONFIG_HLP_ULBW_PHYTEST "Set the number of PRBs used for ULSCH in PHYTEST mode\n"
-#define CONFIG_HLP_PRB_SA "Set the number of PRBs for SA\n"
#define CONFIG_HLP_DLBM_PHYTEST "Bitmap for DLSCH slots in period (slot 0 starts at LSB)\n"
#define CONFIG_HLP_ULBM_PHYTEST "Bitmap for ULSCH slots in period (slot 0 starts at LSB)\n"
-#define CONFIG_HLP_SSC "Set the start subcarrier \n"
-#define CONFIG_HLP_TDD "Set hardware to TDD mode (default: FDD). Used only with -U (otherwise set in config file).\n"
-#define CONFIG_HLP_UE "Set the lte softmodem as a UE\n"
-#define CONFIG_HLP_L2MONW "Enable L2 wireshark messages on localhost \n"
-#define CONFIG_HLP_L2MONP "Enable L2 pcap messages on localhost \n"
-#define CONFIG_HLP_MAC "Disable the MAC procedures at UE side (default is enabled)\n"
-#define CONFIG_HLP_VCD "Enable VCD (generated file will is named openair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n"
-#define CONFIG_HLP_TPORT "tracer port\n"
-#define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n"
-#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
-#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
-#define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n"
-#define CONFIG_HLP_RE_CFG_FILE "filename for reconfig.raw in phy-test mode\n"
-#define CONFIG_HLP_RB_CFG_FILE "filename for rbconfig.raw in phy-test mode\n"
-#define CONFIG_HLP_UECAP_FILE "path for UE Capabilities file\n"
-
-#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n"
-#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
-#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
-#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
-#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
-#define CONFIG_HLP_TX_SUBDEV "set the arguments to select tx_subdev (same syntax as in UHD)\n"
-#define CONFIG_HLP_RX_SUBDEV "set the arguments to select rx_subdev (same syntax as in UHD)\n"
-
-#define CONFIG_HLP_FLOG "Enable online log \n"
-#define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n"
-#define CONFIG_HLP_LOGV "Set the global log verbosity \n"
-#define CONFIG_HLP_TELN "Start embedded telnet server \n"
-#define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n"
-#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
-
-/*--------------------------------------------------------------------------------------------------------------------------------*/
-/* command line parameters for LOG utility */
-/* optname helpstr paramflags XXXptr defXXXval type numelt */
-/*--------------------------------------------------------------------------------------------------------------------------------*/
-#define CMDLINE_LOGPARAMS_DESC_NR { \
- {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \
- {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \
- {"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \
- {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \
- }
-
-#define CMDLINE_ONLINELOG_IDX 0
-#define CMDLINE_GLOGLEVEL_IDX 1
-#define CMDLINE_GLOGVERBO_IDX 2
-#define CMDLINE_STARTTELN_IDX 3
-
-/***************************************************************************************************************************************/
-
-
-extern pthread_cond_t sync_cond;
-extern pthread_mutex_t sync_mutex;
-extern int sync_var;
-
-
-extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
-extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
-
-extern int oai_exit;
-
-extern pthread_cond_t sync_cond;
-extern pthread_mutex_t sync_mutex;
-extern int sync_var;
-extern int transmission_mode;
-extern double cpuf;
-
-extern int numerology;
-extern int usrp_tx_thread;
void wait_gNBs(void);
#endif
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index e632180782..479aec465f 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -114,9 +114,6 @@ double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0},{20,0,0,0}};
double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0},{20,0,0,0}};
#endif
-double rx_gain_off = 0.0;
-
-static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/;
int chain_offset = 0;
int numerology = 0;
double cpuf;
@@ -527,7 +524,6 @@ int main( int argc, char **argv ) {
setvbuf(stderr, NULL, _IONBF, 0);
#endif
mode = normal_txrx;
- memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
logInit();
lock_memory_to_ram();
get_options(uniqCfg);
diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h
index ecbf5d8759..08bee0d2d8 100644
--- a/executables/nr-softmodem.h
+++ b/executables/nr-softmodem.h
@@ -23,8 +23,8 @@
{"t" , CONFIG_HLP_ULMCS_PHYTEST, 0, .uptr=&target_ul_mcs, .defintval=0, TYPE_UINT, 0}, \
{"M" , CONFIG_HLP_DLBW_PHYTEST, 0, .uptr=&target_dl_bw, .defintval=0, TYPE_UINT, 0}, \
{"T" , CONFIG_HLP_ULBW_PHYTEST, 0, .uptr=&target_ul_bw, .defintval=0, TYPE_UINT, 0}, \
- {"D" , CONFIG_HLP_DLBM_PHYTEST, 0, .u64ptr=&dlsch_slot_bitmap, .defintval=0, TYPE_UINT64, 0}, \
- {"U" , CONFIG_HLP_ULBM_PHYTEST, 0, .u64ptr=&ulsch_slot_bitmap, .defintval=0, TYPE_UINT64, 0}, \
+ {"D" , CONFIG_HLP_DLBM_PHYTEST, 0, .u64ptr=&dlsch_slot_bitmap, .defint64val=0, TYPE_UINT64, 0}, \
+ {"U" , CONFIG_HLP_ULBM_PHYTEST, 0, .u64ptr=&ulsch_slot_bitmap, .defint64val=0, TYPE_UINT64, 0}, \
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, .iptr=&usrp_tx_thread, .defstrval=0, TYPE_INT, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, .strptr=&uecap_file, .defstrval="./uecap_ports1.xml", TYPE_STRING, 0}, \
}
diff --git a/executables/nr-ue-ru.c b/executables/nr-ue-ru.c
new file mode 100644
index 0000000000..7235ae5c9f
--- /dev/null
+++ b/executables/nr-ue-ru.c
@@ -0,0 +1,526 @@
+/*
+ * 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.0 (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 "nr-ue-ru.h"
+#include "nr-uesoftmodem.h"
+#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
+
+/* NR UE RU configuration section name */
+#define CONFIG_STRING_NRUE_RU_LIST "RUs"
+
+#define NRUE_RU_NB_TX "nb_tx"
+#define NRUE_RU_NB_RX "nb_rx"
+#define NRUE_RU_ATT_TX "att_tx"
+#define NRUE_RU_ATT_RX "att_rx"
+#define NRUE_RU_MAX_RXGAIN "max_rxgain"
+#define NRUE_RU_SDR_ADDRS "sdr_addrs"
+#define NRUE_RU_TX_SUBDEV "tx_subdev"
+#define NRUE_RU_RX_SUBDEV "rx_subdev"
+#define NRUE_RU_CLOCK_SRC "clock_src"
+#define NRUE_RU_TIME_SRC "time_src"
+#define NRUE_RU_TUNE_OFFSET "tune_offset"
+#define NRUE_RU_IF_FREQUENCY "if_freq"
+#define NRUE_RU_IF_FREQ_OFFSET "if_offset"
+
+#define NRUE_RU_SRC_CHECK \
+ &(checkedparam_t) \
+ { \
+ .s3a = { config_checkstr_assign_integer, {"internal", "external", "gpsdo"}, {internal, external, gpsdo}, 3 } \
+ }
+
+/*------------------------------------------------------------------------------------------------------------------------------------------------*/
+/* NR UE RU configuration parameters */
+/* optname helpstr paramflags XXXptr defXXXval type numelt chkPptr */
+/*------------------------------------------------------------------------------------------------------------------------------------------------*/
+// clang-format off
+#define NRUE_RU_PARAMS_DESC { \
+ {NRUE_RU_NB_TX, CONFIG_HLP_UENANTT, 0, .uptr=NULL, .defuintval=1, TYPE_UINT, 0, NULL }, \
+ {NRUE_RU_NB_RX, CONFIG_HLP_UENANTR, 0, .uptr=NULL, .defuintval=1, TYPE_UINT, 0, NULL }, \
+ {NRUE_RU_ATT_TX, NULL, 0, .uptr=NULL, .defuintval=0, TYPE_UINT, 0, NULL }, \
+ {NRUE_RU_ATT_RX, NULL, 0, .uptr=NULL, .defuintval=0, TYPE_UINT, 0, NULL }, \
+ {NRUE_RU_MAX_RXGAIN, NULL, 0, .iptr=NULL, .defintval=120, TYPE_INT, 0, NULL }, \
+ {NRUE_RU_SDR_ADDRS, CONFIG_HLP_USRP_ARGS, 0, .strptr=NULL, .defstrval="type=b200", TYPE_STRING, 0, NULL }, \
+ {NRUE_RU_TX_SUBDEV, CONFIG_HLP_TX_SUBDEV, 0, .strptr=NULL, .defstrval="", TYPE_STRING, 0, NULL }, \
+ {NRUE_RU_RX_SUBDEV, CONFIG_HLP_RX_SUBDEV, 0, .strptr=NULL, .defstrval="", TYPE_STRING, 0, NULL }, \
+ {NRUE_RU_CLOCK_SRC, NULL, 0, .strptr=NULL, .defstrval="internal", TYPE_STRING, 0, NRUE_RU_SRC_CHECK }, \
+ {NRUE_RU_TIME_SRC, NULL, 0, .strptr=NULL, .defstrval="internal", TYPE_STRING, 0, NRUE_RU_SRC_CHECK }, \
+ {NRUE_RU_TUNE_OFFSET, CONFIG_HLP_TUNE_OFFSET, 0, .dblptr=NULL, .defdblval=0.0, TYPE_DOUBLE, 0, NULL }, \
+ {NRUE_RU_IF_FREQUENCY, CONFIG_HLP_IF_FREQ, 0, .u64ptr=NULL, .defint64val=0, TYPE_UINT64, 0, NULL }, \
+ {NRUE_RU_IF_FREQ_OFFSET, CONFIG_HLP_IF_FREQ_OFF, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0, NULL }, \
+}
+// clang-format on
+
+/* NR UE cell configuration section name */
+#define CONFIG_STRING_NRUE_CELL_LIST "cells"
+
+#define NRUE_CELL_RU_ID "ru_id"
+#define NRUE_CELL_BAND "band"
+#define NRUE_CELL_RF_FREQUENCY "rf_freq"
+#define NRUE_CELL_RF_FREQ_OFFSET "rf_offset"
+#define NRUE_CELL_NUMEROLOGY "numerology"
+#define NRUE_CELL_N_RB_DL "N_RB_DL"
+#define NRUE_CELL_SSB_START "ssb_start"
+
+/*------------------------------------------------------------------------------------------------------------------------------------------------*/
+/* NR UE cell configuration parameters */
+/* optname helpstr paramflags XXXptr defXXXval type numelt chkPptr */
+/*------------------------------------------------------------------------------------------------------------------------------------------------*/
+// clang-format off
+#define NRUE_CELL_PARAMS_DESC { \
+ {NRUE_CELL_RU_ID, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0, NULL }, \
+ {NRUE_CELL_BAND, CONFIG_HLP_BAND, 0, .iptr=NULL, .defintval=78, TYPE_INT, 0, NULL }, \
+ {NRUE_CELL_RF_FREQUENCY, CONFIG_HLP_DLF, 0, .u64ptr=NULL, .defint64val=0, TYPE_UINT64, 0, NULL }, \
+ {NRUE_CELL_RF_FREQ_OFFSET, CONFIG_HLP_ULF, 0, .i64ptr=NULL, .defint64val=0, TYPE_INT64, 0, NULL }, \
+ {NRUE_CELL_NUMEROLOGY, CONFIG_HLP_NUMEROLOGY, 0, .iptr=NULL, .defintval=1, TYPE_INT, 0, NULL }, \
+ {NRUE_CELL_N_RB_DL, CONFIG_HLP_PRB_SA, 0, .iptr=NULL, .defintval=106, TYPE_INT, 0, NULL }, \
+ {NRUE_CELL_SSB_START, CONFIG_HLP_SSC, 0, .iptr=NULL, .defintval=516, TYPE_INT, 0, NULL }, \
+}
+// clang-format on
+
+static int nrue_cell_count;
+static nrUE_cell_params_t *nrue_cells;
+static NR_DL_FRAME_PARMS *nrue_cell_fp;
+
+static int nrue_ru_count;
+static nrUE_RU_params_t *nrue_rus;
+
+openair0_config_t openair0_cfg[MAX_CARDS];
+openair0_device_t openair0_dev[MAX_CARDS];
+
+int nrue_get_cell_count(void)
+{
+ return nrue_cell_count;
+}
+
+const nrUE_cell_params_t *nrue_get_cell(int cell_id)
+{
+ AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
+ return &nrue_cells[cell_id];
+}
+
+NR_DL_FRAME_PARMS *nrue_get_cell_fp(int cell_id)
+{
+ AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
+ return &nrue_cell_fp[cell_id];
+}
+
+void nrue_set_cell(int cell_id, const nrUE_cell_params_t *cell)
+{
+ AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
+ nrue_cells[cell_id] = *cell;
+}
+
+void nrue_set_cell_params(configmodule_interface_t *cfg)
+{
+ paramdef_t cellParams[] = NRUE_CELL_PARAMS_DESC;
+ paramlist_def_t cellParamList = {CONFIG_STRING_NRUE_CELL_LIST, NULL, 0};
+ config_getlist(cfg, &cellParamList, cellParams, sizeofArray(cellParams), NULL);
+
+ if (cellParamList.numelt <= 0) {
+ nrue_cell_count = 1;
+ nrue_cell_fp = calloc_or_fail(nrue_cell_count, sizeof(NR_DL_FRAME_PARMS));
+ nrue_cells = calloc_or_fail(nrue_cell_count, sizeof(nrUE_cell_params_t));
+ nrue_cells[0] = (nrUE_cell_params_t){.ru_id = 0,
+ .band = get_softmodem_params()->band,
+ .rf_frequency = downlink_frequency[0][0],
+ .rf_freq_offset = uplink_frequency_offset[0][0],
+ .numerology = get_softmodem_params()->numerology,
+ .N_RB_DL = get_nrUE_params()->N_RB_DL,
+ .ssb_start = get_nrUE_params()->ssb_start_subcarrier,
+ .used_by_ue = -1};
+ return;
+ }
+
+ nrue_cell_count = cellParamList.numelt;
+ nrue_cell_fp = calloc_or_fail(nrue_cell_count, sizeof(NR_DL_FRAME_PARMS));
+ nrue_cells = calloc_or_fail(nrue_cell_count, sizeof(nrUE_cell_params_t));
+
+ LOG_W(NR_PHY, "Ignoring command line cell parameters, using the following instead:\n");
+
+ for (int cell_id = 0; cell_id < nrue_cell_count; cell_id++) {
+ nrue_cells[cell_id].ru_id = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_RU_ID)->iptr);
+ nrue_cells[cell_id].band = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_BAND)->iptr);
+ nrue_cells[cell_id].rf_frequency = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_RF_FREQUENCY)->u64ptr);
+ nrue_cells[cell_id].rf_freq_offset = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_RF_FREQ_OFFSET)->i64ptr);
+ nrue_cells[cell_id].numerology = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_NUMEROLOGY)->iptr);
+ nrue_cells[cell_id].N_RB_DL = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_N_RB_DL)->iptr);
+ nrue_cells[cell_id].ssb_start = *(gpd(cellParamList.paramarray[cell_id], sizeofArray(cellParams), NRUE_CELL_SSB_START)->iptr);
+ nrue_cells[cell_id].used_by_ue = -1;
+
+ LOG_I(NR_PHY,
+ "cell %d: ru_id %d, band %d, DL freq %lu, UL freq_offset %ld, numerology %d, N_RB_DL %d, ssb_start %d\n",
+ cell_id,
+ nrue_cells[cell_id].ru_id,
+ nrue_cells[cell_id].band,
+ nrue_cells[cell_id].rf_frequency,
+ nrue_cells[cell_id].rf_freq_offset,
+ nrue_cells[cell_id].numerology,
+ nrue_cells[cell_id].N_RB_DL,
+ nrue_cells[cell_id].ssb_start);
+ }
+}
+
+int nrue_get_ru_count(void)
+{
+ return nrue_ru_count;
+}
+
+const nrUE_RU_params_t *nrue_get_ru(int ru_id)
+{
+ AssertFatal(ru_id >= 0 && ru_id < nrue_ru_count, "Invalid RU ID %d! RU count = %d\n", ru_id, nrue_ru_count);
+ return &nrue_rus[ru_id];
+}
+
+void nrue_set_ru_cell_id(int ru_id, int cell_id)
+{
+ AssertFatal(ru_id >= 0 && ru_id < nrue_ru_count, "Invalid RU ID %d! RU count = %d\n", ru_id, nrue_ru_count);
+ AssertFatal(cell_id >= 0 && cell_id < nrue_cell_count, "Invalid cell ID %d! Cell count = %d\n", cell_id, nrue_cell_count);
+ nrue_rus[ru_id].used_by_cell = cell_id;
+}
+
+void nrue_set_ru_params(configmodule_interface_t *cfg)
+{
+ paramdef_t RUParams[] = NRUE_RU_PARAMS_DESC;
+ paramlist_def_t RUParamList = {CONFIG_STRING_NRUE_RU_LIST, NULL, 0};
+ config_getlist(cfg, &RUParamList, RUParams, sizeofArray(RUParams), NULL);
+
+ if (RUParamList.numelt <= 0) {
+ nrue_ru_count = 1;
+ nrue_rus = calloc_or_fail(nrue_ru_count, sizeof(nrUE_RU_params_t));
+ nrue_rus[0] = (nrUE_RU_params_t){.nb_tx = get_nrUE_params()->nb_antennas_tx,
+ .nb_rx = get_nrUE_params()->nb_antennas_rx,
+ .att_tx = get_nrUE_params()->tx_gain,
+ .att_rx = 0,
+ .max_rxgain = get_nrUE_params()->rx_gain,
+ .sdr_addrs = get_nrUE_params()->usrp_args,
+ .tx_subdev = get_nrUE_params()->tx_subdev,
+ .rx_subdev = get_nrUE_params()->rx_subdev,
+ .clock_source = get_softmodem_params()->clock_source,
+ .time_source = get_softmodem_params()->timing_source,
+ .tune_offset = get_softmodem_params()->tune_offset,
+ .if_frequency = get_nrUE_params()->if_freq,
+ .if_freq_offset = get_nrUE_params()->if_freq_off,
+ .used_by_cell = -1};
+ return;
+ }
+
+ nrue_ru_count = RUParamList.numelt;
+ nrue_rus = calloc_or_fail(nrue_ru_count, sizeof(nrUE_RU_params_t));
+
+ LOG_W(NR_PHY, "Ignoring command line RU parameters, using the following instead:\n");
+
+ for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
+ nrue_rus[ru_id].nb_tx = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_NB_TX)->uptr);
+ nrue_rus[ru_id].nb_rx = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_NB_RX)->uptr);
+ nrue_rus[ru_id].att_tx = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_ATT_TX)->uptr);
+ nrue_rus[ru_id].att_rx = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_ATT_RX)->uptr);
+ nrue_rus[ru_id].max_rxgain = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_MAX_RXGAIN)->iptr);
+ nrue_rus[ru_id].tune_offset = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_TUNE_OFFSET)->dblptr);
+ nrue_rus[ru_id].if_frequency = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_IF_FREQUENCY)->u64ptr);
+ nrue_rus[ru_id].if_freq_offset = *(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_IF_FREQ_OFFSET)->iptr);
+ nrue_rus[ru_id].used_by_cell = -1;
+
+ nrue_rus[ru_id].sdr_addrs = strdup(*(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_SDR_ADDRS)->strptr));
+ nrue_rus[ru_id].tx_subdev = strdup(*(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_TX_SUBDEV)->strptr));
+ nrue_rus[ru_id].rx_subdev = strdup(*(gpd(RUParamList.paramarray[ru_id], sizeofArray(RUParams), NRUE_RU_RX_SUBDEV)->strptr));
+
+ int clock_src_idx = config_paramidx_fromname(RUParams, sizeofArray(RUParams), NRUE_RU_CLOCK_SRC);
+ AssertFatal(clock_src_idx >= 0, "Index for clock_src config option not found!\n");
+ nrue_rus[ru_id].clock_source = config_get_processedint(cfg, &RUParamList.paramarray[ru_id][clock_src_idx]);
+
+ int time_src_idx = config_paramidx_fromname(RUParams, sizeofArray(RUParams), NRUE_RU_TIME_SRC);
+ AssertFatal(time_src_idx >= 0, "Index for time_src config option not found!\n");
+ nrue_rus[ru_id].time_source = config_get_processedint(cfg, &RUParamList.paramarray[ru_id][time_src_idx]);
+
+ LOG_I(NR_PHY,
+ "RU %d: nb_tx %d, nb_rx %d, att_tx %d, att_rx %d, max_rxgain %d, tune_offset %f, if_frequency %lu, if_freq_offset %d, "
+ "sdr_addrs \"%s\", tx_subdev \"%s\", rx_subdev \"%s\", clock_source %d, time_source %d\n",
+ ru_id,
+ nrue_rus[ru_id].nb_tx,
+ nrue_rus[ru_id].nb_rx,
+ nrue_rus[ru_id].att_tx,
+ nrue_rus[ru_id].att_rx,
+ nrue_rus[ru_id].max_rxgain,
+ nrue_rus[ru_id].tune_offset,
+ nrue_rus[ru_id].if_frequency,
+ nrue_rus[ru_id].if_freq_offset,
+ nrue_rus[ru_id].sdr_addrs,
+ nrue_rus[ru_id].tx_subdev,
+ nrue_rus[ru_id].rx_subdev,
+ nrue_rus[ru_id].clock_source,
+ nrue_rus[ru_id].time_source);
+ }
+}
+
+void nrue_init_openair0(void)
+{
+ int freq_off = 0;
+ bool is_sidelink = (get_softmodem_params()->sl_mode) ? true : false;
+
+ memset(openair0_cfg, 0, sizeof(openair0_config_t) * MAX_CARDS);
+ memset(openair0_dev, 0, sizeof(openair0_device_t) * MAX_CARDS);
+
+ AssertFatal(MAX_CARDS >= nrue_ru_count,
+ "Too many RUs allocated (%d)! Maybe increase MAX_CARDS (%d).\n",
+ nrue_ru_count,
+ MAX_CARDS);
+
+ for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
+ int cell_id = nrue_rus[ru_id].used_by_cell;
+ if (cell_id < 0) {
+ LOG_W(PHY, "Skipping initialization of RU %d because it is not used by any cell!\n", ru_id);
+ continue;
+ }
+ NR_DL_FRAME_PARMS *frame_parms = &nrue_cell_fp[cell_id];
+ if (is_sidelink) {
+ int UE_id = nrue_cells[cell_id].used_by_ue;
+ if (UE_id < 0) {
+ LOG_W(PHY, "Skipping initialization of RU %d because it is not used by any UE!\n", ru_id);
+ continue;
+ }
+ extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
+ frame_parms = &PHY_vars_UE_g[UE_id][0]->SL_UE_PHY_PARAMS.sl_frame_params;
+ }
+
+ openair0_config_t *cfg = &openair0_cfg[ru_id];
+ cfg->configFilename = NULL;
+ cfg->sample_rate = frame_parms->samples_per_subframe * 1e3;
+
+ if (frame_parms->frame_type == TDD)
+ cfg->duplex_mode = duplex_mode_TDD;
+ else
+ cfg->duplex_mode = duplex_mode_FDD;
+
+ cfg->ru_id = ru_id;
+ cfg->num_rb_dl = frame_parms->N_RB_DL;
+ cfg->tx_num_channels = min(4, frame_parms->nb_antennas_tx);
+ cfg->rx_num_channels = min(4, frame_parms->nb_antennas_rx);
+
+ LOG_I(PHY,
+ "HW: Configuring ru_id %d, sample_rate %f, tx/rx num_channels %d/%d, duplex_mode %s\n",
+ ru_id,
+ cfg->sample_rate,
+ cfg->tx_num_channels,
+ cfg->rx_num_channels,
+ duplex_mode_txt[cfg->duplex_mode]);
+
+ uint64_t dl_carrier, ul_carrier;
+ if (is_sidelink || nrue_rus[ru_id].if_frequency == 0) {
+ dl_carrier = frame_parms->dl_CarrierFreq;
+ ul_carrier = frame_parms->ul_CarrierFreq;
+ } else {
+ dl_carrier = nrue_rus[ru_id].if_frequency;
+ ul_carrier = nrue_rus[ru_id].if_frequency + nrue_rus[ru_id].if_freq_offset;
+ }
+
+ nr_rf_card_config_freq(cfg, ul_carrier, dl_carrier, freq_off);
+ nr_rf_card_config_gain(cfg);
+
+ cfg->configFilename = get_softmodem_params()->rf_config_file;
+
+ cfg->sdr_addrs = nrue_rus[ru_id].sdr_addrs;
+ cfg->tx_subdev = nrue_rus[ru_id].tx_subdev;
+ cfg->rx_subdev = nrue_rus[ru_id].rx_subdev;
+ cfg->clock_source = nrue_rus[ru_id].clock_source;
+ cfg->time_source = nrue_rus[ru_id].time_source;
+ cfg->tune_offset = nrue_rus[ru_id].tune_offset;
+ }
+}
+
+void nrue_ru_start(void)
+{
+ for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
+ openair0_config_t *cfg0 = &openair0_cfg[ru_id];
+ openair0_device_t *dev0 = &openair0_dev[ru_id];
+
+ dev0->host_type = RAU_HOST;
+ int tmp = openair0_device_load(dev0, cfg0);
+ AssertFatal(tmp == 0, "Could not load the device %d\n", ru_id);
+ int tmp2 = dev0->trx_start_func(dev0);
+ AssertFatal(tmp2 == 0, "Could not start the device %d\n", ru_id);
+ if (usrp_tx_thread == 1)
+ dev0->trx_write_init(dev0);
+ }
+}
+
+void nrue_ru_end(void)
+{
+ for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
+ if (openair0_dev[ru_id].trx_get_stats_func)
+ openair0_dev[ru_id].trx_get_stats_func(&openair0_dev[ru_id]);
+ if (openair0_dev[ru_id].trx_end_func)
+ openair0_dev[ru_id].trx_end_func(&openair0_dev[ru_id]);
+ }
+}
+
+void nrue_ru_set_freq(PHY_VARS_NR_UE *UE, uint64_t ul_carrier, uint64_t dl_carrier, int freq_offset)
+{
+ int current_cell_id = nrue_rus[UE->rf_map.card].used_by_cell;
+ NR_DL_FRAME_PARMS *fp0 = &nrue_cell_fp[current_cell_id];
+ uint64_t dl_carrier_distance =
+ fp0->dl_CarrierFreq > dl_carrier ? fp0->dl_CarrierFreq - dl_carrier : dl_carrier - fp0->dl_CarrierFreq;
+ uint64_t ul_carrier_distance =
+ fp0->ul_CarrierFreq > ul_carrier ? fp0->ul_CarrierFreq - ul_carrier : ul_carrier - fp0->ul_CarrierFreq;
+ uint64_t carrier_distance = dl_carrier_distance + ul_carrier_distance;
+
+ for (int ru_id = 0; carrier_distance != 0 && ru_id < nrue_ru_count; ru_id++) {
+ int cell_id = nrue_rus[ru_id].used_by_cell;
+ if (cell_id < 0) // skip RUs that have no cell definition
+ continue;
+ if (nrue_cells[cell_id].used_by_ue >= 0) // skip cells that are already used by an UE
+ continue;
+
+ fp0 = &nrue_cell_fp[cell_id];
+ uint64_t this_dl_carrier_distance =
+ fp0->dl_CarrierFreq > dl_carrier ? fp0->dl_CarrierFreq - dl_carrier : dl_carrier - fp0->dl_CarrierFreq;
+ uint64_t this_ul_carrier_distance =
+ fp0->ul_CarrierFreq > ul_carrier ? fp0->ul_CarrierFreq - ul_carrier : ul_carrier - fp0->ul_CarrierFreq;
+ uint64_t this_carrier_distance = this_dl_carrier_distance + this_ul_carrier_distance;
+ if (this_carrier_distance < carrier_distance) {
+ UE->rf_map.card = ru_id;
+ carrier_distance = this_carrier_distance;
+ }
+ }
+
+ nrue_cells[current_cell_id].used_by_ue = -1;
+ current_cell_id = nrue_rus[UE->rf_map.card].used_by_cell;
+ nrue_cells[current_cell_id].used_by_ue = UE->Mod_id;
+
+ openair0_config_t *cfg0 = &openair0_cfg[UE->rf_map.card];
+ openair0_device_t *dev0 = &openair0_dev[UE->rf_map.card];
+ nr_rf_card_config_freq(cfg0, ul_carrier, dl_carrier, freq_offset);
+ dev0->trx_set_freq_func(dev0, cfg0);
+}
+
+int nrue_ru_adjust_rx_gain(PHY_VARS_NR_UE *UE, int gain_change)
+{
+ openair0_config_t *cfg0 = &openair0_cfg[UE->rf_map.card];
+ openair0_device_t *dev0 = &openair0_dev[UE->rf_map.card];
+
+ // Increase the RX gain by the value determined by adjust_rxgain
+ cfg0->rx_gain[0] += gain_change;
+
+ // Set new RX gain.
+ int ret_gain = dev0->trx_set_gains_func(dev0, cfg0);
+ // APPLY RX gain again if crossed the MAX RX gain threshold
+ if (ret_gain < 0) {
+ gain_change += ret_gain;
+ cfg0->rx_gain[0] += ret_gain;
+ ret_gain = dev0->trx_set_gains_func(dev0, cfg0);
+ }
+
+ int applied_rxgain = cfg0->rx_gain[0] - cfg0->rx_gain_offset[0];
+ LOG_I(HW, "Rxgain adjusted by %d dB, RX gain: %d dB \n", gain_change, applied_rxgain);
+
+ return gain_change;
+}
+
+int nrue_ru_read(PHY_VARS_NR_UE *UE, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int num_antennas)
+{
+ openair0_device_t *dev0 = &openair0_dev[UE->rf_map.card];
+ openair0_timestamp_t tmp_timestamp;
+ int ret = dev0->trx_read_func(dev0, &tmp_timestamp, buff, nsamps, num_antennas);
+ if (!dev0->firstTS_initialized) {
+ dev0->firstTS = tmp_timestamp;
+ dev0->firstTS_initialized = true;
+ }
+ *ptimestamp = tmp_timestamp - dev0->firstTS;
+
+ if (UE->Mod_id != 0)
+ return ret;
+
+ // UE 0 needs to read from all RUs that are not used by any other UE
+
+ void *tmp_buf[num_antennas];
+ uint32_t tmp_samples[nsamps];
+ for (int ant = 0; ant < num_antennas; ant++)
+ tmp_buf[ant] = tmp_samples;
+
+ for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
+ int cell_id = nrue_rus[ru_id].used_by_cell;
+ if (cell_id < 0) // skip RUs that have no cell definition
+ continue;
+ int ue_id = nrue_cells[cell_id].used_by_ue;
+ if (ue_id >= 0) // skip cells that are already used by an UE
+ continue;
+
+ dev0 = &openair0_dev[ru_id];
+ dev0->trx_read_func(dev0, &tmp_timestamp, tmp_buf, nsamps, num_antennas);
+ if (!dev0->firstTS_initialized) {
+ dev0->firstTS = tmp_timestamp;
+ dev0->firstTS_initialized = true;
+ }
+ }
+
+ return ret;
+}
+
+int nrue_ru_write(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **buff, int nsamps, int num_antennas, int flags)
+{
+ openair0_device_t *dev0 = &openair0_dev[UE->rf_map.card];
+ int ret = dev0->trx_write_func(dev0, timestamp + dev0->firstTS, buff, nsamps, num_antennas, flags);
+
+ if (UE->Mod_id != 0)
+ return ret;
+
+ // UE 0 needs to write to all RUs that are not used by any other UE
+
+ void *tmp_buf[num_antennas];
+ uint32_t tmp_samples[nsamps];
+ memset(tmp_samples, 0, sizeof(tmp_samples));
+ for (int ant = 0; ant < num_antennas; ant++)
+ tmp_buf[ant] = tmp_samples;
+
+ for (int ru_id = 0; ru_id < nrue_ru_count; ru_id++) {
+ int cell_id = nrue_rus[ru_id].used_by_cell;
+ if (cell_id < 0) // skip RUs that have no cell definition
+ continue;
+ int ue_id = nrue_cells[cell_id].used_by_ue;
+ if (ue_id >= 0) // skip cells that are already used by an UE
+ continue;
+
+ dev0 = &openair0_dev[ru_id];
+ dev0->trx_write_func(dev0, timestamp + dev0->firstTS, tmp_buf, nsamps, num_antennas, flags);
+ }
+ return ret;
+}
+
+typedef int (*nrue_ru_write_t)(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags);
+int openair0_write_reorder_common(nrue_ru_write_t nrue_ru_write,
+ PHY_VARS_NR_UE *UE,
+ openair0_device_t *device,
+ openair0_timestamp_t timestamp,
+ void **txp,
+ int nsamps,
+ int nbAnt,
+ int flags);
+
+int nrue_ru_write_reorder(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags)
+{
+ openair0_device_t *device = &openair0_dev[UE->rf_map.card];
+ return openair0_write_reorder_common(nrue_ru_write, UE, device, timestamp, txp, nsamps, nbAnt, flags);
+}
+
+void nrue_ru_write_reorder_clear_context(PHY_VARS_NR_UE *UE)
+{
+ openair0_device_t *device = &openair0_dev[UE->rf_map.card];
+ openair0_write_reorder_clear_context(device);
+}
diff --git a/executables/nr-ue-ru.h b/executables/nr-ue-ru.h
new file mode 100644
index 0000000000..9fe3fc3bd9
--- /dev/null
+++ b/executables/nr-ue-ru.h
@@ -0,0 +1,50 @@
+/*
+ * 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.0 (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 NR_UE_RU_H
+#define NR_UE_RU_H
+
+#include "PHY/defs_nr_UE.h"
+#include "radio/COMMON/common_lib.h"
+
+int nrue_get_cell_count(void);
+const nrUE_cell_params_t *nrue_get_cell(int cell_id);
+NR_DL_FRAME_PARMS *nrue_get_cell_fp(int cell_id);
+void nrue_set_cell(int cell_id, const nrUE_cell_params_t *cell);
+void nrue_set_cell_params(configmodule_interface_t *cfg);
+
+int nrue_get_ru_count(void);
+const nrUE_RU_params_t *nrue_get_ru(int ru_id);
+void nrue_set_ru_cell_id(int ru_id, int cell_id);
+void nrue_set_ru_params(configmodule_interface_t *cfg);
+
+void nrue_init_openair0(void);
+
+void nrue_ru_start(void);
+void nrue_ru_end(void);
+void nrue_ru_set_freq(PHY_VARS_NR_UE *UE, uint64_t ul_carrier, uint64_t dl_carrier, int freq_offset);
+int nrue_ru_adjust_rx_gain(PHY_VARS_NR_UE *UE, int gain_change);
+int nrue_ru_read(PHY_VARS_NR_UE *UE, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int num_antennas);
+int nrue_ru_write(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **buff, int nsamps, int num_antennas, int flags);
+int nrue_ru_write_reorder(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags);
+void nrue_ru_write_reorder_clear_context(PHY_VARS_NR_UE *UE);
+
+#endif
diff --git a/executables/nr-ue.c b/executables/nr-ue.c
index c920a57b88..0d1ae421f0 100644
--- a/executables/nr-ue.c
+++ b/executables/nr-ue.c
@@ -23,6 +23,7 @@
#define _GNU_SOURCE // For pthread_setname_np
#include
#include
+#include "executables/nr-ue-ru.h"
#include "executables/nr-uesoftmodem.h"
#include "PHY/INIT/nr_phy_init.h"
#include "NR_MAC_UE/mac_proto.h"
@@ -201,31 +202,10 @@ typedef struct {
int rx_offset;
} syncData_t;
-static int nr_ue_adjust_rx_gain(PHY_VARS_NR_UE *UE, openair0_config_t *cfg0, int gain_change)
-{
- // Increase the RX gain by the value determined by adjust_rxgain
- cfg0->rx_gain[0] += gain_change;
-
- // Set new RX gain.
- int ret_gain = UE->rfdevice.trx_set_gains_func(&UE->rfdevice, cfg0);
- // APPLY RX gain again if crossed the MAX RX gain threshold
- if (ret_gain < 0) {
- gain_change += ret_gain;
- cfg0->rx_gain[0] += ret_gain;
- ret_gain = UE->rfdevice.trx_set_gains_func(&UE->rfdevice, cfg0);
- }
-
- int applied_rxgain = cfg0->rx_gain[0] - cfg0->rx_gain_offset[0];
- LOG_I(PHY, "Rxgain adjusted by %d dB, RX gain: %d dB \n", gain_change, applied_rxgain);
-
- return gain_change;
-}
-
static void UE_synch(void *arg) {
syncData_t *syncD = (syncData_t *)arg;
PHY_VARS_NR_UE *UE = syncD->UE;
UE->is_synchronized = 0;
- openair0_config_t *cfg0 = &UE->openair0_cfg[UE->rf_map.card];
if (UE->target_Nid_cell != -1) {
LOG_W(NR_PHY, "Starting re-sync detection for target Nid_cell %i\n", UE->target_Nid_cell);
@@ -259,27 +239,20 @@ static void UE_synch(void *arg) {
UE->freq_offset = freq_offset - UE->dl_Doppler_shift;
} else {
// rerun with new cell parameters and frequency-offset
- nr_rf_card_config_freq(cfg0, ul_carrier, dl_carrier, freq_offset);
- UE->rfdevice.trx_set_freq_func(&UE->rfdevice, cfg0);
+ nrue_ru_set_freq(UE, ul_carrier, dl_carrier, freq_offset);
}
if (get_nrUE_params()->agc) {
- nr_ue_adjust_rx_gain(UE, cfg0, UE->adjust_rxgain);
+ nrue_ru_adjust_rx_gain(UE, UE->adjust_rxgain);
}
- LOG_I(PHY,
- "Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %f (DL %f Hz, UL %f Hz)\n",
- hw_slot_offset,
- freq_offset,
- cfg0->rx_gain[0] - cfg0->rx_gain_offset[0],
- cfg0->rx_freq[0],
- cfg0->tx_freq[0]);
+ LOG_I(PHY, "Got synch: hw_slot_offset %d, carrier off %d Hz\n", hw_slot_offset, freq_offset);
UE->is_synchronized = 1;
} else {
int gain_change = 0;
if (get_nrUE_params()->agc)
- gain_change = nr_ue_adjust_rx_gain(UE, cfg0, INCREASE_IN_RXGAIN);
+ gain_change = nrue_ru_adjust_rx_gain(UE, INCREASE_IN_RXGAIN);
if (gain_change)
LOG_I(PHY, "synch retry: Rx gain increased \n");
else
@@ -334,7 +307,7 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **tx
radio_tx_burst_flag_t flags = TX_BURST_INVALID;
if (UE->received_config_request) {
- if (UE->openair0_cfg[0].duplex_mode == duplex_mode_FDD || get_softmodem_params()->continuous_tx) {
+ if (fp->frame_type == FDD || get_softmodem_params()->continuous_tx) {
flags = TX_BURST_MIDDLE;
// In case of Sidelink, USRP write needed only in case transmission
// needs to be done in this slot and not based on tdd ULDL configuration.
@@ -379,13 +352,13 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **tx
}
}
- openair0_timestamp writeTimestamp = proc->timestamp_tx;
+ openair0_timestamp_t writeTimestamp = proc->timestamp_tx;
int writeBlockSize = rxtxD->writeBlockSize;
// if writeBlockSize gets longer that slot size, fill with dummy
const int maxWriteBlockSize = get_samples_per_slot(proc->nr_slot_tx, fp);
while (writeBlockSize > maxWriteBlockSize) {
const int dummyBlockSize = min(writeBlockSize - maxWriteBlockSize, maxWriteBlockSize);
- int tmp = openair0_write_reorder(&UE->rfdevice, writeTimestamp, (void **)txp, dummyBlockSize, fp->nb_antennas_tx, flags);
+ int tmp = nrue_ru_write_reorder(UE, writeTimestamp, (void **)txp, dummyBlockSize, fp->nb_antennas_tx, flags);
AssertFatal(tmp == dummyBlockSize, "");
writeTimestamp += dummyBlockSize;
@@ -408,7 +381,7 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action, c16_t **tx
writeBlockSize);
}
- int tmp = openair0_write_reorder(&UE->rfdevice, writeTimestamp, (void **)txp, writeBlockSize, fp->nb_antennas_tx, flags);
+ int tmp = nrue_ru_write_reorder(UE, writeTimestamp, (void **)txp, writeBlockSize, fp->nb_antennas_tx, flags);
AssertFatal(tmp == writeBlockSize, "");
}
@@ -523,10 +496,9 @@ static int handle_sync_req_from_mac(PHY_VARS_NR_UE *UE)
ul_CarrierFreq,
cfg->dl_frequency,
UE->target_Nid_cell);
+ nrue_ru_set_freq(UE, ul_CarrierFreq, dl_CarrierFreq, 0);
fp->dl_CarrierFreq = dl_CarrierFreq;
fp->ul_CarrierFreq = ul_CarrierFreq;
- nr_rf_card_config_freq(&UE->openair0_cfg[UE->rf_map.card], ul_CarrierFreq, dl_CarrierFreq, 0);
- UE->rfdevice.trx_set_freq_func(&UE->rfdevice, &UE->openair0_cfg[UE->rf_map.card]);
init_symbol_rotation(fp);
}
@@ -647,23 +619,24 @@ void UE_dl_processing(void *arg) {
TracyCZoneEnd(ctx);
}
-void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockSize) {
+void dummyWrite(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, int writeBlockSize)
+{
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
if (UE->sl_mode == 2)
fp = &UE->SL_UE_PHY_PARAMS.sl_frame_params;
void *dummy_tx[fp->nb_antennas_tx];
// 2 because the function we call use pairs of int16_t implicitly as complex numbers
- int16_t dummy_tx_data[fp->nb_antennas_tx][2 * writeBlockSize];
+ int16_t dummy_tx_data[2 * writeBlockSize];
memset(dummy_tx_data, 0, sizeof(dummy_tx_data));
for (int i = 0; i < fp->nb_antennas_tx; i++)
- dummy_tx[i]=dummy_tx_data[i];
+ dummy_tx[i] = dummy_tx_data;
- int tmp = UE->rfdevice.trx_write_func(&UE->rfdevice, timestamp, dummy_tx, writeBlockSize, fp->nb_antennas_tx, 4);
+ int tmp = nrue_ru_write(UE, timestamp, dummy_tx, writeBlockSize, fp->nb_antennas_tx, 4);
AssertFatal(writeBlockSize == tmp, "");
}
-void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_rx_to_tx, bool toTrash)
+void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp_t *timestamp, int duration_rx_to_tx, bool toTrash)
{
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
// two frames for initial sync
@@ -675,9 +648,11 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_r
}
void *rxp[NB_ANTENNAS_RX];
- if (toTrash)
- for (int i = 0; i < fp->nb_antennas_rx; i++)
- rxp[i] = malloc16(get_samples_per_slot(0, fp) * 4);
+ if (toTrash) {
+ rxp[0] = malloc16(get_samples_per_slot(0, fp) * 4);
+ for (int i = 1; i < fp->nb_antennas_rx; i++)
+ rxp[i] = rxp[0];
+ }
for (int x = 0; x < num_frames * NR_NUMBER_OF_SUBFRAMES_PER_FRAME; x++) { // two frames for initial sync
for (int slot = 0; slot < fp->slots_per_subframe; slot++) {
@@ -687,13 +662,13 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_r
((void *)&UE->common_vars.rxdata[i][0]) + 4 * ((x * fp->samples_per_subframe) + get_samples_slot_timestamp(fp, slot));
int read_block_size = get_samples_per_slot(slot, fp);
- int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice, timestamp, rxp, read_block_size, fp->nb_antennas_rx);
+ int tmp = nrue_ru_read(UE, timestamp, rxp, read_block_size, fp->nb_antennas_rx);
UEscopeCopy(UE, ueTimeDomainSamplesBeforeSync, rxp[0], sizeof(c16_t), 1, read_block_size, 0);
AssertFatal(read_block_size == tmp, "");
if (IS_SOFTMODEM_RFSIM) {
int ta = UE->timing_advance + UE->timing_advance_ntn;
- const openair0_timestamp writeTimestamp =
+ const openair0_timestamp_t writeTimestamp =
*timestamp + get_samples_slot_duration(fp, slot, duration_rx_to_tx) - UE->N_TA_offset - ta;
dummyWrite(UE, writeTimestamp, get_samples_per_slot(slot, fp));
}
@@ -701,11 +676,10 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_r
}
if (toTrash)
- for (int i = 0; i < fp->nb_antennas_rx; i++)
- free(rxp[i]);
+ free(rxp[0]);
}
-static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int duration_rx_to_tx, openair0_timestamp rx_offset)
+static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp_t *timestamp, int duration_rx_to_tx, openair0_timestamp_t rx_offset)
{
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
if (UE->sl_mode == 2)
@@ -717,11 +691,11 @@ static void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, int d
int size = rx_offset;
while (size > 0) {
const int unitTransfer = min(get_samples_per_slot(slot, fp), size);
- const int res = UE->rfdevice.trx_read_func(&UE->rfdevice, timestamp, (void **)UE->common_vars.rxdata, unitTransfer, fp->nb_antennas_rx);
+ const int res = nrue_ru_read(UE, timestamp, (void **)UE->common_vars.rxdata, unitTransfer, fp->nb_antennas_rx);
DevAssert(unitTransfer == res);
if (IS_SOFTMODEM_RFSIM) {
int ta = UE->timing_advance + UE->timing_advance_ntn;
- const openair0_timestamp writeTimestamp =
+ const openair0_timestamp_t writeTimestamp =
*timestamp + get_samples_slot_duration(fp, slot, duration_rx_to_tx) - UE->N_TA_offset - ta;
dummyWrite(UE, writeTimestamp, unitTransfer);
}
@@ -745,13 +719,11 @@ static inline int get_readBlockSize(uint16_t slot, NR_DL_FRAME_PARMS *fp) {
void *UE_thread(void *arg)
{
//this thread should be over the processing thread to keep in real time
- PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg;
+ PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *)arg;
// int tx_enabled = 0;
void *rxp[NB_ANTENNAS_RX];
enum stream_status_e stream_status = STREAM_STATUS_UNSYNC;
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
- int tmp = openair0_device_load(&(UE->rfdevice), &UE->openair0_cfg[0]);
- AssertFatal(tmp == 0, "Could not load the device\n");
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
sl_nr_phy_config_request_t *sl_cfg = NULL;
if (UE->sl_mode == 2) {
@@ -759,13 +731,7 @@ void *UE_thread(void *arg)
sl_cfg = &UE->SL_UE_PHY_PARAMS.sl_config;
}
- UE->rfdevice.host_type = RAU_HOST;
UE->is_synchronized = 0;
- int tmp2 = UE->rfdevice.trx_start_func(&UE->rfdevice);
- AssertFatal(tmp2 == 0, "Could not start the device\n");
- if (usrp_tx_thread == 1)
- UE->rfdevice.trx_write_init(&UE->rfdevice);
-
InitSinLUT();
notifiedFIFO_t nf;
@@ -798,14 +764,14 @@ void *UE_thread(void *arg)
}
int shiftForNextFrame = 0;
int intialSyncOffset = 0;
- openair0_timestamp sync_timestamp;
+ openair0_timestamp_t sync_timestamp;
bool stats_printed = false;
if (get_softmodem_params()->sync_ref && UE->sl_mode == 2) {
UE->is_synchronized = 1;
} else {
//warm up the RF board
- int64_t tmp;
+ openair0_timestamp_t tmp;
for (int i = 0; i < 50; i++)
readFrame(UE, &tmp, duration_rx_to_tx, true);
}
@@ -845,7 +811,9 @@ void *UE_thread(void *arg)
/* For IQ recorder-player we force synchronization to happen in a fixed duration so that
the replay runs in sync with recorded samples.
*/
- const unsigned int sync_in_frames = UE->rfdevice.openair0_cfg->recplay_conf->u_f_sync;
+ extern openair0_config_t openair0_cfg[MAX_CARDS];
+ openair0_config_t *cfg0 = &openair0_cfg[UE->rf_map.card];
+ const unsigned int sync_in_frames = cfg0->recplay_conf->u_f_sync;
while (trashed_frames != sync_in_frames) {
readFrame(UE, &sync_timestamp, duration_rx_to_tx, true);
trashed_frames += 2;
@@ -886,16 +854,16 @@ void *UE_thread(void *arg)
if (stream_status == STREAM_STATUS_UNSYNC) {
stream_status = STREAM_STATUS_SYNCING;
syncInFrame(UE, &sync_timestamp, duration_rx_to_tx, intialSyncOffset);
- openair0_write_reorder_clear_context(&UE->rfdevice);
+ nrue_ru_write_reorder_clear_context(UE);
shiftForNextFrame = -(UE->init_sync_frame + trashed_frames + 2) * UE->max_pos_acc * get_nrUE_params()->time_sync_I; // compensate for the time drift that happened during initial sync
LOG_I(PHY, "max_pos_acc = %d, shiftForNextFrame = %d\n", UE->max_pos_acc, shiftForNextFrame);
// read in first symbol
AssertFatal(fp->ofdm_symbol_size + fp->nb_prefix_samples0
- == UE->rfdevice.trx_read_func(&UE->rfdevice,
- &sync_timestamp,
- (void **)UE->common_vars.rxdata,
- fp->ofdm_symbol_size + fp->nb_prefix_samples0,
- fp->nb_antennas_rx),
+ == nrue_ru_read(UE,
+ &sync_timestamp,
+ (void **)UE->common_vars.rxdata,
+ fp->ofdm_symbol_size + fp->nb_prefix_samples0,
+ fp->nb_antennas_rx),
"");
// we have the decoded frame index in the return of the synch process
// and we shifted above to the first slot of next frame
@@ -995,8 +963,8 @@ void *UE_thread(void *arg)
}
const int readBlockSize = get_readBlockSize(slot_nr, fp) - iq_shift_to_apply;
- openair0_timestamp rx_timestamp;
- int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice, &rx_timestamp, rxp, readBlockSize, fp->nb_antennas_rx);
+ openair0_timestamp_t rx_timestamp;
+ int tmp = nrue_ru_read(UE, &rx_timestamp, rxp, readBlockSize, fp->nb_antennas_rx);
metadata meta = {.slot = curMsg.proc.nr_slot_rx, .frame = curMsg.proc.frame_rx};
UEscopeCopyWithMetadata(UE, ueTimeDomainSamples, rxp[0] - firstSymSamp * sizeof(c16_t), sizeof(c16_t), 1, readBlockSize, 0, &meta);
AssertFatal(readBlockSize == tmp, "");
@@ -1010,12 +978,8 @@ void *UE_thread(void *arg)
int first_symbols = fp->ofdm_symbol_size + fp->nb_prefix_samples0; // first symbol of every frames
if (first_symbols > 0) {
- openair0_timestamp ignore_timestamp;
- int tmp = UE->rfdevice.trx_read_func(&UE->rfdevice,
- &ignore_timestamp,
- (void **)UE->common_vars.rxdata,
- first_symbols,
- fp->nb_antennas_rx);
+ openair0_timestamp_t ignore_timestamp;
+ int tmp = nrue_ru_read(UE, &ignore_timestamp, (void **)UE->common_vars.rxdata, first_symbols, fp->nb_antennas_rx);
AssertFatal(first_symbols == tmp, "");
} else
@@ -1023,13 +987,13 @@ void *UE_thread(void *arg)
}
// use previous timing_advance value to compute writeTimestamp
- const openair0_timestamp writeTimestamp =
+ const openair0_timestamp_t writeTimestamp =
rx_timestamp + get_samples_slot_duration(fp, slot_nr, duration_rx_to_tx) - firstSymSamp - UE->N_TA_offset - timing_advance;
// Calculate TX deadline, approximately 1 symbol before the first sample should be written
const uint64_t samples_diff = writeTimestamp - rx_timestamp - fp->ofdm_symbol_size;
- const float deadline_us = samples_diff / UE->rfdevice.openair0_cfg->sample_rate * 1e6;
- const uint64_t absolute_deadline_us = current_time.tv_sec * 1e6 + current_time.tv_nsec / 1e3 + deadline_us;
+ const float deadline_us = samples_diff * 1e3 / fp->samples_per_subframe;
+ const uint64_t absolute_deadline_us = current_time.tv_sec * 1e6 + current_time.tv_nsec * 1e-3 + deadline_us;
// but use current UE->timing_advance value to compute writeBlockSize
int writeBlockSize = get_samples_per_slot((slot_nr + duration_rx_to_tx) % nb_slot_frame, fp) - iq_shift_to_apply;
@@ -1106,11 +1070,11 @@ void *UE_thread(void *arg)
return NULL;
}
-void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconfig_file)
+void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconfig_file, int numerology)
{
for (int instance_id = 0; instance_id < nb_inst; instance_id++) {
NR_UE_RRC_INST_t* rrc = nr_rrc_init_ue(uecap_file, instance_id, get_nrUE_params()->nb_antennas_tx);
- NR_UE_MAC_INST_t *mac = nr_l2_init_ue(instance_id);
+ NR_UE_MAC_INST_t *mac = nr_l2_init_ue(instance_id, numerology);
nr_rrc_set_mac_queue(instance_id, &mac->input_nf);
mac->if_module = nr_ue_if_module_init(instance_id);
diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index f1cc659cae..a1dcaed52c 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -81,6 +81,7 @@ unsigned short config_frames[4] = {2,9,11,13};
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
#include "PHY/TOOLS/phy_scope_interface.h"
#include "PHY/TOOLS/nr_phy_scope.h"
+#include "executables/nr-ue-ru.h"
#include
#include "executables/softmodem-common.h"
#include "executables/thread-common.h"
@@ -102,10 +103,6 @@ int get_node_type() {return -1;}
RAN_CONTEXT_t RC;
int oai_exit = 0;
-static int tx_max_power[MAX_NUM_CCs] = {0};
-
-double rx_gain_off = 0.0;
-
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
uint64_t sidelink_frequency[MAX_NUM_CCs][4];
@@ -138,21 +135,11 @@ int create_tasks_nrue(uint32_t ue_nb) {
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{
- int CC_id;
LOG_W(NR_PHY, "called by: %s:%d %s() Exiting OAI softmodem: %s\n", file, line, function, s ? s : "no msg");
oai_exit = 1;
- if (PHY_vars_UE_g && PHY_vars_UE_g[0]) {
- for(CC_id=0; CC_idrfdevice.trx_end_func) {
- if (PHY_vars_UE_g[0][CC_id]->rfdevice.trx_get_stats_func) {
- PHY_vars_UE_g[0][CC_id]->rfdevice.trx_get_stats_func(&PHY_vars_UE_g[0][CC_id]->rfdevice);
- }
- PHY_vars_UE_g[0][CC_id]->rfdevice.trx_end_func(&PHY_vars_UE_g[0][CC_id]->rfdevice);
- }
- }
- }
+ nrue_ru_end();
if (assert) {
abort();
@@ -181,27 +168,27 @@ static void get_options(configmodule_interface_t *cfg)
config_get(cfg, cmdline_params, numparams, NULL);
if (nrUE_params.vcdflag > 0)
ouput_vcd = 1;
- AssertFatal(nrUE_params.extra_pdu_id != get_softmodem_params()->default_pdu_session_id,
- "Default PDU ID (%d) and Extra PDU ID (%d) must be different!\n",
- get_softmodem_params()->default_pdu_session_id,
- nrUE_params.extra_pdu_id);
+ AssertFatal(nrUE_params.extra_pdu_id == -1,
+ "Add additional PDU sessions in uicc.pdu_sessions array instead\n");
}
// set PHY vars from command line
-void set_options(int CC_id, PHY_VARS_NR_UE *UE){
- NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
+static void set_UE_options(int CC_id, PHY_VARS_NR_UE *UE, int ru_id)
+{
+ const nrUE_RU_params_t *RU = nrue_get_ru(ru_id);
// Set UE variables
- UE->rx_total_gain_dB = (int)nrUE_params.rx_gain + rx_gain_off;
- UE->tx_total_gain_dB = (int)nrUE_params.tx_gain;
+ UE->rx_total_gain_dB = RU->max_rxgain - RU->att_rx;
+ UE->tx_total_gain_dB = RU->att_tx;
+ UE->if_freq = RU->if_frequency;
+ UE->if_freq_off = RU->if_freq_offset;
+ UE->rf_map.card = ru_id;
+ UE->rf_map.chain = CC_id;
+
UE->tx_power_max_dBm = nrUE_params.tx_max_power;
- UE->rf_map.card = 0;
- UE->rf_map.chain = CC_id + 0;
UE->max_ldpc_iterations = nrUE_params.max_ldpc_iterations;
UE->UE_scan_carrier = nrUE_params.UE_scan_carrier;
UE->UE_fo_compensation = nrUE_params.UE_fo_compensation;
- UE->if_freq = nrUE_params.if_freq;
- UE->if_freq_off = nrUE_params.if_freq_off;
UE->chest_freq = nrUE_params.chest_freq;
UE->chest_time = nrUE_params.chest_time;
UE->no_timing_correction = nrUE_params.no_timing_correction;
@@ -210,76 +197,21 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
LOG_I(PHY,"Set UE_fo_compensation %d, UE_scan_carrier %d, UE_no_timing_correction %d \n, chest-freq %d, chest-time %d\n",
UE->UE_fo_compensation, UE->UE_scan_carrier, UE->no_timing_correction, UE->chest_freq, UE->chest_time);
-
- // Set FP variables
-
- fp->nb_antennas_rx = nrUE_params.nb_antennas_rx;
- fp->nb_antennas_tx = nrUE_params.nb_antennas_tx;
- fp->threequarter_fs = get_softmodem_params()->threequarter_fs;
- fp->N_RB_DL = nrUE_params.N_RB_DL;
- fp->ssb_start_subcarrier = nrUE_params.ssb_start_subcarrier;
- fp->ofdm_offset_divisor = nrUE_params.ofdm_offset_divisor;
-
- LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d, ssb_start_subcarrier %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs, fp->ssb_start_subcarrier);
-
}
-void init_openair0(PHY_VARS_NR_UE *ue)
+static void set_fp_options(int cell_id, int ru_id)
{
- int card;
- int freq_off = 0;
- NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
- bool is_sidelink = (get_softmodem_params()->sl_mode) ? true : false;
- if (is_sidelink)
- frame_parms = &ue->SL_UE_PHY_PARAMS.sl_frame_params;
+ NR_DL_FRAME_PARMS *fp = nrue_get_cell_fp(cell_id);
+ const nrUE_RU_params_t *RU = nrue_get_ru(ru_id);
- for (card=0; cardopenair0_cfg[card];
- uint64_t dl_carrier, ul_carrier;
- cfg->configFilename = NULL;
- cfg->sample_rate = frame_parms->samples_per_subframe * 1e3;
- cfg->samples_per_frame = frame_parms->samples_per_frame;
+ // Set FP variables
+ fp->nb_antennas_rx = RU->nb_rx;
+ fp->nb_antennas_tx = RU->nb_tx;
- if (frame_parms->frame_type==TDD)
- cfg->duplex_mode = duplex_mode_TDD;
- else
- cfg->duplex_mode = duplex_mode_FDD;
+ fp->threequarter_fs = get_softmodem_params()->threequarter_fs;
+ fp->ofdm_offset_divisor = nrUE_params.ofdm_offset_divisor;
- cfg->Mod_id = 0;
- cfg->num_rb_dl = frame_parms->N_RB_DL;
- cfg->clock_source = get_softmodem_params()->clock_source;
- cfg->time_source = get_softmodem_params()->timing_source;
- cfg->tune_offset = get_softmodem_params()->tune_offset;
- cfg->tx_num_channels = min(4, frame_parms->nb_antennas_tx);
- cfg->rx_num_channels = min(4, frame_parms->nb_antennas_rx);
-
- LOG_I(PHY,
- "HW: Configuring card %d, sample_rate %f, tx/rx num_channels %d/%d, duplex_mode %s\n",
- card,
- cfg->sample_rate,
- cfg->tx_num_channels,
- cfg->rx_num_channels,
- duplex_mode_txt[cfg->duplex_mode]);
-
- if (is_sidelink) {
- dl_carrier = frame_parms->dl_CarrierFreq;
- ul_carrier = frame_parms->ul_CarrierFreq;
- } else
- nr_get_carrier_frequencies(PHY_vars_UE_g[0][0], &dl_carrier, &ul_carrier);
-
- nr_rf_card_config_freq(cfg, ul_carrier, dl_carrier, freq_off);
-
- nr_rf_card_config_gain(cfg, rx_gain_off);
-
- cfg->configFilename = get_softmodem_params()->rf_config_file;
-
- if (get_nrUE_params()->usrp_args)
- cfg->sdr_addrs = get_nrUE_params()->usrp_args;
- if (get_nrUE_params()->tx_subdev)
- cfg->tx_subdev = get_nrUE_params()->tx_subdev;
- if (get_nrUE_params()->rx_subdev)
- cfg->rx_subdev = get_nrUE_params()->rx_subdev;
- }
+ LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d, ofdm_offset_divisor %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs, fp->ofdm_offset_divisor);
}
// Stupid function addition because UE itti messages queues definition is common with eNB
@@ -324,7 +256,6 @@ int main(int argc, char **argv)
}
//set_softmodem_sighandler();
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
- memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
// initialize logging
logInit();
// get options and fill parameters from configuration file
@@ -379,7 +310,14 @@ int main(int argc, char **argv)
nr_pdcp_layer_init();
nas_init_nrue(NB_UE_INST);
- init_NR_UE(NB_UE_INST, get_nrUE_params()->uecap_file, get_nrUE_params()->reconfig_file, get_nrUE_params()->rbconfig_file);
+ nrue_set_ru_params(uniqCfg);
+ nrue_set_cell_params(uniqCfg);
+
+ init_NR_UE(NB_UE_INST,
+ get_nrUE_params()->uecap_file,
+ get_nrUE_params()->reconfig_file,
+ get_nrUE_params()->rbconfig_file,
+ nrue_get_cell(0)->numerology);
// start time manager with some reasonable default for the running mode
// (may be overwritten in configuration file or command line)
@@ -396,24 +334,52 @@ int main(int argc, char **argv)
IS_SOFTMODEM_RFSIM ? TIME_SOURCE_IQ_SAMPLES
: TIME_SOURCE_REALTIME);
+ // initialize per-cell frame parameters
+ for (int cell_id = 0; cell_id < nrue_get_cell_count(); cell_id++) {
+ int ru_id = nrue_get_cell(cell_id)->ru_id;
+ AssertFatal(ru_id >= 0 && ru_id < nrue_get_ru_count(),
+ "Invalid ru_id (%d) for cell %d. Should be >= 0 and < %d\n",
+ ru_id,
+ cell_id,
+ nrue_get_ru_count());
+ AssertFatal(nrue_get_ru(ru_id)->used_by_cell == -1,
+ "RU %d is already used by cell %d and therefore cannot also be used by cell %d\n",
+ ru_id,
+ nrue_get_ru(ru_id)->used_by_cell,
+ cell_id);
+ nrue_set_ru_cell_id(ru_id, cell_id);
+
+ set_fp_options(cell_id, ru_id);
+ if (IS_SA_MODE(get_softmodem_params()) || get_softmodem_params()->sl_mode)
+ nr_init_frame_parms_ue_sa(nrue_get_cell_fp(cell_id), nrue_get_cell(cell_id));
+ }
+
+ int cell_id = 0;
for (int inst = 0; inst < NB_UE_INST; inst++) {
- PHY_VARS_NR_UE *UE[MAX_NUM_CCs];
+ NR_UE_MAC_INST_t *mac = get_mac_inst(inst);
+
for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
- UE[CC_id] = PHY_vars_UE_g[inst][CC_id];
- set_options(CC_id, UE[CC_id]);
- NR_UE_MAC_INST_t *mac = get_mac_inst(inst);
- init_nr_ue_phy_cpu_stats(&UE[CC_id]->phy_cpu_stats);
- // set frame config to initial values from command line and assume that the SSB is centered on the grid
- if (IS_SA_MODE(get_softmodem_params()) || get_softmodem_params()->sl_mode) {
- uint16_t nr_band = get_softmodem_params()->band;
- mac->nr_band = nr_band;
- mac->ssb_start_subcarrier = UE[CC_id]->frame_parms.ssb_start_subcarrier;
- nr_init_frame_parms_ue_sa(&UE[CC_id]->frame_parms,
- downlink_frequency[CC_id][0],
- uplink_frequency_offset[CC_id][0],
- get_softmodem_params()->numerology,
- nr_band);
- } else {
+ PHY_VARS_NR_UE *UE_CC = PHY_vars_UE_g[inst][CC_id];
+
+ AssertFatal(cell_id >= 0 && cell_id < nrue_get_cell_count(),
+ "There are not enough cell definitions for all UEs! NB_UE_INST = %d, MAX_NUM_CCs = %d, nrue_cell_count = %d\n",
+ NB_UE_INST,
+ MAX_NUM_CCs,
+ nrue_get_cell_count());
+ nrUE_cell_params_t cell = *nrue_get_cell(cell_id);
+
+ AssertFatal(cell.used_by_ue == -1,
+ "Cell %d is already used by UE %d and cannot also be used by UE %d as cells map 1:1 to RUs and RU sharing is not implemented\n",
+ cell_id,
+ cell.used_by_ue,
+ inst);
+ cell.used_by_ue = inst;
+
+ set_UE_options(CC_id, UE_CC, cell.ru_id);
+ init_nr_ue_phy_cpu_stats(&UE_CC->phy_cpu_stats);
+
+ NR_DL_FRAME_PARMS *fp = nrue_get_cell_fp(cell_id);
+ if (!IS_SA_MODE(get_softmodem_params()) && !get_softmodem_params()->sl_mode) {
do {
notifiedFIFO_elt_t *elt = pollNotifiedFIFO(&mac->input_nf);
if (!elt) {
@@ -422,44 +388,60 @@ int main(int argc, char **argv)
process_msg_rcc_to_mac(NotifiedFifoData(elt), inst);
delNotifiedFIFO_elt(elt);
} while (true);
- fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
- nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, mac->nr_band);
- }
+ fapi_nr_config_request_t *nrUE_config = &UE_CC->nrUE_config;
+ nr_init_frame_parms_ue(fp, nrUE_config, mac->nr_band);
- UE[CC_id]->sl_mode = get_softmodem_params()->sl_mode;
- init_actor(&UE[CC_id]->sync_actor, "SYNC_", -1);
+ cell.band = fp->nr_band;
+ cell.rf_frequency = fp->dl_CarrierFreq;
+ cell.rf_freq_offset = fp->ul_CarrierFreq - fp->dl_CarrierFreq;
+ cell.numerology = fp->numerology_index;
+ cell.N_RB_DL = fp->N_RB_DL;
+ cell.ssb_start = fp->ssb_start_subcarrier;
+ }
+ nrue_set_cell(cell_id, &cell);
+
+ UE_CC->frame_parms = *fp;
+ mac->nr_band = cell.band;
+ mac->ssb_start_subcarrier = cell.ssb_start;
+ mac->dl_frequency = cell.rf_frequency;
+
+ UE_CC->sl_mode = get_softmodem_params()->sl_mode;
+ init_actor(&UE_CC->sync_actor, "SYNC_", -1);
if (get_nrUE_params()->num_dl_actors > 0) {
- UE[CC_id]->dl_actors = calloc_or_fail(get_nrUE_params()->num_dl_actors, sizeof(*UE[CC_id]->dl_actors));
+ UE_CC->dl_actors = calloc_or_fail(get_nrUE_params()->num_dl_actors, sizeof(*UE_CC->dl_actors));
for (int i = 0; i < get_nrUE_params()->num_dl_actors; i++) {
- init_actor(&UE[CC_id]->dl_actors[i], "DL_", -1);
+ init_actor(&UE_CC->dl_actors[i], "DL_", -1);
}
}
if (get_nrUE_params()->num_ul_actors > 0) {
- UE[CC_id]->ul_actors = calloc_or_fail(get_nrUE_params()->num_ul_actors, sizeof(*UE[CC_id]->ul_actors));
+ UE_CC->ul_actors = calloc_or_fail(get_nrUE_params()->num_ul_actors, sizeof(*UE_CC->ul_actors));
for (int i = 0; i < get_nrUE_params()->num_ul_actors; i++) {
- init_actor(&UE[CC_id]->ul_actors[i], "UL_", -1);
+ init_actor(&UE_CC->ul_actors[i], "UL_", -1);
}
}
- init_nr_ue_vars(UE[CC_id], inst);
+ init_nr_ue_vars(UE_CC, inst);
- if (UE[CC_id]->sl_mode) {
- AssertFatal(UE[CC_id]->sl_mode == 2, "Only Sidelink mode 2 supported. Mode 1 not yet supported\n");
+ if (UE_CC->sl_mode) {
+ AssertFatal(UE_CC->sl_mode == 2, "Only Sidelink mode 2 supported. Mode 1 not yet supported\n");
DevAssert(mac->if_module != NULL && mac->if_module->sl_phy_config_request != NULL);
nr_sl_phy_config_t *phycfg = &mac->SL_MAC_PARAMS->sl_phy_config;
phycfg->sl_config_req.sl_carrier_config.sl_num_rx_ant = get_nrUE_params()->nb_antennas_rx;
phycfg->sl_config_req.sl_carrier_config.sl_num_tx_ant = get_nrUE_params()->nb_antennas_tx;
mac->if_module->sl_phy_config_request(phycfg);
- sl_nr_ue_phy_params_t *sl_phy = &UE[CC_id]->SL_UE_PHY_PARAMS;
+ sl_nr_ue_phy_params_t *sl_phy = &UE_CC->SL_UE_PHY_PARAMS;
nr_init_frame_parms_ue_sl(&sl_phy->sl_frame_params,
&sl_phy->sl_config,
get_softmodem_params()->threequarter_fs,
get_nrUE_params()->ofdm_offset_divisor);
- sl_ue_phy_init(UE[CC_id]);
+ sl_ue_phy_init(UE_CC);
}
- init_openair0(UE[CC_id]);
+
+ cell_id++; // initially connect each UE and carrier to its own cell
}
}
+ nrue_init_openair0();
+
lock_memory_to_ram();
if (IS_SOFTMODEM_DOSCOPE) {
@@ -474,6 +456,8 @@ int main(int argc, char **argv)
load_module_shlib("imscope_record", NULL, 0, PHY_vars_UE_g[0][0]);
}
+ nrue_ru_start();
+
for (int inst = 0; inst < NB_UE_INST; inst++) {
LOG_I(PHY,"Intializing UE Threads for instance %d ...\n", inst);
init_NR_UE_threads(PHY_vars_UE_g[inst][0]);
@@ -514,14 +498,12 @@ int main(int argc, char **argv)
ret = pthread_join(phy_vars->stat_thread, NULL);
AssertFatal(ret == 0, "pthread_join error %d, errno %d (%s)\n", ret, errno, strerror(errno));
}
- if (phy_vars->rfdevice.trx_get_stats_func)
- phy_vars->rfdevice.trx_get_stats_func(&phy_vars->rfdevice);
- if (phy_vars->rfdevice.trx_end_func)
- phy_vars->rfdevice.trx_end_func(&phy_vars->rfdevice);
}
}
}
+ nrue_ru_end();
+
free_nrLDPC_coding_interface(&nrLDPC_coding_interface);
time_manager_finish();
diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h
index f14594b0dd..598b409808 100644
--- a/executables/nr-uesoftmodem.h
+++ b/executables/nr-uesoftmodem.h
@@ -31,14 +31,6 @@ extern uint16_t ue_id_g;
/* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument
when calling config_get or config_getlist functions */
-#define CALIBRX_OPT "calib-ue-rx"
-#define CALIBRXMED_OPT "calib-ue-rx-med"
-#define CALIBRXBYP_OPT "calib-ue-rx-byp"
-#define DBGPRACH_OPT "debug-ue-prach"
-#define NOL2CONNECT_OPT "no-L2-connect"
-#define CALIBPRACH_OPT "calib-prach-tx"
-#define DUMPFRAME_OPT "ue-dump-frame"
-
/*------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters defining UE running mode */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
@@ -56,7 +48,6 @@ extern uint16_t ue_id_g;
{"reconfig-file", CONFIG_HLP_RE_CFG_FILE, 0, .strptr=&nrUE_params.reconfig_file, .defstrval="./reconfig.raw", TYPE_STRING, 0}, \
{"rbconfig-file", CONFIG_HLP_RB_CFG_FILE, 0, .strptr=&nrUE_params.rbconfig_file, .defstrval="./rbconfig.raw", TYPE_STRING, 0}, \
{"ue-rxgain", CONFIG_HLP_UERXG, 0, .dblptr=&nrUE_params.rx_gain, .defdblval=110, TYPE_DOUBLE, 0}, \
- {"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, .dblptr=&nrUE_params.rx_gain_off, .defdblval=0, TYPE_DOUBLE, 0}, \
{"ue-txgain", CONFIG_HLP_UETXG, 0, .dblptr=&nrUE_params.tx_gain, .defdblval=0, TYPE_DOUBLE, 0}, \
{"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, .iptr=&(nrUE_params.nb_antennas_rx), .defuintval=1, TYPE_UINT8, 0}, \
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, .iptr=&(nrUE_params.nb_antennas_tx), .defuintval=1, TYPE_UINT8, 0}, \
@@ -65,12 +56,12 @@ extern uint16_t ue_id_g;
{"ue-max-power", NULL, 0, .iptr=&(nrUE_params.tx_max_power), .defintval=90, TYPE_INT, 0}, \
{"r" , CONFIG_HLP_PRB_SA, 0, .iptr=&(nrUE_params.N_RB_DL), .defintval=106, TYPE_UINT, 0}, \
{"ssb", CONFIG_HLP_SSC, 0, .iptr=&(nrUE_params.ssb_start_subcarrier), .defintval=516, TYPE_UINT16, 0}, \
- {"if_freq" , CONFIG_HLP_IF_FREQ, 0, .u64ptr=&(nrUE_params.if_freq), .defuintval=0, TYPE_UINT64, 0}, \
+ {"if_freq" , CONFIG_HLP_IF_FREQ, 0, .u64ptr=&(nrUE_params.if_freq), .defint64val=0, TYPE_UINT64, 0}, \
{"if_freq_off" , CONFIG_HLP_IF_FREQ_OFF, 0, .iptr=&(nrUE_params.if_freq_off), .defuintval=0, TYPE_INT, 0}, \
{"chest-freq", CONFIG_HLP_CHESTFREQ, 0, .iptr=&(nrUE_params.chest_freq), .defintval=0, TYPE_INT, 0}, \
{"chest-time", CONFIG_HLP_CHESTTIME, 0, .iptr=&(nrUE_params.chest_time), .defintval=0, TYPE_INT, 0}, \
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, .iptr=&(nrUE_params.no_timing_correction), .defintval=0, TYPE_INT, 0}, \
- {"SLC", CONFIG_HLP_SLF, 0, .u64ptr=&(sidelink_frequency[0][0]), .defuintval=2600000000,TYPE_UINT64,0}, \
+ {"SLC", CONFIG_HLP_SLF, 0, .u64ptr=&(sidelink_frequency[0][0]), .defint64val=2600000000,TYPE_UINT64,0}, \
{"num-ues", NULL, 0, .iptr=&(NB_UE_INST), .defuintval=1, TYPE_INT, 0}, \
{"time-sync-P", CONFIG_HLP_TIME_SYNC_P, 0, .dblptr=&(nrUE_params.time_sync_P), .defdblval=0.5, TYPE_DOUBLE, 0}, \
{"time-sync-I", CONFIG_HLP_TIME_SYNC_I, 0, .dblptr=&(nrUE_params.time_sync_I), .defdblval=0.0, TYPE_DOUBLE, 0}, \
@@ -120,7 +111,6 @@ typedef struct {
char *uecap_file;
double tx_gain;
double rx_gain;
- double rx_gain_off;
int vcdflag;
int tx_max_power;
int num_ul_actors;
@@ -131,11 +121,9 @@ extern uint64_t get_nrUE_optmask(void);
extern uint64_t set_nrUE_optmask(uint64_t bitmask);
extern nrUE_params_t *get_nrUE_params(void);
-
// In nr-ue.c
-extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
extern void fill_ue_band_info(void);
-extern void init_NR_UE(int, char *, char *, char *);
+extern void init_NR_UE(int, char *, char *, char *, int);
extern void init_NR_UE_threads(PHY_VARS_NR_UE *ue);
void *UE_thread(void *arg);
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id);
diff --git a/executables/softmodem-common.c b/executables/softmodem-common.c
index 09fced4aa3..558fd4968b 100644
--- a/executables/softmodem-common.c
+++ b/executables/softmodem-common.c
@@ -156,6 +156,10 @@ void get_common_options(configmodule_interface_t *cfg)
nfapi_setmode(nfapi_mode);
if (stats_disabled)
IS_SOFTMODEM_NOSTATS = true;
+
+ // To be removed in a future release (after 1 month)
+ AssertFatal(get_softmodem_params()->default_pdu_session_id == -1,
+ "Use uicc0.pdu_sessions.[0].id to change the requested PDU session ID (is %d)\n", get_softmodem_params()->default_pdu_session_id);
}
void softmodem_verify_mode(const softmodem_params_t *p)
diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h
index 4dfa5eb680..1018716bb7 100644
--- a/executables/softmodem-common.h
+++ b/executables/softmodem-common.h
@@ -41,13 +41,12 @@ extern "C"
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
-#define CONFIG_HLP_SPLIT73 "Split 7.3 (below rate matching) option: ::\n"
-#define CONFIG_HLP_TPOOL "Thread pool configuration: \n\
+#define CONFIG_HLP_TPOOL \
+ "Thread pool configuration: \n\
list of cores, comma separated (negative value is no core affinity)\n\
example: -1,3 launches two working threads one floating, the second set on core 3\n\
default 8 floating threads\n\
use N for no pool (runs in calling thread) recommended with rfsim.\n"
-#define CONFIG_HLP_ULMAXE "set the eNodeB max ULSCH erros\n"
#define CONFIG_HLP_CALUER "set UE RX calibration\n"
#define CONFIG_HLP_CALUERM ""
#define CONFIG_HLP_CALUERB ""
@@ -59,40 +58,29 @@ extern "C"
#define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n"
#define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n"
#define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n"
-#define CONFIG_HLP_SA "run gNB in standalone mode\n"
#define CONFIG_HLP_SL_MODE "sets the NR sidelink mode (0: not in sidelink mode, 1: in-coverage/gNB, 2: out-of-coverage/no gNB)\n"
-#define CONFIG_HLP_EXTS "tells hardware to use an external timing reference\n"
-#define CONFIG_HLP_DMRSSYNC "tells RU to insert DMRS in subframe 1 slot 0"
#define CONFIG_HLP_CLK "tells hardware to use a clock reference (0:internal, 1:external, 2:gpsdo)\n"
#define CONFIG_HLP_TME "tells hardware to use a time reference (0:internal, 1:external, 2:gpsdo)\n"
#define CONFIG_HLP_TUNE_OFFSET "LO tuning offset to use in Hz\n"
-#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n"
#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n"
#define CONFIG_HLP_ULF "Set the uplink frequency offset for all component carriers\n"
#define CONFIG_HLP_SLF "Set the sidelink frequency for all component carriers\n"
#define CONFIG_HLP_CHOFF "Channel id offset\n"
#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n"
-#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
#define CONFIG_HLP_DLMCS "Set the maximum downlink MCS\n"
#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
-#define CONFIG_HLP_256QAM "Use the 256 QAM mcs table for PDSCH\n"
#define CONFIG_HLP_CHESTFREQ "Set channel estimation type in frequency domain. 0-Linear interpolation (default). 1-PRB based averaging of channel estimates in frequency. \n"
#define CONFIG_HLP_CHESTTIME "Set channel estimation type in time domain. 0-Symbols take estimates of the last preceding DMRS symbol (default). 1-Symbol based averaging of channel estimates in time. \n"
#define CONFIG_HLP_IMSCOPE "Enable phy scope based on imgui and implot"
#define CONFIG_HLP_IMSCOPE_RECORD "Enable recording scope data to filesystem"
#define CONFIG_HLP_NONSTOP "Go back to frame sync mode after 100 consecutive PBCH failures\n"
-//#define CONFIG_HLP_NUMUES "Set the number of UEs for the emulation"
-#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
-#define CONFIG_HLP_ULMCS "Set the maximum uplink MCS\n"
-#define CONFIG_HLP_UE "Set the lte softmodem as a UE\n"
#define CONFIG_HLP_TQFS \
"Apply three-quarter of sampling frequency, (example 23.04 Msps for LTE 20MHz) to reduce the data rate on USB/PCIe transfers " \
"(only valid for some bandwidths)\n"
#define CONFIG_HLP_TPORT "tracer port\n"
#define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n"
-#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n"
#define CONFIG_HLP_BAND "band index\n"
@@ -129,7 +117,6 @@ extern "C"
#define CLOCK_SOURCE softmodem_params.clock_source
#define TIMING_SOURCE softmodem_params.timing_source
#define TUNE_OFFSET softmodem_params.tune_offset
-#define SEND_DMRSSYNC softmodem_params.send_dmrs_sync
#define CHEST_FREQ softmodem_params.chest_freq
#define CHEST_TIME softmodem_params.chest_time
#define NFAPI softmodem_params.nfapi
@@ -140,8 +127,6 @@ extern "C"
#define SYNC_REF softmodem_params.sync_ref
#define DEFAULT_PDU_ID softmodem_params.default_pdu_session_id
-#define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
-
extern int usrp_tx_thread;
// clang-format off
#define CMDLINE_PARAMS_DESC { \
@@ -153,7 +138,7 @@ extern int usrp_tx_thread;
{"clock-source", CONFIG_HLP_CLK, 0, .uptr=&CLOCK_SOURCE, .defintval=0, TYPE_UINT, 0}, \
{"time-source", CONFIG_HLP_TME, 0, .uptr=&TIMING_SOURCE, .defintval=0, TYPE_UINT, 0}, \
{"tune-offset", CONFIG_HLP_TUNE_OFFSET, 0, .dblptr=&TUNE_OFFSET, .defintval=0, TYPE_DOUBLE, 0}, \
- {"C" , CONFIG_HLP_DLF, 0, .u64ptr=&(downlink_frequency[0][0]), .defuintval=0, TYPE_UINT64, 0}, \
+ {"C" , CONFIG_HLP_DLF, 0, .u64ptr=&(downlink_frequency[0][0]), .defint64val=0, TYPE_UINT64, 0}, \
{"CO" , CONFIG_HLP_ULF, 0, .iptr=&(uplink_frequency_offset[0][0]), .defintval=0, TYPE_INT, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, .iptr=&CHAIN_OFFSET, .defintval=0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, .uptr=&do_forms, .defintval=0, TYPE_UINT, 0}, \
@@ -180,7 +165,7 @@ extern int usrp_tx_thread;
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, .iptr=&softmodem_params.threequarter_fs, .defintval=0, TYPE_INT, 0}, \
{"imscope" , CONFIG_HLP_IMSCOPE, PARAMFLAG_BOOL, .uptr=&enable_imscope, .defintval=0, TYPE_UINT, 0}, \
{"imscope-record" , CONFIG_HLP_IMSCOPE_RECORD,PARAMFLAG_BOOL, .uptr=&enable_imscope_record, .defintval=0, TYPE_UINT, 0}, \
- {"default-pdu-id", NULL, 0, .iptr=&DEFAULT_PDU_ID, .defintval=10, TYPE_INT, 0}, \
+ {"default-pdu-id", NULL, 0, .iptr=&DEFAULT_PDU_ID, .defintval=-1, TYPE_INT, 0}, \
}
// clang-format on
@@ -358,6 +343,8 @@ struct timespec timespec_sub(struct timespec lhs, struct timespec rhs);
extern uint8_t nfapi_mode;
extern char *parallel_config;
extern char *worker_config;
+extern double cpuf;
+
#ifdef __cplusplus
}
#endif
diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c
index 8b07bea297..35a32f4600 100644
--- a/nfapi/oai_integration/nfapi_pnf.c
+++ b/nfapi/oai_integration/nfapi_pnf.c
@@ -72,7 +72,6 @@
#include
#endif
-#define NUM_P5_PHY 2
#define _GNU_SOURCE
@@ -1801,6 +1800,9 @@ int nr_stop_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfa
.header.phy_id = req->header.phy_id};
nfapi_nr_stop_indication(config, &resp);
has_sent_stop_ind = true;
+ // Upon sending the STOP.indication mark P7 PNF to terminate, to not send any further messages to the VNF
+ pnf_p7_t *pnf_p7 = (pnf_p7_t *)(p7_config_g);
+ pnf_p7->terminate = 1;
#ifdef ENABLE_WLS
wls_pnf_close(pnf_p5_init_and_receive_pthread);
#endif
diff --git a/nfapi/oai_integration/socket/socket_pnf.c b/nfapi/oai_integration/socket/socket_pnf.c
index 6a96247b74..0be068fe22 100644
--- a/nfapi/oai_integration/socket/socket_pnf.c
+++ b/nfapi/oai_integration/socket/socket_pnf.c
@@ -78,6 +78,10 @@ static int send_p7_msg(pnf_p7_t *pnf_p7, uint8_t *msg, uint32_t len)
bool pnf_nr_send_p7_message(pnf_p7_t *pnf_p7, nfapi_nr_p7_message_header_t *header, uint32_t msg_len)
{
+ if (pnf_p7->terminate) {
+ //don't send any further P7 messages after terminating
+ return false;
+ }
header->m_segment_sequence = NFAPI_NR_P7_SET_MSS(0, 0, pnf_p7->sequence_number);
// Need to guard against different threads calling the encode function at the same time
diff --git a/nfapi/oai_integration/wls_integration/wls_pnf.c b/nfapi/oai_integration/wls_integration/wls_pnf.c
index e6fd609346..96bfc3fd6b 100644
--- a/nfapi/oai_integration/wls_integration/wls_pnf.c
+++ b/nfapi/oai_integration/wls_integration/wls_pnf.c
@@ -201,7 +201,10 @@ bool wls_pnf_nr_send_p5_message(pnf_t *pnf, nfapi_nr_p4_p5_message_header_t *msg
bool wls_pnf_nr_send_p7_message(pnf_p7_t *pnf_p7, nfapi_nr_p7_message_header_t *msg, uint32_t msg_len)
{
UNUSED_VARIABLE(msg_len);
-
+ if (pnf_p7->terminate) {
+ // don't send any further P7 messages after terminating
+ return false;
+ }
if (!isFAPIMessageIDValid(msg->message_id)) {
return false;
}
diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
index 4c99da4e35..481f704da1 100644
--- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
@@ -260,6 +260,13 @@ typedef struct
} nfapi_nr_ue_pusch_data_t;
+typedef struct csi_payload {
+ uint64_t part1_payload;
+ uint64_t part2_payload;
+ int p1_bits;
+ int p2_bits;
+} nfapi_nr_ue_csi_payload_t;
+
typedef struct
{
// payloads with fixed array size
@@ -267,10 +274,7 @@ typedef struct
// vector without L1 implementation
uint16_t harq_ack_bit_length;
uint64_t harq_payload;
- uint16_t csi_part1_bit_length;
- uint64_t csi_part1_payload;
- uint16_t csi_part2_bit_length;
- uint64_t csi_part2_payload;
+ nfapi_nr_ue_csi_payload_t csi_payload;
uint8_t alpha_scaling; // 0 = 0.5, 1 = 0.65, 2 = 0.8, 3 = 1
uint8_t beta_offset_harq_ack;
uint8_t beta_offset_csi1;
diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
index d146408abf..722ec5f807 100644
--- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
@@ -121,7 +121,6 @@ typedef struct {
#define NFAPI_NR_P7_SET_MSS(_more, _segm, _sequ) ( (((_more) & 0x1) << 15) | (((_segm) & 0x7F) << 8) | ((_sequ) & 0xFF) )
#define NFAPI_P7_SET_MSS(_more, _segm, _sequ) ( (((_more) & 0x1) << 7) | (((_segm) & 0x7F) << 4) | ((_sequ) & 0xF) )
-#define NFAPI_TAG_LENGTH_PACKED_LEN 4
// Convenience methods to convert between SFN/SLOT formats
#define NFAPI_SLOTNUM(_mu) (10 << (_mu))
@@ -563,7 +562,6 @@ typedef struct {
uint16_t number_of_phys;
nfapi_pnf_phy_rel15_info_t phy[NFAPI_MAX_PNF_PHY];
} nfapi_pnf_phy_rel15_t;
-#define NFAPI_PNF_PHY_REL15_TAG 0x100H
typedef struct {
@@ -3053,7 +3051,6 @@ typedef struct {
#define NFAPI_LTE_RSSI_REQUEST_TAG 0x3000
-#define NFAPI_P4_START_TAG NFAPI_LTE_RSSI_REQUEST_TAG
typedef struct {
nfapi_tl_t tl;
diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7.c b/nfapi/open-nFAPI/vnf/src/vnf_p7.c
index 82c5ae7d1c..e1f99f6d38 100644
--- a/nfapi/open-nFAPI/vnf/src/vnf_p7.c
+++ b/nfapi/open-nFAPI/vnf/src/vnf_p7.c
@@ -2130,6 +2130,10 @@ void vnf_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
void vnf_nr_handle_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
+ if (vnf_p7->terminate) {
+ // VNF already terminated, ignore messages ( shouldn't get here, since the PNF doesn't send further messages after terminating as well )
+ return;
+ }
nfapi_nr_p7_message_header_t header;
// validate the input params
diff --git a/openair1/PHY/CODING/DOC/LDPCImplementation.md b/openair1/PHY/CODING/DOC/LDPCImplementation.md
index 56e7570de4..d6ea6565fa 100644
--- a/openair1/PHY/CODING/DOC/LDPCImplementation.md
+++ b/openair1/PHY/CODING/DOC/LDPCImplementation.md
@@ -41,7 +41,7 @@ At runtime, to successfully use LDPC accelerators (e.g., Xilinx T2/Intel ACCs),
Please refer to the dedicated documentation at [LDPC_OFFLOAD_SETUP.md](file://../../../../doc/LDPC_OFFLOAD_SETUP.md).
```
-./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server --log_config.gtpu_log_level info --loader.ldpc.shlibversion _aal --nrLDPC_coding_aal.dpdk_dev 01:00.0 --nrLDPC_coding_aal.dpdk_core_list 0-1
+./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.[0].serveraddr server --log_config.gtpu_log_level info --loader.ldpc.shlibversion _aal --nrLDPC_coding_aal.dpdk_dev 01:00.0 --nrLDPC_coding_aal.dpdk_core_list 0-1
```
`libldpc_aal.so` has its decoder and its encoder implemented in [nrLDPC_coding_aal.c](file://../nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c).
@@ -61,7 +61,7 @@ At runtime, to successfully use the xdma, you need to install vendor specific dr
Please refer to the dedicated documentation at [LDPC_XDMA_OFFLOAD_SETUP.md](file://../../../../doc/LDPC_XDMA_OFFLOAD_SETUP.md).
```
-./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server --log_config.gtpu_log_level info --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
+./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.[0].serveraddr server --log_config.gtpu_log_level info --loader.ldpc.shlibversion _xdma --nrLDPC_coding_xdma.num_threads_prepare 2
```
`libldpc_xdma.so` has its decoder implemented in [nrLDPC_coding_xdma.c](file://../nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c).\
diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
index 4dddaf7e7e..b9ee66389f 100644
--- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c
+++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
@@ -42,7 +42,6 @@
#endif
#define NR_LDPC_PROFILER_DETAIL
-#define NR_LDPC_ENABLE_PARITY_CHECK
ldpc_interface_t ldpc_orig, ldpc_toCompare;
// 4-bit quantizer
diff --git a/openair1/PHY/CODING/coding_defs.h b/openair1/PHY/CODING/coding_defs.h
index d6e1b780f7..e5eb61e0bd 100644
--- a/openair1/PHY/CODING/coding_defs.h
+++ b/openair1/PHY/CODING/coding_defs.h
@@ -38,7 +38,6 @@
#define MAX_TURBO_ITERATIONS_MBSFN 8
#define MAX_TURBO_ITERATIONS max_turbo_iterations
-#define MAX_LDPC_ITERATIONS_MBSFN 4
#define LTE_NULL 2
typedef struct {
diff --git a/openair1/PHY/CODING/coding_extern.h b/openair1/PHY/CODING/coding_extern.h
index 12aeb3af05..f910d0b1cf 100644
--- a/openair1/PHY/CODING/coding_extern.h
+++ b/openair1/PHY/CODING/coding_extern.h
@@ -19,7 +19,6 @@
* contact@openairinterface.org
*/
-extern double cpuf;
extern decoder_if_t *decoder16;
extern decoder_if_t *decoder8;
extern encoder_if_t *encoder;
diff --git a/openair1/PHY/CODING/defs_NB_IoT.h b/openair1/PHY/CODING/defs_NB_IoT.h
index d33ae1c440..2a8bbccd7d 100644
--- a/openair1/PHY/CODING/defs_NB_IoT.h
+++ b/openair1/PHY/CODING/defs_NB_IoT.h
@@ -30,15 +30,9 @@
#include // for uint8/16/32_t
-#define CRC24_A_NB_IoT 0
-#define CRC24_B_NB_IoT 1
-#define CRC16_NB_IoT 2
-#define CRC8_NB_IoT 3
//#define MAX_TURBO_ITERATIONS_MBSFN 8 // no MBSFN
-#define MAX_TURBO_ITERATIONS_NB_IoT 4
-#define LTE_NULL_NB_IoT 2 // defined also in PHY/LTE_TRANSPORT/defs_NB_IoT.h
/** \fn uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w)
\brief This is the subblock interleaving algorithm for convolutionally coded blocks from 36-212 (Release 13.4, 2017).
diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
index 1d9aa53d25..8aa1a95cbe 100644
--- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
+++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
@@ -53,8 +53,6 @@
#define PRINT_CRC_CHECK(a)
#endif
-// extern double cpuf;
-
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h
index 43bf68f48d..b04b991249 100644
--- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h
+++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h
@@ -40,7 +40,6 @@
/** Number of columns in BG1 */
#define NR_LDPC_NCOL_BG1 68
/** Number of rows in BG1 */
-#define NR_LDPC_NROW_BG1 46
/** Number of edges/entries in BG1 */
#define NR_LDPC_NUM_EDGE_BG1 316
/** Number of check node (CN) groups in BG1
@@ -67,9 +66,7 @@
/** Number of columns in BG2 */
#define NR_LDPC_NCOL_BG2 52
/** Number of rows in BG2 */
-#define NR_LDPC_NROW_BG2 42
/** Number of edges/entries in BG2 */
-#define NR_LDPC_NUM_EDGE_BG2 197
/** Number of check node (CN) groups in BG2
A CN group is defined by its number of connected bit nodes. */
#define NR_LDPC_NUM_CN_GROUPS_BG2 6
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_pucch_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_pucch_defs.h
index 2b1fa8c6a7..6f5ae86752 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_pucch_defs.h
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_pucch_defs.h
@@ -5,7 +5,6 @@
#ifndef __NR_POLAR_PUCCH_DEFS__H__
#define __NR_POLAR_PUCCH_DEFS__H__
-#define NR_POLAR_PUCCH_PAYLOAD_BITS 16
// Ref. 38-212 v15.0.1
#define NR_POLAR_PUCCH_N_MAX 10 // uint8_t <------
@@ -16,7 +15,6 @@
// Ref. 38-212 v15.0.1, Section 7.1.5: Rate Matching
#define NR_POLAR_PUCCH_I_BIL 0 // uint8_t
-#define NR_POLAR_PUCCH_E 864 // uint16_t
/*
* TEST CODE
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h
index d08862bb13..5a9def2d04 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h
@@ -35,23 +35,13 @@
#define NR_POLAR_UCI_PUCCH_MESSAGE_TYPE 2 // int8_t
#define NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS 3
-#define NR_POLAR_PUCCH_PAYLOAD_BITS 32
-#define NR_POLAR_PUCCH_E 32
// Ref. 38-212, Section 6.3.1.2.1
-#define NR_POLAR_PUCCH_CRC_PARITY_BITS_SHORT 6
-#define NR_POLAR_PUCCH_CRC_PARITY_BITS_LONG 11
-#define NR_POLAR_PUCCH_I_SEG_LONG 1
-#define NR_POLAR_PUCCH_I_SEG_SHORT 0
// Ref. 38-212, Section 6.3.1.3.1
#define NR_POLAR_PUCCH_N_MAX 10
#define NR_POLAR_PUCCH_I_IL 0
-#define NR_POLAR_PUCCH_N_PC_SHORT 3
-#define NR_POLAR_PUCCH_N_PC_LONG 0
-#define NR_POLAR_PUCCH_N_PC_WM_LONG 0
-#define NR_POLAR_PUCCH_N_PC_WM_SHORT 1
// Ref. 38-212, Section 6.3.1.4.1
#define NR_POLAR_PUCCH_I_BIL 1
diff --git a/openair1/PHY/CODING/nrSmallBlock/nr_small_block_defs.h b/openair1/PHY/CODING/nrSmallBlock/nr_small_block_defs.h
index 7c8554f807..02df3f8dc9 100644
--- a/openair1/PHY/CODING/nrSmallBlock/nr_small_block_defs.h
+++ b/openair1/PHY/CODING/nrSmallBlock/nr_small_block_defs.h
@@ -41,7 +41,6 @@
#define NR_SMALL_BLOCK_CODED_BITS 32
-#define L1d_CLS 64
uint32_t encodeSmallBlock(int in, int len);
diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c
index 71418bb1e3..d82ff3c919 100644
--- a/openair1/PHY/INIT/nr_init_ru.c
+++ b/openair1/PHY/INIT/nr_init_ru.c
@@ -33,20 +33,23 @@ void nr_phy_init_RU(RU_t *ru)
LOG_D(PHY, "Initializing RU signal buffers (if_south %s) nb_tx %d, nb_rx %d\n", ru_if_types[ru->if_south], ru->nb_tx, ru->nb_rx);
- nfapi_nr_config_request_scf_t *cfg = &ru->config;
- ru->nb_log_antennas = 0;
- for (int n = 0; n < ru->num_gNB; n++) {
- if (cfg->carrier_config.num_tx_ant.value > ru->nb_log_antennas)
- ru->nb_log_antennas = cfg->carrier_config.num_tx_ant.value;
+ ru->num_beams_period = 1;
+ if (ru->num_gNB > 0) {
+ nfapi_nr_config_request_scf_t *cfg = &ru->config;
+ ru->nb_log_antennas = 0;
+ for (int n = 0; n < ru->num_gNB; n++) {
+ if (cfg->carrier_config.num_tx_ant.value > ru->nb_log_antennas)
+ ru->nb_log_antennas = cfg->carrier_config.num_tx_ant.value;
+ }
+ nfapi_nr_analog_beamforming_ve_t *analog_config = &cfg->analog_beamforming_ve;
+ ru->num_beams_period = analog_config->analog_bf_vendor_ext.value ? analog_config->num_beams_period_vendor_ext.value : 1;
}
+ else ru->nb_log_antennas = ru->nb_tx;
// copy configuration from gNB[0] in to RU, assume that all gNB instances sharing RU use the same configuration
// (at least the parts that are needed by the RU, numerology and PRACH)
AssertFatal(ru->nb_log_antennas > 0 && ru->nb_log_antennas < 13, "ru->nb_log_antennas %d ! \n",ru->nb_log_antennas);
-
- nfapi_nr_analog_beamforming_ve_t *analog_config = &cfg->analog_beamforming_ve;
- ru->num_beams_period = analog_config->analog_bf_vendor_ext.value ? analog_config->num_beams_period_vendor_ext.value : 1;
int nb_tx_streams = ru->nb_tx * ru->num_beams_period;
int nb_rx_streams = ru->nb_rx * ru->num_beams_period;
LOG_I(NR_PHY, "nb_tx_streams %d, nb_rx_streams %d, num_Beams_period %d\n", nb_tx_streams, nb_rx_streams, ru->num_beams_period);
diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c
index 6fbfcb3cac..d6043775af 100644
--- a/openair1/PHY/INIT/nr_parms.c
+++ b/openair1/PHY/INIT/nr_parms.c
@@ -320,7 +320,7 @@ uint32_t get_samples_symbol_timestamp(const NR_DL_FRAME_PARMS *fp, int slot, int
return get_samples_symbol_duration(fp, slot, 0, symbol);
}
-uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, const NR_DL_FRAME_PARMS *fp)
+uint32_t get_slot_from_timestamp(openair0_timestamp_t timestamp_rx, const NR_DL_FRAME_PARMS *fp)
{
timestamp_rx = timestamp_rx % fp->samples_per_frame;
if (timestamp_rx < fp->samples_per_slot0)
@@ -525,13 +525,20 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
return 0;
}
-void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t delta_duplex, uint8_t mu, uint16_t nr_band) {
+void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_params_t *cell)
+{
+ const uint64_t downlink_frequency = cell->rf_frequency;
+ const int64_t delta_duplex = cell->rf_freq_offset;
+ const uint8_t mu = cell->numerology;
+ const int N_RB_DL = cell->N_RB_DL;
+ const int ssb_start_subcarrier = cell->ssb_start;
+ const uint16_t nr_band = cell->band;
- LOG_I(PHY,"SA init parameters. DL freq %lu UL offset %d SSB numerology %d N_RB_DL %d\n",
+ LOG_I(PHY,"SA init parameters. DL freq %lu UL offset %ld SSB numerology %d N_RB_DL %d\n",
downlink_frequency,
delta_duplex,
mu,
- frame_parms->N_RB_DL);
+ N_RB_DL);
frame_parms->numerology_index = mu;
frame_parms->dl_CarrierFreq = downlink_frequency;
@@ -539,6 +546,7 @@ void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink
if (get_softmodem_params()->sl_mode == 0) {
frame_parms->freq_range = get_freq_range_from_freq(frame_parms->dl_CarrierFreq);
}
+ frame_parms->N_RB_DL = N_RB_DL;
frame_parms->N_RB_UL = frame_parms->N_RB_DL;
frame_parms->nr_band = nr_band;
@@ -564,8 +572,9 @@ void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink
+ (frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size);
frame_parms->samples_per_frame = 10 * frame_parms->samples_per_subframe;
- LOG_W(PHY, "samples_per_subframe %d/per second %d, wCP %d\n", frame_parms->samples_per_subframe, 1000*frame_parms->samples_per_subframe, frame_parms->samples_per_subframe_wCP);
+ frame_parms->ssb_start_subcarrier = ssb_start_subcarrier;
+ LOG_W(PHY, "samples_per_subframe %d/per second %d, wCP %d\n", frame_parms->samples_per_subframe, 1000*frame_parms->samples_per_subframe, frame_parms->samples_per_subframe_wCP);
}
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp)
diff --git a/openair1/PHY/INIT/nr_phy_init.h b/openair1/PHY/INIT/nr_phy_init.h
index bfe935d93f..ec4a8de71b 100644
--- a/openair1/PHY/INIT/nr_phy_init.h
+++ b/openair1/PHY/INIT/nr_phy_init.h
@@ -28,7 +28,7 @@
int nr_get_ssb_start_symbol(const NR_DL_FRAME_PARMS *fp, uint8_t i_ssb);
void nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band);
-void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band);
+void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_params_t *cell);
int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
sl_nr_phy_config_request_t *config,
int threequarter_fs,
diff --git a/openair1/PHY/INIT/tests/test_nr_frame_params.cpp b/openair1/PHY/INIT/tests/test_nr_frame_params.cpp
index e3e541f8ab..acf43ec0b8 100644
--- a/openair1/PHY/INIT/tests/test_nr_frame_params.cpp
+++ b/openair1/PHY/INIT/tests/test_nr_frame_params.cpp
@@ -41,7 +41,7 @@ uint32_t ref_get_samples_slot_timestamp(NR_DL_FRAME_PARMS *fp, unsigned int slot
return samp_count;
}
-uint32_t ref_get_slot_from_timestamp(openair0_timestamp ts, NR_DL_FRAME_PARMS *fp)
+uint32_t ref_get_slot_from_timestamp(openair0_timestamp_t ts, NR_DL_FRAME_PARMS *fp)
{
uint32_t slot_idx = 0;
int samples_till_the_slot = get_samples_per_slot(slot_idx, fp) - 1;
@@ -75,7 +75,7 @@ void test_coherence_slot_api(NR_DL_FRAME_PARMS *fp)
EXPECT_EQ(get_samples_slot_timestamp(fp, slot), ref_get_samples_slot_timestamp(fp, slot));
}
- openair0_timestamp ts = get_samples_per_slot(0, fp);
+ openair0_timestamp_t ts = get_samples_per_slot(0, fp);
// When timestamp is the last sample of the slot
EXPECT_EQ(get_slot_from_timestamp(ts - 1, fp), 0);
for (unsigned int slot = 0; slot < fp->slots_per_frame; slot++) {
@@ -174,4 +174,4 @@ int main(int argc, char **argv)
logInit();
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
-}
\ No newline at end of file
+}
diff --git a/openair1/PHY/LTE_REFSIG/mod_table.h b/openair1/PHY/LTE_REFSIG/mod_table.h
index 29ae9f4495..755bb06006 100644
--- a/openair1/PHY/LTE_REFSIG/mod_table.h
+++ b/openair1/PHY/LTE_REFSIG/mod_table.h
@@ -24,9 +24,6 @@
#define MOD_TABLE_SIZE_SHORT 304
#define MOD_TABLE_QPSK_OFFSET 1
-#define MOD_TABLE_16QAM_OFFSET 5
-#define MOD_TABLE_64QAM_OFFSET 21
-#define MOD_TABLE_PSS_OFFSET 85
short mod_table[MOD_TABLE_SIZE_SHORT] = {0,0,768,768,768,-768,-768,768,-768,-768,343,343,343,1030,1030,343,1030,1030,343,-343,343,-1030,1030,-343,1030,-1030,-343,343,-343,1030,-1030,343,-1030,1030,-343,-343,-343,-1030,-1030,-343,-1030,-1030,503,503,503,168,168,503,168,168,503,838,503,1173,168,838,168,1173,838,503,838,168,1173,503,1173,168,838,838,838,1173,1173,838,1173,1173,503,-503,503,-168,168,-503,168,-168,503,-838,503,-1173,168,-838,168,-1173,838,-503,838,-168,1173,-503,1173,-168,838,-838,838,-1173,1173,-838,1173,-1173,-503,503,-503,168,-168,503,-168,168,-503,838,-503,1173,-168,838,-168,1173,-838,503,-838,168,-1173,503,-1173,168,-838,838,-838,1173,-1173,838,-1173,1173,-503,-503,-503,-168,-168,-503,-168,-168,-503,-838,-503,-1173,-168,-838,-168,-1173,-838,-503,-838,-168,-1173,-503,-1173,-168,-838,-838,-838,-1173,-1173,-838,-1173,-1173,1086,0,1081,-108,1065,-215,1038,-320,1001,-422,954,-519,897,-612,832,-698,758,-777,677,-849,589,-912,495,-966,397,-1011,294,-1046,189,-1070,81,-1083,-27,-1086,-135,-1078,-242,-1059,-346,-1030,-447,-990,-543,-941,-634,-882,-719,-814,-796,-739,-866,-656,-927,-566,-979,-471,-1021,-371,-1053,-268,-1074,-162,-1085,-54,-1085,54,-1074,162,-1053,268,-1021,371,-979,471,-927,566,-866,656,-796,739,-719,814,-634,882,-543,941,-447,990,-346,1030,-242,1059,-135,1078,-27,1086,81,1083,189,1070,294,1045,397,1011,495,966,589,912,677,849,758,777,832,698,897,612,954,519,1001,422,1038,320,1065,215,1081,108,16384,0,8192,0,4096,0,2048,0};
#endif
diff --git a/openair1/PHY/LTE_TRANSPORT/dci.h b/openair1/PHY/LTE_TRANSPORT/dci.h
index cd76f20919..e15eaa4a96 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci.h
+++ b/openair1/PHY/LTE_TRANSPORT/dci.h
@@ -699,7 +699,6 @@ struct DCI1A_RA_5MHz_TDD_1_6 {
} __attribute__ ((__packed__));
typedef struct DCI1A_RA_5MHz_TDD_1_6 DCI1A_RA_5MHz_TDD_1_6_t;
-#define sizeof_DCI1A_RA_5MHz_TDD_1_6_t 27
/// DCI Format Type 1A (5 MHz, TDD, frame 0, 27 bits)
/*
@@ -717,7 +716,6 @@ struct DCI1A_5MHz_TDD_0 {
} __attribute__ ((__packed__));
typedef struct DCI1A_5MHz_TDD_0 DCI1A_5MHz_TDD_0_t;
-#define sizeof_DCI1A_5MHz_TDD_0_t 27
*/
/// DCI Format Type 1B (5 MHz, FDD, 2 Antenna Ports, 27 bits)
@@ -745,7 +743,6 @@ struct DCI1B_5MHz_2A_FDD {
} __attribute__ ((__packed__));
typedef struct DCI1B_5MHz_2A_FDD DCI1B_5MHz_2A_FDD_t;
-#define sizeof_DCI1B_5MHz_FDD_t 27
/// DCI Format Type 1B (5 MHz, TDD, 2 Antenna Ports, 29 bits)
struct DCI1B_5MHz_2A_TDD {
@@ -772,7 +769,6 @@ struct DCI1B_5MHz_2A_TDD {
} __attribute__ ((__packed__));
typedef struct DCI1B_5MHz_2A_TDD DCI1B_5MHz_2A_TDD_t;
-#define sizeof_DCI1B_5MHz_2A_TDD_t 29
/// DCI Format Type 1B (5 MHz, FDD, 4 Antenna Ports, 28 bits)
struct DCI1B_5MHz_4A_FDD {
@@ -797,7 +793,6 @@ struct DCI1B_5MHz_4A_FDD {
} __attribute__ ((__packed__));
typedef struct DCI1B_5MHz_4A_FDD DCI1B_5MHz_4A_FDD_t;
-#define sizeof_DCI1B_5MHz_4A_FDD_t 28
/// DCI Format Type 1B (5 MHz, TDD, 4 Antenna Ports, 31 bits)
struct DCI1B_5MHz_4A_TDD {
@@ -824,7 +819,6 @@ struct DCI1B_5MHz_4A_TDD {
} __attribute__ ((__packed__));
typedef struct DCI1B_5MHz_4A_TDD DCI1B_5MHz_4A_TDD_t;
-#define sizeof_DCI1B_5MHz_4A_TDD_t 31
/// DCI Format Type 1C (1.4 MHz, 8 bits)
struct DCI1C_1_5MHz
@@ -876,7 +870,6 @@ struct DCI1C_15MHz
} __attribute__ ((__packed__));
typedef struct DCI1C_15MHz DCI1C_15MHz_t;
-#define sizeof_DCI1C_15MHz_t X
/// DCI Format Type 1C (20 MHz, 15 bits)
struct DCI1C_20MHz
@@ -919,7 +912,6 @@ struct DCI1D_5MHz_2A_FDD {
} __attribute__ ((__packed__));
typedef struct DCI1D_5MHz_2A_FDD DCI1D_5MHz_2A_FDD_t;
-#define sizeof_DCI1D_5MHz_2A_FDD_t 27
/// DCI Format Type 1D (5 MHz, TDD, 2 Antenna Ports, 30 bits)
struct DCI1D_5MHz_2A_TDD {
@@ -948,7 +940,6 @@ struct DCI1D_5MHz_2A_TDD {
} __attribute__ ((__packed__));
typedef struct DCI1D_5MHz_2A_TDD DCI1D_5MHz_2A_TDD_t;
-#define sizeof_DCI1D_5MHz_2A_TDD_t 30
/// DCI Format Type 1D (5 MHz, FDD, 4 Antenna Ports, 29 bits)
struct DCI1D_5MHz_4A_FDD {
@@ -975,7 +966,6 @@ struct DCI1D_5MHz_4A_FDD {
} __attribute__ ((__packed__));
typedef struct DCI1D_5MHz_4A_FDD DCI1D_5MHz_4A_FDD_t;
-#define sizeof_DCI1D_5MHz_4A_FDD_t 29
/// DCI Format Type 1D (5 MHz, TDD, 4 Antenna Ports, 33 bits)
struct DCI1D_5MHz_4A_TDD {
@@ -1006,7 +996,6 @@ struct DCI1D_5MHz_4A_TDD {
} __attribute__ ((__packed__));
typedef struct DCI1D_5MHz_4A_TDD DCI1D_5MHz_4A_TDD_t;
-#define sizeof_DCI1D_5MHz_4A_TDD_t 33
///******************NEW DCI Format for MU-MIMO****************///////////
@@ -2121,7 +2110,6 @@ struct DCI2B_1_5MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2B_1_5MHz_TDD DCI2B_1_5MHz_TDD_t;
-#define sizeof_DCI2B_1_5MHz_TDD_t 33
/// DCI Format Type 2B (5 MHz, TDD, 39 bits)
struct DCI2B_5MHz_TDD {
@@ -2156,7 +2144,6 @@ struct DCI2B_5MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2B_5MHz_TDD DCI2B_5MHz_TDD_t;
-#define sizeof_DCI2B_5MHz_TDD_t 39
/// DCI Format Type 2B (10 MHz, TDD, 43 bits)
struct DCI2B_10MHz_TDD {
@@ -2191,7 +2178,6 @@ struct DCI2B_10MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2B_10MHz_TDD DCI2B_10MHz_TDD_t;
-#define sizeof_DCI2B_10MHz_TDD_t 43
/// DCI Format Type 2B (20 MHz, TDD, 51 bits)
struct DCI2B_20MHz_TDD {
@@ -2226,7 +2212,6 @@ struct DCI2B_20MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2B_20MHz_TDD DCI2B_20MHz_TDD_t;
-#define sizeof_DCI2B_20MHz_TDD_t 51
/// DCI Format Type 2B (1.5 MHz, FDD, 28 bits)
struct DCI2B_1_5MHz_FDD {
@@ -2255,7 +2240,6 @@ struct DCI2B_1_5MHz_FDD {
} __attribute__ ((__packed__));
typedef struct DCI2B_1_5MHz_FDD DCI2B_1_5MHz_FDD_t;
-#define sizeof_DCI2B_1_5MHz_FDD_t 28
/// DCI Format Type 2B (5 MHz, FDD, 36 bits)
struct DCI2B_5MHz_FDD {
@@ -2285,7 +2269,6 @@ struct DCI2B_5MHz_FDD {
uint64_t rah:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI2B_5MHz_FDD_t 36
typedef struct DCI2B_5MHz_FDD DCI2B_5MHz_FDD_t;
/// DCI Format Type 2B (10 MHz, FDD, 41 bits)
@@ -2318,7 +2301,6 @@ struct DCI2B_10MHz_FDD {
uint64_t padding0:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI2B_10MHz_FDD_t 41
typedef struct DCI2B_10MHz_FDD DCI2B_10MHz_FDD_t;
/// DCI Format Type 2B (20 MHz, FDD, 48 bits)
@@ -2349,7 +2331,6 @@ struct DCI2B_20MHz_FDD {
uint64_t rah:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI2B_20MHz_FDD_t 48
typedef struct DCI2B_20MHz_FDD DCI2B_20MHz_FDD_t;
// *******************************************************************
@@ -2386,7 +2367,6 @@ struct DCI2C_1_5MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2C_1_5MHz_TDD DCI2C_1_5MHz_TDD_t;
-#define sizeof_DCI2C_1_5MHz_TDD_t 34
/// DCI Format Type 2C (5 MHz, TDD, 41 bits)
struct DCI2C_5MHz_TDD {
@@ -2421,7 +2401,6 @@ struct DCI2C_5MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2C_5MHz_TDD DCI2C_5MHz_TDD_t;
-#define sizeof_DCI2C_5MHz_TDD_t 41
/// DCI Format Type 2C (10 MHz, TDD, 45 bits)
struct DCI2C_10MHz_TDD {
@@ -2456,7 +2435,6 @@ struct DCI2C_10MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2C_10MHz_TDD DCI2C_10MHz_TDD_t;
-#define sizeof_DCI2C_10MHz_TDD_t 45
/// DCI Format Type 2C (20 MHz, TDD, 53 bits)
struct DCI2C_20MHz_TDD {
@@ -2491,7 +2469,6 @@ struct DCI2C_20MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2C_20MHz_TDD DCI2C_20MHz_TDD_t;
-#define sizeof_DCI2C_20MHz_TDD_t 53
/// DCI Format Type 2C (1.5 MHz, FDD, 30 bits)
struct DCI2C_1_5MHz_FDD {
@@ -2520,7 +2497,6 @@ struct DCI2C_1_5MHz_FDD {
} __attribute__ ((__packed__));
typedef struct DCI2C_1_5MHz_FDD DCI2C_1_5MHz_FDD_t;
-#define sizeof_DCI2C_1_5MHz_FDD_t 30
/// DCI Format Type 2C (5 MHz, FDD, 38 bits)
struct DCI2C_5MHz_FDD {
@@ -2550,7 +2526,6 @@ struct DCI2C_5MHz_FDD {
uint64_t rah:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI2C_5MHz_FDD_t 38
typedef struct DCI2C_5MHz_FDD DCI2C_5MHz_FDD_t;
/// DCI Format Type 2C (10 MHz, FDD, 42 bits)
@@ -2581,7 +2556,6 @@ struct DCI2C_10MHz_FDD {
uint64_t rah:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI2C_10MHz_FDD_t 43
typedef struct DCI2C_10MHz_FDD DCI2C_10MHz_FDD_t;
/// DCI Format Type 2C (20 MHz, FDD, 50 bits)
@@ -2612,7 +2586,6 @@ struct DCI2C_20MHz_FDD {
uint64_t rah:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI2C_20MHz_FDD_t 50
typedef struct DCI2C_20MHz_FDD DCI2C_20MHz_FDD_t;
// *******************************************************************
@@ -2651,7 +2624,6 @@ struct DCI2D_1_5MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2D_1_5MHz_TDD DCI2D_1_5MHz_TDD_t;
-#define sizeof_DCI2D_1_5MHz_TDD_t 36
/// DCI Format Type 2D (5 MHz, TDD, 43 bits)
struct DCI2D_5MHz_TDD {
@@ -2688,7 +2660,6 @@ struct DCI2D_5MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2D_5MHz_TDD DCI2D_5MHz_TDD_t;
-#define sizeof_DCI2D_5MHz_TDD_t 43
/// DCI Format Type 2D (10 MHz, TDD, 47 bits)
struct DCI2D_10MHz_TDD {
@@ -2725,7 +2696,6 @@ struct DCI2D_10MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2D_10MHz_TDD DCI2D_10MHz_TDD_t;
-#define sizeof_DCI2D_10MHz_TDD_t 47
/// DCI Format Type 2D (20 MHz, TDD, 55 bits)
struct DCI2D_20MHz_TDD {
@@ -2762,7 +2732,6 @@ struct DCI2D_20MHz_TDD {
} __attribute__ ((__packed__));
typedef struct DCI2D_20MHz_TDD DCI2D_20MHz_TDD_t;
-#define sizeof_DCI2D_20MHz_TDD_t 55
/// DCI Format Type 2D (1.5 MHz, FDD, 33 bits)
struct DCI2D_1_5MHz_FDD {
@@ -2795,7 +2764,6 @@ struct DCI2D_1_5MHz_FDD {
} __attribute__ ((__packed__));
typedef struct DCI2D_1_5MHz_FDD DCI2D_1_5MHz_FDD_t;
-#define sizeof_DCI2D_1_5MHz_FDD_t 33
/// DCI Format Type 2D (5 MHz, FDD, 41 bits)
struct DCI2D_5MHz_FDD {
@@ -2829,7 +2797,6 @@ struct DCI2D_5MHz_FDD {
uint64_t padding0:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI2D_5MHz_FDD_t 41
typedef struct DCI2D_5MHz_FDD DCI2D_5MHz_FDD_t;
/// DCI Format Type 2D (10 MHz, FDD, 45 bits)
@@ -2864,7 +2831,6 @@ struct DCI2D_10MHz_FDD {
uint64_t padding0:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI2D_10MHz_FDD_t 45
typedef struct DCI2D_10MHz_FDD DCI2D_10MHz_FDD_t;
/// DCI Format Type 2D (20 MHz, FDD, 52 bits)
@@ -2895,7 +2861,6 @@ struct DCI2D_20MHz_FDD {
uint64_t rah:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI2D_20MHz_FDD_t 52
typedef struct DCI2D_20MHz_FDD DCI2D_20MHz_FDD_t;
@@ -2904,14 +2869,12 @@ typedef struct __attribute__ ((__packed__))
uint32_t TPC:28;
}
DCI3_5MHz_TDD_0_t;
-#define sizeof_DCI3_5MHz_TDD_0_t 27
typedef struct __attribute__ ((__packed__))
{
uint32_t TPC:28;
}
DCI3_5MHz_TDD_1_6_t;
-#define sizeof_DCI3_5MHz_TDD_1_6_t 27
typedef struct __attribute__ ((__packed__))
@@ -2919,7 +2882,6 @@ typedef struct __attribute__ ((__packed__))
uint32_t TPC:26;
}
DCI3_5MHz_FDD_t;
-#define sizeof_DCI3_5MHz_FDD_t 25
/// DCI Format Type 0 (1.5 MHz,9 bits)
struct DCI0A_1_5MHz {
@@ -2932,7 +2894,6 @@ struct DCI0A_1_5MHz {
/// Hopping flag
uint32_t hopping:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI0A_1_5MHz 9
/// DCI Format Type 0 (5 MHz,13 bits)
struct DCI0A_5MHz {
@@ -2945,7 +2906,6 @@ struct DCI0A_5MHz {
/// Hopping flag
uint32_t hopping:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI0A_5MHz 13
/// DCI Format Type 0 (10 MHz,15 bits)
struct DCI0A_10_MHz {
@@ -2958,7 +2918,6 @@ struct DCI0A_10_MHz {
/// Hopping flag
uint32_t hopping:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI0A_10MHz 15
/// DCI Format Type 0 (20 MHz,17 bits)
struct DCI0A_20_MHz {
@@ -2971,7 +2930,6 @@ struct DCI0A_20_MHz {
/// Hopping flag
uint32_t hopping:1;
} __attribute__ ((__packed__));
-#define sizeof_DCI0A_20MHz 17
#define MAX_DCI_SIZE_BITS 45
diff --git a/openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h b/openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h
index 512316f565..d21af4d850 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h
+++ b/openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h
@@ -203,7 +203,6 @@ typedef union DCI_CONTENT {
} __attribute__ ((__packed__));
typedef struct DCIN0 DCIN0_t;
-#define sizeof_DCIN0_t 23
struct DCIN1_RAR{
// DCI subframe repetition Number, 2 bits
@@ -227,7 +226,6 @@ struct DCIN1_RAR{
} __attribute__ ((__packed__));
typedef struct DCIN1_RAR DCIN1_RAR_t;
-#define sizeof_DCIN1_RAR_t 23
struct DCIN1{
// DCI subframe repetition Number, 2 bits
@@ -251,7 +249,6 @@ struct DCIN1{
} __attribute__ ((__packed__));
typedef struct DCIN1 DCIN1_t;
-#define sizeof_DCIN1_t 23
// DCI Format Type N2 for direct indication, 15 bits
struct DCIN2_Ind{
@@ -264,7 +261,6 @@ struct DCIN2_Ind{
} __attribute__ ((__packed__));;
typedef struct DCIN2_Ind DCIN2_Ind_t;
-#define sizeof_DCIN2_Ind_t 15
// DCI Format Type N2 for Paging, 15 bits
struct DCIN2_Pag{
@@ -282,8 +278,6 @@ struct DCIN2_Pag{
typedef struct DCIN2_Pag DCIN2_Pag_t;
-#define sizeof_DCIN2_Pag_t 15
-#define MAX_DCI_SIZE_BITS_NB_IoT 23
#endif
diff --git a/openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h b/openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h
index 44eac0ff0c..9b8624498e 100644
--- a/openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h
+++ b/openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h
@@ -29,14 +29,10 @@
//#include "dci_nb_iot.h"
//#define MOD_TABLE_QPSK_OFFSET 1
-//#define MOD_TABLE_16QAM_OFFSET 5
-//#define MOD_TABLE_64QAM_OFFSET 21
-//#define MOD_TABLE_PSS_OFFSET 85
//
//// structures below implement 36-211 and 36-212
//
//#define NSOFT 1827072
-#define LTE_NULL_NB_IoT 2
//
//// maximum of 3 segments before each coding block if data length exceeds 6144 bits.
//
diff --git a/openair1/PHY/LTE_TRANSPORT/mdci.h b/openair1/PHY/LTE_TRANSPORT/mdci.h
index 3cb6380625..81bb73a024 100644
--- a/openair1/PHY/LTE_TRANSPORT/mdci.h
+++ b/openair1/PHY/LTE_TRANSPORT/mdci.h
@@ -267,7 +267,6 @@ struct DCI6_0B_5MHz {
} __attribute__ ((__packed__));
typedef struct DCI6_0B_5MHz DCI6_0B_5MHz_t;
-#define sizeof_DCI6_0B_5MHz_t 17
/// basic DCI Format Type 6-1B (5 MHz)
struct DCI6_1B_5MHz {
@@ -315,7 +314,6 @@ struct DCI6_0B_10MHz {
} __attribute__ ((__packed__));
typedef struct DCI6_0B_10MHz DCI6_0B_10MHz_t;
-#define sizeof_DCI6_0B_10MHz_t 18
/// basic DCI Format Type 6-1B (10 MHz)
struct DCI6_1B_10MHz {
@@ -363,7 +361,6 @@ struct DCI6_0B_20MHz {
} __attribute__ ((__packed__));
typedef struct DCI6_0B_20MHz DCI6_0B_20MHz_t;
-#define sizeof_DCI6_0B_20MHz_t 18
/// basic DCI Format Type 6-1B (10 MHz)
struct DCI6_1B_20MHz {
diff --git a/openair1/PHY/LTE_TRANSPORT/pucch_extern.h b/openair1/PHY/LTE_TRANSPORT/pucch_extern.h
index f2d0f883b3..15a726d84e 100644
--- a/openair1/PHY/LTE_TRANSPORT/pucch_extern.h
+++ b/openair1/PHY/LTE_TRANSPORT/pucch_extern.h
@@ -36,14 +36,10 @@
#include
/* PUCCH format3 >> */
-#define D_I 0
-#define D_Q 1
-#define D_IQDATA 2
#define D_NSLT1SF 2
#define D_NSYM1SLT 7
#define D_NSYM1SF 2*7
#define D_NSC1RB 12
-#define D_NRB1PUCCH 2
#define D_NPUCCH_SF5 5
#define D_NPUCCH_SF4 4
diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common.h b/openair1/PHY/LTE_TRANSPORT/transport_common.h
index bc90d44e1e..108ab7db06 100644
--- a/openair1/PHY/LTE_TRANSPORT/transport_common.h
+++ b/openair1/PHY/LTE_TRANSPORT/transport_common.h
@@ -40,9 +40,6 @@
//#endif
#define MOD_TABLE_QPSK_OFFSET 1
-#define MOD_TABLE_16QAM_OFFSET 5
-#define MOD_TABLE_64QAM_OFFSET 21
-#define MOD_TABLE_PSS_OFFSET 85
// structures below implement 36-211 and 36-212
@@ -72,7 +69,6 @@
#define PMI_2A_1j 2
#define PMI_2A_1mj 3
//2 layers
-#define PMI_2A_R1_10 0
#define PMI_2A_R1_11 1
#define PMI_2A_R1_1j 2
diff --git a/openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h b/openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h
index c16be6a308..6f508e09ac 100644
--- a/openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h
+++ b/openair1/PHY/LTE_TRANSPORT/uci_NB_IoT.h
@@ -45,7 +45,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
wideband_cqi_rank1_2A_1_5MHz_NB_IoT ;
-#define sizeof_wideband_cqi_rank1_2A_1_5MHz_NB_IoT 16
typedef struct __attribute__((packed))
{
@@ -55,7 +54,6 @@ typedef struct __attribute__((packed))
uint16_t cqi1:4;
}
wideband_cqi_rank2_2A_1_5MHz_NB_IoT ;
-#define sizeof_wideband_cqi_rank2_2A_1_5MHz_NB_IoT 14
typedef struct __attribute__((packed))
{
@@ -64,7 +62,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_nopmi_1_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_nopmi_1_5MHz_NB_IoT 16
typedef struct __attribute__((packed))
{
@@ -74,7 +71,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT 18
typedef struct __attribute__((packed))
{
@@ -86,7 +82,6 @@ typedef struct __attribute__((packed))
uint64_t cqi1:4;
}
HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT 33
typedef struct __attribute__((packed))
{
@@ -95,7 +90,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_modes123_1_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_modes123_1_5MHz_NB_IoT 16
typedef struct __attribute__((packed))
{
@@ -104,7 +98,6 @@ typedef struct __attribute__((packed))
uint32_t mcs:5;
}
HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT 21
// **********************************************5 MHz***************************************************************************
@@ -115,7 +108,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
wideband_cqi_rank1_2A_5MHz_NB_IoT ;
-#define sizeof_wideband_cqi_rank1_2A_5MHz_NB_IoT 18
typedef struct __attribute__((packed))
{
@@ -125,7 +117,6 @@ typedef struct __attribute__((packed))
uint16_t cqi1:4;
}
wideband_cqi_rank2_2A_5MHz_NB_IoT ;
-#define sizeof_wideband_cqi_rank2_2A_5MHz_NB_IoT 15
typedef struct __attribute__((packed))
{
@@ -134,7 +125,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_nopmi_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_nopmi_5MHz_NB_IoT 18
typedef struct __attribute__((packed))
{
@@ -144,7 +134,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_rank1_2A_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_rank1_2A_5MHz_NB_IoT 20
typedef struct __attribute__((packed))
{
@@ -156,7 +145,6 @@ typedef struct __attribute__((packed))
uint64_t cqi1:4;
}
HLC_subband_cqi_rank2_2A_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_rank2_2A_5MHz_NB_IoT 37
typedef struct __attribute__((packed))
{
@@ -165,7 +153,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_modes123_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_modes123_5MHz_NB_IoT 18
typedef struct __attribute__((packed))
{
@@ -174,7 +161,6 @@ typedef struct __attribute__((packed))
uint32_t mcs:5;
}
HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT 21
// **********************************************10 MHz***************************************************************************
typedef struct __attribute__((packed))
@@ -184,7 +170,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
wideband_cqi_rank1_2A_10MHz_NB_IoT ;
-#define sizeof_wideband_cqi_rank1_2A_10MHz_NB_IoT 22
typedef struct __attribute__((packed))
{
@@ -194,7 +179,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
wideband_cqi_rank2_2A_10MHz_NB_IoT ;
-#define sizeof_wideband_cqi_rank2_2A_10MHz_NB_IoT 17
typedef struct __attribute__((packed))
{
@@ -203,7 +187,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_nopmi_10MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_nopmi_10MHz_NB_IoT 22
typedef struct __attribute__((packed))
{
@@ -213,7 +196,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_rank1_2A_10MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_rank1_2A_10MHz_NB_IoT 24
typedef struct __attribute__((packed))
{
@@ -225,7 +207,6 @@ typedef struct __attribute__((packed))
uint64_t cqi1:4;
}
HLC_subband_cqi_rank2_2A_10MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_rank2_2A_10MHz_NB_IoT 45
typedef struct __attribute__((packed))
{
@@ -234,7 +215,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_modes123_10MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_modes123_10MHz_NB_IoT 22
typedef struct __attribute__((packed))
{
@@ -243,7 +223,6 @@ typedef struct __attribute__((packed))
uint32_t mcs:5;
}
HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT 21
// **********************************************20 MHz***************************************************************************
typedef struct __attribute__((packed))
@@ -253,7 +232,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
wideband_cqi_rank1_2A_20MHz_NB_IoT ;
-#define sizeof_wideband_cqi_rank1_2A_20MHz_NB_IoT 20
typedef struct __attribute__((packed))
{
@@ -263,7 +241,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
wideband_cqi_rank2_2A_20MHz_NB_IoT ;
-#define sizeof_wideband_cqi_rank2_2A_20MHz_NB_IoT 21
typedef struct __attribute__((packed))
{
@@ -272,7 +249,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_nopmi_20MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_nopmi_20MHz_NB_IoT 30
typedef struct __attribute__((packed))
{
@@ -282,7 +258,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_rank1_2A_20MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_rank1_2A_20MHz_NB_IoT 32
typedef struct __attribute__((packed))
{
@@ -294,7 +269,6 @@ typedef struct __attribute__((packed))
uint64_t cqi1:4;
}
HLC_subband_cqi_rank2_2A_20MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_rank2_2A_20MHz_NB_IoT 61
typedef struct __attribute__((packed))
{
@@ -303,7 +277,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_modes123_20MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_modes123_20MHz_NB_IoT 30
typedef struct __attribute__((packed))
{
@@ -313,7 +286,6 @@ typedef struct __attribute__((packed))
}
HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT;
-#define sizeof_HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT 21
#define MAX_CQI_PAYLOAD_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT)*8*20)
#define MAX_CQI_BITS_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT)*8)
diff --git a/openair1/PHY/LTE_TRANSPORT/uci_common.h b/openair1/PHY/LTE_TRANSPORT/uci_common.h
index 78555d4928..b2d13fb1d2 100644
--- a/openair1/PHY/LTE_TRANSPORT/uci_common.h
+++ b/openair1/PHY/LTE_TRANSPORT/uci_common.h
@@ -74,7 +74,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_rank1_2A_1_5MHz;
-#define sizeof_HLC_subband_cqi_rank1_2A_1_5MHz 18
typedef struct __attribute__((packed))
{
@@ -86,7 +85,6 @@ typedef struct __attribute__((packed))
uint64_t cqi1:4;
}
HLC_subband_cqi_rank2_2A_1_5MHz;
-#define sizeof_HLC_subband_cqi_rank2_2A_1_5MHz 33
typedef struct __attribute__((packed))
{
@@ -95,7 +93,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_modes123_1_5MHz;
-#define sizeof_HLC_subband_cqi_modes123_1_5MHz 16
typedef struct __attribute__((packed))
{
@@ -144,7 +141,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_rank1_2A_5MHz;
-#define sizeof_HLC_subband_cqi_rank1_2A_5MHz 20
typedef struct __attribute__((packed))
{
@@ -156,7 +152,6 @@ typedef struct __attribute__((packed))
uint64_t cqi1:4;
}
HLC_subband_cqi_rank2_2A_5MHz;
-#define sizeof_HLC_subband_cqi_rank2_2A_5MHz 37
typedef struct __attribute__((packed))
{
@@ -165,7 +160,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_modes123_5MHz;
-#define sizeof_HLC_subband_cqi_modes123_5MHz 18
typedef struct __attribute__((packed))
{
@@ -213,7 +207,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_rank1_2A_10MHz;
-#define sizeof_HLC_subband_cqi_rank1_2A_10MHz 24
typedef struct __attribute__((packed))
{
@@ -225,7 +218,6 @@ typedef struct __attribute__((packed))
uint64_t cqi1:4;
}
HLC_subband_cqi_rank2_2A_10MHz;
-#define sizeof_HLC_subband_cqi_rank2_2A_10MHz 45
typedef struct __attribute__((packed))
{
@@ -234,7 +226,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_modes123_10MHz;
-#define sizeof_HLC_subband_cqi_modes123_10MHz 22
typedef struct __attribute__((packed))
{
@@ -282,7 +273,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_rank1_2A_20MHz;
-#define sizeof_HLC_subband_cqi_rank1_2A_20MHz 32
typedef struct __attribute__((packed))
{
@@ -294,7 +284,6 @@ typedef struct __attribute__((packed))
uint64_t cqi1:4;
}
HLC_subband_cqi_rank2_2A_20MHz;
-#define sizeof_HLC_subband_cqi_rank2_2A_20MHz 61
typedef struct __attribute__((packed))
{
@@ -303,7 +292,6 @@ typedef struct __attribute__((packed))
uint32_t cqi1:4;
}
HLC_subband_cqi_modes123_20MHz;
-#define sizeof_HLC_subband_cqi_modes123_20MHz 30
typedef struct __attribute__((packed))
{
diff --git a/openair1/PHY/NR_REFSIG/dmrs_nr.c b/openair1/PHY/NR_REFSIG/dmrs_nr.c
index 7dba224cdb..acf25e38c9 100644
--- a/openair1/PHY/NR_REFSIG/dmrs_nr.c
+++ b/openair1/PHY/NR_REFSIG/dmrs_nr.c
@@ -293,7 +293,6 @@ uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_
*
*********************************************************************/
-#define CHECK_DMRS_PBCH_SEQUENCE
/* return the position of next dmrs symbol in a slot */
int8_t get_next_dmrs_symbol_in_slot(uint16_t ul_dmrs_symb_pos, uint8_t counter, uint8_t end_symbol)
diff --git a/openair1/PHY/NR_REFSIG/nr_mod_table.h b/openair1/PHY/NR_REFSIG/nr_mod_table.h
index 81969d9a40..3ad317ed0d 100644
--- a/openair1/PHY/NR_REFSIG/nr_mod_table.h
+++ b/openair1/PHY/NR_REFSIG/nr_mod_table.h
@@ -23,10 +23,6 @@
#define __PHY_NR_REFSIG_NR_MOD_TABLE__H__
#define NR_MOD_TABLE_SIZE_SHORT 686
-#define NR_MOD_TABLE_BPSK_OFFSET 1
-#define NR_MOD_TABLE_QAM16_OFFSET 7
-#define NR_MOD_TABLE_QAM64_OFFSET 23
-#define NR_MOD_TABLE_QAM256_OFFSET 87
extern c16_t nr_qpsk_mod_table[4];
extern simde__m128i nr_qpsk_byte_mod_table[256];
diff --git a/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h b/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h
index 04fc884acc..ec8a6f590b 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h
@@ -36,8 +36,6 @@
#include "PHY/defs_nr_common.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
-#define NR_PDSCH_DMRS_ANTENNA_PORT0 1000
-#define NR_PDSCH_DMRS_NB_ANTENNA_PORTS 12
void get_antenna_ports(uint8_t *ap, uint8_t n_symbs, uint8_t config);
void get_Wt(int *Wt, const int ap, const nfapi_nr_dmrs_type_e config);
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
index 24d4950dfa..a7d5206dd0 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
@@ -50,8 +50,6 @@
#define PRINT_CRC_CHECK(a)
#endif
-// extern double cpuf;
-
void free_gNB_ulsch(NR_gNB_ULSCH_t *ulsch, uint16_t N_RB_UL)
{
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER * NR_MAX_NB_LAYERS; // number of segments to be allocated
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
index 316a16c459..aa0da63558 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
@@ -15,7 +15,6 @@
#include
#include "PHY/log_tools.h"
-#define INVALID_VALUE 255
#if T_TRACER
static void copy_c16_data_to_slot_memory(c16_t *src, c16_t *dst_slot, int nb_re_pusch, int symbol)
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
index dbf9559c4b..a6ff270840 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
@@ -46,6 +46,8 @@
#define CH_INTERP 0
#define NO_INTERP 1
+extern openair0_config_t openair0_cfg[MAX_CARDS];
+
/* Generic function to find the peak of channel estimation buffer */
void peak_estimator(c16_t *buffer, int32_t buf_len, int32_t *peak_idx, int32_t *peak_val, int32_t mean_val)
{
@@ -461,12 +463,13 @@ int nr_prs_channel_estimation(uint8_t gNB_id,
// adjusting the rx_gains for channel peak power
ch_pwr_dbm = 10 * log10(ch_pwr) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- - ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0])
+ - ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
- dB_fixed(frame_params->ofdm_symbol_size);
- prs_meas[rxAnt]->rsrp_dBm = 10 * log10(prs_meas[rxAnt]->rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- - ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0])
- - dB_fixed(ue->frame_parms.ofdm_symbol_size);
+ prs_meas[rxAnt]->rsrp_dBm =
+ 10 * log10(prs_meas[rxAnt]->rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
+ - ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
+ - dB_fixed(ue->frame_parms.ofdm_symbol_size);
// prs measurements
prs_meas[rxAnt]->gNB_id = gNB_id;
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
index 4804f41b21..4a67f2956e 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
@@ -122,7 +122,7 @@ void nr_ue_ssb_rsrp_measurements(PHY_VARS_NR_UE *ue,
typedef struct {
UE_nr_rxtx_proc_t proc;
PHY_VARS_NR_UE *ue;
- c16_t *rxdata[NB_RX_ANTENNAS_MAX];
+ c16_t *rxdata[NB_ANTENNAS_RX];
uint32_t rxdata_size;
c16_t rxdata_ant[];
} nr_meas_task_args_t;
@@ -154,10 +154,10 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
uint16_t rnti,
NR_UE_DLSCH_t dlsch[2]);
-int nr_sl_psbch_rsrp_measurements(sl_nr_ue_phy_params_t *sl_phy_params,
+int nr_sl_psbch_rsrp_measurements(PHY_VARS_NR_UE *ue,
+ sl_nr_ue_phy_params_t *sl_phy_params,
NR_DL_FRAME_PARMS *fp,
c16_t rxdataF[][fp->samples_per_slot_wCP],
- bool use_SSS,
- openair0_config_t *openair0_cfg);
+ bool use_SSS);
/** @}*/
#endif
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
index d06f458419..8a59470cbf 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
@@ -51,6 +51,8 @@
//#define DEBUG_MEAS_UE
//#define DEBUG_RANK_EST
+extern openair0_config_t openair0_cfg[MAX_CARDS];
+
void nr_ue_measurements(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
int number_rbs,
@@ -133,9 +135,10 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
ue->measurements.n0_power_avg_dB = dB_fixed(ue->measurements.n0_power_avg);
ue->measurements.wideband_cqi_tot[gNB_id] = ue->measurements.rx_power_tot_dB[gNB_id] - ue->measurements.n0_power_tot_dB;
ue->measurements.wideband_cqi_avg[gNB_id] = ue->measurements.rx_power_avg_dB[gNB_id] - ue->measurements.n0_power_avg_dB;
- ue->measurements.rx_rssi_dBm[gNB_id] = ue->measurements.rx_power_avg_dB[gNB_id] + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- - ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0])
- - dB_fixed(ue->frame_parms.ofdm_symbol_size);
+ ue->measurements.rx_rssi_dBm[gNB_id] =
+ ue->measurements.rx_power_avg_dB[gNB_id] + 30 - SQ15_SQUARED_NORM_FACTOR_DB
+ - ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
+ - dB_fixed(ue->frame_parms.ofdm_symbol_size);
LOG_D(PHY, "[gNB %d] Slot %d, RSSI %d dB (%d dBm/RE), WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n",
gNB_id,
@@ -242,11 +245,14 @@ void nr_ue_ssb_rsrp_measurements(PHY_VARS_NR_UE *ue,
uint32_t rsrp_avg = nr_ue_calculate_ssb_rsrp(fp, proc, rxdataF, symbol_offset, fp->ssb_start_subcarrier);
float rsrp_db_per_re = 10 * log10(rsrp_avg);
- openair0_config_t *cfg0 = &ue->openair0_cfg[0];
+ openair0_config_t *cfg0 = &openair0_cfg[ue->rf_map.card];
- ue->measurements.ssb_rsrp_dBm[ssb_index] = rsrp_db_per_re + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- - ((int)cfg0->rx_gain[0] - (int)cfg0->rx_gain_offset[0])
- - dB_fixed(fp->ofdm_symbol_size);
+ if (rsrp_avg == 0)
+ ue->measurements.ssb_rsrp_dBm[ssb_index] = -200; // lower than any value to be reported per Table 10.1.6.1-1 of 38.133
+ else
+ ue->measurements.ssb_rsrp_dBm[ssb_index] = rsrp_db_per_re + 30 - SQ15_SQUARED_NORM_FACTOR_DB
+ - ((int)cfg0->rx_gain[0] - (int)cfg0->rx_gain_offset[0])
+ - dB_fixed(fp->ofdm_symbol_size);
// to obtain non-integer dB value with a resoluion of 0.5dB
uint32_t signal_pwr = rsrp_avg > ue->measurements.n0_power_avg ? rsrp_avg - ue->measurements.n0_power_avg : 0;
@@ -485,9 +491,10 @@ void do_neighboring_cell_measurements(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *u
// RSRP measurements
neighboring_cell_info->ssb_rsrp = nr_ue_calculate_ssb_rsrp(frame_parms, proc, rxdataF, 0, frame_parms->ssb_start_subcarrier);
- neighboring_cell_info->ssb_rsrp_dBm = 10 * log10(neighboring_cell_info->ssb_rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- - ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0])
- - dB_fixed(ue->frame_parms.ofdm_symbol_size);
+ neighboring_cell_info->ssb_rsrp_dBm =
+ 10 * log10(neighboring_cell_info->ssb_rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
+ - ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
+ - dB_fixed(ue->frame_parms.ofdm_symbol_size);
// Send SS measurements to MAC
send_ssb_rsrp_meas(ue, proc, neighbor_cell->Nid_cell, neighboring_cell_info->ssb_rsrp_dBm, true, -1, 0.0);
@@ -519,8 +526,8 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue,
const uint8_t k_length = 8;
uint8_t l_sss = (ue->symbol_offset + 2) % ue->frame_parms.symbols_per_slot;
unsigned int ssb_offset = ue->frame_parms.first_carrier_offset + ue->frame_parms.ssb_start_subcarrier;
- double rx_gain = ue->openair0_cfg[0].rx_gain[0];
- double rx_gain_offset = ue->openair0_cfg[0].rx_gain_offset[0];
+ double rx_gain = openair0_cfg[ue->rf_map.card].rx_gain[0];
+ double rx_gain_offset = openair0_cfg[ue->rf_map.card].rx_gain_offset[0];
ue->measurements.n0_power_tot = 0;
@@ -589,11 +596,11 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue,
// Measurement units:
// - RSRP: W (dBW)
// returns RXgain to be adjusted based on target rx power (50db) - received digital power in db/RE
-int nr_sl_psbch_rsrp_measurements(sl_nr_ue_phy_params_t *sl_phy_params,
+int nr_sl_psbch_rsrp_measurements(PHY_VARS_NR_UE *ue,
+ sl_nr_ue_phy_params_t *sl_phy_params,
NR_DL_FRAME_PARMS *fp,
c16_t rxdataF[][fp->samples_per_slot_wCP],
- bool use_SSS,
- openair0_config_t *openair0_cfg)
+ bool use_SSS)
{
SL_NR_UE_PSBCH_t *psbch_rx = &sl_phy_params->psbch;
uint8_t numsym = (fp->Ncp) ? SL_NR_NUM_SYMBOLS_SSB_EXT_CP : SL_NR_NUM_SYMBOLS_SSB_NORMAL_CP;
@@ -626,9 +633,10 @@ int nr_sl_psbch_rsrp_measurements(sl_nr_ue_phy_params_t *sl_phy_params,
}
psbch_rx->rsrp_dB_per_RE = 10 * log10(rsrp / num_re);
- psbch_rx->rsrp_dBm_per_RE = psbch_rx->rsrp_dB_per_RE + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- - ((int)openair0_cfg[0].rx_gain[0] - (int)openair0_cfg[0].rx_gain_offset[0])
- - dB_fixed(fp->ofdm_symbol_size);
+ psbch_rx->rsrp_dBm_per_RE =
+ psbch_rx->rsrp_dB_per_RE + 30 - SQ15_SQUARED_NORM_FACTOR_DB
+ - ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
+ - dB_fixed(fp->ofdm_symbol_size);
int adjust_rxgain = TARGET_RX_POWER - psbch_rx->rsrp_dB_per_RE;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
index b2e43b3c16..d8604d4570 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c
@@ -45,6 +45,8 @@
//#define NR_CSIRS_DEBUG
//#define NR_CSIIM_DEBUG
+extern openair0_config_t openair0_cfg[MAX_CARDS];
+
void nr_det_A_MF_2x2(int32_t *a_mf_00,
int32_t *a_mf_01,
int32_t *a_mf_10,
@@ -237,7 +239,8 @@ static int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue,
*rsrp = rsrp_sum/meas_count;
*rsrp_dBm = dB_fixed(*rsrp) + 30 - SQ15_SQUARED_NORM_FACTOR_DB
- - ((int)ue->openair0_cfg[0].rx_gain[0] - (int)ue->openair0_cfg[0].rx_gain_offset[0]) - dB_fixed(ue->frame_parms.ofdm_symbol_size);
+ - ((int)openair0_cfg[ue->rf_map.card].rx_gain[0] - (int)openair0_cfg[ue->rf_map.card].rx_gain_offset[0])
+ - dB_fixed(ue->frame_parms.ofdm_symbol_size);
#ifdef NR_CSIRS_DEBUG
LOG_I(NR_PHY, "RSRP = %i (%i dBm)\n", *rsrp, *rsrp_dBm);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
index 822389ebdc..cd233bca26 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
@@ -65,8 +65,6 @@
#endif
#define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0)
-#define NR_NBR_SEARCHSPACE_ACT_BWP \
- 10 // The number of SearSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0)
#define RE_PER_RB 12
// after removing the 3 DMRS RE, the RB contains 9 RE with PDCCH
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c
index 619262c746..321281fcda 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c
@@ -501,7 +501,7 @@ nr_initial_sync_t sl_nr_slss_search(PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc,
sync_params->DFN,
sync_params->slot_offset);
- UE->adjust_rxgain = nr_sl_psbch_rsrp_measurements(sl_ue, frame_parms, rxdataF, false, UE->openair0_cfg);
+ UE->adjust_rxgain = nr_sl_psbch_rsrp_measurements(UE, sl_ue, frame_parms, rxdataF, false);
UE->init_sync_frame = sync_params->remaining_frames;
result.rx_offset = sync_params->rx_offset;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
index e47ff37969..b0df82c467 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
@@ -260,25 +260,13 @@ bool nr_search_ssb_common(nr_ssb_search_params_t *params);
@param dl_Carrier Pointer to DL carrier to be set
@param ul_Carrier Pointer to UL carrier to be set
*/
-void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue,
- uint64_t *dl_Carrier,
- uint64_t *ul_Carrier);
-
-/*!
- \brief This function gets the carrier frequencies either from FP or command-line-set global variables, depending on the availability of the latter
- @param ue Pointer to PHY UE
- @param sl_Carrier Pointer to SL carrier to be set
-*/
-void nr_get_carrier_frequencies_sl(PHY_VARS_NR_UE *ue,
- uint64_t *sl_Carrier);
+void nr_get_carrier_frequencies(const PHY_VARS_NR_UE *ue, uint64_t *dl_Carrier, uint64_t *ul_Carrier);
/*!
\brief This function sets the OAI RF card rx/tx params
@param openair0_cfg Pointer OAI config for a specific card
- @param rx_gain_off Rx gain offset
*/
-void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
- double rx_gain_off);
+void nr_rf_card_config_gain(openair0_config_t *openair0_cfg);
void nr_rf_card_config_freq(openair0_config_t *openair0_cfg,
uint64_t ul_Carrier,
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
index 596916f091..fd7509e496 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
@@ -152,6 +152,10 @@ typedef struct {
uint16_t E_uci_ACK; // number of coded HARQ-ACK bits
uint16_t Q_dash_ACK_rvd; // number of coded HARQ-ACK symbols reserved
uint16_t E_uci_ACK_rvd; // number of coded HARQ-ACK bits reserved
+ uint16_t Q_dash_CSI1; // number of coded CSI part 1 symbols
+ uint16_t E_uci_CSI1; // number of coded CSI part 1 bits
+ uint16_t Q_dash_CSI2; // number of coded CSI part 2 symbols
+ uint16_t E_uci_CSI2; // number of coded CSI part 2 bits
uint32_t G_ulsch; // bit capacity of ULSCH
} rate_match_info_uci_t;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
index 436ebfe5e0..1649c05aef 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
@@ -34,9 +34,9 @@
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
-void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64_t *ul_carrier){
-
- NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
+void nr_get_carrier_frequencies(const PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64_t *ul_carrier)
+{
+ const NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
if (ue->if_freq!=0) {
*dl_carrier = ue->if_freq;
*ul_carrier = *dl_carrier + ue->if_freq_off;
@@ -47,12 +47,8 @@ void nr_get_carrier_frequencies(PHY_VARS_NR_UE *ue, uint64_t *dl_carrier, uint64
}
}
-
-
-
-void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
- double rx_gain_off){
-
+void nr_rf_card_config_gain(openair0_config_t *openair0_cfg)
+{
uint8_t mod_id = 0;
uint8_t cc_id = 0;
PHY_VARS_NR_UE *ue = PHY_vars_UE_g[mod_id][cc_id];
@@ -65,7 +61,7 @@ void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
if (tx_gain)
openair0_cfg->tx_gain[i] = tx_gain;
if (rx_gain)
- openair0_cfg->rx_gain[i] = rx_gain - rx_gain_off;
+ openair0_cfg->rx_gain[i] = rx_gain;
openair0_cfg->autocal[i] = 1;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
index 8251f278ad..6708cef338 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
@@ -517,6 +517,51 @@ static void map_symbols(const nr_phy_pxsch_params_t p,
}
}
+// Function to lookup beta offset value from Table 9.3-2 in TS 38.213
+static double get_beta_offset_csi(const uint8_t beta_offset_idx)
+{
+ static const double beta_offset_values[19] = {1.125,
+ 1.250,
+ 1.375,
+ 1.625,
+ 1.750,
+ 2.000,
+ 2.250,
+ 2.500,
+ 2.875,
+ 3.125,
+ 3.500,
+ 4.000,
+ 5.000,
+ 6.250,
+ 8.000,
+ 10.000,
+ 12.625,
+ 15.875,
+ 20.000};
+
+ if (beta_offset_idx >= sizeofArray(beta_offset_values)) {
+ LOG_E(PHY, "Invalid beta_offset_index %d, using default value\n", beta_offset_idx);
+ return beta_offset_values[9];
+ }
+
+ return beta_offset_values[beta_offset_idx];
+}
+
+static uint32_t get_d_factor_re(const uint32_t a, const uint32_t b)
+{
+ uint32_t d_factor_re;
+ if (a >= b) {
+ d_factor_re = 1;
+ } else {
+ d_factor_re = floor((double)b / a);
+ if (d_factor_re == 0) {
+ d_factor_re = 1;
+ }
+ }
+ return d_factor_re;
+}
+
// Function to lookup beta offset value from Table 9.3-1 in TS 38.213
static double get_beta_offset_harq_ack(uint8_t beta_offset_index)
{
@@ -586,13 +631,19 @@ static int get_crc_uci(const uint16_t ouci)
return L;
}
-static uint16_t get_Qd(const uint16_t oack, double beta, double alpha, const uint32_t sumKr, const uint32_t s1, const uint32_t s2)
+static uint16_t get_Qd(const uint16_t oack,
+ double beta,
+ double alpha,
+ const uint32_t sumKr,
+ const uint32_t s1,
+ const uint32_t s2,
+ const uint32_t sub)
{
if (oack == 0)
return 0;
uint16_t first_term = ceil(((double)oack + get_crc_uci(oack)) * (double)beta * s1 / sumKr);
- uint16_t second_term = ceil(alpha * s2);
+ uint16_t second_term = ceil(alpha * s2) - sub;
return (first_term < second_term) ? first_term : second_term;
}
@@ -661,26 +712,41 @@ static rate_match_info_uci_t calc_rate_match_info_uci(const nfapi_nr_ue_pusch_pd
rate_match_info_uci_t rminfo = {0};
// get the number of coded HARQ-ACK symbols and bits, TS 38.212 section 6.3.2.4.1.1
- rminfo.Q_dash_ACK = get_Qd(oack, beta, alpha, sumKr, s1, s2);
+ rminfo.Q_dash_ACK = get_Qd(oack, beta, alpha, sumKr, s1, s2, 0);
rminfo.E_uci_ACK = rminfo.Q_dash_ACK * nlqm;
if (oack_rvd > 0) {
- rminfo.Q_dash_ACK_rvd = get_Qd(oack_rvd, beta, alpha, sumKr, s1, s2);
+ rminfo.Q_dash_ACK_rvd = get_Qd(oack_rvd, beta, alpha, sumKr, s1, s2, 0);
rminfo.E_uci_ACK_rvd = rminfo.Q_dash_ACK_rvd * nlqm;
}
+ // get beta offset for csi
+ const double beta_csi1 = get_beta_offset_csi(pusch_pdu->pusch_uci.beta_offset_csi1);
+
+ // get the number of coded CSI part 1 symbols and bits, TS 38.212 section 6.3.2.4.1.2
+ const uint16_t ocsi1 = pusch_pdu->pusch_uci.csi_payload.p1_bits;
+ rminfo.Q_dash_CSI1 = get_Qd(ocsi1, beta_csi1, alpha, sumKr, s1, s1, rminfo.Q_dash_ACK);
+ rminfo.E_uci_CSI1 = rminfo.Q_dash_CSI1 * nlqm;
+
+ // get the number of coded CSI part 2 symbols and bits, TS 38.212 section 6.3.2.4.1.3
+ const double beta_csi2 = get_beta_offset_csi(pusch_pdu->pusch_uci.beta_offset_csi2);
+ const uint16_t ocsi2 = pusch_pdu->pusch_uci.csi_payload.p2_bits;
+ rminfo.Q_dash_CSI2 = get_Qd(ocsi2, beta_csi2, alpha, sumKr, s1, s1, rminfo.Q_dash_ACK + rminfo.Q_dash_CSI1);
+ rminfo.E_uci_CSI2 = rminfo.Q_dash_CSI2 * nlqm;
+
+ rminfo.G_ulsch = *G - (rminfo.E_uci_CSI1 + rminfo.E_uci_CSI2);
if (oack_rvd == 0) {
- rminfo.G_ulsch = *G - rminfo.E_uci_ACK;
- } else {
- rminfo.G_ulsch = *G;
+ rminfo.G_ulsch -= rminfo.E_uci_ACK;
}
*G = rminfo.G_ulsch;
LOG_D(PHY, "[UCI_RATE_MATCH] sumKr=%u, s1=%u, s2=%u, Final G_ulsch (output G): %u\n", sumKr, s1, s2, *G);
LOG_D(PHY,
- "[UCI_RATE_MATCH] rate matching info returned: E_uci_ACK=%u, E_uci_ACK_rvd=%u, G_ulsch=%u\n",
+ "[UCI_RATE_MATCH] rate matching info returned: E_uci_ACK=%u, E_uci_ACK_rvd=%u, E_uci_CSI1=%u, E_uci_CSI2=%u, G_ulsch=%u\n",
rminfo.E_uci_ACK,
rminfo.E_uci_ACK_rvd,
+ rminfo.E_uci_CSI1,
+ rminfo.E_uci_CSI2,
rminfo.G_ulsch);
return rminfo;
@@ -747,115 +813,93 @@ static void get_first_uci_symbol(const uint8_t start_symbol,
*dmrs_p1 -= start_symbol;
}
-/*
- * This function builds the initial template by reserving positions for HARQ-ACK.
- */
-static void build_template_reserve_ack(uci_on_pusch_bit_type_t *template,
- const nfapi_nr_ue_pusch_pdu_t *pusch_pdu,
- uint32_t G_ack_rvd,
- uint8_t l1_c,
- const uint32_t *m_uci_current,
- const uint32_t *m_ulsch_initial,
- uint32_t positions_by_sym[][MAX_UCI_CODED_BITS],
- uint32_t *count_by_sym)
+static inline bool skip_mapping_current_uci(const uci_on_pusch_bit_type_t template, const uci_on_pusch_bit_type_t uci_type_to_map)
{
- const uint8_t n_symbols = pusch_pdu->nr_of_symbols;
- const uint32_t nlqm = pusch_pdu->qam_mod_order * pusch_pdu->nrOfLayers;
+ bool ret = false;
+ switch (uci_type_to_map) {
+ case BIT_TYPE_ACK_RESERVED:
+ case BIT_TYPE_ACK:
+ // ACK bits get the highest priority. Don't skip
+ ret = false;
+ break;
- memset(count_by_sym, 0, n_symbols * sizeof(uint32_t));
+ case BIT_TYPE_CSI1:
+ // Skip if already occupied by ACK and reserved ACK. Template is initialized with ULSCH
+ ret = (template != BIT_TYPE_ULSCH);
+ break;
- uint32_t symbol_start_bit_idx[14] = {0};
- for (uint8_t s = 1; s < n_symbols; s++) {
- symbol_start_bit_idx[s] = symbol_start_bit_idx[s - 1] + (m_ulsch_initial[s - 1] * nlqm);
- }
+ case BIT_TYPE_CSI2:
+ // Skip if already occupied by ACK but not reserved ACK
+ ret = (template != BIT_TYPE_ACK_RESERVED && template != BIT_TYPE_ULSCH);
+ break;
- // Reserve Positions using RE-level D-Factor Distribution
- uint32_t total_reserved = 0;
-
- for (uint8_t sym = l1_c; sym < n_symbols && total_reserved < G_ack_rvd; sym++) {
- const uint32_t uci_re_on_sym = m_uci_current[sym];
-
- if (uci_re_on_sym > 0) {
- const uint32_t remaining_to_reserve = G_ack_rvd - total_reserved;
- uint32_t d_factor_re;
- const uint32_t num_re_to_select = ceil((double)remaining_to_reserve / nlqm);
- if (num_re_to_select >= uci_re_on_sym) {
- d_factor_re = 1;
- } else {
- d_factor_re = floor((double)uci_re_on_sym / num_re_to_select);
- if (d_factor_re == 0) {
- d_factor_re = 1;
- }
- }
-
- for (uint32_t re_offset = 0; re_offset < uci_re_on_sym && total_reserved < G_ack_rvd; re_offset += d_factor_re) {
- for (uint32_t bit_in_re = 0; bit_in_re < nlqm; bit_in_re++) {
- if (total_reserved >= G_ack_rvd) {
- break;
- }
-
- uint32_t bit_offset_in_sym = (re_offset * nlqm) + bit_in_re;
- uint32_t cw_idx = symbol_start_bit_idx[sym] + bit_offset_in_sym;
- template[cw_idx] = BIT_TYPE_ACK_RESERVED;
- positions_by_sym[sym][count_by_sym[sym]] = cw_idx;
- count_by_sym[sym]++;
-
- total_reserved++;
- }
- }
- }
+ default:
+ AssertFatal(0, "Mapping called with incorrect UCI type\n");
}
+ return ret;
}
-/*
- * This function maps the HARQ-ACK bits when O_ACK > 2
- */
-static void map_non_overlapped_ack(uci_on_pusch_bit_type_t *template,
- const nfapi_nr_ue_pusch_pdu_t *pusch_pdu,
- uint16_t G_ack,
- uint8_t l1_c,
- const uint32_t *m_uci_current,
- const uint32_t *m_ulsch_initial)
-{
- const uint8_t n_symbols = pusch_pdu->nr_of_symbols;
- const uint32_t nlqm = pusch_pdu->qam_mod_order * pusch_pdu->nrOfLayers;
+struct map_uci_common_arg {
+ uci_on_pusch_bit_type_t *template;
+ uci_on_pusch_bit_type_t uci_type_to_map;
+ uint32_t n_symbols;
+ uint32_t nlqm;
+ uint16_t G_uci;
+ uint8_t l1_c;
+ uint32_t *m_uci_current;
+ uint32_t *m_ulsch_initial;
+ uint32_t (*resv_ack_pos_symb)[MAX_UCI_CODED_BITS];
+ uint32_t *resv_ack_count_symb;
+};
- uint32_t symbol_start_bit_idx[14] = {0};
- for (uint8_t s = 1; s < n_symbols; s++) {
- symbol_start_bit_idx[s] = symbol_start_bit_idx[s - 1] + (m_ulsch_initial[s - 1] * nlqm);
+static void map_uci_common(struct map_uci_common_arg p)
+{
+ DevAssert((p.resv_ack_count_symb && p.resv_ack_pos_symb && (p.uci_type_to_map == BIT_TYPE_ACK_RESERVED))
+ || (!p.resv_ack_count_symb && !p.resv_ack_pos_symb && (p.uci_type_to_map != BIT_TYPE_ACK_RESERVED)));
+
+ uint32_t symbol_start_bit_idx[NR_SYMBOLS_PER_SLOT] = {0};
+ for (uint8_t s = 1; s < p.n_symbols; s++) {
+ symbol_start_bit_idx[s] = symbol_start_bit_idx[s - 1] + (p.m_ulsch_initial[s - 1] * p.nlqm);
}
+ if (p.uci_type_to_map == BIT_TYPE_ACK_RESERVED)
+ memset(p.resv_ack_count_symb, 0, sizeof(*p.resv_ack_count_symb) * NR_SYMBOLS_PER_SLOT);
+
uint32_t total_placed = 0;
- for (uint8_t sym = l1_c; sym < n_symbols && total_placed < G_ack; sym++) {
- const uint32_t uci_re_on_sym = m_uci_current[sym];
+ for (uint8_t sym = p.l1_c; sym < p.n_symbols && total_placed < p.G_uci; sym++) {
+ const uint32_t uci_re_on_sym = p.m_uci_current[sym];
- if (uci_re_on_sym > 0) {
- const uint32_t remaining_to_place = G_ack - total_placed;
- uint32_t d_factor_re;
- const uint32_t num_re_to_select = ceil((double)remaining_to_place / nlqm);
+ if (uci_re_on_sym <= 0) {
+ continue;
+ }
- if (num_re_to_select >= uci_re_on_sym) {
- d_factor_re = 1;
- } else {
- d_factor_re = floor((double)uci_re_on_sym / num_re_to_select);
- if (d_factor_re == 0) {
- d_factor_re = 1;
- }
+ const uint32_t remaining_to_place = p.G_uci - total_placed;
+ const uint32_t num_re_to_select = ceil((double)remaining_to_place / p.nlqm);
+
+ uint32_t d_factor_re = get_d_factor_re(num_re_to_select, uci_re_on_sym);
+ uint32_t re_offset = 0;
+ uint32_t *cur_sym_resv_ack_pos = p.resv_ack_pos_symb[sym];
+ while (re_offset < uci_re_on_sym && total_placed < p.G_uci) {
+ uci_on_pusch_bit_type_t cur_template = p.template[symbol_start_bit_idx[sym] + (re_offset * p.nlqm)];
+ if (skip_mapping_current_uci(cur_template, p.uci_type_to_map)) {
+ re_offset++;
+ continue; // if RE already allocated to UCI or reserved for ACK
}
-
- for (uint32_t re_offset = 0; re_offset < uci_re_on_sym && total_placed < G_ack; re_offset += d_factor_re) {
- for (uint32_t bit_in_re = 0; bit_in_re < nlqm; bit_in_re++) {
- if (total_placed >= G_ack) {
- break;
- }
-
- uint32_t bit_offset_in_sym = (re_offset * nlqm) + bit_in_re;
- uint32_t cw_idx = symbol_start_bit_idx[sym] + bit_offset_in_sym;
- template[cw_idx] = BIT_TYPE_ACK;
-
- total_placed++;
+ for (uint32_t bit_in_re = 0; bit_in_re < p.nlqm; bit_in_re++) {
+ if (total_placed >= p.G_uci) {
+ break;
}
+
+ uint32_t bit_offset_in_sym = (re_offset * p.nlqm) + bit_in_re;
+ uint32_t cw_idx = symbol_start_bit_idx[sym] + bit_offset_in_sym;
+ p.template[cw_idx] = p.uci_type_to_map;
+ if (p.uci_type_to_map == BIT_TYPE_ACK_RESERVED) {
+ cur_sym_resv_ack_pos[p.resv_ack_count_symb[sym]++] = cw_idx;
+ }
+
+ total_placed++;
}
+ re_offset += d_factor_re;
}
}
}
@@ -877,21 +921,13 @@ static void map_overlapped_ack(uci_on_pusch_bit_type_t *template,
if (num_reserved_bits_on_sym > 0) {
const uint32_t num_ack_remaining = G_ack - ack_bits_marked;
- uint32_t d_factor;
// This d-factor is calculated for stepping through the list of *reserved bits*.
- if (num_ack_remaining >= num_reserved_bits_on_sym) {
- d_factor = 1;
- } else {
- d_factor = floor((double)num_reserved_bits_on_sym / num_ack_remaining);
- if (d_factor == 0) {
- d_factor = 1;
- }
- }
+ const uint32_t d_factor_re = get_d_factor_re(num_ack_remaining, num_reserved_bits_on_sym);
const uint32_t *reserved_indices_on_this_sym = positions_by_sym[sym_iter];
- for (uint32_t i = 0; i < num_reserved_bits_on_sym && ack_bits_marked < G_ack; i += d_factor) {
+ for (uint32_t i = 0; i < num_reserved_bits_on_sym && ack_bits_marked < G_ack; i += d_factor_re) {
uint32_t pos_to_mark = reserved_indices_on_this_sym[i];
template[pos_to_mark] = BIT_TYPE_ACK_ULSCH;
@@ -909,11 +945,17 @@ static void apply_template_to_codeword(uint8_t *codeword,
uint32_t codeword_len,
const uint8_t *ulsch_bits,
const uint64_t *cack,
+ const uint64_t *csi1,
+ const uint64_t *csi2,
uint16_t G_ack,
+ uint32_t G_csi1,
+ uint32_t G_csi2,
uint32_t G_ulsch)
{
uint32_t ulsch_idx = 0;
uint32_t ack_idx = 0;
+ uint32_t csi1_idx = 0;
+ uint32_t csi2_idx = 0;
for (uint32_t i = 0; i < codeword_len; i++) {
switch (template[i]) {
@@ -935,6 +977,24 @@ static void apply_template_to_codeword(uint8_t *codeword,
}
break;
+ case BIT_TYPE_CSI1:
+ if (G_csi1 > 0 && csi1_idx < G_csi1) {
+ uint32_t word_idx = csi1_idx / 64;
+ uint32_t bit_in_word_idx = csi1_idx % 64;
+ codeword[i] = (csi1[word_idx] >> bit_in_word_idx) & 1;
+ csi1_idx++;
+ }
+ break;
+
+ case BIT_TYPE_CSI2:
+ if (G_csi2 > 0 && csi2_idx < G_csi2) {
+ uint32_t word_idx = csi2_idx / 64;
+ uint32_t bit_in_word_idx = csi2_idx % 64;
+ codeword[i] = (csi2[word_idx] >> bit_in_word_idx) & 1;
+ csi2_idx++;
+ }
+ break;
+
case BIT_TYPE_ACK_RESERVED:
case BIT_TYPE_ULSCH:
default:
@@ -957,10 +1017,14 @@ static uci_on_pusch_bit_type_t *nr_data_control_mapping(const nfapi_nr_ue_pusch_
unsigned int G_ulsch,
uint16_t G_ack,
uint32_t G_ack_rvd,
+ uint32_t G_csi1,
+ uint32_t G_csi2,
uint8_t *codeword,
uint32_t codeword_len,
const uint8_t *ulsch_bits,
- const uint64_t *cack)
+ const uint64_t *cack,
+ const uint64_t *csi1,
+ const uint64_t *csi2)
{
if (!pusch_pdu || !codeword || codeword_len == 0 || !template)
return NULL;
@@ -989,24 +1053,40 @@ static uci_on_pusch_bit_type_t *nr_data_control_mapping(const nfapi_nr_ue_pusch_
uint32_t positions_by_sym[NR_NUMBER_OF_SYMBOLS_PER_SLOT][MAX_UCI_CODED_BITS] = {0};
uint32_t count_by_sym[NR_NUMBER_OF_SYMBOLS_PER_SLOT] = {0};
+ struct map_uci_common_arg map_arg = {.template = template,
+ .n_symbols = pusch_pdu->nr_of_symbols,
+ .nlqm = pusch_pdu->qam_mod_order * pusch_pdu->nrOfLayers,
+ .l1_c = l1_c,
+ .m_uci_current = m_uci_current,
+ .m_ulsch_initial = m_ulsch_initial};
if (G_ack_rvd > 0) {
- build_template_reserve_ack(template,
- pusch_pdu,
- G_ack_rvd,
- l1_c,
- m_uci_current,
- m_ulsch_initial,
- positions_by_sym,
- count_by_sym);
+ map_arg.uci_type_to_map = BIT_TYPE_ACK_RESERVED;
+ map_arg.G_uci = G_ack_rvd;
+ map_arg.resv_ack_pos_symb = positions_by_sym;
+ map_arg.resv_ack_count_symb = count_by_sym;
+ map_uci_common(map_arg);
} else if (G_ack > 0) {
- map_non_overlapped_ack(template, pusch_pdu, G_ack, l1_c, m_uci_current, m_ulsch_initial);
+ map_arg.uci_type_to_map = BIT_TYPE_ACK;
+ map_arg.G_uci = G_ack;
+ map_uci_common(map_arg);
}
+ // CSI part 1
+ map_arg.uci_type_to_map = BIT_TYPE_CSI1;
+ map_arg.G_uci = G_csi1;
+ map_arg.resv_ack_pos_symb = NULL;
+ map_arg.resv_ack_count_symb = NULL;
+ map_uci_common(map_arg);
+ // CSI part 2
+ map_arg.uci_type_to_map = BIT_TYPE_CSI2;
+ map_arg.G_uci = G_csi2;
+ map_uci_common(map_arg);
+
if (G_ack > 0 && G_ack_rvd > 0) {
map_overlapped_ack(template, G_ack, l1_c, n_symbols, positions_by_sym, count_by_sym);
}
- apply_template_to_codeword(codeword, template, codeword_len, ulsch_bits, cack, G_ack, G_ulsch);
+ apply_template_to_codeword(codeword, template, codeword_len, ulsch_bits, cack, csi1, csi2, G_ack, G_csi1, G_csi2, G_ulsch);
return template;
}
@@ -1106,7 +1186,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
return;
}
- if (pusch_pdu->pusch_uci.harq_ack_bit_length != 0) {
+ bool uci_present = (pusch_pdu->pusch_uci.harq_ack_bit_length != 0) || (pusch_pdu->pusch_uci.csi_payload.p1_bits != 0);
+ if (uci_present) {
rm_info = calc_rate_match_info_uci(pusch_pdu, harq_process_ul_ue, nl_qm, &G[pusch_id]);
}
@@ -1123,12 +1204,10 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
int N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig
- if (pusch_pdu->pusch_uci.harq_ack_bit_length != 0) {
- LOG_D(PHY, "[UCI_ON_PUSCH] Original HARQ-ACK bit length: %u\n", pusch_pdu->pusch_uci.harq_ack_bit_length);
- LOG_D(PHY, "[UCI_ON_PUSCH] Initial G: %u\n", G_initial_total_pusch_bits);
- // b is the block of bits transmitted on the physical channel after payload coding
- uint64_t b[16] = {0}; // limit to 1024-bit encoded length
+ // b is the block of bits transmitted on the physical channel after payload coding
+ uint64_t b_ack[16] = {0}; // limit to 1024-bit encoded length
+ if (pusch_pdu->pusch_uci.harq_ack_bit_length != 0) {
if (pucch_pdu == NULL) {
LOG_E(PHY, "nr_ue_ulsch_procedures: pucch_pdu is NULL but HARQ-ACK is present. Cannot proceed with UCI encoding.\n");
stop_meas_nr_ue_phy(UE, PUSCH_PROC_STATS);
@@ -1141,7 +1220,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
true,
rm_info.E_uci_ACK,
mod_order,
- &b[0]);
+ &b_ack[0]);
LOG_D(PHY,
"[UCI_ON_PUSCH] G_ulsch=%u (updated G[pusch_id]), G_ack=%u (M_bit), G_ack_rvd=%u, total_len=%u "
@@ -1150,7 +1229,31 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
rm_info.E_uci_ACK,
rm_info.E_uci_ACK_rvd,
G_initial_total_pusch_bits);
+ }
+ uint64_t b_csi1[16] = {0}; // limit to 1024-bit encoded length
+ uint64_t b_csi2[16] = {0}; // limit to 1024-bit encoded length
+ if (pusch_pdu->pusch_uci.csi_payload.p1_bits != 0) {
+ nr_uci_encoding(pusch_pdu->pusch_uci.csi_payload.part1_payload,
+ pusch_pdu->pusch_uci.csi_payload.p1_bits,
+ pucch_pdu->prb_size,
+ true,
+ rm_info.E_uci_CSI1,
+ mod_order,
+ &b_csi1[0]);
+
+ // Process CSI Part 2 if any
+ if (pusch_pdu->pusch_uci.csi_payload.p2_bits > 0)
+ nr_uci_encoding(pusch_pdu->pusch_uci.csi_payload.part2_payload,
+ pusch_pdu->pusch_uci.csi_payload.p2_bits,
+ pucch_pdu->prb_size,
+ true,
+ rm_info.E_uci_CSI2,
+ mod_order,
+ &b_csi2[0]);
+ }
+
+ if (uci_present) {
uint8_t temp_codeword[G_initial_total_pusch_bits];
start_meas_nr_ue_phy(UE, UCI_ON_PUSCH_MAPPING);
nr_data_control_mapping(pusch_pdu,
@@ -1158,18 +1261,19 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
G[pusch_id],
rm_info.E_uci_ACK,
rm_info.E_uci_ACK_rvd,
+ rm_info.E_uci_CSI1,
+ rm_info.E_uci_CSI2,
temp_codeword,
G_initial_total_pusch_bits,
harq_process_ul_ue->f,
- b);
+ b_ack,
+ b_csi1,
+ b_csi2);
stop_meas_nr_ue_phy(UE, UCI_ON_PUSCH_MAPPING);
memcpy(harq_process_ul_ue->f, temp_codeword, G_initial_total_pusch_bits);
uci_mapping_template = template_buffer;
}
- AssertFatal(pusch_pdu->pusch_uci.csi_part1_bit_length == 0 && pusch_pdu->pusch_uci.csi_part2_bit_length == 0,
- "UCI (CSI) on PUSCH not supported at PHY\n");
-
uint16_t start_rb = pusch_pdu->rb_start;
uint16_t start_sc = frame_parms->first_carrier_offset + (start_rb + pusch_pdu->bwp_start) * NR_NB_SC_PER_RB;
@@ -1202,9 +1306,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
/////////////////////////ULSCH scrambling/////////////////////////
uint32_t available_bits;
- bool is_uci_on_pusch = (pusch_pdu->pusch_uci.harq_ack_bit_length != 0);
- if (is_uci_on_pusch) {
+ if (uci_present) {
// UCI on PUSCH is present, so available bits are the total codeword length
available_bits = G_initial_total_pusch_bits;
} else {
@@ -1221,7 +1324,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
available_bits,
pusch_pdu->data_scrambling_id,
rnti,
- is_uci_on_pusch,
+ uci_present,
uci_mapping_template,
scrambled_output);
if (UE->phy_sim_test_buf) {
diff --git a/openair1/PHY/TOOLS/calibration_scope.c b/openair1/PHY/TOOLS/calibration_scope.c
index c7a305ab27..eb80dec38e 100644
--- a/openair1/PHY/TOOLS/calibration_scope.c
+++ b/openair1/PHY/TOOLS/calibration_scope.c
@@ -18,7 +18,7 @@ typedef struct {
#define SquaredNorm(VaR) ((VaR).r*(VaR).r+(VaR).i*(VaR).i)
typedef struct {
void ** samplesRx;
- openair0_device *rfdevice;
+ openair0_device_t *rfdevice;
} calibData_t;
typedef struct OAIgraph {
@@ -384,7 +384,8 @@ static void *scopeThread(void *arg) {
return NULL;
}
-void CalibrationInitScope(void ** samplesRx,openair0_device *rfdevice) {
+void CalibrationInitScope(void **samplesRx, openair0_device_t *rfdevice)
+{
pthread_t forms_thread;
calibData_t *tmp = (calibData_t *)malloc_or_fail(sizeof(*tmp));
tmp->samplesRx=samplesRx;
diff --git a/openair1/PHY/TOOLS/calibration_scope.h b/openair1/PHY/TOOLS/calibration_scope.h
index 052a1a6b6e..f2646d79ab 100644
--- a/openair1/PHY/TOOLS/calibration_scope.h
+++ b/openair1/PHY/TOOLS/calibration_scope.h
@@ -1,5 +1,5 @@
#ifndef CALIB_SCOPE_H
#define CALIB_SCOPE_H
-void CalibrationInitScope(void ** samplesRx,openair0_device *rfdevice);
+void CalibrationInitScope(void **samplesRx, openair0_device_t *rfdevice);
#endif
diff --git a/openair1/PHY/TOOLS/calibration_test.c b/openair1/PHY/TOOLS/calibration_test.c
index 8007040499..05420672ad 100644
--- a/openair1/PHY/TOOLS/calibration_test.c
+++ b/openair1/PHY/TOOLS/calibration_test.c
@@ -45,7 +45,6 @@ int main(int argc, char **argv) {
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
lock_memory_to_ram();
- int N_RB=50;
int sampling_rate=30.72e6;
int DFT=2048;
int TxAdvanceInDFTSize=12;
@@ -57,20 +56,8 @@ int main(int argc, char **argv) {
char * usrp_addrs="type=b200";
openair0_config_t openair0_cfg= {
- //! Module ID for this configuration
- .Mod_id=0,
- //! duplexing mode
- .duplex_mode=0,
- //! number of downlink resource blocks
- .num_rb_dl=N_RB,
- //! number of samples per frame
- .samples_per_frame=0,
//! the sample rate for both transmit and receive.
.sample_rate=sampling_rate,
- //device is doing mmapped DMA transfers
- .mmapped_dma=0,
- //! offset in samples between TX and RX paths
- .tx_sample_advance=0,
//! samples per packet on the fronthaul interface
.samples_per_packet=1024,
//! number of RX channels (=RX antennas)
@@ -83,17 +70,9 @@ int main(int argc, char **argv) {
//! \brief Center frequency in Hz for TX.
//! index: [0..rx_num_channels[ !!! see lte-ue.c:427 FIXME iterates over rx_num_channels
.tx_freq={freq,freq,freq,freq},
- //! \brief memory
- //! \brief Pointer to Calibration table for RX gains
- .rx_gain_calib_table=NULL,
- //! mode for rxgain (ExpressMIMO2)
- .rxg_mode={0},
//! \brief Gain for RX in dB.
//! index: [0..rx_num_channels]
.rx_gain={rxGain,rxGain,rxGain,rxGain},
- //! \brief Gain offset (for calibration) in dB
- //! index: [0..rx_num_channels]
- .rx_gain_offset={0},
//! gain for TX in dB
.tx_gain={txGain,txGain,txGain,txGain},
//! RX bandwidth in Hz
@@ -106,32 +85,9 @@ int main(int argc, char **argv) {
.time_source=internal, //internal gpsdo external
//! Manual SDR IP address
.sdr_addrs=usrp_addrs,
- //! Auto calibration flag
- .autocal={0},
- //! Configuration file for LMS7002M
- .configFilename="",
- //! remote IP/MAC addr for Ethernet interface
- .remote_addr="",
- //! remote port number for Ethernet interface
- .remote_port=0,
- //! local IP/MAC addr for Ethernet interface (eNB/BBU, UE)
- .my_addr=0,
- //! local port number for Ethernet interface (eNB/BBU, UE)
- .my_port=0,
- //! record player configuration, definition in record_player.h
- .recplay_mode=0,
- .recplay_conf=NULL,
- //! number of samples per tti
- .samples_per_tti=0,
};
//-----------------------
- openair0_device rfdevice= {
- /*!tx write thread*/
- //.write_thread={0},
- /*!brief Module ID of this device */
- .Mod_id=0,
- /*!brief Component Carrier ID of this device */
- .CC_id=0,
+ openair0_device_t rfdevice= {
/*!brief Type of this device */
.type=NONE_DEV,
/*!brief Transport protocol type that the device supports (in case I/Q samples need to be transported) */
@@ -306,7 +262,7 @@ int main(int argc, char **argv) {
}
CalibrationInitScope(samplesRx, &rfdevice);
- openair0_timestamp timestamp=0;
+ openair0_timestamp_t timestamp=0;
rfdevice.trx_start_func(&rfdevice);
while(!oai_exit) {
diff --git a/openair1/PHY/TOOLS/dfts_load.c b/openair1/PHY/TOOLS/dfts_load.c
index 2e4ddb595f..d2dcf316aa 100644
--- a/openair1/PHY/TOOLS/dfts_load.c
+++ b/openair1/PHY/TOOLS/dfts_load.c
@@ -35,7 +35,6 @@
#include
#include "assertions.h"
#include "common/utils/LOG/log.h"
-#define OAIDFTS_LOADER
#include "tools_defs.h"
#include "common/config/config_userapi.h"
#include "common/utils/load_module_shlib.h"
diff --git a/openair1/PHY/defs_L1_NB_IoT.h b/openair1/PHY/defs_L1_NB_IoT.h
index 97f243fae8..a963ad4e64 100644
--- a/openair1/PHY/defs_L1_NB_IoT.h
+++ b/openair1/PHY/defs_L1_NB_IoT.h
@@ -45,11 +45,6 @@
#include "defs_eNB.h"
//#include
#include "assertions.h"
-#if ENABLE_RAL
-#include "collection/hashtable/hashtable.h"
-#include "COMMON/ral_messages_types.h"
-#include "UTIL/queue.h"
-#endif
#include "common/utils/LOG/log.h"
#define msg(aRGS...) LOG_D(PHY, ##aRGS)
//use msg in the real-time thread context
@@ -59,8 +54,6 @@
#define malloc16(x) memalign(32,x)
#endif
#define free16(y,x) free(y)
-#define bigmalloc malloc
-#define bigmalloc16 malloc16
#define openair_free(y,x) free((y))
#define PAGE_SIZE 4096
@@ -86,7 +79,6 @@ static inline void* malloc16_clear( size_t size )
*/
-// #define PAGE_MASK 0xfffff000
// #define virt_to_phys(x) (x)
// #define openair_sched_exit() exit(-1)
@@ -222,7 +214,7 @@ typedef struct {
/// Context data structure for RX/TX portion of subframe processing
typedef struct {
/// timestamp transmitted to HW
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -273,9 +265,9 @@ typedef struct eNB_proc_NB_IoT_t_s {
/// thread index
int thread_index;
/// timestamp received from HW
- openair0_timestamp timestamp_rx;
+ openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
/// subframe to act upon for reception
int subframe_rx;
/// symbol mask for IF4p5 reception per subframe
@@ -414,7 +406,7 @@ typedef struct {
/// index of the current UE RX/TX proc
int proc_id;
/// timestamp transmitted to HW
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -445,7 +437,7 @@ typedef struct {
/// Context data structure for eNB subframe processing
typedef struct {
/// Last RX timestamp
- openair0_timestamp timestamp_rx;
+ openair0_timestamp_t timestamp_rx;
/// pthread attributes for main UE thread
pthread_attr_t attr_ue;
/// scheduling parameters for main UE thread
@@ -484,9 +476,9 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
eth_params_t eth_params_n;
/// Ethernet parameters for fronthaul interface (upper L1 to Radio head)
eth_params_t eth_params;
- openair0_rf_map rf_map;
+ openair0_rf_map_t rf_map;
int abstraction_flag;
- openair0_timestamp ts_offset;
+ openair0_timestamp_t ts_offset;
// indicator for synchronization state of eNB
int in_synch;
// indicator for master/slave (RRU)
@@ -672,8 +664,8 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
/// RF and Interface devices per CC
- openair0_device rfdevice;
- openair0_device ifdevice;
+ openair0_device_t rfdevice;
+ openair0_device_t ifdevice;
/// Pointer for ifdevice buffer struct
if_buffer_t ifbuffer;
@@ -731,7 +723,7 @@ typedef struct {
/// \brief Module ID indicator for this instance
uint8_t Mod_id;
/// \brief Mapping of CC_id antennas to cards
- openair0_rf_map rf_map;
+ openair0_rf_map_t rf_map;
//uint8_t local_flag;
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
runmode_NB_IoT_t mode;
@@ -956,18 +948,13 @@ typedef struct {
time_stats_t tx_prach;
/// RF and Interface devices per CC
- openair0_device rfdevice;
+ openair0_device_t rfdevice;
time_stats_t dlsch_encoding_SIC_stats;
time_stats_t dlsch_scrambling_SIC_stats;
time_stats_t dlsch_modulation_SIC_stats;
time_stats_t dlsch_llr_stripping_unit_SIC_stats;
time_stats_t dlsch_unscrambling_SIC_stats;
- #if ENABLE_RAL
- hash_table_t *ral_thresholds_timed;
- SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
- SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
- #endif
*/
} PHY_VARS_UE_NB_IoT;
diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h
index 9e69bda093..851d417804 100644
--- a/openair1/PHY/defs_RU.h
+++ b/openair1/PHY/defs_RU.h
@@ -196,9 +196,9 @@ typedef struct RU_proc_t_s {
/// Pointer to associated RU descriptor
struct RU_t_s *ru;
/// timestamp received from HW
- openair0_timestamp timestamp_rx;
+ openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
/// subframe (LTE) / slot (NR) to act upon for reception
int tti_rx;
/// subframe (LTE) / slot (NR) to act upon for transmission
@@ -354,7 +354,7 @@ typedef struct RU_proc_t_s {
/// subframe to act upon for transmission
int subframe_phy_tx;
/// timestamp to send to "slave rru"
- openair0_timestamp timestamp_phy_tx;
+ openair0_timestamp_t timestamp_phy_tx;
/// pthread structure for RF TX thread
pthread_t pthread_rf_tx;
pthread_mutex_t mutex_rf_tx;
@@ -500,7 +500,7 @@ typedef struct RU_t_s {
/// "end of burst delay" used in TDD (unit: number of samples at 30.72MHz) (this is an expert option)
int end_of_burst_delay;
/// RF device descriptor
- openair0_device rfdevice;
+ openair0_device_t rfdevice;
/// HW configuration
openair0_config_t openair0_cfg;
/// Number of NBs using this RU
@@ -510,9 +510,9 @@ typedef struct RU_t_s {
struct PHY_VARS_eNB_s *eNB_list[NUMBER_OF_eNB_MAX];
struct PHY_VARS_gNB_s *gNB_list[NUMBER_OF_gNB_MAX];
/// Mapping of antenna ports to RF chain index
- openair0_rf_map rf_map;
+ openair0_rf_map_t rf_map;
/// IF device descriptor
- openair0_device ifdevice;
+ openair0_device_t ifdevice;
/// Pointer for ifdevice buffer struct
if_buffer_t ifbuffer;
/// if prach processing is to be performed in RU
@@ -599,7 +599,7 @@ typedef struct RU_t_s {
/// sequence number for IF5
uint8_t seqno;
/// initial timestamp used as an offset make first real timestamp 0
- openair0_timestamp ts_offset;
+ openair0_timestamp_t ts_offset;
/// Current state of the RU
rru_state_t state;
/// Command to do
@@ -758,7 +758,7 @@ typedef struct processingData_RU {
int frame_tx;
int slot_tx;
int next_slot;
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
RU_t *ru;
} processingData_RU_t;
#endif //__PHY_DEFS_RU__H__
diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h
index 20d5a9ab8d..cd8ce75906 100644
--- a/openair1/PHY/defs_UE.h
+++ b/openair1/PHY/defs_UE.h
@@ -76,11 +76,6 @@
#define stop_UE_TIMING(a)
#endif
-#if ENABLE_RAL
-#include "collection/hashtable/hashtable.h"
-#include "COMMON/ral_messages_types.h"
-#include "UTIL/queue.h"
-#endif
#include "common/utils/LOG/log.h"
#define msg(aRGS...) LOG_D(PHY, ##aRGS)
@@ -91,7 +86,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -148,7 +143,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// Last RX timestamp
- openair0_timestamp timestamp_rx;
+ openair0_timestamp_t timestamp_rx;
/// pthread attributes for main UE thread
pthread_attr_t attr_ue;
/// scheduling parameters for main UE thread
@@ -550,8 +545,7 @@ typedef struct {
/// \brief Component carrier ID for this PHY instance
uint8_t CC_id;
/// \brief Mapping of CC_id antennas to cards
- openair0_rf_map rf_map;
- //uint8_t local_flag;
+ openair0_rf_map_t rf_map;
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
runmode_t mode;
/// \brief Indicator that UE is configured for FeMBMS functionality (This flag should be avoided) ... just kept for PBCH initical scan (TODO)
@@ -817,7 +811,7 @@ typedef struct {
int instance_cnt_timer;
/// RF and Interface devices per CC
- openair0_device rfdevice;
+ openair0_device_t rfdevice;
void *scopeData;
} PHY_VARS_UE;
diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h
index dbb07a9bbb..04d99108a1 100644
--- a/openair1/PHY/defs_common.h
+++ b/openair1/PHY/defs_common.h
@@ -75,7 +75,6 @@
#define RX_NB_TH_MAX 2
#define RX_NB_TH 2
-#define RX_NB_TH_DL 14
#define LTE_SLOTS_PER_SUBFRAME 2
@@ -96,7 +95,6 @@
#define MAX_MBSFN_AREA 8
-#define NB_RX_ANTENNAS_MAX 64
#define TC_NSEC_x32768 16667
@@ -936,13 +934,11 @@ typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t;
#define MAX_FRAME_NUMBER 0x400
-#define NUMBER_OF_RN_MAX 3
typedef enum {no_relay=1,unicast_relay_type1,unicast_relay_type2, multicast_relay} relaying_type_t;
#define MCS_COUNT 29
-#define MCS_TABLE_LENGTH_MAX 64
#define NUM_DCI_MAX 32
diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h
index 6ae50482cc..441c7b8f96 100644
--- a/openair1/PHY/defs_eNB.h
+++ b/openair1/PHY/defs_eNB.h
@@ -218,8 +218,8 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
- openair0_timestamp timestamp_tx;
- openair0_timestamp timestamp_rx;
+ openair0_timestamp_t timestamp_tx;
+ openair0_timestamp_t timestamp_rx;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
@@ -285,9 +285,9 @@ typedef struct L1_proc_t_s {
/// thread index
int thread_index;
/// timestamp received from HW
- openair0_timestamp timestamp_rx;
+ openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
/// subframe to act upon for reception
int subframe_rx;
/// subframe to act upon for PRACH
diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h
index f3350d707e..46ba246dbe 100644
--- a/openair1/PHY/defs_gNB.h
+++ b/openair1/PHY/defs_gNB.h
@@ -288,7 +288,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
/// slot to act upon for transmission
int slot_tx;
/// slot to act upon for reception
@@ -312,9 +312,9 @@ typedef struct gNB_L1_proc_t_s {
/// Component Carrier index
uint8_t CC_id;
/// timestamp received from HW
- openair0_timestamp timestamp_rx;
+ openair0_timestamp_t timestamp_rx;
/// timestamp to send to "slave rru"
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
/// slot to act upon for reception
int slot_rx;
/// frame to act upon for reception
@@ -566,7 +566,7 @@ union ldpcReqUnion {
typedef struct processingData_L1 {
int frame_rx;
int slot_rx;
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
PHY_VARS_gNB *gNB;
notifiedFIFO_elt_t *elt;
} processingData_L1_t;
@@ -576,7 +576,7 @@ typedef struct processingData_L1tx {
int slot;
int frame_rx;
int slot_rx;
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
PHY_VARS_gNB *gNB;
} processingData_L1tx_t;
diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h
index e96927fe21..5511d8ed0d 100644
--- a/openair1/PHY/defs_nr_UE.h
+++ b/openair1/PHY/defs_nr_UE.h
@@ -56,11 +56,6 @@
#include "actor.h"
//#include "openair1/SCHED_NR_UE/defs.h"
-#if ENABLE_RAL
-#include "common/utils/hashtable/hashtable.h"
-#include "COMMON/ral_messages_types.h"
-#include "UTIL/queue.h"
-#endif
#define msg(aRGS...) LOG_D(PHY, ##aRGS)
// use msg in the real-time thread context
#define msg_nrt printf
@@ -69,12 +64,9 @@
#define malloc16(x) memalign(32,x)
#endif
#define free16(y,x) free(y)
-#define bigmalloc malloc
-#define bigmalloc16 malloc16
#define openair_free(y,x) free((y))
#define PAGE_SIZE 4096
-#define PAGE_MASK 0xfffff000
#define virt_to_phys(x) (x)
#define openair_sched_exit() exit(-1)
@@ -113,7 +105,7 @@ typedef struct {
/// Component Carrier index
uint8_t CC_id;
/// Last RX timestamp
- openair0_timestamp timestamp_rx;
+ openair0_timestamp_t timestamp_rx;
} UE_nr_proc_t;
typedef enum {
@@ -266,7 +258,6 @@ typedef struct {
#define NR_PDCCH_DEFS_NR_UE
#define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0)
-#define NR_NBR_SEARCHSPACE_ACT_BWP 10 // The number of SearchSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0)
#ifdef NR_PDCCH_DEFS_NR_UE
#define MAX_NR_DCI_DECODED_SLOT 10 // This value is not specified
@@ -288,8 +279,6 @@ typedef struct {
fapi_nr_dl_config_dci_dl_pdu_rel15_t pdcch_config[FAPI_NR_MAX_SS];
} NR_UE_PDCCH_CONFIG;
-#define NR_PSBCH_MAX_NB_CARRIERS 132
-#define NR_PSBCH_MAX_NB_MOD_SYMBOLS 99
#define NR_PSBCH_DMRS_LENGTH 297 // in mod symbols
#define NR_PSBCH_DMRS_LENGTH_DWORD 20 // ceil(2(QPSK)*NR_PBCH_DMRS_LENGTH/32)
@@ -342,15 +331,42 @@ typedef struct UE_NR_SCAN_INFO_s {
int32_t freq_offset_Hz[3][10];
} UE_NR_SCAN_INFO_t;
+typedef struct {
+ unsigned int nb_tx;
+ unsigned int nb_rx;
+ unsigned int att_tx;
+ unsigned int att_rx;
+ int max_rxgain;
+ char *sdr_addrs;
+ char *tx_subdev;
+ char *rx_subdev;
+ clock_source_t clock_source;
+ clock_source_t time_source;
+ double tune_offset;
+ uint64_t if_frequency;
+ int if_freq_offset;
+ int used_by_cell;
+} nrUE_RU_params_t;
+
+typedef struct {
+ int ru_id;
+ int band;
+ uint64_t rf_frequency;
+ int64_t rf_freq_offset;
+ int numerology;
+ int N_RB_DL;
+ int ssb_start;
+ int used_by_ue;
+} nrUE_cell_params_t;
+
/// Top-level PHY Data Structure for UE
typedef struct PHY_VARS_NR_UE_s {
- openair0_config_t openair0_cfg[MAX_CARDS];
/// \brief Module ID indicator for this instance
uint8_t Mod_id;
/// \brief Component carrier ID for this PHY instance
uint8_t CC_id;
/// \brief Mapping of CC_id antennas to cards
- openair0_rf_map rf_map;
+ openair0_rf_map_t rf_map;
/// \brief Indicator that UE should perform band scanning
int UE_scan;
/// \brief Indicator that UE should perform coarse scanning around carrier
@@ -507,9 +523,6 @@ typedef struct PHY_VARS_NR_UE_s {
time_stats_t ue_ul_indication_stats;
nr_ue_phy_cpu_stat_t phy_cpu_stats;
- /// RF and Interface devices per CC
- openair0_device rfdevice;
-
/// Phase precompensation flag
bool no_phase_pre_comp;
@@ -540,7 +553,7 @@ typedef struct PHY_VARS_NR_UE_s {
} PHY_VARS_NR_UE;
typedef struct {
- openair0_timestamp timestamp_tx;
+ openair0_timestamp_t timestamp_tx;
int gNB_id;
/// NR slot index within frame_tx [0 .. slots_per_frame - 1] to act upon for transmission
int nr_slot_tx;
diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h
index b9948eaf92..dc2630348c 100644
--- a/openair1/PHY/defs_nr_common.h
+++ b/openair1/PHY/defs_nr_common.h
@@ -46,23 +46,16 @@
#define NR_SYMBOLS_PER_SLOT NR_NUMBER_OF_SYMBOLS_PER_SLOT
#define ONE_OVER_SQRT2_Q15 23170
-#define ONE_OVER_TWO_Q15 16384
#define NR_MOD_TABLE_SIZE_SHORT 686
-#define NR_MOD_TABLE_BPSK_OFFSET 1
-#define NR_MOD_TABLE_QAM16_OFFSET 7
-#define NR_MOD_TABLE_QAM64_OFFSET 23
-#define NR_MOD_TABLE_QAM256_OFFSET 87
#define NR_PSS_LENGTH 127
#define NR_SSS_LENGTH 127
#define NR_MAX_PRS_LENGTH 3264 //272*6(max allocation per RB)*2(QPSK)
#define NR_MAX_PRS_INIT_LENGTH_DWORD 102 // ceil(NR_MAX_CSI_RS_LENGTH/32)
-#define NR_MAX_NUM_PRS_SYMB 12
#define NR_MAX_PRS_COMB_SIZE 12
#define NR_MAX_PRS_RESOURCES_PER_SET 64
-#define NR_MAX_PRS_MUTING_PATTERN_LENGTH 32
#define NR_PBCH_DMRS_LENGTH 144 // in mod symbols
#define NR_PBCH_DMRS_LENGTH_DWORD 10 // ceil(2(QPSK)*NR_PBCH_DMRS_LENGTH/32)
@@ -70,7 +63,6 @@
/*used for the resource mapping*/
#define NR_MAX_PDCCH_DMRS_LENGTH 576 // 16(L)*2(QPSK)*3(3 DMRS symbs per REG)*6(REG per CCE)
#define NR_MAX_PDCCH_SIZE 8192 // It seems it is the max polar coded block size
-#define NR_MAX_DCI_PAYLOAD_SIZE 64
#define NR_MAX_DCI_SIZE 1728 //16(L)*2(QPSK)*9(12 RE per REG - 3(DMRS))*6(REG per CCE)
#define NR_MAX_DCI_SIZE_DWORD 54 // ceil(NR_MAX_DCI_SIZE/32)
@@ -87,7 +79,6 @@
#define MAX_NUM_NR_SRS_SYMBOLS 4
#define MAX_NUM_NR_SRS_AP 4
-#define NR_NB_NSCID 2
#define MAX_DELAY_COMP 20
@@ -334,7 +325,7 @@ uint32_t get_samples_slot_duration(const NR_DL_FRAME_PARMS *fp, unsigned int sta
// Get timestamp of slot from start of frame
uint32_t get_samples_slot_timestamp(const NR_DL_FRAME_PARMS *fp, unsigned int slot);
// Get slot from timestamp
-uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, const NR_DL_FRAME_PARMS *fp);
+uint32_t get_slot_from_timestamp(openair0_timestamp_t timestamp_rx, const NR_DL_FRAME_PARMS *fp);
// Get number of samples in the slot
uint32_t get_samples_per_slot(int slot, const NR_DL_FRAME_PARMS *fp);
diff --git a/openair1/PHY/defs_nr_sl_UE.h b/openair1/PHY/defs_nr_sl_UE.h
index 4fec84f550..e082223434 100644
--- a/openair1/PHY/defs_nr_sl_UE.h
+++ b/openair1/PHY/defs_nr_sl_UE.h
@@ -46,7 +46,6 @@
// 11 RBs for PSBCH in one symbol * 12 REs
#define SL_NR_NUM_PSBCH_RE_IN_ONE_SYMBOL 132
// 3 DMRS REs per RB * 11 RBS in one symbol
-#define SL_NR_NUM_PSBCH_DMRS_RE_IN_ONE_SYMBOL 33
// 9 PSBCH DATA REs * 11 RBS in one symbol
#define SL_NR_NUM_PSBCH_DATA_RE_IN_ONE_SYMBOL 99
#define SL_NR_NUM_PSBCH_RBS_IN_ONE_SYMBOL 11
@@ -54,7 +53,6 @@
// 11 * (12-3 DMRS REs) * 9 symbols for PSBCH
#define SL_NR_NUM_PSBCH_MODULATED_SYMBOLS 891
#define SL_NR_NUM_PSBCH_DATA_RE_IN_ONE_RB 9
-#define SL_NR_NUM_PSBCH_DMRS_RE_IN_ONE_RB 3
// 11 * (12-3 DMRS REs) * 9 symbols for PSBCH
#define SL_NR_NUM_PSBCH_DATA_RE_IN_ALL_SYMBOLS 891
@@ -63,7 +61,6 @@
#define SL_NR_NUM_PSS_SYMBOLS 2
#define SL_NR_NUM_SSS_SYMBOLS 2
#define SL_NR_PSS_START_SYMBOL 1
-#define SL_NR_SSS_START_SYMBOL 3
#define SL_NR_NUM_PSS_OR_SSS_SYMBOLS 2
#define SL_NR_PSS_SEQUENCE_LENGTH 127
#define SL_NR_SSS_SEQUENCE_LENGTH 127
diff --git a/openair1/PHY/impl_defs_lte_NB_IoT.h b/openair1/PHY/impl_defs_lte_NB_IoT.h
index b9e5965452..d70c577c72 100644
--- a/openair1/PHY/impl_defs_lte_NB_IoT.h
+++ b/openair1/PHY/impl_defs_lte_NB_IoT.h
@@ -489,10 +489,6 @@ typedef struct {
uint16_t dl_GapDurationCoeff;
} DL_GapConfig_NB_IoT;
-#define NBIOT_INBAND_LTEPCI 0
-#define NBIOT_INBAND_IOTPCI 1
-#define NBIOT_INGUARD 2
-#define NBIOT_STANDALONE 3
typedef struct {
diff --git a/openair1/PHY/impl_defs_nr.h b/openair1/PHY/impl_defs_nr.h
index 9db686d664..41a38291c6 100644
--- a/openair1/PHY/impl_defs_nr.h
+++ b/openair1/PHY/impl_defs_nr.h
@@ -325,9 +325,6 @@ typedef struct {
*
************************************************************************/
-#define MAX_NR_RATE_MATCH_PATTERNS 4
-#define MAX_NR_ZP_CSI_RS_RESOURCES 32
-#define MAX_NR_OF_DL_ALLOCATIONS 16
#define MAX_NR_OF_UL_ALLOCATIONS (16)
typedef enum {
diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h
index 178549e5cc..a59244a14b 100644
--- a/openair1/PHY/impl_defs_top.h
+++ b/openair1/PHY/impl_defs_top.h
@@ -128,10 +128,6 @@
#define EXTENSION_TYPE (PHY_config->PHY_framing.Extension_type)
-#define NUMBER_OF_OFDM_CARRIERS_BYTES NUMBER_OF_OFDM_CARRIERS*4
-//#define NUMBER_OF_USEFUL_CARRIERS_BYTES NUMBER_OF_USEFUL_CARRIERS*4
-#define HALF_NUMBER_OF_USER_CARRIERS_BYTES NUMBER_OF_USEFUL_CARRIERS/2
-
#define CYCLIC_PREFIX_LENGTH (frame_parms->nb_prefix_samples)
#define CYCLIC_PREFIX_LENGTH_SAMPLES (CYCLIC_PREFIX_LENGTH*2)
#define CYCLIC_PREFIX_LENGTH_BYTES (CYCLIC_PREFIX_LENGTH*4)
@@ -191,8 +187,6 @@
#define MIN_RF_GAIN 80
#define PHY_SYNCH_OFFSET ((OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES)-1) // OFFSET of BEACON SYNCH
-#define PHY_SYNCH_MIN_POWER 1000
-#define PHY_SYNCH_THRESHOLD 100
@@ -224,30 +218,6 @@
///Third Amplitude for QAM256 (\f$ 2^{15} \times 2/\sqrt{170}\f$)
#define QAM256_n3 5026
-/// First Amplitude for QAM16 for TM5 (\f$ 2^{15} \times 2/sqrt(20)\f$)
-#define QAM16_TM5_n1 14654
-/// Second Amplitude for QAM16 for TM5 Receiver (\f$ 2^{15} \times 1/\sqrt{20}\f$)
-#define QAM16_TM5_n2 7327
-
-///First Amplitude for QAM64 (\f$ 2^{15} \times 4/\sqrt{84}\f$)
-#define QAM64_TM5_n1 14301
-///Second Amplitude for QAM64 (\f$ 2^{15} \times 2/\sqrt{84}\f$)
-#define QAM64_TM5_n2 7150
-///Third Amplitude for QAM64 for TM5 Receiver (\f$ 2^{15} \times 1/\sqrt{84}\f$)
-#define QAM64_TM5_n3 3575
-
-
-#ifdef BIT8_RXMUX
-#define PERROR_SHIFT 0
-#else
-#define PERROR_SHIFT 10
-#endif
-
-#define BIT8_TX_SHIFT 2
-#define BIT8_TX_SHIFT_DB 12
-
-//#define CHBCH_RSSI_MIN -75
-
#ifdef BIT8_TX
#define AMP_SHIFT 7
#else
@@ -259,14 +229,6 @@
#define AMP_OVER_SQRT2 ((AMP*ONE_OVER_SQRT2_Q15)>>15)
#define AMP_OVER_2 (AMP>>1)
-/// Threshold for PUCCH Format 1 detection
-#define PUCCH1_THRES 0
-/// Threshold for PUCCH Format 1a/1b detection
-#define PUCCH1a_THRES 4
-
-//#if defined(UPGRADE_RAT_NR)
-#if 1
-
#define NB_NUMEROLOGIES_NR (5)
#define NR_MAX_SLOTS_PER_FRAME (160) /* number of slots per frame */
@@ -277,7 +239,6 @@
#define NR_MAX_ULSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 6.1 UE procedure for receiving the physical uplink shared channel */
#define NR_MAX_DLSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 5.1 UE procedure for receiving the physical downlink shared channel */
-#endif
/// Data structure for transmission.
typedef struct {
diff --git a/openair1/PHY/impl_defs_top_NB_IoT.h b/openair1/PHY/impl_defs_top_NB_IoT.h
index 8b3360c087..a6409839a4 100644
--- a/openair1/PHY/impl_defs_top_NB_IoT.h
+++ b/openair1/PHY/impl_defs_top_NB_IoT.h
@@ -34,7 +34,6 @@
#define __PHY_IMPLEMENTATION_DEFS_NB_IOT_H__
#include "common/openairinterface5g_limits.h"
-#define ONE_OVER_SQRT2_Q15_NB_IoT 23170
#define NUMBER_OF_SUBBANDS_MAX_NB_IoT 13
typedef enum {no_relay_NB_IoT=1,unicast_relay_type1_NB_IoT,unicast_relay_type2_NB_IoT, multicast_relay_NB_IoT} relaying_type_t_NB_IoT;
diff --git a/openair1/PHY/phy_extern.h b/openair1/PHY/phy_extern.h
index f982daa584..f0de13b954 100644
--- a/openair1/PHY/phy_extern.h
+++ b/openair1/PHY/phy_extern.h
@@ -176,7 +176,5 @@ static const int8_t delta_PUSCH_abs[4] = {-4, -1, 1, 4};
static const int8_t delta_PUSCH_acc[4] = {-1, 0, 1, 3};
extern uint8_t max_turbo_iterations;
-extern double cpuf;
-
#endif /*__PHY_EXTERN_H__ */
diff --git a/openair1/SCHED/sched_eNB.h b/openair1/SCHED/sched_eNB.h
index 50c6dc2efa..408dfeb520 100644
--- a/openair1/SCHED/sched_eNB.h
+++ b/openair1/SCHED/sched_eNB.h
@@ -38,10 +38,6 @@ enum THREAD_INDEX { OPENAIR_THREAD_INDEX = 0,
openair_SCHED_NB_THREADS
}; // do not modify this line
-
-#define OPENAIR_THREAD_PRIORITY 255
-
-
#define OPENAIR_THREAD_STACK_SIZE PTHREAD_STACK_MIN //4096 //RTL_PTHREAD_STACK_MIN*6
//#define DLC_THREAD_STACK_SIZE 4096 //DLC stack size
//#define UE_SLOT_PARALLELISATION
@@ -77,10 +73,6 @@ enum openair_HARQ_TYPE {
openair_harq_RA
};
-#define DAQ_AGC_ON 1
-#define DAQ_AGC_OFF 0
-
-
/** @addtogroup _PHY_PROCEDURES_
* @{
*/
diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h
index 3ba5226542..5fe6e0c1bb 100644
--- a/openair1/SCHED_NR_UE/defs.h
+++ b/openair1/SCHED_NR_UE/defs.h
@@ -38,10 +38,6 @@
openair_SCHED_NB_THREADS
};*/ // do not modify this line
-
-#define OPENAIR_THREAD_PRIORITY 255
-
-
#define OPENAIR_THREAD_STACK_SIZE PTHREAD_STACK_MIN //4096 //RTL_PTHREAD_STACK_MIN*6
//#define DLC_THREAD_STACK_SIZE 4096 //DLC stack size
//#define UE_SLOT_PARALLELISATION
@@ -78,9 +74,6 @@
openair_harq_RA
};*/
-#define DAQ_AGC_ON 1
-#define DAQ_AGC_OFF 0
-
/** @addtogroup _PHY_PROCEDURES_
* @{
*/
diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c
index 40f3a8256b..dbdaaa4689 100644
--- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c
+++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c
@@ -229,7 +229,7 @@ int psbch_pscch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr
sym = (sym == 0) ? 5 : sym + 1;
}
- ue->adjust_rxgain = nr_sl_psbch_rsrp_measurements(sl_phy_params, fp, rxdataF, false, ue->openair0_cfg);
+ ue->adjust_rxgain = nr_sl_psbch_rsrp_measurements(ue, sl_phy_params, fp, rxdataF, false);
LOG_D(NR_PHY, " ------ Decode SL-MIB: frame.slot %d.%d ------ \n", frame_rx % 1024, nr_slot_rx);
diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c
index 0e4c59dc0e..8ca02917b0 100644
--- a/openair1/SCHED_UE/phy_procedures_lte_ue.c
+++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c
@@ -70,8 +70,6 @@
static const char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
-extern double cpuf;
-
void Msg1_transmitted(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint8_t eNB_id);
void Msg3_transmitted(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint8_t eNB_id);
diff --git a/openair1/SIMULATION/LTE_PHY/unitary_defs.h b/openair1/SIMULATION/LTE_PHY/unitary_defs.h
index f0c3f32b1b..8a411902c8 100644
--- a/openair1/SIMULATION/LTE_PHY/unitary_defs.h
+++ b/openair1/SIMULATION/LTE_PHY/unitary_defs.h
@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
-openair0_device openair0;
+openair0_device_t openair0;
int oai_exit=0;
void exit_function(const char* file, const char* function, const int line,const char* s, const int assert) {
diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c
index d760e2394b..cd952a2ecb 100644
--- a/openair1/SIMULATION/NR_PHY/dlschsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlschsim.c
@@ -67,7 +67,6 @@ uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1};
// needed for some functions
PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } };
uint16_t n_rnti = 0x1234;
-openair0_config_t openair0_cfg[MAX_CARDS];
static softmodem_params_t softmodem_params;
softmodem_params_t *get_softmodem_params(void) {
return &softmodem_params;
diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c
index 454a23770e..f1461bc25d 100644
--- a/openair1/SIMULATION/NR_PHY/dlsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlsim.c
@@ -852,13 +852,10 @@ int main(int argc, char **argv)
if (g_rbSize < 0) g_rbSize = N_RB_DL - g_rbStart;
double fs,txbw,rxbw;
- uint32_t samples;
-
get_samplerate_and_bw(mu,
N_RB_DL,
frame_parms->threequarter_fs,
&fs,
- &samples,
&txbw,
&rxbw);
@@ -932,7 +929,7 @@ int main(int argc, char **argv)
init_nr_ue_transport(UE);
- UE_mac = nr_l2_init_ue(0);
+ UE_mac = nr_l2_init_ue(0, mu);
ue_init_config_request(UE_mac, get_slots_per_frame_from_scs(mu));
UE->if_inst = nr_ue_if_module_init(0);
diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c
index 91d6a09569..abf3fd83fe 100644
--- a/openair1/SIMULATION/NR_PHY/pbchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pbchsim.c
@@ -437,9 +437,7 @@ int main(int argc, char **argv)
double fs=0, eps;
double scs = 30000;
double txbw, rxbw;
- uint32_t samples;
-
- get_samplerate_and_bw(mu, N_RB_DL, frame_parms->threequarter_fs, &fs, &samples, &txbw, &rxbw);
+ get_samplerate_and_bw(mu, N_RB_DL, frame_parms->threequarter_fs, &fs, &txbw, &rxbw);
// cfo with respect to sub-carrier spacing
eps = cfo/scs;
diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c
index 58e6321a0b..26bf44da8c 100644
--- a/openair1/SIMULATION/NR_PHY/prachsim.c
+++ b/openair1/SIMULATION/NR_PHY/prachsim.c
@@ -77,7 +77,6 @@ PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC;
RU_t *ru;
double cpuf;
-openair0_config_t openair0_cfg[MAX_CARDS];
//uint8_t nfapi_mode=0;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c
index db20b21b8f..67aa99e417 100644
--- a/openair1/SIMULATION/NR_PHY/pucchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pucchsim.c
@@ -54,7 +54,6 @@ THREAD_STRUCT thread_struct;
PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC;
-openair0_config_t openair0_cfg[MAX_CARDS];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
uint64_t downlink_frequency[MAX_NUM_CCs][4];
@@ -445,13 +444,10 @@ int main(int argc, char **argv)
gNB->common_vars.rxdataF[0][i] = malloc16_clear(gNB->frame_parms.samples_per_frame_wCP * sizeof(c16_t));
double fs,txbw,rxbw;
- uint32_t samples;
-
get_samplerate_and_bw(mu,
N_RB_DL,
frame_parms->threequarter_fs,
&fs,
- &samples,
&txbw,
&rxbw);
diff --git a/openair1/SIMULATION/NR_PHY/srssim.c b/openair1/SIMULATION/NR_PHY/srssim.c
index c86ab2b6a9..0a284a2f6d 100644
--- a/openair1/SIMULATION/NR_PHY/srssim.c
+++ b/openair1/SIMULATION/NR_PHY/srssim.c
@@ -325,8 +325,7 @@ int main(int argc, char *argv[])
snr1 = snr0 + 10;
double sampling_rate, tx_bandwidth, rx_bandwidth;
- uint32_t samples;
- get_samplerate_and_bw(mu, N_RB_DL, threequarter_fs, &sampling_rate, &samples, &tx_bandwidth, &rx_bandwidth);
+ get_samplerate_and_bw(mu, N_RB_DL, threequarter_fs, &sampling_rate, &tx_bandwidth, &rx_bandwidth);
// Initialize gNB
gNB = calloc_or_fail(1, sizeof(PHY_VARS_gNB));
diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c
index 3705df3b2c..bbe69b2cba 100644
--- a/openair1/SIMULATION/NR_PHY/ulschsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulschsim.c
@@ -73,7 +73,6 @@ double cpuf;
// needed for some functions
PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } };
uint16_t n_rnti = 0x1234;
-openair0_config_t openair0_cfg[MAX_CARDS];
void inc_ref_sched_response(int _)
{
diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c
index d7bd25555f..e545d6cba2 100644
--- a/openair1/SIMULATION/NR_PHY/ulsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulsim.c
@@ -257,15 +257,15 @@ static void prepare_ue_pusch_pdu_from_matlab_vector(const bool uci_on_pusch,
p_vec_bits += var.A;
copy_bytes_to_packed_bits(p_vec_bits, var.oack, false, pb);
- pusch_config_pdu->pusch_uci.csi_part1_bit_length = var.ocsi1;
- pb = (uint8_t *)&pusch_config_pdu->pusch_uci.csi_part1_payload;
- memset(pb, 0, sizeof(pusch_config_pdu->pusch_uci.csi_part1_payload));
+ pusch_config_pdu->pusch_uci.csi_payload.p1_bits = var.ocsi1;
+ pb = (uint8_t *)&pusch_config_pdu->pusch_uci.csi_payload.part1_payload;
+ memset(pb, 0, sizeof(pusch_config_pdu->pusch_uci.csi_payload.part1_payload));
p_vec_bits += var.oack;
copy_bytes_to_packed_bits(p_vec_bits, var.ocsi1, false, pb);
- pusch_config_pdu->pusch_uci.csi_part2_bit_length = var.ocsi2;
- pb = (uint8_t *)&pusch_config_pdu->pusch_uci.csi_part2_payload;
- memset(pb, 0, sizeof(pusch_config_pdu->pusch_uci.csi_part2_payload));
+ pusch_config_pdu->pusch_uci.csi_payload.p2_bits = var.ocsi2;
+ pb = (uint8_t *)&pusch_config_pdu->pusch_uci.csi_payload.part2_payload;
+ memset(pb, 0, sizeof(pusch_config_pdu->pusch_uci.csi_payload.part2_payload));
p_vec_bits += var.ocsi1;
copy_bytes_to_packed_bits(p_vec_bits, var.ocsi2, false, pb);
}
@@ -711,12 +711,10 @@ int main(int argc, char *argv[])
snr1 = snr0 + 10;
double sampling_frequency, tx_bandwidth, rx_bandwidth;
- uint32_t samples;
get_samplerate_and_bw(mu,
N_RB_DL,
threequarter_fs,
&sampling_frequency,
- &samples,
&tx_bandwidth,
&rx_bandwidth);
@@ -893,7 +891,7 @@ int main(int argc, char *argv[])
init_nr_ue_transport(UE);
//Configure UE
- NR_UE_MAC_INST_t* UE_mac = nr_l2_init_ue(0);
+ NR_UE_MAC_INST_t* UE_mac = nr_l2_init_ue(0, mu);
ue_init_config_request(UE_mac, get_slots_per_frame_from_scs(mu));
@@ -1349,9 +1347,7 @@ int main(int argc, char *argv[])
.beta_offset_harq_ack = 11,
.harq_ack_bit_length = 3,
.harq_payload = 3,
- //.csi_part1_bit_length = 4,
- //.csi_part1_payload = 15
- };
+ .csi_payload = {.p1_bits = 4, .part1_payload = 15, .p2_bits = 4, .part2_payload = 15}};
pusch_config_pdu->pusch_uci = pusch_uci;
prepare_ue_pusch_pdu_from_matlab_vector(uci_on_pusch, uci_ulsch_matlab_vec, pusch_config_pdu, cw_buf);
}
@@ -1603,7 +1599,6 @@ int main(int argc, char *argv[])
}
}
}
- round++;
if (uci_on_pusch && uci_ulsch_matlab_vec && (errors_scrambling[round] == 0)) {
ret = 0;
printf("*************\n");
@@ -1611,6 +1606,7 @@ int main(int argc, char *argv[])
printf("*************\n");
break;
}
+ round++;
} // round
if (n_trials == 1 && errors_scrambling[0] > 0) {
diff --git a/openair1/SIMULATION/TOOLS/DOC/channel_simulation.md b/openair1/SIMULATION/TOOLS/DOC/channel_simulation.md
index e3e3bd3189..b7380ec422 100644
--- a/openair1/SIMULATION/TOOLS/DOC/channel_simulation.md
+++ b/openair1/SIMULATION/TOOLS/DOC/channel_simulation.md
@@ -123,17 +123,17 @@ Please refer to this documentation [telnetusage.md](../../../../common/utils/tel
When the `chanmod` option is enabled, the RF channel simulator with a channel modeling function is called. Add the following options to the command line to enable the channel model:
```bash
---rfsimulator.options chanmod
+--rfsimulator.[0].options chanmod
```
Example run of OAI RFSIM on the same machine with activation of the channel model via command line:
gNB:
```bash
-sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.options chanmod --telnetsrv
+sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.[0].options chanmod --telnetsrv
```
UE:
```bash
-sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --rfsimulator.serveraddr 127.0.0.1 --uicc0.imsi 001010000000001 -O ../../../ci-scripts/conf_files/nrue.uicc.conf --rfsimulator.options chanmod
+sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --rfsimulator.[0].serveraddr 127.0.0.1 --uicc0.imsi 001010000000001 -O ../../../ci-scripts/conf_files/nrue.uicc.conf --rfsimulator.[0].options chanmod
```
where `@include "channelmod_rfsimu.conf"` has been added at the end of `ci-scripts/conf_files/channelmod_rfsimu.conf` which has been copied to `targets/PROJECTS/GENERIC-LTE-EPC/CONF/`.
@@ -175,7 +175,7 @@ Example usage, set the offset for the selected model of the selected `modellist`
e.g. with the softmodem:
```bash
-sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.options chanmod --telnetsrv --channelmod.modellist modellist_rfsimu_2 --channelmod.modellist_rfsimu_2.[1].offset 120
+sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.[0].options chanmod --telnetsrv --channelmod.modellist modellist_rfsimu_2 --channelmod.modellist_rfsimu_2.[1].offset 120
```
## Real time control and monitoring with telnet server
diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h
index 6e60ce76de..d31109a836 100644
--- a/openair1/SIMULATION/TOOLS/sim.h
+++ b/openair1/SIMULATION/TOOLS/sim.h
@@ -328,8 +328,8 @@ typedef struct {
int RU_output_mask[NUMBER_OF_UE_MAX];
pthread_mutex_t RU_output_mutex[NUMBER_OF_UE_MAX];
pthread_mutex_t UE_output_mutex[NUMBER_OF_RU_MAX];
- openair0_timestamp current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
- openair0_timestamp current_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
+ openair0_timestamp_t current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
+ openair0_timestamp_t current_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
double ru_amp[NUMBER_OF_RU_MAX];
} sim_t;
diff --git a/openair1/SIMULATION/TOOLS/uci_on_pusch_encode.m b/openair1/SIMULATION/TOOLS/uci_on_pusch_encode.m
index 0b83d211d2..c2d41dcacb 100644
--- a/openair1/SIMULATION/TOOLS/uci_on_pusch_encode.m
+++ b/openair1/SIMULATION/TOOLS/uci_on_pusch_encode.m
@@ -1,5 +1,5 @@
% ulsim command for same pusch config
-% ./nr_ulsim -m 27 -u 1 -R 51 -r 51 -s 300 -o uci_on_pusch_7.bin
+% ./nr_ulsim -m 27 -u 1 -R 51 -r 51 -s 300 -ouci_on_pusch_oack3_ocsi14_ocsi20.bin
carrier = nrCarrierConfig;
carrier.NSizeGrid = 51;
@@ -32,7 +32,7 @@ pusch.DMRS.SequenceHopping = 0;
pusch.BetaOffsetACK = 20;
pusch.BetaOffsetCSI1 = 6.25;
-pusch.BetaOffsetCSI2 = 1;
+pusch.BetaOffsetCSI2 = 6.25;
pusch.UCIScaling = 1;
A = 37896;
@@ -41,17 +41,17 @@ rv = 0;
modulation = pusch.Modulation;
nlayers = pusch.NumLayers; % Number of layers for decoding
-oack = 7;
-ocsi1 = 0;
-ocsi2 = 0;
+oack = 3;
+ocsi1 = 4;
+ocsi2 = 4;
cbsInfo = nrULSCHInfo(pusch, rate, A, oack, ocsi1, ocsi2); % Get ULSCH information
ack = randi([0 1],oack,1);
csi1 = randi([0 1],ocsi1,1);
csi2 = randi([0 1],ocsi2,1);
cack = nrUCIEncode(ack,cbsInfo.GACK,pusch.Modulation);
-ccsi1 = [];
-ccsi2 = [];
+ccsi1 = nrUCIEncode(csi1,cbsInfo.GCSI1,pusch.Modulation);
+ccsi2 = nrUCIEncode(csi2,cbsInfo.GCSI2,pusch.Modulation);
tb_data = randi([0 1],A,1);
% Transport block CRC attachment
@@ -73,7 +73,8 @@ culsch = chIn;
cw_scr = nrPUSCHScramble(cw,pusch.NID,pusch.RNTI);
% Write to bin file
-fid = fopen('uci_on_pusch_7.bin', 'wb');
+file_name = sprintf('uci_on_pusch_oack%d_ocsi1%d_ocsi2%d.bin', oack, ocsi1, ocsi2);
+fid = fopen(file_name, 'wb');
to_write = [A,oack,ocsi1,ocsi2,length(cw),length(cw_scr)];
fwrite(fid, to_write, 'uint32'); % Write the data to the binary file
fwrite(fid, tb_data, "uint8");
diff --git a/openair2/COMMON/as_message.h b/openair2/COMMON/as_message.h
index a134c1b47c..d82d1ce53f 100644
--- a/openair2/COMMON/as_message.h
+++ b/openair2/COMMON/as_message.h
@@ -474,6 +474,7 @@ typedef struct nas_pdu_session_req_s {
int pdusession_type;
int sst;
int sd;
+ char dnn[103]; /* 24.501 §9.11.2.1A: max length 102 + 0-byte */
} nas_pdu_session_req_t;
/*
diff --git a/openair2/COMMON/e1ap_messages_types.h b/openair2/COMMON/e1ap_messages_types.h
index 6906d54704..711c126dab 100644
--- a/openair2/COMMON/e1ap_messages_types.h
+++ b/openair2/COMMON/e1ap_messages_types.h
@@ -33,7 +33,6 @@
/* Definitions according to 3GPP TS 38.463 */
#define E1AP_MAX_NUM_TRANSAC_IDS 4
#define E1AP_MAX_NUM_PLMNS 4
-#define E1AP_MAX_NUM_SLICES 1024
#define E1AP_MAX_NUM_CELL_GROUPS 4
#define E1AP_MAX_NUM_QOS_FLOWS 64
#define E1AP_MAX_NUM_PDU_SESSIONS 4
diff --git a/openair2/COMMON/f1ap_messages_types.h b/openair2/COMMON/f1ap_messages_types.h
index a92f14ca50..0cd090ebc7 100644
--- a/openair2/COMMON/f1ap_messages_types.h
+++ b/openair2/COMMON/f1ap_messages_types.h
@@ -74,7 +74,6 @@
*/
#define F1AP_TRANSPORT_LAYER_ADDRESS_SIZE (160 / 8)
-#define F1AP_MAX_NB_CU_IP_ADDRESS 10
// Note this should be 512 from maxval in 38.473
#define F1AP_MAX_NB_CELLS 2
@@ -82,7 +81,6 @@
#define F1AP_MAX_NO_OF_TNL_ASSOCIATIONS 32
#define F1AP_MAX_NO_UE_ID 1024
-#define F1AP_MAX_NO_OF_INDIVIDUAL_CONNECTIONS_TO_RESET 65536
/* 9.3.1.42 of 3GPP TS 38.473 - gNB-CU System Information */
#define F1AP_MAX_NO_SIB_TYPES 32
@@ -552,6 +550,9 @@ typedef struct f1ap_ue_context_mod_req_t {
byte_array_t *rrc_container;
+ // gNB-DU Configuration Query
+ bool *gNB_DU_Configuration_Query;
+
int srbs_len;
f1ap_srb_to_setup_t *srbs; // reuse the same type as for setup; there is a
// list for SRB modification
diff --git a/openair2/COMMON/mac_rrc_primitives.h b/openair2/COMMON/mac_rrc_primitives.h
index d65b31b145..3ec4959a4c 100644
--- a/openair2/COMMON/mac_rrc_primitives.h
+++ b/openair2/COMMON/mac_rrc_primitives.h
@@ -83,11 +83,6 @@ result could be based on an event-driven measurement report.
#define NUMBER_OF_MEASUREMENT_SUBBANDS 16
-#define RRC_RACH_ASS_REQ 0
-#define MAC_RACH_BW_REQ 1
-
-
-
/*! MAC/PHY Measurement Structure*/
/*! \brief Logical Channel ID structure */
typedef struct {
@@ -325,20 +320,11 @@ typedef struct { //RRC_INTERFACE_FUNCTIONS
} RRC_XFACE;
//#define IDLE 0
-#define NEED_RADIO_CONFIG 3
#define RADIO_CONFIG_TX 2
#define RADIO_CONFIG_OK 1
-#define MEAS_CONFIGURED 4
-#define MEAS_OK 5
-#define MEAS_TRIGGER 6
-#define RRC_MEAS_REPORT_REQ 7
#define MEAS_REPORT 8
-#define RAB_MEAS_IND 0
-#define DEF_MEAS_IND 1
-#define ADD_LC 0
-#define REMOVE_LC 1
#endif
diff --git a/openair2/COMMON/messages_def.h b/openair2/COMMON/messages_def.h
index 8334700dd0..5e7d6d76f5 100644
--- a/openair2/COMMON/messages_def.h
+++ b/openair2/COMMON/messages_def.h
@@ -30,9 +30,6 @@
#include "pdcp_messages_def.h"
#include "rrc_messages_def.h"
#include "nas_messages_def.h"
-#if ENABLE_RAL
-#include "ral_messages_def.h"
-#endif
#include "s1ap_messages_def.h"
#include "f1ap_messages_def.h"
#include "x2ap_messages_def.h"
diff --git a/openair2/COMMON/networkDef.h b/openair2/COMMON/networkDef.h
index 89f8d5fc44..14e629b3bc 100644
--- a/openair2/COMMON/networkDef.h
+++ b/openair2/COMMON/networkDef.h
@@ -228,9 +228,6 @@ typedef struct {
*/
typedef struct {
unsigned char id; /* Packet filter identifier */
-#define NET_PACKET_FILTER_DOWNLINK 0x01
-#define NET_PACKET_FILTER_UPLINK 0x02
-#define NET_PACKET_FILTER_BIDIR 0x03
unsigned char dir; /* Packet filter direction */
unsigned char precedence; /* Evaluation precedence */
union {
diff --git a/openair2/COMMON/ngap_messages_types.h b/openair2/COMMON/ngap_messages_types.h
index 0aad7b8598..b7c6c281ec 100644
--- a/openair2/COMMON/ngap_messages_types.h
+++ b/openair2/COMMON/ngap_messages_types.h
@@ -88,7 +88,6 @@
#define NGAP_TRANSPORT_LAYER_ADDRESS_SIZE (160 / 8)
#define NGAP_MAX_NB_AMF_IP_ADDRESS 10
-#define NGAP_IMSI_LENGTH 16
#define NGAP_MAX_NO_TAI_PAGING 16 // 9.2.4.1 3GPP TS 38.413
diff --git a/openair2/COMMON/phy_messages_types.h b/openair2/COMMON/phy_messages_types.h
index aef018db76..051d9fef23 100644
--- a/openair2/COMMON/phy_messages_types.h
+++ b/openair2/COMMON/phy_messages_types.h
@@ -88,9 +88,6 @@ typedef struct PhyDeactivateReq_s {
} PhyDeactivateReq;
typedef struct PhyFindCellReq_s {
-# if ENABLE_RAL
- ral_transaction_id_t transaction_id;
-# endif
Earfcn earfcn_start;
Earfcn earfcn_end;
} PhyFindCellReq;
@@ -105,27 +102,16 @@ typedef struct PhyMeasThresholdReq_s {
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
// To be removed if the structure is filled
uint32_t dummy;
-# if ENABLE_RAL
- ral_transaction_id_t transaction_id;
- ral_link_cfg_param_t cfg_param;
-#endif
} PhyMeasThresholdReq;
typedef struct PhyMeasReportInd_s {
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
// To be removed if the structure is filled
uint32_t dummy;
-# if ENABLE_RAL
- ral_threshold_t threshold;
- ral_link_param_t link_param;
-#endif
} PhyMeasReportInd;
// UE: PHY -> RRC messages
typedef struct PhyFindCellInd_s {
-# if ENABLE_RAL
- ral_transaction_id_t transaction_id;
-# endif
uint8_t cell_nb;
CellInfo cells[MAX_REPORTED_CELL];
} PhyFindCellInd;
@@ -134,11 +120,5 @@ typedef struct PhyMeasThresholdConf_s {
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
// To be removed if the structure is filled
uint32_t dummy;
-# if ENABLE_RAL
- ral_transaction_id_t transaction_id;
- ral_status_t status;
- uint8_t num_link_cfg_params;
- ral_link_cfg_status_t cfg_status[RAL_MAX_LINK_CFG_PARAMS];
-#endif
} PhyMeasThresholdConf;
#endif /* PHY_MESSAGES_TYPES_H_ */
diff --git a/openair2/COMMON/ral_messages_def.h b/openair2/COMMON/ral_messages_def.h
deleted file mode 100644
index 7dd41b5db3..0000000000
--- a/openair2/COMMON/ral_messages_def.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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
- */
-
-MESSAGE_DEF(RRC_RAL_SYSTEM_CONFIGURATION_IND, MESSAGE_PRIORITY_MED, rrc_ral_system_configuration_ind_t, rrc_ral_system_configuration_ind)
-MESSAGE_DEF(RRC_RAL_SYSTEM_INFORMATION_IND, MESSAGE_PRIORITY_MED, rrc_ral_system_information_ind_t, rrc_ral_system_information_ind)
-
-MESSAGE_DEF(RRC_RAL_SCAN_REQ, MESSAGE_PRIORITY_MED, rrc_ral_scan_req_t, rrc_ral_scan_req)
-MESSAGE_DEF(RRC_RAL_SCAN_CONF, MESSAGE_PRIORITY_MED, rrc_ral_scan_conf_t, rrc_ral_scan_conf)
-
-MESSAGE_DEF(RRC_RAL_CONFIGURE_THRESHOLD_REQ, MESSAGE_PRIORITY_MED, rrc_ral_configure_threshold_req_t, rrc_ral_configure_threshold_req)
-MESSAGE_DEF(RRC_RAL_CONFIGURE_THRESHOLD_CONF, MESSAGE_PRIORITY_MED, rrc_ral_configure_threshold_conf_t, rrc_ral_configure_threshold_conf)
-MESSAGE_DEF(RRC_RAL_MEASUREMENT_REPORT_IND, MESSAGE_PRIORITY_MED, rrc_ral_measurement_report_ind_t, rrc_ral_measurement_report_ind)
-
-MESSAGE_DEF(RRC_RAL_CONNECTION_ESTABLISHMENT_REQ, MESSAGE_PRIORITY_MED, rrc_ral_connection_establishment_req_t, rrc_ral_connection_establishment_req)
-MESSAGE_DEF(RRC_RAL_CONNECTION_ESTABLISHMENT_CONF, MESSAGE_PRIORITY_MED, rrc_ral_connection_establishment_conf_t, rrc_ral_connection_establishment_conf)
-MESSAGE_DEF(RRC_RAL_CONNECTION_ESTABLISHMENT_IND, MESSAGE_PRIORITY_MED, rrc_ral_connection_establishment_ind_t, rrc_ral_connection_establishment_ind)
-MESSAGE_DEF(RRC_RAL_CONNECTION_REESTABLISHMENT_IND, MESSAGE_PRIORITY_MED, rrc_ral_connection_reestablishment_ind_t, rrc_ral_connection_reestablishment_ind)
-MESSAGE_DEF(RRC_RAL_CONNECTION_RECONFIGURATION_REQ, MESSAGE_PRIORITY_MAX, rrc_ral_connection_reconfiguration_req_t, rrc_ral_connection_reconfiguration_req)
-MESSAGE_DEF(RRC_RAL_CONNECTION_RECONFIGURATION_IND, MESSAGE_PRIORITY_MAX, rrc_ral_connection_reconfiguration_ind_t, rrc_ral_connection_reconfiguration_ind)
-MESSAGE_DEF(RRC_RAL_CONNECTION_RECONFIGURATION_HO_IND, MESSAGE_PRIORITY_MAX, rrc_ral_connection_reconfiguration_ho_ind_t, rrc_ral_connection_reconfiguration_ho_ind)
-
-MESSAGE_DEF(RRC_RAL_CONNECTION_RELEASE_REQ, MESSAGE_PRIORITY_MED, rrc_ral_connection_release_req_t, rrc_ral_connection_release_req)
-MESSAGE_DEF(RRC_RAL_CONNECTION_RELEASE_CONF, MESSAGE_PRIORITY_MED, rrc_ral_connection_release_conf_t, rrc_ral_connection_release_conf)
-MESSAGE_DEF(RRC_RAL_CONNECTION_RELEASE_IND, MESSAGE_PRIORITY_MED, rrc_ral_connection_release_ind_t, rrc_ral_connection_release_ind)
-
diff --git a/openair2/COMMON/ral_messages_types.h b/openair2/COMMON/ral_messages_types.h
deleted file mode 100644
index 9858d420ca..0000000000
--- a/openair2/COMMON/ral_messages_types.h
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * 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 RAL_MESSAGES_TYPES_H_
-#define RAL_MESSAGES_TYPES_H_
-#include "asn_constant.h"
-#include "common/platform_types.h"
-#include "commonDef.h"
-/* 802.21 mappings with the RRC protocol :
-(Research Report RR-12-265 Mapping of IEEE 802.21 MIH primitives to EPS/LTE protocols March 13 th, 2012, Michelle WETTERWALD, Prof. Christian BONNET )
-LINK EVENTS:
- Link_Detected System Information
-
- Link_Up RRC Connection establishment
- RRC Connection re-establishment
- RRC Connection reconfiguration
-
- Link_Down RRC Connection reconfiguration
- RRC Connection Release
-
- Link_Parameters_Report Measurement report
- Link_Going_Down N/A
- Link_Handover_Imminent N/A
- Link_Handover_Complete RRC Connection reconfiguration
- Link_PDU_Transmit_Status N/A
-
-
-LINK COMMANDS:
- Link_Capability_Discover N/A
- Link_Event_Subscribe Measurement configuration
- Link_Event_Unsubscribe Measurement configuration
- Link_Get_Parameters Measurement configuration
- Link_Configure_Thresholds Measurement configuration
- Link_Action / Disconnect RRC Connection Release
- Link_Action / Low Power N/A
- Link_Action / Power Down RRC Connection Release
- Link_Action / Power Up RRC Connection establishment
-*/
-
-#define RRC_RAL_SYSTEM_CONFIGURATION_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_system_configuration_ind
-#define RRC_RAL_SYSTEM_INFORMATION_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_system_information_ind
-
-#define RRC_RAL_SCAN_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_scan_req
-#define RRC_RAL_SCAN_CONF(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_scan_conf
-
-#define RRC_RAL_CONFIGURE_THRESHOLD_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_configure_threshold_req
-#define RRC_RAL_CONFIGURE_THRESHOLD_CONF(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_configure_threshold_conf
-#define RRC_RAL_MEASUREMENT_REPORT_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_measurement_report_ind
-
-#define RRC_RAL_CONNECTION_ESTABLISHMENT_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_establishment_req
-#define RRC_RAL_CONNECTION_ESTABLISHMENT_CONF(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_establishment_conf
-#define RRC_RAL_CONNECTION_ESTABLISHMENT_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_establishment_ind
-#define RRC_RAL_CONNECTION_REESTABLISHMENT_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_reestablishment_ind
-#define RRC_RAL_CONNECTION_RECONFIGURATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_reconfiguration_req
-#define RRC_RAL_CONNECTION_RECONFIGURATION_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_reconfiguration_ind
-#define RRC_RAL_CONNECTION_RECONFIGURATION_HO_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_reconfiguration_ho_ind
-
-#define RRC_RAL_CONNECTION_RELEASE_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_release_req
-#define RRC_RAL_CONNECTION_RELEASE_CONF(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_release_conf
-#define RRC_RAL_CONNECTION_RELEASE_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_ral_connection_release_ind
-
-#include "MIH_C_header_codec.h"
-
-typedef MIH_C_TRANSACTION_ID_T ral_transaction_id_t;
-typedef MIH_C_STATUS_T ral_status_t;
-typedef MIH_C_CHOICE_T ral_choice_t;
-typedef MIH_C_CONFIG_STATUS_T ral_config_status_t;
-typedef MIH_C_TH_ACTION_T ral_th_action_t;
-typedef MIH_C_LINK_ACTION_T ral_link_action_t;
-
-
-#define RAL_STATUS_SUCCESS MIH_C_STATUS_SUCCESS
-#define RAL_STATUS_UNSPECIFIED_FAILURE MIH_C_STATUS_UNSPECIFIED_FAILURE
-#define RAL_STATUS_REJECTED MIH_C_STATUS_REJECTED
-#define RAL_STATUS_AUTHORIZATION_FAILURE MIH_C_STATUS_AUTHORIZATION_FAILURE
-#define RAL_STATUS_NETWORK_ERROR MIH_C_STATUS_NETWORK_ERROR
-
-
-#define RAL_3GPP_ADDR_LENGTH MIH_C_3GPP_ADDR_LENGTH
-#define RAL_3GPP2_ADDR_LENGTH MIH_C_3GPP2_ADDR_LENGTH
-#define RAL_OTHER_L2_ADDR_LENGTH MIH_C_OTHER_L2_ADDR_LENGTH
-#define RAL_LINK_SCAN_RSP_LENGTH MIH_C_LINK_SCAN_RSP_LENGTH
-#define RAL_THRESHOLD_LIST_LENGTH MIH_C_THRESHOLD_LIST_LENGTH
-#define RAL_LINK_ADDR_LIST_LENGTH MIH_C_LINK_ADDR_LIST_LENGTH
-#define RAL_QOS_LIST_LENGTH MIH_C_QOS_LIST_LENGTH
-#define RAL_LINK_STATUS_REQ_LIST_LENGTH MIH_C_LINK_STATUS_REQ_LIST_LENGTH
-#define RAL_LINK_CFG_PARAM_LIST_LENGTH MIH_C_LINK_CFG_PARAM_LIST_LENGTH
-
-typedef struct ral_network_id_s {
- u_int16_t length;
- u_int8_t val[253];
-} ral_network_id_t;
-
-typedef struct ral_link_addr_s {
- u_int16_t length;
- u_int8_t val[RAL_LINK_ADDR_LIST_LENGTH];
-} ral_link_addr_t;
-
-typedef struct ral_sig_strength_s {
- ral_choice_t choice;
- union {
- uint8_t dbm;
- uint8_t percentage;
- } _union;
-} ral_sig_strength_t;
-#define RAL_SIG_STRENGTH_CHOICE_DBM (ral_choice_t)0
-#define RAL_SIG_STRENGTH_CHOICE_PERCENTAGE (ral_choice_t)1
-
-
-// FOR ENB ONLY
-typedef struct rrc_ral_system_configuration_ind_s {
- plmn_t plmn_id;
- unsigned int cell_id:28;
-} rrc_ral_system_configuration_ind_t;
-
-// FOR UE ONLY
-typedef struct rrc_ral_system_information_ind_s {
- plmn_t plmn_id;
- unsigned int cell_id:28;
- uint8_t dbm; // sig strength
- uint16_t sinr;
- uint32_t link_data_rate; //the maximum data rate in kb/s
-
-} rrc_ral_system_information_ind_t;
-
-typedef struct ral_link_scan_resp_s {
- ral_link_addr_t link_addr;
- ral_network_id_t network_id;
- ral_sig_strength_t sig_strength;
-} ral_link_scan_resp_t;
-
-typedef struct rrc_ral_scan_req_s {
- ral_transaction_id_t transaction_id;
-
-} rrc_ral_scan_req_t;
-
-typedef struct rrc_ral_scan_conf_s {
- ral_transaction_id_t transaction_id;
-#define RAL_MAX_LINK_SCAN_RESP 16
- uint8_t num_scan_resp;
- ral_link_scan_resp_t link_scan_resp[RAL_MAX_LINK_SCAN_RESP];
-} rrc_ral_scan_conf_t;
-
-typedef struct rrc_ral_connection_establishment_req_s {
- ral_transaction_id_t transaction_id;
-
-} rrc_ral_connection_establishment_req_t;
-
-typedef struct rrc_ral_connection_establishment_conf_s {
- ral_transaction_id_t transaction_id;
-
-} rrc_ral_connection_establishment_conf_t;
-
-typedef struct rrc_ral_connection_establishment_ind_s {
- uint16_t ue_id; // may be c-rnti
-} rrc_ral_connection_establishment_ind_t;
-
-
-typedef struct rrc_ral_connection_reestablishment_ind_s {
- uint16_t ue_id;
- uint8_t num_drb;
- rb_id_t drb_id[maxDRB];
- uint8_t num_srb;
-} rrc_ral_connection_reestablishment_ind_t;
-
-typedef struct rrc_ral_connection_reconfiguration_req_s {
- ral_transaction_id_t transaction_id;
- uint16_t ue_id;
- ral_link_action_t link_action;
- // uint8_t num_drb;
- // rb_id_t drb_id[maxDRB];
- // uint8_t num_srb;
-} rrc_ral_connection_reconfiguration_req_t;
-
-
-typedef struct rrc_ral_connection_reconfiguration_ind_s {
- uint16_t ue_id;
- uint8_t num_drb;
- rb_id_t drb_id[maxDRB];
- uint8_t num_srb;
-} rrc_ral_connection_reconfiguration_ind_t;
-
-typedef struct rrc_ral_connection_reconfiguration_ho_ind_s {
- uint16_t ue_id;
- uint8_t num_drb;
- rb_id_t drb_id[maxDRB];
- uint8_t num_srb;
- //unsigned int cell_id:28;
-} rrc_ral_connection_reconfiguration_ho_ind_t;
-
-
-
-
-#define RAL_ABOVE_THRESHOLD MIH_C_ABOVE_THRESHOLD
-#define RAL_BELOW_THRESHOLD MIH_C_BELOW_THRESHOLD
-#define RAL_NO_THRESHOLD 0xFF
-typedef struct ral_threshold_s {
- uint16_t threshold_val;
- uint8_t threshold_xdir;
-} ral_threshold_t;
-
-
-typedef MIH_C_LINK_PARAM_GEN_T ral_link_param_gen_t;
-#define RAL_LINK_PARAM_GEN_DATA_RATE MIH_C_LINK_PARAM_GEN_DATA_RATE
-#define RAL_LINK_PARAM_GEN_SIGNAL_STRENGTH MIH_C_LINK_PARAM_GEN_SIGNAL_STRENGTH
-#define RAL_LINK_PARAM_GEN_SINR MIH_C_LINK_PARAM_GEN_SINR
-#define RAL_LINK_PARAM_GEN_THROUGHPUT MIH_C_LINK_PARAM_GEN_THROUGHPUT
-#define RAL_LINK_PARAM_GEN_PACKET_ERROR_RATE MIH_C_LINK_PARAM_GEN_PACKET_ERROR_RATE
-#define RAL_LINK_PARAM_GEN_MAX RAL_LINK_PARAM_GEN_PACKET_ERROR_RATE
-
-typedef MIH_C_LINK_PARAM_QOS_T ral_link_param_qos_t;
-#define RAL_LINK_PARAM_QOS_MAX_NUM_DIF_COS_SUPPORTED MIH_C_LINK_PARAM_QOS_MAX_NUM_DIF_COS_SUPPORTED
-#define RAL_LINK_PARAM_QOS_MIN_PACKET_TRANSFER_DELAY_ALL_COS MIH_C_LINK_PARAM_QOS_MIN_PACKET_TRANSFER_DELAY_ALL_COS
-#define RAL_LINK_PARAM_QOS_AVG_PACKET_TRANSFER_DELAY_ALL_COS MIH_C_LINK_PARAM_QOS_AVG_PACKET_TRANSFER_DELAY_ALL_COS
-#define RAL_LINK_PARAM_QOS_MAX_PACKET_TRANSFER_DELAY_ALL_COS MIH_C_LINK_PARAM_QOS_MAX_PACKET_TRANSFER_DELAY_ALL_COS
-#define RAL_LINK_PARAM_QOS_STD_DEVIATION_PACKET_TRANSFER_DELAY MIH_C_LINK_PARAM_QOS_STD_DEVIATION_PACKET_TRANSFER_DELAY
-#define RAL_LINK_PARAM_QOS_PACKET_LOSS_RATE_ALL_COS_FRAME_RATIO MIH_C_LINK_PARAM_QOS_PACKET_LOSS_RATE_ALL_COS_FRAME_RATIO
-#define RAL_LINK_PARAM_QOS_MAX RAL_LINK_PARAM_QOS_PACKET_LOSS_RATE_ALL_COS_FRAME_RATIO
-
-typedef MIH_C_LINK_PARAM_LTE_T ral_link_param_lte_t;
-#define RAL_LINK_PARAM_LTE_UE_RSRP MIH_C_LINK_PARAM_LTE_UE_RSRP
-#define RAL_LINK_PARAM_LTE_UE_RSRQ MIH_C_LINK_PARAM_LTE_UE_RSRQ
-#define RAL_LINK_PARAM_LTE_UE_CQI MIH_C_LINK_PARAM_LTE_UE_CQI
-#define RAL_LINK_PARAM_LTE_AVAILABLE_BW MIH_C_LINK_PARAM_LTE_AVAILABLE_BW
-#define RAL_LINK_PARAM_LTE_PACKET_DELAY MIH_C_LINK_PARAM_LTE_PACKET_DELAY
-#define RAL_LINK_PARAM_LTE_PACKET_LOSS_RATE MIH_C_LINK_PARAM_LTE_PACKET_LOSS_RATE
-#define RAL_LINK_PARAM_LTE_L2_BUFFER_STATUS MIH_C_LINK_PARAM_LTE_L2_BUFFER_STATUS
-#define RAL_LINK_PARAM_LTE_MOBILE_NODE_CAPABILITIES MIH_C_LINK_PARAM_LTE_MOBILE_NODE_CAPABILITIES
-#define RAL_LINK_PARAM_LTE_EMBMS_CAPABILITY MIH_C_LINK_PARAM_LTE_EMBMS_CAPABILITY
-#define RAL_LINK_PARAM_LTE_JUMBO_FEASIBILITY MIH_C_LINK_PARAM_LTE_JUMBO_FEASIBILITY
-#define RAL_LINK_PARAM_LTE_JUMBO_SETUP_STATUS MIH_C_LINK_PARAM_LTE_JUMBO_SETUP_STATUS
-#define RAL_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW MIH_C_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW
-#define RAL_LINK_PARAM_LTE_MAX RAL_LINK_PARAM_LTE_NUM_ACTIVE_EMBMS_RECEIVERS_PER_FLOW
-
-#define RAL_LINK_PARAM_TYPE_CHOICE_GEN MIH_C_LINK_PARAM_TYPE_CHOICE_GEN // 0
-#define RAL_LINK_PARAM_TYPE_CHOICE_QOS MIH_C_LINK_PARAM_TYPE_CHOICE_QOS
-#define RAL_LINK_PARAM_TYPE_CHOICE_LTE MIH_C_LINK_PARAM_TYPE_CHOICE_LTE // 12
-
-typedef struct ral_link_param_type_s {
- ral_choice_t choice;
- union {
- ral_link_param_gen_t link_param_gen;
- ral_link_param_qos_t link_param_qos;
- ral_link_param_lte_t link_param_lte;
- } _union;
-} ral_link_param_type_t;
-
-typedef uint16_t ral_link_param_val_t;
-typedef MIH_C_NUM_COS_TYPES_T ral_num_cos_types_t ;
-
-typedef struct ral_qos_param_val_s {
- ral_choice_t choice;
- union {
- ral_num_cos_types_t num_qos_types;
- LIST(MIH_C_MIN_PK_TX_DELAY, min_pk_tx_delay)
- LIST(MIH_C_AVG_PK_TX_DELAY, avg_pk_tx_delay)
- LIST(MIH_C_MAX_PK_TX_DELAY, max_pk_tx_delay)
- LIST(MIH_C_PK_DELAY_JITTER, pk_delay_jitter)
- LIST(MIH_C_PK_LOSS_RATE, pk_loss_rate)
- } _union;
-} ral_qos_param_val_t;
-#define RAL_QOS_PARAM_VAL_CHOICE_NUM_QOS_TYPES MIH_C_QOS_PARAM_VAL_CHOICE_NUM_QOS_TYPES
-#define RAL_QOS_PARAM_VAL_CHOICE_MIN_PK_TX_DELAY MIH_C_QOS_PARAM_VAL_CHOICE_MIN_PK_TX_DELAY
-#define RAL_QOS_PARAM_VAL_CHOICE_AVG_PK_TX_DELAY MIH_C_QOS_PARAM_VAL_CHOICE_AVG_PK_TX_DELAY
-#define RAL_QOS_PARAM_VAL_CHOICE_MAX_PK_TX_DELAY MIH_C_QOS_PARAM_VAL_CHOICE_MAX_PK_TX_DELAY
-#define RAL_QOS_PARAM_VAL_CHOICE_PK_DELAY_JITTER MIH_C_QOS_PARAM_VAL_CHOICE_PK_DELAY_JITTER
-#define RAL_QOS_PARAM_VAL_CHOICE_PK_LOSS_RATE MIH_C_QOS_PARAM_VAL_CHOICE_PK_LOSS_RATE
-
-typedef struct ral_link_param_s {
- ral_link_param_type_t link_param_type;
- ral_choice_t choice;
- union {
- ral_link_param_val_t link_param_val;
- ral_qos_param_val_t qos_param_val;
- } _union;
-} ral_link_param_t;
-#define RAL_LINK_PARAM_CHOICE_LINK_PARAM_VAL MIH_C_LINK_PARAM_CHOICE_LINK_PARAM_VAL
-#define RAL_LINK_PARAM_CHOICE_QOS_PARAM_VAL MIH_C_LINK_PARAM_CHOICE_QOS_PARAM_VAL
-
-typedef struct ral_link_cfg_param_s {
- ral_link_param_type_t link_param_type;
-#define RAL_LINK_CFG_PARAM_CHOICE_TIMER_NULL 0
-#define RAL_LINK_CFG_PARAM_CHOICE_TIMER 1
- uint8_t union_choice;
- union {
- uint8_t null_attr;
- uint16_t timer_interval; // This timer value (ms) is used to set the interval between periodic reports.
- } _union;
-#define RAL_TH_ACTION_SET_NORMAL_THRESHOLD MIH_C_SET_NORMAL_THRESHOLD
-#define RAL_TH_ACTION_SET_ONE_SHOT_THRESHOLD MIH_C_SET_ONE_SHOT_THRESHOLD
-#define RAL_TH_ACTION_CANCEL_THRESHOLD MIH_C_CANCEL_THRESHOLD
- ral_th_action_t th_action; // indicates what action to apply to the listed thresholds.
- // When “Cancel threshold” is selected and no thresholds are specified, then
- // all currently configured thresholds for the given LINK_PARAM_TYPE are can-
- // celled.
- // When “Cancel threshold” is selected and thresholds are specified only those
- // configured thresholds for the given LINK_PARAM_TYPE and whose threshold
- // value match what was specified are cancelled.
- // With “Set one-shot threshold” the listed thresholds are first set and then
- // each of the threshold is cancelled as soon as it is crossed for the first
- // time.
- uint8_t num_thresholds;
-#define RAL_LINK_CFG_PARAM_MAX_THRESHOLDS 16
- ral_threshold_t thresholds[RAL_LINK_CFG_PARAM_MAX_THRESHOLDS];
-} ral_link_cfg_param_t;
-
-
-typedef struct rrc_ral_configure_threshold_req_s {
- ral_transaction_id_t transaction_id;
-#define RAL_MAX_LINK_CFG_PARAMS 16
- uint8_t num_link_cfg_params;
- ral_link_cfg_param_t link_cfg_params[RAL_MAX_LINK_CFG_PARAMS];
-} rrc_ral_configure_threshold_req_t;
-
-typedef struct ral_link_cfg_status_s {
- ral_link_param_type_t link_param_type;
- ral_threshold_t threshold;
- ral_config_status_t config_status;
-} ral_link_cfg_status_t;
-
-typedef struct rrc_ral_configure_threshold_conf_s {
- ral_transaction_id_t transaction_id;
- ral_status_t status;
- uint8_t num_link_cfg_params;
- ral_link_cfg_status_t cfg_status[RAL_MAX_LINK_CFG_PARAMS];
-} rrc_ral_configure_threshold_conf_t;
-
-typedef struct rrc_ral_measurement_report_ind_s {
- ral_threshold_t threshold;
- ral_link_param_t link_param;
-} rrc_ral_measurement_report_ind_t;
-
-
-typedef struct rrc_ral_connection_release_req_s {
- ral_transaction_id_t transaction_id;
- uint16_t ue_id;
-} rrc_ral_connection_release_req_t;
-
-typedef struct rrc_ral_connection_release_conf_s {
- ral_transaction_id_t transaction_id;
- uint16_t ue_id;
-} rrc_ral_connection_release_conf_t;
-
-
-typedef struct rrc_ral_connection_release_ind_s {
- uint16_t ue_id;
-} rrc_ral_connection_release_ind_t;
-
-
-
-
-#endif /* RAL_MESSAGES_TYPES_H_ */
diff --git a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.c b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.c
index 1a134d24da..742b450d9e 100644
--- a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.c
+++ b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.c
@@ -26,7 +26,6 @@
#include
#include
-#define MAX_NUM_RIC_REQ_ID 64
static pthread_mutex_t rc_mutex = PTHREAD_MUTEX_INITIALIZER;
diff --git a/openair2/E2AP/README.md b/openair2/E2AP/README.md
index 5644d10cb5..3a334aac09 100644
--- a/openair2/E2AP/README.md
+++ b/openair2/E2AP/README.md
@@ -187,9 +187,9 @@ e2_agent = {
```bash
cd /build
# for gNB-mono
- sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.serveraddr 127.0.0.1
+ sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.[0].serveraddr 127.0.0.1
# for CU/DU and CU-CP/CU-UP/DU split
- sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3450720000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.serveraddr 127.0.0.1
+ sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3450720000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.[0].serveraddr 127.0.0.1
```
Note: [multi-UE rfsim deployment tutorial](../../doc/NR_SA_Tutorial_OAI_multi_UE.md?ref_type=heads#run-multiple-ues-in-rfsimulator)
diff --git a/openair2/ENB_APP/RRC_paramsvalues.h b/openair2/ENB_APP/RRC_paramsvalues.h
index 3aeee1417e..c577abcf58 100644
--- a/openair2/ENB_APP/RRC_paramsvalues.h
+++ b/openair2/ENB_APP/RRC_paramsvalues.h
@@ -35,7 +35,6 @@
#define ENB_CONFIG_STRING_ENB_LIST "eNBs"
/* component carriers configuration section name */
#define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers"
-#define ENB_CONFIG_STRING_COMPONENT_BR_PARAMETERS "br_parameters"
#define ENB_CONFIG_STRING_FRAME_TYPE "frame_type"
@@ -43,7 +42,6 @@
#define ENB_CONFIG_STRING_TDD_CONFIG "tdd_config"
#define ENB_CONFIG_STRING_TDD_CONFIG_S "tdd_config_s"
#define ENB_CONFIG_STRING_PREFIX_TYPE "prefix_type"
-#define ENB_CONFIG_STRING_PREFIX_TYPE_UL "prefix_type_UL"
#define ENB_CONFIG_STRING_EUTRA_BAND "eutra_band"
#define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency"
#define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset"
@@ -51,24 +49,12 @@
#define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL"
#define ENB_CONFIG_STRING_CELL_MBSFN "Nid_cell_mbsfn"
-
-#define FRAMETYPE_OKVALUES {"FDD","TDD"}
-#define FRAMETYPE_MODVALUES { FDD, TDD}
-
#define TDDCFG(A) TDD_Config__subframeAssignment_ ## A
#define TDDCONFIG_OKRANGE { TDDCFG(sa0), TDDCFG(sa6)}
#define TDDCFGS(A) TDD_Config__specialSubframePatterns_ ## A
#define TDDCONFIGS_OKRANGE { TDDCFGS(ssp0), TDDCFGS(ssp8)}
-#define PREFIX_OKVALUES {"NORMAL","EXTENDED"}
-#define PREFIX_MODVALUES { NORMAL, EXTENDED}
-
-#define PREFIXUL_OKVALUES {"NORMAL","EXTENDED"}
-#define PREFIXUL_MODVALUES { NORMAL, EXTENDED}
-
-#define NRBDL_OKVALUES {6,15,25,50,75,100}
-
#define UETIMER_T300_OKVALUES {100,200,300,400,600,1000,1500,2000}
#define UETT300(A) LTE_UE_TimersAndConstants__t300_ ## A
#define UETIMER_T300_MODVALUES { UETT300(ms100), UETT300(ms200),UETT300(ms300),UETT300(ms400),UETT300(ms600),UETT300(ms1000),UETT300(ms1500),UETT300(ms2000)}
diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h
index dc182faf4b..14af6158dd 100644
--- a/openair2/ENB_APP/enb_config.h
+++ b/openair2/ENB_APP/enb_config.h
@@ -63,10 +63,6 @@
// Hard to find a defined value for max enb...
#define MAX_ENB 16
-#define MAX_DU 4
-#define CU_BALANCING_ALL 127
-#define CU_BALANCING_ROUND_ROBIN 126
-
typedef struct mme_ip_address_s {
unsigned ipv4:1;
unsigned ipv6:1;
diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h
index 7be234262f..fe65c70662 100644
--- a/openair2/ENB_APP/enb_paramdef.h
+++ b/openair2/ENB_APP/enb_paramdef.h
@@ -36,16 +36,6 @@
#include "RRC_paramsvalues.h"
#include "s1ap_eNB_default_values.h"
-#define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function"
-#define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing"
-#define ENB_CONFIG_STRING_CC_NODE_SYNCH_REF "node_synch_ref"
-
-// OTG config per ENB-UE DL
-#define ENB_CONF_STRING_OTG_CONFIG "otg_config"
-#define ENB_CONF_STRING_OTG_UE_ID "ue_id"
-#define ENB_CONF_STRING_OTG_APP_TYPE "app_type"
-#define ENB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic"
-
#ifdef LIBCONFIG_LONG
#define libconfig_int long
#else
@@ -62,11 +52,9 @@ typedef enum {
} RC_config_functions_t;
-#define CONFIG_STRING_ACTIVE_RUS "Active_RUs"
/*------------------------------------------------------------------------------------------------------------------------------------------*/
/* RUs configuration section name */
#define CONFIG_STRING_RU_LIST "RUs"
-#define CONFIG_STRING_RU_CONFIG "ru_config"
/* RUs configuration parameters name */
#define CONFIG_STRING_RU_LOCAL_IF_NAME "local_if_name"
@@ -86,7 +74,6 @@ typedef enum {
#define CONFIG_STRING_RU_ATT_RX "att_rx"
#define CONFIG_STRING_RU_MAX_RS_EPRE "max_pdschReferenceSignalPower"
#define CONFIG_STRING_RU_MAX_RXGAIN "max_rxgain"
-#define CONFIG_STRING_RU_IF_COMPRESSION "if_compression"
#define CONFIG_STRING_RU_IS_SLAVE "is_slave"
#define CONFIG_STRING_RU_NBIOTRRC_LIST "NbIoT_RRC_instances"
#define CONFIG_STRING_RU_SDR_ADDRS "sdr_addrs"
@@ -202,7 +189,7 @@ typedef enum {
{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, .uptr=NULL, .defuintval=400, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, .strptr=NULL, .defstrval="no", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_BF_WEIGHTS_LIST, NULL, 0, .iptr=NULL, .defintarrayval=DEFBFW, TYPE_INTARRAY, 0}, \
- {CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, .u64ptr=NULL, .defuintval=0, TYPE_UINT64, 0}, \
+ {CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, .u64ptr=NULL, .defint64val=0, TYPE_UINT64, 0}, \
{CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
{CONFIG_STRING_RU_DO_PRECODING, NULL, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
{CONFIG_STRING_RU_SF_AHEAD, HLP_RU_SF_AHEAD, 0, .iptr=NULL, .defintval=4, TYPE_INT, 0}, \
@@ -226,8 +213,6 @@ typedef enum {
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* value definitions for ASN1 verbosity parameter */
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none"
-#define ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying"
-#define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info"
/* global parameters, not under a specific section */
@@ -338,28 +323,6 @@ typedef enum {
#define ENB_SCTP_REQ_COUNT_IDX 23
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
-// clang-format off
-#define ENBPARAMS_CHECK { \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s2 = { config_check_intrange, TRACKING_AREA_CODE_OKRANGE } },\
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- }
-// clang-format on
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
@@ -401,7 +364,6 @@ typedef enum {
#define ENB_CONFIG_STRING_MBMS_SYNC_AREA "mbms_sync_area"
-#define ENB_MBMS_SYNC_AREA_IDX 0
// clang-format off
#define MBMS_CONFIG_PARAMS_DESC { \
@@ -427,10 +389,6 @@ typedef enum {
/* component carries configuration parameters name */
#define ENB_CONFIG_STRING_NB_ANT_PORTS "nb_antenna_ports"
-#define ENB_CONFIG_STRING_NB_ANT_TX "nb_antennas_tx"
-#define ENB_CONFIG_STRING_NB_ANT_RX "nb_antennas_rx"
-#define ENB_CONFIG_STRING_TX_GAIN "tx_gain"
-#define ENB_CONFIG_STRING_RX_GAIN "rx_gain"
#define ENB_CONFIG_STRING_PRACH_ROOT "prach_root"
#define ENB_CONFIG_STRING_PRACH_CONFIG_INDEX "prach_config_index"
#define ENB_CONFIG_STRING_PRACH_HIGH_SPEED "prach_high_speed"
@@ -453,7 +411,6 @@ typedef enum {
#define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL2 "pucch_NumRepetitionCE_Msg4_Level2_r13"
#define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL3 "pucch_NumRepetitionCE_Msg4_Level3_r13"
-#define ENB_CONFIG_STRING_FREQ_HOPPING_PARAMETERS_R13 "sib2_freq_hoppingParameters_r13"
#define ENB_CONFIG_STRING_PDSCH_RS_EPRE "pdsch_referenceSignalPower"
#define ENB_CONFIG_STRING_PDSCH_PB "pdsch_p_b"
@@ -521,12 +478,9 @@ typedef enum {
#define ENB_CONFIG_STRING_PDSCH_MAX_NUM_REPETITION_CE_MODE_A_R13 "pdsch_maxNumRepetitionCEmodeA_r13"
-#define ENB_CONFIG_STRING_PDSCH_MAX_NUM_REPETITION_CE_MODE_B_R13 "pdsch_maxNumRepetitionCEmodeB_r13"
#define ENB_CONFIG_STRING_PUSCH_MAX_NUM_REPETITION_CE_MODE_A_R13 "pusch_maxNumRepetitionCEmodeA_r13"
-#define ENB_CONFIG_STRING_PUSCH_MAX_NUM_REPETITION_CE_MODE_B_R13 "pusch_maxNumRepetitionCEmodeB_r13"
#define ENB_CONFIG_STRING_PUSCH_REPETITION_LEVEL_CE_MODE_A_R13 "pusch_repetitionLevelCEmodeA_r13"
-#define ENB_CONFIG_STRING_PUSCH_HOPPING_OFFSET_V1310 "pusch_HoppingOffset_v1310"
//TTN - for D2D
@@ -840,83 +794,6 @@ typedef struct ccparams_lte_s {
// clang-format on
-#define ENB_CONFIG_FRAME_TYPE_IDX 0
-#define ENB_CONFIG_TDD_CONFIG_IDX 1
-#define ENB_CONFIG_TDD_CONFIG_S_IDX 2
-#define ENB_CONFIG_PREFIX_TYPE_IDX 3
-#define ENB_CONFIG_PBCH_REPETITION_IDX 4
-#define ENB_CONFIG_EUTRA_BAND_IDX 5
-#define ENB_CONFIG_DOWNLINK_FREQUENCY_IDX 6
-#define ENB_CONFIG_UPLINK_FREQUENCY_OFFSET_IDX 7
-#define ENB_CONFIG_NID_CELL_IDX 8
-#define ENB_CONFIG_N_RB_DL_IDX 9
-#define ENB_CONFIG_CELL_MBSFN_IDX 10
-#define ENB_CONFIG_NB_ANT_PORTS_IDX 11
-#define ENB_CONFIG_PRACH_ROOT_IDX 12
-#define ENB_CONFIG_PRACH_CONFIG_INDEX_IDX 13
-#define ENB_CONFIG_PRACH_HIGH_SPEED_IDX 14
-#define ENB_CONFIG_PRACH_ZERO_CORRELATION_IDX 15
-#define ENB_CONFIG_PRACH_FREQ_OFFSET_IDX 16
-#define ENB_CONFIG_PUCCH_DELTA_SHIFT_IDX 17
-#define ENB_CONFIG_PUCCH_NRB_CQI_IDX 18
-#define ENB_CONFIG_PUCCH_NCS_AN_IDX 19
-#define ENB_CONFIG_PUCCH_N1_AN_IDX 20
-#define ENB_CONFIG_PDSCH_RS_EPRE_IDX 21
-#define ENB_CONFIG_PDSCH_PB_IDX 22
-#define ENB_CONFIG_PUSCH_N_SB_IDX 23
-#define ENB_CONFIG_PUSCH_HOPPINGMODE_IDX 24
-#define ENB_CONFIG_PUSCH_HOPPINGOFFSET_IDX 25
-#define ENB_CONFIG_PUSCH_ENABLE64QAM_IDX 26
-#define ENB_CONFIG_PUSCH_GROUP_HOPPING_EN_IDX 27
-#define ENB_CONFIG_PUSCH_GROUP_ASSIGNMENT_IDX 28
-#define ENB_CONFIG_PUSCH_SEQUENCE_HOPPING_EN_IDX 29
-#define ENB_CONFIG_PUSCH_NDMRS1_IDX 30
-#define ENB_CONFIG_PHICH_DURATION_IDX 31
-#define ENB_CONFIG_PHICH_RESOURCE_IDX 32
-#define ENB_CONFIG_SRS_ENABLE_IDX 33
-#define ENB_CONFIG_SRS_BANDWIDTH_CONFIG_IDX 34
-#define ENB_CONFIG_SRS_SUBFRAME_CONFIG_IDX 35
-#define ENB_CONFIG_SRS_ACKNACKST_CONFIG_IDX 36
-#define ENB_CONFIG_SRS_MAXUPPTS_IDX 37
-#define ENB_CONFIG_PUSCH_PO_NOMINAL_IDX 38
-#define ENB_CONFIG_PUSCH_ALPHA_IDX 39
-#define ENB_CONFIG_PUCCH_PO_NOMINAL_IDX 40
-#define ENB_CONFIG_MSG3_DELTA_PREAMBLE_IDX 41
-#define ENB_CONFIG_PUCCH_DELTAF_FORMAT1_IDX 42
-#define ENB_CONFIG_PUCCH_DELTAF_FORMAT1b_IDX 43
-#define ENB_CONFIG_PUCCH_DELTAF_FORMAT2_IDX 44
-#define ENB_CONFIG_PUCCH_DELTAF_FORMAT2A_IDX 45
-#define ENB_CONFIG_PUCCH_DELTAF_FORMAT2B_IDX 46
-#define ENB_CONFIG_RACH_NUM_RA_PREAMBLES_IDX 47
-#define ENB_CONFIG_RACH_PREAMBLESGROUPACONFIG_IDX 48
-#define ENB_CONFIG_RACH_SIZEOFRA_PREAMBLESGROUPA_IDX 49
-#define ENB_CONFIG_RACH_MESSAGESIZEGROUPA_IDX 50
-#define ENB_CONFIG_RACH_MESSAGEPOWEROFFSETGROUPB_IDX 51
-#define ENB_CONFIG_RACH_POWERRAMPINGSTEP_IDX 52
-#define ENB_CONFIG_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER_IDX 53
-#define ENB_CONFIG_RACH_PREAMBLETRANSMAX_IDX 54
-#define ENB_CONFIG_RACH_RARESPONSEWINDOWSIZE_IDX 55
-#define ENB_CONFIG_RACH_MACCONTENTIONRESOLUTIONTIMER_IDX 56
-#define ENB_CONFIG_RACH_MAXHARQMSG3TX_IDX 57
-#define ENB_CONFIG_PCCH_DEFAULT_PAGING_CYCLE_IDX 58
-#define ENB_CONFIG_PCCH_NB_IDX 59
-#define ENB_CONFIG_STRING_DRX_CONFIG_PRESENT_IDX 60
-#define ENB_CONFIG_STRING_DRX_ONDURATIONTIMER_IDX 61
-#define ENB_CONFIG_STRING_DRX_INACTIVITYTIMER_IDX 62
-#define ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER_IDX 63
-#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT_IDX 64
-#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_IDX 65
-#define ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE_IDX 66
-#define ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER_IDX 67
-#define ENB_CONFIG_BCCH_MODIFICATIONPERIODCOEFF_IDX 68
-#define ENB_CONFIG_UETIMERS_T300_IDX 69
-#define ENB_CONFIG_UETIMERS_T301_IDX 70
-#define ENB_CONFIG_UETIMERS_T310_IDX 71
-#define ENB_CONFIG_UETIMERS_T311_IDX 72
-#define ENB_CONFIG_UETIMERS_N310_IDX 73
-#define ENB_CONFIG_UETIMERS_N311_IDX 74
-#define ENB_CONFIG_UE_TRANSMISSION_MODE_IDX 75
-#define ENB_CONFIG_MBMS_DEDICATED_SERVING_CELL_IDX 76
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* SRB1 configuration parameters section name */
@@ -1119,12 +996,10 @@ typedef struct srb1_params_s {
/* L1 configuration section names */
#define CONFIG_STRING_L1_LIST "L1s"
-#define CONFIG_STRING_L1_CONFIG "l1_config"
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* MACRLC configuration section names */
#define CONFIG_STRING_MACRLC_LIST "MACRLCs"
-#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config"
/* MACRLC configuration parameters names */
diff --git a/openair2/ENB_APP/enb_paramdef_emtc.h b/openair2/ENB_APP/enb_paramdef_emtc.h
index 52f5b2a60f..b19ca2fadd 100644
--- a/openair2/ENB_APP/enb_paramdef_emtc.h
+++ b/openair2/ENB_APP/enb_paramdef_emtc.h
@@ -62,14 +62,9 @@
#define ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_B_R13_VAL "interval_DLHoppingConfigCommonModeB_r13_val"
#define ENB_CONFIG_STRING_MPDCCH_PDSCH_HOPPING_OFFSET_R13 "mpdcch_pdsch_HoppingOffset_r13"
#define ENB_CONFIG_STRING_PREAMBLE_TRANSMAX_CE_R13 "preamble_TransMax_ce_r13"
-#define ENB_CONFIG_STRING_PREAMBLE_TRANSMAX_CE_R13_VAL "preamble_TransMax_ce_r13_val"
#define ENB_CONFIG_STRING_PDSCH_MAX_NUM_REPETITION_CE_MODE_A_R13 "pdsch_maxNumRepetitionCEmodeA_r13"
-#define ENB_CONFIG_STRING_PDSCH_MAX_NUM_REPETITION_CE_MODE_B_R13 "pdsch_maxNumRepetitionCEmodeB_r13"
#define ENB_CONFIG_STRING_PUSCH_MAX_NUM_REPETITION_CE_MODE_A_R13 "pusch_maxNumRepetitionCEmodeA_r13"
-#define ENB_CONFIG_STRING_PUSCH_MAX_NUM_REPETITION_CE_MODE_B_R13 "pusch_maxNumRepetitionCEmodeB_r13"
#define ENB_CONFIG_STRING_PUSCH_REPETITION_LEVEL_CE_MODE_A_R13 "pusch_repetitionLevelCEmodeA_r13"
-#define ENB_CONFIG_STRING_PUSCH_HOPPING_OFFSET_V1310 "pusch_HoppingOffset_v1310"
-#define ENB_CONFIG_STRING_SYSTEM_INFO_VALUE_TAG_LIST "system_info_value_tag_SI"
#define ENB_CONFIG_STRING_FIRST_PREAMBLE_R13 "firstPreamble_r13"
#define ENB_CONFIG_STRING_LAST_PREAMBLE_R13 "lastPreamble_r13"
#define ENB_CONFIG_STRING_RA_RESPONSE_WINDOW_SIZE_R13 "ra_ResponseWindowSize_r13"
diff --git a/openair2/ENB_APP/enb_paramdef_mce.h b/openair2/ENB_APP/enb_paramdef_mce.h
index c93fb4097e..20a45ba464 100644
--- a/openair2/ENB_APP/enb_paramdef_mce.h
+++ b/openair2/ENB_APP/enb_paramdef_mce.h
@@ -54,16 +54,6 @@
#define MCE_MCE_ID_IDX 0
#define MCE_MCE_NAME_IDX 1
-#define MCE_ENABLE_MCE_M2_IDX 2
-#define MCE_ENABLE_MCE_M3_IDX 3
-
-#define MCE_PARAMS_CHECK { \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
-}
-
#define MCE_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES"
diff --git a/openair2/ENB_APP/enb_paramdef_mme.h b/openair2/ENB_APP/enb_paramdef_mme.h
index b1deee0e8e..42533c69d6 100644
--- a/openair2/ENB_APP/enb_paramdef_mme.h
+++ b/openair2/ENB_APP/enb_paramdef_mme.h
@@ -36,37 +36,8 @@
#include "common/config/config_paramdesc.h"
#include "RRC_paramsvalues.h"
-
-
-/* mme configuration parameters names */
-
-#define MME_CONFIG_STRING_MME_ID "MME_ID"
-#define MME_CONFIG_STRING_MME_NAME "MME_name"
-#define MME_CONFIG_STRING_MME_M3 "enable_mme_m3"
-
-#define MMEPARAMS_DESC {\
-{MME_CONFIG_STRING_MME_ID, NULL, 0, .uptr=NULL, .defintval=0, TYPE_UINT, 0}, \
-{MME_CONFIG_STRING_MME_NAME, NULL, 0, .strptr=NULL, .defstrval="OAIMME", TYPE_STRING, 0}, \
-{MME_CONFIG_STRING_MME_M3, NULL, 0, .strptr=NULL, .defstrval="no", TYPE_STRING, 0}, \
-}
-
-#define MME_MME_ID_IDX 0
-#define MME_MME_NAME_IDX 1
-#define MME_ENABLE_MME_M3_IDX 2
-
-#define MMEPARAMS_CHECK { \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
- { .s5 = { NULL } }, \
-}
-
-
#define MME_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES"
-#define MME_INTERFACE_NAME_FOR_M3_MME_IDX 0
-#define MME_IPV4_ADDRESS_FOR_M3C_IDX 1
-#define MME_PORT_FOR_M3C_IDX 2
-
/* interface configuration parameters names */
/* M3 interface configuration parameters names */
#define MME_CONFIG_STRING_MME_INTERFACE_NAME_FOR_M3_MCE "MME_INTERFACE_NAME_FOR_M3_MCE"
diff --git a/openair2/F1AP/f1ap_common.h b/openair2/F1AP/f1ap_common.h
index 83781484c7..664599c2f2 100644
--- a/openair2/F1AP/f1ap_common.h
+++ b/openair2/F1AP/f1ap_common.h
@@ -36,7 +36,6 @@
#include "oai_asn1.h"
#include
-#define F1AP_UE_IDENTIFIER_NUMBER 3
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
#include "F1AP_RAT-FrequencyPriorityInformation.h"
@@ -357,7 +356,6 @@
# error "You are compiling f1ap with the wrong version of ASN1C"
#endif
-#define F1AP_UE_ID_FMT "0x%06"PRIX32
#include "assertions.h"
diff --git a/openair2/F1AP/lib/f1ap_ue_context.c b/openair2/F1AP/lib/f1ap_ue_context.c
index 829cdacdfb..728849d8e5 100644
--- a/openair2/F1AP/lib/f1ap_ue_context.c
+++ b/openair2/F1AP/lib/f1ap_ue_context.c
@@ -1666,6 +1666,15 @@ F1AP_F1AP_PDU_t *encode_ue_context_mod_req(const f1ap_ue_context_mod_req_t *req)
OCTET_STRING_fromBuf(&ie81->value.choice.RRCContainer, (const char *)req->rrc_container->buf, req->rrc_container->len);
}
+ /* optional: gNB-DU Configuration Query */
+ if (req->gNB_DU_Configuration_Query && *req->gNB_DU_Configuration_Query) {
+ asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie82);
+ ie82->id = F1AP_ProtocolIE_ID_id_GNB_DUConfigurationQuery;
+ ie82->criticality = F1AP_Criticality_ignore;
+ ie82->value.present = F1AP_UEContextModificationRequestIEs__value_PR_GNB_DUConfigurationQuery;
+ ie82->value.choice.GNB_DUConfigurationQuery = F1AP_GNB_DUConfigurationQuery_true;
+ }
+
/* optional: SRBs_ToBeSetupMod */
if (req->srbs_len > 0) {
DevAssert(req->srbs);
@@ -1777,6 +1786,13 @@ bool decode_ue_context_mod_req(const F1AP_F1AP_PDU_t *pdu, f1ap_ue_context_mod_r
*out->rrc_container = create_byte_array(os->size, os->buf);
}
break;
+ case F1AP_ProtocolIE_ID_id_GNB_DUConfigurationQuery:
+ _F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_GNB_DUConfigurationQuery);
+ {
+ bool v = ie->value.choice.GNB_DUConfigurationQuery == F1AP_GNB_DUConfigurationQuery_true;
+ _F1_MALLOC(out->gNB_DU_Configuration_Query, v);
+ }
+ break;
case F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_List:
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeSetupMod_List);
_F1_CHECK_EXP(decode_srbs_to_setupmod(&ie->value.choice.SRBs_ToBeSetupMod_List, &out->srbs_len, &out->srbs));
@@ -1862,6 +1878,8 @@ f1ap_ue_context_mod_req_t cp_ue_context_mod_req(const f1ap_ue_context_mod_req_t
}
if (orig->status)
_F1_MALLOC(cp.status, *orig->status);
+ if (orig->gNB_DU_Configuration_Query)
+ _F1_MALLOC(cp.gNB_DU_Configuration_Query, *orig->gNB_DU_Configuration_Query);
return cp;
}
@@ -1898,6 +1916,7 @@ bool eq_ue_context_mod_req(const f1ap_ue_context_mod_req_t *a, const f1ap_ue_con
_F1_CHECK_EXP(eq_drb_to_release(&a->drbs_rel[i], &b->drbs_rel[i]));
_F1_EQ_CHECK_OPTIONAL_IE(a, b, status, _F1_EQ_CHECK_INT);
+ _F1_EQ_CHECK_OPTIONAL_IE(a, b, gNB_DU_Configuration_Query, _F1_EQ_CHECK_INT);
return true;
}
@@ -1925,6 +1944,7 @@ void free_ue_context_mod_req(f1ap_ue_context_mod_req_t *req)
free_drb_to_release(&req->drbs_rel[i]);
free(req->drbs_rel);
free(req->status);
+ free(req->gNB_DU_Configuration_Query);
}
/**
diff --git a/openair2/F1AP/tests/f1ap_lib_test.c b/openair2/F1AP/tests/f1ap_lib_test.c
index 75fa75bcc1..cba787f4dc 100644
--- a/openair2/F1AP/tests/f1ap_lib_test.c
+++ b/openair2/F1AP/tests/f1ap_lib_test.c
@@ -1039,6 +1039,7 @@ static void test_f1ap_ue_context_modification_request()
orig.drbs_rel[2].id = 19;
_F1_MALLOC(orig.status, LOWER_LAYERS_RESUME);
+ _F1_MALLOC(orig.gNB_DU_Configuration_Query, true);
F1AP_F1AP_PDU_t *f1enc = encode_ue_context_mod_req(&orig);
F1AP_F1AP_PDU_t *f1dec = f1ap_encode_decode(f1enc);
diff --git a/openair2/GNB_APP/RRC_nr_paramsvalues.h b/openair2/GNB_APP/RRC_nr_paramsvalues.h
index 28d5f71ff9..6ac8443581 100644
--- a/openair2/GNB_APP/RRC_nr_paramsvalues.h
+++ b/openair2/GNB_APP/RRC_nr_paramsvalues.h
@@ -51,7 +51,6 @@
#define GNB_CONFIG_STRING_INITIALDLBWPLOCATIONANDBANDWIDTH "initialDLBWPlocationAndBandwidth"
#define GNB_CONFIG_STRING_INITIALDLBWPSUBCARRIERSPACING "initialDLBWPsubcarrierSpacing"
-#define GNB_CONFIG_STRING_INITIALDLBWPCYCLICPREFIX "initialDLBWPcyclicPrefix"
#define GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO "initialDLBWPcontrolResourceSetZero"
#define GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO "initialDLBWPsearchSpaceZero"
@@ -116,7 +115,6 @@
#define GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS "nrofDownlinkSymbols"
#define GNB_CONFIG_STRING_NROFUPLINKSLOTS "nrofUplinkSlots"
#define GNB_CONFIG_STRING_NROFUPLINKSYMBOLS "nrofUplinkSymbols"
-#define GNB_CONFIG_STRING_PATTERN2 "pattern2"
#define GNB_CONFIG_STRING_DLULTRANSMISSIONPERIODICITY2 "dl_UL_TransmissionPeriodicity2"
#define GNB_CONFIG_STRING_NROFDOWNLINKSLOTS2 "nrofDownlinkSlots2"
#define GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS2 "nrofDownlinkSymbols2"
@@ -135,7 +133,6 @@
#define GNB_CONFIG_STRING_TA_COMMON "ta-Common-r17"
#define GNB_CONFIG_STRING_TA_COMMONDRIFT "ta-CommonDrift-r17"
-#define CARRIERBANDWIDTH_OKVALUES {11,18,24,25,31,32,38,51,52,65,66,78,79,93,106,107,121,132,133,135,160,162,189,216,217,245,264,270,273}
/*--------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
@@ -143,11 +140,6 @@
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-#define GNB_CONFIG_PHYSCELLID_IDX 0
-#define GNB_CONFIG_ABSOLUTEFREQUENCYSSB_IDX 5
-#define GNB_CONFIG_DLFREQUENCYBAND_IDX 6
-#define GNB_CONFIG_ABSOLUTEFREQUENCYPOINTA_IDX 7
-#define GNB_CONFIG_DLCARRIERBANDWIDTH_IDX 10
#define SCCPARAMS_DESC(scc) { \
diff --git a/openair2/GNB_APP/gnb_app.c b/openair2/GNB_APP/gnb_app.c
index 3b97dfe515..98546413a0 100644
--- a/openair2/GNB_APP/gnb_app.c
+++ b/openair2/GNB_APP/gnb_app.c
@@ -55,9 +55,6 @@
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
extern RAN_CONTEXT_t RC;
-
-#define GNB_REGISTER_RETRY_DELAY 10
-
/*------------------------------------------------------------------------------*/
diff --git a/openair2/GNB_APP/gnb_config.h b/openair2/GNB_APP/gnb_config.h
index 96cf898ba0..c33c6964dc 100644
--- a/openair2/GNB_APP/gnb_config.h
+++ b/openair2/GNB_APP/gnb_config.h
@@ -37,23 +37,11 @@
#include "f1ap_messages_types.h"
#include "intertask_interface.h"
-#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
- struct in_addr inp;\
- if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\
- AssertFatal (0, MeSsAgE);\
- } else {\
- NwBo = inp.s_addr;\
- }\
- } while (0);
-
-// Hard to find a defined value for max enb...
-#define MAX_GNB 16
-
void RCconfig_verify(configmodule_interface_t *cfg, ngran_node_t node_type);
-extern void RCconfig_nr_prs(void);
-extern void RCconfig_NR_L1(void);
-extern void RCconfig_nr_macrlc(configmodule_interface_t *cfg);
-extern void NRRCConfig(void);
+void RCconfig_nr_prs(void);
+void RCconfig_NR_L1(void);
+void RCconfig_nr_macrlc(configmodule_interface_t *cfg);
+void NRRCConfig(void);
gNB_RRC_INST *RCconfig_NRRRC();
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i);
diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h
index eb90b2f1bf..4a34e8d0e0 100644
--- a/openair2/GNB_APP/gnb_paramdef.h
+++ b/openair2/GNB_APP/gnb_paramdef.h
@@ -37,18 +37,6 @@
#include "common/ngran_types.h"
#include "RRC_nr_paramsvalues.h"
-
-#define GNB_CONFIG_STRING_CC_NODE_FUNCTION "node_function"
-#define GNB_CONFIG_STRING_CC_NODE_TIMING "node_timing"
-#define GNB_CONFIG_STRING_CC_NODE_SYNCH_REF "node_synch_ref"
-
-
-// OTG config per GNB-UE DL
-#define GNB_CONF_STRING_OTG_CONFIG "otg_config"
-#define GNB_CONF_STRING_OTG_UE_ID "ue_id"
-#define GNB_CONF_STRING_OTG_APP_TYPE "app_type"
-#define GNB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic"
-
#ifdef LIBCONFIG_LONG
#define libconfig_int long
#else
@@ -64,7 +52,6 @@ typedef enum {
NRlastel = 5
} NRRC_config_functions_t;
-#define CONFIG_STRING_ACTIVE_RUS "Active_RUs"
/*------------------------------------------------------------------------------------------------------------------------------------------*/
/* RUs configuration for gNB is the same for eNB */
@@ -74,8 +61,6 @@ typedef enum {
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* value definitions for ASN1 verbosity parameter */
#define GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none"
-#define GNB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying"
-#define GNB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info"
/* global parameters, not under a specific section */
#define GNB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity"
@@ -338,8 +323,6 @@ typedef enum {
// clang-format on
#define GNB_CONFIG_STRING_NEIGHBOUR_CELL_LIST "neighbour_cell_configuration"
-#define GNB_CONFIG_STRING_NEIGHBOUR_GNB_ID "gNB_ID"
-#define GNB_CONFIG_STRING_NEIGHBOUR_NR_CELLID "nr_cellid"
#define GNB_CONFIG_STRING_NEIGHBOUR_CELL_PHYSICAL_ID "physical_cellId"
#define GNB_CONFIG_STRING_NEIGHBOUR_CELL_ABS_FREQ_SSB "absoluteFrequencySSB"
#define GNB_CONFIG_STRING_NEIGHBOUR_CELL_SCS "subcarrierSpacing"
@@ -642,7 +625,6 @@ typedef enum {
#define GNB_PORT_FOR_X2C_IDX 4
/* S1 interface configuration parameters names */
-#define GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1_MME "GNB_IPV4_ADDRESS_FOR_S1_MME"
#define GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1U "GNB_IPV4_ADDRESS_FOR_S1U"
#define GNB_CONFIG_STRING_GNB_PORT_FOR_S1U "GNB_PORT_FOR_S1U"
@@ -690,14 +672,12 @@ typedef enum {
// clang-format on
/* L1 configuration section names */
#define CONFIG_STRING_L1_LIST "L1s"
-#define CONFIG_STRING_L1_CONFIG "l1_config"
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* MACRLC configuration section names */
#define CONFIG_STRING_MACRLC_LIST "MACRLCs"
-#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config"
/* MACRLC configuration parameters names */
diff --git a/openair2/LAYER2/MAC/defs_NB_IoT.h b/openair2/LAYER2/MAC/defs_NB_IoT.h
index 92e267324e..d0b2570719 100644
--- a/openair2/LAYER2/MAC/defs_NB_IoT.h
+++ b/openair2/LAYER2/MAC/defs_NB_IoT.h
@@ -22,15 +22,12 @@
// MAC definition
#define MAX_FRAME 0xfffff
#define NUM_FRAME 0x100000
-#define MAX_SUBFRAME 10485760
#define MAX(a, b) (((a)>(b))?(a):(b))
// RA-RNTI: 1+SFN_id>>2
#define RA_RNTI_LOW 0x0001 // SFN_id = 0
#define RA_RNTI_HIGH 0x0100 // SFN_id = 1023
-#define C_RNTI_LOW 0x0101
-#define C_RNTI_HIGH
// ULSCH LCHAN IDs
/*!\brief LCID of extended power headroom for ULSCH */
@@ -46,7 +43,6 @@
/*!\brief LCID of long BSR for ULSCH */
#define LONG_BSR 30
/*! \brief Values of CCCH LCID for DLSCH */
-#define CCCH_LCHANID 0
/*!\brief Values of BCCH logical channel */
#define BCCH 3 // SI
/*!\brief Values of PCCH logical channel */
@@ -107,7 +103,6 @@ typedef enum{
#define BCCH1_NB_IoT 12 // SI-SIB-NB_IoTs
/*!\brief Values of PCCH logical channel */
#define PCCH_NB_IoT 13 // Paging XXX not used for the moment
-#define MCCH_NB_IoT 14
/*!\brief Value of CCCH / SRB0 logical channel */
#define CCCH_NB_IoT 0 // srb0 ---> XXX exactly the same as in LTE (commented for compilation purposes)
/*!\brief DCCH0 / SRB1bis logical channel */
@@ -119,7 +114,6 @@ typedef enum{
/*!\brief DTCH1 DRB1 logical channel */
#define DTCH1_NB_IoT 5 // DRB1
/*Index of UE contention resoulution logical channel*/
-#define UE_CONTENTION_RESOLUTION 28
/*Index of TIMING_ADVANCE logical channel*/
#define TIMING_ADVANCE 29
/*Index of DRX_COMMAND logical channel*/
diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h
index f10941c3ab..1e51704185 100644
--- a/openair2/LAYER2/MAC/mac.h
+++ b/openair2/LAYER2/MAC/mac.h
@@ -110,9 +110,6 @@
/*!\brief MAX MCCH payload size */
#define MCCH_PAYLOAD_SIZE_MAX 128
//#define MCH_PAYLOAD_SIZE_MAX 16384// this value is using in case mcs and TBS index are hi
-
-#define printk printf
-
/*!\brief Maximum number of logical channl group IDs */
#define MAX_NUM_LCGID 4
/*!\brief logical channl group ID 0 */
@@ -213,7 +210,6 @@ typedef struct {
uint64_t t_crnti:16;
} __attribute__((__packed__))RAR_PDU;
-#define sizeof_RAR_PDU 6
*/
/*!\brief MAC subheader short with 7bit Length field */
typedef struct {
@@ -402,8 +398,6 @@ typedef struct {
uint8_t lcid:5; // octet 2 MSB
uint8_t stop_sf_LSB:8;
} __attribute__ ((__packed__)) MSI_ELEMENT;
-/*! \brief Values of CCCH LCID for DLSCH */
-#define CCCH_LCHANID 0
/*!\brief Values of BCCH logical channel (fake)*/
#define BCCH 3 // SI
/*!\brief Values of PCCH logical channel (fake)*/
@@ -448,8 +442,6 @@ typedef struct {
#define MCCH_LCHANID 0
/*!\brief LCID of MCH scheduling info for DL */
#define MCH_SCHDL_INFO 30
-/*!\brief LCID of Carrier component activation/deactivation */
-#define CC_ACT_DEACT 27
//TTN (for D2D)
#define SL_DISCOVERY 8 //LCID (fake)
#define MAX_NUM_DEST 10
diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
index f73c1f2db3..53349cae8d 100644
--- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
+++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
@@ -45,18 +45,6 @@
#define NR_SHORT_BSR_TABLE_SIZE 32
#define NR_LONG_BSR_TABLE_SIZE 256
-#define TABLE_38213_13_1_NUM_INDEXES 15
-#define TABLE_38213_13_2_NUM_INDEXES 14
-#define TABLE_38213_13_3_NUM_INDEXES 9
-#define TABLE_38213_13_4_NUM_INDEXES 16
-#define TABLE_38213_13_5_NUM_INDEXES 9
-#define TABLE_38213_13_6_NUM_INDEXES 10
-#define TABLE_38213_13_7_NUM_INDEXES 12
-#define TABLE_38213_13_8_NUM_INDEXES 8
-#define TABLE_38213_13_9_NUM_INDEXES 4
-#define TABLE_38213_13_10_NUM_INDEXES 8
-#define TABLE_38213_13_11_NUM_INDEXES 16
-#define TABLE_38213_13_12_NUM_INDEXES 14
// Definitions for MAC control and data
#define NR_BCCH_DL_SCH 3 // SI
@@ -432,7 +420,6 @@ typedef struct {
#define UL_SCH_LCID_PADDING 0x3F
#define NR_MAX_NUM_LCGID 8
-#define MAX_RLC_SDU_SUBHEADER_SIZE 3
//=========
// DCI defs
diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
index f111f571ba..11dac69484 100644
--- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
+++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
@@ -3399,11 +3399,11 @@ uint16_t get_ssb_start_symbol(const long band, NR_SubcarrierSpacing_t scs, int i
}
}
-
-void csi_period_offset(NR_CSI_ReportConfig_t *csirep,
- struct NR_CSI_ResourcePeriodicityAndOffset *periodicityAndOffset,
- int *period, int *offset) {
-
+void csi_period_offset(const NR_CSI_ReportConfig_t *csirep,
+ const struct NR_CSI_ResourcePeriodicityAndOffset *periodicityAndOffset,
+ int *period,
+ int *offset)
+{
if(periodicityAndOffset != NULL) {
NR_CSI_ResourcePeriodicityAndOffset_PR p_and_o = periodicityAndOffset->present;
diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
index 12b444539f..74baa8462f 100644
--- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
+++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
@@ -285,9 +285,10 @@ unsigned int get_N_RA_RB(const unsigned int delta_f_RA_PRACH, const unsigned int
void find_period_offset_SR(const NR_SchedulingRequestResourceConfig_t *SchedulingReqRec, int *period, int *offset);
-void csi_period_offset(NR_CSI_ReportConfig_t *csirep,
- struct NR_CSI_ResourcePeriodicityAndOffset *periodicityAndOffset,
- int *period, int *offset);
+void csi_period_offset(const NR_CSI_ReportConfig_t *csirep,
+ const struct NR_CSI_ResourcePeriodicityAndOffset *periodicityAndOffset,
+ int *period,
+ int *offset);
bool set_dl_ptrs_values(NR_PTRS_DownlinkConfig_t *ptrs_config,
uint16_t rbSize, uint8_t mcsIndex, uint8_t mcsTable,
diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c
index e5a1fb4e1a..b3195894a4 100644
--- a/openair2/LAYER2/NR_MAC_UE/config_ue.c
+++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c
@@ -137,6 +137,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommo
AssertFatal(frequencyInfoDL->frequencyBandList.list.array[0]->freqBandIndicatorNR, "Field mandatory present for DL in SIB1\n");
mac->nr_band = *frequencyInfoDL->frequencyBandList.list.array[0]->freqBandIndicatorNR;
+ AssertFatal(mac->numerology == frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, "DL and SSB subcarrierSpacing must be the same!\n");
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
mac->frequency_range,
frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
@@ -149,7 +150,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommo
// Initial cell selection: derive from command-line parameter
uint64_t dl_bw_khz = (12 * frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth) *
(15 << frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing);
- cfg->carrier_config.dl_frequency = (downlink_frequency[cc_idP][0]/1000) - (dl_bw_khz>>1);
+ cfg->carrier_config.dl_frequency = mac->dl_frequency / 1000 - (dl_bw_khz >> 1);
LOG_I(NR_MAC,
"[UE %d] Initial cell selection: dl_frequency=%u kHz (from command-line, band=%d, scs=%ld)\n",
mac->ue_id,
@@ -172,25 +173,35 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommo
NR_FrequencyInfoUL_SIB_t *frequencyInfoUL = &scc->uplinkConfigCommon->frequencyInfoUL;
mac->p_Max = frequencyInfoUL->p_Max ? *frequencyInfoUL->p_Max : INT_MIN;
+ AssertFatal(mac->numerology == frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, "UL and SSB subcarrierSpacing must be the same!\n");
bw_index = get_supported_band_index(frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
mac->frequency_range,
frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
cfg->carrier_config.uplink_bandwidth = get_supported_bw_mhz(mac->frequency_range, bw_index);
/** Only set UL frequency if not already initialized (e.g., from handover reconfigurationWithSync)
- * MAC maintains its own frequency state, don't overwrite it with command-line parameter which
- * is related to the initial cell selection. */
+ * MAC maintains its own frequency state, don't overwrite it with command-line parameter which
+ * is related to the initial cell selection. */
if (cfg->carrier_config.uplink_frequency == 0) {
- // Initial cell selection: derive from DL frequency
- LOG_I(NR_MAC,
- "Initial cell selection: uplink_frequency=%u kHz (from dl_frequency=%u kHz, uplink_frequency_offset=%u kHz)\n",
- cfg->carrier_config.uplink_frequency,
- cfg->carrier_config.dl_frequency,
- uplink_frequency_offset[cc_idP][0]);
- if (frequencyInfoUL->absoluteFrequencyPointA == NULL)
+ // Initial cell selection: derive from DL frequency or frequencyInfoUL->absoluteFrequencyPointA
+ if (frequencyInfoUL->absoluteFrequencyPointA == NULL) {
cfg->carrier_config.uplink_frequency = cfg->carrier_config.dl_frequency;
- else
- cfg->carrier_config.uplink_frequency = cfg->carrier_config.dl_frequency + (uplink_frequency_offset[cc_idP][0] / 1000);
+ LOG_I(NR_MAC,
+ "Initial cell selection: uplink_frequency=%u kHz (from dl_frequency=%u kHz)\n",
+ cfg->carrier_config.uplink_frequency,
+ cfg->carrier_config.dl_frequency);
+ } else {
+ cfg->carrier_config.uplink_frequency = from_nrarfcn(*frequencyInfoUL->frequencyBandList->list.array[0]->freqBandIndicatorNR,
+ frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
+ *frequencyInfoUL->absoluteFrequencyPointA)
+ / 1000; // freq in kHz
+ LOG_I(NR_MAC,
+ "Initial cell selection: uplink_frequency=%u kHz (from absoluteFrequencyPointA=%ld, band=%ld, scs=%ld)\n",
+ cfg->carrier_config.uplink_frequency,
+ *frequencyInfoUL->absoluteFrequencyPointA,
+ *frequencyInfoUL->frequencyBandList->list.array[0]->freqBandIndicatorNR,
+ frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing);
+ }
}
for (int i = 0; i < 5; i++) {
@@ -204,7 +215,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommo
}
}
- frame_type_t frame_type = get_frame_type(mac->nr_band, get_softmodem_params()->numerology);
+ frame_type_t frame_type = get_frame_type(mac->nr_band, mac->numerology);
// cell config
cfg->cell_config.phy_cell_id = mac->physCellId;
cfg->cell_config.frame_duplex_type = frame_type;
@@ -212,7 +223,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommo
// SSB config
cfg->ssb_config.ss_pbch_power = scc->ss_PBCH_BlockPower;
- cfg->ssb_config.scs_common = get_softmodem_params()->numerology;
+ cfg->ssb_config.scs_common = mac->numerology;
// SSB Table config
cfg->ssb_table.ssb_offset_point_a = frequencyInfoDL->offsetToPointA;
@@ -231,7 +242,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommo
}
int period_idx = mac->tdd_UL_DL_ConfigurationCommon ? get_tdd_period_idx(mac->tdd_UL_DL_ConfigurationCommon) : 0;
- config_frame_structure(get_softmodem_params()->numerology,
+ config_frame_structure(mac->numerology,
mac->tdd_UL_DL_ConfigurationCommon,
period_idx,
frame_type,
@@ -443,14 +454,16 @@ static void config_common_ue(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommon_t
// carrier config
LOG_D(MAC, "[UE %d] Entering UE Config Common\n", mac->ue_id);
+ mac->numerology = *scc->ssbSubcarrierSpacing;
AssertFatal(scc->downlinkConfigCommon, "Not expecting downlinkConfigCommon to be NULL here\n");
NR_FrequencyInfoDL_t *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
if (frequencyInfoDL) { // NeedM for inter-freq handover
mac->nr_band = *frequencyInfoDL->frequencyBandList.list.array[0];
- frame_type = get_frame_type(mac->nr_band, get_softmodem_params()->numerology);
+ frame_type = get_frame_type(mac->nr_band, mac->numerology);
mac->frequency_range = get_freq_range_from_band(mac->nr_band);
+ AssertFatal(mac->numerology == frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, "DL and SSB subcarrierSpacing must be the same!\n");
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
mac->frequency_range,
frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
@@ -483,6 +496,7 @@ static void config_common_ue(NR_UE_MAC_INST_t *mac, NR_ServingCellConfigCommon_t
NR_FrequencyInfoUL_t *frequencyInfoUL = scc->uplinkConfigCommon->frequencyInfoUL;
mac->p_Max = frequencyInfoUL->p_Max ? *frequencyInfoUL->p_Max : INT_MIN;
+ AssertFatal(mac->numerology == frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, "UL and SSB subcarrierSpacing must be the same!\n");
int bw_index = get_supported_band_index(frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
mac->frequency_range,
frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h
index 65bf66505b..10a89adc89 100644
--- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h
+++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h
@@ -310,10 +310,8 @@ typedef struct {
NR_PUCCH_Resource_t *pucch_resource;
uint32_t ack_payload;
uint8_t sr_payload;
- uint64_t csi_part1_payload;
- uint64_t csi_part2_payload;
+ nfapi_nr_ue_csi_payload_t csi_payload;
int n_sr;
- int n_csi;
int n_harq;
int n_CCE;
int N_CCE;
@@ -490,13 +488,6 @@ typedef struct {
A_SEQUENCE_OF(NR_SearchSpace_t) list_SS;
} NR_BWP_PDCCH_t;
-typedef struct csi_payload {
- uint64_t part1_payload;
- uint64_t part2_payload;
- int p1_bits;
- int p2_bits;
-} csi_payload_t;
-
typedef enum {
WIDEBAND_ON_PUCCH,
SUBBAND_ON_PUCCH,
@@ -615,6 +606,8 @@ typedef struct NR_UE_MAC_INST_s {
uint16_t nr_band;
uint8_t ssb_subcarrier_offset;
int ssb_start_subcarrier;
+ uint64_t dl_frequency;
+ int numerology;
NR_SSB_meas_t ssb_measurements[MAX_NB_SSB];
NR_CSIRS_meas_t csirs_measurements;
diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs_sl.h b/openair2/LAYER2/NR_MAC_UE/mac_defs_sl.h
index 10eaea3862..405ba8e1cc 100644
--- a/openair2/LAYER2/NR_MAC_UE/mac_defs_sl.h
+++ b/openair2/LAYER2/NR_MAC_UE/mac_defs_sl.h
@@ -30,7 +30,6 @@
#define SL_NR_MAC_NUM_RX_RESOURCE_POOLS 1
#define SL_NR_MAC_NUM_TX_RESOURCE_POOLS 1
-#define SL_NUM_BYTES_TIMERESOURCEBITMAP 20
// every 16 frames, SSB is repeated.
#define SL_NR_SSB_REPETITION_IN_FRAMES 16
diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h
index 69ba897a21..9ee1bfab28 100644
--- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h
+++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h
@@ -106,7 +106,7 @@ typedef struct nr_neighbor_cell_info {
void nr_rrc_mac_config_req_meas(module_id_t module_id, const nr_neighbor_cell_info_t *neighbor_cells, int num_neighbors);
/**\brief initialization NR UE MAC instance(s)*/
-NR_UE_MAC_INST_t * nr_l2_init_ue(int nb_inst);
+NR_UE_MAC_INST_t * nr_l2_init_ue(int nb_inst, int numerology);
/**\brief fetch MAC instance by module_id
\param module_id index of MAC instance(s)*/
@@ -124,7 +124,7 @@ void release_mac_configuration(NR_UE_MAC_INST_t *mac,
void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info);
void nr_ue_dl_scheduler(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info);
-csi_payload_t nr_ue_aperiodic_csi_reporting(NR_UE_MAC_INST_t *mac, dci_field_t csi_request, int tda, long *K2);
+nfapi_nr_ue_csi_payload_t nr_ue_aperiodic_csi_reporting(NR_UE_MAC_INST_t *mac, dci_field_t csi_request, int tda, long *K2);
nr_dci_format_t nr_ue_process_dci_indication_pdu(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, fapi_nr_dci_indication_pdu_t *dci);
@@ -137,12 +137,17 @@ bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac,
frame_t frame,
int slot);
-int nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sched_t *pucch);
+int nr_get_csi_measurements(NR_UE_MAC_INST_t *mac,
+ frame_t frame,
+ int slot,
+ nfapi_nr_ue_csi_payload_t *csi_payload,
+ NR_PUCCH_Resource_t **csi_pucch,
+ bool csi_on_pusch);
-csi_payload_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac,
+nfapi_nr_ue_csi_payload_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac,
int csi_report_id,
CSI_mapping_t mapping_type,
- NR_CSI_MeasConfig_t *csi_MeasConfig);
+ const NR_CSI_MeasConfig_t *csi_MeasConfig);
/* \brief Get payload (MAC PDU) from UE PHY
@param dl_info pointer to dl indication
@@ -330,7 +335,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
NR_tda_info_t *tda_info,
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
dci_pdu_rel15_t *dci,
- csi_payload_t *csi_report,
+ nfapi_nr_ue_csi_payload_t *csi_report,
RAR_grant_t *rar_grant,
rnti_t rnti,
int ss_type,
diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
index 461d21f3aa..9230294ca6 100644
--- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
+++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
@@ -97,7 +97,7 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac)
// default values as defined in 38.331 sec 9.2.2
// sf80 default for retxBSR_Timer sf10 for periodicBSR_Timer
- int mu = mac->current_UL_BWP ? mac->current_UL_BWP->scs : get_softmodem_params()->numerology;
+ int mu = mac->current_UL_BWP ? mac->current_UL_BWP->scs : mac->numerology;
int subframes_per_slot = get_slots_per_frame_from_scs(mu) / 10;
nr_timer_setup(&mac->scheduling_info.retxBSR_Timer, 80 * subframes_per_slot, 1); // 1 slot update rate
nr_timer_setup(&mac->scheduling_info.periodicBSR_Timer, 10 * subframes_per_slot, 1); // 1 slot update rate
@@ -130,7 +130,7 @@ NR_UE_L2_STATE_t nr_ue_get_sync_state(module_id_t mod_id)
return mac->state;
}
-NR_UE_MAC_INST_t *nr_l2_init_ue(int instance_id)
+NR_UE_MAC_INST_t *nr_l2_init_ue(int instance_id, int numerology)
{
AssertFatal(instance_id < MAX_NUM_NR_UE_INST, "instance_id %d is out of range\n", instance_id);
AssertFatal(nr_ue_mac_inst[instance_id] == NULL, "MAC instance %d already initialized\n", instance_id);
@@ -138,12 +138,13 @@ NR_UE_MAC_INST_t *nr_l2_init_ue(int instance_id)
NR_UE_MAC_INST_t *mac = nr_ue_mac_inst[instance_id];
mac->ue_id = instance_id;
+ mac->numerology = numerology;
nr_ue_init_mac(mac);
int ret = pthread_mutex_init(&mac->if_mutex, NULL);
AssertFatal(ret == 0, "Mutex init failed\n");
nr_ue_mac_default_configs(mac);
if (IS_SA_MODE(get_softmodem_params()))
- ue_init_config_request(mac, get_slots_per_frame_from_scs(get_softmodem_params()->numerology));
+ ue_init_config_request(mac, get_slots_per_frame_from_scs(numerology));
static bool initialized = false;
if (!initialized) {
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
index 0e8651a84d..8dbce0032c 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
@@ -427,7 +427,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
const NR_UE_DL_BWP_t *current_DL_BWP = mac->current_DL_BWP;
NR_BWP_Id_t dl_bwp_id = current_DL_BWP ? current_DL_BWP->bwp_id : 0;
NR_BWP_PDCCH_t *pdcch_config = &mac->config_BWP_PDCCH[dl_bwp_id];
- int scs = current_DL_BWP ? current_DL_BWP->scs : get_softmodem_params()->numerology;
+ int scs = current_DL_BWP ? current_DL_BWP->scs : mac->numerology;
const int slots_per_frame = get_slots_per_frame_from_scs(scs);
if (mac->get_sib1) {
int ssb_sc_offset_norm;
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
index b94a8758c8..672bc3c3a2 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
@@ -632,7 +632,7 @@ static int nr_ue_process_dci_ul_01(NR_UE_MAC_INST_t *mac,
/* CSI_REQUEST */
long csi_K2 = -1;
- csi_payload_t csi_report = {0};
+ nfapi_nr_ue_csi_payload_t csi_report = {0};
if (dci->csi_request.nbits > 0 && dci->csi_request.val > 0)
csi_report = nr_ue_aperiodic_csi_reporting(mac, dci->csi_request, dci->time_domain_assignment.val, &csi_K2);
@@ -1609,7 +1609,7 @@ int nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
pucch_pdu->second_hop_prb = pucchres->secondHopPRB!= NULL ? *pucchres->secondHopPRB : 0;
pucch_pdu->prb_size = 1; // format 0 or 1
- int n_uci = pucch->n_sr + pucch->n_harq + pucch->n_csi;
+ int n_uci = pucch->n_sr + pucch->n_harq + pucch->csi_payload.p1_bits;
if (n_uci > (sizeof(uint64_t) * 8)) {
LOG_E(NR_MAC, "PUCCH number of UCI bits exceeds payload size\n");
return -1;
@@ -1651,14 +1651,15 @@ int nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
pucch_pdu->dmrs_scrambling_id = id0 != NULL ? *id0 : mac->physCellId;
pucch_pdu->prb_size = compute_pucch_prb_size(2,
pucchres->format.choice.format2->nrofPRBs,
- pucch->n_csi,
+ pucch->csi_payload.p1_bits,
pucch->n_harq,
pucch->n_sr,
pucch_Config->format2->choice.setup->maxCodeRate,
2,
pucchres->format.choice.format2->nrofSymbols,
8);
- pucch_pdu->payload = (pucch->csi_part1_payload << (pucch->n_harq + pucch->n_sr)) | (pucch->sr_payload << pucch->n_harq) | pucch->ack_payload;
+ pucch_pdu->payload = (pucch->csi_payload.part1_payload << (pucch->n_harq + pucch->n_sr))
+ | (pucch->sr_payload << pucch->n_harq) | pucch->ack_payload;
break;
case NR_PUCCH_Resource__format_PR_format3 :
pucch_pdu->format_type = 3;
@@ -1686,14 +1687,15 @@ int nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
}
pucch_pdu->prb_size = compute_pucch_prb_size(3,
pucchres->format.choice.format3->nrofPRBs,
- pucch->n_csi,
+ pucch->csi_payload.p1_bits,
pucch->n_harq,
pucch->n_sr,
pucch_Config->format3->choice.setup->maxCodeRate,
2 - pucch_pdu->pi_2bpsk,
pucchres->format.choice.format3->nrofSymbols - f3_dmrs_symbols,
12);
- pucch_pdu->payload = (pucch->csi_part1_payload << (pucch->n_harq + pucch->n_sr)) | (pucch->sr_payload << pucch->n_harq) | pucch->ack_payload;
+ pucch_pdu->payload = (pucch->csi_payload.part1_payload << (pucch->n_harq + pucch->n_sr))
+ | (pucch->sr_payload << pucch->n_harq) | pucch->ack_payload;
break;
case NR_PUCCH_Resource__format_PR_format4 :
pucch_pdu->format_type = 4;
@@ -1711,7 +1713,8 @@ int nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
pucch_pdu->pi_2bpsk = pucchfmt->pi2BPSK!= NULL ? 1 : 0;
pucch_pdu->add_dmrs_flag = pucchfmt->additionalDMRS!= NULL ? 1 : 0;
}
- pucch_pdu->payload = (pucch->csi_part1_payload << (pucch->n_harq + pucch->n_sr)) | (pucch->sr_payload << pucch->n_harq) | pucch->ack_payload;
+ pucch_pdu->payload = (pucch->csi_payload.part1_payload << (pucch->n_harq + pucch->n_sr))
+ | (pucch->sr_payload << pucch->n_harq) | pucch->ack_payload;
break;
default :
LOG_E(NR_MAC, "Undefined PUCCH format \n");
@@ -2152,8 +2155,8 @@ void merge_resources(PUCCH_sched_t *res, int num_res, NR_PUCCH_Config_t *pucch_C
case NR_PUCCH_Resource__format_PR_format2:
case NR_PUCCH_Resource__format_PR_format4:
case NR_PUCCH_Resource__format_PR_format3:
- if (res[i + 1].n_csi > 0) {
- AssertFatal(res[i].n_csi == 0, "Multiplexing multiple CSI report in a single PUCCH not supported yet\n");
+ if (res[i + 1].csi_payload.p1_bits > 0) {
+ AssertFatal(res[i].csi_payload.p1_bits == 0, "Multiplexing multiple CSI report in a single PUCCH not supported yet\n");
AssertFatal(res[i].n_harq > 0 && res[i + 1].n_harq == 0,
"There is CSI in next F2 or above resource, since there is no CSI in current one, we expect HARQ in "
"there and not in next\n");
@@ -2166,8 +2169,8 @@ void merge_resources(PUCCH_sched_t *res, int num_res, NR_PUCCH_Config_t *pucch_C
res[i].n_sr = res[i + 1].n_sr;
res[i].sr_payload = res[i + 1].sr_payload;
}
- res[i].n_csi = res[i + 1].n_csi;
- res[i].csi_part1_payload = res[i + 1].csi_part1_payload;
+ res[i].csi_payload.p1_bits = res[i + 1].csi_payload.p1_bits;
+ res[i].csi_payload.part1_payload = res[i + 1].csi_payload.part1_payload;
res[i + 1] = res[i];
res[i] = empty;
} else {
@@ -2188,8 +2191,8 @@ void merge_resources(PUCCH_sched_t *res, int num_res, NR_PUCCH_Config_t *pucch_C
res[i] = empty;
}
}
- } else if (res[i].n_csi > 0) {
- AssertFatal(res[i + 1].n_csi == 0, "Multiplexing multiple CSI report in a single PUCCH not supported yet\n");
+ } else if (res[i].csi_payload.p1_bits > 0) {
+ AssertFatal(res[i + 1].csi_payload.p1_bits == 0, "Multiplexing multiple CSI report in a single PUCCH not supported yet\n");
AssertFatal(res[i + 1].n_harq > 0 && res[i].n_harq == 0,
"There is CSI in next F2 or above resource, since there is no CSI in current one, we expect HARQ in "
"there and not in next\n");
@@ -2202,8 +2205,8 @@ void merge_resources(PUCCH_sched_t *res, int num_res, NR_PUCCH_Config_t *pucch_C
res[i + 1].n_sr = res[i].n_sr;
res[i + 1].sr_payload = res[i].sr_payload;
}
- res[i + 1].n_csi = res[i].n_csi;
- res[i + 1].csi_part1_payload = res[i].csi_part1_payload;
+ res[i + 1].csi_payload.p1_bits = res[i].csi_payload.p1_bits;
+ res[i + 1].csi_payload.part1_payload = res[i].csi_payload.part1_payload;
res[i] = empty;
} else {
if (res[i + 1].n_sr > 0) {
@@ -2597,68 +2600,72 @@ int compute_csi_priority(NR_UE_MAC_INST_t *mac, NR_CSI_ReportConfig_t *csirep)
return 2 * Ncells * Ms * y + Ncells * Ms * k + Ms * c + s;
}
-int nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sched_t *pucch)
+int nr_get_csi_measurements(NR_UE_MAC_INST_t *mac,
+ frame_t frame,
+ int slot,
+ nfapi_nr_ue_csi_payload_t *csi_payload,
+ NR_PUCCH_Resource_t **csi_pucch,
+ bool csi_on_pusch)
{
NR_UE_UL_BWP_t *current_UL_BWP = mac->current_UL_BWP;
NR_PUCCH_Config_t *pucch_Config = current_UL_BWP ? current_UL_BWP->pucch_Config : NULL;
+
+ if (!mac->sc_info.csi_MeasConfig || !pucch_Config)
+ return 0;
+
int num_csi = 0;
+ NR_CSI_MeasConfig_t *csi_measconfig = mac->sc_info.csi_MeasConfig;
- if (mac->sc_info.csi_MeasConfig) {
- NR_CSI_MeasConfig_t *csi_measconfig = mac->sc_info.csi_MeasConfig;
+ int csi_priority = INT_MAX;
+ for (int csi_report_id = 0; csi_report_id < csi_measconfig->csi_ReportConfigToAddModList->list.count; csi_report_id++) {
+ NR_CSI_ReportConfig_t *csirep = csi_measconfig->csi_ReportConfigToAddModList->list.array[csi_report_id];
- int csi_priority = INT_MAX;
- for (int csi_report_id = 0; csi_report_id < csi_measconfig->csi_ReportConfigToAddModList->list.count; csi_report_id++) {
- NR_CSI_ReportConfig_t *csirep = csi_measconfig->csi_ReportConfigToAddModList->list.array[csi_report_id];
+ AssertFatal(csirep->reportConfigType.present == NR_CSI_ReportConfig__reportConfigType_PR_aperiodic
+ || csirep->reportConfigType.present == NR_CSI_ReportConfig__reportConfigType_PR_periodic,
+ "Not supported CSI report type\n");
- if(csirep->reportConfigType.present == NR_CSI_ReportConfig__reportConfigType_PR_periodic) {
- int period, offset;
- csi_period_offset(csirep, NULL, &period, &offset);
- const int n_slots_frame = mac->frame_structure.numb_slots_frame;
- if (((n_slots_frame*frame + slot - offset)%period) == 0 && pucch_Config) {
- int csi_res_id = -1;
- for (int i = 0; i < csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.count; i++) {
- const NR_PUCCH_CSI_Resource_t *pucchcsires =
- csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.array[i];
- if (pucchcsires->uplinkBandwidthPartId == current_UL_BWP->bwp_id) {
- csi_res_id = pucchcsires->pucch_Resource;
- break;
- }
- }
- if (csi_res_id < 0) {
- // This CSI Report ID is not associated with current active BWP
- continue;
- }
- NR_PUCCH_Resource_t *csi_pucch = find_pucch_resource_from_list(pucch_Config->resourceToAddModList, csi_res_id);
- AssertFatal(csi_pucch != NULL, "Couldn't find PUCCH Resource ID for SR in PUCCH resource list\n");
- LOG_D(NR_MAC, "Preparing CSI report in frame %d slot %d CSI report ID %d\n", frame, slot, csi_report_id);
- int temp_priority = compute_csi_priority(mac, csirep);
- if (num_csi > 0) {
- // need to verify if we can multiplex multiple CSI report
- if (pucch_Config->multi_CSI_PUCCH_ResourceList) {
- AssertFatal(false, "Multiplexing multiple CSI report in a single PUCCH not supported yet\n");
- } else if (temp_priority < csi_priority) {
- // we discard previous report
- csi_priority = temp_priority;
- num_csi = 1;
- csi_payload_t csi = nr_get_csi_payload(mac, csi_report_id, WIDEBAND_ON_PUCCH, csi_measconfig);
- pucch->n_csi = csi.p1_bits;
- pucch->csi_part1_payload = csi.part1_payload;
- pucch->pucch_resource = csi_pucch;
- } else
- continue;
- } else {
- num_csi = 1;
- csi_priority = temp_priority;
- csi_payload_t csi = nr_get_csi_payload(mac, csi_report_id, WIDEBAND_ON_PUCCH, csi_measconfig);
- pucch->n_csi = csi.p1_bits;
- pucch->csi_part1_payload = csi.part1_payload;
- pucch->pucch_resource = csi_pucch;
- }
- }
+ // Aperiodic CSI measurements handled in nr_ue_aperiodic_csi_reporting function
+ if (csirep->reportConfigType.present != NR_CSI_ReportConfig__reportConfigType_PR_periodic)
+ continue;
+
+ int period, offset;
+ csi_period_offset(csirep, NULL, &period, &offset);
+ const int n_slots_frame = mac->frame_structure.numb_slots_frame;
+ // Check if current slot falls in the report period
+ if (((n_slots_frame * frame + slot - offset) % period) != 0)
+ continue;
+
+ int csi_res_id = -1;
+ for (int i = 0; i < csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.count; i++) {
+ const NR_PUCCH_CSI_Resource_t *pucchcsires = csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.array[i];
+ if (pucchcsires->uplinkBandwidthPartId == current_UL_BWP->bwp_id) {
+ csi_res_id = pucchcsires->pucch_Resource;
+ break;
}
- else
- AssertFatal(csirep->reportConfigType.present == NR_CSI_ReportConfig__reportConfigType_PR_aperiodic,
- "Not supported CSI report type\n");
+ }
+ if (csi_res_id < 0) {
+ // This CSI Report ID is not associated with current active BWP
+ continue;
+ }
+ *csi_pucch = find_pucch_resource_from_list(pucch_Config->resourceToAddModList, csi_res_id);
+ AssertFatal(*csi_pucch != NULL, "Couldn't find PUCCH Resource ID for CSI in PUCCH resource list\n");
+ LOG_D(NR_MAC, "Preparing CSI report in frame %d slot %d CSI report ID %d\n", frame, slot, csi_report_id);
+ int temp_priority = compute_csi_priority(mac, csirep);
+ if (num_csi > 0) {
+ // need to verify if we can multiplex multiple CSI report
+ if (pucch_Config->multi_CSI_PUCCH_ResourceList) {
+ AssertFatal(false, "Multiplexing multiple CSI report in a single PUCCH not supported yet\n");
+ } else if (temp_priority < csi_priority) {
+ // we discard previous report
+ csi_priority = temp_priority;
+ num_csi = 1;
+ *csi_payload = nr_get_csi_payload(mac, csi_report_id, csi_on_pusch ? ON_PUSCH : WIDEBAND_ON_PUCCH, csi_measconfig);
+ } else
+ continue;
+ } else {
+ num_csi = 1;
+ csi_priority = temp_priority;
+ *csi_payload = nr_get_csi_payload(mac, csi_report_id, csi_on_pusch ? ON_PUSCH : WIDEBAND_ON_PUCCH, csi_measconfig);
}
}
return num_csi;
@@ -2696,10 +2703,10 @@ static int compare_ssb_sinr(const void *a, const void *b)
return mb->ssb_sinr_dB - ma->ssb_sinr_dB;
}
-static csi_payload_t get_ssb_sinr_payload(NR_UE_MAC_INST_t *mac,
- struct NR_CSI_ReportConfig *csi_reportconfig,
- NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
- NR_CSI_MeasConfig_t *csi_MeasConfig)
+static nfapi_nr_ue_csi_payload_t get_ssb_sinr_payload(NR_UE_MAC_INST_t *mac,
+ const struct NR_CSI_ReportConfig *csi_reportconfig,
+ const NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
+ const NR_CSI_MeasConfig_t *csi_MeasConfig)
{
int nb_ssb = 0; // nb of ssb in the resource
int nb_meas = 0; // nb of ssb to report measurements on
@@ -2717,7 +2724,7 @@ static csi_payload_t get_ssb_sinr_payload(NR_UE_MAC_INST_t *mac,
} else
nb_meas = 2;
- struct NR_CSI_SSB_ResourceSet__csi_SSB_ResourceList *SSB_resource = NULL;
+ const struct NR_CSI_SSB_ResourceSet__csi_SSB_ResourceList *SSB_resource = NULL;
for (int csi_ssb_idx = 0; csi_ssb_idx < csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; csi_ssb_idx++) {
if (csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceSetId
== *(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.array[0])) {
@@ -2770,9 +2777,9 @@ static csi_payload_t get_ssb_sinr_payload(NR_UE_MAC_INST_t *mac,
break; // resource found
}
}
- int max_bits = sizeof(((csi_payload_t *)0)->part1_payload) * 8;
+ int max_bits = sizeof(((nfapi_nr_ue_csi_payload_t *)0)->part1_payload) * 8;
AssertFatal(bits <= max_bits, "Not supporting CSI report with more than %d bits (payload: %d bits)\n", max_bits, bits);
- csi_payload_t csi = {.part1_payload = temp_payload, .part2_payload = 0, .p1_bits = bits, csi.p2_bits = 0};
+ nfapi_nr_ue_csi_payload_t csi = {.part1_payload = temp_payload, .part2_payload = 0, .p1_bits = bits, csi.p2_bits = 0};
return csi;
}
@@ -2795,10 +2802,10 @@ static uint8_t get_rsrp_diff_index(int best_rsrp, int current_rsrp)
return (diff>>1);
}
-static csi_payload_t get_ssb_rsrp_payload(NR_UE_MAC_INST_t *mac,
- struct NR_CSI_ReportConfig *csi_reportconfig,
- NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
- NR_CSI_MeasConfig_t *csi_MeasConfig)
+static nfapi_nr_ue_csi_payload_t get_ssb_rsrp_payload(NR_UE_MAC_INST_t *mac,
+ const struct NR_CSI_ReportConfig *csi_reportconfig,
+ const NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
+ const NR_CSI_MeasConfig_t *csi_MeasConfig)
{
int nb_ssb = 0; // nb of ssb in the resource
int nb_meas = 0; // nb of ssb to report measurements on
@@ -2817,7 +2824,7 @@ static csi_payload_t get_ssb_rsrp_payload(NR_UE_MAC_INST_t *mac,
} else
nb_meas = 2;
- struct NR_CSI_SSB_ResourceSet__csi_SSB_ResourceList *SSB_resource = NULL;
+ const struct NR_CSI_SSB_ResourceSet__csi_SSB_ResourceList *SSB_resource = NULL;
for (int csi_ssb_idx = 0; csi_ssb_idx < csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; csi_ssb_idx++) {
if (csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_ssb_idx]->csi_SSB_ResourceSetId ==
*(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.array[0])){
@@ -2870,18 +2877,18 @@ static csi_payload_t get_ssb_rsrp_payload(NR_UE_MAC_INST_t *mac,
break; // resource found
}
}
- int max_bits = sizeof(((csi_payload_t *)0)->part1_payload) * 8;
+ int max_bits = sizeof(((nfapi_nr_ue_csi_payload_t *)0)->part1_payload) * 8;
AssertFatal(bits <= max_bits, "Not supporting CSI report with more than %d bits (payload: %d bits)\n", max_bits, bits);
- csi_payload_t csi = {.part1_payload = temp_payload, .part2_payload = 0, .p1_bits = bits, .p2_bits = 0};
+ nfapi_nr_ue_csi_payload_t csi = {.part1_payload = temp_payload, .part2_payload = 0, .p1_bits = bits, .p2_bits = 0};
return csi;
}
-static csi_payload_t get_csirs_RI_PMI_CQI_payload(NR_UE_MAC_INST_t *mac,
- struct NR_CSI_ReportConfig *csi_reportconfig,
- NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
- NR_CSI_MeasConfig_t *csi_MeasConfig,
- CSI_mapping_t mapping_type)
+static nfapi_nr_ue_csi_payload_t get_csirs_RI_PMI_CQI_payload(NR_UE_MAC_INST_t *mac,
+ const struct NR_CSI_ReportConfig *csi_reportconfig,
+ const NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
+ const NR_CSI_MeasConfig_t *csi_MeasConfig,
+ const CSI_mapping_t mapping_type)
{
int p1_bits = 0;
int p2_bits = 0;
@@ -2949,13 +2956,13 @@ static csi_payload_t get_csirs_RI_PMI_CQI_payload(NR_UE_MAC_INST_t *mac,
}
}
AssertFatal(p1_bits <= 32 && p2_bits <= 32, "Not supporting CSI report with more than 32 bits\n");
- csi_payload_t csi = {.part1_payload = temp_payload_1, .part2_payload = temp_payload_2, .p1_bits = p1_bits, csi.p2_bits = p2_bits};
+ nfapi_nr_ue_csi_payload_t csi = {.part1_payload = temp_payload_1, .part2_payload = temp_payload_2, .p1_bits = p1_bits, csi.p2_bits = p2_bits};
return csi;
}
-static csi_payload_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac,
- struct NR_CSI_ReportConfig *csi_reportconfig,
- NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
+static nfapi_nr_ue_csi_payload_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac,
+ const struct NR_CSI_ReportConfig *csi_reportconfig,
+ const NR_CSI_ResourceConfigId_t csi_ResourceConfigId,
const NR_CSI_MeasConfig_t *csi_MeasConfig)
{
int n_bits = 0;
@@ -3002,17 +3009,17 @@ static csi_payload_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac,
}
}
AssertFatal(n_bits <= 32, "Not supporting CSI report with more than 32 bits\n");
- csi_payload_t csi = {.part1_payload = temp_payload, .p1_bits = n_bits, csi.p2_bits = 0};
+ nfapi_nr_ue_csi_payload_t csi = {.part1_payload = temp_payload, .p1_bits = n_bits, csi.p2_bits = 0};
return csi;
}
-csi_payload_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac,
- int csi_report_id,
- CSI_mapping_t mapping_type,
- NR_CSI_MeasConfig_t *csi_MeasConfig)
+nfapi_nr_ue_csi_payload_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac,
+ int csi_report_id,
+ CSI_mapping_t mapping_type,
+ const NR_CSI_MeasConfig_t *csi_MeasConfig)
{
AssertFatal(csi_MeasConfig->csi_ReportConfigToAddModList->list.count > 0,"No CSI Report configuration available\n");
- csi_payload_t csi = {0};
+ nfapi_nr_ue_csi_payload_t csi = {0};
struct NR_CSI_ReportConfig *csi_reportconfig = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id];
NR_CSI_ResourceConfigId_t csi_ResourceConfigId = csi_reportconfig->resourcesForChannelMeasurement;
if (csi_reportconfig->ext2 && csi_reportconfig->ext2->reportQuantity_r16) {
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
index 2818c20c37..fcc977d9e5 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
@@ -341,6 +341,26 @@ void ul_layers_config(NR_UE_MAC_INST_t *mac, nfapi_nr_ue_pusch_pdu_t *pusch_conf
}
}
+static void fill_pusch_uci_struct(const NR_PUSCH_Config_t *pusch_Config,
+ const nfapi_nr_ue_csi_payload_t *csi_payload,
+ nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu)
+{
+ pusch_config_pdu->pusch_uci.csi_payload = *csi_payload;
+ AssertFatal(pusch_Config && pusch_Config->uci_OnPUSCH, "UCI on PUSCH need to be configured\n");
+ NR_UCI_OnPUSCH_t *onPusch = pusch_Config->uci_OnPUSCH->choice.setup;
+ AssertFatal(onPusch && onPusch->betaOffsets && onPusch->betaOffsets->present == NR_UCI_OnPUSCH__betaOffsets_PR_semiStatic,
+ "Only semistatic beta offset is supported\n");
+ NR_BetaOffsets_t *beta_offsets = onPusch->betaOffsets->choice.semiStatic;
+
+ pusch_config_pdu->pusch_uci.beta_offset_csi1 = pusch_config_pdu->pusch_uci.csi_payload.p1_bits < 12
+ ? *beta_offsets->betaOffsetCSI_Part1_Index1
+ : *beta_offsets->betaOffsetCSI_Part1_Index2;
+ pusch_config_pdu->pusch_uci.beta_offset_csi2 = pusch_config_pdu->pusch_uci.csi_payload.p2_bits < 12
+ ? *beta_offsets->betaOffsetCSI_Part2_Index1
+ : *beta_offsets->betaOffsetCSI_Part2_Index2;
+ pusch_config_pdu->pusch_uci.alpha_scaling = onPusch->scaling;
+}
+
// Configuration of Msg3 PDU according to clauses:
// - 8.3 of 3GPP TS 38.213 version 16.3.0 Release 16
// - 6.1.2.2 of TS 38.214
@@ -353,7 +373,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
NR_tda_info_t *tda_info,
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
dci_pdu_rel15_t *dci,
- csi_payload_t *csi_report,
+ nfapi_nr_ue_csi_payload_t *csi_report,
RAR_grant_t *rar_grant,
rnti_t rnti,
int ss_type,
@@ -534,29 +554,10 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
pusch_config_pdu->ulsch_indicator = dci->ulsch_indicator;
if (dci->csi_request.nbits > 0 && dci->csi_request.val > 0) {
AssertFatal(csi_report, "CSI report needs to be present in case of CSI request\n");
- pusch_config_pdu->pusch_uci.csi_part1_bit_length = csi_report->p1_bits;
- pusch_config_pdu->pusch_uci.csi_part1_payload = csi_report->part1_payload;
- pusch_config_pdu->pusch_uci.csi_part2_bit_length = csi_report->p2_bits;
- pusch_config_pdu->pusch_uci.csi_part2_payload = csi_report->part2_payload;
- AssertFatal(pusch_Config && pusch_Config->uci_OnPUSCH, "UCI on PUSCH need to be configured\n");
- NR_UCI_OnPUSCH_t *onPusch = pusch_Config->uci_OnPUSCH->choice.setup;
- AssertFatal(onPusch &&
- onPusch->betaOffsets &&
- onPusch->betaOffsets->present == NR_UCI_OnPUSCH__betaOffsets_PR_semiStatic,
- "Only semistatic beta offset is supported\n");
- NR_BetaOffsets_t *beta_offsets = onPusch->betaOffsets->choice.semiStatic;
-
- pusch_config_pdu->pusch_uci.beta_offset_csi1 = pusch_config_pdu->pusch_uci.csi_part1_bit_length < 12 ?
- *beta_offsets->betaOffsetCSI_Part1_Index1 :
- *beta_offsets->betaOffsetCSI_Part1_Index2;
- pusch_config_pdu->pusch_uci.beta_offset_csi2 = pusch_config_pdu->pusch_uci.csi_part2_bit_length < 12 ?
- *beta_offsets->betaOffsetCSI_Part2_Index1 :
- *beta_offsets->betaOffsetCSI_Part2_Index2;
- pusch_config_pdu->pusch_uci.alpha_scaling = onPusch->scaling;
- }
- else {
- pusch_config_pdu->pusch_uci.csi_part1_bit_length = 0;
- pusch_config_pdu->pusch_uci.csi_part2_bit_length = 0;
+ fill_pusch_uci_struct(pusch_Config, csi_report, pusch_config_pdu);
+ } else {
+ pusch_config_pdu->pusch_uci.csi_payload.p1_bits = 0;
+ pusch_config_pdu->pusch_uci.csi_payload.p2_bits = 0;
}
pusch_config_pdu->pusch_uci.harq_ack_bit_length = 0;
@@ -864,13 +865,13 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
return 0;
}
-csi_payload_t nr_ue_aperiodic_csi_reporting(NR_UE_MAC_INST_t *mac, dci_field_t csi_request, int tda, long *k2)
+nfapi_nr_ue_csi_payload_t nr_ue_aperiodic_csi_reporting(NR_UE_MAC_INST_t *mac, dci_field_t csi_request, int tda, long *k2)
{
NR_CSI_AperiodicTriggerStateList_t *aperiodicTriggerStateList = mac->sc_info.aperiodicTriggerStateList;
AssertFatal(aperiodicTriggerStateList, "Received CSI request via DCI but aperiodicTriggerStateList is not present\n");
int n_states = aperiodicTriggerStateList->list.count;
int n_ts = csi_request.nbits;
- csi_payload_t csi = {0};
+ nfapi_nr_ue_csi_payload_t csi = {0};
AssertFatal(n_states <= ((1 << n_ts) - 1), "Case of subselection indication of trigger states not supported yet\n");
int num_trig = 0;
for (int i = 0; i < n_ts; i++) {
@@ -891,8 +892,8 @@ csi_payload_t nr_ue_aperiodic_csi_reporting(NR_UE_MAC_INST_t *mac, dci_field_t c
if (report_config->reportConfigId == id) {
struct NR_CSI_ReportConfig__reportConfigType__aperiodic__reportSlotOffsetList *offset_list = &report_config->reportConfigType.choice.aperiodic->reportSlotOffsetList;
AssertFatal(tda < offset_list->list.count, "TDA index from DCI %d exceeds slot offset list %d\n", tda, offset_list->list.count);
- if (k2 == NULL || *k2 < *offset_list->list.array[tda])
- k2 = offset_list->list.array[tda];
+ if (*k2 < *offset_list->list.array[tda])
+ *k2 = *offset_list->list.array[tda];
found = c;
break;
}
@@ -1791,9 +1792,17 @@ static bool schedule_uci_on_pusch(NR_UE_MAC_INST_t *mac,
LOG_E(NR_MAC, "UCI on PUSCH need to be configured to schedule UCI on PUSCH\n");
}
}
- if (pusch_pdu->pusch_uci.csi_part1_bit_length == 0 && pusch_pdu->pusch_uci.csi_part2_bit_length == 0) {
- // To support this we would need to shift some bits into CSI part2 -> need to change the logic
- AssertFatal(pucch->n_csi == 0, "Multiplexing periodic CSI on PUSCH not supported\n");
+
+ AssertFatal(pusch_pdu->pusch_uci.csi_payload.p1_bits == 0, "PUSCH already has CSI report\n");
+
+ // Check if this PUCCH has CSI report to send. If so, multiplex it on PUSCH
+ if (pucch->csi_payload.p1_bits > 0) {
+ nfapi_nr_ue_csi_payload_t csi_payload = {0};
+ NR_PUSCH_Config_t *pusch_Config = mac->current_UL_BWP->pusch_Config;
+ NR_PUCCH_Resource_t *csi_pucch = NULL;
+ nr_get_csi_measurements(mac, frame_tx, slot_tx, &csi_payload, &csi_pucch, true);
+ fill_pusch_uci_struct(pusch_Config, &csi_payload, pusch_pdu);
+ mux_done = true;
}
release_ul_config(ulcfg_pdu, false);
@@ -1824,7 +1833,7 @@ static void nr_ue_pucch_scheduler(NR_UE_MAC_INST_t *mac, frame_t frame, int slot
// CSI
int csi_res = 0;
if (mac->state == UE_CONNECTED)
- csi_res = nr_get_csi_measurements(mac, frame, slot, &pucch[num_res]);
+ csi_res = nr_get_csi_measurements(mac, frame, slot, &pucch[num_res].csi_payload, &pucch[num_res].pucch_resource, false);
if (csi_res > 0) {
num_res += csi_res;
}
@@ -1845,14 +1854,14 @@ static void nr_ue_pucch_scheduler(NR_UE_MAC_INST_t *mac, frame_t frame, int slot
}
for (int j = 0; j < num_res; j++) {
- if (pucch[j].n_harq + pucch[j].n_sr + pucch[j].n_csi != 0) {
+ if (pucch[j].n_harq + pucch[j].n_sr + pucch[j].csi_payload.p1_bits != 0) {
LOG_D(NR_MAC,
"%d.%d configure pucch, O_ACK %d, O_SR %d, O_CSI %d\n",
frame,
slot,
pucch[j].n_harq,
pucch[j].n_sr,
- pucch[j].n_csi);
+ pucch[j].csi_payload.p1_bits);
// checking if we need to schedule pucch[j] on PUSCH
if (schedule_uci_on_pusch(mac, frame, slot, &pucch[j], mac->current_UL_BWP))
@@ -2696,6 +2705,18 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
}
}
+static void get_pusch_frame_slot(const int current_frame,
+ const int current_slot,
+ const int k2,
+ const int delta,
+ const int slots_per_frame,
+ frame_t *frame_tx,
+ int *slot_tx)
+{
+ *slot_tx = (current_slot + k2 + delta) % slots_per_frame;
+ *frame_tx = (current_frame + (current_slot + k2 + delta) / slots_per_frame) % MAX_FRAME_NUMBER;
+}
+
// PUSCH scheduler:
// - Calculate the slot in which ULSCH should be scheduled. This is current slot + K2,
// - where K2 is the offset between the slot in which UL DCI is received and the slot
@@ -2734,8 +2755,7 @@ int nr_ue_pusch_scheduler(const NR_UE_MAC_INST_t *mac,
GET_DURATION_RX_TO_TX(&mac->phy_config.config_req.ntn_config, mu));
- *slot_tx = (current_slot + k2 + delta) % slots_per_frame;
- *frame_tx = (current_frame + (current_slot + k2 + delta) / slots_per_frame) % MAX_FRAME_NUMBER;
+ get_pusch_frame_slot(current_frame, current_slot, k2, delta, slots_per_frame, frame_tx, slot_tx);
} else {
AssertFatal(k2 >= GET_DURATION_RX_TO_TX(&mac->phy_config.config_req.ntn_config, mu),
"Slot offset K2 (%ld) needs to be higher than DURATION_RX_TO_TX (%ld). Please set min_rxtxtime at least to %ld in "
@@ -2752,8 +2772,7 @@ int nr_ue_pusch_scheduler(const NR_UE_MAC_INST_t *mac,
}
// Calculate TX slot and frame
- *slot_tx = (current_slot + k2) % slots_per_frame;
- *frame_tx = (current_frame + (current_slot + k2) / slots_per_frame) % MAX_FRAME_NUMBER;
+ get_pusch_frame_slot(current_frame, current_slot, k2, 0, slots_per_frame, frame_tx, slot_tx);
}
LOG_D(NR_MAC, "[%04d.%02d] UL transmission in [%04d.%02d] (k2 %ld delta %d)\n", current_frame, current_slot, *frame_tx, *slot_tx, k2, delta);
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
index 5dd7e89fec..921003d110 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
@@ -47,7 +47,6 @@
/////* DLSCH MAC PDU generation (6.1.2 TS 38.321) */////
////////////////////////////////////////////////////////
#define OCTET 8
-#define HALFWORD 16
#define WORD 32
//#define SIZE_OF_POINTER sizeof (void *)
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
index 4207f6de93..2dea54ea4a 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
@@ -54,7 +54,6 @@
#include "SIMULATION/TOOLS/sim.h" // for taus
#define ENABLE_MAC_PAYLOAD_DEBUG
-#define DEBUG_gNB_SCHEDULER 1
#include "common/ran_context.h"
#include "nfapi/oai_integration/vendor_ext.h"
@@ -62,7 +61,6 @@
#include "common/utils/alg/find.h"
// 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs
-#define NR_RRC_SETUP_DELAY_MS 10
#define NR_RRC_RECONFIGURATION_DELAY_MS 10
#define NR_RRC_BWP_SWITCHING_DELAY_MS 6
diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
index c271824e75..7229b98fd0 100644
--- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
+++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
@@ -607,6 +607,86 @@ static NR_UE_info_t *create_new_UE(gNB_MAC_INST *mac, uint32_t cu_id, const NR_C
return UE;
}
+/** @brief Encode CellGroupConfig to byte array for transparent forwarding in F1AP messages.
+ * The encoded bytes are intended for transparent forwarding to the UE without
+ * decode/re-encode cycles per TS 38.473 transparency requirements.
+ * @param cellGroup CellGroupConfig to encode
+ * @return Encoded byte array */
+static byte_array_t encode_cellgroup_config(const NR_CellGroupConfig_t *cellGroup)
+{
+ byte_array_t cgc = {0};
+ ssize_t encoded = uper_encode_to_new_buffer(&asn_DEF_NR_CellGroupConfig, NULL, cellGroup, (void **)&cgc.buf);
+ AssertFatal(encoded > 0, "Could not encode CellGroup\n");
+ cgc.len = encoded;
+ return cgc;
+}
+
+/** @brief Handle RRC container from UE Context Setup/Modification request.
+ * Per 3GPP TS 38.473, the RRCContainer IE contains an RRC message (e.g., DL-DCCH-Message
+ * as defined in TS 38.331) that is encapsulated in a PDCP PDU. The DU forwards this
+ * container transparently to the UE via SRB1 without decode/re-encode cycles.
+ * @param rrc_container RRC container
+ * @param rnti RNTI of the UE */
+static void handle_ue_context_rrc_container(const byte_array_t *rrc_container, const rnti_t rnti)
+{
+ DevAssert(rrc_container);
+ logical_chan_id_t id = 1;
+ nr_rlc_srb_recv_sdu(rnti, id, rrc_container->buf, rrc_container->len);
+}
+
+/** @brief Get and clone CellGroupConfig for UE Context Setup/Modification response.
+ * The source depends on re-establishment state:
+ * - CellGroup: Currently active/runtime CellGroupConfig used by MAC for scheduling.
+ * During re-establishment, spCellConfig is removed from it (per TS 38.331 §5.3.7.2).
+ * - reconfigCellGroup: Staging area that holds a complete CellGroupConfig saved before
+ * modifications. During re-establishment, it still contains spCellConfig (saved before
+ * removal). It becomes the new CellGroup when reconfiguration completes.
+ * During re-establishment, we must clone from reconfigCellGroup to get a complete
+ * CellGroupConfig with spCellConfig for transparent forwarding to the UE.
+ * @param UE UE context
+ * @return Cloned CellGroupConfig */
+static NR_CellGroupConfig_t *get_cellgroup_config(NR_UE_info_t *UE)
+{
+ if (UE->reestablish_rlc && UE->reconfigCellGroup != NULL) {
+ return clone_CellGroupConfig(UE->reconfigCellGroup);
+ } else {
+ return clone_CellGroupConfig(UE->CellGroup);
+ }
+}
+
+/** @brief Update CellGroupConfig for RRC re-establishment procedure.
+ * This function prepares a complete CellGroupConfig for gNB-DU Configuration Query response
+ * during RRC re-establishment.
+ * The function sets reestablishRLC flags for all RLC bearers except SRB1.
+ * SRB1 is removed from the bearer list since it is already re-established during
+ * RRCReestablishment and should not be included. */
+static void update_cellgroup_for_reestablishment(NR_UE_info_t *UE, NR_CellGroupConfig_t *new_CellGroup)
+{
+ DevAssert(new_CellGroup);
+ DevAssert(new_CellGroup->spCellConfig);
+ DevAssert(UE->reestablish_rlc);
+ LOG_I(NR_MAC, "UE %04x: Re-establishment detected, setting reestablishRLC flags\n", UE->rnti);
+ struct NR_CellGroupConfig__rlc_BearerToAddModList *addmod = new_CellGroup->rlc_BearerToAddModList;
+ if (addmod && addmod->list.count > 0) {
+ LOG_I(NR_MAC, "UE %04x: CellGroupConfig has %d bearers:\n", UE->rnti, addmod->list.count);
+ for (int i = 0; i < addmod->list.count; ++i) {
+ NR_RLC_BearerConfig_t *bearer = addmod->list.array[i];
+ int lcid = bearer->logicalChannelIdentity;
+ int rb_type = bearer->servedRadioBearer->present;
+ int rb_id = (rb_type == NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity)
+ ? bearer->servedRadioBearer->choice.srb_Identity
+ : bearer->servedRadioBearer->choice.drb_Identity;
+ if (rb_type == NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity && rb_id == 1) {
+ asn_sequence_del(&addmod->list, i, 1);
+ --i;
+ continue;
+ }
+ LOG_I(NR_MAC, "UE %04x: Re-establishing RLC for LCID %d\n", UE->rnti, lcid);
+ asn1cCallocOne(addmod->list.array[i]->reestablishRLC, NR_RLC_BearerConfig__reestablishRLC_true);
+ }
+ }
+}
+
void ue_context_setup_request(const f1ap_ue_context_setup_req_t *req)
{
const bool is_SA = IS_SA_MODE(get_softmodem_params());
@@ -653,7 +733,8 @@ void ue_context_setup_request(const f1ap_ue_context_setup_req_t *req)
AssertFatal(UE, "no UE found or could not be created, but UE Context Setup Failed not implemented\n");
resp.gNB_DU_ue_id = UE->rnti;
- NR_CellGroupConfig_t *new_CellGroup = clone_CellGroupConfig(UE->CellGroup);
+ NR_CellGroupConfig_t *new_CellGroup = get_cellgroup_config(UE);
+
// Needed for DRB Setup (e.g., RLC might reduce SN size)
UE->capability = ue_cap;
@@ -667,8 +748,7 @@ void ue_context_setup_request(const f1ap_ue_context_setup_req_t *req)
}
if (req->rrc_container != NULL) {
- logical_chan_id_t id = 1;
- nr_rlc_srb_recv_sdu(UE->rnti, id, req->rrc_container->buf, req->rrc_container->len);
+ handle_ue_context_rrc_container(req->rrc_container, UE->rnti);
}
NR_ServingCellConfigCommon_t *scc = mac->common_channels[0].ServingCellConfigCommon;
@@ -678,6 +758,15 @@ void ue_context_setup_request(const f1ap_ue_context_setup_req_t *req)
update_cellGroupConfig(new_CellGroup, UE->uid, UE->capability, &mac->radio_config, scc);
}
+ /* During re-establishment, prepare CellGroupConfig for UE Context Setup response.
+ * Per TS 38.401 §8.7: when a UE re-establishes on a different DU, the CU triggers
+ * UE Context Setup on the new DU. The DU must respond with a CellGroupConfig that has
+ * reestablishRLC flags set for all RLC bearers except SRB1. This prepares the CellGroupConfig
+ * for transparent forwarding to the UE per TS 38.473 transparency requirements. */
+ if (UE->reestablish_rlc) {
+ update_cellgroup_for_reestablishment(UE, new_CellGroup);
+ }
+
if (!ue_id_provided && cg_configinfo == NULL) {
/* new UE: tell the UE to reestablish RLC */
struct NR_CellGroupConfig__rlc_BearerToAddModList *addmod = new_CellGroup->rlc_BearerToAddModList;
@@ -688,12 +777,7 @@ void ue_context_setup_request(const f1ap_ue_context_setup_req_t *req)
}
}
- byte_array_t cgc = { .buf = calloc_or_fail(1,1024) };
- asn_enc_rval_t enc_rval =
- uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, new_CellGroup, cgc.buf, 1024);
- AssertFatal(enc_rval.encoded > 0, "Could not encode CellGroup, failed element %s\n", enc_rval.failed_type->name);
- cgc.len = (enc_rval.encoded + 7) >> 3;
- resp.du_to_cu_rrc_info.cell_group_config = cgc;
+ resp.du_to_cu_rrc_info.cell_group_config = encode_cellgroup_config(new_CellGroup);
ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->reconfigCellGroup);
UE->reconfigCellGroup = new_CellGroup;
@@ -745,7 +829,7 @@ void ue_context_modification_request(const f1ap_ue_context_mod_req_t *req)
return;
}
- NR_CellGroupConfig_t *new_CellGroup = clone_CellGroupConfig(UE->CellGroup);
+ NR_CellGroupConfig_t *new_CellGroup = get_cellgroup_config(UE);
if (req->srbs_len > 0) {
resp.srbs_len = handle_ue_context_srbs_setup(UE, req->srbs_len, req->srbs, &resp.srbs, new_CellGroup, &mac->rlc_config);
@@ -760,8 +844,7 @@ void ue_context_modification_request(const f1ap_ue_context_mod_req_t *req)
}
if (req->rrc_container != NULL) {
- logical_chan_id_t id = 1;
- nr_rlc_srb_recv_sdu(req->gNB_DU_ue_id, id, req->rrc_container->buf, req->rrc_container->len);
+ handle_ue_context_rrc_container(req->rrc_container, req->gNB_DU_ue_id);
}
NR_ServingCellConfigCommon_t *scc = mac->common_channels[0].ServingCellConfigCommon;
@@ -771,6 +854,10 @@ void ue_context_modification_request(const f1ap_ue_context_mod_req_t *req)
} else if (req->reconfig_compl) {
LOG_I(NR_MAC, "DU received confirmation of successful RRC Reconfiguration\n");
if (UE->reconfigCellGroup) {
+ /** During handover, target DU never sends RRC Reconfiguration (source DU does),
+ * so ack_reconfig is never called on target DU - this warning is expected.
+ * If RRC Reconfiguration was sent via PDSCH, ack_reconfig should have been called when UE ACKed it.
+ * If not, this warning would indicate a bug. */
LOG_W(NR_MAC, "reconfigCellGroup still present, did we miss ACK for RRCReconfiguration?\n");
ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->CellGroup);
UE->CellGroup = UE->reconfigCellGroup;
@@ -780,6 +867,7 @@ void ue_context_modification_request(const f1ap_ue_context_mod_req_t *req)
for (int i = 1; i < seq_arr_size(&UE->UE_sched_ctrl.lc_config); ++i) {
nr_lc_config_t *c = seq_arr_at(&UE->UE_sched_ctrl.lc_config, i);
c->suspended = false;
+ LOG_I(NR_MAC, "UE %04x: Re-establishing RLC for LCID %d\n", UE->rnti, c->lcid);
nr_rlc_reestablish_entity(req->gNB_DU_ue_id, c->lcid);
}
UE->reestablish_rlc = false;
@@ -797,18 +885,21 @@ void ue_context_modification_request(const f1ap_ue_context_mod_req_t *req)
update_cellGroupConfig(new_CellGroup, UE->uid, UE->capability, &mac->radio_config, scc);
}
- if (req->srbs_len > 0 || req->drbs_len > 0 || req->drbs_rel_len > 0 || ue_cap != NULL) {
- resp.du_to_cu_rrc_info = calloc_or_fail(1, sizeof(du_to_cu_rrc_information_t));
- byte_array_t cgc = { .buf = calloc_or_fail(1, 1024) };
- asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
- NULL,
- new_CellGroup,
- cgc.buf,
- 1024);
- AssertFatal(enc_rval.encoded > 0, "Could not encode CellGroup, failed element %s\n", enc_rval.failed_type->name);
- cgc.len = (enc_rval.encoded + 7) >> 3;
- resp.du_to_cu_rrc_info->cell_group_config = cgc;
+ /* 3GPP TS 38.473 Clause 8.3.4: If gNB-DU Configuration Query is present, include CellGroupConfig
+ * (CU requested CellGroupConfig for transparent forwarding) */
+ if (req->gNB_DU_Configuration_Query != NULL && *req->gNB_DU_Configuration_Query) {
+ LOG_I(NR_MAC, "UE %04x: gNB-DU Configuration Query received, will include CellGroupConfig in response\n", UE->rnti);
+ if (UE->reestablish_rlc) {
+ update_cellgroup_for_reestablishment(UE, new_CellGroup);
+ }
+
+ /* Encode CellGroupConfig for transparent forwarding in the DU to CU trasnfer IE
+ * CU will forward these encoded bytes directly to UE without decode/re-encode cycles */
+ resp.du_to_cu_rrc_info = calloc_or_fail(1, sizeof(du_to_cu_rrc_information_t));
+ resp.du_to_cu_rrc_info->cell_group_config = encode_cellgroup_config(new_CellGroup);
+
+ // Replace reconfigCellGroup with new_CellGroup (now contains complete config with spCellConfig restored)
ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->reconfigCellGroup);
UE->reconfigCellGroup = new_CellGroup;
configure_UE_BWP(mac, scc, UE, false, NR_SearchSpace__searchSpaceType_PR_common, -1, -1);
@@ -915,6 +1006,11 @@ void ue_context_release_command(const f1ap_ue_context_rel_cmd_t *cmd)
NR_SCHED_UNLOCK(&mac->sched_lock);
}
+/** @brief Process a DL RRC MESSAGE TRANSFER. Handles delivery of an RRC message to a UE
+ * via the F1AP DL RRC MESSAGE TRANSFER procedure, as specified in TS 38.473. This procedure
+ * is also responsible for re-establishing UE context when required (e.g., during RRC connection
+ * reestablishment).
+ * @param dl_rrc Pointer to the DL RRC MESSAGE TRANSFER data structure. */
void dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *dl_rrc)
{
LOG_D(NR_MAC,
@@ -942,50 +1038,71 @@ void dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *dl_rrc)
DevAssert(success);
}
-
- /* if we get the old-gNB-DU-UE-ID, this means there is a reestablishment
- * ongoing. */
+ /* Per TS 38.473: "The DL RRC MESSAGE TRANSFER message shall include, if available,
+ * the old gNB-DU UE F1AP ID IE so that the gNB-DU can retrieve the existing UE context
+ * in RRC connection reestablishment procedure, as defined in TS 38.401"
+ *
+ * "If the gNB-DU identifies the UE-associated logical F1-connection by the gNB-DU UE F1AP ID
+ * IE in the DL RRC MESSAGE TRANSFER message and the old gNB-DU UE F1AP ID IE is included,
+ * it shall release the old gNB-DU UE F1AP ID and the related configurations associated
+ * with the old gNB-DU UE F1AP ID." */
if (dl_rrc->old_gNB_DU_ue_id != NULL) {
AssertFatal(*dl_rrc->old_gNB_DU_ue_id != dl_rrc->gNB_DU_ue_id,
"logic bug: current and old gNB DU UE ID cannot be the same\n");
- /* 38.401 says: "Find UE context based on old gNB-DU UE F1AP ID, replace
- * old C-RNTI/PCI with new C-RNTI/PCI". Below, we do the inverse: we keep
- * the new UE context (with new C-RNTI), but set up everything to reuse the
- * old config. */
NR_UE_info_t *oldUE = find_nr_UE(&mac->UE_info, *dl_rrc->old_gNB_DU_ue_id);
- AssertFatal(oldUE, "CU claims we should know UE %04x, but we don't\n", *dl_rrc->old_gNB_DU_ue_id);
- pthread_mutex_lock(&mac->sched_lock);
- uid_t temp_uid = UE->uid;
- UE->uid = oldUE->uid;
- oldUE->uid = temp_uid;
- for (int i = 1; i < seq_arr_size(&oldUE->UE_sched_ctrl.lc_config); ++i) {
- const nr_lc_config_t *c = seq_arr_at(&oldUE->UE_sched_ctrl.lc_config, i);
- nr_lc_config_t new = *c;
- new.suspended = true;
- nr_mac_add_lcid(&UE->UE_sched_ctrl, &new);
+ if (oldUE == NULL) {
+ /* No matching UE-associated logical F1-connection for the old gNB-DU UE F1AP ID.
+ * Per TS 38.473, if there's no matching connection, there's nothing to release. */
+ LOG_I(NR_MAC,
+ "DL RRC Message Transfer: old gNB-DU UE F1AP ID %04x has no matching UE-associated logical F1-connection, nothing to "
+ "release\n",
+ *dl_rrc->old_gNB_DU_ue_id);
+ /* Clean up any F1 UE data associated with the old gNB-DU UE F1AP ID */
+ if (du_exists_f1_ue_data(*dl_rrc->old_gNB_DU_ue_id)) {
+ du_remove_f1_ue_data(*dl_rrc->old_gNB_DU_ue_id);
+ }
+ } else {
+ /* Per TS 38.401: "Find UE context based on old gNB-DU UE F1AP ID, replace
+ * old C-RNTI/PCI with new C-RNTI/PCI". Below, we do the inverse: we keep
+ * the new UE context (with new C-RNTI), but set up everything to reuse the
+ * old config. */
+ pthread_mutex_lock(&mac->sched_lock);
+ uid_t temp_uid = UE->uid;
+ UE->uid = oldUE->uid;
+ oldUE->uid = temp_uid;
+ for (int i = 1; i < seq_arr_size(&oldUE->UE_sched_ctrl.lc_config); ++i) {
+ const nr_lc_config_t *c = seq_arr_at(&oldUE->UE_sched_ctrl.lc_config, i);
+ nr_lc_config_t new = *c;
+ new.suspended = true;
+ nr_mac_add_lcid(&UE->UE_sched_ctrl, &new);
+ }
+ ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->CellGroup);
+ UE->CellGroup = oldUE->CellGroup;
+ oldUE->CellGroup = NULL;
+ ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability, UE->capability);
+ UE->capability = oldUE->capability;
+ oldUE->capability = NULL;
+ UE->mac_stats = oldUE->mac_stats;
+ UE->measgap_config = oldUE->measgap_config;
+ UE->local_bwp_id = oldUE->local_bwp_id;
+ mac_remove_nr_ue(mac, *dl_rrc->old_gNB_DU_ue_id);
+ pthread_mutex_unlock(&mac->sched_lock);
+ nr_rlc_remove_ue(dl_rrc->gNB_DU_ue_id);
+ nr_rlc_update_id(*dl_rrc->old_gNB_DU_ue_id, dl_rrc->gNB_DU_ue_id);
+ instance_t f1inst = get_f1_gtp_instance();
+ if (f1inst >= 0) // we actually use F1-U
+ gtpv1u_update_ue_id(f1inst, *dl_rrc->old_gNB_DU_ue_id, dl_rrc->gNB_DU_ue_id);
}
- ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->CellGroup);
- UE->CellGroup = oldUE->CellGroup;
- oldUE->CellGroup = NULL;
- ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability, UE->capability);
- UE->capability = oldUE->capability;
- oldUE->capability = NULL;
- UE->mac_stats = oldUE->mac_stats;
- UE->measgap_config = oldUE->measgap_config;
- UE->local_bwp_id = oldUE->local_bwp_id;
- /* 38.331 5.3.7.2 says that the UE releases the spCellConfig, so we drop it
+ /* Per TS 38.331 5.3.7.2: the UE releases the spCellConfig, so we drop it
* from the current configuration. It will be reapplied when the
* reconfiguration has succeeded (indicated by the CU) */
asn_copy(&asn_DEF_NR_CellGroupConfig, (void **)&UE->reconfigCellGroup, UE->CellGroup);
ASN_STRUCT_FREE(asn_DEF_NR_SpCellConfig, UE->CellGroup->spCellConfig);
UE->CellGroup->spCellConfig = NULL;
UE->reestablish_rlc = true;
- mac_remove_nr_ue(mac, *dl_rrc->old_gNB_DU_ue_id);
- pthread_mutex_unlock(&mac->sched_lock);
- nr_rlc_remove_ue(dl_rrc->gNB_DU_ue_id);
- nr_rlc_update_id(*dl_rrc->old_gNB_DU_ue_id, dl_rrc->gNB_DU_ue_id);
- /* 38.331 clause 5.3.7.4: apply gNB RLC configuration for SRB1 to match the UE RLC configuration defined in 9.2.1 */
- nr_rlc_configuration_t rlc_configuration = mac->rlc_config; // use configuration file values for timers t_poll_retransmit, t_reassembly and t_status_prohibit
+ /* Per TS 38.331 clause 5.3.7.4: apply gNB RLC configuration for SRB1 to match the UE RLC configuration defined in 9.2.1.
+ * Use configuration file values for timers t_poll_retransmit, t_reassembly and t_status_prohibit */
+ nr_rlc_configuration_t rlc_configuration = mac->rlc_config;
rlc_configuration.srb.poll_pdu = -1;
rlc_configuration.srb.poll_byte = -1;
rlc_configuration.srb.max_retx_threshold = 8;
@@ -993,9 +1110,6 @@ void dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *dl_rrc)
NR_RLC_Config_t *rlc_Config = nr_srb_config(&rlc_configuration);
nr_rlc_reconfigure_entity(dl_rrc->gNB_DU_ue_id, 1, rlc_Config);
ASN_STRUCT_FREE(asn_DEF_NR_RLC_Config, rlc_Config);
- instance_t f1inst = get_f1_gtp_instance();
- if (f1inst >= 0) // we actually use F1-U
- gtpv1u_update_ue_id(f1inst, *dl_rrc->old_gNB_DU_ue_id, dl_rrc->gNB_DU_ue_id);
}
/* the DU ue id is the RNTI */
diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
index 136fb0365e..e620e2f37d 100644
--- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
@@ -94,7 +94,6 @@
/* Defs */
#define MAX_NUM_BWP 5
#define MAX_NUM_CORESET 12
-#define MAX_NUM_CCE 90
/*!\brief Maximum number of random access process */
#define NR_NB_RA_PROC_MAX 4
#define MAX_NUM_OF_SSB 64
@@ -566,15 +565,6 @@ struct CSI_Report {
RSRP_report_t csirs_rsrp_report;
};
-#define MAX_SR_BITLEN 8
-
-/*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report
- the number of CSI_report will depend on number of CSI resource sets that are configured in CSI-ResourceConfig RRC IE
- From spec 38.331 from the IE CSI-ResourceConfig for SSB RSRP reporting we can configure only one resource set
- From spec 38.214 section 5.2.1.2 For periodic and semi-persistent CSI Resource Settings, the number of CSI-RS Resource Sets configured is limited to S=1
- */
-#define MAX_CSI_RESOURCE_SET_IN_CSI_RESOURCE_CONFIG 16
-
typedef enum {
INACTIVE = 0,
ACTIVE_NOT_SCHED,
@@ -609,7 +599,6 @@ typedef struct nr_lc_config {
} nr_lc_config_t;
/*! \brief scheduling control information set through an API */
-#define MAX_CSI_REPORTS 48
typedef struct {
/// CCE index and aggregation, should be coherent with cce_list
NR_SearchSpace_t *search_space;
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
index 884c5f5621..03b8ecc2d3 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
@@ -49,7 +49,7 @@
#include "common/ngran_types.h"
#include "common/openairinterface5g_limits.h"
#include "executables/lte-softmodem.h"
-#include "common/utils/tun_if.h"
+#include "common/utils/tuntap_if.h"
#include "intertask_interface.h"
#include "openair3/S1AP/s1ap_eNB.h"
#include
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
index 7a2ce5b84c..d1bd545614 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
@@ -355,8 +355,6 @@ uint64_t pdcp_module_init (uint64_t pdcp_optmask, int ue_id);
void pdcp_module_cleanup (void);
void pdcp_layer_init (void);
void pdcp_layer_cleanup (void);
-#define PDCP2NW_DRIVER_FIFO 21
-#define NW_DRIVER2PDCP_FIFO 22
int pdcp_fifo_flush_sdus ( const protocol_ctxt_t *const ctxt_pP);
int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t *const ctxt_pP);
@@ -440,7 +438,6 @@ typedef struct {
/*
* Reordering_Window: half of the PDCP SN space
*/
-#define REORDERING_WINDOW_SN_5BIT 16
#define REORDERING_WINDOW_SN_7BIT 64
#define REORDERING_WINDOW_SN_12BIT 2048
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index aeac4b3b98..0deeb692cc 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -29,7 +29,6 @@
* @ingroup pdcp
*/
-#define PDCP_FIFO_C
extern int otg_enabled;
@@ -42,8 +41,6 @@ extern int otg_enabled;
#include
#include
#include
-#define rtf_put write
-#define rtf_get read
#include "../MAC/mac_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.h
index 6adcde8f74..49a3930aec 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.h
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.h
@@ -40,12 +40,6 @@
#define PDCP_CONTROL_PDU_BIT_SET 0x00
#define PDCP_DATA_PDU_BIT_SET 0x01
-/*
- * PDU-type (3-bit, see 6.3.8)
- */
-#define PDCP_STATUS_REPORT 0x00
-#define INTERSPERSED_ROHC_FEEDBACK_PACKET 0x01
-
/*
* 6.1 Protocol Data Units
* 6.2.2 Control Plane PDCP Data PDU
@@ -83,7 +77,6 @@ typedef struct {
uint8_t dc;
uint8_t pdu_type; // PDU type (see 6.3.8)
} pdcp_control_pdu_for_interspersed_rohc_feedback_packet_header;
-#define PDCP_CONTROL_PDU_INTERSPERSED_ROHC_FEEDBACK_HEADER_SIZE 1
/*
* 6.2.6 PDCP Control PDU for PDCP status report
@@ -95,11 +88,6 @@ typedef struct {
unsigned char* window_bitmap; // Ack/Nack information coded as a bitmap
uint16_t window_bitmap_size;
} pdcp_control_pdu_for_pdcp_status_report;
-/*
- * Following symbolic constant is the size of FIXED part of this PDU
- * so bitmap size should be added to find total header size
- */
-#define PDCP_CONTROL_PDU_STATUS_REPORT_HEADER_SIZE 2
/*
* Parses sequence number out of buffer of User Plane PDCP Data PDU with
diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
index 3fd4c4bdd4..e588c2665b 100644
--- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
@@ -46,7 +46,7 @@
#include "common/platform_constants.h"
#include "common/ran_context.h"
#include "common/utils/T/T.h"
-#include "common/utils/tun_if.h"
+#include "common/utils/tuntap_if.h"
#include "cuup_cucp_if.h"
#include "executables/lte-softmodem.h"
#include "executables/softmodem-common.h"
@@ -405,7 +405,7 @@ void nr_pdcp_layer_init(void)
#include "nfapi/oai_integration/vendor_ext.h"
#include "executables/lte-softmodem.h"
-#include "common/utils/tun_if.h"
+#include "common/utils/tuntap_if.h"
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
@@ -506,6 +506,7 @@ srb_found:
* RRC, the RLC-PDCP interface does not transport this information */
f1_ue_data_t ue_data = cu_get_f1_ue_data(ue->ue_id);
ul_rrc->gNB_DU_ue_id = ue_data.secondary_ue;
+ message_p->ittiMsgHeader.originInstance = ue_data.du_assoc_id;
ul_rrc->srb_id = srb_id;
ul_rrc->rrc_container = malloc(size);
AssertFatal(ul_rrc->rrc_container != NULL, "OUT OF MEMORY\n");
diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h
index 49219a0af1..e53f04d859 100644
--- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h
+++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h
@@ -46,13 +46,6 @@
#define MAX_NUM_HI_DCI0_PDU 100
#define MAX_NUM_TX_REQUEST_PDU 100
-#define MAX_NUM_HARQ_IND 100
-#define MAX_NUM_CRC_IND 100
-#define MAX_NUM_SR_IND 100
-#define MAX_NUM_CQI_IND 100
-#define MAX_NUM_RACH_IND 100
-#define MAX_NUM_SRS_IND 100
-
#define MAX_NUM_NR_RX_RACH_PDUS 4
#define MAX_UL_PDUS_PER_SLOT 8
#define MAX_NUM_NR_SRS_PDUS 8
diff --git a/openair2/PHY_INTERFACE/IF_Module.h b/openair2/PHY_INTERFACE/IF_Module.h
index 27eea78fc6..d413a13bd6 100644
--- a/openair2/PHY_INTERFACE/IF_Module.h
+++ b/openair2/PHY_INTERFACE/IF_Module.h
@@ -44,13 +44,6 @@
#define MAX_NUM_HI_DCI0_PDU 100
#define MAX_NUM_TX_REQUEST_PDU 100
-#define MAX_NUM_HARQ_IND 100
-#define MAX_NUM_CRC_IND 100
-#define MAX_NUM_SR_IND 100
-#define MAX_NUM_CQI_IND 100
-#define MAX_NUM_RACH_IND 100
-#define MAX_NUM_SRS_IND 100
-
typedef struct {
/// Module ID
module_id_t module_id;
diff --git a/openair2/PHY_INTERFACE/IF_Module_NB_IoT.h b/openair2/PHY_INTERFACE/IF_Module_NB_IoT.h
index 8aec51d85d..ec5e7e5370 100644
--- a/openair2/PHY_INTERFACE/IF_Module_NB_IoT.h
+++ b/openair2/PHY_INTERFACE/IF_Module_NB_IoT.h
@@ -9,16 +9,8 @@
#define __IF_MODULE_NB_IoT__H__
#include "nfapi_interface.h"
-//#include "openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h"
#include "LTE_PhysicalConfigDedicated-NB-r13.h"
-//#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
#include "common/platform_types.h"
-//#include "openair1/SCHED/IF_Module_L1_primitives_NB_IoT.h"
-
-//#define SCH_PAYLOAD_SIZE_MAX 4096
-#define BCCH_PAYLOAD_SIZE_MAX_NB_IoT 128
-
-
// P5 FAPI-like configuration structures-------------------------------------------------------------------------------
diff --git a/openair2/PHY_INTERFACE/phy_interface.h b/openair2/PHY_INTERFACE/phy_interface.h
index 09e95988a4..2bb9a6c53f 100644
--- a/openair2/PHY_INTERFACE/phy_interface.h
+++ b/openair2/PHY_INTERFACE/phy_interface.h
@@ -32,10 +32,6 @@
#include "LAYER2/MAC/mac.h"
-
-#define MAX_NUMBER_OF_MAC_INSTANCES 16
-
-#define NULL_PDU 255
#define DCI 0
#define DLSCH 1
#define ULSCH 2
diff --git a/openair2/RRC/LTE/defs_NB_IoT.h b/openair2/RRC/LTE/defs_NB_IoT.h
index 51835cc181..bd1e7d58b5 100644
--- a/openair2/RRC/LTE/defs_NB_IoT.h
+++ b/openair2/RRC/LTE/defs_NB_IoT.h
@@ -66,13 +66,6 @@
# include "intertask_interface.h"
# include "commonDef.h"
-
-#if ENABLE_RAL
- #include "collection/hashtable/obj_hashtable.h"
-#endif
-
-
-
/*I will change the name of the structure for compile purposes--> hope not to undo this process*/
typedef unsigned int uid_NB_IoT_t;
@@ -442,7 +435,6 @@ typedef struct eNB_RRC_INST_NB_IoT_s {
} eNB_RRC_INST_NB_IoT;
-#define RRC_HEADER_SIZE_MAX_NB_IoT 64
#define MAX_UE_CAPABILITY_SIZE_NB_IoT 255
//not needed for the moment
@@ -453,10 +445,6 @@ typedef struct OAI_UECapability_NB_IoT_s {
LTE_UE_Capability_NB_r13_t UE_Capability_NB_IoT; //replace the UE_EUTRA_Capability of LTE
} OAI_UECapability_NB_IoT_t;
-#define RRC_BUFFER_SIZE_MAX_NB_IoT 1024
-
-
-
typedef struct UE_RRC_INST_NB_IoT_s {
Rrc_State_NB_IoT_t RrcState;
Rrc_Sub_State_NB_IoT_t RrcSubState;
diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c
index 70692bfaa9..c8ea0fa878 100644
--- a/openair2/RRC/LTE/rrc_UE.c
+++ b/openair2/RRC/LTE/rrc_UE.c
@@ -64,10 +64,7 @@
#include "LTE_UECapabilityEnquiry.h"
#include "LTE_UE-CapabilityRequest.h"
-#include "common/utils/tun_if.h"
-#if ENABLE_RAL
- #include "rrc_UE_ral.h"
-#endif
+#include "common/utils/tuntap_if.h"
#include "openair3/SECU/key_nas_deriver.h"
@@ -1234,11 +1231,6 @@ rrc_ue_process_radioResourceConfigDedicated(
(LTE_PMCH_InfoList_r9_t *)NULL,
0, 0
);
-#if ENABLE_RAL
- // first msg that includes srb config
- UE_rrc_inst[ctxt_pP->module_id].num_srb=radioResourceConfigDedicated->srb_ToAddModList->list.count;
-#endif
-
for (cnt=0; cntsrb_ToAddModList->list.count; cnt++) {
// connection_reestablishment_ind.num_srb+=1;
SRB_id = radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt]->srb_Identity;
@@ -1829,49 +1821,6 @@ static void rrc_ue_process_rrcConnectionReconfiguration(const protocol_ctxt_t *c
free (r_r8->dedicatedInfoNASList);
}
-#if ENABLE_RAL
- {
- MessageDef *message_ral_p = NULL;
- rrc_ral_connection_reestablishment_ind_t connection_reestablishment_ind;
- int i;
- message_ral_p = itti_alloc_new_message (TASK_RRC_UE, 0, RRC_RAL_CONNECTION_REESTABLISHMENT_IND);
- memset(&connection_reestablishment_ind, 0, sizeof(rrc_ral_connection_reestablishment_ind_t));
- // TO DO ral_si_ind.plmn_id = 0;
- connection_reestablishment_ind.ue_id = ctxt_pP->rntiMaybeUEid;
-
- if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList != NULL) {
- connection_reestablishment_ind.num_drb =
- rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count;
-
- for (i=0; (
- icriticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count)
- && (i < LTE_maxDRB); i++) {
- // why minus 1 in RRC code for drb_identity ?
- connection_reestablishment_ind.drb_id[i] =
- rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
- }
- } else {
- connection_reestablishment_ind.num_drb = 0;
- }
-
- if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->srb_ToAddModList != NULL) {
- connection_reestablishment_ind.num_srb =
- rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->srb_ToAddModList->list.count +
- UE_rrc_inst[ctxt_pP->module_id].num_srb;
- } else {
- connection_reestablishment_ind.num_srb += UE_rrc_inst[ctxt_pP->module_id].num_srb;
- }
-
- if (connection_reestablishment_ind.num_srb > 2) { // fixme: only 2 srbs can exist, adjust the value
- connection_reestablishment_ind.num_srb =2;
- }
-
- memcpy (&message_ral_p->ittiMsg, (void *) &connection_reestablishment_ind, sizeof(rrc_ral_connection_reestablishment_ind_t));
- //#warning "ue_mod_idP ? for instance ? => YES"
- LOG_I(RRC, "Sending RRC_RAL_CONNECTION_REESTABLISHMENT_IND to mRAL\n");
- itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
- }
-#endif
} // c1 present
} // critical extensions present
}
@@ -2102,51 +2051,6 @@ static void rrc_ue_decode_dcch(const protocol_ctxt_t *const ctxt_pP,
UE_rrc_inst[ctxt_pP->module_id].Info[target_eNB_index].State = RRC_RECONFIGURED;
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n",
ctxt_pP->module_id, target_eNB_index);
-#if ENABLE_RAL
- {
- MessageDef *message_ral_p = NULL;
- rrc_ral_connection_reconfiguration_ho_ind_t connection_reconfiguration_ho_ind;
- int i;
- message_ral_p = itti_alloc_new_message (TASK_RRC_UE, 0, RRC_RAL_CONNECTION_RECONFIGURATION_HO_IND);
- memset(&connection_reconfiguration_ho_ind, 0, sizeof(rrc_ral_connection_reconfiguration_ho_ind_t));
- connection_reconfiguration_ho_ind.ue_id = ctxt_pP->module_id;
-
- if (dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList
- != NULL) {
- connection_reconfiguration_ho_ind.num_drb =
- dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count;
-
- for (i=0; (
- imessage.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count)
- && (i < LTE_maxDRB); i++) {
- // why minus 1 in RRC code for drb_identity ?
- connection_reconfiguration_ho_ind.drb_id[i] =
- dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
- }
- } else {
- connection_reconfiguration_ho_ind.num_drb = 0;
- }
-
- if (dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->srb_ToAddModList
- != NULL) {
- connection_reconfiguration_ho_ind.num_srb =
- dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->srb_ToAddModList->list.count
- +
- UE_rrc_inst[ctxt_pP->module_id].num_srb;
- } else {
- connection_reconfiguration_ho_ind.num_srb += UE_rrc_inst[ctxt_pP->module_id].num_srb;
- }
-
- if (connection_reconfiguration_ho_ind.num_srb > 2 ) {
- connection_reconfiguration_ho_ind.num_srb =2;
- }
-
- memcpy (&message_ral_p->ittiMsg, (void *) &connection_reconfiguration_ho_ind, sizeof(rrc_ral_connection_reconfiguration_ho_ind_t));
- //#warning "ue_mod_idP ? for instance ? => YES"
- LOG_I(RRC, "Sending RRC_RAL_CONNECTION_RECONFIGURATION_HO_IND to mRAL\n");
- itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
- }
-#endif
} else {
rrc_ue_generate_RRCConnectionReconfigurationComplete(
ctxt_pP,
@@ -2157,51 +2061,6 @@ static void rrc_ue_decode_dcch(const protocol_ctxt_t *const ctxt_pP,
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED (eNB %d)\n",
ctxt_pP->module_id,
eNB_indexP);
-#if ENABLE_RAL
- {
- MessageDef *message_ral_p = NULL;
- rrc_ral_connection_reconfiguration_ind_t connection_reconfiguration_ind;
- int i;
- message_ral_p = itti_alloc_new_message (TASK_RRC_UE, 0, RRC_RAL_CONNECTION_RECONFIGURATION_IND);
- memset(&connection_reconfiguration_ind, 0, sizeof(rrc_ral_connection_reconfiguration_ind_t));
- connection_reconfiguration_ind.ue_id = ctxt_pP->module_id;
-
- if (dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList
- != NULL) {
- connection_reconfiguration_ind.num_drb =
- dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count;
-
- for (i=0; (
- imessage.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count)
- && (i < LTE_maxDRB); i++) {
- // why minus 1 in RRC code for drb_identity ?
- connection_reconfiguration_ind.drb_id[i] =
- dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
- }
- } else {
- connection_reconfiguration_ind.num_drb = 0;
- }
-
- if (dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->srb_ToAddModList
- != NULL) {
- connection_reconfiguration_ind.num_srb =
- dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->srb_ToAddModList->list.count
- +
- UE_rrc_inst[ctxt_pP->module_id].num_srb;
- } else {
- connection_reconfiguration_ind.num_srb +=UE_rrc_inst[ctxt_pP->module_id].num_srb;
- }
-
- if (connection_reconfiguration_ind.num_srb > 2 ) {
- connection_reconfiguration_ind.num_srb =2;
- }
-
- memcpy (&message_ral_p->ittiMsg, (void *) &connection_reconfiguration_ind, sizeof(rrc_ral_connection_reconfiguration_ind_t));
- //#warning "ue_mod_idP ? for instance ? => YES"
- LOG_I(RRC, "Sending RRC_RAL_CONNECTION_RECONFIGURATION_IND to mRAL\n");
- itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
- }
-#endif
}
//TTN test D2D (should not be here - in reality, this message will be triggered from ProSeApp)
@@ -2241,11 +2100,6 @@ static void rrc_ue_decode_dcch(const protocol_ctxt_t *const ctxt_pP,
}
itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p);
-#if ENABLE_RAL
- msg_p = itti_alloc_new_message(TASK_RRC_UE, 0, RRC_RAL_CONNECTION_RELEASE_IND);
- RRC_RAL_CONNECTION_RELEASE_IND(msg_p).ue_id = ctxt_pP->module_id;
- itti_send_msg_to_task(TASK_RAL_UE, ctxt_pP->instance, msg_p);
-#endif
break;
case LTE_DL_DCCH_MessageType__c1_PR_securityModeCommand:
@@ -3656,31 +3510,6 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State == RRC_IDLE) {
LOG_I( RRC, "[UE %d] Received SIB1/SIB2/SIB3 Switching to RRC_SI_RECEIVED\n", ctxt_pP->module_id );
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State = RRC_SI_RECEIVED;
-#if ENABLE_RAL
- {
- MessageDef *message_ral_p = NULL;
- rrc_ral_system_information_ind_t ral_si_ind;
- message_ral_p = itti_alloc_new_message (TASK_RRC_UE, 0, RRC_RAL_SYSTEM_INFORMATION_IND);
- memset(&ral_si_ind, 0, sizeof(rrc_ral_system_information_ind_t));
- ral_si_ind.plmn_id.MCCdigit2 = '0';
- ral_si_ind.plmn_id.MCCdigit1 = '2';
- ral_si_ind.plmn_id.MNCdigit3 = '0';
- ral_si_ind.plmn_id.MCCdigit3 = '8';
- ral_si_ind.plmn_id.MNCdigit2 = '9';
- ral_si_ind.plmn_id.MNCdigit1 = '9';
- ral_si_ind.cell_id = 1;
- ral_si_ind.dbm = 0;
- //ral_si_ind.dbm = fifo_dump_emos_UE.PHY_measurements->rx_rssi_dBm[eNB_index];
- // TO DO
- ral_si_ind.sinr = 0;
- //ral_si_ind.sinr = fifo_dump_emos_UE.PHY_measurements->subband_cqi_dB[eNB_index][phy_vars_ue->lte_frame_parms.nb_antennas_rx][0];
- // TO DO
- ral_si_ind.link_data_rate = 0;
- memcpy (&message_ral_p->ittiMsg, (void *) &ral_si_ind, sizeof(rrc_ral_system_information_ind_t));
-#warning "ue_mod_idP ? for instance ?"
- itti_send_msg_to_task (TASK_RAL_UE, UE_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), message_ral_p);
- }
-#endif
}
}else{
//LOG_W( RRC, "[UE %d] Received new SIB1/SIB2/SIB3 with MBMSs %d\n", ctxt_pP->module_id, ((&typeandinfo->choice.sib2)->mbsfn_SubframeConfigList == NULL ? 0:1) );
@@ -4741,146 +4570,6 @@ void *rrc_ue_task( void *args_p ) {
break;
}
-# if ENABLE_RAL
-
- case RRC_RAL_SCAN_REQ:
- LOG_D(RRC, "[UE %d] Received %s: state %d\n", ue_mod_id,ITTI_MSG_NAME (msg_p) );
-
- switch (rrc_get_state(ue_mod_id)) {
- case RRC_STATE_INACTIVE: {
- rrc_set_state (ue_mod_id, RRC_STATE_IDLE);
- /* Fall through to next case */
- }
-
- case RRC_STATE_IDLE: {
- if (rrc_get_sub_state(ue_mod_id) != RRC_SUB_STATE_IDLE_SEARCHING) {
- /* Ask to layer 1 to find a cell matching the criterion */
- MessageDef *message_p;
- message_p = itti_alloc_new_message(TASK_RRC_UE, 0, PHY_FIND_CELL_REQ);
- rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_SEARCHING);
- PHY_FIND_CELL_REQ (message_p).transaction_id = RRC_RAL_SCAN_REQ (msg_p).transaction_id;
- PHY_FIND_CELL_REQ (message_p).earfcn_start = 1;
- PHY_FIND_CELL_REQ (message_p).earfcn_end = 1; //44
- itti_send_msg_to_task(TASK_PHY_UE, instance, message_p);
- }
-
- break;
- }
-
- case RRC_STATE_CONNECTED:
- /* should not happen */
- LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id));
- break;
-
- default:
- LOG_E(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id));
- break;
- }
-
- break;
-
- case PHY_FIND_CELL_IND:
- LOG_D(RRC, "[UE %d] Received %s: state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id));
-
- switch (rrc_get_state(ue_mod_id)) {
- case RRC_STATE_IDLE:
- switch (rrc_get_sub_state(ue_mod_id)) {
- case RRC_SUB_STATE_IDLE_SEARCHING: {
- MessageDef *message_p;
- int i;
- message_p = itti_alloc_new_message(TASK_RRC_UE, 0, RRC_RAL_SCAN_CONF);
- RRC_RAL_SCAN_CONF (message_p).transaction_id = PHY_FIND_CELL_IND(msg_p).transaction_id;
- RRC_RAL_SCAN_CONF (message_p).num_scan_resp = PHY_FIND_CELL_IND(msg_p).cell_nb;
-
- for (i = 0 ; i < PHY_FIND_CELL_IND(msg_p).cell_nb; i++) {
- // TO DO
- memset(&RRC_RAL_SCAN_CONF (message_p).link_scan_resp[i].link_addr, 0, sizeof(ral_link_addr_t));
- // TO DO
- memset(&RRC_RAL_SCAN_CONF (message_p).link_scan_resp[i].network_id, 0, sizeof(ral_network_id_t));
- RRC_RAL_SCAN_CONF (message_p).link_scan_resp[i].sig_strength.choice = RAL_SIG_STRENGTH_CHOICE_DBM;
- RRC_RAL_SCAN_CONF (message_p).link_scan_resp[i].sig_strength._union.dbm = PHY_FIND_CELL_IND(msg_p).cells[i].rsrp;
- }
-
- rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE);
- itti_send_msg_to_task(TASK_RAL_UE, instance, message_p);
- break;
- }
-
- default:
- LOG_E(RRC, "[UE %d] Invalid RRC state %d substate %d\n",
- ue_mod_id,
- rrc_get_state(ue_mod_id),
- rrc_get_sub_state(ue_mod_id));
- }
-
- break;
-
- case RRC_STATE_INACTIVE:
- case RRC_STATE_CONNECTED:
- /* should not happen */
- LOG_E(RRC, "[UE %d] indication %s in RRC state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id));
- break;
-
- default:
- LOG_E(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id));
- break;
- }
-
- break; // PHY_FIND_CELL_IND
-
- case PHY_MEAS_REPORT_IND: {
- LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
- MessageDef *message_p;
- message_p = itti_alloc_new_message(TASK_RRC_UE, 0, RRC_RAL_MEASUREMENT_REPORT_IND);
- memcpy(&RRC_RAL_MEASUREMENT_REPORT_IND (message_p).threshold,
- &PHY_MEAS_REPORT_IND(msg_p).threshold,
- sizeof(RRC_RAL_MEASUREMENT_REPORT_IND (message_p).threshold));
- memcpy(&RRC_RAL_MEASUREMENT_REPORT_IND (message_p).link_param,
- &PHY_MEAS_REPORT_IND(msg_p).link_param,
- sizeof(RRC_RAL_MEASUREMENT_REPORT_IND (message_p).link_param));
- LOG_D(RRC, "[UE %d] PHY_MEAS_REPORT_IN: sending msg %s to %s \n", ue_mod_id, "RRC_RAL_MEASUREMENT_REPORT_IND", "TASK_RAL_UE");
- itti_send_msg_to_task(TASK_RAL_UE, instance, message_p);
- break;
- }
-
- case RRC_RAL_CONFIGURE_THRESHOLD_REQ:
- LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
- rrc_ue_ral_handle_configure_threshold_request(ue_mod_id, msg_p);
- break;
-
- case RRC_RAL_CONNECTION_ESTABLISHMENT_REQ:
- LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
-
- switch (rrc_get_state(ue_mod_id)) {
- case RRC_STATE_IDLE: {
- if (rrc_get_sub_state(ue_mod_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) {
- PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, UE_rrc_inst[ue_mod_id].Info[0].rnti, 0, 0, 0);
- rrc_ue_generate_RRCConnectionRequest(&ctxt, 0);
- LOG_D(RRC, "not sending connection request\n");
- rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_CONNECTING);
- }
-
- break;
- }
-
- case RRC_STATE_INACTIVE:
- case RRC_STATE_CONNECTED:
- /* should not happen */
- LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id));
- break;
-
- default:
- LOG_E(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id));
- break;
- }
-
- break;
-
- case RRC_RAL_CONNECTION_RELEASE_REQ:
- LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
- break;
-#endif
-
default:
LOG_E(RRC, "[UE %d] Received unexpected message %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
break;
diff --git a/openair2/RRC/LTE/rrc_UE_ral.h b/openair2/RRC/LTE/rrc_UE_ral.h
deleted file mode 100644
index dfa971d28c..0000000000
--- a/openair2/RRC/LTE/rrc_UE_ral.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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
- */
-
-/*! \file rrc_UE_ral.h
- * \brief rrc procedures for handling RAL messages
- * \author Lionel GAUTHIER
- * \date 2013
- * \version 1.0
- * \company Eurecom
- * \email: lionel.gauthier@eurecom.fr
- */
-#ifndef __RRC_UE_RAL_H__
-# define __RRC_UE_RAL_H__
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-//-----------------------------------------------------------------------------
-#include "intertask_interface.h"
-#include "ral_messages_types.h"
-#include "defs.h"
-
-int rrc_ue_ral_delete_all_thresholds_type (unsigned int mod_idP, ral_link_param_type_t *param_type_pP);
-int rrc_ue_ral_delete_threshold (unsigned int mod_idP, ral_link_param_type_t *param_type_pP, ral_threshold_t *threshold_pP);
-int rrc_ue_ral_handle_configure_threshold_request(unsigned int mod_idP, MessageDef *msg_pP);
-#endif
diff --git a/openair2/RRC/LTE/rrc_defs.h b/openair2/RRC/LTE/rrc_defs.h
index 70897c16b7..85fd3b9d83 100644
--- a/openair2/RRC/LTE/rrc_defs.h
+++ b/openair2/RRC/LTE/rrc_defs.h
@@ -50,26 +50,17 @@
#include "LAYER2/MAC/mac.h"
#include "openair2/RRC/common.h"
// for D2D
-#define DEBUG_CTRL_SOCKET
#define CONTROL_SOCKET_PORT_NO 8888
#define MAX_NUM_DEST 10
//netlink
//#define DEBUG_PDCP
-#define UE_IP_PDCP_NETLINK_ID 31
-#define PDCP_PID 1
-#define NETLINK_HEADER_SIZE 16
-#define SL_DEFAULT_RAB_ID 3
-#define SLRB_ID 3
#define MAX_PAYLOAD 1024 /* maximum payload size*/
#define MAX_NUM_NEIGH_CELLs 6 /* maximum neighbouring cells number */
#define MAX_NUM_GNB_CELLs 1 /* maximum gNB cells number */
-
-#define UE_STATE_NOTIFICATION_INTERVAL 50
-
#define IPV4_ADDR "%u.%u.%u.%u"
#define IPV4_ADDR_FORMAT(aDDRESS) \
(uint8_t)((aDDRESS) & 0x000000ff), \
@@ -308,9 +299,6 @@ typedef enum SL_TRIGGER_e {
#define UNDEF_SECURITY_MODE 0xff
#define NO_SECURITY_MODE 0x20
-#define CBA_OFFSET 0xfff4
-// #define NUM_MAX_CBA_GROUP 4 // in the platform_constants
-
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
#define RRC_TRANSACTION_IDENTIFIER_NUMBER 3
diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c
index 4ddd7fc625..5f9e32cfd8 100644
--- a/openair2/RRC/LTE/rrc_eNB.c
+++ b/openair2/RRC/LTE/rrc_eNB.c
@@ -28,7 +28,6 @@
* \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr
*/
#define RRC_ENB
-#define RRC_ENB_C
#include "oai_asn1.h"
#include
#include "uper_encoder.h"
@@ -79,7 +78,7 @@
#include "T.h"
#include "LTE_MeasResults.h"
-#include "common/utils/tun_if.h"
+#include "common/utils/tuntap_if.h"
#include "rrc_eNB_S1AP.h"
#include "rrc_eNB_GTPV1U.h"
@@ -93,16 +92,11 @@
#include "intertask_interface.h"
#include "softmodem-common.h"
-#if ENABLE_RAL
- #include "rrc_eNB_ral.h"
-#endif
-
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "openair1/PHY/LTE_TRANSPORT/transport_proto.h"
#define ASN_MAX_ENCODE_SIZE 4096
-#define NUMBEROF_DRBS_TOBE_ADDED 1
static int encode_CG_ConfigInfo(char *buffer,int buffer_size,rrc_eNB_ue_context_t *const ue_context_pP,int *enc_size);
mui_t rrc_eNB_mui = 0;
diff --git a/openair2/RRC/LTE/rrc_eNB_ral.h b/openair2/RRC/LTE/rrc_eNB_ral.h
deleted file mode 100644
index bfdcdc1d53..0000000000
--- a/openair2/RRC/LTE/rrc_eNB_ral.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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
- */
-
-/*! \file rrc_eNB_ral.h
- * \brief rrc procedures for handling RAL messages
- * \author Lionel GAUTHIER
- * \date 2013
- * \version 1.0
- * \company Eurecom
- * \email: lionel.gauthier@eurecom.fr
- */
-#ifndef __RRC_ENB_RAL_H__
-# define __RRC_ENB_RAL_H__
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-//-----------------------------------------------------------------------------
-#include "intertask_interface.h"
-#include "ral_messages_types.h"
-#include "defs.h"
-
-
-int rrc_enb_ral_delete_all_thresholds_type (unsigned int mod_idP, ral_link_param_type_t *param_type_pP);
-int rrc_enb_ral_delete_threshold (unsigned int mod_idP, ral_link_param_type_t* param_type_pP,
- ral_threshold_t* threshold_pP);
-int rrc_enb_ral_handle_configure_threshold_request(unsigned int mod_idP, MessageDef *msg_pP);
-
-#endif
diff --git a/openair2/RRC/LTE/rrc_rrm_interface.h b/openair2/RRC/LTE/rrc_rrm_interface.h
deleted file mode 100644
index 0880859a59..0000000000
--- a/openair2/RRC/LTE/rrc_rrm_interface.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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
- */
-
-/*!
-*******************************************************************************
-
-\file rrm_sock.h
-
-\brief common header for the communication between RRM and RRC/CMM/PUSU.
-
-\author BURLOT Pascal
-
-\date 15/07/08
-
-
-\par History:
- $Author$ $Date$ $Revision$
- $Id$
- $Log$
-
-*******************************************************************************
-*/
-
-#ifndef __RRC_RRM_INTERFACE_H__
-#define __RRC_RRM_INTERFACE_H__
-
-
-//#ifdef RRC_RRM_XFACE
-
-/*!
-*******************************************************************************
-\brief Entete des messages de RRM/CMM/RRC
-*/
-typedef struct {
- unsigned short start ; ///< Identification du debut de message
- unsigned char inst ; ///< Identification de l'instance RRM
- unsigned char msg_type ; ///< Identification du type message
- unsigned int size ; ///< taille du message
- unsigned int Trans_id ; ///< Identification de la transaction
-} msg_head_t ;
-
-/*!
-*******************************************************************************
-\brief Definition de la structure d'un message a envoyer sur un socket:
- - RRM->RRC
- - RRC->RRM
- - RRCI->RRC
- - RRC->RRCI
- - CMM->RRM
- - RRM->CMM
-*/
-typedef struct {
- msg_head_t head ; ///< entete du message
- char *data ; ///< message
-} msg_t ;
-
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//! \brief Socket path associated to RRM-CMM interface
-#define RRM_CMM_SOCK_PATH "/tmp/rrm_cmm_socket"
-//! \brief Socket path associated to CMM-RRM interface
-#define CMM_RRM_SOCK_PATH "/tmp/cmm_rrm_socket"
-
-//! \brief Socket path associated to RRM-RRC interface
-#define RRM_RRC_SOCK_PATH "/tmp/rrm_rrc_socket"
-//! \brief Socket path associated to RRC-RRM interface
-#define RRC_RRM_SOCK_PATH "/tmp/rrc_rrm_socket"
-
-//! \brief Socket path associated to RRM-PUSU interface
-#define RRM_PUSU_SOCK_PATH "/tmp/rrm_pusu_socket"
-//! \brief Socket path associated to PUSU-RRM interface
-#define PUSU_RRM_SOCK_PATH "/tmp/pusu_rrm_socket"
-
-
-//! \brief Identification of the RRM/CMM/RRC message begin
-#define START_MSG 0xA533
-//! \brief Identification of the PUSU message begin
-#define START_MSG_PUSU 0xCC
-
-
-#include
-#include
-
-
-/*!
-*******************************************************************************
-\brief Definition de la structure definissant le socket pour envoyer les messages
-*/
-typedef struct {
- int s ; ///< identification du socket
- struct sockaddr_un un_local_addr ; ///< Adresse local si unix socket
- struct sockaddr_un un_dest_addr ; ///< Adresse destinataire si unix socket
-} sock_rrm_t ;
-
-
-/* *** Fonctions relatives aux interfaces CMM ou RRC *** */
-
-int open_socket( sock_rrm_t *s ,char *path_local, char *path_dest , int rrm_inst ) ;
-void close_socket(sock_rrm_t *sock ) ;
-int send_msg_sock(sock_rrm_t *s ,msg_t *msg ) ;
-char *recv_msg( sock_rrm_t *s ) ;
-#ifdef __cplusplus
-}
-#endif
-
-int send_msg(void *, msg_t *);
-
-#endif
diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c
index e179b5f4e8..2c3cf2717a 100644
--- a/openair2/RRC/NR/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c
@@ -532,7 +532,7 @@ static NR_RRCReconfiguration_IEs_t *build_RRCReconfiguration_IEs(const nr_rrc_re
ie->measConfig = params->meas_config;
/* nonCriticalExtension, RRCReconfiguration-v1530-IEs */
- if (params->cell_group_config || params->num_nas_msg) {
+ if (params->cgc || params->num_nas_msg) {
// Allocate memory for extension IE
ie->nonCriticalExtension = calloc_or_fail(1, sizeof(*ie->nonCriticalExtension));
}
@@ -549,37 +549,13 @@ static NR_RRCReconfiguration_IEs_t *build_RRCReconfiguration_IEs(const nr_rrc_re
}
}
- /* masterCellGroup */
- if (params->cell_group_config) {
- uint8_t temp[4096];
- asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, params->cell_group_config, temp, sizeof(temp));
-
- if (enc.encoded <= 0) {
- LOG_E(NR_RRC, "ASN.1 encoding failed for NR_CellGroupConfig (encoded=%ld)\n", enc.encoded);
- if (enc.failed_type) {
- LOG_E(NR_RRC, "Failed at ASN.1 type: %s\n", enc.failed_type->name);
- }
- if (enc.structure_ptr) {
- LOG_E(NR_RRC, "Failed at structure element: %p\n", enc.structure_ptr);
- }
- // Print diagnostic information to help debug the issue
- LOG_E(NR_RRC, "CellGroupConfig structure that failed to encode:\n");
- xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void *)params->cell_group_config);
- ASN_STRUCT_FREE(asn_DEF_NR_RRCReconfiguration_IEs, ie);
- return NULL;
- }
- DevAssert(enc.encoded <= sizeof(temp) * 8); // Encoded data must fit in temp buffer
- // Allocate buffer for the encoded data and copy it
- // enc.encoded is in bits, convert to bytes
- size_t encoded_bytes = (enc.encoded + 7) / 8;
- uint8_t *buf = calloc_or_fail(1, encoded_bytes);
- memcpy(buf, temp, encoded_bytes);
-
- if (LOG_DEBUGFLAG(DEBUG_ASN1)) {
- xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void *)params->cell_group_config);
- }
+ /* masterCellGroup - Transparent forwarding per TS 38.473 */
+ if (params->cgc) {
+ // Copy pre-encoded CellGroupConfig bytes directly without decode/re-encode (TS 38.473 transparency)
+ // CU receives encoded bytes from DU and forwards to UE without modification
+ LOG_D(NR_RRC, "Transparent forwarding CellGroupConfig (len=%ld bytes)\n", params->cgc->len);
ie->nonCriticalExtension->masterCellGroup = calloc_or_fail(1, sizeof(*ie->nonCriticalExtension->masterCellGroup));
- *ie->nonCriticalExtension->masterCellGroup = (OCTET_STRING_t){.buf = buf, .size = encoded_bytes};
+ OCTET_STRING_fromBuf(ie->nonCriticalExtension->masterCellGroup, (const char *)params->cgc->buf, params->cgc->len);
}
/* masterKeyUpdate */
@@ -630,6 +606,49 @@ static byte_array_t do_HO_RRCReconfiguration(nr_rrc_reconfig_param_t *params)
return msg;
}
+void dump_cgc(const uint8_t *buf, size_t len)
+{
+ // Decode the encoded CellGroupConfig for debugging
+ NR_CellGroupConfig_t *temp_cellGroupConfig = NULL;
+ asn_dec_rval_t dec_rval = uper_decode_complete(NULL, &asn_DEF_NR_CellGroupConfig, (void **)&temp_cellGroupConfig, buf, len);
+ if (dec_rval.code == RC_OK && dec_rval.consumed > 0) {
+ xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, temp_cellGroupConfig);
+ ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, temp_cellGroupConfig);
+ } else {
+ LOG_W(NR_RRC, "Failed to decode CellGroupConfig (code=%d consumed=%zu)\n", dec_rval.code, dec_rval.consumed);
+ }
+}
+
+static void dump_mcg(const NR_DL_DCCH_Message_t *dl_dcch_msg)
+{
+ if (!dl_dcch_msg) {
+ LOG_W(NR_RRC, "DL_DCCH_Message is NULL\n");
+ return;
+ }
+
+ const NR_RRCReconfiguration_IEs_t *reconf_ies = NULL;
+ const struct NR_DL_DCCH_MessageType__c1 *c1 = NULL;
+
+ if (dl_dcch_msg->message.present == NR_DL_DCCH_MessageType_PR_c1
+ && (c1 = dl_dcch_msg->message.choice.c1)
+ && c1->present == NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration
+ && c1->choice.rrcReconfiguration
+ && c1->choice.rrcReconfiguration->criticalExtensions.present
+ == NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration
+ && c1->choice.rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration) {
+ reconf_ies = c1->choice.rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration;
+ }
+
+ if (reconf_ies && reconf_ies->nonCriticalExtension && reconf_ies->nonCriticalExtension->masterCellGroup) {
+ const OCTET_STRING_t *mcg = reconf_ies->nonCriticalExtension->masterCellGroup;
+
+ /* decode and XER print CellGroupConfig */
+ dump_cgc(mcg->buf, mcg->size);
+ } else {
+ LOG_W(NR_RRC, "No masterCellGroup found in RRCReconfiguration nonCriticalExtension\n");
+ }
+}
+
byte_array_t do_RRCReconfiguration(const nr_rrc_reconfig_param_t *params)
{
byte_array_t msg = {.buf = NULL, .len = 0};
@@ -651,6 +670,7 @@ byte_array_t do_RRCReconfiguration(const nr_rrc_reconfig_param_t *params)
if (LOG_DEBUGFLAG(DEBUG_ASN1)) {
xer_fprint(stdout, &asn_DEF_NR_DL_DCCH_Message, (void *)&dl_dcch_msg);
+ dump_mcg(&dl_dcch_msg);
}
int val = uper_encode_to_new_buffer(&asn_DEF_NR_DL_DCCH_Message, NULL, &dl_dcch_msg, (void **)&msg.buf);
@@ -1350,20 +1370,33 @@ void fill_removal_lists_from_source_measConfig(NR_MeasConfig_t *currentMC, byte_
ASN_STRUCT_FREE(asn_DEF_NR_RRCReconfiguration, rrcReconf);
}
-int doRRCReconfiguration_from_HandoverCommand(byte_array_t *ba, const byte_array_t handoverCommand)
+byte_array_t doRRCReconfiguration_from_HandoverCommand(const byte_array_t handoverCommand)
{
+ DevAssert(handoverCommand.buf);
+ DevAssert(handoverCommand.len > 0);
+ byte_array_t msg = {.buf = NULL, .len = 0};
+
// Decode Handover Command
NR_HandoverCommand_t *hoCommand = NULL;
asn_dec_rval_t dec_rval = uper_decode_complete(NULL, &asn_DEF_NR_HandoverCommand, (void **)&hoCommand, handoverCommand.buf, handoverCommand.len);
- if (dec_rval.code != RC_OK && dec_rval.consumed == 0) {
- LOG_E(NR_RRC, "Can not decode Handover Command!\n");
- return -1;
+ if (dec_rval.code != RC_OK || !hoCommand) {
+ LOG_E(NR_RRC, "Failed to decode Handover Command (dec_rval.code=%d)!\n", dec_rval.code);
+ return msg;
+ }
+
+ // Validate HandoverCommand structure
+ if (hoCommand->criticalExtensions.present != NR_HandoverCommand__criticalExtensions_PR_c1
+ || !hoCommand->criticalExtensions.choice.c1
+ || hoCommand->criticalExtensions.choice.c1->present != NR_HandoverCommand__criticalExtensions__c1_PR_handoverCommand
+ || !hoCommand->criticalExtensions.choice.c1->choice.handoverCommand) {
+ LOG_E(NR_RRC, "Invalid HandoverCommand in criticalExtensions.choice.c1->choice.handoverCommand\n");
+ ASN_STRUCT_FREE(asn_DEF_NR_HandoverCommand, hoCommand);
+ return msg;
}
// Prepare DL DCCH message for RRCReconfiguration
NR_DL_DCCH_Message_t dl_dcch_msg = {0};
- asn_enc_rval_t enc_rval;
dl_dcch_msg.message.present = NR_DL_DCCH_MessageType_PR_c1;
asn1cCalloc(dl_dcch_msg.message.choice.c1, c1);
c1->present = NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration;
@@ -1371,18 +1404,37 @@ int doRRCReconfiguration_from_HandoverCommand(byte_array_t *ba, const byte_array
// Decode RRCReconfiguration from handoverCommandMessage
OCTET_STRING_t *ho = &hoCommand->criticalExtensions.choice.c1->choice.handoverCommand->handoverCommandMessage;
- uper_decode_complete(NULL, &asn_DEF_NR_RRCReconfiguration, (void **)&rrcReconf, ho->buf, ho->size);
+ if (!ho->buf || ho->size == 0) {
+ LOG_E(NR_RRC, "Invalid handoverCommandMessage OCTET_STRING (buf=%p, size=%zu)!\n", ho->buf, ho->size);
+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NR_DL_DCCH_Message, &dl_dcch_msg);
+ ASN_STRUCT_FREE(asn_DEF_NR_HandoverCommand, hoCommand);
+ return msg;
+ }
+ asn_dec_rval_t rrc_dec_rval = uper_decode_complete(NULL, &asn_DEF_NR_RRCReconfiguration, (void **)&rrcReconf, ho->buf, ho->size);
+ if (rrc_dec_rval.code != RC_OK || !rrcReconf) {
+ LOG_E(NR_RRC, "Failed to decode RRCReconfiguration from Handover Command!\n");
+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NR_DL_DCCH_Message, &dl_dcch_msg);
+ ASN_STRUCT_FREE(asn_DEF_NR_HandoverCommand, hoCommand);
+ return msg;
+ }
if (LOG_DEBUGFLAG(DEBUG_ASN1))
xer_fprint(stdout, &asn_DEF_NR_DL_DCCH_Message, (void *)&dl_dcch_msg);
- // Encode DL DCCH message in buffer
- enc_rval = uper_encode_to_buffer(&asn_DEF_NR_DL_DCCH_Message, NULL, &dl_dcch_msg, ba->buf, ba->len);
- AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded);
+ // Encode DL DCCH message to new buffer
+ int val = uper_encode_to_new_buffer(&asn_DEF_NR_DL_DCCH_Message, NULL, &dl_dcch_msg, (void **)&msg.buf);
+ if (val <= 0) {
+ LOG_E(NR_RRC, "Failed to encode RRCReconfiguration from Handover Command!\n");
+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NR_DL_DCCH_Message, &dl_dcch_msg);
+ ASN_STRUCT_FREE(asn_DEF_NR_HandoverCommand, hoCommand);
+ return msg;
+ }
+ msg.len = val;
+ LOG_D(NR_RRC, "RRCReconfiguration from HandoverCommand: Encoded (%ld bytes)\n", msg.len);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NR_DL_DCCH_Message, &dl_dcch_msg);
ASN_STRUCT_FREE(asn_DEF_NR_HandoverCommand, hoCommand);
- return ((enc_rval.encoded + 7) / 8);
+ return msg;
}
byte_array_t get_HandoverCommandMessage(nr_rrc_reconfig_param_t *params)
diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h
index 2e09397e60..2e955f8cff 100644
--- a/openair2/RRC/NR/MESSAGES/asn1_msg.h
+++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h
@@ -70,7 +70,7 @@ typedef struct {
NR_MeasConfig_t *meas_config;
byte_array_t dedicated_NAS_msg_list[MAX_DRBS_PER_UE];
int num_nas_msg;
- NR_CellGroupConfig_t *cell_group_config;
+ byte_array_t *cgc;
bool masterKeyUpdate;
int nextHopChainingCount;
byte_array_t ue_cap;
@@ -175,9 +175,10 @@ int do_NR_Paging(uint8_t Mod_id, uint8_t *buffer, uint32_t tmsi);
byte_array_t get_HandoverPreparationInformation(nr_rrc_reconfig_param_t *params, int scell_pci);
byte_array_t get_HandoverCommandMessage(nr_rrc_reconfig_param_t *params);
void fill_removal_lists_from_source_measConfig(NR_MeasConfig_t *measConfig, byte_array_t prep_info);
-int doRRCReconfiguration_from_HandoverCommand(byte_array_t *ba, byte_array_t handoverCommand);
+byte_array_t doRRCReconfiguration_from_HandoverCommand(byte_array_t handoverCommand);
struct NR_UE_NR_Capability *get_ue_nr_capability(int rnti, uint8_t *buf, uint32_t len);
NR_UE_NR_Capability_t *decode_nr_ue_capability(int rnti, const NR_UE_CapabilityRAT_ContainerList_t *clist);
+void dump_cgc(const uint8_t *buf, size_t len);
#endif /* __RRC_NR_MESSAGES_ASN1_MSG__H__ */
diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h
index 4d24a771c0..46e1ef3384 100644
--- a/openair2/RRC/NR/nr_rrc_defs.h
+++ b/openair2/RRC/NR/nr_rrc_defs.h
@@ -186,7 +186,8 @@ typedef struct gNB_RRC_UE_s {
NR_UE_MRDC_Capability_t* UE_Capability_MRDC;
int UE_MRDC_Capability_size;
- NR_CellGroupConfig_t *masterCellGroup;
+ // Transparent forwarding of CellGroupConfig
+ byte_array_t mcg;
NR_RadioBearerConfig_t *rb_config;
/* KgNB as derived from KASME received from EPC */
diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h
index a36a0778c6..1db6a4d236 100644
--- a/openair2/RRC/NR/nr_rrc_proto.h
+++ b/openair2/RRC/NR/nr_rrc_proto.h
@@ -100,9 +100,9 @@ int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib, uint3
/* UE Management Procedures */
-void rrc_gNB_generate_UeContextSetupRequest(const gNB_RRC_INST *rrc,
- rrc_gNB_ue_context_t *const ue_context_pP,
- const e1ap_bearer_setup_resp_t *resp);
+void rrc_f1_ue_context_setup_from_e1_response(const gNB_RRC_INST *rrc,
+ rrc_gNB_ue_context_t *const ue_context_pP,
+ const e1ap_bearer_setup_resp_t *resp);
void rrc_gNB_generate_UeContextModificationRequest(const gNB_RRC_INST *rrc,
rrc_gNB_ue_context_t *const ue_context_pP,
@@ -124,4 +124,14 @@ void activate_srb(gNB_RRC_UE_t *UE, int srb_id);
void e1_notify_pdcp_status(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const ngap_drb_status_t *drb_status);
void init_delayed_action(delayed_action_state_t *delayed_action);
+/** @brief Prepare and send F1AP UE Context Setup Request for a target DU
+ * @param rrc RRC instance
+ * @param ue UE context
+ * @param du Target DU container containing cell and setup information
+ * @param ho_prep_info Optional handover preparation information (NULL if not provided) */
+void rrc_f1_ue_context_setup_for_target_du(const gNB_RRC_INST *rrc,
+ gNB_RRC_UE_t *ue,
+ const nr_rrc_du_container_t *du,
+ const byte_array_t *ho_prep_info);
+
#endif
diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c
index 7a1c96e33b..6b914c27e9 100644
--- a/openair2/RRC/NR/rrc_gNB.c
+++ b/openair2/RRC/NR/rrc_gNB.c
@@ -27,8 +27,6 @@
* \company Eurecom, NTUST
* \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr, kroempa@gmail.com
*/
-#define RRC_GNB_C
-#define RRC_GNB_C
#include
#include
@@ -529,6 +527,51 @@ void activate_srb(gNB_RRC_UE_t *UE, int srb_id)
freeSRBlist(list);
}
+/** @brief Fill common fields of F1AP UE Context Setup Request
+ * This helper function initializes common fields that are shared between
+ * different UE context setup scenarios (serving DU, target DU).
+ * @param ue UE context
+ * @param du DU container for measurement timing configuration
+ * @param gNB_DU_ue_id Optional gNB-DU UE ID to include in the request (NULL if not provided)
+ * @return F1AP UE Context Setup Request */
+static f1ap_ue_context_setup_req_t rrc_fill_f1_ue_context_setup(gNB_RRC_UE_t *ue,
+ const nr_rrc_du_container_t *du,
+ const uint32_t *gNB_DU_ue_id)
+{
+ f1ap_ue_context_setup_req_t req = {
+ .gNB_CU_ue_id = ue->rrc_ue_id,
+ .servCellIndex = 0,
+ };
+
+ /* UE Aggregate Maximum Bit Rate Uplink is C-ifDRBSetup: 1 Gbps */
+ req.gnb_du_ue_agg_mbr_ul = malloc_or_fail(sizeof(*req.gnb_du_ue_agg_mbr_ul));
+ *req.gnb_du_ue_agg_mbr_ul = 1000000000; /* bps */
+
+ /* Measurement timing configuration */
+ req.cu_to_du_rrc_info.meas_timing_config = get_meas_timing_config(du->mtc, ue->measConfig);
+
+ /* UE capabilities */
+ if (ue->ue_cap_buffer.len > 0) {
+ req.cu_to_du_rrc_info.ue_cap = malloc_or_fail(sizeof(byte_array_t));
+ *req.cu_to_du_rrc_info.ue_cap = copy_byte_array(ue->ue_cap_buffer);
+ }
+
+ /* gNB-DU UE ID */
+ if (gNB_DU_ue_id) {
+ req.gNB_DU_ue_id = malloc_or_fail(sizeof(*req.gNB_DU_ue_id));
+ *req.gNB_DU_ue_id = *gNB_DU_ue_id;
+ }
+
+ /* PLMN and cell ID from DU setup request */
+ const f1ap_served_cell_info_t *cell_info = &du->setup_req->cell[0].info;
+ req.plmn.mcc = cell_info->plmn.mcc;
+ req.plmn.mnc = cell_info->plmn.mnc;
+ req.plmn.mnc_digit_length = cell_info->plmn.mnc_digit_length;
+ req.nr_cellid = cell_info->nr_cellid;
+
+ return req;
+}
+
//-----------------------------------------------------------------------------
static void rrc_gNB_generate_RRCSetup(instance_t instance,
rnti_t rnti,
@@ -816,7 +859,7 @@ nr_rrc_reconfig_param_t get_RRCReconfiguration_params(gNB_RRC_INST *rrc, gNB_RRC
NR_SRB_ToAddModList_t *SRBs = createSRBlist(UE, srb_reest_bitmap);
NR_DRB_ToAddModList_t *DRBs = createDRBlist(UE, drb_reestablish, do_integrity, do_ciphering);
- nr_rrc_reconfig_param_t params = {.cell_group_config = UE->masterCellGroup,
+ nr_rrc_reconfig_param_t params = {.cgc = &UE->mcg,
.transaction_id = xid,
.drb_config_list = DRBs,
.meas_config = UE->measConfig,
@@ -873,10 +916,25 @@ byte_array_t rrc_gNB_encode_RRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *
return msg;
}
-static void rrc_gNB_generate_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p)
+/* Forward declaration */
+static void cuup_notify_reestablishment(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p);
+
+/** @brief Generate and send RRC Reconfiguration message.
+ * Handles both normal reconfiguration and first reconfiguration after re-establishment.
+ * @param rrc RRC instance
+ * @param ue_p UE context
+ * @param is_reestablishment True if this is the first reconfiguration after re-establishment */
+static void rrc_gNB_generate_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, bool is_reestablishment)
{
- /* do not re-establish PDCP for any bearer */
- nr_rrc_reconfig_param_t params = get_RRCReconfiguration_params(rrc, ue_p, 0, false);
+ /** Get RRC Reconfiguration parameters
+ * For the first reconfiguration after a re-establishment: re-establish PDCP for SRB2
+ * (SRB1 already re-established in RRCReestablishment) and all DRBs,
+ * For the subsequent reconfigurations: do not re-establish PDCP for any bearer */
+ uint8_t srb_reest_bitmap = is_reestablishment ? (1 << SRB2) : 0;
+ bool drb_reestablish = is_reestablishment;
+ nr_rrc_reconfig_param_t params = get_RRCReconfiguration_params(rrc, ue_p, srb_reest_bitmap, drb_reestablish);
+
+ // Handle PDU session status updates
FOR_EACH_SEQ_ARR(rrc_pdu_session_param_t *, item, &ue_p->pduSessions) {
if (item->status == PDU_SESSION_STATUS_NEW) {
item->status = PDU_SESSION_STATUS_DONE;
@@ -887,15 +945,43 @@ static void rrc_gNB_generate_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_
}
// Set xid for RRC transaction
- ue_p->xids[params.transaction_id] = params.n_drb_rel > 0 ? RRC_PDUSESSION_RELEASE : RRC_PDUSESSION_ESTABLISH;
+ if (is_reestablishment) {
+ ue_p->xids[params.transaction_id] = RRC_REESTABLISH_COMPLETE;
+ } else {
+ ue_p->xids[params.transaction_id] = params.n_drb_rel > 0 ? RRC_PDUSESSION_RELEASE : RRC_PDUSESSION_ESTABLISH;
+ }
byte_array_t msg = rrc_gNB_encode_RRCReconfiguration(rrc, ue_p, params);
if (msg.len <= 0) {
- LOG_E(NR_RRC, "UE %d: Failed to generate RRCReconfiguration\n", ue_p->rrc_ue_id);
+ LOG_E(NR_RRC,
+ "UE %d: Failed to generate RRCReconfiguration%s\n",
+ ue_p->rrc_ue_id,
+ is_reestablishment ? " for re-establishment" : "");
+ free_RRCReconfiguration_params(params);
return;
}
- LOG_UE_DL_EVENT(ue_p, "Generate RRCReconfiguration (bytes %ld, xid %d)\n", msg.len, params.transaction_id);
+ /* Per TS 38.331 5.3.5.6.3, re-establish SRB2 PDCP when sending the first
+ * RRCReconfiguration after reestablishment */
+ if (is_reestablishment) {
+ if (ue_p->Srb[SRB2].Active) {
+ nr_pdcp_entity_security_keys_and_algos_t security_parameters = {0};
+ security_parameters.ciphering_algorithm = ue_p->ciphering_algorithm;
+ security_parameters.integrity_algorithm = ue_p->integrity_algorithm;
+ nr_derive_key(RRC_ENC_ALG, ue_p->ciphering_algorithm, ue_p->kgnb, security_parameters.ciphering_key);
+ nr_derive_key(RRC_INT_ALG, ue_p->integrity_algorithm, ue_p->kgnb, security_parameters.integrity_key);
+ nr_pdcp_reestablishment(ue_p->rrc_ue_id, SRB2, true, &security_parameters);
+ }
+ /* Per TS 38.331 5.3.5.6.5, re-establish PDCP for all DRBs when sending the first
+ * RRCReconfiguration after RRC connection re-establishment (over E1 to CU-UP) */
+ cuup_notify_reestablishment(rrc, ue_p);
+ }
+
+ LOG_UE_DL_EVENT(ue_p,
+ "Generate RRCReconfiguration%s (bytes %ld, xid %d)\n",
+ is_reestablishment ? " after re-establishment" : "",
+ msg.len,
+ params.transaction_id);
const uint32_t msg_id = NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration;
nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, msg_id, msg.buf, msg.len);
free_RRCReconfiguration_params(params);
@@ -982,6 +1068,10 @@ static void rrc_gNB_send_f1_drb_release_request(gNB_RRC_INST *rrc, gNB_RRC_UE_t
req.drbs_rel_len = n_drb_to_release;
memcpy(req.drbs_rel, drb_to_release, n_drb_to_release * sizeof(int));
+ // Request CellGroupConfig from DU in the response
+ req.gNB_DU_Configuration_Query = calloc_or_fail(1, sizeof(*req.gNB_DU_Configuration_Query));
+ *req.gNB_DU_Configuration_Query = true;
+
/* send UE Context Modification to DU without attaching any RRC container */
rrc->mac_rrc.ue_context_modification_request(ue_data.du_assoc_id, &req);
LOG_I(NR_RRC, "UE %d: send F1 UE Context Modification Request with DRB release (%d DRBs)\n", ue_p->rrc_ue_id, req.drbs_rel_len);
@@ -1092,12 +1182,13 @@ static void cuup_notify_reestablishment(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p)
free_e1ap_context_mod_request(&req);
}
-/**
- * @brief RRCReestablishment message
- * Direction: Network to UE
- */
+/** @brief Generate and send RRCReestablishment message to UE
+ * This function implements the gNB side of the RRC Connection Re-establishment procedure
+ * as specified in 3GPP TS 38.331 clause 5.3.7.4.
+ * @param ue_context_pP UE context pointer
+ * @param old_rnti Previous RNTI of the UE before re-establishment
+ * @param du DU container containing cell information for key derivation */
static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context_pP,
- const uint8_t *masterCellGroup_from_DU,
const rnti_t old_rnti,
const nr_rrc_du_container_t *du)
{
@@ -1122,7 +1213,9 @@ static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context
LOG_A(NR_RRC, "Send RRCReestablishment [%d bytes] to RNTI %04x\n", size, ue_p->rnti);
/* Ciphering and Integrity according to TS 33.501 */
- nr_pdcp_entity_security_keys_and_algos_t security_parameters;
+ nr_pdcp_entity_security_keys_and_algos_t security_parameters = {0};
+ DevAssert(ue_p->ciphering_algorithm >= NR_CipheringAlgorithm_nea0 && ue_p->ciphering_algorithm <= NR_CipheringAlgorithm_nea2);
+ DevAssert(ue_p->integrity_algorithm >= NR_IntegrityProtAlgorithm_nia0 && ue_p->integrity_algorithm <= NR_IntegrityProtAlgorithm_nia2);
/* Derive the keys from kgnb */
nr_derive_key(RRC_ENC_ALG, ue_p->ciphering_algorithm, ue_p->kgnb, security_parameters.ciphering_key);
nr_derive_key(RRC_INT_ALG, ue_p->integrity_algorithm, ue_p->kgnb, security_parameters.integrity_key);
@@ -1139,16 +1232,14 @@ static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context
security_parameters.integrity_algorithm = ue_p->integrity_algorithm;
security_parameters.ciphering_algorithm = 0;
- /* SRBs */
- for (int srb_id = 1; srb_id < NR_NUM_SRB; srb_id++) {
- if (ue_p->Srb[srb_id].Active)
- nr_pdcp_config_set_security(ue_p->rrc_ue_id, srb_id, true, &security_parameters);
- }
- /* Re-establish PDCP for SRB1, according to 5.3.7.4 of 3GPP TS 38.331 */
- nr_pdcp_reestablishment(ue_p->rrc_ue_id,
- 1,
- true,
- &security_parameters);
+ /* Re-establish PDCP for SRB1, according to 5.3.7.4 of 3GPP TS 38.331,
+ * and configure security via set_security internally.
+ * Note: SRB2 is NOT re-established here. Per TS 38.331 5.3.5.6.3, SRB2
+ * should be re-established in the first RRCReconfiguration after
+ * RRCReestablishmentComplete */
+ ue_p->Srb[SRB1].Active = 1;
+ nr_pdcp_reestablishment(ue_p->rrc_ue_id, SRB1, true, &security_parameters);
+
/* F1AP DL RRC Message Transfer */
f1_ue_data_t ue_data = cu_get_f1_ue_data(ue_p->rrc_ue_id);
RETURN_IF_INVALID_ASSOC_ID(ue_data.du_assoc_id);
@@ -1174,98 +1265,49 @@ static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context
}
/// @brief Function tha processes RRCReestablishmentComplete message sent by the UE, after RRCReestasblishment request.
-static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const uint8_t xid)
+static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc,
+ gNB_RRC_UE_t *ue_p,
+ const uint8_t xid,
+ const sctp_assoc_t assoc_id)
{
LOG_I(NR_RRC, "UE %d Processing NR_RRCReestablishmentComplete from UE\n", ue_p->rrc_ue_id);
- int i = 0;
-
ue_p->xids[xid] = RRC_ACTION_NONE;
- ue_p->Srb[1].Active = 1;
+ f1_ue_data_t ue_data = cu_get_f1_ue_data(ue_p->rrc_ue_id);
+ RETURN_IF_INVALID_ASSOC_ID(ue_data.du_assoc_id);
- NR_CellGroupConfig_t *cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
+ bool different_du_detected = !ue_p->f1_ue_context_active;
+ if (different_du_detected) {
+ /** Handle UE access on a different DU than the original one
+ * Per 38.401 8.7: "If the UE accessed from a gNB-DU other than the original
+ * one, the gNB-CU should trigger the UE Context Setup procedure". */
+ /* UE is accessing a different DU - trigger UE Context Setup per TS 38.401 §8.7 */
+ nr_rrc_du_container_t *du = get_du_by_assoc_id(rrc, assoc_id);
+ if (du == NULL) {
+ LOG_E(NR_RRC, "UE %d: cannot find DU for assoc_id %d\n", ue_p->rrc_ue_id, assoc_id);
+ return;
+ }
+ rrc_f1_ue_context_setup_for_target_du(rrc, ue_p, du, NULL);
+ } else {
+ // Request DU to provide CellGroupConfig with reestablishRLC flags for re-establishment
+ // According to TS 38.473 transparency requirements, CU should not construct or re-encode CellGroupConfig
+ f1ap_ue_context_mod_req_t ue_context_modif_req = {
+ .gNB_CU_ue_id = ue_p->rrc_ue_id,
+ .gNB_DU_ue_id = ue_data.secondary_ue,
+ };
- cellGroupConfig->spCellConfig = ue_p->masterCellGroup->spCellConfig;
- cellGroupConfig->mac_CellGroupConfig = ue_p->masterCellGroup->mac_CellGroupConfig;
- cellGroupConfig->physicalCellGroupConfig = ue_p->masterCellGroup->physicalCellGroupConfig;
- cellGroupConfig->rlc_BearerToReleaseList = NULL;
- cellGroupConfig->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
+ // Request CellGroupConfig from DU in the response
+ ue_context_modif_req.gNB_DU_Configuration_Query = calloc_or_fail(1, sizeof(*ue_context_modif_req.gNB_DU_Configuration_Query));
+ *ue_context_modif_req.gNB_DU_Configuration_Query = true;
- /*
- * Get SRB2, DRB configuration from the existing UE context,
- * also start from SRB2 (i=1) and not from SRB1 (i=0).
- */
- for (i = 1; i < ue_p->masterCellGroup->rlc_BearerToAddModList->list.count; ++i)
- asn1cSeqAdd(&cellGroupConfig->rlc_BearerToAddModList->list, ue_p->masterCellGroup->rlc_BearerToAddModList->list.array[i]);
-
- /*
- * At this stage, PDCP entity are re-established and reestablishRLC is flagged
- * with RRCReconfiguration to complete RLC re-establishment of remaining bearers
- */
- for (i = 0; i < cellGroupConfig->rlc_BearerToAddModList->list.count; i++) {
- asn1cCallocOne(cellGroupConfig->rlc_BearerToAddModList->list.array[i]->reestablishRLC,
- NR_RLC_BearerConfig__reestablishRLC_true);
+ /** Send UE context modification request to DU, which will respond with CellGroupConfig
+ * containing reestablishRLC flags for re-establishment.
+ * The response will be handled in rrc_CU_process_ue_context_modification_response()
+ * which will store the encoded CellGroupConfig and trigger RRC Reconfiguration */
+ rrc->mac_rrc.ue_context_modification_request(ue_data.du_assoc_id, &ue_context_modif_req);
+ free_ue_context_mod_req(&ue_context_modif_req);
}
-
- /* TODO: remove a reconfigurationWithSync, we don't need it for
- * reestablishment. The whole reason why this might be here is that we store
- * the CellGroupConfig (after handover), and simply reuse it for
- * reestablishment, instead of re-requesting the CellGroupConfig from the DU.
- * Hence, add below hack; the solution would be to request the
- * CellGroupConfig from the DU when doing reestablishment. */
- if (cellGroupConfig->spCellConfig && cellGroupConfig->spCellConfig->reconfigurationWithSync) {
- ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cellGroupConfig->spCellConfig->reconfigurationWithSync);
- cellGroupConfig->spCellConfig->reconfigurationWithSync = NULL;
- }
-
- /* Re-establish SRB2 according to clause 5.3.5.6.3 of 3GPP TS 38.331
- * (SRB1 is re-established with RRCReestablishment message)
- */
- int srb_id = 2;
- if (ue_p->Srb[srb_id].Active) {
- nr_pdcp_entity_security_keys_and_algos_t security_parameters;
- security_parameters.ciphering_algorithm = ue_p->ciphering_algorithm;
- security_parameters.integrity_algorithm = ue_p->integrity_algorithm;
- nr_derive_key(RRC_ENC_ALG, ue_p->ciphering_algorithm, ue_p->kgnb, security_parameters.ciphering_key);
- nr_derive_key(RRC_INT_ALG, ue_p->integrity_algorithm, ue_p->kgnb, security_parameters.integrity_key);
-
- nr_pdcp_reestablishment(ue_p->rrc_ue_id, srb_id, true, &security_parameters);
- }
- /* PDCP Reestablishment of DRBs according to 5.3.5.6.5 of 3GPP TS 38.331 (over E1) */
- cuup_notify_reestablishment(rrc, ue_p);
-
- /* Create srb-ToAddModList, 3GPP TS 38.331 RadioBearerConfig:
- * do not re-establish PDCP for SRB1, when resuming an RRC connection,
- * or at the first reconfiguration after RRC connection reestablishment in NR */
- NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, 1 << SRB2); // Re-establish PDCP for SRB2 only
- /* Create drb-ToAddModList */
- bool do_integrity = rrc->security.do_drb_integrity;
- bool do_ciphering = rrc->security.do_drb_ciphering;
- NR_DRB_ToAddModList_t *DRBs = createDRBlist(ue_p, true, do_integrity, do_ciphering);
-
- uint8_t new_xid = rrc_gNB_get_next_transaction_identifier(rrc->module_id);
- ue_p->xids[new_xid] = RRC_REESTABLISH_COMPLETE;
- nr_rrc_reconfig_param_t params = {.cell_group_config = cellGroupConfig,
- .meas_config = ue_p->measConfig,
- .drb_config_list = DRBs,
- .srb_config_list = SRBs,
- .transaction_id = new_xid};
- byte_array_t msg = do_RRCReconfiguration(¶ms);
- if (msg.len <= 0) {
- LOG_E(NR_RRC, "UE %d: Failed to generate RRCReconfiguration\n", ue_p->rrc_ue_id);
- return;
- }
- LOG_DUMPMSG(NR_RRC, DEBUG_RRC, msg.buf, msg.len, "[MSG] RRC Reconfiguration\n");
- LOG_I(NR_RRC,
- "UE %d RNTI %04x: Generate NR_RRCReconfiguration after reestablishment complete (bytes %ld)\n",
- ue_p->rrc_ue_id,
- ue_p->rnti,
- msg.len);
- const uint32_t msg_id = NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration;
- nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, msg_id, msg.buf, msg.len);
- free_RRCReconfiguration_params(params);
- free_byte_array(msg);
}
int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const int dl_bwp_id, const int ul_bwp_id)
@@ -1274,16 +1316,7 @@ int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const int
ue_p->xids[xid] = RRC_DEDICATED_RECONF;
ue_p->ongoing_reconfiguration = true;
- NR_CellGroupConfig_t *masterCellGroup = ue_p->masterCellGroup;
- if (dl_bwp_id > 0) {
- *masterCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = dl_bwp_id;
- *masterCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = dl_bwp_id;
- }
- if (ul_bwp_id > 0) {
- *masterCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = ul_bwp_id;
- }
-
- nr_rrc_reconfig_param_t params = {.cell_group_config = masterCellGroup, .transaction_id = xid};
+ nr_rrc_reconfig_param_t params = {.cgc = &ue_p->mcg, .transaction_id = xid};
byte_array_t msg = do_RRCReconfiguration(¶ms);
if (msg.len <= 0) {
LOG_E(NR_RRC, "UE %d: Failed to generate RRCReconfiguration\n", ue_p->rrc_ue_id);
@@ -1296,6 +1329,19 @@ int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const int
return 0;
}
+/** @brief Store encoded CellGroupConfig for transparent forwarding (TS 38.473 requirement).
+ * CU must not decode/re-encode CellGroupConfig, only forward encoded bytes to UE. */
+static void store_cgc(gNB_RRC_UE_t *UE, const byte_array_t *cgc)
+{
+ LOG_D(RRC, "UE %04x storing CellGroupConfig encoded bytes for transparent forwarding (len=%ld)\n", UE->rnti, cgc->len);
+
+ free_byte_array(UE->mcg);
+ UE->mcg = copy_byte_array(*cgc);
+
+ if (LOG_DEBUGFLAG(DEBUG_ASN1))
+ dump_cgc(UE->mcg.buf, UE->mcg.len);
+}
+
static void rrc_handle_RRCSetupRequest(gNB_RRC_INST *rrc,
sctp_assoc_t assoc_id,
const NR_RRCSetupRequest_IEs_t *rrcSetupRequest,
@@ -1353,19 +1399,12 @@ static void rrc_handle_RRCSetupRequest(gNB_RRC_INST *rrc,
rrc_gNB_generate_RRCReject(rrc, ue_context_p);
return;
}
- NR_CellGroupConfig_t *cellGroupConfig = NULL;
- asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
- &asn_DEF_NR_CellGroupConfig,
- (void **)&cellGroupConfig,
- msg->du2cu_rrc_container,
- msg->du2cu_rrc_container_length);
- AssertFatal(dec_rval.code == RC_OK && dec_rval.consumed > 0, "Cell group config decode error\n");
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
- UE = &ue_context_p->ue_context;
+ byte_array_t cgc = {.buf = msg->du2cu_rrc_container, .len = msg->du2cu_rrc_container_length};
+ store_cgc(UE, &cgc);
UE->establishment_cause = rrcSetupRequest->establishmentCause;
UE->nr_cellid = msg->nr_cellid;
- UE->masterCellGroup = cellGroupConfig;
UE->ongoing_reconfiguration = false;
UE->measConfig = nr_rrc_get_measconfig(rrc, UE->nr_cellid);
activate_srb(UE, 1);
@@ -1424,11 +1463,12 @@ static void rrc_handle_RRCReestablishmentRequest(gNB_RRC_INST *rrc,
const char *scause = get_reestab_cause(req->reestablishmentCause);
const long physCellId = req->ue_Identity.physCellId;
long ngap_cause = NGAP_CAUSE_RADIO_NETWORK_UNSPECIFIED; /* cause in case of NGAP release req */
+ const rnti_t old_rnti = req->ue_Identity.c_RNTI;
rrc_gNB_ue_context_t *ue_context_p = NULL;
LOG_I(NR_RRC,
- "Reestablishment RNTI %04x req C-RNTI %04lx physCellId %ld cause %s\n",
+ "Reestablishment RNTI %04x req C-RNTI %04x physCellId %ld cause %s\n",
msg->crnti,
- req->ue_Identity.c_RNTI,
+ old_rnti,
physCellId,
scause);
@@ -1438,10 +1478,9 @@ static void rrc_handle_RRCReestablishmentRequest(gNB_RRC_INST *rrc,
return;
}
- // 3GPP TS 38.321 version 15.13.0 Section 7.1 Table 7.1-1: RNTI values
- if (req->ue_Identity.c_RNTI < 0x1 || req->ue_Identity.c_RNTI > 0xffef) {
- /* c_RNTI range error should not happen */
- LOG_E(NR_RRC, "NR_RRCReestablishmentRequest c_RNTI %04lx range error, fallback to RRC setup\n", req->ue_Identity.c_RNTI);
+ // Validate C-RNTI range (3GPP TS 38.321 version 15.13.0 Section 7.1 Table 7.1-1)
+ if (old_rnti < 0x1 || old_rnti > 0xffef) {
+ LOG_E(NR_RRC, "NR_RRCReestablishmentRequest c_RNTI %04x range error, fallback to RRC setup\n", old_rnti);
goto fallback_rrc_setup;
}
@@ -1462,20 +1501,33 @@ static void rrc_handle_RRCReestablishmentRequest(gNB_RRC_INST *rrc,
goto fallback_rrc_setup;
}
- rnti_t old_rnti = req->ue_Identity.c_RNTI;
+ // Try to find UE context by RNTI and assoc_id (normal case: same DU)
ue_context_p = rrc_gNB_get_ue_context_by_rnti(rrc, assoc_id, old_rnti);
if (ue_context_p == NULL) {
- ue_context_p = rrc_gNB_get_ue_context_source_cell(rrc, physCellId, old_rnti);
+ // Fallback 1: Try to find UE by RNTI only (re-establishment on different DU scenario)
+ ue_context_p = rrc_gNB_get_ue_context_by_rnti_any_du(rrc, old_rnti);
if (ue_context_p == NULL) {
- LOG_E(NR_RRC, "NR_RRCReestablishmentRequest without UE context, fallback to RRC setup\n");
- goto fallback_rrc_setup;
+ // Fallback 2: Try to find UE by source cell (handover scenario)
+ ue_context_p = rrc_gNB_get_ue_context_source_cell(rrc, physCellId, old_rnti);
+ if (ue_context_p == NULL) {
+ LOG_E(NR_RRC, "NR_RRCReestablishmentRequest without UE context, fallback to RRC setup\n");
+ goto fallback_rrc_setup;
+ }
}
}
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
+ if (!UE->as_security_active) {
+ /* no active security context, need to restart entire connection */
+ LOG_E(NR_RRC, "UE requested Reestablishment without activated AS security\n");
+ ngap_cause = NGAP_CAUSE_RADIO_NETWORK_RELEASE_DUE_TO_NGRAN_GENERATED_REASON;
+ goto fallback_rrc_setup;
+ }
+
/* should check phys cell ID to identify the correct cell */
const f1ap_served_cell_info_t *cell_info = &du->setup_req->cell[0].info;
const f1ap_served_cell_info_t *previous_cell_info = get_cell_information_by_phycellId(physCellId);
+ f1_ue_data_t ue_data = cu_get_f1_ue_data(UE->rrc_ue_id);
nr_ho_source_cu_t *source_ctx = UE->ho_context ? UE->ho_context->source : NULL;
DevAssert(!source_ctx || source_ctx->du->setup_req->num_cells_available == 1);
@@ -1496,35 +1548,68 @@ static void rrc_handle_RRCReestablishmentRequest(gNB_RRC_INST *rrc,
f1u_dl_gtp_rollback(UE);
/* we need the original CellGroupConfig */
- ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->masterCellGroup);
- UE->masterCellGroup = source_ctx->old_cellGroupConfig;
- source_ctx->old_cellGroupConfig = NULL;
+ store_cgc(UE, &source_ctx->old_cgc);
/* update to old DU assoc id -- RNTI + secondary DU UE ID further below */
- f1_ue_data_t ue_data = cu_get_f1_ue_data(UE->rrc_ue_id);
ue_data.du_assoc_id = source_ctx->du->assoc_id;
bool success = cu_update_f1_ue_data(UE->rrc_ue_id, &ue_data);
DevAssert(success);
nr_rrc_finalize_ho(UE);
} else if (physCellId != cell_info->nr_pci) {
- /* UE was moving from previous cell so quickly that RRCReestablishment for previous cell was received in this cell */
- LOG_I(NR_RRC,
- "RRC Reestablishment Request from different physCellId (%ld) than current physCellId (%d), fallback to RRC setup\n",
- physCellId,
- cell_info->nr_pci);
- ngap_cause = NGAP_CAUSE_RADIO_NETWORK_RELEASE_DUE_TO_NGRAN_GENERATED_REASON;
- /* 38.401 8.7: "If the UE accessed from a gNB-DU other than the original
- * one, the gNB-CU should trigger the UE Context Setup procedure". Let's
- * assume that the old DU will trigger a release request, also freeing the
- * ongoing context at the CU. Hence, create new below */
- goto fallback_rrc_setup;
- }
+ /* Check if this is a different DU scenario or "too fast movement" scenario */
+ if (assoc_id != ue_data.du_assoc_id) {
+ /* Different DU scenario - physCellId differs because UE is re-establishing on a different DU.
+ * Re-establishment is allowed, UE Context Setup will be triggered at RRCReestablishmentComplete. */
+ // Store original du_assoc_id and du_ue_id for immediate release
+ const sctp_assoc_t old_du_assoc_id = ue_data.du_assoc_id;
+ const uint32_t old_du_ue_id = ue_data.secondary_ue;
+ LOG_I(NR_RRC,
+ "UE %d: Re-establishment on different DU (physCellId %ld from old cell != %d from new DU, du_assoc_id %d -> %d)\n",
+ UE->rrc_ue_id,
+ physCellId,
+ cell_info->nr_pci,
+ ue_data.du_assoc_id,
+ assoc_id);
- if (!UE->as_security_active) {
- /* no active security context, need to restart entire connection */
- LOG_E(NR_RRC, "UE requested Reestablishment without activated AS security\n");
- ngap_cause = NGAP_CAUSE_RADIO_NETWORK_RELEASE_DUE_TO_NGRAN_GENERATED_REASON;
- goto fallback_rrc_setup;
+ // Update to new DU
+ ue_data.du_assoc_id = assoc_id;
+
+ /* Release old DU context immediately per 3GPP TS 38.473 §8.3.3.2:
+ * "Interactions with UE Context Setup procedure:
+ * The UE Context Release procedure may be performed before the UE Context Setup
+ * procedure to release an existing UE-associated logical F1-connection and related
+ * resources in the gNB-DU" */
+ DevAssert(old_du_ue_id != 0);
+ RETURN_IF_INVALID_ASSOC_ID(old_du_assoc_id);
+ f1ap_ue_context_rel_cmd_t cmd = {
+ .gNB_CU_ue_id = UE->rrc_ue_id,
+ .gNB_DU_ue_id = old_du_ue_id,
+ .cause = F1AP_CAUSE_RADIO_NETWORK,
+ .cause_value = F1AP_CauseRadioNetwork_normal_release,
+ };
+ rrc->mac_rrc.ue_context_release_command(old_du_assoc_id, &cmd);
+ LOG_I(NR_RRC,
+ "UE %d: Re-establishment on different DU - releasing old DU immediately (assoc_id %d, DU UE ID %u)\n",
+ UE->rrc_ue_id,
+ old_du_assoc_id,
+ old_du_ue_id);
+
+ // on a new DU: we will have to send f1_ue_context again
+ UE->f1_ue_context_active = false;
+
+ // Update f1_ue_data after release
+ bool success = cu_update_f1_ue_data(UE->rrc_ue_id, &ue_data);
+ DevAssert(success);
+ } else {
+ /* Same DU but different physCellId - "too fast movement" scenario:
+ * UE was moving from previous cell so quickly that RRCReestablishment for previous cell was received in this cell */
+ LOG_I(NR_RRC,
+ "RRC Reestablishment Request from different physCellId (%ld) than current physCellId (%d), fallback to RRC setup\n",
+ physCellId,
+ cell_info->nr_pci);
+ ngap_cause = NGAP_CAUSE_RADIO_NETWORK_RELEASE_DUE_TO_NGRAN_GENERATED_REASON;
+ goto fallback_rrc_setup;
+ }
}
/* TODO: start timer in ITTI and drop UE if it does not come back */
@@ -1532,12 +1617,11 @@ static void rrc_handle_RRCReestablishmentRequest(gNB_RRC_INST *rrc,
// update with new RNTI, and update secondary UE association
UE->rnti = msg->crnti;
UE->nr_cellid = msg->nr_cellid;
- f1_ue_data_t ue_data = cu_get_f1_ue_data(UE->rrc_ue_id);
ue_data.secondary_ue = msg->gNB_DU_ue_id;
bool success = cu_update_f1_ue_data(UE->rrc_ue_id, &ue_data);
DevAssert(success);
- rrc_gNB_generate_RRCReestablishment(ue_context_p, msg->du2cu_rrc_container, old_rnti, du);
+ rrc_gNB_generate_RRCReestablishment(ue_context_p, old_rnti, du);
return;
fallback_rrc_setup:
@@ -1728,17 +1812,21 @@ static void rrc_gNB_process_MeasurementReport(gNB_RRC_INST *rrc, gNB_RRC_UE_t *U
LOG_E(NR_RRC, "Incoming Report Type: %d is not supported! \n", report_config->choice.reportConfigNR->reportType.present);
}
-static int handle_rrcReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const NR_RRCReestablishmentComplete_t *cplt)
+static void handle_rrcReestablishmentComplete(gNB_RRC_INST *rrc,
+ gNB_RRC_UE_t *UE,
+ const uint32_t gNB_DU_ue_id,
+ const NR_RRCReestablishmentComplete_t *cplt,
+ const sctp_assoc_t assoc_id)
{
NR_RRCReestablishmentComplete__criticalExtensions_PR p = cplt->criticalExtensions.present;
if (p != NR_RRCReestablishmentComplete__criticalExtensions_PR_rrcReestablishmentComplete) {
LOG_E(NR_RRC, "UE %d: expected presence of rrcReestablishmentComplete, but message has %d\n", UE->rrc_ue_id, p);
- return -1;
+ return;
}
- rrc_gNB_process_RRCReestablishmentComplete(rrc, UE, cplt->rrc_TransactionIdentifier);
+
+ rrc_gNB_process_RRCReestablishmentComplete(rrc, UE, cplt->rrc_TransactionIdentifier, assoc_id);
UE->ue_reestablishment_counter++;
- return 0;
}
/**
@@ -2044,7 +2132,7 @@ static void rrc_gNB_generate_UECapabilityEnquiry(gNB_RRC_INST *rrc, gNB_RRC_UE_t
nr_rrc_transfer_protected_rrc_message(rrc, ue, DL_SCH_LCID_DCCH, msg_id, buffer, size);
}
-static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *msg)
+static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *msg, const sctp_assoc_t assoc_id)
{
/* we look up by CU UE ID! Do NOT change back to RNTI! */
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(rrc, msg->gNB_CU_ue_id);
@@ -2149,7 +2237,8 @@ static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *m
case NR_UL_DCCH_MessageType__c1_PR_rrcReestablishmentComplete:
LOG_UE_UL_EVENT(UE, "Received RRCReestablishmentComplete\n");
- handle_rrcReestablishmentComplete(rrc, UE, ul_dcch_msg->message.choice.c1->choice.rrcReestablishmentComplete);
+ const NR_RRCReestablishmentComplete_t *rc = ul_dcch_msg->message.choice.c1->choice.rrcReestablishmentComplete;
+ handle_rrcReestablishmentComplete(rrc, UE, msg->gNB_DU_ue_id, rc, assoc_id);
break;
default:
@@ -2385,6 +2474,61 @@ void e1_notify_pdcp_status(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const ngap_drb_s
free_e1ap_context_mod_request(&req);
}
+static NR_MeasGapConfig_t *get_meas_gap_config(const f1ap_du_to_cu_rrc_info_t *du_to_cu_rrc_info)
+{
+ if (!du_to_cu_rrc_info->meas_gap_config) {
+ return NULL;
+ }
+
+ NR_MeasGapConfig_t *measGapConfig = NULL;
+ asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
+ &asn_DEF_NR_MeasGapConfig,
+ (void **)&measGapConfig,
+ (uint8_t *)du_to_cu_rrc_info->meas_gap_config->buf,
+ du_to_cu_rrc_info->meas_gap_config->len);
+ AssertFatal(dec_rval.code == RC_OK && dec_rval.consumed > 0, "measGapConfig decode error\n");
+ return measGapConfig;
+}
+
+/** @brief Detect re-establishment by checking reestablishRLC flags in CellGroupConfig.
+ * Temporary decode only for detection (not for modification, to preserve transparency).
+ * DU sets reestablishRLC=true for bearers needing RLC re-establishment (except SRB1).
+ * @param cgc Encoded CellGroupConfig from DU to CU transfer IE
+ * @return True if re-establishment is detected, false otherwise */
+static bool rrc_detect_reestablishment(const byte_array_t *cgc)
+{
+ if (!cgc || !cgc->buf || cgc->len == 0) {
+ return false;
+ }
+
+ NR_CellGroupConfig_t *temp_cellGroupConfig = NULL;
+ asn_dec_rval_t dec_rval =
+ uper_decode_complete(NULL, &asn_DEF_NR_CellGroupConfig, (void **)&temp_cellGroupConfig, cgc->buf, cgc->len);
+ if (dec_rval.code != RC_OK || dec_rval.consumed == 0) {
+ LOG_W(NR_RRC,
+ "Failed to decode CellGroupConfig for re-establishment detection (code=%d, consumed=%zu)\n",
+ dec_rval.code,
+ dec_rval.consumed);
+ return false;
+ }
+
+ bool is_reestablishment = false;
+ // Check if any RLC bearer has reestablishRLC flag set
+ if (temp_cellGroupConfig->rlc_BearerToAddModList && temp_cellGroupConfig->rlc_BearerToAddModList->list.count > 0) {
+ for (int i = 0; i < temp_cellGroupConfig->rlc_BearerToAddModList->list.count; i++) {
+ if (temp_cellGroupConfig->rlc_BearerToAddModList->list.array[i]->reestablishRLC
+ && *temp_cellGroupConfig->rlc_BearerToAddModList->list.array[i]->reestablishRLC
+ == NR_RLC_BearerConfig__reestablishRLC_true) {
+ is_reestablishment = true;
+ break;
+ }
+ }
+ }
+ ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, temp_cellGroupConfig);
+ return is_reestablishment;
+}
+
+
static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, instance_t instance)
{
f1ap_ue_context_setup_resp_t *resp = &F1AP_UE_CONTEXT_SETUP_RESP(msg_p);
@@ -2397,31 +2541,16 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, instance
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
UE->f1_ue_context_active = true;
- NR_CellGroupConfig_t *cellGroupConfig = NULL;
+ // Store the encoded CellGroupConfig for transparent forwarding
byte_array_t *cgc = &resp->du_to_cu_rrc_info.cell_group_config;
- asn_dec_rval_t dec_rval =
- uper_decode_complete(NULL, &asn_DEF_NR_CellGroupConfig, (void **)&cellGroupConfig, (uint8_t *)cgc->buf, cgc->len);
- AssertFatal(dec_rval.code == RC_OK && dec_rval.consumed > 0, "Cell group config decode error\n");
+ store_cgc(UE, cgc);
- if (resp->du_to_cu_rrc_info.meas_gap_config) {
- NR_MeasGapConfig_t *measGapConfig = NULL;
- asn_dec_rval_t dec_rval_mgc = uper_decode_complete(NULL,
- &asn_DEF_NR_MeasGapConfig,
- (void **)&measGapConfig,
- (uint8_t *)resp->du_to_cu_rrc_info.meas_gap_config->buf,
- resp->du_to_cu_rrc_info.meas_gap_config->len);
- AssertFatal(dec_rval_mgc.code == RC_OK && dec_rval_mgc.consumed > 0, "measGapConfig decode error\n");
+ // Process measurement gap config if present
+ NR_MeasGapConfig_t *measGapConfig = get_meas_gap_config(&resp->du_to_cu_rrc_info);
+ if (measGapConfig) {
UE->measConfig->measGapConfig = measGapConfig;
}
- if (UE->masterCellGroup) {
- ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->masterCellGroup);
- LOG_I(RRC, "UE %04x replacing existing CellGroupConfig with new one received from DU\n", UE->rnti);
- }
- UE->masterCellGroup = cellGroupConfig;
- if (LOG_DEBUGFLAG(DEBUG_ASN1))
- xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, UE->masterCellGroup);
-
if (!IS_SA_MODE(get_softmodem_params())) {
rrc_add_nsa_user_resp(rrc, UE, resp);
return;
@@ -2442,7 +2571,9 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, instance
}
if (UE->ho_context == NULL) {
- rrc_gNB_generate_dedicatedRRCReconfiguration(rrc, UE);
+ // Check if this is a re-establishment scenario by examining the CellGroupConfig
+ bool is_reestablishment = rrc_detect_reestablishment(cgc);
+ rrc_gNB_generate_dedicatedRRCReconfiguration(rrc, UE, is_reestablishment);
} else {
// case of handover
// handling of "target CU" information
@@ -2500,6 +2631,16 @@ static void rrc_CU_process_ue_context_release_request(MessageDef *msg_p, sctp_as
// if we receive the release request from the target DU (regardless if
// successful), we assume it is "genuine" and ask the AMF to release
nr_rrc_finalize_ho(UE);
+ } else {
+ f1_ue_data_t ue_data = cu_get_f1_ue_data(UE->rrc_ue_id);
+ if (ue_data.du_assoc_id != assoc_id) {
+ LOG_W(NR_RRC,
+ "UE context release request from unexpected DU with assoc_id %d for rrc_ue_id %d with du_assoc_id %d\n",
+ assoc_id,
+ UE->rrc_ue_id,
+ ue_data.du_assoc_id);
+ return;
+ }
}
/* TODO: marshall types correctly */
@@ -2514,7 +2655,7 @@ static void rrc_delete_ue_data(gNB_RRC_UE_t *UE)
if (UE->ho_context)
nr_rrc_finalize_ho(UE);
ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability, UE->UE_Capability_nr);
- ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->masterCellGroup);
+ free_byte_array(UE->mcg);
ASN_STRUCT_FREE(asn_DEF_NR_MeasResults, UE->measResults);
FREE_AND_ZERO_BYTE_ARRAY(UE->ue_cap_buffer);
free_MeasConfig(UE->measConfig);
@@ -2577,22 +2718,18 @@ static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, i
}
if (resp->du_to_cu_rrc_info) {
- NR_CellGroupConfig_t *cellGroupConfig = NULL;
byte_array_t *cgc = &resp->du_to_cu_rrc_info->cell_group_config;
- asn_dec_rval_t dec_rval =
- uper_decode_complete(NULL, &asn_DEF_NR_CellGroupConfig, (void **)&cellGroupConfig, (uint8_t *)cgc->buf, cgc->len);
- AssertFatal(dec_rval.code == RC_OK && dec_rval.consumed > 0, "Cell group config decode error\n");
/* hack for interoperability with srsRAN: ignore cell group config if empty */
/* cell group config is empty if buffer length is 2 and content is all 0 */
bool cgc_is_empty = cgc->len == 2 && cgc->buf[0] == 0 && cgc->buf[1] == 0;
if (!cgc_is_empty) {
- if (UE->masterCellGroup) {
- ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->masterCellGroup);
- LOG_I(RRC, "UE %04x replacing existing CellGroupConfig with new one received from DU\n", UE->rnti);
- }
- UE->masterCellGroup = cellGroupConfig;
- rrc_gNB_generate_dedicatedRRCReconfiguration(rrc, UE);
+ // Store the encoded CellGroupConfig for transparent forwarding
+ store_cgc(UE, cgc);
+
+ // Check if this is a re-establishment scenario by examining the CellGroupConfig
+ bool is_reestablishment = rrc_detect_reestablishment(cgc);
+ rrc_gNB_generate_dedicatedRRCReconfiguration(rrc, UE, is_reestablishment);
} else {
LOG_W(NR_RRC, "hack: UE %d: ignore empty CellGroupConfig in UEContextModificationResponse\n", UE->rrc_ue_id);
}
@@ -2633,6 +2770,37 @@ static void rrc_CU_process_ue_modification_required(MessageDef *msg_p, instance_
return;
}
+ /* Check if UE is accessing a different DU than its current one */
+ f1_ue_data_t ue_data = cu_get_f1_ue_data(UE->rrc_ue_id);
+ RETURN_IF_INVALID_ASSOC_ID(ue_data.du_assoc_id);
+
+ /** Refuse UE Context Modification Required from any DU if:
+ * UE Context Setup Request was sent but Setup Response hasn't arrived yet.
+ * This includes the case where UE is re-establishing on a different DU. The CU has
+ * already triggered UE Context Setup on the new DU (per TS 38.401 §8.7), and Setup Response
+ * is pending. Modification Required from any DU during this transition should be refused
+ * to avoid conflicts with the ongoing Setup procedure.
+ *
+ * Note: according to TS 38.401 §8.7 "it is assumed that the UE accessed the original gNB-DU
+ * where the UE context is available for that UE, and either steps 9-10 or steps 9’-10’
+ * may be executed or both could be skipped."
+ * By design, CU-CP will trigger UE Context Setup Modification Request and DU does not send
+ * Modification Required during re-establishment. */
+ if (!UE->f1_ue_context_active) {
+ LOG_W(NR_RRC,
+ "UE %d: UE Context Modification Required received while UE Context Setup is pending (CU UE ID %d), refusing\n",
+ UE->rrc_ue_id,
+ required->gNB_CU_ue_id);
+ f1ap_ue_context_modif_refuse_t refuse = {
+ .gNB_CU_ue_id = required->gNB_CU_ue_id,
+ .gNB_DU_ue_id = required->gNB_DU_ue_id,
+ .cause = F1AP_CAUSE_RADIO_NETWORK,
+ .cause_value = F1AP_CauseRadioNetwork_interaction_with_other_procedure,
+ };
+ rrc->mac_rrc.ue_context_modification_refuse(msg_p->ittiMsgHeader.originInstance, &refuse);
+ return;
+ }
+
if (required->du_to_cu_rrc_information && required->du_to_cu_rrc_information->cellGroupConfig) {
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
LOG_I(RRC,
@@ -2640,31 +2808,12 @@ static void rrc_CU_process_ue_modification_required(MessageDef *msg_p, instance_
UE->rrc_ue_id,
UE->rnti);
- NR_CellGroupConfig_t *cellGroupConfig = NULL;
- asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
- &asn_DEF_NR_CellGroupConfig,
- (void **)&cellGroupConfig,
- (uint8_t *)required->du_to_cu_rrc_information->cellGroupConfig,
- required->du_to_cu_rrc_information->cellGroupConfig_length);
- if (dec_rval.code != RC_OK && dec_rval.consumed == 0) {
- LOG_E(RRC, "Cell group config decode error, refusing reconfiguration\n");
- f1ap_ue_context_modif_refuse_t refuse = {
- .gNB_CU_ue_id = required->gNB_CU_ue_id,
- .gNB_DU_ue_id = required->gNB_DU_ue_id,
- .cause = F1AP_CAUSE_PROTOCOL,
- .cause_value = F1AP_CauseProtocol_transfer_syntax_error,
- };
- rrc->mac_rrc.ue_context_modification_refuse(msg_p->ittiMsgHeader.originInstance, &refuse);
- return;
- }
+ // Store the encoded CellGroupConfig for transparent forwarding
+ uint8_t *cgc_buf = required->du_to_cu_rrc_information->cellGroupConfig;
+ size_t cgc_len = required->du_to_cu_rrc_information->cellGroupConfig_length;
- if (UE->masterCellGroup) {
- ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->masterCellGroup);
- LOG_I(RRC, "UE %d/RNTI %04x replacing existing CellGroupConfig with new one received from DU\n", UE->rrc_ue_id, UE->rnti);
- }
- UE->masterCellGroup = cellGroupConfig;
- if (LOG_DEBUGFLAG(DEBUG_ASN1))
- xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, UE->masterCellGroup);
+ byte_array_t temp_cgc = {.buf = cgc_buf, .len = cgc_len};
+ store_cgc(UE, &temp_cgc);
/* trigger reconfiguration */
if (!UE->ongoing_reconfiguration)
@@ -2815,7 +2964,7 @@ void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp
}
if (!UE->f1_ue_context_active)
- rrc_gNB_generate_UeContextSetupRequest(rrc, ue_context_p, resp);
+ rrc_f1_ue_context_setup_from_e1_response(rrc, ue_context_p, resp);
else
rrc_gNB_generate_UeContextModificationRequest(rrc, ue_context_p, resp, 0, NULL);
}
@@ -3098,7 +3247,7 @@ void *rrc_gnb_task(void *args_p) {
/* Messages from PDCP */
/* From DU -> CU */
case F1AP_UL_RRC_MESSAGE:
- rrc_gNB_decode_dcch(RC.nrrrc[instance], &F1AP_UL_RRC_MESSAGE(msg_p));
+ rrc_gNB_decode_dcch(RC.nrrrc[instance], &F1AP_UL_RRC_MESSAGE(msg_p), msg_p->ittiMsgHeader.originInstance);
free_ul_rrc_message_transfer(&F1AP_UL_RRC_MESSAGE(msg_p));
break;
@@ -3397,25 +3546,147 @@ int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib1, uint
/* F1AP UE Context Management Procedures */
-//-----------------------------------------------------------------------------
-void rrc_gNB_generate_UeContextSetupRequest(const gNB_RRC_INST *rrc,
- rrc_gNB_ue_context_t *const ue_context_pP,
- const e1ap_bearer_setup_resp_t *resp)
-//-----------------------------------------------------------------------------
+/** @brief Fill DRB to Be Setup List for F1 UE Context Setup Request
+ * Returns number of DRBs filled, 0 if none */
+static int rrc_fill_f1_drb_to_setup(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue, f1ap_drb_to_setup_t drbs[MAX_DRBS_PER_UE])
+{
+ int nb_drb = 0;
+
+ FOR_EACH_SEQ_ARR(drb_t *, rrc_drb, &ue->drbs) {
+ DevAssert(nb_drb < MAX_DRBS_PER_UE);
+ f1ap_drb_to_setup_t *drb = &drbs[nb_drb];
+ nr_pdcp_configuration_t *pdcp = &rrc_drb->pdcp_config;
+ nb_drb++;
+ /* fetch an existing PDU session for this DRB */
+ rrc_pdu_session_param_t *pdu = find_pduSession_from_drbId((gNB_RRC_UE_t *)ue, rrc_drb->drb_id);
+ AssertFatal(pdu != NULL, "no PDU session for DRB ID %d\n", rrc_drb->drb_id);
+
+ drb->id = rrc_drb->drb_id;
+
+ drb->qos_choice = F1AP_QOS_CHOICE_NR;
+ drb->nr.nssai = pdu->param.nssai;
+ drb->nr.flows_len = 1;
+ drb->nr.flows = calloc_or_fail(1, sizeof(*drb->nr.flows));
+
+ /* QoS flow associated with this DRB: use first QoS flow */
+ AssertFatal(seq_arr_size(&pdu->param.qos) == 1, "only 1 Qos flow supported\n");
+ nr_rrc_qos_t *qos_param = (nr_rrc_qos_t *)seq_arr_at(&pdu->param.qos, 0);
+ DevAssert(qos_param->qos.qfi > 0);
+ drb->nr.flows[0].qfi = qos_param->qos.qfi;
+ drb->nr.flows[0].param = get_qos_char_from_qos_flow_param(&qos_param->qos);
+ /* the DRB QoS parameters: reuse the ones from the first flow */
+ drb->nr.drb_qos = drb->nr.flows[0].param;
+
+ memcpy(&drb->up_ul_tnl[0].tl_address, &rrc_drb->cuup_tunnel_config.addr.buffer, sizeof(uint8_t) * 4);
+ drb->up_ul_tnl[0].teid = rrc_drb->cuup_tunnel_config.teid;
+ drb->up_ul_tnl_len = 1;
+
+ drb->rlc_mode = rrc->configuration.um_on_default_drb ? F1AP_RLC_MODE_UM_BIDIR : F1AP_RLC_MODE_AM;
+ DevAssert(pdcp->drb.sn_size == 18 || pdcp->drb.sn_size == 12);
+ drb->dl_pdcp_sn_len = malloc_or_fail(sizeof(*drb->dl_pdcp_sn_len));
+ *drb->dl_pdcp_sn_len = pdcp->drb.sn_size == 18 ? F1AP_PDCP_SN_18B : F1AP_PDCP_SN_12B;
+ drb->ul_pdcp_sn_len = malloc_or_fail(sizeof(*drb->ul_pdcp_sn_len));
+ *drb->ul_pdcp_sn_len = pdcp->drb.sn_size == 18 ? F1AP_PDCP_SN_18B : F1AP_PDCP_SN_12B;
+ }
+ return nb_drb;
+}
+
+/** @brief Prepare and send F1AP UE Context Setup Request for a target DU
+ * This function prepares and sends an F1AP UE Context Setup Request for
+ * a target DU in handover/mobility or reestablishment scenarios.
+ * It configures:
+ * - SRB1 and SRB2 for signaling
+ * - All existing DRBs from the UE context
+ * - Measurement configuration updated for the target DU's cell
+ * - PLMN and cell information from the target DU
+ * - UE aggregate maximum bit rate
+ * - Handover preparation information (if provided)
+ * @param rrc RRC instance
+ * @param ue UE context
+ * @param du Target DU container containing cell and setup information
+ * @param ho_prep_info Optional handover preparation information */
+void rrc_f1_ue_context_setup_for_target_du(const gNB_RRC_INST *rrc,
+ gNB_RRC_UE_t *ue,
+ const nr_rrc_du_container_t *du,
+ const byte_array_t *ho_prep_info)
+{
+ DevAssert(du != NULL);
+ /* Handle two scenarios:
+ * 1. Handover (ho_prep_info provided): Prepare and copy handover preparation information
+ * for the target DU. The target DU will assign a new gNB-DU UE ID in the response.
+ * 2. Reestablishment on different DU (ho_prep_info NULL): The UE is accessing a different
+ * DU than the original one. Use secondary_ue (the new DU's RNTI) as gNB-DU UE ID because
+ * the UE context already exists in MAC layer from when RRCReestablishmentRequest was
+ * received on the new DU. The MAC layer will find the existing UE context using this RNTI. */
+ byte_array_t *hpi = NULL;
+ uint32_t du_ue_id = 0;
+ uint32_t *opt_du_ue_id = NULL;
+ if (ho_prep_info) {
+ /* Handover scenario: copy handover preparation information */
+ hpi = malloc_or_fail(sizeof(*hpi));
+ *hpi = copy_byte_array(*ho_prep_info);
+ } else {
+ /* Reestablishment scenario: use secondary_ue from existing UE context */
+ f1_ue_data_t ue_data = cu_get_f1_ue_data(ue->rrc_ue_id);
+ RETURN_IF_INVALID_ASSOC_ID(ue_data.du_assoc_id);
+ du_ue_id = ue_data.secondary_ue;
+ opt_du_ue_id = &du_ue_id;
+ }
+ LOG_I(NR_RRC, "Triggering UE Context Setup for UE %d on DU %d\n", ue->rrc_ue_id, du->assoc_id);
+ int nb_srb = 2;
+ f1ap_srb_to_setup_t *srbs = calloc_or_fail(nb_srb, sizeof(*srbs));
+ f1ap_drb_to_setup_t *drbs = calloc_or_fail(MAX_DRBS_PER_UE, sizeof(*drbs));
+
+ /* Fill DRBs */
+ int nb_drb = rrc_fill_f1_drb_to_setup(rrc, ue, drbs);
+
+ /* Prepare SRBs */
+ srbs[0].id = SRB1;
+ srbs[1].id = SRB2;
+
+ /* Update measurement config for target DU */
+ free_MeasConfig(ue->measConfig);
+ ue->measConfig = nr_rrc_get_measconfig(rrc, du->setup_req->cell[0].info.nr_cellid);
+ byte_array_t *meas_config = calloc_or_fail(1, sizeof(*meas_config));
+ meas_config->buf = calloc_or_fail(1, NR_RRC_BUF_SIZE);
+ meas_config->len = do_NR_MeasConfig(ue->measConfig, meas_config->buf, NR_RRC_BUF_SIZE);
+ /* Fill common fields */
+ f1ap_ue_context_setup_req_t req = rrc_fill_f1_ue_context_setup(ue, du, opt_du_ue_id);
+ /* Fill target DU specific fields */
+ req.srbs_len = 2;
+ req.srbs = srbs;
+ req.drbs_len = nb_drb;
+ req.drbs = drbs;
+ req.cu_to_du_rrc_info.meas_config = meas_config;
+ req.cu_to_du_rrc_info.ho_prep_info = hpi;
+
+ RETURN_IF_INVALID_ASSOC_ID(du->assoc_id);
+ rrc->mac_rrc.ue_context_setup_request(du->assoc_id, &req);
+ free_ue_context_setup_req(&req);
+}
+
+/** @brief Prepare and send F1AP UE Context Setup Request to serving DU after E1AP bearer setup
+ * This function is called when the CU-CP receives an E1AP Bearer Context Setup Response
+ * and the UE context is not yet active on the F1 interface. It prepares a complete F1AP
+ * UE Context Setup Request containing:
+ * - SRB configuration (SRB2)
+ * - DRB configuration derived from the E1AP bearer setup response
+ * - UE capabilities and measurement timing configuration
+ * - PLMN and cell information from the serving DU
+ * The request is sent to the serving DU.
+ * @param rrc RRC instance
+ * @param ue_context_pP UE context
+ * @param resp E1AP bearer setup response containing PDU session and DRB information */
+void rrc_f1_ue_context_setup_from_e1_response(const gNB_RRC_INST *rrc,
+ rrc_gNB_ue_context_t *const ue_context_pP,
+ const e1ap_bearer_setup_resp_t *resp)
{
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
AssertFatal(!ue_p->f1_ue_context_active, "logic error: ue context already active\n");
AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
- f1ap_cu_to_du_rrc_info_t cu2du = {0};
- if (ue_p->ue_cap_buffer.len > 0) {
- cu2du.ue_cap = malloc_or_fail(sizeof(byte_array_t));
- *cu2du.ue_cap = copy_byte_array(ue_p->ue_cap_buffer);
- }
-
nr_rrc_du_container_t *du = get_du_for_ue((gNB_RRC_INST *)rrc, ue_p->rrc_ue_id);
- cu2du.meas_timing_config = get_meas_timing_config(du->mtc, ue_p->measConfig);
int nb_srb = 1;
f1ap_srb_to_setup_t *srbs = calloc_or_fail(nb_srb, sizeof(*srbs));
@@ -3426,29 +3697,18 @@ void rrc_gNB_generate_UeContextSetupRequest(const gNB_RRC_INST *rrc,
f1ap_drb_to_setup_t *drbs = calloc_or_fail(32, sizeof(*drbs)); // maximum DRB can be 32
int n_drbs = fill_drb_to_be_setup_from_e1_resp(rrc, ue_p, resp->pduSession, resp->numPDUSessions, drbs);
- /* gNB-DU UE Aggregate Maximum Bit Rate Uplink is C- ifDRBSetup */
- uint64_t *agg_mbr = malloc_or_fail(sizeof(*agg_mbr));
- *agg_mbr = 1000000000 /* bps */;
-
+ /* Get gNB DU UE ID */
f1_ue_data_t ue_data = cu_get_f1_ue_data(ue_p->rrc_ue_id);
RETURN_IF_INVALID_ASSOC_ID(ue_data.du_assoc_id);
- uint32_t *du_ue_id = malloc_or_fail(sizeof(*du_ue_id));
- *du_ue_id = ue_data.secondary_ue;
- f1ap_ue_context_setup_req_t ue_context_setup_req = {
- .gNB_CU_ue_id = ue_p->rrc_ue_id,
- .gNB_DU_ue_id = du_ue_id,
- .plmn.mcc = rrc->configuration.plmn[0].mcc,
- .plmn.mnc = rrc->configuration.plmn[0].mnc,
- .plmn.mnc_digit_length = rrc->configuration.plmn[0].mnc_digit_length,
- .nr_cellid = rrc->nr_cellid,
- .servCellIndex = 0, /* TODO: correct value? */
- .srbs_len = nb_srb,
- .srbs = srbs,
- .drbs_len = n_drbs,
- .drbs = drbs,
- .cu_to_du_rrc_info = cu2du,
- .gnb_du_ue_agg_mbr_ul = agg_mbr,
- };
+ const uint32_t du_ue_id = ue_data.secondary_ue;
+
+ /* Fill common fields */
+ f1ap_ue_context_setup_req_t ue_context_setup_req = rrc_fill_f1_ue_context_setup(ue_p, du, &du_ue_id);
+ /* Fill bearers information for serving DU */
+ ue_context_setup_req.srbs_len = nb_srb;
+ ue_context_setup_req.srbs = srbs;
+ ue_context_setup_req.drbs_len = n_drbs;
+ ue_context_setup_req.drbs = drbs;
rrc->mac_rrc.ue_context_setup_request(ue_data.du_assoc_id, &ue_context_setup_req);
free_ue_context_setup_req(&ue_context_setup_req);
@@ -3491,6 +3751,10 @@ void rrc_gNB_generate_UeContextModificationRequest(const gNB_RRC_INST *rrc,
.drbs_rel = (f1ap_drb_to_release_t *)rel_drbs,
.cu_to_du_rrc_info = cu2du,
};
+
+ // Request CellGroupConfig from DU in the response
+ ue_context_modif_req.gNB_DU_Configuration_Query = calloc_or_fail(1, sizeof(*ue_context_modif_req.gNB_DU_Configuration_Query));
+ *ue_context_modif_req.gNB_DU_Configuration_Query = true;
rrc->mac_rrc.ue_context_modification_request(ue_data.du_assoc_id, &ue_context_modif_req);
// avoid attempt to release rel_drbs
ue_context_modif_req.drbs_rel_len = 0;
diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c
index 19bab47b67..bf8a797a49 100644
--- a/openair2/RRC/NR/rrc_gNB_NGAP.c
+++ b/openair2/RRC/NR/rrc_gNB_NGAP.c
@@ -1276,13 +1276,20 @@ void rrc_gNB_process_HandoverCommand(gNB_RRC_INST *rrc, const ngap_handover_comm
}
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
- uint8_t buffer[NR_RRC_BUF_SIZE];
- byte_array_t ba = {.buf = buffer, .len = sizeof(buffer)};
- int enc = doRRCReconfiguration_from_HandoverCommand(&ba, msg->handoverCommand);
- DevAssert(enc > 0);
+ byte_array_t buffer = doRRCReconfiguration_from_HandoverCommand(msg->handoverCommand);
+ if (!buffer.buf || buffer.len == 0) {
+ LOG_E(NR_RRC, "Failed to decode/encode RRCReconfiguration from HandoverCommand\n");
+ // Notify AMF that handover was cancelled
+ DevAssert(UE->ho_context);
+ DevAssert(UE->ho_context->source);
+ DevAssert(UE->ho_context->source->ho_cancel);
+ UE->ho_context->source->ho_cancel(rrc, UE);
+ return;
+ }
- rrc_gNB_trigger_reconfiguration_for_handover(rrc, UE, buffer, enc);
+ rrc_gNB_trigger_reconfiguration_for_handover(rrc, UE, buffer.buf, buffer.len);
LOG_A(NR_RRC, "Send reconfiguration (HO Command) to UE %u/RNTI %04x\n", UE->rrc_ue_id, UE->rnti);
+ free_byte_array(buffer);
}
void rrc_gNB_free_Handover_Command(ngap_handover_command_t *msg)
diff --git a/openair2/RRC/NR/rrc_gNB_mobility.c b/openair2/RRC/NR/rrc_gNB_mobility.c
index 1fc274db5b..a2230c1146 100644
--- a/openair2/RRC/NR/rrc_gNB_mobility.c
+++ b/openair2/RRC/NR/rrc_gNB_mobility.c
@@ -91,52 +91,6 @@ void nr_rrc_apply_target_context(gNB_RRC_UE_t *UE)
UE->nr_cellid = target_ctx->du->setup_req->cell[0].info.nr_cellid;
}
-/** @brief Fill DRB to Be Setup List in F1 UE Context Setup Request (optional list)
- * @return 0 if list is empty, list size otherwise */
-static int fill_drb_to_be_setup(const gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue, f1ap_drb_to_setup_t drbs[MAX_DRBS_PER_UE])
-{
- int nb_drb = 0;
-
- FOR_EACH_SEQ_ARR(drb_t *, rrc_drb, &ue->drbs) {
- DevAssert(nb_drb < MAX_DRBS_PER_UE);
- f1ap_drb_to_setup_t *drb = &drbs[nb_drb];
- nr_pdcp_configuration_t *pdcp = &rrc_drb->pdcp_config;
- nb_drb++;
- /* fetch an existing PDU session for this DRB */
- rrc_pdu_session_param_t *pdu = find_pduSession_from_drbId(ue, rrc_drb->drb_id);
- AssertFatal(pdu != NULL, "no PDU session for DRB ID %d\n", rrc_drb->drb_id);
-
- drb->id = rrc_drb->drb_id;
-
- drb->qos_choice = F1AP_QOS_CHOICE_NR;
- drb->nr.nssai = pdu->param.nssai;
- drb->nr.flows_len = 1;
- drb->nr.flows = calloc_or_fail(1, sizeof(*drb->nr.flows));
-
- // Find the QoS flow associated with this DRB
- // Since we don't have QFI mapping in the new structure, we'll use the first QoS flow
- AssertFatal(seq_arr_size(&pdu->param.qos) == 1, "only 1 Qos flow supported\n");
- nr_rrc_qos_t *qos_param = (nr_rrc_qos_t *)seq_arr_at(&pdu->param.qos, 0);
- DevAssert(qos_param->qos.qfi > 0);
- drb->nr.flows[0].qfi = qos_param->qos.qfi;
- drb->nr.flows[0].param = get_qos_char_from_qos_flow_param(&qos_param->qos);
- /* the DRB QoS parameters: we just reuse the ones from the first flow */
- drb->nr.drb_qos = drb->nr.flows[0].param;
-
- memcpy(&drb->up_ul_tnl[0].tl_address, &rrc_drb->cuup_tunnel_config.addr.buffer, sizeof(uint8_t) * 4);
- drb->up_ul_tnl[0].teid = rrc_drb->cuup_tunnel_config.teid;
- drb->up_ul_tnl_len = 1;
-
- drb->rlc_mode = rrc->configuration.um_on_default_drb ? F1AP_RLC_MODE_UM_BIDIR : F1AP_RLC_MODE_AM;
- DevAssert(pdcp->drb.sn_size == 18 || pdcp->drb.sn_size == 12);
- drb->dl_pdcp_sn_len = malloc_or_fail(sizeof(*drb->dl_pdcp_sn_len));
- *drb->dl_pdcp_sn_len = pdcp->drb.sn_size == 18 ? F1AP_PDCP_SN_18B : F1AP_PDCP_SN_12B;
- drb->ul_pdcp_sn_len = malloc_or_fail(sizeof(*drb->ul_pdcp_sn_len));
- *drb->ul_pdcp_sn_len = pdcp->drb.sn_size == 18 ? F1AP_PDCP_SN_18B : F1AP_PDCP_SN_12B;
- }
- return nb_drb;
-}
-
/* \brief Initiate a handover of UE to a specific target cell handled by this
* CU.
* \param ue a UE context for which the handover should be triggered. The UE
@@ -194,8 +148,8 @@ static void nr_initiate_handover(const gNB_RRC_INST *rrc,
ho_ctx->source->old_du_tunnel_config = drb->du_tunnel_config;
}
- int result = asn_copy(&asn_DEF_NR_CellGroupConfig, (void **)&ho_ctx->source->old_cellGroupConfig, ue->masterCellGroup);
- AssertFatal(result == 0, "error during asn_copy() of CellGroupConfig\n");
+ // Store the old CellGroupConfig for reestablishment
+ ho_ctx->source->old_cgc = copy_byte_array(ue->mcg);
}
LOG_A(NR_RRC,
@@ -206,48 +160,7 @@ static void nr_initiate_handover(const gNB_RRC_INST *rrc,
target_du->assoc_id,
target_du->setup_req->cell[0].info.nr_pci);
- f1ap_drb_to_setup_t *drbs = calloc_or_fail(MAX_DRBS_PER_UE, sizeof(*drbs));
- int nb_drb = fill_drb_to_be_setup(rrc, ue, drbs);
-
- int nb_srb = 2;
- f1ap_srb_to_setup_t *srbs = calloc_or_fail(nb_srb, sizeof(*srbs));
- srbs[0].id = 1;
- srbs[1].id = 2;
-
- free_MeasConfig(ue->measConfig);
- ue->measConfig = nr_rrc_get_measconfig(rrc, target_du->setup_req->cell[0].info.nr_cellid);
- byte_array_t *meas_config = calloc_or_fail(1, sizeof(*meas_config));
- meas_config->buf = calloc_or_fail(1, NR_RRC_BUF_SIZE);
- meas_config->len = do_NR_MeasConfig(ue->measConfig, meas_config->buf, NR_RRC_BUF_SIZE);
-
- byte_array_t *meas_timing_config = get_meas_timing_config(target_du->mtc, ue->measConfig);
-
- byte_array_t *hpi = malloc_or_fail(sizeof(*hpi));
- *hpi = copy_byte_array(*ho_prep_info);
-
- uint64_t *ue_agg_mbr = malloc_or_fail(sizeof(*ue_agg_mbr));
- *ue_agg_mbr = 1000000000 /*bps*/;
-
- f1ap_served_cell_info_t *cell_info = &target_du->setup_req->cell[0].info;
- RETURN_IF_INVALID_ASSOC_ID(target_du->assoc_id);
- f1ap_ue_context_setup_req_t ue_context_setup_req = {
- .gNB_CU_ue_id = ue->rrc_ue_id,
- .plmn.mcc = cell_info->plmn.mcc,
- .plmn.mnc = cell_info->plmn.mnc,
- .plmn.mnc_digit_length = cell_info->plmn.mnc_digit_length,
- .nr_cellid = cell_info->nr_cellid,
- .servCellIndex = 0, // TODO: correct value?
- .srbs_len = nb_srb,
- .srbs = srbs,
- .drbs_len = nb_drb,
- .drbs = drbs,
- .cu_to_du_rrc_info.ho_prep_info = hpi,
- .cu_to_du_rrc_info.meas_config = meas_config,
- .cu_to_du_rrc_info.meas_timing_config = meas_timing_config,
- .gnb_du_ue_agg_mbr_ul = ue_agg_mbr,
- };
- rrc->mac_rrc.ue_context_setup_request(target_du->assoc_id, &ue_context_setup_req);
- free_ue_context_setup_req(&ue_context_setup_req);
+ rrc_f1_ue_context_setup_for_target_du(rrc, ue, target_du, ho_prep_info);
}
typedef struct deliver_ue_ctxt_modification_data_t {
@@ -392,7 +305,7 @@ void nr_rrc_trigger_f1_ho(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue, nr_rrc_du_contain
void nr_rrc_finalize_ho(gNB_RRC_UE_t *ue)
{
if (ue->ho_context->source)
- ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, ue->ho_context->source->old_cellGroupConfig);
+ free_byte_array(ue->ho_context->source->old_cgc);
free_ho_ctx(ue->ho_context);
ue->ho_context = NULL;
}
diff --git a/openair2/RRC/NR/rrc_gNB_mobility.h b/openair2/RRC/NR/rrc_gNB_mobility.h
index 54691c2edd..456730060e 100644
--- a/openair2/RRC/NR/rrc_gNB_mobility.h
+++ b/openair2/RRC/NR/rrc_gNB_mobility.h
@@ -50,7 +50,7 @@ typedef struct nr_ho_source_cu {
rnti_t old_rnti;
/// old (source) CellGroupConfig (to send the cellGroupConfig in case of
/// reestablishment)
- NR_CellGroupConfig_t *old_cellGroupConfig;
+ byte_array_t old_cgc;
/// function pointer to announce the handover cancellation, e.g.,
/// reestablishment
ho_cancel_t ho_cancel;
diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c
index 3e3c462145..88f06338d7 100644
--- a/openair2/RRC/NR/rrc_gNB_nsa.c
+++ b/openair2/RRC/NR/rrc_gNB_nsa.c
@@ -201,7 +201,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, x2ap_ENDC_sgnb_addition_req_t *m, sctp_
byte_array_t cgci = {0};
if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1) {
DevAssert(m == NULL);
- UE->rb_config = get_default_rbconfig(10 /* EPS bearer ID */, 1 /* drb ID */, NR_CipheringAlgorithm_nea0, NR_SecurityConfig__keyToUse_master, &rrc->pdcp_config);
+ UE->rb_config = get_default_rbconfig(DEFAULT_NOS1_PDU_ID, 1 /* drb ID */, NR_CipheringAlgorithm_nea0, NR_SecurityConfig__keyToUse_master, &rrc->pdcp_config);
int len = cg_config_info_from_ue_cap_file(sizeof tmp, tmp);
DevAssert(len > 0);
cgci = create_byte_array(len, tmp);
@@ -386,18 +386,15 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, x2ap_ENDC_sgnb_addition_req_t *m, sctp_
free_ue_context_setup_req(&req);
}
-static NR_RRCReconfiguration_IEs_t *get_default_reconfig(const NR_CellGroupConfig_t *secondaryCellGroup)
+static NR_RRCReconfiguration_IEs_t *get_default_reconfig(const byte_array_t cgc)
{
NR_RRCReconfiguration_IEs_t *reconfig = calloc(1, sizeof(NR_RRCReconfiguration_IEs_t));
AssertFatal(reconfig != NULL, "out of memory\n");
- AssertFatal(secondaryCellGroup != NULL, "secondaryCellGroup is null\n");
+ AssertFatal(cgc.buf != NULL, "cgc is null\n");
reconfig->radioBearerConfig = NULL;
-
- char scg_buffer[1024];
- asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, (void *)secondaryCellGroup, scg_buffer, 1024);
- AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", enc_rval.failed_type->name, enc_rval.encoded);
- reconfig->secondaryCellGroup = calloc(1, sizeof(*reconfig->secondaryCellGroup));
- OCTET_STRING_fromBuf(reconfig->secondaryCellGroup, (const char *)scg_buffer, (enc_rval.encoded + 7) >> 3);
+ // Copy the stored CellGroupConfig to the RRCReconfiguration message
+ reconfig->secondaryCellGroup = calloc_or_fail(1, sizeof(*reconfig->secondaryCellGroup));
+ OCTET_STRING_fromBuf(reconfig->secondaryCellGroup, (const char *)cgc.buf, cgc.len);
reconfig->measConfig = NULL;
reconfig->lateNonCriticalExtension = NULL;
reconfig->nonCriticalExtension = NULL;
@@ -469,7 +466,7 @@ void rrc_add_nsa_user_resp(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const f1ap_ue_co
NR_RRCReconfiguration_t *reconfig = calloc(1, sizeof(NR_RRCReconfiguration_t));
reconfig->rrc_TransactionIdentifier = 0;
reconfig->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration;
- reconfig->criticalExtensions.choice.rrcReconfiguration = get_default_reconfig(UE->masterCellGroup);
+ reconfig->criticalExtensions.choice.rrcReconfiguration = get_default_reconfig(UE->mcg);
NR_CG_Config_t *CG_Config = generate_CG_Config(reconfig, UE->rb_config);
ASN_STRUCT_FREE(asn_DEF_NR_RRCReconfiguration, reconfig);
diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c
index 9e77dcfa8f..4860e0b63e 100644
--- a/openair2/RRC/NR_UE/rrc_UE.c
+++ b/openair2/RRC/NR_UE/rrc_UE.c
@@ -2617,7 +2617,7 @@ static int nr_rrc_ue_decode_dcch(NR_UE_RRC_INST_t *rrc,
set_DRB_status(rrc, i, RB_ESTABLISHED);
nr_mac_rrc_message_t rrc_msg = {0};
rrc_msg.payload_type = NR_MAC_RRC_RESUME_RB;
- rrc_msg.payload.resume_rb.is_srb = true;
+ rrc_msg.payload.resume_rb.is_srb = false;
rrc_msg.payload.resume_rb.rb_id = i;
nr_rrc_send_msg_to_mac(rrc, &rrc_msg);
}
diff --git a/openair2/RRC/NR_UE/rrc_sl_preconfig.c b/openair2/RRC/NR_UE/rrc_sl_preconfig.c
index 212899f866..fdf6fb37b4 100644
--- a/openair2/RRC/NR_UE/rrc_sl_preconfig.c
+++ b/openair2/RRC/NR_UE/rrc_sl_preconfig.c
@@ -19,8 +19,6 @@
* contact@openairinterface.org
*/
-#define RRC_SL_PRECONFIG
-#define RRC_SL_PRECONFIG_C
#include "oai_asn1.h"
#include "NR_SL-PreconfigurationNR-r16.h"
diff --git a/openair2/RRC/NR_UE/sl_preconfig_paramvalues.h b/openair2/RRC/NR_UE/sl_preconfig_paramvalues.h
index a44c5e4d1f..b12c9b4c83 100644
--- a/openair2/RRC/NR_UE/sl_preconfig_paramvalues.h
+++ b/openair2/RRC/NR_UE/sl_preconfig_paramvalues.h
@@ -49,12 +49,6 @@
#define SL_CONFIG_STRING_SL_NUMSSB_WITHINPERIOD_0 "sl_NumSSB_WithinPeriod_0"
#define SL_CONFIG_STRING_SL_TIMEOFFSET_SSB_0 "sl_TimeOffsetSSB_0"
#define SL_CONFIG_STRING_SL_TIMEINTERVAL_0 "sl_TimeInterval_0"
-#define SL_CONFIG_STRING_SL_NUMSSB_WITHINPERIOD_1 "sl_NumSSB_WithinPeriod_1"
-#define SL_CONFIG_STRING_SL_TIMEOFFSET_SSB_1 "sl_TimeOffsetSSB_1"
-#define SL_CONFIG_STRING_SL_TIMEINTERVAL_1 "sl_TimeInterval_1"
-#define SL_CONFIG_STRING_SL_NUMSSB_WITHINPERIOD_2 "sl_NumSSB_WithinPeriod_2"
-#define SL_CONFIG_STRING_SL_TIMEOFFSET_SSB_2 "sl_TimeOffsetSSB_2"
-#define SL_CONFIG_STRING_SL_TIMEINTERVAL_2 "sl_TimeInterval_2"
/*Sidelink Bandwidth related parameters in SL-Preconfig */
diff --git a/openair2/SDAP/nr_sdap/nr_sdap.c b/openair2/SDAP/nr_sdap/nr_sdap.c
index 1aec02814e..29e5dc93db 100644
--- a/openair2/SDAP/nr_sdap/nr_sdap.c
+++ b/openair2/SDAP/nr_sdap/nr_sdap.c
@@ -29,7 +29,7 @@
#include "common/utils/LOG/log.h"
#include "errno.h"
#include "rlc.h"
-#include "tun_if.h"
+#include "tuntap_if.h"
#include "system.h"
static void reblock_tun_socket(int fd)
@@ -157,25 +157,27 @@ static void *sdap_tun_read_thread(void *arg)
return NULL;
}
-void start_sdap_tun_gnb_first_ue_default_pdu_session(ue_id_t ue_id)
+void start_sdap_tun_gnb_first_ue_default_pdu_session(ue_id_t ue_id, int pdu_session_id)
{
- nr_sdap_entity_t *entity = nr_sdap_get_entity(ue_id, get_softmodem_params()->default_pdu_session_id);
+ nr_sdap_entity_t *entity = nr_sdap_get_entity(ue_id, pdu_session_id);
DevAssert(entity != NULL);
DevAssert(entity->is_gnb);
char *ifprefix = get_softmodem_params()->nsa ? "oaitun_gnb" : "oaitun_enb";
char ifname[IFNAMSIZ];
tun_generate_ifname(ifname, ifprefix, ue_id - 1);
- entity->pdusession_sock = tun_alloc(ifname);
+ entity->pdusession_sock = tuntap_alloc(IFF_TUN, ifname);
+ entity->pdusession_if_name = strdup(ifname);
tun_config(ifname, "10.0.1.1", NULL);
threadCreate(&entity->pdusession_thread, sdap_tun_read_thread, entity, "gnb_tun_read_thread", -1, OAI_PRIORITY_RT_LOW);
}
-void start_sdap_tun_ue(ue_id_t ue_id, int pdu_session_id, int sock)
+static void start_sdap_tun_ue(ue_id_t ue_id, int pdu_session_id, int sock, const char *ifname)
{
nr_sdap_entity_t *entity = nr_sdap_get_entity(ue_id, pdu_session_id);
DevAssert(entity != NULL);
DevAssert(!entity->is_gnb);
entity->pdusession_sock = sock;
+ entity->pdusession_if_name = strdup(ifname);
entity->stop_thread = false;
char thread_name[64];
snprintf(thread_name, sizeof(thread_name), "ue_tun_read_%ld_p%d", ue_id, pdu_session_id);
@@ -183,22 +185,32 @@ void start_sdap_tun_ue(ue_id_t ue_id, int pdu_session_id, int sock)
}
-void create_ue_ip_if(const char *ipv4, const char *ipv6, int ue_id, int pdu_session_id)
+void create_ue_ip_if(const char *ipv4, const char *ipv6, int ue_id, int pdu_session_id, bool is_default)
{
- int default_pdu = get_softmodem_params()->default_pdu_session_id;
char ifname[IFNAMSIZ];
- tun_generate_ue_ifname(ifname, ue_id, pdu_session_id != default_pdu ? pdu_session_id : -1);
- const int sock = tun_alloc(ifname);
+ tuntap_generate_ue_ifname(ifname, IFF_TUN, ue_id, is_default ? -1 : pdu_session_id);
+ const int sock = tuntap_alloc(IFF_TUN, ifname);
tun_config(ifname, ipv4, ipv6);
if (ipv4) {
setup_ue_ipv4_route(ifname, ue_id, ipv4);
}
- start_sdap_tun_ue(ue_id, pdu_session_id, sock); // interface name suffix is ue_id+1
+ start_sdap_tun_ue(ue_id, pdu_session_id, sock, ifname); // interface name suffix is ue_id+1
+}
+
+void create_ue_eth_if(int ue_id, int pdu_session_id, bool is_default)
+{
+ char ifname[IFNAMSIZ];
+ tuntap_generate_ue_ifname(ifname, IFF_TAP, ue_id, is_default ? -1 : pdu_session_id);
+ const int sock = tuntap_alloc(IFF_TAP, ifname);
+ tap_config(ifname); // brings the interface up
+ start_sdap_tun_ue(ue_id, pdu_session_id, sock, ifname);
}
void remove_ip_if(nr_sdap_entity_t *entity)
{
DevAssert(entity != NULL);
+ DevAssert(entity->pdusession_if_name != NULL);
+
// Stop the read thread
entity->stop_thread = true;
@@ -208,13 +220,7 @@ void remove_ip_if(nr_sdap_entity_t *entity)
int ret = pthread_join(entity->pdusession_thread, NULL);
AssertFatal(ret == 0, "pthread_join() failed, errno: %d, %s\n", errno, strerror(errno));
// Bring down the IP interface
- int default_pdu = get_softmodem_params()->default_pdu_session_id;
- char ifname[IFNAMSIZ];
- if (entity->is_gnb) {
- char *ifprefix = get_softmodem_params()->nsa ? "oaitun_gnb" : "oaitun_enb";
- tun_generate_ifname(ifname, ifprefix, entity->ue_id - 1);
- } else {
- tun_generate_ue_ifname(ifname, entity->ue_id, entity->pdusession_id != default_pdu ? entity->pdusession_id : -1);
- }
- tun_destroy(ifname);
+ tuntap_destroy(entity->pdusession_if_name);
+ free(entity->pdusession_if_name);
+ entity->pdusession_if_name = NULL;
}
diff --git a/openair2/SDAP/nr_sdap/nr_sdap.h b/openair2/SDAP/nr_sdap/nr_sdap.h
index 1164641970..bb85fdf249 100644
--- a/openair2/SDAP/nr_sdap/nr_sdap.h
+++ b/openair2/SDAP/nr_sdap/nr_sdap.h
@@ -60,8 +60,8 @@ void sdap_data_ind(int pdcp_entity,
char *buf,
int size);
-void start_sdap_tun_ue(ue_id_t ue_id, int pdu_session_id, int sock);
-void start_sdap_tun_gnb_first_ue_default_pdu_session(ue_id_t ue_id);
-void create_ue_ip_if(const char *ipv4, const char *ipv6, int ue_id, int pdu_session_id);
+void start_sdap_tun_gnb_first_ue_default_pdu_session(ue_id_t ue_id, int pdu_session_id);
+void create_ue_ip_if(const char *ipv4, const char *ipv6, int ue_id, int pdu_session_id, bool is_default);
+void create_ue_eth_if(int ue_id, int pdu_session_id, bool is_default);
#endif
diff --git a/openair2/SDAP/nr_sdap/nr_sdap_entity.c b/openair2/SDAP/nr_sdap/nr_sdap_entity.c
index dc747e5a60..266fff17ae 100644
--- a/openair2/SDAP/nr_sdap/nr_sdap_entity.c
+++ b/openair2/SDAP/nr_sdap/nr_sdap_entity.c
@@ -31,7 +31,7 @@
#include "gtpv1_u_messages_types.h"
#include "intertask_interface.h"
#include "rlc.h"
-#include "tun_if.h"
+#include "tuntap_if.h"
#include "nr_sdap.h"
#define NO_SDAP_HEADER 0
@@ -534,7 +534,7 @@ static void nr_sdap_add_entity(const int is_gnb, const ue_id_t ue_id, const sdap
if (IS_SOFTMODEM_NOS1 && is_gnb) {
// In NOS1 mode, terminate SDAP for the first UE on the gNB. This allows injecting/receiving
// PDCP SDUs to/from the TUN interface.
- start_sdap_tun_gnb_first_ue_default_pdu_session(ue_id);
+ start_sdap_tun_gnb_first_ue_default_pdu_session(ue_id, sdap_entity->pdusession_id);
}
}
diff --git a/openair2/SDAP/nr_sdap/nr_sdap_entity.h b/openair2/SDAP/nr_sdap/nr_sdap_entity.h
index 9f85ac21cf..c8a43dbc2a 100644
--- a/openair2/SDAP/nr_sdap/nr_sdap_entity.h
+++ b/openair2/SDAP/nr_sdap/nr_sdap_entity.h
@@ -102,6 +102,7 @@ typedef struct nr_sdap_entity_s {
bool enable_sdap;
int pdusession_id;
int pdusession_sock;
+ char *pdusession_if_name;
pthread_t pdusession_thread;
bool stop_thread;
int qfi;
diff --git a/openair2/UTIL/CLI/cli_server.c b/openair2/UTIL/CLI/cli_server.c
index 1994855b5d..951358e255 100644
--- a/openair2/UTIL/CLI/cli_server.c
+++ b/openair2/UTIL/CLI/cli_server.c
@@ -47,7 +47,6 @@
#include "UTIL/LOG/log.h"
#define MAX_NUM_CLIENTS 15
-#define MAX_LINE 100
struct sockaddr_in saddr;
unsigned short server_port = 1352;
diff --git a/openair2/UTIL/OMG/omg_constants.h b/openair2/UTIL/OMG/omg_constants.h
index 1d70551b03..98661cf387 100644
--- a/openair2/UTIL/OMG/omg_constants.h
+++ b/openair2/UTIL/OMG/omg_constants.h
@@ -69,9 +69,6 @@ typedef enum {
#define omg_eps 0.10 //10.99
#define SLEEP 1
-#define GET_DATA 0
-#define GET_DATA_UPDATE 1
-
#endif /* __OMG_H_ */
diff --git a/openair2/UTIL/OTG/otg_config.h b/openair2/UTIL/OTG/otg_config.h
index 2302c71f00..d2255b9e1f 100644
--- a/openair2/UTIL/OTG/otg_config.h
+++ b/openair2/UTIL/OTG/otg_config.h
@@ -36,7 +36,6 @@
/*!\brief It indicates that: the payload and the transport header (not otg header) are copied from static strings (HEADER_STRING and PAYLOAD_STRING) */
-#define STRING_STATIC 1
/*!\brief Define the max number of states*/
#define MAX_NUM_TRAFFIC_STATE 4 // we have 4 state: OFF, PU, ED, PE
@@ -50,8 +49,6 @@
/*!\brief Define the max number of traffic runing in the same time - using their ID in the customized traffic*/
#define MAX_EMU_TRAFFIC 10
-#define OTG_FLAG_SIZE 3
-#define OTG_FLAG "OTG"
#define IDT_TH 100
#define SIZE_COEF 1000
@@ -74,7 +71,6 @@
/*!\brief Define the size of IP version header, in bytes*/
#define HDR_IP_v4_MIN 20
-#define HDR_IP_v4_MAX 60
#define HDR_IP_v6 60
/*!\brief Define the size of TCP header, in bytes*/
@@ -87,16 +83,12 @@
#define RTP_HEADER 12
/*!\brief Define the max size of the header*/
-#define MAX_HEADER_SIZE 80
/*!\brief Define the Alphabet string to generate the payload of the packet*/
-#define ALPHABET_NUM_LETTER "abcdefghijklmnopqrstuvwyzABCDEFGHIGKLMNOPQRSTUVWXYZ0123456789"
-#define ALPHABET_LETTER "abcdefghijklmnopqrstuvwyzABCDEFGHIGKLMNOPQRSTUVWXZ"
/*!\brief Define the Alphabet string to generate the header of the packet*/
-#define ALPHABET_NUM "0123456789"
/*!\brief Define the static string to generate the header of the packet*/
//#define HEADER_STRING "5048717272261061594909177115977673656394812939088509638561159848103044447631759621785741859753883189"
@@ -108,7 +100,6 @@
/*!\brief We describe below different M2M domains and we present their associated latencies in LTE/LTE-A network REF: "Latency for Real-Time Machine-to-Machine Communication in LTE-Based System Architecture"*/
/*!\brief Latency budget for M2M capillary domain(unit millisecond)*/
-#define APPLICATION_PROCESSING_DEVICE_DELAY 1
#define MIN_APPLICATION_PROCESSING_GATEWAY_DELAY 1
#define MAX_APPLICATION_PROCESSING_GATEWAY_DELAY 3
#define MIN_FORMATING_TRANSFERRING_DELAY 1
@@ -118,8 +109,6 @@
#define TERMINAL_ACCESS_DELAY 1
/*!\brief Latency budget for access domain(unit millisecond)*/
-#define MIN_U_PLANE_GW_PROCESSING_DELAY 1
-#define MAX_U_PLANE_GW_PROCESSING_DELAY 4
#define MIN_U_PLANE_CORE_IP_ACCESS_DELAY 1
#define MAX_U_PLANE_CORE_IP_ACCESS_DELAY 2
#define MIN_FW_PROXY_DELAY 1
@@ -128,8 +117,6 @@
/*!\brief Latency budget for core and application domain(unit millisecond)*/
#define MIN_NETWORK_ACCESS_DELAY 15
#define MAX_NETWORK_ACCESS_DELAY 150
-#define MIN_SERVICE_ENABLERS_DELAY 300
-#define MAX_SERVICE_ENABLERS_DELAY 500
#define MIN_APPLICATION_ACESS_DELAY 1
#define MAX_APPLICATION_ACESS_DELAY 3
diff --git a/openair2/UTIL/OTG/traffic_config.h b/openair2/UTIL/OTG/traffic_config.h
index c0a64a3465..6787af4831 100644
--- a/openair2/UTIL/OTG/traffic_config.h
+++ b/openair2/UTIL/OTG/traffic_config.h
@@ -30,7 +30,6 @@
#define IDT_LAMBDA 3
//TRANSPORT PROTOCOL
-#define TRANS_PROTO TCP
#define IP_V IPV4
//DATA PACKET SIZE DISTRIBUTION PARAMETERS
diff --git a/openair3/COMMON/common_types.h b/openair3/COMMON/common_types.h
index 51f1f83391..c32176ab3f 100644
--- a/openair3/COMMON/common_types.h
+++ b/openair3/COMMON/common_types.h
@@ -50,7 +50,6 @@ typedef enum {
RAT_EHRPD = 2003,
} rat_type_t;
-#define NUMBER_OF_RAT_TYPE 11
typedef enum {
SS_SERVICE_GRANTED = 0,
diff --git a/openair3/COMMON/security_types.h b/openair3/COMMON/security_types.h
index d78534e176..e6010bb610 100644
--- a/openair3/COMMON/security_types.h
+++ b/openair3/COMMON/security_types.h
@@ -62,9 +62,6 @@ typedef struct {
} res_t;
#define FORMAT_128BITS "%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x"
-#define RAND_FORMAT FORMAT_128BITS
-#define AUTN_FORMAT FORMAT_128BITS
-#define KASME_FORMAT FORMAT_128BITS
#define DISPLAY_128BITS(bUFFER) \
bUFFER[0], bUFFER[1], bUFFER[2], bUFFER[3], bUFFER[4], bUFFER[5], bUFFER[6], bUFFER[7], \
diff --git a/openair3/MME_APP/enb_paramdef_mme.h b/openair3/MME_APP/enb_paramdef_mme.h
deleted file mode 100644
index 127c1855e7..0000000000
--- a/openair3/MME_APP/enb_paramdef_mme.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * 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
- */
-
-/*! \file openair2/ENB_APP/enb_paramdef_mce.h
- * \brief definition of configuration parameters for MME modules
- * \author Javier MORGADE
- * \date 2019
- * \version 0.1
- * \company VICOMTECH Spain
- * \email: javier.morgade@ieee.org
- * \note
- * \warning
- */
-
-#ifndef __MME_APP_ENB_PARAMDEF_MME__H__
-#define __MME_APP_ENB_PARAMDEF_MME__H__
-
-#include "common/config/config_paramdesc.h"
-#include "RRC_paramsvalues.h"
-
-#define ENB_CONFIG_STRING_MME_PARAMETERS "mme_parameters"
-//#define ENB_CONFIG_STRING_SCHEDULING_INFO_BR "scheduling_info_br"
-//#define ENB_CONFIG_STRING_RSRP_RANGE_LIST "rsrp_range_list"
-//#define ENB_CONFIG_STRING_PRACH_CONFIG_COMMON_V1310 "prach_ConfigCommon_v1310"
-//#define ENB_CONFIG_STRING_MPDCCH_START_SF_CSS_RA_R13 "mpdcch_startSF_CSS_RA_r13"
-//#define ENB_CONFIG_STRING_MPDCCH_START_SF_CSS_RA_R13_VAL "mpdcch_startSF_CSS_RA_r13_val"
-//#define ENB_CONFIG_STRING_PRACH_HOPPING_OFFSET_R13 "prach_HoppingOffset_r13"
-//#define ENB_CONFIG_STRING_SCHEDULING_INFO_SIB1_BR_R13 "schedulingInfoSIB1_BR_r13"
-//#define ENB_CONFIG_STRING_CELL_SELECTION_INFO_CE_R13 "cellSelectionInfoCE_r13"
-//#define ENB_CONFIG_STRING_Q_RX_LEV_MIN_CE_R13 "q_RxLevMinCE_r13"
-//#define ENB_CONFIG_STRING_BANDWIDTH_REDUCED_ACCESS_RELATED_INFO_R13 "bandwidthReducedAccessRelatedInfo_r13"
-//#define ENB_CONFIG_STRING_SI_WINDOW_LENGTH_BR_R13 "si_WindowLength_BR_r13"
-//#define ENB_CONFIG_STRING_SI_REPETITION_PATTERN_R13 "si_RepetitionPattern_r13"
-//#define ENB_CONFIG_STRING_FDD_DOWNLINK_OR_TDD_SUBFRAME_BITMAP_BR_R13 "fdd_DownlinkOrTddSubframeBitmapBR_r13"
-//#define ENB_CONFIG_STRING_FDD_DOWNLINK_OR_TDD_SUBFRAME_BITMAP_BR_VAL_R13 "fdd_DownlinkOrTddSubframeBitmapBR_val_r13"
-//#define ENB_CONFIG_STRING_START_SYMBOL_BR_R13 "startSymbolBR_r13"
-//#define ENB_CONFIG_STRING_SI_HOPPING_CONFIG_COMMON_R13 "si_HoppingConfigCommon_r13"
-//#define ENB_CONFIG_STRING_SI_VALIDITY_TIME_R13 "si_ValidityTime_r13"
-//#define ENB_CONFIG_STRING_FREQ_HOPPING_PARAMETERS_DL_R13 "freqHoppingParametersDL_r13"
-//#define ENB_CONFIG_STRING_MPDCCH_PDSCH_HOPPING_NB_R13 "mpdcch_pdsch_HoppingNB_r13"
-//#define ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_A_R13 "interval_DLHoppingConfigCommonModeA_r13"
-//#define ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_A_R13_VAL "interval_DLHoppingConfigCommonModeA_r13_val"
-//#define ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_B_R13 "interval_DLHoppingConfigCommonModeB_r13"
-//#define ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_B_R13_VAL "interval_DLHoppingConfigCommonModeB_r13_val"
-//#define ENB_CONFIG_STRING_MPDCCH_PDSCH_HOPPING_OFFSET_R13 "mpdcch_pdsch_HoppingOffset_r13"
-//#define ENB_CONFIG_STRING_PREAMBLE_TRANSMAX_CE_R13 "preamble_TransMax_ce_r13"
-//#define ENB_CONFIG_STRING_PREAMBLE_TRANSMAX_CE_R13_VAL "preamble_TransMax_ce_r13_val"
-//#define ENB_CONFIG_STRING_PDSCH_MAX_NUM_REPETITION_CE_MODE_A_R13 "pdsch_maxNumRepetitionCEmodeA_r13"
-//#define ENB_CONFIG_STRING_PDSCH_MAX_NUM_REPETITION_CE_MODE_B_R13 "pdsch_maxNumRepetitionCEmodeB_r13"
-//#define ENB_CONFIG_STRING_PUSCH_MAX_NUM_REPETITION_CE_MODE_A_R13 "pusch_maxNumRepetitionCEmodeA_r13"
-//#define ENB_CONFIG_STRING_PUSCH_MAX_NUM_REPETITION_CE_MODE_B_R13 "pusch_maxNumRepetitionCEmodeB_r13"
-//#define ENB_CONFIG_STRING_PUSCH_HOPPING_OFFSET_V1310 "pusch_HoppingOffset_v1310"
-//#define ENB_CONFIG_STRING_SYSTEM_INFO_VALUE_TAG_LIST "system_info_value_tag_SI"
-//#define ENB_CONFIG_STRING_FIRST_PREAMBLE_R13 "firstPreamble_r13"
-//#define ENB_CONFIG_STRING_LAST_PREAMBLE_R13 "lastPreamble_r13"
-//#define ENB_CONFIG_STRING_RA_RESPONSE_WINDOW_SIZE_R13 "ra_ResponseWindowSize_r13"
-//#define ENB_CONFIG_STRING_MAC_CONTENTION_RESOLUTION_TIMER_R13 "mac_ContentionResolutionTimer_r13"
-//#define ENB_CONFIG_STRING_RAR_HOPPING_CONFIG_R13 "rar_HoppingConfig_r13"
-//#define ENB_CONFIG_STRING_RACH_CE_LEVELINFOLIST_R13 "rach_CE_LevelInfoList_r13"
-//#define ENB_CONFIG_STRING_PRACH_CONFIG_INDEX_BR "prach_config_index_br"
-//#define ENB_CONFIG_STRING_PRACH_FREQ_OFFSET_BR "prach_freq_offset_br"
-//#define ENB_CONFIG_STRING_PRACH_STARTING_SUBFRAME_R13 "prach_StartingSubframe_r13"
-//#define ENB_CONFIG_STRING_MAX_NUM_PER_PREAMBLE_ATTEMPT_CE_R13 "maxNumPreambleAttemptCE_r13"
-//#define ENB_CONFIG_STRING_NUM_REPETITION_PER_PREAMBLE_ATTEMPT_R13 "numRepetitionPerPreambleAttempt_r13"
-//#define ENB_CONFIG_STRING_MPDCCH_NUM_REPETITION_RA_R13 "mpdcch_NumRepetition_RA_r13"
-//#define ENB_CONFIG_STRING_PRACH_HOPPING_CONFIG_R13 "prach_HoppingConfig_r13"
-//#define ENB_CONFIG_SRING_MAX_AVAILABLE_NARROW_BAND "max_available_narrow_band"
-//#define ENB_CONFIG_STRING_PRACH_PARAMETERS_CE_R13 "prach_parameters_ce_r13"
-//#define ENB_CONFIG_STRING_PUCCH_INFO_VALUE "pucch_info_value"
-//#define ENB_CONFIG_STRING_N1PUCCH_AN_INFOLIST_R13 "n1PUCCH_AN_InfoList_r13"
-//#define ENB_CONFIG_STRING_PCCH_CONFIG_V1310 "pcch_config_v1310"
-//#define ENB_CONFIG_STRING_PAGING_NARROWBANDS_R13 "paging_narrowbands_r13"
-//#define ENB_CONFIG_STRING_MPDCCH_NUMREPETITION_PAGING_R13 "mpdcch_numrepetition_paging_r13"
-//#define ENB_CONFIG_STRING_NB_V1310 "nb_v1310"
-//#define ENB_CONFIG_STRING_SIB2_FREQ_HOPPINGPARAMETERS_R13 "sib2_freq_hoppingParameters_r13"
-
-typedef struct ccparams_MME_s {
- /// indicator that eMTC is configured for this cell
- int32_t MME_configured;
- // /// the SIB2 parameters for eMTC SIB2
- // ccparams_lte_t ccparams;
- // int si_Narrowband_r13;
- // int si_TBS_r13;
- // int systemInfoValueTagSi_r13;
- // int firstPreamble_r13;
- // int lastPreamble_r13;
- // int ra_ResponseWindowSize_r13;
- // int mac_ContentionResolutionTimer_r13;
- // int rar_HoppingConfig_r13;
- // int rsrp_range_br;
- // int prach_config_index_br;
- // int prach_freq_offset_br;
- // int prach_StartingSubframe_r13;
- // int maxNumPreambleAttemptCE_r13;
- // int numRepetitionPerPreambleAttempt_r13;
- // int mpdcch_NumRepetition_RA_r13;
- // int prach_HoppingConfig_r13;
- // int *maxavailablenarrowband;
- // int pucch_info_value;
- // int paging_narrowbands_r13;
- // int mpdcch_numrepetition_paging_r13;
- // int nb_v1310;
- // char *pucch_NumRepetitionCE_Msg4_Level0_r13;
- // char *pucch_NumRepetitionCE_Msg4_Level1_r13;
- // char *pucch_NumRepetitionCE_Msg4_Level2_r13;
- // char *pucch_NumRepetitionCE_Msg4_Level3_r13;
- // int sib2_mpdcch_pdsch_hoppingNB_r13;
- // char *sib2_interval_DLHoppingConfigCommonModeA_r13;
- // int sib2_interval_DLHoppingConfigCommonModeA_r13_val;
- // char *sib2_interval_DLHoppingConfigCommonModeB_r13;
- // int sib2_interval_DLHoppingConfigCommonModeB_r13_val;
- // char *sib2_interval_ULHoppingConfigCommonModeA_r13;
- // int sib2_interval_ULHoppingConfigCommonModeA_r13_val;
- // char *sib2_interval_ULHoppingConfigCommonModeB_r13;
- // int sib2_interval_ULHoppingConfigCommonModeB_r13_val;
- // int sib2_mpdcch_pdsch_hoppingOffset_r13;
- // int pusch_HoppingOffset_v1310;
- // int hyperSFN_r13;
- // int eDRX_Allowed_r13;
- // int q_RxLevMinCE_r13;
- // int q_QualMinRSRQ_CE_r13;
- // char *si_WindowLength_BR_r13;
- // char *si_RepetitionPattern_r13;
- // int startSymbolBR_r13;
- // char *si_HoppingConfigCommon_r13;
- // char *si_ValidityTime_r13;
- // char *mpdcch_pdsch_HoppingNB_r13;
- // int interval_DLHoppingConfigCommonModeA_r13_val;
- // int interval_DLHoppingConfigCommonModeB_r13_val;
- // int mpdcch_pdsch_HoppingOffset_r13;
- // char *preambleTransMax_CE_r13;
- // int prach_HoppingOffset_r13;
- // int schedulingInfoSIB1_BR_r13;
- // int64_t fdd_DownlinkOrTddSubframeBitmapBR_val_r13;
- // char *cellSelectionInfoCE_r13;
- // char *bandwidthReducedAccessRelatedInfo_r13;
- // char *fdd_DownlinkOrTddSubframeBitmapBR_r13;
- // char *fdd_UplinkSubframeBitmapBR_r13;
- // char *freqHoppingParametersDL_r13;
- // char *interval_DLHoppingConfigCommonModeA_r13;
- // char *interval_DLHoppingConfigCommonModeB_r13;
- // char *prach_ConfigCommon_v1310;
- // char *mpdcch_startSF_CSS_RA_r13;
- // char *mpdcch_startSF_CSS_RA_r13_val;
- // char *pdsch_maxNumRepetitionCEmodeA_r13;
- // char *pdsch_maxNumRepetitionCEmodeB_r13;
- // char *pusch_maxNumRepetitionCEmodeA_r13;
- // char *pusch_maxNumRepetitionCEmodeB_r13;
-} ccparams_MME_t;
-
-
-#define MMEPARAMS_DESC(MMEconfig) { \
- {"MME_configured", NULL, 0, iptr:&MMEconfig->MME_configured, defintval:0, TYPE_UINT, 0} \
-}
-
-#define MMEPARAMS_CHECK { \
- { .s5= {NULL }} \
-}
-
-#endif
diff --git a/openair3/NAS/COMMON/EMM/MSG/emm_msgDef.h b/openair3/NAS/COMMON/EMM/MSG/emm_msgDef.h
index b95e140595..3e82fec02a 100644
--- a/openair3/NAS/COMMON/EMM/MSG/emm_msgDef.h
+++ b/openair3/NAS/COMMON/EMM/MSG/emm_msgDef.h
@@ -45,7 +45,6 @@ Description Defines identifiers of the EPS Mobility Management messages.
/* Header length boundaries of EPS Mobility Management messages */
#define EMM_HEADER_LENGTH sizeof(emm_msg_header_t)
-#define EMM_HEADER_MINIMUM_LENGTH EMM_HEADER_LENGTH
#define EMM_HEADER_MAXIMUM_LENGTH EMM_HEADER_LENGTH
/* EPS Mobility Management Security header type */
diff --git a/openair3/NAS/COMMON/ESM/MSG/esm_msgDef.h b/openair3/NAS/COMMON/ESM/MSG/esm_msgDef.h
index 48e6a18a90..b75ce1e77f 100644
--- a/openair3/NAS/COMMON/ESM/MSG/esm_msgDef.h
+++ b/openair3/NAS/COMMON/ESM/MSG/esm_msgDef.h
@@ -46,8 +46,6 @@ Description Defines identifiers of the EPS Session Management messages
/* Header length boundaries of EPS Session Management messages */
#define ESM_HEADER_LENGTH sizeof(esm_msg_header_t)
-#define ESM_HEADER_MINIMUM_LENGTH ESM_HEADER_LENGTH
-#define ESM_HEADER_MAXIMUM_LENGTH ESM_HEADER_LENGTH
/* Message identifiers for EPS Session Management */
# define ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST 0b11000001 /* 193 = 0xc1 */
diff --git a/openair3/NAS/COMMON/IES/AdditionalUpdateType.h b/openair3/NAS/COMMON/IES/AdditionalUpdateType.h
index 57a2f0e075..5686d50853 100644
--- a/openair3/NAS/COMMON/IES/AdditionalUpdateType.h
+++ b/openair3/NAS/COMMON/IES/AdditionalUpdateType.h
@@ -27,8 +27,6 @@
#ifndef ADDITIONAL_UPDATE_TYPE_H_
#define ADDITIONAL_UPDATE_TYPE_H_
-
-#define ADDITIONAL_UPDATE_TYPE_MINIMUM_LENGTH 1
#define ADDITIONAL_UPDATE_TYPE_MAXIMUM_LENGTH 1
typedef uint8_t AdditionalUpdateType;
diff --git a/openair3/NAS/COMMON/IES/EpsMobileIdentity.h b/openair3/NAS/COMMON/IES/EpsMobileIdentity.h
index d9b13f250c..387bb8820e 100644
--- a/openair3/NAS/COMMON/IES/EpsMobileIdentity.h
+++ b/openair3/NAS/COMMON/IES/EpsMobileIdentity.h
@@ -34,7 +34,6 @@
typedef struct {
uint8_t spare:4;
#define EPS_MOBILE_IDENTITY_EVEN 0
-#define EPS_MOBILE_IDENTITY_ODD 1
uint8_t oddeven:1;
uint8_t typeofidentity:3;
uint8_t mccdigit2:4;
diff --git a/openair3/NAS/COMMON/IES/MessageType.h b/openair3/NAS/COMMON/IES/MessageType.h
index d926f09cdc..8e05f506ca 100644
--- a/openair3/NAS/COMMON/IES/MessageType.h
+++ b/openair3/NAS/COMMON/IES/MessageType.h
@@ -28,9 +28,6 @@
#ifndef MESSAGE_TYPE_H_
#define MESSAGE_TYPE_H_
-#define MESSAGE_TYPE_MINIMUM_LENGTH 1
-#define MESSAGE_TYPE_MAXIMUM_LENGTH 1
-
typedef uint8_t MessageType;
int encode_message_type(MessageType *messagetype, uint8_t iei, uint8_t *buffer, uint32_t len);
diff --git a/openair3/NAS/COMMON/IES/MobileStationClassmark3.h b/openair3/NAS/COMMON/IES/MobileStationClassmark3.h
index 80c4d4e8e2..bab12742f2 100644
--- a/openair3/NAS/COMMON/IES/MobileStationClassmark3.h
+++ b/openair3/NAS/COMMON/IES/MobileStationClassmark3.h
@@ -28,7 +28,6 @@
#ifndef MOBILE_STATION_CLASSMARK_3_H_
#define MOBILE_STATION_CLASSMARK_3_H_
-#define MOBILE_STATION_CLASSMARK_3_MINIMUM_LENGTH 1
#define MOBILE_STATION_CLASSMARK_3_MAXIMUM_LENGTH 1
typedef struct {
diff --git a/openair3/NAS/COMMON/IES/NasRequestType.h b/openair3/NAS/COMMON/IES/NasRequestType.h
index 7eb98ff42b..7efb270b45 100644
--- a/openair3/NAS/COMMON/IES/NasRequestType.h
+++ b/openair3/NAS/COMMON/IES/NasRequestType.h
@@ -29,7 +29,6 @@
#define NAS_REQUEST_TYPE_H_
#define REQUEST_TYPE_MINIMUM_LENGTH 1
-#define REQUEST_TYPE_MAXIMUM_LENGTH 1
#define REQUEST_TYPE_INITIAL_REQUEST 0b001
#define REQUEST_TYPE_HANDOVER 0b010
diff --git a/openair3/NAS/COMMON/IES/ProcedureTransactionIdentity.h b/openair3/NAS/COMMON/IES/ProcedureTransactionIdentity.h
index 0f56e764d4..0b0e78c8b3 100644
--- a/openair3/NAS/COMMON/IES/ProcedureTransactionIdentity.h
+++ b/openair3/NAS/COMMON/IES/ProcedureTransactionIdentity.h
@@ -28,9 +28,6 @@
#ifndef PROCEDURE_TRANSACTION_IDENTITY_H_
#define PROCEDURE_TRANSACTION_IDENTITY_H_
-#define PROCEDURE_TRANSACTION_IDENTITY_MINIMUM_LENGTH 1
-#define PROCEDURE_TRANSACTION_IDENTITY_MAXIMUM_LENGTH 1
-
#define PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED 0
#define PROCEDURE_TRANSACTION_IDENTITY_FIRST 1
#define PROCEDURE_TRANSACTION_IDENTITY_LAST 254
diff --git a/openair3/NAS/COMMON/IES/ProtocolDiscriminator.h b/openair3/NAS/COMMON/IES/ProtocolDiscriminator.h
index 465baf21f4..a0fcb1471f 100644
--- a/openair3/NAS/COMMON/IES/ProtocolDiscriminator.h
+++ b/openair3/NAS/COMMON/IES/ProtocolDiscriminator.h
@@ -28,9 +28,6 @@
#ifndef PROTOCOL_DISCRIMINATOR_H_
#define PROTOCOL_DISCRIMINATOR_H_
-#define PROTOCOL_DISCRIMINATOR_MINIMUM_LENGTH 1
-#define PROTOCOL_DISCRIMINATOR_MAXIMUM_LENGTH 1
-
typedef uint8_t ProtocolDiscriminator;
int encode_protocol_discriminator(ProtocolDiscriminator *protocoldiscriminator, uint8_t iei, uint8_t *buffer, uint32_t len);
diff --git a/openair3/NAS/COMMON/IES/SecurityHeaderType.h b/openair3/NAS/COMMON/IES/SecurityHeaderType.h
index dcfaea6f8a..72ab9492c1 100644
--- a/openair3/NAS/COMMON/IES/SecurityHeaderType.h
+++ b/openair3/NAS/COMMON/IES/SecurityHeaderType.h
@@ -28,9 +28,6 @@
#ifndef SECURITY_HEADER_TYPE_H_
#define SECURITY_HEADER_TYPE_H_
-#define SECURITY_HEADER_TYPE_MINIMUM_LENGTH 1
-#define SECURITY_HEADER_TYPE_MAXIMUM_LENGTH 1
-
typedef uint8_t SecurityHeaderType;
int encode_security_header_type(SecurityHeaderType *securityheadertype, uint8_t iei, uint8_t *buffer, uint32_t len);
diff --git a/openair3/NAS/COMMON/IES/TransactionIdentifier.h b/openair3/NAS/COMMON/IES/TransactionIdentifier.h
index cf19a2f6f5..dbe5d76249 100644
--- a/openair3/NAS/COMMON/IES/TransactionIdentifier.h
+++ b/openair3/NAS/COMMON/IES/TransactionIdentifier.h
@@ -28,7 +28,6 @@
#ifndef TRANSACTION_IDENTIFIER_H_
#define TRANSACTION_IDENTIFIER_H_
-#define TRANSACTION_IDENTIFIER_MINIMUM_LENGTH 1
#define TRANSACTION_IDENTIFIER_MAXIMUM_LENGTH 1
typedef struct {
diff --git a/openair3/NAS/COMMON/IES/UeNetworkCapability.h b/openair3/NAS/COMMON/IES/UeNetworkCapability.h
index a93587c33c..a006c0c45e 100644
--- a/openair3/NAS/COMMON/IES/UeNetworkCapability.h
+++ b/openair3/NAS/COMMON/IES/UeNetworkCapability.h
@@ -78,19 +78,14 @@ typedef struct UeNetworkCapability_tag {
/* Bits 8 to 6 of octet 7 are spare and shall be coded as zero */
uint8_t spare:3;
/* eNodeB-based access class control for CSFB capability */
-#define UE_NETWORK_CAPABILITY_CSFB 1
uint8_t csfb:1;
/* LTE Positioning Protocol capability */
-#define UE_NETWORK_CAPABILITY_LPP 1
uint8_t lpp:1;
/* Location services notification mechanisms capability */
-#define UE_NETWORK_CAPABILITY_LCS 1
uint8_t lcs:1;
/* 1xSRVCC capability */
-#define UE_NETWORK_CAPABILITY_SRVCC 1
uint8_t srvcc:1;
/* NF notification procedure capability */
-#define UE_NETWORK_CAPABILITY_NF 1
uint8_t nf:1;
uint8_t umts_present;
diff --git a/openair3/NAS/COMMON/IES/UeSecurityCapability.h b/openair3/NAS/COMMON/IES/UeSecurityCapability.h
index d9726d76e0..0304eb94fc 100644
--- a/openair3/NAS/COMMON/IES/UeSecurityCapability.h
+++ b/openair3/NAS/COMMON/IES/UeSecurityCapability.h
@@ -33,54 +33,16 @@
typedef struct UeSecurityCapability_tag {
/* EPS encryption algorithms supported (octet 3) */
-#define UE_SECURITY_CAPABILITY_EEA0 0b10000000
-#define UE_SECURITY_CAPABILITY_EEA1 0b01000000
-#define UE_SECURITY_CAPABILITY_EEA2 0b00100000
-#define UE_SECURITY_CAPABILITY_EEA3 0b00010000
-#define UE_SECURITY_CAPABILITY_EEA4 0b00001000
-#define UE_SECURITY_CAPABILITY_EEA5 0b00000100
-#define UE_SECURITY_CAPABILITY_EEA6 0b00000010
-#define UE_SECURITY_CAPABILITY_EEA7 0b00000001
uint8_t eea;
/* EPS integrity algorithms supported (octet 4) */
-#define UE_SECURITY_CAPABILITY_EIA0 0b10000000
-#define UE_SECURITY_CAPABILITY_EIA1 0b01000000
-#define UE_SECURITY_CAPABILITY_EIA2 0b00100000
-#define UE_SECURITY_CAPABILITY_EIA3 0b00010000
-#define UE_SECURITY_CAPABILITY_EIA4 0b00001000
-#define UE_SECURITY_CAPABILITY_EIA5 0b00000100
-#define UE_SECURITY_CAPABILITY_EIA6 0b00000010
-#define UE_SECURITY_CAPABILITY_EIA7 0b00000001
uint8_t eia;
uint8_t umts_present;
uint8_t gprs_present;
/* UMTS encryption algorithms supported (octet 5) */
-#define UE_SECURITY_CAPABILITY_UEA0 0b10000000
-#define UE_SECURITY_CAPABILITY_UEA1 0b01000000
-#define UE_SECURITY_CAPABILITY_UEA2 0b00100000
-#define UE_SECURITY_CAPABILITY_UEA3 0b00010000
-#define UE_SECURITY_CAPABILITY_UEA4 0b00001000
-#define UE_SECURITY_CAPABILITY_UEA5 0b00000100
-#define UE_SECURITY_CAPABILITY_UEA6 0b00000010
-#define UE_SECURITY_CAPABILITY_UEA7 0b00000001
uint8_t uea;
/* UMTS integrity algorithms supported (octet 6) */
-#define UE_SECURITY_CAPABILITY_UIA1 0b01000000
-#define UE_SECURITY_CAPABILITY_UIA2 0b00100000
-#define UE_SECURITY_CAPABILITY_UIA3 0b00010000
-#define UE_SECURITY_CAPABILITY_UIA4 0b00001000
-#define UE_SECURITY_CAPABILITY_UIA5 0b00000100
-#define UE_SECURITY_CAPABILITY_UIA6 0b00000010
-#define UE_SECURITY_CAPABILITY_UIA7 0b00000001
uint8_t uia:7;
/* GPRS encryption algorithms supported (octet 7) */
-#define UE_SECURITY_CAPABILITY_GEA1 0b01000000
-#define UE_SECURITY_CAPABILITY_GEA2 0b00100000
-#define UE_SECURITY_CAPABILITY_GEA3 0b00010000
-#define UE_SECURITY_CAPABILITY_GEA4 0b00001000
-#define UE_SECURITY_CAPABILITY_GEA5 0b00000100
-#define UE_SECURITY_CAPABILITY_GEA6 0b00000010
-#define UE_SECURITY_CAPABILITY_GEA7 0b00000001
uint8_t gea:7;
} UeSecurityCapability;
diff --git a/openair3/NAS/COMMON/IES/VoiceDomainPreferenceAndUeUsageSetting.h b/openair3/NAS/COMMON/IES/VoiceDomainPreferenceAndUeUsageSetting.h
index b7dbe35de4..347d314082 100644
--- a/openair3/NAS/COMMON/IES/VoiceDomainPreferenceAndUeUsageSetting.h
+++ b/openair3/NAS/COMMON/IES/VoiceDomainPreferenceAndUeUsageSetting.h
@@ -29,7 +29,6 @@
#define VOICE_DOMAIN_PREFERENCE_AND_UE_USAGE_SETTING_H_
#define VOICE_DOMAIN_PREFERENCE_AND_UE_USAGE_SETTING_MINIMUM_LENGTH 1
-#define VOICE_DOMAIN_PREFERENCE_AND_UE_USAGE_SETTING_MAXIMUM_LENGTH 1
typedef struct VoiceDomainPreferenceAndUeUsageSetting_tag {
uint8_t spare:5;
diff --git a/openair3/NAS/COMMON/UTIL/nas_log.h b/openair3/NAS/COMMON/UTIL/nas_log.h
index de7b6357fe..334997aacb 100644
--- a/openair3/NAS/COMMON/UTIL/nas_log.h
+++ b/openair3/NAS/COMMON/UTIL/nas_log.h
@@ -61,17 +61,6 @@ Description Usefull logging functions
* ON : Enables logging traces excepted FUNC.
* ALL : Turns on ALL logging traces.
*/
-#define NAS_LOG_OFF 0x00 /* No trace */
-#define NAS_LOG_DEBUG 0x01 /* Debug trace */
-#define NAS_LOG_INFO 0x02 /* Informational trace */
-#define NAS_LOG_WARNING 0x04 /* Warning trace */
-#define NAS_LOG_ERROR 0x08 /* Error trace */
-#define NAS_LOG_FUNC 0x10 /* Entering/Leaving function trace */
-#define NAS_LOG_HEX 0x20 /* Dump trace */
-
-#define NAS_LOG_ON 0x0F /* All traces excepted FUNC and HEX */
-#define NAS_LOG_ALL 0xFF /* All traces */
-
/* Logging severity type */
typedef enum {
DEBUG,
@@ -83,18 +72,6 @@ typedef enum {
LOG_SEVERITY_MAX
} log_severity_t;
-/****************************************************************************/
-/************************ G L O B A L T Y P E S ************************/
-/****************************************************************************/
-
-/****************************************************************************/
-/******************** G L O B A L V A R I A B L E S ********************/
-/****************************************************************************/
-
-/****************************************************************************/
-/****************** E X P O R T E D F U N C T I O N S ******************/
-/****************************************************************************/
-
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#ifdef LOG_E
diff --git a/openair3/NAS/COMMON/securityDef.h b/openair3/NAS/COMMON/securityDef.h
index 30732f26f5..344bda5646 100644
--- a/openair3/NAS/COMMON/securityDef.h
+++ b/openair3/NAS/COMMON/securityDef.h
@@ -53,12 +53,9 @@ Description Contains global security definitions
* Size of the authentication challenge parameters in bytes
*/
#define AUTH_SQN_SIZE 6 /* Sequence number: 48 bits */
-#define AUTH_AK_SIZE 6 /* Anonymity key: 48 bits */
#define AUTH_AMF_SIZE 2 /* Authentication Management Field: 16 bits */
-#define AUTH_MAC_SIZE 8 /* Message Authentication Code: 64 bits */
#define AUTH_AUTN_SIZE 16 /* Authentication token: 128 bits
AUTN = (SQN ⊕ AK) || AMF || MAC */
-#define AUTH_MACS_SIZE 8 /* Re-synchronization MAC: 64 bits */
#define AUTH_AUTS_SIZE 16 /* Re-synchronization AUT: 128 bits */
#define AUTH_RAND_SIZE 16 /* Random challenge: 128 bits */
#define AUTH_CK_SIZE 16 /* Ciphering key: 128 bits */
diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.h b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.h
index a81c1add67..51e589cc92 100644
--- a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.h
+++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.h
@@ -38,7 +38,6 @@
#define FGC_NAS_MESSAGE_CONTAINER_H_
#define FGC_NAS_MESSAGE_CONTAINER_MINIMUM_LENGTH 4
-#define FGC_NAS_MESSAGE_CONTAINER_MAXIMUM_LENGTH 65535
typedef struct FGCNasMessageContainer_tag {
OctetString nasmessagecontainercontents;
diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSDeregistrationType.h b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSDeregistrationType.h
index 84a09657d4..9417266191 100644
--- a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSDeregistrationType.h
+++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSDeregistrationType.h
@@ -25,8 +25,6 @@
#include
#include "OctetString.h"
-#define FGS_DEREGISTRATION_TYPE_MINIMUM_LENGTH 1
-#define FGS_DEREGISTRATION_TYPE_MAXIMUM_LENGTH 1
typedef struct FGSDeregistrationType_tag {
#define NORMAL_DEREGISTRATION 0
diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h
index 7a0e832942..856590495f 100644
--- a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h
+++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h
@@ -35,8 +35,6 @@
#ifndef FGS_REGISTRATION_TYPE_H_
#define FGS_REGISTRATION_TYPE_H_
-#define FGS_REGISTRATION_TYPE_MINIMUM_LENGTH 1
-#define FGS_REGISTRATION_TYPE_MAXIMUM_LENGTH 1
typedef uint8_t FGSRegistrationType;
diff --git a/openair3/NAS/NR_UE/5GS/5GSM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/NR_UE/5GS/5GSM/MSG/PduSessionEstablishmentAccept.c
index cb12e5dc6c..f59111cf43 100644
--- a/openair3/NAS/NR_UE/5GS/5GSM/MSG/PduSessionEstablishmentAccept.c
+++ b/openair3/NAS/NR_UE/5GS/5GSM/MSG/PduSessionEstablishmentAccept.c
@@ -23,7 +23,6 @@
#include
#include "PduSessionEstablishmentAccept.h"
#include "common/utils/LOG/log.h"
-#include "common/utils/tun_if.h"
#include "fgs_nas_utils.h"
/**
diff --git a/openair3/NAS/NR_UE/5GS/5GSM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/NR_UE/5GS/5GSM/MSG/PduSessionEstablishmentAccept.h
index 80694814b4..eb8738295b 100644
--- a/openair3/NAS/NR_UE/5GS/5GSM/MSG/PduSessionEstablishmentAccept.h
+++ b/openair3/NAS/NR_UE/5GS/5GSM/MSG/PduSessionEstablishmentAccept.h
@@ -49,9 +49,10 @@ typedef enum { FOREACH_IEI(TO_ENUM) } pduSessionEstablishment_IEI_t;
#define PDU_SESSION_TYPE_IPV4 0b001
#define PDU_SESSION_TYPE_IPV6 0b010
#define PDU_SESSION_TYPE_IPV4V6 0b011
+#define PDU_SESSION_TYPE_UNSTRUCT 0b100
+#define PDU_SESSION_TYPE_ETHER 0b101
#define IPv4_ADDRESS_LENGTH 4 // length of the IPv4 address associated with a PDU session
#define IPv6_INTERFACE_ID_LENGTH 8 // interface identifier for the IPv6 link local address
-#define SMF_IPv6_LLA_LENGTH 16
/* Rule operation codes - TS 24.501 Table 9.11.4.13.1 */
diff --git a/openair3/NAS/NR_UE/nr_nas_msg.c b/openair3/NAS/NR_UE/nr_nas_msg.c
index 5a58af6b84..8f4f9bd280 100644
--- a/openair3/NAS/NR_UE/nr_nas_msg.c
+++ b/openair3/NAS/NR_UE/nr_nas_msg.c
@@ -56,7 +56,6 @@
#include "aka_functions.h"
#include "assertions.h"
#include "common/utils/ds/byte_array.h"
-#include "common/utils/tun_if.h"
#include "commonDef.h"
#include "intertask_interface.h"
#include "kdf.h"
@@ -1473,7 +1472,10 @@ static int capture_ipv6_addr(const uint8_t *addr, char *ip, size_t len)
* @brief Process PDU Session Address in PDU Session Establishment Accept message
* and configure the tun interface
*/
-static void process_pdu_session_addr(pdu_session_establishment_accept_msg_t *msg, int instance_id, int pdu_session_id)
+static void process_pdu_session_addr(pdu_session_establishment_accept_msg_t *msg,
+ int instance_id,
+ int pdu_session_id,
+ bool is_default)
{
uint8_t *addr = msg->pdu_addr_ie.pdu_addr_oct;
@@ -1481,13 +1483,13 @@ static void process_pdu_session_addr(pdu_session_establishment_accept_msg_t *msg
case PDU_SESSION_TYPE_IPV4: {
char ip[20];
capture_ipv4_addr(&addr[0], ip, sizeof(ip));
- create_ue_ip_if(ip, NULL, instance_id, pdu_session_id);
+ create_ue_ip_if(ip, NULL, instance_id, pdu_session_id, is_default);
} break;
case PDU_SESSION_TYPE_IPV6: {
char ipv6[40];
capture_ipv6_addr(addr, ipv6, sizeof(ipv6));
- create_ue_ip_if(NULL, ipv6, instance_id, pdu_session_id);
+ create_ue_ip_if(NULL, ipv6, instance_id, pdu_session_id, is_default);
} break;
case PDU_SESSION_TYPE_IPV4V6: {
@@ -1495,7 +1497,7 @@ static void process_pdu_session_addr(pdu_session_establishment_accept_msg_t *msg
capture_ipv6_addr(addr, ipv6, sizeof(ipv6));
char ipv4[20];
capture_ipv4_addr(&addr[IPv6_INTERFACE_ID_LENGTH], ipv4, sizeof(ipv4));
- create_ue_ip_if(ipv4, ipv6, instance_id, pdu_session_id);
+ create_ue_ip_if(ipv4, ipv6, instance_id, pdu_session_id, is_default);
} break;
default:
@@ -1507,7 +1509,7 @@ static void process_pdu_session_addr(pdu_session_establishment_accept_msg_t *msg
/**
* @brief Handle PDU Session Establishment Accept and process decoded message
*/
-static void handle_pdu_session_accept(uint8_t *pdu_buffer, uint32_t msg_length, int instance)
+static void handle_pdu_session_accept(const nr_ue_nas_t *nas, uint8_t *pdu_buffer, uint32_t msg_length, int instance)
{
pdu_session_establishment_accept_msg_t msg = {0};
int size = 0;
@@ -1545,22 +1547,42 @@ static void handle_pdu_session_accept(uint8_t *pdu_buffer, uint32_t msg_length,
size += decoded;
// decode PDU Session Establishment Accept
- if (!decode_pdu_session_establishment_accept_msg(&msg, pdu_buffer + size, msg_length))
+ if (!decode_pdu_session_establishment_accept_msg(&msg, pdu_buffer + size, msg_length)) {
LOG_E(NAS, "decode_pdu_session_establishment_accept_msg failure\n");
+ return;
+ }
+
+ int idx;
+ for (idx = 0; idx < nas->uicc->n_pdu_sessions; ++idx) {
+ const pdu_session_config_t *pdu = &nas->uicc->pdu_sessions[idx];
+ if (pdu->id == sm_header.pdu_session_id && pdu->type == msg.pdu_type)
+ break;
+ }
+ if (idx == nas->uicc->n_pdu_sessions) {
+ LOG_E(NAS,
+ "PDU session establishment accept for ID %d type %d not in list of configured PDU sessions, abort transaction\n",
+ sm_header.pdu_session_id,
+ msg.pdu_type);
+ return;
+ }
+
+ // process PDU Session: pass ID -1 to not append PDU ID to interface
+ bool is_default = idx == 0;
+ if (msg.pdu_type == PDU_SESSION_TYPE_ETHER) {
+ create_ue_eth_if(instance, sm_header.pdu_session_id, is_default);
+ } else if (msg.pdu_addr_ie.pdu_length) {
+ process_pdu_session_addr(&msg, instance, sm_header.pdu_session_id, is_default);
+ } else {
+ LOG_W(NAS, "Unhandled PDU session type %d, ignoring PDU session ID %d\n", msg.pdu_type, sm_header.pdu_session_id);
+ }
- // process PDU Session
- if (msg.pdu_addr_ie.pdu_length)
- process_pdu_session_addr(&msg, instance, sm_header.pdu_session_id);
- else
- LOG_W(NAS, "Optional PDU Address IE was not provided\n");
-
set_qfi(msg.qos_rules.rule->qfi, sm_header.pdu_session_id, instance);
}
/**
* @brief Handle DL NAS Transport and process piggybacked 5GSM messages
*/
-void handleDownlinkNASTransport(uint8_t * pdu_buffer, int pdu_length, int instance)
+void handleDownlinkNASTransport(const nr_ue_nas_t *nas, uint8_t * pdu_buffer, int pdu_length, int instance)
{
if (pdu_length < 17) {
LOG_E(NAS, "Received DL NAS Transport message too short (%d)\n", pdu_length);
@@ -1569,7 +1591,7 @@ void handleDownlinkNASTransport(uint8_t * pdu_buffer, int pdu_length, int instan
uint8_t msg_type = *(pdu_buffer + 16);
if (msg_type == FGS_PDU_SESSION_ESTABLISHMENT_ACC) {
LOG_A(NAS, "Received PDU Session Establishment Accept in DL NAS Transport\n");
- handle_pdu_session_accept(pdu_buffer, pdu_length, instance);
+ handle_pdu_session_accept(nas, pdu_buffer, pdu_length, instance);
} else {
LOG_E(NAS, "Received unexpected message in DLinformationTransfer %d\n", msg_type);
}
@@ -1688,19 +1710,16 @@ static void generatePduSessionEstablishRequest(nr_ue_nas_t *nas, as_nas_info_t *
const bool has_nssai_sd = pdu_req->sd != 0xffffff; // 0xffffff means "no SD", TS 23.003
const size_t nssai_len = has_nssai_sd ? 4 : 1;
mm_msg->snssai.length = nssai_len;
- // Fixme: it seems there are a lot of memory errors in this: this value was on the stack,
- // but pushed in a itti message to another thread
- // this kind of error seems in many places in 5G NAS
mm_msg->snssai.value = calloc(1, nssai_len);
mm_msg->snssai.value[0] = pdu_req->sst;
if (has_nssai_sd)
INT24_TO_BUFFER(pdu_req->sd, &mm_msg->snssai.value[1]);
size += 1 + 1 + nssai_len;
- int dnnSize = strlen(nas->uicc->dnnStr);
+ int dnnSize = strlen(pdu_req->dnn);
mm_msg->dnn.value = calloc(1, dnnSize + 1);
mm_msg->dnn.length = dnnSize + 1;
mm_msg->dnn.value[0] = dnnSize;
- memcpy(mm_msg->dnn.value + 1, nas->uicc->dnnStr, dnnSize);
+ memcpy(mm_msg->dnn.value + 1, pdu_req->dnn, dnnSize);
size += (1 + 1 + dnnSize + 1);
// encode the message
@@ -1772,24 +1791,33 @@ static void send_nas_5gmm_ind(instance_t instance, const Guti5GSMobileIdentity_t
itti_send_msg_to_task(TASK_RRC_NRUE, instance, msg);
}
-void request_pdusession(nr_ue_nas_t *nas, int pdusession_id)
+void request_pdusession(nr_ue_nas_t *nas, const pdu_session_config_t *pdu)
{
+ int t = pdu->type;
+ AssertFatal(t == PDU_SESSION_TYPE_IPV4 || t == PDU_SESSION_TYPE_IPV6 || t == PDU_SESSION_TYPE_IPV4V6
+ || t == PDU_SESSION_TYPE_UNSTRUCT || t == PDU_SESSION_TYPE_ETHER,
+ "illegal PDU session type %d\n",
+ t);
+ AssertFatal(t != PDU_SESSION_TYPE_UNSTRUCT, "unstructured PDU sessions not handled yet\n");
MessageDef *message_p = itti_alloc_new_message(TASK_NAS_NRUE, nas->UE_id, NAS_PDU_SESSION_REQ);
- NAS_PDU_SESSION_REQ(message_p).pdusession_id = pdusession_id;
- NAS_PDU_SESSION_REQ(message_p).pdusession_type = 0x91; // 0x91 = IPv4, 0x92 = IPv6, 0x93 = IPv4v6
- NAS_PDU_SESSION_REQ(message_p).sst = nas->uicc->nssai_sst;
- NAS_PDU_SESSION_REQ(message_p).sd = nas->uicc->nssai_sd;
+ nas_pdu_session_req_t *pdu_req = &NAS_PDU_SESSION_REQ(message_p);
+ pdu_req->pdusession_id = pdu->id;
+ // 24.501: joint PDU session type IEI (0x9-, Table 8.3.1.1.1) and type (9.11.4.11)
+ pdu_req->pdusession_type = 0x90 | t;
+ pdu_req->sst = pdu->nssai.sst;
+ pdu_req->sd = pdu->nssai.sd;
+ snprintf(pdu_req->dnn, sizeof(pdu_req->dnn), "%s", pdu->dnn);
itti_send_msg_to_task(TASK_NAS_NRUE, nas->UE_id, message_p);
}
-static int get_user_nssai_idx(const nr_nas_msg_snssai_t allowed_nssai[NAS_MAX_NUMBER_SLICES], const nr_ue_nas_t *nas)
+static int get_user_nssai_idx(nssai_t ch_nssai, const nr_nas_msg_snssai_t allowed_nssai[NAS_MAX_NUMBER_SLICES])
{
for (int i = 0; i < NAS_MAX_NUMBER_SLICES; i++) {
const nr_nas_msg_snssai_t *nssai = allowed_nssai + i;
/* If it was received in Registration Accept, check the SD
in the stored Allowed N-SSAI, else, consider the SD valid */
- bool sd_match = !nssai->sd || (nas->uicc->nssai_sd == *nssai->sd);
- if ((nas->uicc->nssai_sst == nssai->sst) && sd_match)
+ bool sd_match = !nssai->sd || (ch_nssai.sd == *nssai->sd);
+ if ((ch_nssai.sst == nssai->sst) && sd_match)
return i;
}
return -1;
@@ -1864,12 +1892,18 @@ static void handle_registration_accept(nr_ue_nas_t *nas, const uint8_t *pdu_buff
send_nas_uplink_data_req(nas, &initialNasMsg);
LOG_I(NAS, "Send NAS_UPLINK_DATA_REQ message(RegistrationComplete)\n");
}
- if (get_user_nssai_idx(msg.nas_allowed_nssai, nas) < 0) {
- LOG_E(NAS, "NSSAI parameters not match with allowed NSSAI. Couldn't request PDU session.\n");
- } else {
- request_pdusession(nas, get_softmodem_params()->default_pdu_session_id);
- if (get_nrUE_params()->extra_pdu_id != -1) {
- request_pdusession(nas, get_nrUE_params()->extra_pdu_id);
+ if (nas->uicc->n_pdu_sessions == 0)
+ LOG_W(SIM, "no PDU sessions to request configured\n");
+ for (const pdu_session_config_t *pdu = nas->uicc->pdu_sessions; pdu < nas->uicc->pdu_sessions + nas->uicc->n_pdu_sessions; ++pdu) {
+ if (get_user_nssai_idx(pdu->nssai, msg.nas_allowed_nssai) < 0) {
+ LOG_E(NAS,
+ "PDU session ID %d NSSAI %d.%d: mismatch for allowed NSSAI. Couldn't request PDU session.\n",
+ pdu->id,
+ pdu->nssai.sst,
+ pdu->nssai.sd);
+ } else {
+ LOG_I(NAS, "requested PDU session ID %d type %d NSSAI %d.%d DNN %s\n", pdu->id, pdu->type, pdu->nssai.sst, pdu->nssai.sd, pdu->dnn);
+ request_pdusession(nas, pdu);
}
}
// Free local message after processing
@@ -2017,7 +2051,7 @@ void *nas_nrue(void *args_p)
if (msg_type == FGS_REGISTRATION_ACCEPT) {
handle_registration_accept(nas, ba.buf, ba.len);
} else if (msg_type == FGS_PDU_SESSION_ESTABLISHMENT_ACC) {
- handle_pdu_session_accept(ba.buf, ba.len, nas->UE_id);
+ handle_pdu_session_accept(nas, ba.buf, ba.len, nas->UE_id);
}
// Free NAS buffer memory after use (coming from RRC)
@@ -2103,7 +2137,7 @@ void *nas_nrue(void *args_p)
handle_security_mode_command(nas, &initialNasMsg, pdu_buffer, pdu_length);
break;
case FGS_DOWNLINK_NAS_TRANSPORT:
- handleDownlinkNASTransport(pdu_buffer, pdu_length, nas->UE_id);
+ handleDownlinkNASTransport(nas, pdu_buffer, pdu_length, nas->UE_id);
break;
case FGS_REGISTRATION_ACCEPT:
handle_registration_accept(nas, pdu_buffer, pdu_length);
@@ -2114,7 +2148,7 @@ void *nas_nrue(void *args_p)
nas->fiveGMM_state = FGS_DEREGISTERED;
break;
case FGS_PDU_SESSION_ESTABLISHMENT_ACC:
- handle_pdu_session_accept(pdu_buffer, pdu_length, nas->UE_id);
+ handle_pdu_session_accept(nas, pdu_buffer, pdu_length, nas->UE_id);
break;
case FGS_PDU_SESSION_ESTABLISHMENT_REJ:
LOG_E(NAS, "Received PDU Session Establishment reject\n");
@@ -2159,10 +2193,11 @@ void *nas_nrue(void *args_p)
} break;
case NAS_INIT_NOS1_IF: {
- const int pdu_session_id = get_softmodem_params()->default_pdu_session_id;
+ const int pdu_session_id = DEFAULT_NOS1_PDU_ID;
const char *ip = "10.0.1.2";
const int qfi = 7;
- create_ue_ip_if(ip, NULL, nas->UE_id, pdu_session_id);
+ const bool is_default = true;
+ create_ue_ip_if(ip, NULL, nas->UE_id, pdu_session_id, is_default);
set_qfi(qfi, pdu_session_id, nas->UE_id);
break;
}
diff --git a/openair3/NAS/NR_UE/nr_nas_msg.h b/openair3/NAS/NR_UE/nr_nas_msg.h
index 7a19997444..f5e6b4db59 100644
--- a/openair3/NAS/NR_UE/nr_nas_msg.h
+++ b/openair3/NAS/NR_UE/nr_nas_msg.h
@@ -32,6 +32,7 @@
#define __NR_NAS_MSG_SIM_H__
#include
+#include "common/5g_platform_types.h"
#include
#include
#include
@@ -42,10 +43,7 @@
#define INITIAL_REGISTRATION 0b001
-#define PLAIN_5GS_NAS_MESSAGE_HEADER_LENGTH 3
#define SECURITY_PROTECTED_5GS_NAS_MESSAGE_HEADER_LENGTH 7
-#define PAYLOAD_CONTAINER_LENGTH_MIN 3
-#define PAYLOAD_CONTAINER_LENGTH_MAX 65537
#define NAS_INTEGRITY_SIZE 4
/* 3GPP TS 24.501: 9.11.3.50 Service type */
@@ -113,6 +111,6 @@ void *nas_nrue_task(void *args_p);
void *nas_nrue(void *args_p);
void nas_init_nrue(int num_ues);
void nr_ue_create_ip_if(const char *ifnameprefix, const char *ipv4, const char *ipv6, int ue_id, int pdu_session_id);
-void request_pdusession(nr_ue_nas_t *nas, int pdusession_id);
+void request_pdusession(nr_ue_nas_t *nas, const pdu_session_config_t *pdu);
#endif /* __NR_NAS_MSG_SIM_H__*/
diff --git a/openair3/NAS/TOOLS/conf_network.h b/openair3/NAS/TOOLS/conf_network.h
index a535841a4c..a9d738148e 100644
--- a/openair3/NAS/TOOLS/conf_network.h
+++ b/openair3/NAS/TOOLS/conf_network.h
@@ -12,9 +12,6 @@
#define MNC "MNC"
#define MCC "MCC"
-#define MIN_TAC 0x0000
-#define MAX_TAC 0xFFFE
-
/*
* PLMN network operator record
*/
diff --git a/openair3/NAS/UE/API/USER/at_command.h b/openair3/NAS/UE/API/USER/at_command.h
index 658dbc7a08..7358eb1f64 100644
--- a/openair3/NAS/UE/API/USER/at_command.h
+++ b/openair3/NAS/UE/API/USER/at_command.h
@@ -59,12 +59,6 @@ Description Defines the ATtention (AT) command set supported by the NAS
#define AT_COMMAND_PARAM8 0x0080 /* 8th parameter is present */
#define AT_COMMAND_PARAM9 0x0100 /* 9th parameter is present */
#define AT_COMMAND_PARAM10 0x0200 /* 10th parameter is present */
-#define AT_COMMAND_PARAM11 0x0400 /* 11th parameter is present */
-#define AT_COMMAND_PARAM12 0x0800 /* 12th parameter is present */
-#define AT_COMMAND_PARAM13 0x1000 /* 13th parameter is present */
-#define AT_COMMAND_PARAM14 0x2000 /* 14th parameter is present */
-#define AT_COMMAND_PARAM15 0x4000 /* 15th parameter is present */
-#define AT_COMMAND_PARAM16 0x8000 /* 16th parameter is present */
/* Value of the mask parameter for AT commands without any parameters */
#define AT_COMMAND_NO_PARAM AT_COMMAND_PARAM0
@@ -249,8 +243,6 @@ typedef struct at_cimi_s {
/* Functionality levels */
#define AT_CFUN_MIN 0 /* minimum functionality */
#define AT_CFUN_FULL 1 /* full functionality */
-#define AT_CFUN_SEND 2 /* disable phone transmit RF circuits only */
-#define AT_CFUN_RECV 3 /* disable phone receive RF circuits only */
#define AT_CFUN_BOTH 4 /* disable phone both transmit and receive
* RF circuits */
#define AT_CFUN_MAX AT_CFUN_BOTH
@@ -265,7 +257,6 @@ typedef struct at_cimi_s {
* is not given) */
#define AT_CFUN_RST 1 /* reset the ME before setting it to
* power level */
-#define AT_CFUN_RST_DEFAULT AT_CFUN_NORST
/* Default resetting action applied when
* no value is given */
/* Optional parameter bitmask */
@@ -468,12 +459,6 @@ typedef struct {
* no value is given */
/* Access technology indicators */
#define AT_COPS_GSM NET_ACCESS_GSM /* GSM */
-#define AT_COPS_COMPACT NET_ACCESS_COMPACT /* GSM Compact */
-#define AT_COPS_UTRAN NET_ACCESS_UTRAN /* UTRAN */
-#define AT_COPS_EGPRS NET_ACCESS_EGPRS /* GSM w/EGPRS */
-#define AT_COPS_HSDPA NET_ACCESS_HSDPA /* UTRAN w/HSDPA */
-#define AT_COPS_HSUPA NET_ACCESS_HSUPA /* UTRAN w/HSUPA */
-#define AT_COPS_HSDUPA NET_ACCESS_HSDUPA /* w/HSDPA and HSUPA */
#define AT_COPS_EUTRAN NET_ACCESS_EUTRAN /* E-UTRAN */
#define AT_COPS_ACT_MIN AT_COPS_GSM
/* Minimum value of supported access
@@ -675,21 +660,15 @@ typedef struct {
#define AT_CGDCONT_CID_DEFAULT AT_CGDCONT_CID_MIN
/* PDP data compression parameter values */
#define AT_CGDCONT_D_COMP_OFF 0 /* PDP data compression is disabled */
-#define AT_CGDCONT_D_COMP_ON 1 /* manufacturer preferred compression */
-#define AT_CGDCONT_D_COMP_V42B 2 /* V.42bis */
#define AT_CGDCONT_D_COMP_V44 3 /* V.44 */
#define AT_CGDCONT_D_COMP_MIN AT_CGDCONT_D_COMP_OFF
#define AT_CGDCONT_D_COMP_MAX AT_CGDCONT_D_COMP_V44
-#define AT_CGDCONT_D_COMP_DEFAULT AT_CGDCONT_D_COMP_OFF
/* PDP header compression parameter values */
#define AT_CGDCONT_H_COMP_OFF 0 /* PDP header compression is disabled */
-#define AT_CGDCONT_H_COMP_ON 1 /* manufacturer preferred compression */
#define AT_CGDCONT_H_COMP_1144 2 /* RFC1144 (applicable for SNDCP only) */
-#define AT_CGDCONT_H_COMP_2507 3 /* RFC2507 */
#define AT_CGDCONT_H_COMP_3095 4 /* RFC3095 (applicable for PDCP only) */
#define AT_CGDCONT_H_COMP_MIN AT_CGDCONT_H_COMP_OFF
#define AT_CGDCONT_H_COMP_MAX AT_CGDCONT_H_COMP_3095
-#define AT_CGDCONT_H_COMP_DEFAULT AT_CGDCONT_H_COMP_OFF
/* IPv4AddrAlloc parameter values */
#define AT_CGDCONT_IPV4_NAS 0 /* IPv4 Address Allocation through NAS
* Signalling */
@@ -708,8 +687,6 @@ typedef struct {
/* P_CSCF_discovery parameter values */
#define AT_CGDCONT_PCSCF_OFF 0 /* Preference of P-CSCF address discovery
* not influenced by +CGDCONTPDP */
-#define AT_CGDCONT_PCSCF_NAS 1 /* Preference of P-CSCF address discovery
- * through NAS Signalling */
#define AT_CGDCONT_PCSCF_DHCP 2 /* Preference of P-CSCF address discovery
* through DHCP */
#define AT_CGDCONT_PCSCF_MIN AT_CGDCONT_PCSCF_OFF
diff --git a/openair3/NAS/UE/API/USIM/usim_api.h b/openair3/NAS/UE/API/USIM/usim_api.h
index e1b379c050..b83ed28f66 100644
--- a/openair3/NAS/UE/API/USIM/usim_api.h
+++ b/openair3/NAS/UE/API/USIM/usim_api.h
@@ -52,7 +52,6 @@ Description Implements the API used by the NAS layer to read/write
* Subscriber authentication security key
*/
#define USIM_API_K_SIZE 16
-#define USIM_API_K_VALUE "fec86ba6eb707ed08905757b1bb44b8f"
/*
* The name of the file where are stored data of the USIM application
@@ -156,7 +155,6 @@ typedef struct {
*/
typedef struct {
/* Length of all subsequent data */
-#define USIM_EPS_NAS_SECURITY_CONTEXT_TAG 0xA0U
uint8_t length;
/* Key set identifier KSI_ASME */
#define USIM_KSI_ASME_TAG 0x80U
diff --git a/openair3/NAS/UE/EMM/SAP/emm_fsm.c b/openair3/NAS/UE/EMM/SAP/emm_fsm.c
index 5a715727ad..edfd9c05ae 100644
--- a/openair3/NAS/UE/EMM/SAP/emm_fsm.c
+++ b/openair3/NAS/UE/EMM/SAP/emm_fsm.c
@@ -44,19 +44,6 @@ Description Defines the EPS Mobility Management procedures executed at
#include "emmData.h"
#include "user_defs.h"
-
-
-
-/****************************************************************************/
-/**************** E X T E R N A L D E F I N I T I O N S ****************/
-/****************************************************************************/
-
-#define EMM_FSM_NB_UE_MAX 1
-
-/****************************************************************************/
-/******************* L O C A L D E F I N I T I O N S *******************/
-/****************************************************************************/
-
/*
* -----------------------------------------------------------------------------
* Data used for trace logging
diff --git a/openair3/NAS/UE/EMM/SAP/emm_sap.h b/openair3/NAS/UE/EMM/SAP/emm_sap.h
index 98088a66f3..50d42d4f10 100644
--- a/openair3/NAS/UE/EMM/SAP/emm_sap.h
+++ b/openair3/NAS/UE/EMM/SAP/emm_sap.h
@@ -123,7 +123,6 @@ typedef enum {
#define EMMREG_PRIMITIVE_MIN _EMMREG_START
#define EMMESM_PRIMITIVE_MIN _EMMESM_START
#define EMMAS_PRIMITIVE_MIN _EMMAS_START
-#define EMMCN_PRIMITIVE_MIN _EMMCN_START
/*
* Maximal identifier for EMM-SAP primitives
@@ -131,7 +130,6 @@ typedef enum {
#define EMMREG_PRIMITIVE_MAX _EMMREG_END
#define EMMESM_PRIMITIVE_MAX _EMMESM_END
#define EMMAS_PRIMITIVE_MAX _EMMAS_END
-#define EMMCN_PRIMITIVE_MAX _EMMCN_END
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
diff --git a/openair3/NAS/UE/ESM/esm_ebr_context.c b/openair3/NAS/UE/ESM/esm_ebr_context.c
index cec4c268bd..63cfabbac4 100644
--- a/openair3/NAS/UE/ESM/esm_ebr_context.c
+++ b/openair3/NAS/UE/ESM/esm_ebr_context.c
@@ -45,7 +45,7 @@ Description Defines functions used to handle EPS bearer contexts.
#include "esm_ebr.h"
#include "esm_ebr_context.h"
-#include "common/utils/tun_if.h"
+#include "common/utils/tuntap_if.h"
#include "emm_sap.h"
#include "system.h"
diff --git a/openair3/NGAP/ngap_common.h b/openair3/NGAP/ngap_common.h
index 9afaf47c4b..986a7b59bf 100644
--- a/openair3/NGAP/ngap_common.h
+++ b/openair3/NGAP/ngap_common.h
@@ -46,8 +46,6 @@
# error "You are compiling ngap with the wrong version of ASN1C"
#endif
-#define NGAP_UE_ID_FMT "0x%06"PRIX32
-
# include "common/utils/LOG/log.h"
# include "ngap_gNB_default_values.h"
# define NGAP_ERROR(x, args...) LOG_E(NGAP, x, ##args)
diff --git a/openair3/NGAP/ngap_gNB_decoder.c b/openair3/NGAP/ngap_gNB_decoder.c
index 481cccf876..43110e9037 100644
--- a/openair3/NGAP/ngap_gNB_decoder.c
+++ b/openair3/NGAP/ngap_gNB_decoder.c
@@ -76,6 +76,12 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) {
NGAP_INFO("Handover Preparation initiating message\n");
break;
+ case NGAP_ProcedureCode_id_HandoverCancel:
+ res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
+ free(res.buffer);
+ NGAP_INFO("Handover Cancel initiating message\n");
+ break;
+
case NGAP_ProcedureCode_id_PDUSessionResourceModify:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
diff --git a/openair3/NGAP/ngap_gNB_encoder.c b/openair3/NGAP/ngap_gNB_encoder.c
index be3945c2f0..ff318ed184 100644
--- a/openair3/NGAP/ngap_gNB_encoder.c
+++ b/openair3/NGAP/ngap_gNB_encoder.c
@@ -55,6 +55,7 @@ static inline int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu, uint8_t **buf
NGAP_ProcedureCode_id_PDUSessionResourceModifyIndication,
NGAP_ProcedureCode_id_UplinkRANStatusTransfer,
NGAP_ProcedureCode_id_HandoverPreparation,
+ NGAP_ProcedureCode_id_HandoverCancel,
NGAP_ProcedureCode_id_HandoverNotification};
int i;
for (i = 0; i < sizeofArray(tmp); i++)
diff --git a/openair3/S1AP/s1ap_common.h b/openair3/S1AP/s1ap_common.h
index 7ef7e589ca..93993c8d77 100644
--- a/openair3/S1AP/s1ap_common.h
+++ b/openair3/S1AP/s1ap_common.h
@@ -50,8 +50,6 @@
# error "You are compiling s1ap with the wrong version of ASN1C"
#endif
-#define S1AP_UE_ID_FMT "0x%06"PRIX32
-
#include "common/utils/LOG/log.h"
#include "s1ap_eNB_default_values.h"
#define S1AP_ERROR(x, args...) LOG_E(S1AP, x, ##args)
diff --git a/openair3/SECU/nas_stream_eia2.c b/openair3/SECU/nas_stream_eia2.c
index ee19a8f603..8a050b3377 100644
--- a/openair3/SECU/nas_stream_eia2.c
+++ b/openair3/SECU/nas_stream_eia2.c
@@ -32,8 +32,6 @@
#include "assertions.h"
#include "conversions.h"
-#define SECU_DEBUG
-
/*!
* @brief Create integrity cmac t for a given message.
* @param[in] stream_cipher Structure containing various variables to setup encoding
diff --git a/openair3/UICC/CMakeLists.txt b/openair3/UICC/CMakeLists.txt
index c80694e1a5..3e72949a1b 100644
--- a/openair3/UICC/CMakeLists.txt
+++ b/openair3/UICC/CMakeLists.txt
@@ -1,3 +1,3 @@
-add_library(lib_uicc OBJECT usim_interface.c)
+add_library(lib_uicc OBJECT usim_interface.c pdu_session.c)
target_include_directories(lib_uicc PRIVATE .)
target_link_libraries(lib_uicc PRIVATE log_headers)
diff --git a/openair3/UICC/pdu_session.c b/openair3/UICC/pdu_session.c
new file mode 100644
index 0000000000..1eabeb7f37
--- /dev/null
+++ b/openair3/UICC/pdu_session.c
@@ -0,0 +1,116 @@
+/*
+ * 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
+
+#include "pdu_session.h"
+// we can't include the file for PDU session type defines, as it pulls in too
+// much. However, we only use it for mapping types to integers, which are
+// standard defined, so it should be ok.
+//#include "openair3/NAS/NR_UE/5GS/5GSM/MSG/PduSessionEstablishmentAccept.h"
+#include "common/utils/utils.h"
+#include "common/config/config_paramdesc.h"
+#include "common/config/config_userapi.h"
+
+
+// clang-format off
+// Note: Default PDU session ID 0 does not exist and will be replaced with PDU
+// session index if not set to a parameter > 0!
+#define PDU_SESS_PARAMS_DESC { \
+ {"id", "PDU session ID\n", 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \
+ {"type", "PDU session type\n", 0, .strptr=NULL, .defstrval="IPv4", TYPE_STRING, 0}, \
+ {"nssai_sst", "NSSAI slice type\n", 0, .u8ptr=NULL, .defintval=1, TYPE_UINT8, 0}, \
+ {"nssai_sd", "NSSAI slice differentiator\n", 0, .uptr=NULL, .defintval=0xffffff, TYPE_UINT32, 0}, \
+ {"dnn", "PDU session DNN (APN)\n", 0, .strptr=NULL, .defstrval="oai", TYPE_STRING, 0}, \
+}
+
+#define PDU_SESS_PARAMS_CHECK { \
+ {.s2 = {config_check_intrange, {0, 255}}}, \
+ {.s3a = {config_checkstr_assign_integer, \
+ {"IPv4", "IPv6", "IPv4v6", "Ethernet"}, \
+ {1 /*PDU_SESSION_TYPE_IPV4*/, \
+ 2 /*PDU_SESSION_TYPE_IPV6*/, \
+ 3 /*PDU_SESSION_TYPE_IPV4V6*/, \
+ 5 /*PDU_SESSION_TYPE_ETHER*/}, \
+ 4}}, \
+ {.s2 = {config_check_intrange, {1, 4}}}, \
+ {.s2 = {config_check_intrange, {1, 0xffffff}}}, \
+ {.s4 = {config_check_dnn}}, \
+}
+// clang-format on
+
+static int config_check_dnn(configmodule_interface_t *cfg, paramdef_t *param)
+{
+ const char *dnn = *param->strptr;
+ int dnn_len = strlen(dnn);
+ if (dnn_len > 102) {
+ printf("DNN '%s' exceeds max len of 102 (is %d) (TS 24.501 §9.11.2.1A)\n", dnn, dnn_len);
+ return -1;
+ }
+
+ // check for valid characters in the APN (TS 23.003 §9.1)
+ // we don't enforce all conditions
+ const char *allowed = "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789.-";
+ while (*dnn) {
+ if (!strchr(allowed, *dnn)) {
+ printf("character '%c' in DNN '%s' is not allowed (TS 23.003 §9.1)\n", *dnn, *param->strptr);
+ return -1;
+ }
+ dnn++;
+ }
+
+ return 0;
+}
+
+int get_pdu_session_configs(const char *uiccName, pdu_session_config_t *configs, int max_len)
+{
+ paramdef_t pdu_sess_params[] = PDU_SESS_PARAMS_DESC;
+ const int npsp = sizeofArray(pdu_sess_params);
+ paramlist_def_t pdu_sess_list = {"pdu_sessions"};
+ checkedparam_t pdu_sess_params_check[] = PDU_SESS_PARAMS_CHECK;
+ static_assert(sizeofArray(pdu_sess_params) == sizeofArray(pdu_sess_params_check),
+ "param_def_t array and corresponding checkedparam_t array should have the same size");
+ for (int i = 0; i < sizeofArray(pdu_sess_params); ++i)
+ pdu_sess_params[i].chkPptr = &pdu_sess_params_check[i];
+ int ret = config_getlist(config_get_if(), &pdu_sess_list, pdu_sess_params, sizeofArray(pdu_sess_params), uiccName);
+ if (ret < 0) {
+ // couldn't load configuration from pdu_sessions, caller has to handle
+ return -1;
+ }
+
+ int num = pdu_sess_list.numelt;
+ AssertFatal(num <= max_len, "cannot handle more than %d PDU sessions\n", max_len);
+
+ for (int i = 0; i < num; ++i) {
+ pdu_session_config_t *pdu = configs + i;
+ paramdef_t *p = pdu_sess_list.paramarray[i];
+ int id = *gpd(p, npsp, "id")->iptr;
+ pdu->id = id > 0 ? id : i + 1; // if not user-specified ID, use PDU session index
+ pdu->type = config_get_processedint(config_get_if(), (paramdef_t *)gpd(p, npsp, "type"));
+ pdu->nssai.sst = *gpd(p, npsp, "nssai_sst")->iptr;
+ pdu->nssai.sd = *gpd(p, npsp, "nssai_sd")->iptr;
+ pdu->dnn = strdup(*gpd(p, npsp, "dnn")->strptr);
+ }
+
+ return num;
+}
diff --git a/openair2/COMMON/rtos_header.h b/openair3/UICC/pdu_session.h
similarity index 76%
rename from openair2/COMMON/rtos_header.h
rename to openair3/UICC/pdu_session.h
index 05fc33463d..c1acaa82b1 100644
--- a/openair2/COMMON/rtos_header.h
+++ b/openair3/UICC/pdu_session.h
@@ -19,14 +19,18 @@
* contact@openairinterface.org
*/
-#ifndef _RTOS_HEADER_H_
-#define _RTOS_HEADER_H_
-#include
-#include
-#include
-#include
-#include
-#include
-#define rtf_get read
-#define rtf_put write
-#endif
+#ifndef PDU_SESSION_H_
+#define PDU_SESSION_H_
+
+#include "common/5g_platform_types.h"
+
+typedef struct {
+ int id;
+ int type;
+ nssai_t nssai;
+ char *dnn; // [103]?
+} pdu_session_config_t;
+
+int get_pdu_session_configs(const char *uiccName, pdu_session_config_t *configs, int max_len);
+
+#endif /* PDU_SESSION_H_ */
diff --git a/openair3/UICC/usim_interface.c b/openair3/UICC/usim_interface.c
index f1019366b1..b32a84319c 100644
--- a/openair3/UICC/usim_interface.c
+++ b/openair3/UICC/usim_interface.c
@@ -22,11 +22,11 @@
*/
#include
+#include "common/platform_constants.h"
#include
#include
extern uint16_t NB_UE_INST;
-#define UICC_SECTION "uicc"
#define IMEISV_STR_MAX_LENGTH 16
#define UICC_CONFIG_HELP_OPTIONS " list of comma separated options to interface a simulated (real UICC to be developped). Available options: \n"\
" imsi: user imsi\n"\
@@ -76,10 +76,7 @@ uicc_t *init_uicc(char *sectionName) {
// key, OPc, sqn, amf don't need to be read from the true USIM
int ret = config_get(config_get_if(), uicc_params, sizeofArray(uicc_params), sectionName);
AssertFatal(ret >= 0, "configuration couldn't be performed for uicc name: %s", sectionName);
- LOG_I(SIM,
- "UICC simulation: IMSI=%s, IMEISV=%s, Ki=%s, OPc=%s, DNN=%s, SST=0x%02x, SD=0x%06x\n",
- uicc->imsiStr, uicc->imeisvStr, uicc->keyStr, uicc->opcStr,
- uicc->dnnStr, uicc->nssai_sst, uicc->nssai_sd);
+ LOG_I(SIM, "UICC simulation: IMSI=%s, IMEISV=%s, Ki=%s, OPc=%s\n", uicc->imsiStr, uicc->imeisvStr, uicc->keyStr, uicc->opcStr);
to_hex(uicc->keyStr,uicc->key, sizeof(uicc->key) );
to_hex(uicc->opcStr,uicc->opc, sizeof(uicc->opc) );
to_hex(uicc->sqnStr,uicc->sqn, sizeof(uicc->sqn) );
@@ -112,6 +109,36 @@ uicc_t * checkUicc(int Mod_id) {
char uiccName[64];
sprintf(uiccName,"uicc%d", Mod_id);
uiccArray[Mod_id]=(void*)init_uicc(uiccName);
+ uicc_t *uicc = uiccArray[Mod_id];
+ uicc->n_pdu_sessions = get_pdu_session_configs(uiccName, uicc->pdu_sessions, sizeof(uicc->pdu_sessions));
+ if (uicc->n_pdu_sessions > 0) {
+ LOG_I(SIM, "overriding potential %s.dnn/nssai_sst/nssai_sd from %s.pdu_sessions\n", uiccName, uiccName);
+ } else if (uicc->n_pdu_sessions < 0) {
+ // we could not load from "new" pdu_sessions list, so read from "legacy"
+ // config
+ LOG_W(SIM,
+ "loading PDU session parameters from legacy UICC configuration. Please update to use %s.pdu_sessions instead to make this warning disappear\n",
+ uiccName);
+ sleep(3);
+ uicc->n_pdu_sessions = 1;
+ pdu_session_config_t *pdu = &uicc->pdu_sessions[0];
+ AssertFatal(uicc->dnnStr != NULL, "no default DNN, cannot create\n");
+ pdu->id = DEFAULT_NOS1_PDU_ID; // any default would do
+ pdu->dnn = strdup(uicc->dnnStr);
+ pdu->nssai.sst = uicc->nssai_sst;
+ pdu->nssai.sd = uicc->nssai_sd;
+ pdu->type = 1; /* = PDU_SESSION_TYPE_IPV4 */
+ } // else: uicc->n_pdu_sessions == 0 => don't request a PDU session
+ for (int i = 0; i < uicc->n_pdu_sessions; ++i) {
+ const pdu_session_config_t *pdu = &uicc->pdu_sessions[i];
+ LOG_I(SIM,
+ "will request PDU session ID %d, type %d, DNN %s, NSSAI %d.%6x\n",
+ pdu->id,
+ pdu->type,
+ pdu->dnn,
+ pdu->nssai.sst,
+ pdu->nssai.sd);
+ }
}
return (uicc_t*) uiccArray[Mod_id];
}
diff --git a/openair3/UICC/usim_interface.h b/openair3/UICC/usim_interface.h
index 1a275db887..f4689594c2 100644
--- a/openair3/UICC/usim_interface.h
+++ b/openair3/UICC/usim_interface.h
@@ -34,6 +34,7 @@
#include
#include
#include "common_lib.h"
+#include "pdu_session.h"
/* 3GPP glossary
RES RESponse
@@ -53,6 +54,8 @@ typedef struct {
char *dnnStr;
int nssai_sst;
int nssai_sd;
+ pdu_session_config_t pdu_sessions[256];
+ int n_pdu_sessions;
uint8_t key[16];
uint8_t opc[16];
uint8_t amf[2];
diff --git a/openair3/UTILS/conversions.h b/openair3/UTILS/conversions.h
index 31a479cab6..ec65f1727a 100644
--- a/openair3/UTILS/conversions.h
+++ b/openair3/UTILS/conversions.h
@@ -561,6 +561,5 @@ do { \
#define TAC_TO_ASN1 INT16_TO_OCTET_STRING
#define GTP_TEID_TO_ASN1 INT32_TO_OCTET_STRING
-#define OCTET_STRING_TO_TAC OCTET_STRING_TO_INT16
#endif /* CONVERSIONS_H_ */
diff --git a/radio/AW2SORI/oaiori.c b/radio/AW2SORI/oaiori.c
index 8665abc86a..b17c7e5dfd 100644
--- a/radio/AW2SORI/oaiori.c
+++ b/radio/AW2SORI/oaiori.c
@@ -212,8 +212,8 @@ void cb(void * userData, ORI_IndicationType_e type, ORI_IndicationValue_u value)
printf("<============\n");
}
-int aw2s_oricleanup(openair0_device *device) {
-
+int aw2s_oricleanup(openair0_device_t *device)
+{
ORI_s * ori = (ORI_s*)device->thirdparty_priv;
ORI_Disconnect(ori);
@@ -222,8 +222,8 @@ int aw2s_oricleanup(openair0_device *device) {
return(0);
}
-int aw2s_startstreaming(openair0_device *device) {
-
+int aw2s_startstreaming(openair0_device_t *device)
+{
ORI_s * ori = (ORI_s*)device->thirdparty_priv;
ORI_Result_e result;
ORI_Result_e RE_result;
@@ -413,9 +413,8 @@ int aw2s_startstreaming(openair0_device *device) {
printf("ORI_ObjectStateModify: %s\n", ORI_Result_Print(RE_result));
}
- device->fhstate.active=1;
- return(0);
-
+ device->fhstate.active = 1;
+ return (0);
}
uint32_t to_nrarfcn(int nr_bandP,
@@ -423,9 +422,8 @@ uint32_t to_nrarfcn(int nr_bandP,
uint8_t scs_index,
uint32_t bw);
-int aw2s_oriinit(openair0_device *device) {
-
-
+int aw2s_oriinit(openair0_device_t *device)
+{
ORI_s * ori;
ORI_Result_e result;
ORI_Result_e RE_result;
@@ -892,9 +890,8 @@ int aw2s_oriinit(openair0_device *device) {
return 0;
}
-
-int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params ) {
-
+int transport_init(openair0_device_t *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params)
+{
printf("Initializing AW2S (%p,%p,%p)\n",aw2s_oriinit,aw2s_oricleanup,aw2s_startstreaming);
device->thirdparty_init = aw2s_oriinit;
device->thirdparty_cleanup = aw2s_oricleanup;
diff --git a/radio/BLADERF/bladerf_lib.c b/radio/BLADERF/bladerf_lib.c
index bff12bee8e..2298287b5a 100644
--- a/radio/BLADERF/bladerf_lib.c
+++ b/radio/BLADERF/bladerf_lib.c
@@ -46,7 +46,7 @@ int num_devices=0;
* \param device RF frontend parameters set by application
* \returns 0 on success
*/
-int trx_brf_init(openair0_device *device)
+int trx_brf_init(openair0_device_t *device)
{
return 0;
}
@@ -57,8 +57,7 @@ int trx_brf_init(openair0_device *device)
*\param module the bladeRf module
*\returns timestamp of BladeRF
*/
-openair0_timestamp trx_get_timestamp(openair0_device *device,
- bladerf_module module)
+openair0_timestamp_t trx_get_timestamp(openair0_device_t *device, bladerf_module module)
{
int status;
struct bladerf_metadata meta;
@@ -78,7 +77,7 @@ openair0_timestamp trx_get_timestamp(openair0_device *device,
* \param device the hardware to use
* \returns 0 on success
*/
-int trx_brf_start(openair0_device *device)
+int trx_brf_start(openair0_device_t *device)
{
brf_state_t *brf = (brf_state_t*)device->priv;
int status;
@@ -127,12 +126,7 @@ int trx_brf_start(openair0_device *device)
\param flags Ignored for the moment
\returns 0 on success
*/
-static int trx_brf_write(openair0_device *device,
- openair0_timestamp ptimestamp,
- void **buff,
- int nsamps,
- int cc,
- int flags)
+static int trx_brf_write(openair0_device_t *device, openair0_timestamp_t ptimestamp, void **buff, int nsamps, int cc, int flags)
{
int status;
brf_state_t *brf = (brf_state_t*)device->priv;
@@ -185,11 +179,7 @@ static int trx_brf_write(openair0_device *device,
* \param cc Index of component carrier
* \returns number of samples read
*/
-static int trx_brf_read(openair0_device *device,
- openair0_timestamp *ptimestamp,
- void **buff,
- int nsamps,
- int cc)
+static int trx_brf_read(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int cc)
{
int status=0;
brf_state_t *brf = (brf_state_t*)device->priv;
@@ -235,7 +225,7 @@ static int trx_brf_read(openair0_device *device,
/*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources
* \param device the hardware to use
*/
-void trx_brf_end(openair0_device *device)
+void trx_brf_end(openair0_device_t *device)
{
int status;
brf_state_t *brf = (brf_state_t*)device->priv;
@@ -255,7 +245,7 @@ void trx_brf_end(openair0_device *device)
* \param device the hardware to use
* \returns 0 on success
*/
-int trx_brf_get_stats(openair0_device* device)
+int trx_brf_get_stats(openair0_device_t *device)
{
return(0);
}
@@ -265,7 +255,7 @@ int trx_brf_get_stats(openair0_device* device)
* \param device the hardware to use
* \returns 0 on success
*/
-int trx_brf_reset_stats(openair0_device* device)
+int trx_brf_reset_stats(openair0_device_t *device)
{
return(0);
}
@@ -275,7 +265,7 @@ int trx_brf_reset_stats(openair0_device* device)
* \param card the hardware to use
* \returns 0 in success
*/
-int trx_brf_stop(openair0_device* device)
+int trx_brf_stop(openair0_device_t *device)
{
return(0);
}
@@ -286,7 +276,7 @@ int trx_brf_stop(openair0_device* device)
* \param openair0_cfg1 openair0 Config structure (ignored. It is there to comply with RF common API)
* \returns 0 in success
*/
-int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1)
+int trx_brf_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg1)
{
int status;
brf_state_t *brf = (brf_state_t *)device->priv;
@@ -315,12 +305,11 @@ int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1)
* \param openair0_cfg openair0 Config structure
* \returns 0 in success
*/
-int trx_brf_set_gains(openair0_device* device,
- openair0_config_t *openair0_cfg)
+int trx_brf_set_gains(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
return(0);
}
-int trx_brf_write_init(openair0_device *device)
+int trx_brf_write_init(openair0_device_t *device)
{
return 0;
}
@@ -368,13 +357,13 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg,
/*! \brief Calibrate LMSSDR RF
* \param device the hardware to use
*/
-void calibrate_rf(openair0_device *device)
+void calibrate_rf(openair0_device_t *device)
{
/* TODO: this function does not seem to work. Disabled until fixed. */
return;
brf_state_t *brf = (brf_state_t *)device->priv;
- openair0_timestamp ptimestamp;
+ openair0_timestamp_t ptimestamp;
int16_t *calib_buffp,*calib_tx_buffp;
int16_t calib_buff[2*RXDCLENGTH];
int16_t calib_tx_buff[2*RXDCLENGTH];
@@ -948,8 +937,7 @@ void calibrate_rf(openair0_device *device)
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 on success
*/
-int device_init(openair0_device *device,
- openair0_config_t *openair0_cfg)
+int device_init(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
int status;
brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t));
@@ -1138,7 +1126,7 @@ int device_init(openair0_device *device,
*/
bladerf_log_set_verbosity(BLADERF_LOG_LEVEL_INFO);
- printf("BLADERF: Initializing openair0_device\n");
+ printf("BLADERF: Initializing openair0_device_t\n");
device->Mod_id = num_devices++;
device->type = BLADERF_DEV;
device->trx_start_func = trx_brf_start;
diff --git a/radio/BLADERF/bladerf_lib.h b/radio/BLADERF/bladerf_lib.h
index 7c736eb098..a3ba44ee6c 100644
--- a/radio/BLADERF/bladerf_lib.h
+++ b/radio/BLADERF/bladerf_lib.h
@@ -94,7 +94,7 @@ typedef struct {
//! number of RX count
uint64_t rx_count;
//! timestamp of RX packet
- openair0_timestamp rx_timestamp;
+ openair0_timestamp_t rx_timestamp;
} brf_state_t;
/*
@@ -103,13 +103,13 @@ typedef struct {
/*! \brief BladeRF Init function (not used at the moment)
* \param device RF frontend parameters set by application
*/
-int trx_brf_init(openair0_device *device);
+int trx_brf_init(openair0_device_t *device);
/*! \brief get current timestamp
*\param device the hardware to use
*\param module the bladeRf module
*/
-openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module);
+openair0_timestamp_t trx_get_timestamp(openair0_device_t *device, bladerf_module module);
/*! \brief bladeRF error report
* \param status
diff --git a/radio/COMMON/common_lib.c b/radio/COMMON/common_lib.c
index 670a9cc852..7b70dc20fa 100644
--- a/radio/COMMON/common_lib.c
+++ b/radio/COMMON/common_lib.c
@@ -53,7 +53,7 @@ const char *get_devname(int devtype) {
return "none";
}
-int set_device(openair0_device *device)
+int set_device(openair0_device_t *device)
{
const char *devname = get_devname(device->type);
if (strcmp(devname,"none") != 0) {
@@ -65,7 +65,7 @@ int set_device(openair0_device *device)
return 0;
}
-int set_transport(openair0_device *device)
+int set_transport(openair0_device_t *device)
{
switch (device->transp_type) {
case ETHERNET_TP:
@@ -85,14 +85,10 @@ int set_transport(openair0_device *device)
}
}
-typedef int(*devfunc_t)(openair0_device *, openair0_config_t *, eth_params_t *);
-
+typedef int (*devfunc_t)(openair0_device_t *, openair0_config_t *, eth_params_t *);
/* look for the interface library and load it */
-int load_lib(openair0_device *device,
- openair0_config_t *openair0_cfg,
- eth_params_t *cfg,
- uint8_t flag)
+int load_lib(openair0_device_t *device, openair0_config_t *openair0_cfg, eth_params_t *cfg, uint8_t flag)
{
loader_shlibfunc_t shlib_fdesc[1];
int ret=0;
@@ -139,9 +135,7 @@ int load_lib(openair0_device *device,
return ((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
}
-
-int openair0_device_load(openair0_device *device,
- openair0_config_t *openair0_cfg)
+int openair0_device_load(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
int rc=0;
rc=load_lib(device, openair0_cfg, NULL,RAU_LOCAL_RADIO_HEAD );
@@ -157,10 +151,7 @@ int openair0_device_load(openair0_device *device,
return rc;
}
-
-int openair0_transport_load(openair0_device *device,
- openair0_config_t *openair0_cfg,
- eth_params_t *eth_params)
+int openair0_transport_load(openair0_device_t *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params)
{
int rc;
rc=load_lib(device, openair0_cfg, eth_params, RAU_REMOTE_RADIO_HEAD);
@@ -175,7 +166,7 @@ int openair0_transport_load(openair0_device *device,
return rc;
}
-static void writerEnqueue(re_order_t *ctx, openair0_timestamp timestamp, void **txp, int nsamps, int nbAnt, int flags)
+static void writerEnqueue(re_order_t *ctx, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags)
{
pthread_mutex_lock(&ctx->mutex_store);
LOG_D(HW, "Enqueue write for TS: %lu\n", timestamp);
@@ -196,7 +187,10 @@ static void writerEnqueue(re_order_t *ctx, openair0_timestamp timestamp, void **
pthread_mutex_unlock(&ctx->mutex_store);
}
-static void writerProcessWaitingQueue(openair0_device *device)
+typedef struct PHY_VARS_NR_UE_s PHY_VARS_NR_UE;
+typedef int (*nrue_ru_write_t)(PHY_VARS_NR_UE *UE, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags);
+
+static void writerProcessWaitingQueue(nrue_ru_write_t nrue_ru_write, PHY_VARS_NR_UE *UE, openair0_device_t *device)
{
bool found = false;
re_order_t *ctx = &device->reOrder;
@@ -205,7 +199,7 @@ static void writerProcessWaitingQueue(openair0_device *device)
pthread_mutex_lock(&ctx->mutex_store);
for (int i = 0; i < WRITE_QUEUE_SZ; i++) {
if (ctx->queue[i].active && llabs(ctx->queue[i].timestamp - ctx->nextTS) < MAX_GAP) {
- openair0_timestamp timestamp = ctx->queue[i].timestamp;
+ openair0_timestamp_t timestamp = ctx->queue[i].timestamp;
LOG_D(HW, "Dequeue write for TS: %lu\n", timestamp);
int nsamps = ctx->queue[i].nsamps;
int nbAnt = ctx->queue[i].nbAnt;
@@ -218,7 +212,11 @@ static void writerProcessWaitingQueue(openair0_device *device)
pthread_mutex_unlock(&ctx->mutex_store);
found = true;
if (flags || IS_SOFTMODEM_RFSIM) {
- int wroteSamples = device->trx_write_func(device, timestamp, txp, nsamps, nbAnt, flags);
+ int wroteSamples;
+ if (nrue_ru_write)
+ wroteSamples = nrue_ru_write(UE, timestamp, txp, nsamps, nbAnt, flags);
+ else
+ wroteSamples = device->trx_write_func(device, timestamp, txp, nsamps, nbAnt, flags);
if (wroteSamples != nsamps)
LOG_E(HW, "Failed to write to rf\n");
}
@@ -235,7 +233,14 @@ static void writerProcessWaitingQueue(openair0_device *device)
// but to make zerocopy and agnostic design, we need to make a proper ring buffer with mutex protection
// mutex (or atomic flags) will be mandatory because this out order system root cause is there are several writer threads
-int openair0_write_reorder(openair0_device *device, openair0_timestamp timestamp, void **txp, int nsamps, int nbAnt, int flags)
+int openair0_write_reorder_common(nrue_ru_write_t nrue_ru_write,
+ PHY_VARS_NR_UE *UE,
+ openair0_device_t *device,
+ openair0_timestamp_t timestamp,
+ void **txp,
+ int nsamps,
+ int nbAnt,
+ int flags)
{
int wroteSamples = 0;
re_order_t *ctx = &device->reOrder;
@@ -249,28 +254,36 @@ int openair0_write_reorder(openair0_device *device, openair0_timestamp timestamp
if (pthread_mutex_trylock(&ctx->mutex_write) == 0) {
// We have the write exclusivity
if (llabs(timestamp - ctx->nextTS) < MAX_GAP) { // We are writing in sequence of the previous write
- if (flags || IS_SOFTMODEM_RFSIM)
- wroteSamples = device->trx_write_func(device, timestamp, txp, nsamps, nbAnt, flags);
- else
+ if (flags || IS_SOFTMODEM_RFSIM) {
+ if (nrue_ru_write)
+ wroteSamples = nrue_ru_write(UE, timestamp, txp, nsamps, nbAnt, flags);
+ else
+ wroteSamples = device->trx_write_func(device, timestamp, txp, nsamps, nbAnt, flags);
+ } else
wroteSamples = nsamps;
ctx->nextTS = timestamp + nsamps;
} else {
writerEnqueue(ctx, timestamp, txp, nsamps, nbAnt, flags);
}
- writerProcessWaitingQueue(device);
+ writerProcessWaitingQueue(nrue_ru_write, UE, device);
pthread_mutex_unlock(&ctx->mutex_write);
return wroteSamples ? wroteSamples : nsamps;
}
writerEnqueue(ctx, timestamp, txp, nsamps, nbAnt, flags);
if (pthread_mutex_trylock(&ctx->mutex_write) == 0) {
- writerProcessWaitingQueue(device);
+ writerProcessWaitingQueue(nrue_ru_write, UE, device);
pthread_mutex_unlock(&ctx->mutex_write);
}
return nsamps;
}
-void openair0_write_reorder_clear_context(openair0_device *device)
+int openair0_write_reorder(openair0_device_t *device, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags)
+{
+ return openair0_write_reorder_common(NULL, NULL, device, timestamp, txp, nsamps, nbAnt, flags);
+}
+
+void openair0_write_reorder_clear_context(openair0_device_t *device)
{
LOG_I(HW, "received write reorder clear context\n");
re_order_t *ctx = &device->reOrder;
diff --git a/radio/COMMON/common_lib.h b/radio/COMMON/common_lib.h
index 5877506ea2..f21a1ffff4 100644
--- a/radio/COMMON/common_lib.h
+++ b/radio/COMMON/common_lib.h
@@ -56,14 +56,13 @@
#define RAU_REMOTE_THIRDPARTY_RADIO_HEAD 2
#define MAX_WRITE_THREAD_PACKAGE 10
#define MAX_WRITE_THREAD_BUFFER_SIZE 8
-#define MAX_CARDS 8
-
-typedef int64_t openair0_timestamp;
-typedef volatile int64_t openair0_vtimestamp;
+#define MAX_CARDS 10
+typedef int64_t openair0_timestamp_t;
+typedef volatile int64_t openair0_vtimestamp_t;
/*!\brief structure holds the parameters to configure USRP devices*/
-typedef struct openair0_device_t openair0_device;
+typedef struct openair0_device openair0_device_t;
//#define USRP_GAIN_OFFSET (56.0) // 86 calibrated for USRP B210 @ 2.6 GHz to get equivalent RS EPRE in OAI to SMBV100 output
@@ -117,7 +116,6 @@ typedef enum {
MAX_TRANSP_TYPE
} transport_type_t;
-
/*!\brief openair0 device host type */
typedef enum {
MIN_HOST_TYPE = 0,
@@ -167,7 +165,7 @@ typedef enum {
/*! \brief Structure used for initializing UDP read threads */
typedef struct {
- openair0_device *device;
+ openair0_device_t *device;
int thread_id;
pthread_t pthread;
notifiedFIFO_t *resp;
@@ -211,16 +209,12 @@ typedef struct split7_config {
/*! \brief RF frontend parameters set by application */
typedef struct openair0_config {
- //! Module ID for this configuration
- int Mod_id;
+ //! RU ID of this device
+ int ru_id;
//! duplexing mode
duplex_mode_t duplex_mode;
//! number of downlink resource blocks
- int num_rb_dl;
- //! number of samples per frame
- unsigned int samples_per_frame;
- //! the sample rate for both transmit and receive.
- double sample_rate;
+ int num_rb_dl; double sample_rate;
//! flag to indicate that the device is doing mmapped DMA transfers
int mmapped_dma;
//! offset in samples between TX and RX paths
@@ -254,8 +248,6 @@ typedef struct openair0_config {
//! \brief memory
//! \brief Pointer to Calibration table for RX gains
rx_gain_calib_table_t *rx_gain_calib_table;
- //! mode for rxgain (ExpressMIMO2)
- rx_gain_t rxg_mode[8];
//! \brief Gain for RX in dB.
//! index: [0..rx_num_channels]
double rx_gain[8];
@@ -278,23 +270,9 @@ typedef struct openair0_config {
int autocal[8];
//! Configuration file for LMS7002M
char *configFilename;
- //! remote IP/MAC addr for Ethernet interface
- char *remote_addr;
- //! remote port number for Ethernet interface
- unsigned int remote_port;
- //! local IP/MAC addr for Ethernet interface (eNB/BBU, UE)
- char *my_addr;
- //! local port number for Ethernet interface (eNB/BBU, UE)
- unsigned int my_port;
//! record player configuration, definition in record_player.h
uint32_t recplay_mode;
recplay_conf_t *recplay_conf;
- //! number of samples per tti
- unsigned int samples_per_tti;
- //! the sample rate for receive.
- double rx_sample_rate;
- //! the sample rate for transmit.
- double tx_sample_rate;
//! Flag to indicate this configuration is for NR
int nr_flag;
//! NR band number
@@ -317,8 +295,7 @@ typedef struct {
int card;
//! rf chain id
int chain;
-} openair0_rf_map;
-
+} openair0_rf_map_t;
typedef struct {
char *remote_addr;
@@ -350,7 +327,7 @@ typedef struct {
} if_buffer_t;
typedef struct {
- openair0_timestamp timestamp;
+ openair0_timestamp_t timestamp;
void *buff[MAX_WRITE_THREAD_BUFFER_SIZE];// buffer to be write;
int nsamps;
int cc;
@@ -378,11 +355,11 @@ typedef struct {
} openair0_thread_t;
typedef struct fhstate_s {
- openair0_timestamp TS[8];
- openair0_timestamp TS0;
- openair0_timestamp olddeltaTS[8];
- openair0_timestamp oldTS[8];
- openair0_timestamp TS_read;
+ openair0_timestamp_t TS[8];
+ openair0_timestamp_t TS0;
+ openair0_timestamp_t olddeltaTS[8];
+ openair0_timestamp_t oldTS[8];
+ openair0_timestamp_t TS_read;
int first_read;
uint32_t *buff[8];
uint32_t buff_size;
@@ -395,10 +372,10 @@ typedef struct {
bool initDone;
pthread_mutex_t mutex_write;
pthread_mutex_t mutex_store;
- openair0_timestamp nextTS;
+ openair0_timestamp_t nextTS;
struct {
bool active;
- openair0_timestamp timestamp;
+ openair0_timestamp_t timestamp;
void *txp[NB_ANTENNAS_TX];
int nsamps;
int nbAnt;
@@ -406,17 +383,11 @@ typedef struct {
} queue[WRITE_QUEUE_SZ];
} re_order_t;
-/*!\brief structure holds the parameters to configure USRP devices */
-struct openair0_device_t {
+/*!\brief structure holds the parameters to configure RF devices */
+struct openair0_device {
/*!tx write thread*/
openair0_thread_t write_thread;
- /*!brief Module ID of this device */
- int Mod_id;
-
- /*!brief Component Carrier ID of this device */
- int CC_id;
-
/*!brief Type of this device */
dev_type_t type;
@@ -429,23 +400,24 @@ struct openair0_device_t {
/* !brief RF frontend parameters set by application */
openair0_config_t *openair0_cfg;
+ /* !brief timestamp of first read */
+ openair0_timestamp_t firstTS;
+
+ /* !brief flag indicating that firstTS was initialized */
+ bool firstTS_initialized;
+
/* !brief ETH params set by application */
eth_params_t *eth_params;
//! record player data, definition in record_player.h
recplay_state_t *recplay_state;
/* !brief Indicates if device already initialized */
int is_init;
-
-
/*!brief Can be used by driver to hold internal structure*/
void *priv;
/*!brief pointer to FH state, used in ECPRI split 8*/
fhstate_t fhstate;
- /*!brief message response for notification fifo*/
- notifiedFIFO_t *respudpTX;
-
/*!brief UDP TX thread context*/
udp_ctx_t **utx;
@@ -463,28 +435,27 @@ struct openair0_device_t {
/*! \brief Called to start the transceiver. Return 0 if OK, < 0 if error
@param device pointer to the device structure specific to the RF hardware target
*/
- int (*trx_start_func)(openair0_device *device);
+ int (*trx_start_func)(openair0_device_t *device);
- /*! \brief Called to configure the device
- @param device pointer to the device structure specific to the RF hardware target
- */
+ /*! \brief Called to configure the device
+ @param device pointer to the device structure specific to the RF hardware target
+ */
-
- int (*trx_config_func)(openair0_device* device, openair0_config_t *openair0_cfg);
+ int (*trx_config_func)(openair0_device_t *device, openair0_config_t *openair0_cfg);
/*! \brief Called to send a request message between RAU-RRU on control port
@param device pointer to the device structure specific to the RF hardware target
@param msg pointer to the message structure passed between RAU-RRU
@param msg_len length of the message
*/
- int (*trx_ctlsend_func)(openair0_device *device, void *msg, ssize_t msg_len);
+ int (*trx_ctlsend_func)(openair0_device_t *device, void *msg, ssize_t msg_len);
/*! \brief Called to receive a reply message between RAU-RRU on control port
@param device pointer to the device structure specific to the RF hardware target
@param msg pointer to the message structure passed between RAU-RRU
@param msg_len length of the message
*/
- int (*trx_ctlrecv_func)(openair0_device *device, void *msg, ssize_t msg_len);
+ int (*trx_ctlrecv_func)(openair0_device_t *device, void *msg, ssize_t msg_len);
/*! \brief Called to send samples to the RF target
@param device pointer to the device structure specific to the RF hardware target
@@ -495,8 +466,8 @@ struct openair0_device_t {
@param num_beams number of beams
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
- int (*trx_write_beams_func)(openair0_device *device,
- openair0_timestamp timestamp,
+ int (*trx_write_beams_func)(openair0_device_t *device,
+ openair0_timestamp_t timestamp,
void ***buff,
int nsamps,
int nb_antennas_tx,
@@ -511,7 +482,12 @@ struct openair0_device_t {
@param nb_antennas_tx number of antennas
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
- int (*trx_write_func)(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int nb_antennas_tx, int flags);
+ int (*trx_write_func)(openair0_device_t *device,
+ openair0_timestamp_t timestamp,
+ void **buff,
+ int nsamps,
+ int nb_antennas_tx,
+ int flags);
/*! \brief Called to send samples to the RF target
@param device pointer to the device structure specific to the RF hardware target
@@ -520,7 +496,13 @@ struct openair0_device_t {
@param nsamps number of samples to be sent
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
- int (*trx_write_func2)(openair0_device *device, openair0_timestamp timestamp, void **buff, int fd_ind,int nsamps, int flags,int nant);
+ int (*trx_write_func2)(openair0_device_t *device,
+ openair0_timestamp_t timestamp,
+ void **buff,
+ int fd_ind,
+ int nsamps,
+ int flags,
+ int nant);
/*! \brief Receive samples from hardware.
* Read nsamps samples from each channel to buffers. buff[0] is the array for
@@ -533,7 +515,7 @@ struct openair0_device_t {
* antennas from which to receive samples \returns the number of sample read
*/
- int (*trx_read_func)(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int num_antennas);
+ int (*trx_read_func)(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int num_antennas);
/*! \brief Receive samples from hardware.
* Read nsamps samples from each channel to buffers. buff[0] is the array for
@@ -548,8 +530,8 @@ struct openair0_device_t {
* \param num_beams number of beams from which to receive samples
* \returns the number of sample read
*/
- int (*trx_read_beams_func)(openair0_device *device,
- openair0_timestamp *ptimestamp,
+ int (*trx_read_beams_func)(openair0_device_t *device,
+ openair0_timestamp_t *ptimestamp,
void ***buff,
int nsamps,
int num_antennas,
@@ -567,28 +549,28 @@ struct openair0_device_t {
* \param antenna_id Index of antenna from which samples were received
* \returns the number of sample read
*/
- int (*trx_read_func2)(openair0_device *device, openair0_timestamp *ptimestamp, uint32_t **buff, int nsamps);
+ int (*trx_read_func2)(openair0_device_t *device, openair0_timestamp_t *ptimestamp, uint32_t **buff, int nsamps);
/*! \brief print the device statistics
* \param device the hardware to use
* \returns 0 on success
*/
- int (*trx_get_stats_func)(openair0_device *device);
+ int (*trx_get_stats_func)(openair0_device_t *device);
/*! \brief Reset device statistics
* \param device the hardware to use
* \returns 0 in success
*/
- int (*trx_reset_stats_func)(openair0_device *device);
+ int (*trx_reset_stats_func)(openair0_device_t *device);
/*! \brief Terminate operation of the transceiver -- free all associated resources
* \param device the hardware to use
*/
- void (*trx_end_func)(openair0_device *device);
+ void (*trx_end_func)(openair0_device_t *device);
/*! \brief Stop operation of the transceiver
*/
- int (*trx_stop_func)(openair0_device *device);
+ int (*trx_stop_func)(openair0_device_t *device);
/* Functions API related to UE*/
@@ -597,14 +579,14 @@ struct openair0_device_t {
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
- int (*trx_set_freq_func)(openair0_device *device, openair0_config_t *openair0_cfg);
+ int (*trx_set_freq_func)(openair0_device_t *device, openair0_config_t *openair0_cfg);
/*! \brief Set gains
* \param device the hardware to use
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
- int (*trx_set_gains_func)(openair0_device *device, openair0_config_t *openair0_cfg);
+ int (*trx_set_gains_func)(openair0_device_t *device, openair0_config_t *openair0_cfg);
/*! \brief Set tx/rx beams
*
@@ -619,9 +601,9 @@ struct openair0_device_t {
* \param beam_map the beams to receive
* \return 0 on success
*/
- int (*trx_set_beams)(openair0_device *device, uint64_t beam_map, openair0_timestamp timestamp);
+ int (*trx_set_beams)(openair0_device_t *device, uint64_t beam_map, openair0_timestamp_t timestamp);
- /*! \brief Set tx/rx beams
+ /*! \brief Set tx/rx beams
*
* Set the tx/rx beams. This has to be done in advance of the reception in order to
* allow the underlying device to change receiver configuration. The exact time depends
@@ -635,7 +617,7 @@ struct openair0_device_t {
* \param num_beams number of beams
* \return 0 on success
*/
- int (*trx_set_beams2)(openair0_device *device, int* beams, int num_beams, openair0_timestamp timestamp);
+ int (*trx_set_beams2)(openair0_device_t *device, int *beams, int num_beams, openair0_timestamp_t timestamp);
/*! \brief RRU Configuration callback
* \param idx RU index
@@ -651,22 +633,22 @@ struct openair0_device_t {
/*! \brief Callback for Third-party RRU Initialization routine
\param device the hardware configuration to use
*/
- int (*thirdparty_init)(openair0_device *device);
+ int (*thirdparty_init)(openair0_device_t *device);
/*! \brief Callback for Third-party RRU Cleanup routine
\param device the hardware configuration to use
*/
- int (*thirdparty_cleanup)(openair0_device *device);
+ int (*thirdparty_cleanup)(openair0_device_t *device);
/*! \brief Callback for Third-party start streaming routine
\param device the hardware configuration to use
*/
- int (*thirdparty_startstreaming)(openair0_device *device);
+ int (*thirdparty_startstreaming)(openair0_device_t *device);
/*! \brief RRU Configuration callback
* \param idx RU index
* \param arg pointer to capabilities or configuration
*/
- int (*trx_write_init)(openair0_device *device);
+ int (*trx_write_init)(openair0_device_t *device);
/* \brief Get internal parameter
* \param id parameter to get
* \return a pointer to the parameter
@@ -678,14 +660,6 @@ struct openair0_device_t {
re_order_t reOrder;
};
-/* type of device init function, implemented in shared lib */
-typedef int(*oai_device_initfunc_t)(openair0_device *device, openair0_config_t *openair0_cfg);
-/* type of transport init function, implemented in shared lib */
-typedef int(*oai_transport_initfunc_t)(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params);
-
-#define OPTION_LZ4 0x00000001 // LZ4 compression (option_value is set to compressed size)
-
-
typedef struct {
uint32_t size; // Number of samples per antenna to follow this header
uint32_t nbAnt; // Total number of antennas following this header
@@ -706,7 +680,6 @@ extern "C"
#define DEVICE_SECTION "device"
#define CONFIG_HLP_DEVICE "Identifies the oai device (the interface to RF) to use, the shared lib \"lib_.so\" will be loaded"
-
#define CONFIG_DEVICEOPT_NAME "name"
/* inclusion for device configuration */
@@ -723,30 +696,24 @@ extern "C"
/*! \brief get device name from device type */
const char *get_devname(int devtype);
/*! \brief Initialize openair RF target. It returns 0 if OK */
-int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg);
+int openair0_device_load(openair0_device_t *device, openair0_config_t *openair0_cfg);
/*! \brief Initialize transport protocol . It returns 0 if OK */
-int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params);
-
-
-/*! \brief Get current timestamp of USRP
- * \param device the hardware to use
- */
-openair0_timestamp get_usrp_time(openair0_device *device);
+int openair0_transport_load(openair0_device_t *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params);
/*! \brief Set RX frequencies
* \param device the hardware to use
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
-int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *openair0_cfg);
+int openair0_set_rx_frequencies(openair0_device_t *device, openair0_config_t *openair0_cfg);
/*! \brief read the iq record-player configuration */
extern int read_recplayconfig(recplay_conf_t **recplay_conf, recplay_state_t **recplay_state);
/*! \brief store recorded iqs from memory to file. */
-extern void iqrecorder_end(openair0_device *device);
+extern void iqrecorder_end(openair0_device_t *device);
-int openair0_write_reorder(openair0_device *device, openair0_timestamp timestamp, void **txp, int nsamps, int nbAnt, int flags);
-void openair0_write_reorder_clear_context(openair0_device *device);
+int openair0_write_reorder(openair0_device_t *device, openair0_timestamp_t timestamp, void **txp, int nsamps, int nbAnt, int flags);
+void openair0_write_reorder_clear_context(openair0_device_t *device);
#include
#ifndef gettid
#define gettid() syscall(__NR_gettid)
diff --git a/radio/COMMON/record_player.c b/radio/COMMON/record_player.c
index 9e561f1d32..9286bb9ffd 100644
--- a/radio/COMMON/record_player.c
+++ b/radio/COMMON/record_player.c
@@ -78,7 +78,8 @@ int read_recplayconfig(recplay_conf_t **recplay_conf, recplay_state_t **recplay_
* used in record mode
* \param device the hardware used
*/
-void iqrecorder_end(openair0_device *device) {
+void iqrecorder_end(openair0_device_t *device)
+{
if (device->recplay_state != NULL) { // subframes store
iqfile_header_t fh = {device->type,device->openair0_cfg->tx_sample_advance, device->openair0_cfg->rx_bw,0,OAIIQFILE_ID};
recplay_state_t *rs = device->recplay_state;
diff --git a/radio/ETHERNET/eth_raw.c b/radio/ETHERNET/eth_raw.c
index 1b48a762f4..44f17ae5da 100644
--- a/radio/ETHERNET/eth_raw.c
+++ b/radio/ETHERNET/eth_raw.c
@@ -52,8 +52,8 @@
//int addr_len[MAX_INST];
//struct ifreq if_index[MAX_INST];
-int eth_socket_init_raw(openair0_device *device) {
-
+int eth_socket_init_raw(openair0_device_t *device)
+{
eth_state_t *eth = (eth_state_t*)device->priv;
const char *local_mac, *remote_mac;
int sock_dom=0;
@@ -125,8 +125,8 @@ int eth_socket_init_raw(openair0_device *device) {
}
/* 09/03/2019: fix obvious inconsistencies, but this code hasn't be tested for sure */
-int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags) {
-
+int trx_eth_write_raw(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags)
+{
int bytes_sent=0;
eth_state_t *eth = (eth_state_t*)device->priv;
int sendto_flag =0;
@@ -148,12 +148,12 @@ int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, voi
/* we don't want to ovewrite with the header info the previous tx buffer data so we store it*/
struct ether_header temp = *(struct ether_header *)buff2;
int32_t temp0 = *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES);
- openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
-
+ openair0_timestamp_t temp1 = *(openair0_timestamp_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
+
bytes_sent = 0;
memcpy(buff2,(void*)ð->ehd,MAC_HEADER_SIZE_BYTES);
*(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t))=1+(i<<1);
- *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = timestamp;
+ *(openair0_timestamp_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = timestamp;
/*printf("[RRU]write mod_%d %d , len %d, buff %p \n",
Mod_id,eth->sockfd[Mod_id],RAW_PACKET_SIZE_BYTES(nsamps), buff2);*/
@@ -180,15 +180,13 @@ int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, voi
/* tx buffer values restored */
*(struct ether_header *)buff2 = temp;
*(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES) = temp0;
- *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = temp1;
+ *(openair0_timestamp_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = temp1;
}
return (bytes_sent-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES)>>2;
}
-
-
-int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
-
+int trx_eth_write_raw_IF4p5(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags)
+{
int nblocks = nsamps;
int bytes_sent = 0;
@@ -225,13 +223,11 @@ int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestam
eth->tx_count++;
}
- return (bytes_sent-MAC_HEADER_SIZE_BYTES);
+ return (bytes_sent-MAC_HEADER_SIZE_BYTES);
}
-
-
-int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
-
+int trx_eth_read_raw(openair0_device_t *device, openair0_timestamp_t *timestamp, void **buff, int nsamps, int cc)
+{
int ret;
int bytes_received=0;
int i=0;
@@ -251,7 +247,7 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi
/* we don't want to ovewrite with the header info the previous rx buffer data so we store it*/
struct ether_header temp = *(struct ether_header *)buff2;
int32_t temp0 = *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES);
- openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
+ openair0_timestamp_t temp1 = *(openair0_timestamp_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
bytes_received=0;
int receive_bytes;
@@ -299,18 +295,18 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi
} else {
bytes_received+=ret;
/* store the timestamp value from packet's header */
- *timestamp = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
+ *timestamp = *(openair0_timestamp_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
eth->rx_actual_nsamps=bytes_received>>2;
eth->rx_count++;
}
}
-#if DEBUG
+#if DEBUG
printf("------- RX------: nu=%x an_id=%d ts%d bytes_recv=%d \n",
- *(uint8_t *)(buff2+ETH_ALEN),
- *(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t)),
- *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)),
- bytes_received);
+ *(uint8_t *)(buff2 + ETH_ALEN),
+ *(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t)),
+ *(openair0_timestamp_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)),
+ bytes_received);
dump_packet((device->host_type == RAU_HOST)? "RAU":"RRU", buff2, RAW_PACKET_SIZE_BYTES(nsamps),RX_FLAG);
@@ -319,15 +315,13 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi
/* tx buffer values restored */
*(struct ether_header *)buff2 = temp;
*(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES) = temp0;
- *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = temp1;
+ *(openair0_timestamp_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = temp1;
}
return (bytes_received-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES)>>2;
}
-
-
-int trx_eth_read_raw_IF4p5(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
-
+int trx_eth_read_raw_IF4p5(openair0_device_t *device, openair0_timestamp_t *timestamp, void **buff, int nsamps, int cc)
+{
int ret;
// Read nblocks info from packet itself
int nblocks = nsamps;
@@ -413,9 +407,8 @@ int trx_eth_read_raw_IF4p5(openair0_device *device, openair0_timestamp *timestam
return(bytes_received);
}
-
-int eth_set_dev_conf_raw(openair0_device *device) {
-
+int eth_set_dev_conf_raw(openair0_device_t *device)
+{
eth_state_t *eth = (eth_state_t*)device->priv;
void *msg;
ssize_t msg_len;
@@ -443,9 +436,8 @@ int eth_set_dev_conf_raw(openair0_device *device) {
return 0;
}
-
-
-int eth_set_dev_conf_raw_IF4p5(openair0_device *device) {
+int eth_set_dev_conf_raw_IF4p5(openair0_device_t *device)
+{
// use for cc_id info
eth_state_t *eth = (eth_state_t*)device->priv;
@@ -475,9 +467,8 @@ int eth_set_dev_conf_raw_IF4p5(openair0_device *device) {
return 0;
}
-
-int eth_get_dev_conf_raw(openair0_device *device) {
-
+int eth_get_dev_conf_raw(openair0_device_t *device)
+{
eth_state_t *eth = (eth_state_t*)device->priv;
void *msg;
ssize_t msg_len;
@@ -503,8 +494,8 @@ int eth_get_dev_conf_raw(openair0_device *device) {
return 0;
}
-
-int eth_get_dev_conf_raw_IF4p5(openair0_device *device) {
+int eth_get_dev_conf_raw_IF4p5(openair0_device_t *device)
+{
// use for cc_id info
eth_state_t *eth = (eth_state_t*)device->priv;
diff --git a/radio/ETHERNET/eth_udp.c b/radio/ETHERNET/eth_udp.c
index ea290f21cb..657e190ae1 100644
--- a/radio/ETHERNET/eth_udp.c
+++ b/radio/ETHERNET/eth_udp.c
@@ -58,8 +58,8 @@ uint16_t pck_seq_num = 1;
uint16_t pck_seq_num_cur=0;
uint16_t pck_seq_num_prev=0;
-int eth_socket_init_udp(openair0_device *device) {
-
+int eth_socket_init_udp(openair0_device_t *device)
+{
eth_state_t *eth = (eth_state_t*)device->priv;
eth_params_t *eth_params = device->eth_params;
@@ -192,8 +192,8 @@ int eth_socket_init_udp(openair0_device *device) {
return 0;
}
-int trx_eth_read_udp_IF4p5(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
-
+int trx_eth_read_udp_IF4p5(openair0_device_t *device, openair0_timestamp_t *timestamp, void **buff, int nsamps, int cc)
+{
// Read nblocks info from packet itself
int nblocks = nsamps;
int bytes_received=-1;
@@ -244,8 +244,8 @@ int trx_eth_read_udp_IF4p5(openair0_device *device, openair0_timestamp *timestam
return(bytes_received);
}
-int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
-
+int trx_eth_write_udp_IF4p5(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags)
+{
int nblocks = nsamps;
int bytes_sent = 0;
@@ -294,10 +294,10 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
-void *trx_eth_write_udp_cmd(udpTXelem_t *udpTXelem) {
-
- openair0_device *device=udpTXelem->device;
- openair0_timestamp timestamp = udpTXelem->timestamp;
+void *trx_eth_write_udp_cmd(udpTXelem_t *udpTXelem)
+{
+ openair0_device_t *device=udpTXelem->device;
+ openair0_timestamp_t timestamp = udpTXelem->timestamp;
void **buff = udpTXelem->buff;
int nsamps = udpTXelem->nsamps;
int nant = udpTXelem->nant;
@@ -331,7 +331,7 @@ void *trx_eth_write_udp_cmd(udpTXelem_t *udpTXelem) {
// ECPRI Message type (1 byte)
*(uint8_t *)(buff2 + 1) = 64;
- openair0_timestamp TS = timestamp + fhstate->TS0;
+ openair0_timestamp_t TS = timestamp + fhstate->TS0;
TS = (6*device->sampling_rate_ratio_d*TS)/device->sampling_rate_ratio_n;
TS -= device->txrx_offset;
int TSinc = (6*256*device->sampling_rate_ratio_d)/device->sampling_rate_ratio_n;
@@ -386,8 +386,8 @@ void *trx_eth_write_udp_cmd(udpTXelem_t *udpTXelem) {
return(NULL);
}
-int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, void **buff, int fd_ind, int nsamps, int flags, int nant) {
-
+int trx_eth_write_udp(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int fd_ind, int nsamps, int flags, int nant)
+{
union udpTXReqUnion id = {.s={(uint64_t)timestamp,nsamps,0}};
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(udpTXelem_t), id.p, device->utx[fd_ind]->resp,NULL);
udpTXelem_t * udptxelem=(udpTXelem_t *) NotifiedFifoData(req);
@@ -425,12 +425,13 @@ void *udp_write_thread(void *arg) {
return(NULL);
}
-void *udp_read_thread(void *arg) {
- openair0_timestamp TS;
+void *udp_read_thread(void *arg)
+{
+ openair0_timestamp_t TS;
int aid;
udp_ctx_t *u = (udp_ctx_t *)arg;
- openair0_device *device=u->device;
+ openair0_device_t *device=u->device;
fhstate_t *fhstate = &device->fhstate;
char buffer[UDP_PACKET_SIZE_BYTES(256)];
int first_read=0;
@@ -457,7 +458,7 @@ void *udp_read_thread(void *arg) {
if (oai_exit)
break;
aid = *(uint16_t*)(&buffer[ECPRICOMMON_BYTES]);
- TS = *(openair0_timestamp *)(&buffer[ECPRICOMMON_BYTES+ECPRIPCID_BYTES]);
+ TS = *(openair0_timestamp_t *)(&buffer[ECPRICOMMON_BYTES+ECPRIPCID_BYTES]);
// convert TS to samples, /6 for AW2S @ 30.72 Ms/s, this is converted for other sample rates in OAI application
TS = (device->sampling_rate_ratio_n*TS)/(device->sampling_rate_ratio_d*6);
AssertFatal(aid < 8,"Cannot handle more than 8 antennas, got aid %d\n",aid);
@@ -487,24 +488,24 @@ void *udp_read_thread(void *arg) {
return(0);
}
-int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, uint32_t **buff, int nsamps) {
-
+int trx_eth_read_udp(openair0_device_t *device, openair0_timestamp_t *timestamp, uint32_t **buff, int nsamps)
+{
fhstate_t *fhstate = &device->fhstate;
- openair0_timestamp prev_read_TS= fhstate->TS_read;
- volatile openair0_timestamp min_TS;
+ openair0_timestamp_t prev_read_TS= fhstate->TS_read;
+ volatile openair0_timestamp_t min_TS;
// block until FH is ready
while (fhstate->r[0] == 0 || fhstate->r[1] == 0 || fhstate->r[2] == 0 || fhstate->r[3] == 0 ||
fhstate->r[4] == 0 || fhstate->r[5] == 0 || fhstate->r[6] == 0 || fhstate->r[7] == 0) usleep(100);
// get minimum TS over all antennas
- min_TS = (volatile openair0_timestamp)fhstate->TS[0];
+ min_TS = (volatile openair0_timestamp_t)fhstate->TS[0];
for (int i=1;iopenair0_cfg->rx_num_channels;i++) min_TS = min(min_TS,fhstate->TS[i]);
// poll/sleep until we accumulated enough samples on each antenna port
int count=0;
while (fhstate->first_read == 1 && min_TS < (fhstate->TS0+prev_read_TS + nsamps)) {
usleep(10);
- min_TS = (volatile openair0_timestamp)fhstate->TS[0];
- for (int i=1;iopenair0_cfg->rx_num_channels;i++) min_TS = min(min_TS,(volatile openair0_timestamp)fhstate->TS[i]);
+ min_TS = (volatile openair0_timestamp_t)fhstate->TS[0];
+ for (int i=1;iopenair0_cfg->rx_num_channels;i++) min_TS = min(min_TS,(volatile openair0_timestamp_t)fhstate->TS[i]);
count++;
}
if (fhstate->first_read == 0) {
@@ -524,8 +525,8 @@ int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, uin
-int trx_eth_ctlsend_udp(openair0_device *device, void *msg, ssize_t msg_len) {
-
+int trx_eth_ctlsend_udp(openair0_device_t *device, void *msg, ssize_t msg_len)
+{
return(sendto(((eth_state_t*)device->priv)->sockfdc,
msg,
msg_len,
@@ -535,8 +536,8 @@ int trx_eth_ctlsend_udp(openair0_device *device, void *msg, ssize_t msg_len) {
}
-int trx_eth_ctlrecv_udp(openair0_device *device, void *msg, ssize_t msg_len) {
-
+int trx_eth_ctlrecv_udp(openair0_device_t *device, void *msg, ssize_t msg_len)
+{
return (recvfrom(((eth_state_t*)device->priv)->sockfdc,
msg,
msg_len,
diff --git a/radio/ETHERNET/ethernet_lib.c b/radio/ETHERNET/ethernet_lib.c
index 038246c998..b7011c7097 100644
--- a/radio/ETHERNET/ethernet_lib.c
+++ b/radio/ETHERNET/ethernet_lib.c
@@ -51,12 +51,9 @@ int num_devices_eth = 0;
struct sockaddr_in dest_addr[MAX_INST];
int dest_addr_len[MAX_INST];
-int load_lib(openair0_device *device,
- openair0_config_t *openair0_cfg,
- eth_params_t *cfg,
- uint8_t flag);
+int load_lib(openair0_device_t *device, openair0_config_t *openair0_cfg, eth_params_t *cfg, uint8_t flag);
-int trx_eth_start(openair0_device *device)
+int trx_eth_start(openair0_device_t *device)
{
eth_state_t *eth = (eth_state_t*)device->priv;
@@ -130,9 +127,6 @@ int trx_eth_start(openair0_device *device)
}
device->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
initTpool(pool, device->threadPool, cpumeas(CPUMEAS_GETSTATE));
- // ULSCH decoder result FIFO
- device->respudpTX = (notifiedFIFO_elt_t*) malloc(sizeof(notifiedFIFO_elt_t));
- initNotifiedFIFO(device->respudpTX);
#endif
}
/* initialize socket */
@@ -225,8 +219,7 @@ int trx_eth_start(openair0_device *device)
return 0;
}
-
-void trx_eth_end(openair0_device *device)
+void trx_eth_end(openair0_device_t *device)
{
eth_state_t *eth = (eth_state_t*)device->priv;
/* destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */
@@ -239,9 +232,8 @@ void trx_eth_end(openair0_device *device)
}
}
-
-
-int trx_eth_stop(openair0_device *device) {
+int trx_eth_stop(openair0_device_t *device)
+{
eth_state_t *eth = (eth_state_t*)device->priv;
if (eth->flags == ETH_UDP_IF5_ECPRI_MODE) {
@@ -251,38 +243,32 @@ int trx_eth_stop(openair0_device *device) {
return(0);
}
-
-int trx_eth_set_freq(openair0_device* device, openair0_config_t *openair0_cfg)
+int trx_eth_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
return(0);
}
-
-int trx_eth_set_gains(openair0_device* device, openair0_config_t *openair0_cfg)
+int trx_eth_set_gains(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
return(0);
}
-
-int trx_eth_get_stats(openair0_device* device)
+int trx_eth_get_stats(openair0_device_t *device)
{
return(0);
}
-
-int trx_eth_reset_stats(openair0_device* device)
+int trx_eth_reset_stats(openair0_device_t *device)
{
return(0);
}
-int trx_eth_write_init(openair0_device *device)
+int trx_eth_write_init(openair0_device_t *device)
{
return 0;
}
-int ethernet_tune(openair0_device *device,
- unsigned int option,
- int value)
+int ethernet_tune(openair0_device_t *device, unsigned int option, int value)
{
eth_state_t *eth = (eth_state_t*)device->priv;
struct timeval timeout;
@@ -471,10 +457,7 @@ int ethernet_tune(openair0_device *device,
return 0;
}
-
-int transport_init(openair0_device *device,
- openair0_config_t *openair0_cfg,
- eth_params_t * eth_params )
+int transport_init(openair0_device_t *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params)
{
eth_state_t *eth = (eth_state_t*)malloc(sizeof(eth_state_t));
memset(eth, 0, sizeof(eth_state_t));
@@ -496,9 +479,8 @@ int transport_init(openair0_device *device,
eth->num_fd = 1;
- printf("[ETHERNET]: Initializing openair0_device for %s ...\n", ((device->host_type == RAU_HOST) ? "RAU": "RRU"));
+ printf("[ETHERNET]: Initializing openair0_device_t for %s ...\n", ((device->host_type == RAU_HOST) ? "RAU" : "RRU"));
printf("[ETHERNET]: num_fd %d\n",eth->num_fd);
- device->Mod_id = 0;//num_devices_eth++;
device->transp_type = ETHERNET_TP;
device->trx_start_func = trx_eth_start;
device->trx_get_stats_func = trx_eth_get_stats;
@@ -577,12 +559,11 @@ unsigned short calc_csum (unsigned short *buf,
return ~sum;
}
-
-void dump_dev(openair0_device *device)
+void dump_dev(openair0_device_t *device)
{
eth_state_t *eth = (eth_state_t*)device->priv;
- printf("Ethernet device interface %i configuration:\n" ,device->openair0_cfg->Mod_id);
+ printf("Ethernet device configuration:\n");
printf(" RB number: %i, sample rate: %lf \n" ,
device->openair0_cfg->num_rb_dl, device->openair0_cfg->sample_rate);
printf(" RAU configured for %i tx/%i rx channels)\n",
@@ -594,27 +575,21 @@ void dump_dev(openair0_device *device)
}
-
-void inline dump_txcounters(openair0_device *device)
+void inline dump_txcounters(openair0_device_t *device)
{
eth_state_t *eth = (eth_state_t*)device->priv;
- printf(" Ethernet device interface %i, tx counters:\n" ,device->openair0_cfg->Mod_id);
+ printf(" Ethernet device interface tx counters:\n");
printf(" Sent packets: %llu send errors: %i\n", (long long unsigned int)eth->tx_count, eth->num_tx_errors);
}
-
-void inline dump_rxcounters(openair0_device *device)
+void inline dump_rxcounters(openair0_device_t *device)
{
eth_state_t *eth = (eth_state_t*)device->priv;
- printf(" Ethernet device interface %i rx counters:\n" ,device->openair0_cfg->Mod_id);
+ printf(" Ethernet device interface rx counters:\n");
printf(" Received packets: %llu missed packets errors: %i\n", (long long unsigned int)eth->rx_count, eth->num_underflows);
}
-
-void inline dump_buff(openair0_device *device,
- char *buff,
- unsigned int tx_rx_flag,
- int nsamps)
+void inline dump_buff(openair0_device_t *device, char *buff, unsigned int tx_rx_flag, int nsamps)
{
char *strptr;
eth_state_t *eth = (eth_state_t*)device->priv;
diff --git a/radio/ETHERNET/ethernet_lib.h b/radio/ETHERNET/ethernet_lib.h
index 2a5f2db4ca..0c04f8a36c 100644
--- a/radio/ETHERNET/ethernet_lib.h
+++ b/radio/ETHERNET/ethernet_lib.h
@@ -43,7 +43,6 @@
#include
#define MAX_INST 4
-#define DEFAULT_IF "lo"
#define TX_FLAG 1
#define RX_FLAG 0
@@ -51,7 +50,7 @@
#include "if_defs.h"
#define ECPRICOMMON_BYTES 4
#define ECPRIPCID_BYTES 2
-#define APP_HEADER_SIZE_BYTES (ECPRICOMMON_BYTES + ECPRIPCID_BYTES + sizeof(openair0_timestamp))
+#define APP_HEADER_SIZE_BYTES (ECPRICOMMON_BYTES + ECPRIPCID_BYTES + sizeof(openair0_timestamp_t))
#define ECPRIREV 1 // ECPRI Version 1, C=0 - single ECPRI message per OAI TX packet
/*!\brief opaque ethernet data structure */
@@ -111,11 +110,11 @@ typedef struct {
int num_rx_errors;
/*!\brief number of errors in interface's transmitter */
int num_tx_errors;
-
- /*!\brief current TX timestamp */
- openair0_timestamp tx_current_ts;
- /*!\brief socket file desc */
- openair0_timestamp rx_current_ts;
+
+ /*!\brief current TX timestamp */
+ openair0_timestamp_t tx_current_ts;
+ /*!\brief socket file desc */
+ openair0_timestamp_t rx_current_ts;
/*!\brief actual number of samples transmitted */
uint64_t tx_actual_nsamps;
/*!\brief actual number of samples received */
@@ -150,8 +149,8 @@ typedef struct {
uint16_t seq_num ;
/*!\brief antenna port used to resynchronize */
uint16_t antenna_id;
- /*!\brief packet's timestamp */
- openair0_timestamp timestamp;
+ /*!\brief packet's timestamp */
+ openair0_timestamp_t timestamp;
} header_t;
/*!\brief different options for ethernet tuning in socket and driver level */
@@ -204,8 +203,8 @@ typedef struct {
} iqoai_t ;
typedef struct udpTXelem_s {
- openair0_device *device;
- openair0_timestamp timestamp;
+ openair0_device_t *device;
+ openair0_timestamp_t timestamp;
void **buff;
int fd_ind;
int nant;
@@ -227,17 +226,17 @@ union udpTXReqUnion {
void dump_packet(char *title, unsigned char* pkt, int bytes, unsigned int tx_rx_flag);
unsigned short calc_csum (unsigned short *buf, int nwords);
-void dump_dev(openair0_device *device);
-/*void inline dump_buff(openair0_device *device, char *buff,unsigned int tx_rx_flag,int nsamps);
-void inline dump_rxcounters(openair0_device *device);
-void inline dump_txcounters(openair0_device *device);
+void dump_dev(openair0_device_t *device);
+/*void inline dump_buff(openair0_device_t *device, char *buff,unsigned int tx_rx_flag,int nsamps);
+void inline dump_rxcounters(openair0_device_t *device);
+void inline dump_txcounters(openair0_device_t *device);
*/
void dump_iqs(char * buff, int iq_cnt);
void *udp_read_thread(void *arg);
void *udp_write_thread(void *arg);
-/*! \fn int ethernet_tune (openair0_device *device, unsigned int option, int value);
+/*! \fn int ethernet_tune (openair0_device_t *device, unsigned int option, int value);
* \brief this function allows you to configure certain ethernet parameters in socket or device level
* \param[in] device device which bears the socket
* \param[in] option of parameter to configure
@@ -246,34 +245,39 @@ void *udp_write_thread(void *arg);
* \note
* @ingroup _oai
*/
-int ethernet_tune(openair0_device *device, unsigned int option, int value);
+int ethernet_tune(openair0_device_t *device, unsigned int option, int value);
-/*! \fn int eth_socket_init_udp(openair0_device *device)
+/*! \fn int eth_socket_init_udp(openair0_device_t *device)
* \brief initialization of UDP Socket to communicate with one destination
* \param[in] device openair device for which the socket will be created
* \return 0 on success, otherwise -1
* \note
* @ingroup _oai
*/
-int eth_socket_init_udp(openair0_device *device);
-int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, void **buf, int fd_ind, int nsamps, int flags,int nant);
-int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, uint32_t **buff, int nsamps);
+int eth_socket_init_udp(openair0_device_t *device);
+int trx_eth_write_udp(openair0_device_t *device,
+ openair0_timestamp_t timestamp,
+ void **buf,
+ int fd_ind,
+ int nsamps,
+ int flags,
+ int nant);
+int trx_eth_read_udp(openair0_device_t *device, openair0_timestamp_t *timestamp, uint32_t **buff, int nsamps);
+int eth_socket_init_raw(openair0_device_t *device);
+int trx_eth_write_raw(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags);
+int trx_eth_read_raw(openair0_device_t *device, openair0_timestamp_t *timestamp, void **buff, int nsamps, int cc);
+int trx_eth_write_raw_IF4p5(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags);
+int trx_eth_read_raw_IF4p5(openair0_device_t *device, openair0_timestamp_t *timestamp, void **buff, int nsamps, int cc);
+int trx_eth_read_raw_IF5_mobipass(openair0_device_t *device, openair0_timestamp_t *timestamp, void **buff, int nsamps, int cc);
+int trx_eth_write_udp_IF4p5(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags);
+int trx_eth_read_udp_IF4p5(openair0_device_t *device, openair0_timestamp_t *timestamp, void **buff, int nsamps, int cc);
+int trx_eth_ctlsend_udp(openair0_device_t *device, void *msg, ssize_t msg_len);
+int trx_eth_ctlrecv_udp(openair0_device_t *device, void *msg, ssize_t msg_len);
-int eth_socket_init_raw(openair0_device *device);
-int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
-int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
-int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
-int trx_eth_read_raw_IF4p5(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
-int trx_eth_read_raw_IF5_mobipass(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
-int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
-int trx_eth_read_udp_IF4p5(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
-int trx_eth_ctlsend_udp(openair0_device *device, void *msg, ssize_t msg_len);
-int trx_eth_ctlrecv_udp(openair0_device *device, void *msg, ssize_t msg_len);
-
-int eth_get_dev_conf_raw(openair0_device *device);
-int eth_set_dev_conf_raw(openair0_device *device);
-int eth_get_dev_conf_raw_IF4p5(openair0_device *device);
-int eth_set_dev_conf_raw_IF4p5(openair0_device *device);
+int eth_get_dev_conf_raw(openair0_device_t *device);
+int eth_set_dev_conf_raw(openair0_device_t *device);
+int eth_get_dev_conf_raw_IF4p5(openair0_device_t *device);
+int eth_set_dev_conf_raw_IF4p5(openair0_device_t *device);
#endif
diff --git a/radio/ETHERNET/if_defs.h b/radio/ETHERNET/if_defs.h
index e2acf78a5c..df40c25aa3 100644
--- a/radio/ETHERNET/if_defs.h
+++ b/radio/ETHERNET/if_defs.h
@@ -83,6 +83,5 @@
// Mobipass packet sizes
#define RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES 1280
#define RAW_IF5_MOBIPASS_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES)
-#define PAYLOAD_MOBIPASS_NUM_SAMPLES 640
#endif
diff --git a/radio/IRIS/iris_lib.cpp b/radio/IRIS/iris_lib.cpp
index 927c63d72d..0251f8054c 100644
--- a/radio/IRIS/iris_lib.cpp
+++ b/radio/IRIS/iris_lib.cpp
@@ -71,14 +71,15 @@ extern "C" {
//! rx count
int64_t rx_count;
//! timestamp of RX packet
- openair0_timestamp rx_timestamp;
+ openair0_timestamp_t rx_timestamp;
} iris_state_t;
}
/*! \brief Called to start the Iris lime transceiver. Return 0 if OK, < 0 if error
@param device pointer to the device structure specific to the RF hardware target
*/
-static int trx_iris_start(openair0_device *device) {
+static int trx_iris_start(openair0_device_t *device)
+{
iris_state_t *s = (iris_state_t *) device->priv;
long long timeNs = s->iris[0]->getHardwareTime("") + 500000;
@@ -97,7 +98,8 @@ static int trx_iris_start(openair0_device *device) {
/*! \brief Stop Iris
* \param card refers to the hardware index to use
*/
-int trx_iris_stop(openair0_device *device) {
+int trx_iris_stop(openair0_device_t *device)
+{
iris_state_t *s = (iris_state_t *) device->priv;
int r;
for (r = 0; r < s->device_num; r++) {
@@ -110,7 +112,8 @@ int trx_iris_stop(openair0_device *device) {
/*! \brief Terminate operation of the Iris lime transceiver -- free all associated resources
* \param device the hardware to use
*/
-static void trx_iris_end(openair0_device *device) {
+static void trx_iris_end(openair0_device_t *device)
+{
LOG_I(HW, "Closing Iris device.\n");
trx_iris_stop(device);
iris_state_t *s = (iris_state_t *) device->priv;
@@ -133,7 +136,7 @@ static void trx_iris_end(openair0_device *device) {
static int
-trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
+trx_iris_write(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags)
{
using namespace std::chrono;
@@ -209,7 +212,8 @@ trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buf
* \param antenna_id Index of antenna for which to receive samples
* \returns the number of sample read
*/
-static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
+static int trx_iris_read(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int cc)
+{
int ret = 0;
static long long nextTime;
static bool nextTimeValid = false;
@@ -304,7 +308,8 @@ static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp
/*! \brief Get current timestamp of Iris
* \param device the hardware to use
*/
-openair0_timestamp get_iris_time(openair0_device *device) {
+openair0_timestamp_t get_iris_time(openair0_device_t *device)
+{
iris_state_t *s = (iris_state_t *) device->priv;
return SoapySDR::timeNsToTicks(s->iris[0]->getHardwareTime(""), s->sample_rate);
}
@@ -317,9 +322,9 @@ static bool is_equal(double a, double b) {
return std::fabs(a - b) < std::numeric_limits::epsilon();
}
-void *set_freq_thread(void *arg) {
-
- openair0_device *device = (openair0_device *) arg;
+void *set_freq_thread(void *arg)
+{
+ openair0_device_t *device = (openair0_device_t *) arg;
iris_state_t *s = (iris_state_t *) device->priv;
int r, i;
printf("Setting Iris TX Freq %f, RX Freq %f\n", device->openair0_cfg[0].tx_freq[0],
@@ -344,7 +349,7 @@ void *set_freq_thread(void *arg) {
* \param dummy dummy variable not used
* \returns 0 in success
*/
-int trx_iris_set_freq(openair0_device *device, openair0_config_t *openair0_cfg)
+int trx_iris_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
iris_state_t *s = (iris_state_t *)device->priv;
int r, i;
@@ -369,7 +374,7 @@ int trx_iris_set_freq(openair0_device *device, openair0_config_t *openair0_cfg)
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
-int trx_iris_set_gains(openair0_device *device,
+int trx_iris_set_gains(openair0_device_t *device,
openair0_config_t *openair0_cfg) {
iris_state_t *s = (iris_state_t *) device->priv;
int r;
@@ -448,23 +453,21 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index, int bw
* \param device the hardware to use
* \returns 0 on success
*/
-int trx_iris_get_stats(openair0_device *device) {
-
+int trx_iris_get_stats(openair0_device_t *device)
+{
return (0);
-
}
/*! \brief Reset the Iris statistics
* \param device the hardware to use
* \returns 0 on success
*/
-int trx_iris_reset_stats(openair0_device *device) {
-
+int trx_iris_reset_stats(openair0_device_t *device)
+{
return (0);
-
}
-int trx_iris_write_init(openair0_device *device)
+int trx_iris_write_init(openair0_device_t *device)
{
return 0;
}
@@ -475,8 +478,8 @@ extern "C" {
* \param device the hardware to use
* \param openair0_cfg RF frontend parameters set by application
*/
-int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
-
+int device_init(openair0_device_t *device, openair0_config_t *openair0_cfg)
+{
int bw_gain_adjust = 0;
openair0_cfg[0].rx_gain_calib_table = calib_table_iris;
iris_state_t *s = (iris_state_t *) calloc(1, sizeof(*s));
diff --git a/radio/LMSSDR/lms_lib.cpp b/radio/LMSSDR/lms_lib.cpp
index 3d0dd78118..bca1f8efaf 100644
--- a/radio/LMSSDR/lms_lib.cpp
+++ b/radio/LMSSDR/lms_lib.cpp
@@ -72,7 +72,8 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
\param flags Ignored for the moment
\returns 0 on success
*/
-int trx_lms_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int antenna_id, int flags) {
+int trx_lms_write(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int antenna_id, int flags)
+{
timestamp -= device->openair0_cfg->command_line_sample_advance - device->openair0_cfg->tx_sample_advance;
lms_stream_meta_t meta;
meta.waitForTimestamp = true;
@@ -93,8 +94,8 @@ int trx_lms_write(openair0_device *device, openair0_timestamp timestamp, void **
* \param antenna_id Index of antenna port
* \returns number of samples read
*/
-int trx_lms_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int antenna_id) {
-
+int trx_lms_read(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int antenna_id)
+{
lms_stream_meta_t meta;
meta.waitForTimestamp = false;
meta.flushPartialPacket = false;
@@ -140,7 +141,8 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
* \param openair0_cfg openair0 Config structure
* \returns 0 in success, -1 on error
*/
-int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
+int trx_lms_set_gains(openair0_device_t* device, openair0_config_t *openair0_cfg)
+{
int ret = 0;
if (openair0_cfg->rx_gain[0] > 70+openair0_cfg->rx_gain_offset[0]) {
@@ -158,8 +160,8 @@ int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg)
* \param device the hardware to use
* \returns 0 on success
*/
-int trx_lms_start(openair0_device *device){
-
+int trx_lms_start(openair0_device_t *device)
+{
lms_info_str_t list[16]={0};
int n= LMS_GetDeviceList(list);
@@ -269,7 +271,8 @@ int trx_lms_start(openair0_device *device){
* \param card Index of the RF card to use
* \returns 0 on success
*/
-int trx_lms_stop(openair0_device *device) {
+int trx_lms_stop(openair0_device_t *device)
+{
LMS_StopStream(&rx_stream);
LMS_StopStream(&tx_stream);
LMS_DestroyStream(lms_device,&rx_stream);
@@ -283,7 +286,8 @@ int trx_lms_stop(openair0_device *device) {
* \param openair0_cfg openair0 Config structure (ignored. It is there to comply with RF common API)
* \returns 0 in success
*/
-int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg) {
+int trx_lms_set_freq(openair0_device_t* device, openair0_config_t *openair0_cfg)
+{
//Control port must be connected
LMS_SetLOFrequency(lms_device,LMS_CH_TX,0,openair0_cfg->tx_freq[0]);
LMS_SetLOFrequency(lms_device,LMS_CH_RX,0,openair0_cfg->rx_freq[0]);
@@ -322,45 +326,43 @@ rx_gain_calib_table_t calib_table_lmssdr[] = {
* \returns 0 in success
*/
-int trx_lms_get_stats(openair0_device* device) {
-
+int trx_lms_get_stats(openair0_device_t* device)
+{
return(0);
-
}
/*! \brief Reset LMSSDR Statistics
* \param device the hardware to use
* \returns 0 in success
*/
-int trx_lms_reset_stats(openair0_device* device) {
-
+int trx_lms_reset_stats(openair0_device_t* device)
+{
return(0);
-
}
/*! \brief Terminate operation of the LMSSDR transceiver -- free all associated resources
* \param device the hardware to use
*/
-void trx_lms_end(openair0_device *device) {
-
-
+void trx_lms_end(openair0_device_t *device)
+{
}
-int trx_lms_write_init(openair0_device *device)
+int trx_lms_write_init(openair0_device_t *device)
{
return 0;
}
+
extern "C" {
/*! \brief Initialize Openair LMSSDR target. It returns 0 if OK
* \param device the hardware to use
* \param openair0_cfg RF frontend parameters set by application
*/
-int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
-
+int device_init(openair0_device_t *device, openair0_config_t *openair0_cfg)
+{
device->type=LMSSDR_DEV;
- printf("LMSSDR: Initializing openair0_device for %s ...\n", ((device->host_type == RAU_HOST) ? "RAU": "RRU"));
+ printf("LMSSDR: Initializing openair0_device_t for %s ...\n", ((device->host_type == RAU_HOST) ? "RAU": "RRU"));
switch ((int)openair0_cfg[0].sample_rate) {
case 30720000:
diff --git a/radio/LMSSDR/sodera_lib.cpp b/radio/LMSSDR/sodera_lib.cpp
index 7c3690a9d6..39b2811005 100644
--- a/radio/LMSSDR/sodera_lib.cpp
+++ b/radio/LMSSDR/sodera_lib.cpp
@@ -87,7 +87,7 @@ typedef struct
int64_t tx_count;
int64_t rx_count;
- openair0_timestamp rx_timestamp;
+ openair0_timestamp_t rx_timestamp;
} sodera_t;
@@ -131,7 +131,7 @@ uint16_t SPI_read(LMScomms* dataPort, uint16_t address)
return 0;
}
-static int trx_sodera_start(openair0_device *device)
+static int trx_sodera_start(openair0_device_t *device)
{
sodera_t *s = (sodera_t*)device->priv;
@@ -182,7 +182,7 @@ static int trx_sodera_start(openair0_device *device)
return 0;
}
-static void trx_sodera_end(openair0_device *device)
+static void trx_sodera_end(openair0_device_t *device)
{
sodera_t *s = (sodera_t*)device->priv;
@@ -193,7 +193,7 @@ static void trx_sodera_end(openair0_device *device)
}
-static int trx_sodera_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
+static int trx_sodera_write(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags)
{
sodera_t *s = (sodera_t*)device->priv;
@@ -203,7 +203,7 @@ static int trx_sodera_write(openair0_device *device, openair0_timestamp timestam
#define DEBUG_READ 1
-static int trx_sodera_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
+static int trx_sodera_read(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int cc)
{
sodera_t *s = (sodera_t*)device->priv;
int samples_received=0,i,j;
@@ -350,19 +350,18 @@ static bool is_equal(double a, double b)
return fabs(a-b) < 1e-6;
}
-int trx_sodera_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, int dummy) {
-
+int trx_sodera_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg, int dummy)
+{
sodera_t *s = (sodera_t*)device->priv;
// s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]);
// s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]);
- return(0);
-
+ return (0);
}
-int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg) {
-
+int openair0_set_rx_frequencies(openair0_device_t *device, openair0_config_t *openair0_cfg)
+{
sodera_t *s = (sodera_t*)device->priv;
static int first_call=1;
static double rf_freq,diff;
@@ -374,13 +373,11 @@ int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *open
// rf_freq=openair0_cfg[0].rx_freq[0];
// s->usrp->set_rx_freq(rx_tune_req);
- return(0);
-
+ return (0);
}
-int trx_sodera_set_gains(openair0_device* device,
- openair0_config_t *openair0_cfg) {
-
+int trx_sodera_set_gains(openair0_device_t *device, openair0_config_t *openair0_cfg)
+{
sodera_t *s = (sodera_t*)device->priv;
// s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[0]);
@@ -456,20 +453,17 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_
}
-
-int trx_sodera_get_stats(openair0_device* device) {
-
- return(0);
-
-}
-int trx_sodera_reset_stats(openair0_device* device) {
-
- return(0);
-
+int trx_sodera_get_stats(openair0_device_t *device)
+{
+ return (0);
}
+int trx_sodera_reset_stats(openair0_device_t *device)
+{
+ return (0);
+}
-int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair0_cfg)
+int openair0_dev_init_sodera(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
sodera_t *s=&sodera_state;
diff --git a/radio/USRP/usrp_lib.cpp b/radio/USRP/usrp_lib.cpp
index dabc6f8947..f224b75354 100644
--- a/radio/USRP/usrp_lib.cpp
+++ b/radio/USRP/usrp_lib.cpp
@@ -104,7 +104,7 @@ typedef struct {
//int first_tx;
//int first_rx;
//! timestamp of RX packet
- openair0_timestamp rx_timestamp;
+ openair0_timestamp_t rx_timestamp;
} usrp_state_t;
//void print_notes(void)
@@ -145,7 +145,8 @@ int check_ref_locked(usrp_state_t *s,size_t mboard) {
return ref_locked;
}
-static int sync_to_gps(openair0_device *device) {
+static int sync_to_gps(openair0_device_t *device)
+{
//uhd::set_thread_priority_safe();
//std::string args;
//Set up program options
@@ -266,7 +267,7 @@ static int sync_to_gps(openair0_device *device) {
#define ATR_XX 0x20 //data[5]
#define MAN_MASK ATR_MASK ^ 0xFFF // manually controlled pins
-static void trx_usrp_start_interdigital_gpio(openair0_device *device, usrp_state_t *s)
+static void trx_usrp_start_interdigital_gpio(openair0_device_t *device, usrp_state_t *s)
{
AssertFatal(device->type == USRP_X400_DEV,
"interdigital frontend device for beam management can only be used together with an X400\n");
@@ -280,7 +281,7 @@ static void trx_usrp_start_interdigital_gpio(openair0_device *device, usrp_state
s->usrp->set_gpio_attr(s->gpio_bank, "OUT", (1 << 4), 0x1c);
}
-static void trx_usrp_start_generic_gpio(openair0_device *device, usrp_state_t *s)
+static void trx_usrp_start_generic_gpio(openair0_device_t *device, usrp_state_t *s)
{
// setup GPIO for TDD, GPIO(4) = ATR_RX
// set data direction register (DDR) to output
@@ -299,7 +300,8 @@ static void trx_usrp_start_generic_gpio(openair0_device *device, usrp_state_t *s
/*! \brief Called to start the USRP transceiver. Return 0 if OK, < 0 if error
@param device pointer to the device structure specific to the RF hardware target
*/
-static int trx_usrp_start(openair0_device *device) {
+static int trx_usrp_start(openair0_device_t *device)
+{
usrp_state_t *s = (usrp_state_t *)device->priv;
s->gpio_bank = (char *) "FP0"; //good for B210, X310 and N310
@@ -383,7 +385,8 @@ static void trx_usrp_write_reset(openair0_thread_t *wt);
/*! \brief Terminate operation of the USRP transceiver -- free all associated resources
* \param device the hardware to use
*/
-static void trx_usrp_end(openair0_device *device) {
+static void trx_usrp_end(openair0_device_t *device)
+{
if (device == NULL)
return;
@@ -423,12 +426,13 @@ static void trx_usrp_end(openair0_device *device) {
@param antenna_id index of the antenna if the device has multiple antennas
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
-static int trx_usrp_write(openair0_device *device,
- openair0_timestamp timestamp,
+static int trx_usrp_write(openair0_device_t *device,
+ openair0_timestamp_t timestamp,
void **buff,
int nsamps,
int cc,
- int flags) {
+ int flags)
+{
int ret=0;
usrp_state_t *s = (usrp_state_t *)device->priv;
timestamp -= device->openair0_cfg->command_line_sample_advance + device->openair0_cfg->tx_sample_advance;
@@ -562,22 +566,23 @@ static int trx_usrp_write(openair0_device *device,
@param antenna_id index of the antenna if the device has multiple antennas
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
-void *trx_usrp_write_thread(void * arg){
+void *trx_usrp_write_thread(void * arg)
+{
int ret=0;
- openair0_device *device=(openair0_device *)arg;
+ openair0_device_t *device=(openair0_device_t *)arg;
openair0_thread_t *write_thread = &device->write_thread;
openair0_write_package_t *write_package = write_thread->write_package;
usrp_state_t *s;
int nsamps2; // aligned to upper 32 or 16 byte boundary
int start;
- openair0_timestamp timestamp;
- void **buff;
- int nsamps;
- int cc;
- signed char first_packet;
- signed char last_packet;
- int flags_gpio;
+ openair0_timestamp_t timestamp;
+ void **buff;
+ int nsamps;
+ int cc;
+ signed char first_packet;
+ signed char last_packet;
+ int flags_gpio;
printf("trx_usrp_write_thread started on cpu %d\n",sched_getcpu());
while(1){
@@ -659,8 +664,8 @@ void *trx_usrp_write_thread(void * arg){
return NULL;
}
-int trx_usrp_write_init(openair0_device *device){
-
+int trx_usrp_write_init(openair0_device_t *device)
+{
//uhd::set_thread_priority_safe(1.0);
openair0_thread_t *write_thread = &device->write_thread;
printf("initializing tx write thread\n");
@@ -705,7 +710,8 @@ static void trx_usrp_write_reset(openair0_thread_t *wt) {
* \param antenna_id Index of antenna for which to receive samples
* \returns the number of sample read
*/
-static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
+static int trx_usrp_read(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int cc)
+{
usrp_state_t *s = (usrp_state_t *)device->priv;
int samples_received=0;
int nsamps2; // aligned to upper 32 or 16 byte boundary
@@ -817,7 +823,7 @@ static bool is_equal(double a, double b) {
}
void *freq_thread(void *arg) {
- openair0_device *device=(openair0_device *)arg;
+ openair0_device_t *device=(openair0_device_t *)arg;
usrp_state_t *s = (usrp_state_t *)device->priv;
uhd::tune_request_t tx_tune_req(device->openair0_cfg[0].tx_freq[0],
device->openair0_cfg[0].tune_offset);
@@ -833,7 +839,7 @@ void *freq_thread(void *arg) {
* \param dummy dummy variable not used
* \returns 0 in success
*/
-int trx_usrp_set_freq(openair0_device *device, openair0_config_t *openair0_cfg)
+int trx_usrp_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
usrp_state_t *s = (usrp_state_t *)device->priv;
printf("Setting USRP TX Freq %f, RX Freq %f, tune_offset: %f\n", openair0_cfg[0].tx_freq[0], openair0_cfg[0].rx_freq[0], openair0_cfg[0].tune_offset);
@@ -851,7 +857,8 @@ int trx_usrp_set_freq(openair0_device *device, openair0_config_t *openair0_cfg)
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
-int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *openair0_cfg) {
+int openair0_set_rx_frequencies(openair0_device_t *device, openair0_config_t *openair0_cfg)
+{
usrp_state_t *s = (usrp_state_t *)device->priv;
uhd::tune_request_t rx_tune_req(openair0_cfg[0].rx_freq[0], openair0_cfg[0].tune_offset);
printf("In openair0_set_rx_frequencies, freq: %f, tune offset: %f\n",
@@ -867,8 +874,9 @@ int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *open
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
-int trx_usrp_set_gains(openair0_device *device,
- openair0_config_t *openair0_cfg) {
+int trx_usrp_set_gains(openair0_device_t *device,
+ openair0_config_t *openair0_cfg)
+{
usrp_state_t *s = (usrp_state_t *)device->priv;
::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(0);
s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[0]);
@@ -892,7 +900,8 @@ int trx_usrp_set_gains(openair0_device *device,
/*! \brief Stop USRP
* \param card refers to the hardware index to use
*/
-int trx_usrp_stop(openair0_device *device) {
+int trx_usrp_stop(openair0_device_t *device)
+{
return(0);
}
@@ -1012,7 +1021,8 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_
* \param device the hardware to use
* \returns 0 on success
*/
-int trx_usrp_get_stats(openair0_device *device) {
+int trx_usrp_get_stats(openair0_device_t *device)
+{
return(0);
}
@@ -1020,7 +1030,8 @@ int trx_usrp_get_stats(openair0_device *device) {
* \param device the hardware to use
* \returns 0 on success
*/
-int trx_usrp_reset_stats(openair0_device *device) {
+int trx_usrp_reset_stats(openair0_device_t *device)
+{
return(0);
}
@@ -1047,7 +1058,8 @@ static void usrp_sync_pps(usrp_state_t *s)
}
extern "C" {
- int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
+ int device_init(openair0_device_t *device, openair0_config_t *openair0_cfg)
+ {
LOG_I(HW, "openair0_cfg[0].sdr_addrs == '%s'\n", openair0_cfg[0].sdr_addrs);
LOG_I(HW, "openair0_cfg[0].clock_source == '%d' (internal = %d, external = %d)\n", openair0_cfg[0].clock_source,internal,external);
usrp_state_t *s ;
diff --git a/radio/emulator/rf_emulator.c b/radio/emulator/rf_emulator.c
index e73e9bf3d6..7fb2e2979a 100644
--- a/radio/emulator/rf_emulator.c
+++ b/radio/emulator/rf_emulator.c
@@ -115,7 +115,7 @@ static void *emulator_timing_job(void *arg)
/*! \brief Called to start the RF transceiver. Return 0 if OK, < 0 if error
* \param device pointer to the device structure specific to the RF hardware target
*/
-static int emulator_start(openair0_device *device)
+static int emulator_start(openair0_device_t *device)
{
// Start the timing thread and the noise device
emulator_state_t *emulator_state = (emulator_state_t *)device->priv;
@@ -163,7 +163,7 @@ static int emulator_start(openair0_device *device)
* \param device pointer to the device structure specific to the RF hardware target
* \returns 0 on success
*/
-int emulator_get_stats(openair0_device *device)
+int emulator_get_stats(openair0_device_t *device)
{
return (0);
}
@@ -172,7 +172,7 @@ int emulator_get_stats(openair0_device *device)
* \param device pointer to the device structure specific to the RF hardware target
* \returns 0 on success
*/
-int emulator_reset_stats(openair0_device *device)
+int emulator_reset_stats(openair0_device_t *device)
{
return (0);
}
@@ -180,7 +180,7 @@ int emulator_reset_stats(openair0_device *device)
/*! \brief Terminate operation of the RF transceiver -- free all associated resources (if any)
* \param pointer to the device structure specific to the RF hardware target
*/
-static void emulator_end(openair0_device *device)
+static void emulator_end(openair0_device_t *device)
{
// Stop the timing thread and the noise device
emulator_state_t *emulator_state = (emulator_state_t *)device->priv;
@@ -197,7 +197,7 @@ static void emulator_end(openair0_device *device)
/*! \brief Stop RF
* \param device pointer to the device structure specific to the RF hardware target
*/
-int emulator_stop(openair0_device *device)
+int emulator_stop(openair0_device_t *device)
{
return (0);
}
@@ -207,7 +207,7 @@ int emulator_stop(openair0_device *device)
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
-int emulator_set_gains(openair0_device *device, openair0_config_t *openair0_cfg)
+int emulator_set_gains(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
return (0);
}
@@ -217,12 +217,12 @@ int emulator_set_gains(openair0_device *device, openair0_config_t *openair0_cfg)
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
-int emulator_set_freq(openair0_device *device, openair0_config_t *openair0_cfg)
+int emulator_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
return (0);
}
-int emulator_write_init(openair0_device *device)
+int emulator_write_init(openair0_device_t *device)
{
return (0);
}
@@ -235,7 +235,7 @@ int emulator_write_init(openair0_device *device)
* \param nbAnt number of antennas
* \param flags flags must be set to true if timestamp parameter needs to be applied
*/
-static int emulator_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int nbAnt, int flags)
+static int emulator_write(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int nbAnt, int flags)
{
emulator_state_t *emulator_state = (emulator_state_t *)device->priv;
@@ -297,7 +297,7 @@ static void read_noise(void *buff, int nsamps)
* \param nbAnt number of antennas
* \returns the number of samples read
*/
-static int emulator_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int nbAnt)
+static int emulator_read(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int nbAnt)
{
emulator_state_t *emulator_state = (emulator_state_t *)device->priv;
@@ -339,7 +339,7 @@ static void emulator_readconfig(emulator_state_t *emulator_state)
AssertFatal(ret >= 0, "configuration couldn't be performed\n");
}
-int device_init(openair0_device *device, openair0_config_t *openair0_cfg)
+int device_init(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
LOG_I(HW, "This is emulator RF that does nothing\n");
diff --git a/radio/fhi_72/CMakeLists.txt b/radio/fhi_72/CMakeLists.txt
index 6e918650e5..c0546aaca8 100644
--- a/radio/fhi_72/CMakeLists.txt
+++ b/radio/fhi_72/CMakeLists.txt
@@ -17,7 +17,7 @@ add_library(oran_fhlib_5g MODULE
)
set(E_VERSION 5.1.6)
-set(F_VERSION 6.1.6)
+set(F_VERSION 6.1.7)
find_package(xran REQUIRED)
if(xran_VERSION VERSION_EQUAL E_VERSION)
diff --git a/radio/fhi_72/oaioran.c b/radio/fhi_72/oaioran.c
index 149f492e6a..520191186e 100644
--- a/radio/fhi_72/oaioran.c
+++ b/radio/fhi_72/oaioran.c
@@ -363,7 +363,6 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
read_prach_data(ru, *frame, *slot);
const struct xran_fh_init *fh_init = get_xran_fh_init();
- int nPRBs = fh_cfg->nULRBs;
int fftsize = 1 << fh_cfg->nULFftSize;
int slot_offset_rxdata = 3 & (*slot);
@@ -386,93 +385,110 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
if (!is_tdd_ul_symbol(frame_conf, *slot, sym_idx))
continue;
- uint8_t *pData;
oran_buf_list_t *bufs = get_xran_buffers(ant_id / nb_rx_per_ru);
uint8_t *pPrbMapData = bufs->dstcp[ant_id % nb_rx_per_ru][tti % XRAN_N_FE_BUF_LEN].pBuffers->pData;
- struct xran_prb_map *pPrbMap = (struct xran_prb_map *)pPrbMapData;
+ struct xran_prb_map *pRbMap = (struct xran_prb_map *)pPrbMapData;
- struct xran_prb_elm *pRbElm = &pPrbMap->prbMap[0];
-#ifdef E_RELEASE
- struct xran_section_desc *p_sec_desc = pRbElm->p_sec_desc[sym_idx][0];
-#elif defined F_RELEASE
- struct xran_section_desc *p_sec_desc = &pRbElm->sec_desc[sym_idx][0];
-#endif
- uint32_t one_rb_size =
- (((pRbElm->iqWidth == 0) || (pRbElm->iqWidth == 16)) ? (N_SC_PER_PRB * 2 * 2) : (3 * pRbElm->iqWidth + 1));
- if (fh_init->mtu < pRbElm->nRBSize * one_rb_size)
- pData = bufs->dst[ant_id % nb_rx_per_ru][tti % XRAN_N_FE_BUF_LEN]
- .pBuffers[sym_idx % XRAN_NUM_OF_SYMBOL_PER_SLOT]
- .pData;
- else
- pData = p_sec_desc->pData;
- ptr = pData;
- pos = (int32_t *)(start_ptr + (4 * sym_idx * fftsize));
- if (ptr == NULL || pos == NULL)
- continue;
-
- struct xran_prb_map *pRbMap = pPrbMap;
-
- uint32_t idxElm = 0;
uint8_t *src = (uint8_t *)ptr;
- LOG_D(HW, "pRbMap->nPrbElm %d\n", pRbMap->nPrbElm);
- for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
- LOG_D(HW,
- "prbMap[%d] : PRBstart %d nPRBs %d\n",
- idxElm,
- pRbMap->prbMap[idxElm].nRBStart,
- pRbMap->prbMap[idxElm].nRBSize);
- pRbElm = &pRbMap->prbMap[idxElm];
- int pos_len = 0;
- int neg_len = 0;
+ // even when the fragmentation occurs, nRBSize & nRBStart carry the same values in each prbMap
+ // therefore, I took the liberty to just extract these values from the first prbMap
+ int num_totalRB = pRbMap->prbMap[0].nRBSize;
+ int start_totalRB = pRbMap->prbMap[0].nRBStart;
+ int32_t local_dst[num_totalRB * N_SC_PER_PRB] __attribute__((aligned(64)));
- if (pRbElm->nRBStart < (nPRBs >> 1)) // there are PRBs left of DC
- neg_len = min((nPRBs * 6) - (pRbElm->nRBStart * 12), pRbElm->nRBSize * N_SC_PER_PRB);
- pos_len = (pRbElm->nRBSize * N_SC_PER_PRB) - neg_len;
-
- src = pData;
- // Calculation of the pointer for the section in the buffer.
- // positive half
- uint8_t *dst1 = (uint8_t *)(pos + (neg_len == 0 ? ((pRbElm->nRBStart * N_SC_PER_PRB) - (nPRBs * 6)) : 0));
- // negative half
- uint8_t *dst2 = (uint8_t *)(pos + (pRbElm->nRBStart * N_SC_PER_PRB) + fftsize - (nPRBs * 6));
- int32_t local_dst[pRbElm->nRBSize * N_SC_PER_PRB] __attribute__((aligned(64)));
- if (pRbElm->compMethod == XRAN_COMPMETHOD_NONE) {
- // NOTE: gcc 11 knows how to generate AVX2 for this!
- for (idx = 0; idx < pRbElm->nRBSize * N_SC_PER_PRB * 2; idx++)
- ((int16_t *)local_dst)[idx] = ((int16_t)ntohs(((uint16_t *)src)[idx])) >> 2;
- memcpy((void *)dst2, (void *)local_dst, neg_len * 4);
- memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4);
- } else if (pRbElm->compMethod == XRAN_COMPMETHOD_BLKFLOAT) {
-#if defined(__i386__) || defined(__x86_64__)
- struct xranlib_decompress_request bfp_decom_req = {};
- struct xranlib_decompress_response bfp_decom_rsp = {};
-
- int16_t payload_len = (3 * pRbElm->iqWidth + 1) * pRbElm->nRBSize;
-
- bfp_decom_req.data_in = (int8_t *)src;
- bfp_decom_req.numRBs = pRbElm->nRBSize;
- bfp_decom_req.len = payload_len;
- bfp_decom_req.compMethod = pRbElm->compMethod;
- bfp_decom_req.iqWidth = pRbElm->iqWidth;
-
- bfp_decom_rsp.data_out = (int16_t *)local_dst;
- bfp_decom_rsp.len = 0;
-
- xranlib_decompress_avx512(&bfp_decom_req, &bfp_decom_rsp);
-#elif defined(__arm__) || defined(__aarch64__)
- armral_bfp_decompression(pRbElm->iqWidth, pRbElm->nRBSize, (int8_t *)src, (int16_t *)local_dst);
-#else
- AssertFatal(1 == 0, "BFP compression not supported on this architecture");
-#endif
- memcpy((void *)dst2, (void *)local_dst, neg_len * 4);
- memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4);
- outcnt++;
- } else {
- printf("pRbElm->compMethod == %d is not supported\n", pRbElm->compMethod);
- exit(-1);
+ LOG_D(HW, "[%d.%d] pRbMap->nPrbElm %d\n", *frame, *slot, pRbMap->nPrbElm);
+ for (uint32_t idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
+ int numRB, startRB;
+ uint8_t *pData;
+ struct xran_section_desc *p_sec_desc = NULL;
+ struct xran_prb_elm *pRbElm = &pRbMap->prbMap[idxElm];
+#ifdef E_RELEASE
+ uint32_t one_rb_size =
+ (((pRbElm->iqWidth == 0) || (pRbElm->iqWidth == 16)) ? (N_SC_PER_PRB * 2 * 2) : (3 * pRbElm->iqWidth + 1));
+ if (fh_init->mtu < num_totalRB * one_rb_size)
+ pData = bufs->dst[ant_id % nb_rx_per_ru][tti % XRAN_N_FE_BUF_LEN]
+ .pBuffers[sym_idx % XRAN_NUM_OF_SYMBOL_PER_SLOT]
+ .pData;
+ else {
+ p_sec_desc = pRbElm->p_sec_desc[sym_idx][0];
+ pData = p_sec_desc->pData;
}
- }
+ numRB = num_totalRB;
+ startRB = start_totalRB;
+ {
+ {
+#elif defined F_RELEASE
+ // UP_nRBSize & UP_nRBStart are for DL U-plane only
+ LOG_D(HW, "[%d.%d] idxElm[%d] startSym[%d]:numSym[%d] UP_startRB[%d]:UP_numRB[%d] sym_idx[%d] ant_id[%d] pRbElm->nRBStart[%d]:pRbElm->nRBSize[%d]\n", *frame, *slot, idxElm, pRbElm->nStartSymb, pRbElm->numSymb, pRbElm->UP_nRBStart, pRbElm->UP_nRBSize, sym_idx, ant_id, pRbElm->nRBStart, pRbElm->nRBSize);
+ for (int idxDesc = 0; idxDesc < XRAN_MAX_FRAGMENT; idxDesc++) {
+ p_sec_desc = &pRbElm->sec_desc[sym_idx][idxDesc];
+ if (p_sec_desc == NULL)
+ continue;
+ if (sym_idx >= pRbElm->nStartSymb && sym_idx < pRbElm->nStartSymb + pRbElm->numSymb) {
+ if (!p_sec_desc->pCtrl)
+ continue;
+ pData = p_sec_desc->pData;
+ numRB = p_sec_desc->num_prbu;
+ startRB = p_sec_desc->start_prbu;
+ // num_prbu & start_prbu are for UL U-plane only
+ LOG_D(HW, "p_sec_desc[%d] startRB[%d]:numRB[%d]\n", idxDesc, startRB, numRB);
+#endif
+ ptr = pData;
+ pos = (int32_t *)(start_ptr + (4 * sym_idx * fftsize));
+ if (ptr == NULL || pos == NULL)
+ continue;
+ src = pData;
+ if (pRbElm->compMethod == XRAN_COMPMETHOD_NONE) {
+ // NOTE: gcc 11 knows how to generate AVX2 for this!
+ for (idx = 0; idx < (numRB * N_SC_PER_PRB) * 2; idx++)
+ ((int16_t *)local_dst)[idx + startRB * N_SC_PER_PRB * 2] = ((int16_t)ntohs(((uint16_t *)src)[idx])) >> 2;
+ } else if (pRbElm->compMethod == XRAN_COMPMETHOD_BLKFLOAT) {
+#if defined(__i386__) || defined(__x86_64__)
+ struct xranlib_decompress_request bfp_decom_req = {};
+ struct xranlib_decompress_response bfp_decom_rsp = {};
+
+ int16_t payload_len = (3 * pRbElm->iqWidth + 1) * numRB;
+
+ bfp_decom_req.data_in = (int8_t *)src;
+ bfp_decom_req.numRBs = numRB;
+ bfp_decom_req.len = payload_len;
+ bfp_decom_req.compMethod = pRbElm->compMethod;
+ bfp_decom_req.iqWidth = pRbElm->iqWidth;
+
+ bfp_decom_rsp.data_out = (int16_t *) (local_dst + startRB * N_SC_PER_PRB);
+ bfp_decom_rsp.len = 0;
+
+ xranlib_decompress_avx512(&bfp_decom_req, &bfp_decom_rsp);
+#elif defined(__arm__) || defined(__aarch64__)
+ armral_bfp_decompression(pRbElm->iqWidth, numRB, (int8_t *)src, (int16_t *)local_dst);
+#else
+ AssertFatal(1 == 0, "BFP compression not supported on this architecture");
+#endif
+ outcnt++;
+ } else {
+ printf("pRbElm->compMethod == %d is not supported\n", pRbElm->compMethod);
+ exit(-1);
+ }
+ if ((startRB + numRB) == (start_totalRB + num_totalRB)) {
+ int pos_len = 0;
+ int neg_len = 0;
+
+ if (start_totalRB < (num_totalRB >> 1)) // there are PRBs left of DC
+ neg_len = min((num_totalRB * 6) - (start_totalRB * 12), num_totalRB * N_SC_PER_PRB);
+ pos_len = (num_totalRB * N_SC_PER_PRB) - neg_len;
+ // Calculation of the pointer for the section in the buffer.
+ // positive half
+ uint8_t *dst1 = (uint8_t *)(pos + (neg_len == 0 ? ((start_totalRB * N_SC_PER_PRB) - (num_totalRB * 6)) : 0));
+ // negative half
+ uint8_t *dst2 = (uint8_t *)(pos + (start_totalRB * N_SC_PER_PRB) + fftsize - (num_totalRB * 6));
+ memcpy((void *)dst2, (void *)local_dst, neg_len * 4);
+ memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4);
+ }
+ }
+ } // idxDesc
+ } // idxElm
+
} // sym_ind
} // ant_ind
} // vv_inf
@@ -521,7 +537,6 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
const struct xran_fh_init *fh_init = get_xran_fh_init();
const struct xran_fh_config *fh_cfg = get_xran_fh_config(0);
- int nPRBs = fh_cfg->nDLRBs;
int fftsize = 1 << fh_cfg->nDLFftSize;
int nb_tx_per_ru = ru->nb_tx / fh_init->xran_ports;
int nb_rx_per_ru = ru->nb_rx / fh_init->xran_ports;
@@ -539,8 +554,7 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
}
// This loop would better be more inner to avoid confusion and maybe also errors.
for (int32_t sym_idx = 0; sym_idx < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_idx++) {
- /* the callback is for mixed and UL slots. In mixed, we have to
- * skip DL and guard symbols. */
+ /* skip DL and guard symbols. */
if (!is_tdd_ul_symbol(frame_conf, slot, sym_idx)) {
continue;
}
@@ -548,15 +562,18 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
uint8_t *pPrbMapData = bufs->dstcp[ant_id % nb_rx_per_ru][tti % XRAN_N_FE_BUF_LEN].pBuffers->pData;
struct xran_prb_map *pPrbMap = (struct xran_prb_map *)pPrbMapData;
- struct xran_prb_elm *pRbElm = &pPrbMap->prbMap[0];
-
- struct xran_prb_map *pRbMap = pPrbMap;
- uint32_t idxElm = 0;
-
- LOG_D(HW, "pRbMap->nPrbElm %d\n", pRbMap->nPrbElm);
- for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
- LOG_D(HW, "prbMap[%d] : PRBstart %d nPRBs %d\n", idxElm, pRbMap->prbMap[idxElm].nRBStart, pRbMap->prbMap[idxElm].nRBSize);
- pRbElm = &pRbMap->prbMap[idxElm];
+ LOG_D(HW, "pPrbMap->nPrbElm %d\n", pPrbMap->nPrbElm);
+ for (uint32_t idxElm = 0; idxElm < pPrbMap->nPrbElm; idxElm++) {
+ struct xran_prb_elm *pRbElm = &pPrbMap->prbMap[idxElm];
+ int numRB, startRB;
+#ifdef E_RELEASE
+ numRB = pRbElm->nRBSize;
+ startRB = pRbElm->nRBStart;
+#elif F_RELEASE
+ numRB = pRbElm->UP_nRBSize;
+ startRB = pRbElm->UP_nRBStart;
+#endif
+ LOG_D(HW, "pPrbMap[%d] : PRBstart %d nPRBs %d\n", idxElm, startRB, numRB);
if (first) {
// ant_id / no of antenna per beam gives the beam_nb
pRbElm->nBeamIndex =
@@ -583,9 +600,8 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
}
// This loop would better be more inner to avoid confusion and maybe also errors.
for (int32_t sym_idx = 0; sym_idx < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_idx++) {
- /* the callback is for mixed and UL slots. In mixed, we have to
- * skip UL and guard symbols. */
- if (is_tdd_ul_symbol(frame_conf, slot, sym_idx)) {
+ /* skip UL and guard symbols. */
+ if (!is_tdd_dl_symbol(frame_conf, slot, sym_idx)) {
continue;
}
uint8_t *pData =
@@ -596,20 +612,36 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
pos = &ru->txdataF_BF[ant_id][sym_idx * fftsize];
uint8_t *u8dptr;
- struct xran_prb_map *pRbMap = pPrbMap;
- int32_t sym_id = sym_idx % XRAN_NUM_OF_SYMBOL_PER_SLOT;
+ // even when the fragmentation occurs, nRBSize & nRBStart carry the same values in each prbMap
+ // therefore, I took the liberty to just extract these values from the first prbMap
+ struct xran_prb_elm *p_prbMapElm = &pPrbMap->prbMap[0];
+ int num_totalRB = p_prbMapElm->nRBSize;
+ int start_totalRB = p_prbMapElm->nRBStart;
+
+ int pos_len = 0;
+ int neg_len = 0;
+
+ if (start_totalRB < (num_totalRB >> 1)) // there are PRBs left of DC
+ neg_len = min((num_totalRB * 6) - (start_totalRB * 12), num_totalRB * N_SC_PER_PRB);
+ pos_len = (num_totalRB * N_SC_PER_PRB) - neg_len;
+ // Calculation of the pointer for the section in the buffer.
+ // start of positive frequency component
+ uint16_t *src1 = (uint16_t *)&pos[(neg_len == 0) ? ((start_totalRB * N_SC_PER_PRB) - (num_totalRB * 6)) : 0];
+ // start of negative frequency component
+ uint16_t *src2 = (uint16_t *)&pos[(start_totalRB * N_SC_PER_PRB) + fftsize - (num_totalRB * 6)];
+
+ uint32_t local_src[num_totalRB * N_SC_PER_PRB] __attribute__((aligned(64)));
+ memcpy((void *)local_src, (void *)src2, neg_len * 4);
+ memcpy((void *)&local_src[neg_len], (void *)src1, pos_len * 4);
if (ptr && pos) {
- uint32_t idxElm = 0;
u8dptr = (uint8_t *)ptr;
int16_t payload_len = 0;
uint8_t *dst = (uint8_t *)u8dptr;
- struct xran_prb_elm *p_prbMapElm = &pRbMap->prbMap[idxElm];
-
- for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
+ for (uint32_t idxElm = 0; idxElm < pPrbMap->nPrbElm; idxElm++) {
struct xran_section_desc *p_sec_desc = NULL;
- p_prbMapElm = &pRbMap->prbMap[idxElm];
+ struct xran_prb_elm *p_prbMapElm = &pPrbMap->prbMap[idxElm];
if (sym_idx == 0) {
// ant_id / no of antenna per beam gives the beam_nb
p_prbMapElm->nBeamIndex = ru->beam_id[ant_id / (ru->nb_tx / ru->num_beams_period)][slot * XRAN_NUM_OF_SYMBOL_PER_SLOT];
@@ -618,11 +650,18 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
p_prbMapElm->nBeamIndex = 0;
}
- // assumes one fragment per symbol
+ // radio-transport fragmentation is not supported in both E and F releases;
+ // E-bit = 1 => each ethernet frame is considered as the last fragment;
+ // a group of PRBs per each symbol is encapsulated in one ethernet frame.
+ // => seems that the RUs don't check for E-bit
#ifdef E_RELEASE
- p_sec_desc = p_prbMapElm->p_sec_desc[sym_id][0];
+ p_sec_desc = p_prbMapElm->p_sec_desc[sym_idx][0];
+ int16_t startRB = p_prbMapElm->nRBStart;
+ int16_t numRB = p_prbMapElm->nRBSize;
#elif F_RELEASE
- p_sec_desc = &p_prbMapElm->sec_desc[sym_id][0];
+ p_sec_desc = &p_prbMapElm->sec_desc[sym_idx][0];
+ int16_t startRB = p_prbMapElm->UP_nRBStart;
+ int16_t numRB = p_prbMapElm->UP_nRBSize;
#endif
dst = xran_add_hdr_offset(dst, p_prbMapElm->compMethod);
@@ -633,36 +672,28 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
}
uint16_t *dst16 = (uint16_t *)dst;
- int pos_len = 0;
- int neg_len = 0;
-
- if (p_prbMapElm->nRBStart < (nPRBs >> 1)) // there are PRBs left of DC
- neg_len = min((nPRBs * 6) - (p_prbMapElm->nRBStart * 12), p_prbMapElm->nRBSize * N_SC_PER_PRB);
- pos_len = (p_prbMapElm->nRBSize * N_SC_PER_PRB) - neg_len;
- // Calculation of the pointer for the section in the buffer.
- // start of positive frequency component
- uint16_t *src1 = (uint16_t *)&pos[(neg_len == 0) ? ((p_prbMapElm->nRBStart * N_SC_PER_PRB) - (nPRBs * 6)) : 0];
- // start of negative frequency component
- uint16_t *src2 = (uint16_t *)&pos[(p_prbMapElm->nRBStart * N_SC_PER_PRB) + fftsize - (nPRBs * 6)];
-
- uint32_t local_src[p_prbMapElm->nRBSize * N_SC_PER_PRB] __attribute__((aligned(64)));
- memcpy((void *)local_src, (void *)src2, neg_len * 4);
- memcpy((void *)&local_src[neg_len], (void *)src1, pos_len * 4);
if (p_prbMapElm->compMethod == XRAN_COMPMETHOD_NONE) {
- payload_len = p_prbMapElm->nRBSize * N_SC_PER_PRB * 4L;
+ payload_len = numRB * N_SC_PER_PRB * 4L;
/* convert to Network order */
// NOTE: ggc 11 knows how to generate AVX2 for this!
- for (idx = 0; idx < (pos_len + neg_len) * 2; idx++)
- ((uint16_t *)dst16)[idx] = htons(((uint16_t *)local_src)[idx]);
+ for (idx = 0; idx < (numRB * N_SC_PER_PRB) * 2; idx++)
+ ((uint16_t *)dst16)[idx] = htons(((uint16_t *)local_src)[idx + startRB * N_SC_PER_PRB * 2]);
} else if (p_prbMapElm->compMethod == XRAN_COMPMETHOD_BLKFLOAT) {
- payload_len = (3 * p_prbMapElm->iqWidth + 1) * p_prbMapElm->nRBSize;
+ payload_len = (3 * p_prbMapElm->iqWidth + 1) * numRB;
#if defined(__i386__) || defined(__x86_64__)
struct xranlib_compress_request bfp_com_req = {};
struct xranlib_compress_response bfp_com_rsp = {};
- bfp_com_req.data_in = (int16_t *)local_src;
- bfp_com_req.numRBs = p_prbMapElm->nRBSize;
+ uint32_t src_compr[num_totalRB * N_SC_PER_PRB] __attribute__((aligned(64)));
+ if (numRB == num_totalRB) {
+ bfp_com_req.data_in = (int16_t *)local_src;
+ } else {
+ memcpy(src_compr, local_src + (startRB * N_SC_PER_PRB), (numRB * N_SC_PER_PRB) * sizeof(*local_src));
+ bfp_com_req.data_in = (int16_t *)src_compr;
+ }
+
+ bfp_com_req.numRBs = numRB;
bfp_com_req.len = payload_len;
bfp_com_req.compMethod = p_prbMapElm->compMethod;
bfp_com_req.iqWidth = p_prbMapElm->iqWidth;
@@ -672,11 +703,10 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
xranlib_compress_avx512(&bfp_com_req, &bfp_com_rsp);
#elif defined(__arm__) || defined(__aarch64__)
- armral_bfp_compression(p_prbMapElm->iqWidth, p_prbMapElm->nRBSize, (int16_t *)local_src, (int8_t *)dst);
+ armral_bfp_compression(p_prbMapElm->iqWidth, numRB, (int16_t *)local_src, (int8_t *)dst);
#else
AssertFatal(1 == 0, "BFP compression not supported on this architecture");
#endif
-
} else {
printf("p_prbMapElm->compMethod == %d is not supported\n", p_prbMapElm->compMethod);
exit(-1);
@@ -690,7 +720,7 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
}
// The tti should be updated as it increased.
- pRbMap->tti_id = tti;
+ pPrbMap->tti_id = tti;
} else {
printf("ptr ==NULL\n");
@@ -702,6 +732,7 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
return (0);
}
+#ifdef F_RELEASE
/** @details Read PRACH and PUSCH data from xran buffers. If
* I/Q compression (bitwidth < 16 bits) is configured, deccompresses the data
* before writing. Prints ON TIME counters every 128 frames.
@@ -764,7 +795,7 @@ int xran_fh_rx_read_slot_BySymbol(ru_info_t *ru, int *frame, int *slot)
const struct xran_fh_init *fh_init = get_xran_fh_init();
int nPRBs = fh_cfg->nULRBs;
- int fftsize = 1 << fh_cfg->ru_conf.fftSize;
+ int fftsize = 1 << fh_cfg->nULFftSize;
int slot_offset_rxdata = 3 & (*slot);
uint32_t slot_size = 4 * 14 * fftsize;
@@ -942,7 +973,7 @@ int xran_fh_tx_send_slot_BySymbol(ru_info_t *ru, int frame, int slot, uint64_t t
const struct xran_fh_init *fh_init = get_xran_fh_init();
const struct xran_fh_config *fh_cfg = get_xran_fh_config(0);
int nPRBs = fh_cfg->nDLRBs;
- int fftsize = 1 << fh_cfg->ru_conf.fftSize;
+ int fftsize = 1 << fh_cfg->nDLFftSize;
int nb_tx_per_ru = ru->nb_tx / fh_init->xran_ports;
int nb_rx_per_ru = ru->nb_rx / fh_init->xran_ports;
@@ -1168,3 +1199,4 @@ int xran_fh_tx_send_slot_BySymbol(ru_info_t *ru, int frame, int slot, uint64_t t
}
return (0);
}
+#endif
\ No newline at end of file
diff --git a/radio/fhi_72/oran-config.c b/radio/fhi_72/oran-config.c
index 00c13bc64d..8283b63a7d 100644
--- a/radio/fhi_72/oran-config.c
+++ b/radio/fhi_72/oran-config.c
@@ -184,7 +184,8 @@ void print_fh_init(const struct xran_fh_init *fh_init)
fh_init->filePrefix,
fh_init->mtu,
fh_init->p_o_du_addr);
- print_ether_addr(" p_o_ru_addr", fh_init->xran_ports * fh_init->io_cfg.num_vfs, (struct rte_ether_addr *)fh_init->p_o_ru_addr);
+ if (fh_init->p_o_ru_addr) print_ether_addr(" p_o_ru_addr", fh_init->xran_ports * fh_init->io_cfg.num_vfs, (struct rte_ether_addr *)fh_init->p_o_ru_addr);
+ else if (fh_init->p_o_du_addr) print_ether_addr(" p_o_du_addr", fh_init->xran_ports * fh_init->io_cfg.num_vfs, (struct rte_ether_addr *)fh_init->p_o_du_addr);
printf("\
totalBfWeights %d\n",
fh_init->totalBfWeights);
@@ -460,14 +461,14 @@ char bbdev_dev[32] = "";
char bbdev_vfio_vf_token[64] = "";
#endif
-static bool set_fh_io_cfg(struct xran_io_cfg *io_cfg, const paramdef_t *fhip, int nump, const int num_rus)
+static bool set_fh_io_cfg(struct xran_io_cfg *io_cfg, const paramdef_t *fhip, int nump, const int num_rus, const int is_du)
{
DevAssert(fhip != NULL);
int num_dev = gpd(fhip, nump, ORAN_CONFIG_DPDK_DEVICES)->numelt;
AssertFatal(num_dev > 0, "need to provide DPDK devices for O-RAN 7.2 Fronthaul\n");
AssertFatal(num_dev < 17, "too many DPDK devices for O-RAN 7.2 Fronthaul\n");
- io_cfg->id = 0; // 0 -> xran as O-DU; 1 -> xran as O-RU
+ io_cfg->id = 1 - is_du; // 0 -> xran as O-DU; 1 -> xran as O-RU
io_cfg->num_vfs = num_dev; // number of VFs for C-plane and U-plane (should be even); max = XRAN_VF_MAX
io_cfg->num_rxq = 1; // number of RX queues per VF
for (int i = 0; i < num_dev; ++i) {
@@ -540,7 +541,7 @@ static bool set_fh_io_cfg(struct xran_io_cfg *io_cfg, const paramdef_t *fhip, in
/* if RU does support, io_cfg->eowd_cmn[0] should only be filled as id = O_DU; io_cfg->eowd_cmn[1] only used if id = O_RU */
const uint16_t owdm_enable = *gpd(fhip, nump, ORAN_CONFIG_ECPRI_OWDM)->uptr;
if (owdm_enable) {
- io_cfg->eowd_cmn[0].initiator_en = 1; // 1 -> initiator (always O-DU), 0 -> recipient (always O-RU)
+ io_cfg->eowd_cmn[0].initiator_en = is_du ? 1 : 0; // 1 -> initiator (always O-DU), 0 -> recipient (always O-RU)
io_cfg->eowd_cmn[0].numberOfSamples = 8; // total number of samples to be collected and averaged per port
io_cfg->eowd_cmn[0].filterType = 0; // 0 -> simple average based on number of measurements; not used in xran in both E and F releases
io_cfg->eowd_cmn[0].responseTo = 10000000; // response timeout in [ns]
@@ -678,6 +679,19 @@ static bool set_fh_init(void *mplane_api, struct xran_fh_init *fh_init, enum xra
const int nfh = sizeofArray(FHconfigs);
config_getlist(config_get_if(), &FH_ConfigList, FHconfigs, nfh, aprefix);
+ int num_rus = FH_ConfigList.numelt; // based on the number of fh_config sections -> number of RUs
+ int is_du = 0;
+
+ int num_ru_addr = gpd(fhip, nump, ORAN_CONFIG_RU_ADDR)->numelt;
+ int num_du_addr = gpd(fhip, nump, ORAN_CONFIG_DU_ADDR)->numelt;
+ if (num_ru_addr > 0 && num_du_addr == 0)
+ is_du = 1;
+ else if (num_du_addr > 0 && num_ru_addr == 0)
+ is_du = 0;
+ else
+ AssertFatal(false, "Illegal node configuration, num_du_addr %d, num_ru_addr %d\n", num_du_addr, num_ru_addr);
+ fh_init->xran_ports = is_du == 1 ? num_rus : num_du_addr;
+
#ifdef OAI_MPLANE
ru_session_list_t *ru_session_list = (ru_session_list_t *)mplane_api;
int num_rus = ru_session_list->num_rus;
@@ -687,8 +701,8 @@ static bool set_fh_init(void *mplane_api, struct xran_fh_init *fh_init, enum xra
if (!set_fh_eaxcid_conf_mplane(&fh_init->eAxCId_conf, xran_cat, ru_session_list))
return false;
/* maximum transmission unit (MTU) is the size of the largest protocol data unit (PDU) that can be
- communicated in a single xRAN network layer transaction. Supported 1500 bytes and 9600 bytes (Jumbo Frame);
- xran only checks if (MTU <= 1500), therefore setting any value > 1500, xran assumes 9600 value is used */
+ communicated in a single xRAN network layer transaction. Based on the MTU size, xran calculates the number
+ of DL fragments (nPrbElm) needed for transmission of one symbol. */
fh_init->mtu = ru_session_list->ru_session[0].xran_mplane.mtu; // we suppose that each RU supports the same MTU size
int num_ru_addr = (fh_init->io_cfg.one_vf_cu_plane) ? num_rus : 2*num_rus;
@@ -704,26 +718,44 @@ static bool set_fh_init(void *mplane_api, struct xran_fh_init *fh_init, enum xra
}
}
#else
- int num_rus = FH_ConfigList.numelt; // based on the number of fh_config sections -> number of RUs
- fh_init->xran_ports = num_rus; // since we use xran as O-DU, xran_ports is set to the number of RUs
- if (!set_fh_io_cfg(&fh_init->io_cfg, fhip, nump, num_rus))
+
+ if (!set_fh_io_cfg(&fh_init->io_cfg, fhip, nump, num_rus, is_du))
return false;
if (!set_fh_eaxcid_conf(&fh_init->eAxCId_conf, xran_cat))
return false;
/* maximum transmission unit (MTU) is the size of the largest protocol data unit (PDU) that can be
- communicated in a single xRAN network layer transaction. Supported 1500 bytes and 9600 bytes (Jumbo Frame);
- xran only checks if (MTU <= 1500), therefore setting any value > 1500, xran assumes 9600 value is used */
+ communicated in a single xRAN network layer transaction. Based on the MTU size, xran calculates the number
+ of DL fragments (nPrbElm) needed for transmission of one symbol. */
fh_init->mtu = *gpd(fhip, nump, ORAN_CONFIG_MTU)->uptr;
- int num_ru_addr = gpd(fhip, nump, ORAN_CONFIG_RU_ADDR)->numelt;
- fh_init->p_o_ru_addr = calloc(num_ru_addr, sizeof(struct rte_ether_addr));
- AssertFatal(fh_init->p_o_ru_addr != NULL, "out of memory\n");
- char **ru_addrs = gpd(fhip, nump, ORAN_CONFIG_RU_ADDR)->strlistptr;
- for (int i = 0; i < num_ru_addr; ++i) {
- struct rte_ether_addr *ea = (struct rte_ether_addr *)fh_init->p_o_ru_addr;
- if (get_ether_addr(ru_addrs[i], &ea[i]) == NULL) {
- printf("could not read ethernet address '%s' for RU!\n", ru_addrs[i]);
- return false;
+
+ fh_init->p_o_du_addr = NULL; // DPDK retreives DU MAC address within the xran library with rte_eth_macaddr_get() function
+
+ char **ru_addrs,**du_addrs;
+
+ if (is_du > 0) {
+ fh_init->p_o_ru_addr = calloc(num_ru_addr, sizeof(struct rte_ether_addr));
+ ru_addrs = gpd(fhip, nump, ORAN_CONFIG_RU_ADDR)->strlistptr;
+ AssertFatal(fh_init->p_o_ru_addr != NULL, "out of memory\n");
+ for (int i = 0; i < num_ru_addr; ++i) {
+ struct rte_ether_addr *ea = (struct rte_ether_addr *)fh_init->p_o_ru_addr;
+ if (get_ether_addr(ru_addrs[i], &ea[i]) == NULL) {
+ printf("could not read ethernet address '%s' for RU!\n", ru_addrs[i]);
+ return false;
+ }
}
+ fh_init->p_o_du_addr = NULL;
+ } else {
+ fh_init->p_o_du_addr = calloc(num_du_addr, sizeof(struct rte_ether_addr));
+ du_addrs = gpd(fhip, nump, ORAN_CONFIG_DU_ADDR)->strlistptr;
+ AssertFatal(fh_init->p_o_du_addr != NULL, "out of memory\n");
+ for (int i = 0; i < num_du_addr; ++i) {
+ struct rte_ether_addr *ea = (struct rte_ether_addr *)fh_init->p_o_du_addr;
+ if (get_ether_addr(du_addrs[i], &ea[i]) == NULL) {
+ printf("could not read ethernet address '%s' for DU!\n", du_addrs[i]);
+ return false;
+ }
+ }
+ fh_init->p_o_ru_addr = NULL;
}
#endif
@@ -732,7 +764,6 @@ static bool set_fh_init(void *mplane_api, struct xran_fh_init *fh_init, enum xra
/* used to specify a unique prefix for shared memory, and files created by multiple DPDK processes;
it is necessary */
fh_init->filePrefix = strdup(*gpd(fhip, nump, ORAN_CONFIG_FILE_PREFIX)->strptr);
- fh_init->p_o_du_addr = NULL; // DPDK retreives DU MAC address within the xran library with rte_eth_macaddr_get() function
fh_init->totalBfWeights = 0; // only used if id = O_RU (for emulation); C-plane extension types; section 5.4.6 of CUS spec
#ifdef F_RELEASE
diff --git a/radio/fhi_72/oran-init.c b/radio/fhi_72/oran-init.c
index 9707084a2f..4de6d00f20 100644
--- a/radio/fhi_72/oran-init.c
+++ b/radio/fhi_72/oran-init.c
@@ -92,7 +92,7 @@ static struct xran_prb_map get_xran_prb_map(const struct xran_fh_config *f, cons
.cc_id = 0,
.ru_port_id = 0,
.tti_id = 0,
- .nPrbElm = 1,
+ .nPrbElm = 1, // represents the number of fragments on DL only; calculated in xran_init_PrbMap_from_cfg()/xran_init_PrbMap_by_symbol_from_cfg()
};
struct xran_prb_elm *e = &prbmap.prbMap[0];
e->nStartSymb = start_sym;
diff --git a/radio/fhi_72/oran.h b/radio/fhi_72/oran.h
index c79bc88fa3..059d33d79e 100644
--- a/radio/fhi_72/oran.h
+++ b/radio/fhi_72/oran.h
@@ -28,7 +28,7 @@ void oran_fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp);
void oran_fh_if4p5_south_in(RU_t *ru, int *frame, int *slot);
-int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params);
+int transport_init(openair0_device_t *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params);
typedef struct {
eth_state_t e;
diff --git a/radio/fhi_72/oran_isolate.c b/radio/fhi_72/oran_isolate.c
index 9b97b58390..89b16d7198 100644
--- a/radio/fhi_72/oran_isolate.c
+++ b/radio/fhi_72/oran_isolate.c
@@ -55,7 +55,7 @@ typedef struct {
notifiedFIFO_t oran_sync_fifo;
-int trx_oran_start(openair0_device *device)
+int trx_oran_start(openair0_device_t *device)
{
printf("ORAN: %s\n", __FUNCTION__);
@@ -71,14 +71,14 @@ int trx_oran_start(openair0_device *device)
return 0;
}
-void trx_oran_end(openair0_device *device)
+void trx_oran_end(openair0_device_t *device)
{
printf("ORAN: %s\n", __FUNCTION__);
oran_eth_state_t *s = device->priv;
xran_close(s->oran_priv);
}
-int trx_oran_stop(openair0_device *device)
+int trx_oran_stop(openair0_device_t *device)
{
printf("ORAN: %s\n", __FUNCTION__);
oran_eth_state_t *s = device->priv;
@@ -91,19 +91,19 @@ int trx_oran_stop(openair0_device *device)
return (0);
}
-int trx_oran_set_freq(openair0_device *device, openair0_config_t *openair0_cfg)
+int trx_oran_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
printf("ORAN: %s\n", __FUNCTION__);
return (0);
}
-int trx_oran_set_gains(openair0_device *device, openair0_config_t *openair0_cfg)
+int trx_oran_set_gains(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
printf("ORAN: %s\n", __FUNCTION__);
return (0);
}
-int trx_oran_get_stats(openair0_device *device)
+int trx_oran_get_stats(openair0_device_t *device)
{
uint64_t total_time, used_time;
uint32_t num_core_used, core_used[64];
@@ -114,25 +114,25 @@ int trx_oran_get_stats(openair0_device *device)
return (0);
}
-int trx_oran_reset_stats(openair0_device *device)
+int trx_oran_reset_stats(openair0_device_t *device)
{
printf("ORAN: %s\n", __FUNCTION__);
return (0);
}
-int ethernet_tune(openair0_device *device, unsigned int option, int value)
+int ethernet_tune(openair0_device_t *device, unsigned int option, int value)
{
printf("ORAN: %s\n", __FUNCTION__);
return 0;
}
-int trx_oran_write_raw(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
+int trx_oran_write_raw(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags)
{
printf("ORAN: %s\n", __FUNCTION__);
return 0;
}
-int trx_oran_read_raw(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc)
+int trx_oran_read_raw(openair0_device_t *device, openair0_timestamp_t *timestamp, void **buff, int nsamps, int cc)
{
printf("ORAN: %s\n", __FUNCTION__);
return 0;
@@ -160,7 +160,7 @@ char *msg_type(int t)
return s[t];
}
-int trx_oran_ctlsend(openair0_device *device, void *msg, ssize_t msg_len)
+int trx_oran_ctlsend(openair0_device_t *device, void *msg, ssize_t msg_len)
{
RRU_CONFIG_msg_t *rru_config_msg = msg;
oran_eth_state_t *s = device->priv;
@@ -174,7 +174,7 @@ int trx_oran_ctlsend(openair0_device *device, void *msg, ssize_t msg_len)
return msg_len;
}
-int trx_oran_ctlrecv(openair0_device *device, void *msg, ssize_t msg_len)
+int trx_oran_ctlrecv(openair0_device_t *device, void *msg, ssize_t msg_len)
{
RRU_CONFIG_msg_t *rru_config_msg = msg;
oran_eth_state_t *s = device->priv;
@@ -230,9 +230,11 @@ void oran_fh_if4p5_south_in(RU_t *ru, int *frame, int *slot)
start_meas(&ru->rx_fhaul);
struct xran_fh_config *fh_cfg = get_xran_fh_config(0);
int ret = 0;
+#ifdef F_RELEASE
if (fh_cfg->RunSlotPrbMapBySymbolEnable)
ret = xran_fh_rx_read_slot_BySymbol(&ru_info, &f, &sl);
else
+#endif
ret = xran_fh_rx_read_slot(&ru_info, &f, &sl);
stop_meas(&ru->rx_fhaul);
LOG_D(HW, "Read %d.%d rxdataF %p,%p\n", f, sl, ru_info.rxdataF[0], ru_info.rxdataF[1]);
@@ -290,9 +292,11 @@ void oran_fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
struct xran_fh_config *fh_cfg = get_xran_fh_config(0);
int ret = 0;
+#ifdef F_RELEASE
if (fh_cfg->RunSlotPrbMapBySymbolEnable)
ret = xran_fh_tx_send_slot_BySymbol(&ru_info, frame, slot, timestamp);
else
+#endif
ret = xran_fh_tx_send_slot(&ru_info, frame, slot, timestamp);
if (ret != 0) {
printf("ORAN: ORAN_fh_if4p5_south_out ERROR in TX function \n");
@@ -312,7 +316,7 @@ void *get_internal_parameter(char *name)
return NULL;
}
-__attribute__((__visibility__("default"))) int transport_init(openair0_device *device,
+__attribute__((__visibility__("default"))) int transport_init(openair0_device_t *device,
openair0_config_t *openair0_cfg,
eth_params_t *eth_params)
{
@@ -397,7 +401,6 @@ __attribute__((__visibility__("default"))) int transport_init(openair0_device *d
eth->e.if_name = eth_params->local_if_name;
eth->last_msg = (rru_config_msg_type_t)-1;
- device->Mod_id = 0;
device->transp_type = ETHERNET_TP;
device->trx_start_func = trx_oran_start;
device->trx_get_stats_func = trx_oran_get_stats;
diff --git a/radio/fhi_72/oran_isolate.h b/radio/fhi_72/oran_isolate.h
index bb3f17d42b..dfd315dd29 100644
--- a/radio/fhi_72/oran_isolate.h
+++ b/radio/fhi_72/oran_isolate.h
@@ -60,9 +60,13 @@ typedef struct ru_info_s {
* @param frame output of the frame which has been read.
* @param slot output of the slot which has been read. */
int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot);
+#ifdef F_RELEASE
int xran_fh_rx_read_slot_BySymbol(ru_info_t *ru, int *frame, int *slot);
+#endif
/** @brief Writes TX data (PDSCH) of given slot. */
int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp);
+#ifdef F_RELEASE
int xran_fh_tx_send_slot_BySymbol(ru_info_t *ru, int frame, int slot, uint64_t timestamp);
+#endif
#endif /* _ORAN_ISOLATE_H_ */
diff --git a/radio/iqplayer/iqplayer_lib.c b/radio/iqplayer/iqplayer_lib.c
index 2df57c9202..efd4a62b25 100644
--- a/radio/iqplayer/iqplayer_lib.c
+++ b/radio/iqplayer/iqplayer_lib.c
@@ -23,8 +23,6 @@
*
* \author:FrancoisTaburet: francois.taburet@nokia-bell-labs.com
*/
-#define _LARGEFILE_SOURCE
-#define _FILE_OFFSET_BITS 64
#include
#include
#include
@@ -57,7 +55,8 @@ static void busy_wait(uint32_t usecs) {
//LOG_I(HW, "Expected: %d Elapsed: %d us\n", usecs, elapsed_usecs);
}
-static void parse_iqfile_header(openair0_device *device, iqfile_header_t *iq_fh) {
+static void parse_iqfile_header(openair0_device_t *device, iqfile_header_t *iq_fh)
+{
char tmp[4]=OAIIQFILE_ID;
AssertFatal((memcmp(iq_fh->oaiid,tmp,sizeof(iq_fh->oaiid)) == 0),
"iqfile doesn't seem to be compatible with oai (invalid id %.4s in header)\n",
@@ -69,11 +68,11 @@ static void parse_iqfile_header(openair0_device *device, iqfile_header_t *iq_fh)
LOG_UI(HW,"Replay iqs from %s device, bandwidth %e\n",get_devname(iq_fh->devtype),iq_fh->bw);
}
-
/*! \brief Called to start the iqplayer device. Return 0 if OK, < 0 if error
@param device pointer to the device structure specific to the RF hardware target
*/
-static int iqplayer_loadfile(openair0_device *device, openair0_config_t *openair0_cfg) {
+static int iqplayer_loadfile(openair0_device_t *device, openair0_config_t *openair0_cfg)
+{
recplay_state_t *s = device->recplay_state;
recplay_conf_t *c = openair0_cfg->recplay_conf;
@@ -142,7 +141,7 @@ static int iqplayer_loadfile(openair0_device *device, openair0_config_t *openair
* \param device the hardware to use
* \returns 0 on success
*/
-static int trx_iqplayer_get_stats(openair0_device *device)
+static int trx_iqplayer_get_stats(openair0_device_t *device)
{
LOG_I(HW, "trx_iqplayer_get_stats() called, not implemented\n");
return 0;
@@ -152,7 +151,7 @@ static int trx_iqplayer_get_stats(openair0_device *device)
* \param device the hardware to use
* \returns 0 in success
*/
-static int trx_iqplayer_reset_stats(openair0_device *device)
+static int trx_iqplayer_reset_stats(openair0_device_t *device)
{
LOG_I(HW, "trx_iqplayer_reset_stats() called, not implemented\n");
return 0;
@@ -160,7 +159,7 @@ static int trx_iqplayer_reset_stats(openair0_device *device)
/*! \brief Stop operation of the transceiver
*/
-static int trx_iqplayer_stop(openair0_device *device)
+static int trx_iqplayer_stop(openair0_device_t *device)
{
LOG_I(HW, "trx_iqplayer_stop() called, not implemented\n");
return 0;
@@ -171,7 +170,7 @@ static int trx_iqplayer_stop(openair0_device *device)
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
-static int trx_iqplayer_set_freq(openair0_device *device, openair0_config_t *openair0_cfg)
+static int trx_iqplayer_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
LOG_I(HW, "trx_iqplayer_set_freq() called, not implemented\n");
return 0;
@@ -182,7 +181,7 @@ static int trx_iqplayer_set_freq(openair0_device *device, openair0_config_t *ope
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 in success
*/
-static int trx_iqplayer_set_gains(openair0_device *device, openair0_config_t *openair0_cfg)
+static int trx_iqplayer_set_gains(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
LOG_I(HW, "trx_iqplayer_set_gains() called, not implemented\n");
return 0;
@@ -191,14 +190,16 @@ static int trx_iqplayer_set_gains(openair0_device *device, openair0_config_t *op
/*! \brief start the oai iq player
* \param device, the hardware used
*/
-static int trx_iqplayer_start(openair0_device *device) {
+static int trx_iqplayer_start(openair0_device_t *device)
+{
return 0;
}
/*! \brief Terminate operation of the oai iq player
* \param device, the hardware used
*/
-static void trx_iqplayer_end(openair0_device *device) {
+static void trx_iqplayer_end(openair0_device_t *device)
+{
if (device == NULL)
return;
if (device->recplay_state == NULL)
@@ -218,7 +219,6 @@ static void trx_iqplayer_end(openair0_device *device) {
close(device->recplay_state->fd);
device->recplay_state->fd = -1;
}
-
}
/*! \brief Write iqs function when in replay mode, just introduce a delay, as configured at init time,
@param device pointer to the device structure specific to the RF hardware target
@@ -228,7 +228,8 @@ static void trx_iqplayer_end(openair0_device *device) {
@param antenna_id index of the antenna if the device has multiple antennas
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
-static int trx_iqplayer_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
+static int trx_iqplayer_write(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags)
+{
struct timespec req;
req.tv_sec = 0;
req.tv_nsec = device->openair0_cfg->recplay_conf->u_sf_write_delay * 1000;
@@ -247,7 +248,8 @@ static int trx_iqplayer_write(openair0_device *device, openair0_timestamp timest
* \param antenna_id Index of antenna for which to receive samples
* \returns the number of sample read
*/
-static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
+static int trx_iqplayer_read(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **buff, int nsamps, int cc)
+{
recplay_state_t *s = device->recplay_state;
static struct timeval tprev;
static int read_count = 0;
@@ -324,7 +326,8 @@ static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimes
return nsamps;
}
-int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
+int device_init(openair0_device_t *device, openair0_config_t *openair0_cfg)
+{
device->openair0_cfg = openair0_cfg;
device->trx_start_func = trx_iqplayer_start;
device->trx_get_stats_func = trx_iqplayer_get_stats;
diff --git a/radio/rfsimulator/README.md b/radio/rfsimulator/README.md
index 298c7ecfda..c05df0fbbd 100644
--- a/radio/rfsimulator/README.md
+++ b/radio/rfsimulator/README.md
@@ -64,42 +64,44 @@ This is equivalent to using `-w SIMU` when running the `build_oai` script.
To use the RF simulator add the `--rfsim` option to the command line. By
default the RF simulator device will try to connect to host 127.0.0.1, port
4043, which is usually the behavior for the UE. For the eNB/gNB, you either
-have to pass `--rfsimulator.serveraddr server` on the command line, or specify
+have to pass `--rfsimulator.[0].serveraddr server` on the command line, or specify
the corresponding section in the configuration file.
The RF simulator is using the configuration module, and its parameters are defined in a specific section called "rfsimulator". Add the following options to the command line in order to enable different RFSim features:
-| CL option | usage | default |
-|:--------------------- |:-------------------------------------------------------------------------------|----: |
-|`--rfsimulator.serveraddr ` | IPv4v6 address or DNS name to connect to, or `server` to behave as a IPv4v6 TCP server | 127.0.0.1 |
-|`--rfsimulator.serverport ` | port number to connect to or to listen on (eNB, which behaves as a tcp server) | 4043 |
-|`--rfsimulator.options` | list of comma separated run-time options, two are supported: `chanmod`, `saviq`| all options disabled |
-|`--rfsimulator.options saviq` | store IQs to a file for future replay | disabled |
-|`--rfsimulator.options chanmod` | enable the channel model | disabled |
-|`--rfsimulator.IQfile ` | path to a file to store the IQ samples to (only with `saviq`) | `/tmp/rfsimulator.iqs` |
-|`--rfsimulator.prop_delay` | simulated receive-path (gNB: UL, UE: DL) propagation delay in ms | 0 |
-|`--rfsimulator.wait_timeout` | wait timeout when no UE is connected | 1 |
+| CL option | usage | default |
+|:-------------------------------------|:-------------------------------------------------------------------------------|----: |
+|`--rfsimulator.[0].serveraddr ` | IPv4v6 address or DNS name to connect to, or `server` to behave as a IPv4v6 TCP server | 127.0.0.1 |
+|`--rfsimulator.[0].serverport ` | port number to connect to or to listen on (eNB, which behaves as a tcp server) | 4043 |
+|`--rfsimulator.[0].options` | list of comma separated run-time options, two are supported: `chanmod`, `saviq`| all options disabled |
+|`--rfsimulator.[0].options saviq` | store IQs to a file for future replay | disabled |
+|`--rfsimulator.[0].options chanmod` | enable the channel model | disabled |
+|`--rfsimulator.[0].IQfile ` | path to a file to store the IQ samples to (only with `saviq`) | `/tmp/rfsimulator.iqs` |
+|`--rfsimulator.[0].prop_delay` | simulated receive-path (gNB: UL, UE: DL) propagation delay in ms | 0 |
+|`--rfsimulator.[0].wait_timeout` | wait timeout when no UE is connected | 1 |
Please refer to this document [`SIMULATION/TOOLS/DOC/channel_simulation.md`](../../openair1/SIMULATION/TOOLS/DOC/channel_simulation.md) for information about using the RFSimulator options to run the simulator with a channel model.
## 4G case
-For the eNB, use a valid configuration file setup for the USRP board tests and start the softmodem with the `--rfsim` and `--rfsimulator.serveraddr server` options.
+For the eNB, use a valid configuration file setup for the USRP board tests and start the softmodem with the `--rfsim` and `--rfsimulator.[0].serveraddr server` options.
```bash
-sudo ./lte-softmodem -O --rfsim --rfsimulator.serveraddr server
+sudo ./lte-softmodem -O --rfsim --rfsimulator.[0].serveraddr server
```
Often, configuration files define the corresponding `rfsimulator` section, in
-which case you might omit `--rfsimulator.serveraddr server`. Example:
+which case you might omit `--rfsimulator.[0].serveraddr server`. Example:
```
-rfsimulator : {
- serveraddr = "server";
-};
+rfsimulator = (
+ {
+ serveraddr = "server";
+ }
+);
```
For the UE, it should be set to the IP address of the eNB. For instance, if the
eNB runs on another host with IP `192.168.2.200`, do
```bash
-sudo ./lte-uesoftmodem -C 2685000000 -r 50 --rfsim --rfsimulator.serveraddr 192.168.2.200
+sudo ./lte-uesoftmodem -C 2685000000 -r 50 --rfsim --rfsimulator.[0].serveraddr 192.168.2.200
```
For running on the same host, only `--rfsim` is necessary.
@@ -117,7 +119,7 @@ Similarly as for 4G, first launch the gNB, here in an example for the phytest:
run gNB:
```bash
- sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --gNBs.[0].min_rxtxtime 6 --phy-test --rfsim --rfsimulator.serveraddr server
+ sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --gNBs.[0].min_rxtxtime 6 --phy-test --rfsim --rfsimulator.[0].serveraddr server
```
where `--gNBs.[0].min_rxtxtime 6` is due to the UE not being able to handle shorter
@@ -127,19 +129,19 @@ in the config file.
and run UE:
```bash
- sudo ./nr-uesoftmodem --rfsim --phy-test --rfsimulator.serveraddr
+ sudo ./nr-uesoftmodem --rfsim --phy-test --rfsimulator.[0].serveraddr
```
To run OAI RFSimulator for SA mode, gNB:
```bash
- sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --rfsimulator.serveraddr server
+ sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --rfsimulator.[0].serveraddr server
```
and UE:
```bash
- sudo ./nr-uesoftmodem --rfsim --rfsimulator.serveraddr
+ sudo ./nr-uesoftmodem --rfsim --rfsimulator.[0].serveraddr
```
In the commands for the UE, `TARGET_GNB_IP_ADDRESS` can be 127.0.0.1 if both UE and gNB run on the same machine.
@@ -182,7 +184,7 @@ In case of a transparent GEO satellite, the minumum one-way propagation delay (D
So, additionally to other parameters, this parameter should be given when executing the gNB and the UE executables:
```
---rfsimulator.prop_delay 238.74
+--rfsimulator.[0].prop_delay 238.74
```
Note:
@@ -218,8 +220,8 @@ RFsimulator supports beam domain simulation.
Several new CLI parameters were added
-* `--rfsimulator.enable_beams` : enable beam domain simulation. Should match on server and all clients.
-* `--rfsimulator.beam_gains ` : define a matrix of additional pathloss values (in dB)
+* `--rfsimulator.[0].enable_beams` : enable beam domain simulation. Should match on server and all clients.
+* `--rfsimulator.[0].beam_gains ` : define a matrix of additional pathloss values (in dB)
to simulate the effect of different beam combinations in the RF simulator. You provide a comma-separated
list of numbers, which forms the first row of a square matrix. The rest of the matrix is filled by projecting
these values onto the diagonals, making it symmetric.
@@ -236,10 +238,10 @@ these values onto the diagonals, making it symmetric.
Using the example above, if gNB is receiving in beam 1 and the UE is transmitting in beam 1, an additional
2 dB pathloss will be applied on top of the pathloss from the channel model (if present).
-* `--rfsimulator.beam_map ` : where `` is a `uint64_t` value where each bit is an enabled TX/RX beam.
+* `--rfsimulator.[0].beam_map ` : where `` is a `uint64_t` value where each bit is an enabled TX/RX beam.
For gNB: Initial beam_map, i.e. which beams gNB transmits/receives before calling beam APIs.
For UE: Beam position in beam space in the simulation. The UE is not expected to use the beam APIs for now.
-* `--rfsimulator.beam_ids ` : where `` is a comma separated list. Same as above but added for convenience.
+* `--rfsimulator.[0].beam_ids ` : where `` is a comma separated list. Same as above but added for convenience.
## Runtime commands
diff --git a/radio/rfsimulator/apply_channelmod.c b/radio/rfsimulator/apply_channelmod.c
index d1d1042451..4b7f526970 100644
--- a/radio/rfsimulator/apply_channelmod.c
+++ b/radio/rfsimulator/apply_channelmod.c
@@ -27,9 +27,8 @@
#include "openair2/LAYER2/NR_MAC_gNB/mac_config.h"
#include "rfsimulator.h"
-void update_channel_model(channel_desc_t *channelDesc, uint64_t TS)
+void update_channel_model(channel_desc_t *channelDesc, int nbSamples, uint64_t TS)
{
- static uint64_t last_TS = 0;
if ((channelDesc->sat_height > 0)
&& (channelDesc->enable_dynamic_delay
|| channelDesc->enable_dynamic_Doppler)) { // model for transparent satellite on circular orbit
@@ -137,8 +136,7 @@ void update_channel_model(channel_desc_t *channelDesc, uint64_t TS)
if (channelDesc->enable_dynamic_Doppler)
channelDesc->Doppler_phase_inc = 2 * M_PI * f_Doppler_shift_ue_sat / channelDesc->sampling_rate;
- if (TS - last_TS >= channelDesc->sampling_rate) {
- last_TS = TS;
+ if (TS / (unsigned int)channelDesc->sampling_rate != (TS + nbSamples) / (unsigned int)channelDesc->sampling_rate) {
LOG_I(HW,
"Satellite orbit: time %f s, Position = (%f, %f, %f), Velocity = (%f, %f, %f)\n",
t,
@@ -204,8 +202,7 @@ void update_channel_model(channel_desc_t *channelDesc, uint64_t TS)
if (channelDesc->enable_dynamic_Doppler)
channelDesc->Doppler_phase_inc = 2 * M_PI * f_Doppler_shift_sat_ue / channelDesc->sampling_rate;
- if (TS - last_TS >= channelDesc->sampling_rate) {
- last_TS = TS;
+ if (TS / (unsigned int)channelDesc->sampling_rate != (TS + nbSamples) / (unsigned int)channelDesc->sampling_rate) {
LOG_I(HW,
"Satellite orbit: time %f s, Position = (%f, %f, %f), Velocity = (%f, %f, %f)\n",
t,
diff --git a/radio/rfsimulator/rfsimulator.h b/radio/rfsimulator/rfsimulator.h
index 802a2a2e34..71af48ed07 100644
--- a/radio/rfsimulator/rfsimulator.h
+++ b/radio/rfsimulator/rfsimulator.h
@@ -30,5 +30,5 @@ void rxAddInput(c16_t **input_sig,
channel_desc_t *channelDesc,
int nbSamples,
uint64_t TS);
-void update_channel_model(channel_desc_t *channelDesc, uint64_t TS);
+void update_channel_model(channel_desc_t *channelDesc, int nbSamples, uint64_t TS);
#endif
diff --git a/radio/rfsimulator/simulator.cpp b/radio/rfsimulator/simulator.cpp
index ef6be135e6..83bdba990a 100644
--- a/radio/rfsimulator/simulator.cpp
+++ b/radio/rfsimulator/simulator.cpp
@@ -49,7 +49,6 @@
#include
#include
#include "common_lib.h"
-#define CHANNELMOD_DYNAMICLOAD
extern "C" {
#include
#include
@@ -81,7 +80,19 @@ typedef enum { SIMU_ROLE_SERVER = 1, SIMU_ROLE_CLIENT } simuRole;
//
#define RFSIMU_SECTION "rfsimulator"
+#define RFSIMU_SERVER_ADDR "serveraddr"
+#define RFSIMU_SERVER_PORT "serverport"
#define RFSIMU_OPTIONS_PARAMNAME "options"
+#define RFSIMU_IQFILE "IQfile"
+#define RFSIMU_MODELNAME "modelname"
+#define RFSIMU_PLOSS "ploss"
+#define RFSIMU_FORGETFACT "forgetfact"
+#define RFSIMU_OFFSET "offset"
+#define RFSIMU_PROP_DELAY "prop_delay"
+#define RFSIMU_WAIT_TIMEOUT "wait_timeout"
+#define RFSIMU_ENABLE_BEAMS "enable_beams"
+#define RFSIMU_NUM_CONCURRENT_BEAMS "num_concurrent_beams"
+#define RFSIMU_BEAM_MAP "beam_map"
#define RFSIMU_BEAM_GAINS "beam_gains"
#define RFSIMU_BEAM_IDS "beam_ids"
@@ -98,19 +109,19 @@ typedef enum { SIMU_ROLE_SERVER = 1, SIMU_ROLE_CLIENT } simuRole;
/* optname helpstr paramflags XXXptr defXXXval */
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
#define RFSIMULATOR_PARAMS_DESC { \
- STRINGPARAM("serveraddr", "\n", simOpt, &rfsimulator->ip, "127.0.0.1"), \
- UINT16PARAM("serverport", "\n", simOpt, &rfsimulator->port, PORT), \
+ STRINGPARAM(RFSIMU_SERVER_ADDR, "\n", simOpt, NULL, "127.0.0.1"), \
+ UINT16PARAM(RFSIMU_SERVER_PORT, "\n", simOpt, NULL, PORT), \
STRLISTPARAM(RFSIMU_OPTIONS_PARAMNAME, RFSIM_CONFIG_HELP_OPTIONS, simOpt, NULL, NULL), \
- STRINGPARAM("IQfile", "\n", simOpt, &saveF, "/tmp/rfsimulator.iqs"),\
- STRINGPARAM("modelname", "\n", simOpt, &modelname, "AWGN"), \
- DOUBLEPARAM("ploss", "\n", simOpt, &rfsimulator->chan_pathloss, 0), \
- DOUBLEPARAM("forgetfact", "\n", simOpt, &rfsimulator->chan_forgetfact, 0), \
- UINT64PARAM("offset", "\n", simOpt, &rfsimulator->chan_offset, 0L), \
- DOUBLEPARAM("prop_delay", "\n", simOpt, &(rfsimulator->prop_delay_ms), 0.0), \
- INTPARAM("wait_timeout", "\n", simOpt, &rfsimulator->wait_timeout, 1), \
- BOOLPARAM("enable_beams", "\n", simBool,&(beam_ctrl->enable_beams), 0), \
- INTPARAM("num_concurrent_beams", "\n", simOpt, &beam_ctrl->num_concurrent_beams, 1), \
- UINT64PARAM("beam_map", "\n", simOpt, &beam_map, 1), \
+ STRINGPARAM(RFSIMU_IQFILE, "\n", simOpt, NULL, "/tmp/rfsimulator.iqs"),\
+ STRINGPARAM(RFSIMU_MODELNAME, "\n", simOpt, NULL, "AWGN"), \
+ DOUBLEPARAM(RFSIMU_PLOSS, "\n", simOpt, NULL, 0), \
+ DOUBLEPARAM(RFSIMU_FORGETFACT, "\n", simOpt, NULL, 0), \
+ UINT64PARAM(RFSIMU_OFFSET, "\n", simOpt, NULL, 0L), \
+ DOUBLEPARAM(RFSIMU_PROP_DELAY, "\n", simOpt, NULL, 0.0), \
+ INTPARAM(RFSIMU_WAIT_TIMEOUT, "\n", simOpt, NULL, 1), \
+ BOOLPARAM(RFSIMU_ENABLE_BEAMS, "\n", simBool,NULL, 0), \
+ INTPARAM(RFSIMU_NUM_CONCURRENT_BEAMS, "\n", simOpt, NULL, 1), \
+ UINT64PARAM(RFSIMU_BEAM_MAP, "\n", simOpt, NULL, 1), \
STRINGPARAM(RFSIMU_BEAM_IDS, "\n", simOpt, NULL, NULL), \
STRINGPARAM(RFSIMU_BEAM_GAINS, "\n", simOpt, NULL, NULL), \
};
@@ -141,7 +152,7 @@ typedef c16_t sample_t; // 2*16 bits complex number
typedef struct beam_switch_command_t {
std::vector beams;
- openair0_timestamp timestamp;
+ openair0_timestamp_t timestamp;
} beam_switch_command_t;
typedef struct {
@@ -157,7 +168,7 @@ typedef struct {
typedef struct buffer_s {
int conn_sock;
- openair0_timestamp lastReceivedTS;
+ openair0_timestamp_t lastReceivedTS;
bool headerMode;
bool trashingPacket;
samplesBlockHeader_t th;
@@ -182,9 +193,10 @@ typedef struct {
typedef struct {
int listen_sock, epollfd;
pthread_mutex_t Sockmutex;
+ int ru_id;
unsigned int nb_cnx;
- openair0_timestamp nextRxTstamp;
- openair0_timestamp lastWroteTS;
+ openair0_timestamp_t nextRxTstamp;
+ openair0_timestamp_t lastWroteTS;
simuRole role;
char *ip;
uint16_t port;
@@ -218,7 +230,7 @@ typedef struct {
* @param nsamps_out output pointer to receive the number of samples until the next beam switch.
* @return The beam map (uint64_t) valid for the given timestamp.
*/
-static std::vector get_beams(beam_state_t *beam_state, openair0_timestamp timestamp, uint32_t nsamps, uint32_t *nsamps_out)
+static std::vector get_beams(beam_state_t *beam_state, openair0_timestamp_t timestamp, uint32_t nsamps, uint32_t *nsamps_out)
{
std::lock_guard lock(beam_state->mutex);
std::vector current_beams = beam_state->beams;
@@ -284,7 +296,7 @@ static uint64_t beams_to_beam_map(const std::vector &beam_ids)
* @param beam_state Pointer to the beam_state_t structure containing the command queue and current beam map.
* @param timestamp The timestamp up to which commands should be processed and removed.
*/
-static void clear_beam_queue(beam_state_t *beam_state, openair0_timestamp timestamp)
+static void clear_beam_queue(beam_state_t *beam_state, openair0_timestamp_t timestamp)
{
std::lock_guard lock(beam_state->mutex);
while (!beam_state->cmd_queue.empty()) {
@@ -354,7 +366,7 @@ static buffer_t *allocCirBuf(rfsimulator_state_t *bridge, int sock)
sizeofArray(modelname),
"rfsimu_channel_%s%d",
(bridge->role == SIMU_ROLE_SERVER) ? "ue" : "enB",
- bridge->nb_cnx - 1);
+ (bridge->role == SIMU_ROLE_SERVER) ? bridge->nb_cnx - 1 : bridge->ru_id);
ptr->channel_model = find_channel_desc_fromname(modelname); // path_loss in dB
if (!ptr->channel_model) {
// Use legacy method to find channel model - this will use the same channel model for all clients
@@ -472,7 +484,7 @@ static float get_rx_gain_db(rfsimulator_state_t *rfsimulator, uint rx_beam, uint
return rfsimulator->beam_ctrl->beam_gains[rx_beam][tx_beam];
}
-static int rfsimulator_set_beams(openair0_device *device, uint64_t beam_map, openair0_timestamp timestamp)
+static int rfsimulator_set_beams(openair0_device_t *device, uint64_t beam_map, openair0_timestamp_t timestamp)
{
rfsimulator_state_t *s = static_cast(device->priv);
rfsim_beam_ctrl_t *beam_ctrl = s->beam_ctrl;
@@ -484,7 +496,7 @@ static int rfsimulator_set_beams(openair0_device *device, uint64_t beam_map, ope
return 0;
}
-static int rfsimulator_set_beams_vector(openair0_device *device, int* beams, int num_beams, openair0_timestamp timestamp)
+static int rfsimulator_set_beams_vector(openair0_device_t *device, int *beams, int num_beams, openair0_timestamp_t timestamp)
{
rfsimulator_state_t *s = static_cast(device->priv);
rfsim_beam_ctrl_t *beam_ctrl = s->beam_ctrl;
@@ -520,19 +532,45 @@ static void process_gains(char *str, rfsim_beam_ctrl_t *beam_ctrl)
static void rfsimulator_readconfig(rfsimulator_state_t *rfsimulator)
{
- char *saveF = NULL;
- char *modelname = NULL;
+ configmodule_interface_t *cfg = config_get_if();
+ paramdef_t *rfsimuParam;
+ paramdef_t rfsimuParams[] = RFSIMULATOR_PARAMS_DESC;
+ paramlist_def_t rfsimuParamList = {RFSIMU_SECTION, NULL, 0};
+ int ret = config_getlist(cfg, &rfsimuParamList, rfsimuParams, sizeofArray(rfsimuParams), NULL);
+ if (ret < 0 || rfsimuParamList.numelt <= 0) {
+ ret = config_get(cfg, rfsimuParams, sizeofArray(rfsimuParams), RFSIMU_SECTION);
+ AssertFatal(ret >= 0, "configuration couldn't be performed\n");
+ LOG_W(HW, "Warning: rfsimulator parameters should be provided as array elements!\n");
+ rfsimuParam = rfsimuParams;
+ } else {
+ int ru_id = rfsimulator->ru_id;
+ AssertFatal(rfsimuParamList.numelt > ru_id,
+ "no rfsimulator parameters (numelt %d) specified for card %d\n",
+ rfsimuParamList.numelt,
+ ru_id);
+ rfsimuParam = rfsimuParamList.paramarray[ru_id];
+ }
+
+ rfsimulator->ip = strdup(*(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_SERVER_ADDR)->strptr));
+ rfsimulator->port = *(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_SERVER_PORT)->u16ptr);
+ char *saveF = strdup(*(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_IQFILE)->strptr));
+//char *modelname = strdup(*(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_MODELNAME)->strptr));
+ rfsimulator->chan_pathloss = *(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_PLOSS)->dblptr);
+ rfsimulator->chan_forgetfact = *(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_FORGETFACT)->dblptr);
+ rfsimulator->chan_offset = *(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_OFFSET)->u64ptr);
+ rfsimulator->prop_delay_ms = *(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_PROP_DELAY)->dblptr);
+ rfsimulator->wait_timeout = *(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_WAIT_TIMEOUT)->iptr);
+
rfsim_beam_ctrl_t *beam_ctrl = rfsimulator->beam_ctrl;
- uint64_t beam_map = 1;
- paramdef_t rfsimu_params[] = RFSIMULATOR_PARAMS_DESC;
- int p = config_paramidx_fromname(rfsimu_params, sizeofArray(rfsimu_params), RFSIMU_OPTIONS_PARAMNAME);
- int ret = config_get(config_get_if(), rfsimu_params, sizeofArray(rfsimu_params), RFSIMU_SECTION);
- AssertFatal(ret >= 0, "configuration couldn't be performed\n");
+ beam_ctrl->enable_beams = *(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_ENABLE_BEAMS)->iptr);
+ beam_ctrl->num_concurrent_beams = *(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_NUM_CONCURRENT_BEAMS)->iptr);
+ uint64_t beam_map = *(gpd(rfsimuParam, sizeofArray(rfsimuParams), RFSIMU_BEAM_MAP)->u64ptr);
rfsimulator->saveIQfile = -1;
- for (int i = 0; i < rfsimu_params[p].numelt; i++) {
- if (strcmp(rfsimu_params[p].strlistptr[i], "saviq") == 0) {
+ int p = config_paramidx_fromname(rfsimuParams, sizeofArray(rfsimuParams), RFSIMU_OPTIONS_PARAMNAME);
+ for (int i = 0; i < rfsimuParam[p].numelt; i++) {
+ if (strcmp(rfsimuParam[p].strlistptr[i], "saviq") == 0) {
rfsimulator->saveIQfile = open(saveF, O_APPEND | O_CREAT | O_TRUNC | O_WRONLY, 0666);
if (rfsimulator->saveIQfile != -1)
@@ -543,7 +581,7 @@ static void rfsimulator_readconfig(rfsimulator_state_t *rfsimulator)
}
break;
- } else if (strcmp(rfsimu_params[p].strlistptr[i], "chanmod") == 0) {
+ } else if (strcmp(rfsimuParam[p].strlistptr[i], "chanmod") == 0) {
init_channelmod();
load_channellist(rfsimulator->tx_num_channels,
rfsimulator->rx_num_channels,
@@ -552,24 +590,24 @@ static void rfsimulator_readconfig(rfsimulator_state_t *rfsimulator)
rfsimulator->tx_bw);
rfsimulator->channelmod = true;
} else {
- fprintf(stderr, "unknown rfsimulator option: %s\n", rfsimu_params[p].strlistptr[i]);
+ fprintf(stderr, "unknown rfsimulator option: %s\n", rfsimuParam[p].strlistptr[i]);
exit(-1);
}
}
- int beam_gains_param_index = config_paramidx_fromname(rfsimu_params, sizeofArray(rfsimu_params), RFSIMU_BEAM_GAINS);
- if (rfsimu_params[beam_gains_param_index].strptr) {
- process_gains(*rfsimu_params[beam_gains_param_index].strptr, beam_ctrl);
+ int beam_gains_param_index = config_paramidx_fromname(rfsimuParams, sizeofArray(rfsimuParams), RFSIMU_BEAM_GAINS);
+ if (rfsimuParam[beam_gains_param_index].strptr) {
+ process_gains(*rfsimuParam[beam_gains_param_index].strptr, beam_ctrl);
}
std::vector initial_beams = beam_map_to_beams(beam_map);
beam_ctrl->rx.beams = initial_beams;
beam_ctrl->tx.beams = initial_beams;
- int beam_ids_param_index = config_paramidx_fromname(rfsimu_params, sizeofArray(rfsimu_params), RFSIMU_BEAM_IDS);
- if (rfsimu_params[beam_ids_param_index].strptr) {
+ int beam_ids_param_index = config_paramidx_fromname(rfsimuParams, sizeofArray(rfsimuParams), RFSIMU_BEAM_IDS);
+ if (rfsimuParam[beam_ids_param_index].strptr) {
std::vector beam_ids;
- std::stringstream ss(*rfsimu_params[beam_ids_param_index].strptr);
+ std::stringstream ss(*rfsimuParam[beam_ids_param_index].strptr);
std::string token;
while (std::getline(ss, token, ',')) {
beam_ids.push_back(std::stoi(token));
@@ -769,13 +807,13 @@ static int rfsimu_getdistance_cmd(char *buff, int debug, telnet_printfunc_t prnt
static int rfsimu_vtime_cmd(char *buff, int debug, telnet_printfunc_t prnt, void *arg)
{
rfsimulator_state_t *t = (rfsimulator_state_t *)arg;
- const openair0_timestamp ts = t->nextRxTstamp;
+ const openair0_timestamp_t ts = t->nextRxTstamp;
const double sample_rate = t->sample_rate;
prnt("%s: vtime measurement: TS %llu sample_rate %.3f\n", __func__, ts, sample_rate);
return CMDSTATUS_FOUND;
}
-static int startServer(openair0_device *device)
+static int startServer(openair0_device_t *device)
{
int sock = -1;
struct addrinfo *results = NULL;
@@ -885,7 +923,7 @@ static int client_try_connect(const char *host, uint16_t port)
return sock;
}
-static int startClient(openair0_device *device)
+static int startClient(openair0_device_t *device)
{
rfsimulator_state_t *t = static_cast(device->priv);
t->role = SIMU_ROLE_CLIENT;
@@ -928,7 +966,7 @@ static int startClient(openair0_device *device)
}
static int rfsimulator_write_internal(rfsimulator_state_t *t,
- openair0_timestamp timestamp,
+ openair0_timestamp_t timestamp,
void ***samplesVoid,
int nsamps,
int nbAnt,
@@ -986,8 +1024,8 @@ static int rfsimulator_write_internal(rfsimulator_state_t *t,
return nsamps;
}
-static int rfsimulator_write_beams(openair0_device *device,
- openair0_timestamp timestamp,
+static int rfsimulator_write_beams(openair0_device_t *device,
+ openair0_timestamp_t timestamp,
void ***samplesVoid,
int nsamps,
int nbAnt,
@@ -1022,7 +1060,7 @@ static int rfsimulator_write_beams(openair0_device *device,
return nsamps_initial;
}
-static int rfsimulator_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
+static int rfsimulator_write(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int nsamps, int cc, int flags)
{
void **tmp = buff;
return rfsimulator_write_beams(device, timestamp, &tmp, nsamps, cc, 1, flags);
@@ -1253,7 +1291,7 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, bool first_time)
static void rfsimulator_read_internal(rfsimulator_state_t *t,
c16_t **samples,
- openair0_timestamp timestamp,
+ openair0_timestamp_t timestamp,
int nsamps,
int nbAnt,
int rx_beam_id,
@@ -1355,8 +1393,8 @@ static void rfsimulator_read_internal(rfsimulator_state_t *t,
}
}
-static int rfsimulator_read_beams(openair0_device *device,
- openair0_timestamp *ptimestamp,
+static int rfsimulator_read_beams(openair0_device_t *device,
+ openair0_timestamp_t *ptimestamp,
void ***samplesVoid,
int nsamps,
int nbAnt,
@@ -1426,7 +1464,7 @@ static int rfsimulator_read_beams(openair0_device *device,
buffer_t *ptr = &t->buf[sock];
if (ptr->conn_sock != -1 && ptr->channel_model != NULL) {
- update_channel_model(ptr->channel_model, t->nextRxTstamp);
+ update_channel_model(ptr->channel_model, nsamps, t->nextRxTstamp);
}
}
@@ -1438,7 +1476,7 @@ static int rfsimulator_read_beams(openair0_device *device,
for (int a = 0; a < nbAnt; a++)
memset(samplesVoid[beam][a], 0, sampleToByte(nsamps, 1));
- openair0_timestamp timestamp = t->nextRxTstamp;
+ openair0_timestamp_t timestamp = t->nextRxTstamp;
int nsamps_to_process = nsamps;
while (nsamps_to_process > 0) {
uint32_t nsamps_beam_map;
@@ -1488,7 +1526,7 @@ static int rfsimulator_read_beams(openair0_device *device,
buffer_t *ptr = &t->buf[sock];
if (ptr->conn_sock != -1 && !ptr->received_packets.empty()) {
- openair0_timestamp timestamp_to_free = t->nextRxTstamp - 1;
+ openair0_timestamp_t timestamp_to_free = t->nextRxTstamp - 1;
if (ptr->channel_model) {
timestamp_to_free -=
(ptr->channel_model->channel_length - 1) + std::max(ptr->channel_model->channel_offset, t->chan_offset);
@@ -1502,20 +1540,20 @@ static int rfsimulator_read_beams(openair0_device *device,
return nsamps;
}
-static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, void **samplesVoid, int nsamps, int nbAnt)
+static int rfsimulator_read(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **samplesVoid, int nsamps, int nbAnt)
{
return rfsimulator_read_beams(device, ptimestamp, &samplesVoid, nsamps, nbAnt, 1);
}
-static int rfsimulator_get_stats(openair0_device *device)
+static int rfsimulator_get_stats(openair0_device_t *device)
{
return 0;
}
-static int rfsimulator_reset_stats(openair0_device *device)
+static int rfsimulator_reset_stats(openair0_device_t *device)
{
return 0;
}
-static void rfsimulator_end(openair0_device *device)
+static void rfsimulator_end(openair0_device_t *device)
{
rfsimulator_state_t *s = static_cast(device->priv);
for (int i = 0; i < MAX_FD_RFSIMU; i++) {
@@ -1529,7 +1567,8 @@ static void rfsimulator_end(openair0_device *device)
close(s->epollfd);
free(s);
}
-static void stopServer(openair0_device *device)
+
+static void stopServer(openair0_device_t *device)
{
rfsimulator_state_t *t = (rfsimulator_state_t *)device->priv;
DevAssert(t != NULL);
@@ -1537,31 +1576,32 @@ static void stopServer(openair0_device *device)
rfsimulator_end(device);
}
-static int rfsimulator_stop(openair0_device *device)
+static int rfsimulator_stop(openair0_device_t *device)
{
return 0;
}
-static int rfsimulator_set_freq(openair0_device *device, openair0_config_t *openair0_cfg)
+static int rfsimulator_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
rfsimulator_state_t *s = static_cast(device->priv);
s->rx_freq = openair0_cfg->rx_freq[0];
return 0;
}
-static int rfsimulator_set_gains(openair0_device *device, openair0_config_t *openair0_cfg)
+static int rfsimulator_set_gains(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
return 0;
}
-static int rfsimulator_write_init(openair0_device *device)
+static int rfsimulator_write_init(openair0_device_t *device)
{
return 0;
}
-extern "C" __attribute__((__visibility__("default"))) int device_init(openair0_device *device, openair0_config_t *openair0_cfg)
+extern "C" __attribute__((__visibility__("default"))) int device_init(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
// to change the log level, use this on command line
// --log_config.hw_log_level debug
rfsimulator_state_t *rfsimulator = static_cast(calloc(sizeof(rfsimulator_state_t), 1));
// initialize channel simulation
+ rfsimulator->ru_id = openair0_cfg->ru_id;
rfsimulator->tx_num_channels = openair0_cfg->tx_num_channels;
rfsimulator->rx_num_channels = openair0_cfg->rx_num_channels;
rfsimulator->sample_rate = openair0_cfg->sample_rate;
@@ -1595,8 +1635,8 @@ extern "C" __attribute__((__visibility__("default"))) int device_init(openair0_d
}
/* let's pretend to be a b2x0 */
device->type = RFSIMULATOR;
- openair0_cfg[0].rx_gain[0] = 0;
- device->openair0_cfg = &openair0_cfg[0];
+ openair0_cfg->rx_gain[0] = 0;
+ device->openair0_cfg = openair0_cfg;
device->priv = rfsimulator;
device->trx_write_init = rfsimulator_write_init;
device->trx_set_beams = rfsimulator_set_beams;
diff --git a/radio/vrtsim/vrtsim.c b/radio/vrtsim/vrtsim.c
index 1b2b075bd0..f2f9cfef1d 100644
--- a/radio/vrtsim/vrtsim.c
+++ b/radio/vrtsim/vrtsim.c
@@ -20,6 +20,7 @@
*/
#include "PHY/TOOLS/tools_defs.h"
+#include "system.h"
#include
#include
#include
@@ -27,6 +28,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -123,6 +125,7 @@ typedef struct {
Actor_t *channel_modelling_actors;
char *taps_socket;
int client_num_rx_antennas;
+ struct timespec start_ts;
} vrtsim_state_t;
static void histogram_add(histogram_t *histogram, double diff)
@@ -203,30 +206,23 @@ static void vrtsim_readconfig(vrtsim_state_t *vrtsim_state)
static void *vrtsim_timing_job(void *arg)
{
vrtsim_state_t *vrtsim_state = arg;
- struct timespec timestamp;
- if (clock_gettime(CLOCK_REALTIME, ×tamp)) {
+ if (clock_gettime(CLOCK_REALTIME, &vrtsim_state->start_ts)) {
LOG_E(UTIL, "clock_gettime failed\n");
exit(1);
}
- double leftover_samples = 0;
+ int64_t last_sample_index = 0;
while (vrtsim_state->run_timing_thread) {
struct timespec current_time;
if (clock_gettime(CLOCK_REALTIME, ¤t_time)) {
LOG_E(UTIL, "clock_gettime failed\n");
exit(1);
}
- uint64_t diff = (current_time.tv_sec - timestamp.tv_sec) * 1000000000 + (current_time.tv_nsec - timestamp.tv_nsec);
- timestamp = current_time;
- double samples_to_produce = vrtsim_state->sample_rate * vrtsim_state->timescale * diff / 1e9;
-
- // Attempt to correct compounding rounding error
- leftover_samples += samples_to_produce - (uint64_t)samples_to_produce;
- if (leftover_samples > 1.0f) {
- samples_to_produce += 1;
- leftover_samples -= 1;
- }
- AssertFatal(samples_to_produce >= 0, "Negative samples to produce: %f\n", samples_to_produce);
+ uint64_t diff = (current_time.tv_sec - vrtsim_state->start_ts.tv_sec) * 1000000000
+ + (current_time.tv_nsec - vrtsim_state->start_ts.tv_nsec);
+ double sample_index = vrtsim_state->sample_rate * vrtsim_state->timescale * diff / 1e9;
+ int64_t samples_to_produce = sample_index - last_sample_index;
shm_td_iq_channel_produce_samples(vrtsim_state->channel, samples_to_produce);
+ last_sample_index = sample_index;
usleep(1);
}
return 0;
@@ -275,7 +271,7 @@ static client_info_t client_read_info(char *descriptor_file)
return client_info;
}
-static int vrtsim_connect(openair0_device *device)
+static int vrtsim_connect(openair0_device_t *device)
{
vrtsim_state_t *vrtsim_state = (vrtsim_state_t *)device->priv;
@@ -293,8 +289,7 @@ static int vrtsim_connect(openair0_device *device)
server_publish_client_info(client_info, vrtsim_state->connection_descriptor);
vrtsim_state->run_timing_thread = true;
- int ret = pthread_create(&vrtsim_state->timing_thread, NULL, vrtsim_timing_job, vrtsim_state);
- AssertFatal(ret == 0, "pthread_create() failed: errno: %d, %s\n", errno, strerror(errno));
+ threadCreate(&vrtsim_state->timing_thread, vrtsim_timing_job, vrtsim_state, "vrtsim_timing", -1, OAI_PRIORITY_RT_MAX);
} else {
client_info_t client_info = client_read_info(vrtsim_state->connection_descriptor);
AssertFatal(client_info.server_num_rx_antennas > 0, "Server did not publish valid client info, aborting client connection\n");
@@ -337,7 +332,7 @@ static int vrtsim_connect(openair0_device *device)
}
static int vrtsim_write_internal(vrtsim_state_t *vrtsim_state,
- openair0_timestamp timestamp,
+ openair0_timestamp_t timestamp,
c16_t *samples,
int nsamps,
int aarx,
@@ -366,7 +361,7 @@ static int vrtsim_write_internal(vrtsim_state_t *vrtsim_state,
typedef struct {
vrtsim_state_t *vrtsim_state;
- openair0_timestamp timestamp;
+ openair0_timestamp_t timestamp;
c16_t *samples[MAX_NUM_ANTENNAS_TX];
int nsamps;
int nbAnt;
@@ -469,7 +464,7 @@ static void perform_channel_modelling(void *arg)
}
static int vrtsim_write_with_chanmod(vrtsim_state_t *vrtsim_state,
- openair0_timestamp timestamp,
+ openair0_timestamp_t timestamp,
void **samplesVoid,
int nsamps,
int nbAnt,
@@ -478,7 +473,7 @@ static int vrtsim_write_with_chanmod(vrtsim_state_t *vrtsim_state,
// Sample history for channel impulse response
static c16_t saved_samples[MAX_NUM_ANTENNAS_TX][SAVED_SAMPLES_LEN] __attribute__((aligned(32))) = {0};
// Indicates what samples are saves in saved_samples
- static openair0_timestamp last_timestamp = 0;
+ static openair0_timestamp_t last_timestamp = 0;
const int batch_size = 4096;
AssertFatal(nbAnt <= MAX_NUM_ANTENNAS_TX, "Number of antennas %d exceeds maximum %d\n", nbAnt, MAX_NUM_ANTENNAS_TX);
@@ -533,7 +528,12 @@ static int vrtsim_write_with_chanmod(vrtsim_state_t *vrtsim_state,
return nsamps;
}
-static int vrtsim_write(openair0_device *device, openair0_timestamp timestamp, void **samplesVoid, int nsamps, int nbAnt, int flags)
+static int vrtsim_write(openair0_device_t *device,
+ openair0_timestamp_t timestamp,
+ void **samplesVoid,
+ int nsamps,
+ int nbAnt,
+ int flags)
{
AssertFatal(nsamps > 0, "Number of samples must be greater than 0\n");
AssertFatal(nbAnt > 0 && nbAnt <= MAX_NUM_ANTENNAS_TX,
@@ -548,8 +548,8 @@ static int vrtsim_write(openair0_device *device, openair0_timestamp timestamp, v
: vrtsim_write_internal(vrtsim_state, timestamp, (c16_t *)samplesVoid[0], nsamps, 0, flags, 0);
}
-static int vrtsim_write_beams(openair0_device *device,
- openair0_timestamp timestamp,
+static int vrtsim_write_beams(openair0_device_t *device,
+ openair0_timestamp_t timestamp,
void ***buff,
int nsamps,
int nb_antennas_tx,
@@ -560,7 +560,7 @@ static int vrtsim_write_beams(openair0_device *device,
return nsamps;
}
-static int vrtsim_read(openair0_device *device, openair0_timestamp *ptimestamp, void **samplesVoid, int nsamps, int nbAnt)
+static int vrtsim_read(openair0_device_t *device, openair0_timestamp_t *ptimestamp, void **samplesVoid, int nsamps, int nbAnt)
{
vrtsim_state_t *vrtsim_state = (vrtsim_state_t *)device->priv;
if (shm_td_iq_channel_is_aborted(vrtsim_state->channel)) {
@@ -599,7 +599,7 @@ static int vrtsim_read(openair0_device *device, openair0_timestamp *ptimestamp,
return nsamps;
}
-static void vrtsim_end(openair0_device *device)
+static void vrtsim_end(openair0_device_t *device)
{
vrtsim_state_t *vrtsim_state = (vrtsim_state_t *)device->priv;
if (vrtsim_state->role == ROLE_SERVER && vrtsim_state->run_timing_thread) {
@@ -653,33 +653,34 @@ static void vrtsim_end(openair0_device *device)
}
}
-static int vrtsim_stub(openair0_device *device)
-{
- return 0;
-}
-static int vrtsim_stub2(openair0_device *device, openair0_config_t *openair0_cfg)
+static int vrtsim_stub(openair0_device_t *device)
{
return 0;
}
-static int vrtsim_set_freq(openair0_device *device, openair0_config_t *openair0_cfg)
+static int vrtsim_stub2(openair0_device_t *device, openair0_config_t *openair0_cfg)
+{
+ return 0;
+}
+
+static int vrtsim_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
vrtsim_state_t *s = device->priv;
s->rx_freq = openair0_cfg->rx_freq[0];
return 0;
}
-static int vrtsim_set_beams(openair0_device *device, uint64_t beam_map, openair0_timestamp timestamp)
+static int vrtsim_set_beams(openair0_device_t *device, uint64_t beam_map, openair0_timestamp_t timestamp)
{
return 0;
}
-static int vrtsim_set_beams2(openair0_device *device, int *beam_ids, int num_beams, openair0_timestamp timestamp)
+static int vrtsim_set_beams2(openair0_device_t *device, int *beam_ids, int num_beams, openair0_timestamp_t timestamp)
{
return 0;
}
-__attribute__((__visibility__("default"))) int device_init(openair0_device *device, openair0_config_t *openair0_cfg)
+__attribute__((__visibility__("default"))) int device_init(openair0_device_t *device, openair0_config_t *openair0_cfg)
{
randominit();
vrtsim_state_t *vrtsim_state = calloc_or_fail(1, sizeof(vrtsim_state_t));
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf
index 0c053aeda2..5b26815a35 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf
@@ -196,13 +196,15 @@ RUs = (
}
);
-rfsimulator: {
-serveraddr = "server";
+rfsimulator = (
+ {
+ serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
-}
+ }
+);
log_config :
{
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci0.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci0.conf
index 8c200c72fd..f4176d70d3 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci0.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci0.conf
@@ -187,13 +187,13 @@ RUs = ({
clock_src = "internal";
});
-rfsimulator: {
+rfsimulator = ({
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
-}
+});
log_config: {
global_log_level = "info";
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci1.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci1.conf
index f87cc2bb8c..1154b03968 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci1.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band66.25prb.rfsim.pci1.conf
@@ -187,13 +187,13 @@ RUs = ({
clock_src = "internal";
});
-rfsimulator: {
+rfsimulator = ({
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
-}
+});
log_config: {
global_log_level = "info";
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf
index 1652758e4e..e590443239 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-benetel650.conf
@@ -237,7 +237,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("8c:1f:64:d1:10:46","8c:1f:64:d1:10:46");
- mtu = 9600;
+ mtu = 9216;
fh_config = ({
T1a_cp_dl = (419, 470);
T1a_cp_ul = (285, 336);
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-das-benetel650_650.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-das-benetel650_650.conf
index 1650f8a4e1..4a5553006a 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-das-benetel650_650.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.4x4-das-benetel650_650.conf
@@ -241,7 +241,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("8c:1f:64:d1:10:46","8c:1f:64:d1:10:46","8c:1f:64:d1:10:43","8c:1f:64:d1:10:43"); # if two VFs, set two RU MAC addresses (one per RU)
- mtu = 9600;
+ mtu = 9216;
fh_config = (
# RAN650 #1
{
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650.conf
index fdad2726c2..253d312eb0 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band77.273prb.fhi72.8x8-benetel650_650.conf
@@ -237,7 +237,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("8c:1f:64:d1:10:46","8c:1f:64:d1:10:46","8c:1f:64:d1:10:43","8c:1f:64:d1:10:43"); # if two VFs, set two RU MAC addresses (one per RU)
- mtu = 9600;
+ mtu = 9216;
fh_config = (
# RAN650 #1
{
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf
index 09eb99a6b2..cca51dbf7f 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf
@@ -185,13 +185,13 @@ RUs = ({
clock_src = "internal";
});
-rfsimulator: {
+rfsimulator =({
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
-}
+});
log_config: {
global_log_level = "info";
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf
index d2998de712..0c34ec90f9 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf
@@ -185,13 +185,13 @@ RUs = ({
clock_src = "internal";
});
-rfsimulator: {
+rfsimulator =({
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
-}
+});
log_config: {
global_log_level = "info";
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.conf
index 08691c3b62..96c9b3f6ed 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-pnf.band78.rfsim.conf
@@ -27,9 +27,9 @@ RUs = ({
max_rxgain = 125;
});
-rfsimulator: {
+rfsimulator = ({
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
-};
+});
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.aerial.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.aerial.conf
index 7b88ad23c4..046db5a780 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.aerial.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-vnf.sa.band78.273prb.aerial.conf
@@ -3,7 +3,6 @@ Active_gNBs = ( "gNB-OAI");
Asn1_verbosity = "none";
nfapi = "AERIAL";
-pdcp-drop = 1;
gNBs =
(
@@ -14,49 +13,33 @@ gNBs =
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
- plmn_list = ({
- mcc = 001;
- mnc = 01;
- mnc_length = 2;
- snssaiList = (
- {
- sst = 1;
- }
- );
- });
+ plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({ sst = 1; }) });
- nr_cellid = 51L;
+ nr_cellid = 12345678L;
////////// Physical parameters:
pdsch_AntennaPorts_XP = 2;
- #pdsch_AntennaPorts_N1 = 2; #Uncomment for 4 layers
+ pdsch_AntennaPorts_N1 = 2;
pusch_AntennaPorts = 2;
do_CSIRS = 1;
- do_SRS = 0;
- min_rxtxtime = 3;
+ do_SRS = 1;
+ min_rxtxtime = 2;
servingCellConfigCommon = (
{
#spCellConfigCommon
- physCellId = 51;
+ physCellId = 0;
# downlinkConfigCommon
#frequencyInfoDL
- # this is 3300.24 + 134*12*30e3 = 3348.48 MHz (5G NR GSCN: 7741)
- absoluteFrequencySSB = 649920;
- #652860; #should be 649920
-#647520;
-#647540;
-#649920;
-#650208;
-#647540;
- dl_frequencyBand = 78;
- # this is 3300.24 MHz
- dl_absoluteFrequencyPointA = 646724;
-#649104;
-#646724;
+ # center frequency = 3350.01 MHz
+ # selected SSB frequency = 3349.92 MHz
+ absoluteFrequencySSB = 653376;
+ dl_frequencyBand = 77;
+ # frequency point A = 3300.87 MHz
+ dl_absoluteFrequencyPointA = 650056;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
@@ -77,7 +60,7 @@ gNBs =
#uplinkConfigCommon
#frequencyInfoUL
- ul_frequencyBand = 78;
+ ul_frequencyBand = 77;
#scs-SpecificCarrierList
ul_offstToCarrier = 0;
# subcarrierSpacing
@@ -157,13 +140,13 @@ gNBs =
# pattern1
# dl_UL_TransmissionPeriodicity
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
- dl_UL_TransmissionPeriodicity = 6;
- nrofDownlinkSlots = 6;
- nrofDownlinkSymbols = 10;
- nrofUplinkSlots = 3;
+ dl_UL_TransmissionPeriodicity = 6; #5;
+ nrofDownlinkSlots = 6; #3;
+ nrofDownlinkSymbols = 10; #6;
+ nrofUplinkSlots = 3; #1;
nrofUplinkSymbols = 0;
- ssPBCH_BlockPower = -34;
+ ssPBCH_BlockPower = -15;
}
);
@@ -179,12 +162,13 @@ gNBs =
////////// AMF parameters:
- amf_ip_address = ({ ipv4 = "192.168.70.132"; });
+ amf_ip_address = ({ ipv4 = "172.21.6.5"; });
+
NETWORK_INTERFACES :
{
- GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
- GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.8.120";
+ GNB_IPV4_ADDRESS_FOR_NGU = "172.21.8.120";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
@@ -193,25 +177,19 @@ gNBs =
MACRLCs = (
{
- num_cc = 1;
-
- tr_s_preference = "aerial";
- tr_s_shm_prefix = "nvipc";
- tr_s_poll_core = 10;
- remote_s_address = "127.0.0.1"; // pnf addr [!]
- local_s_address = "127.0.0.2"; // vnf addr
- local_s_portc = 50001; // vnf p5 port
- remote_s_portc = 50000; // pnf p5 port [!]
- local_s_portd = 50011; // vnf p7 port [!]
- remote_s_portd = 50010; // pnf p7 port [!]
-
- tr_n_preference = "local_RRC";
- pusch_FailureThres = 10;
- pusch_TargetSNRx10 = 280; # 150;
- pucch_TargetSNRx10 = 100; #200;
- ulsch_max_frame_inactivity = 10;
- dl_max_mcs = 25;
- ul_max_mcs = 25;
+ num_cc = 1;
+ remote_s_address = "127.0.0.1"; // pnf addr [!]
+ local_s_address = "127.0.0.2"; // vnf addr
+ local_s_portc = 50001; // vnf p5 port
+ remote_s_portc = 50000; // pnf p5 port [!]
+ local_s_portd = 50011; // vnf p7 port [!]
+ remote_s_portd = 50010; // pnf p7 port [!]
+ tr_s_preference = "aerial";
+ tr_n_preference = "local_RRC";
+ pusch_TargetSNRx10 = 280; # 150;
+ pucch_TargetSNRx10 = 200; #200;
+ dl_max_mcs = 28;
+ ul_max_mcs = 28;
}
);
@@ -235,13 +213,13 @@ security = {
log_config :
{
- global_log_level ="info";
- hw_log_level ="info";
- phy_log_level ="info";
- mac_log_level ="info";
- rlc_log_level ="info";
- pdcp_log_level ="info";
- rrc_log_level ="info";
- ngap_log_level ="debug";
- f1ap_log_level ="debug";
+ global_log_level ="info";
+ hw_log_level ="info";
+ phy_log_level ="info";
+ mac_log_level ="info";
+ rlc_log_level ="info";
+ pdcp_log_level ="info";
+ rrc_log_level ="info";
+ ngap_log_level ="debug";
+ f1ap_log_level ="debug";
};
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf
index 10caa403d3..81344ddee2 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf
@@ -237,14 +237,15 @@ THREAD_STRUCT = (
}
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf
index 1684a375d0..8b98f020b9 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf
@@ -236,14 +236,15 @@ THREAD_STRUCT = (
}
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf
index c20188594d..ec5896abfb 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf
@@ -236,14 +236,15 @@ THREAD_STRUCT = (
}
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.u0.25prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.u0.25prb.rfsim.conf
index 428b6cb27c..bb06a08d7f 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.u0.25prb.rfsim.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.u0.25prb.rfsim.conf
@@ -207,14 +207,15 @@ RUs = (
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf
index f7f8390b33..5ff25d5f43 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.106prb.fhi72.4x4-vvdn.conf
@@ -256,7 +256,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("98:ae:71:04:83:e3", "98:ae:71:04:83:e3");
- mtu = 9600;
+ mtu = 9216;
fh_config = ({
T1a_cp_dl = (285, 470);
T1a_cp_ul = (285, 429);
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn-16b.conf
similarity index 99%
rename from targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn.conf
rename to targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn-16b.conf
index d68e67c96f..92ba13f7ce 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.2x2-vvdn-16b.conf
@@ -253,7 +253,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("98:ae:71:04:83:e3", "98:ae:71:04:83:e3");
- mtu = 9600;
+ mtu = 9216;
fh_config = ({
T1a_cp_dl = (285, 470);
T1a_cp_ul = (285, 429);
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf
index 7e13bf7dec..2e16cf50a5 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf
@@ -255,7 +255,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("98:ae:71:04:83:e3", "98:ae:71:04:83:e3");
- mtu = 9600;
+ mtu = 9216;
fh_config = ({
T1a_cp_dl = (285, 470);
T1a_cp_ul = (285, 429);
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.2x2-benetel550-16b.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.2x2-benetel550-16b.conf
new file mode 100644
index 0000000000..eb304d01fd
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.2x2-benetel550-16b.conf
@@ -0,0 +1,274 @@
+Active_gNBs = ( "gNB-OAI");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_ID = 0xe00;
+ gNB_name = "gNB-OAI";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+ plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ( { sst = 1; }); });
+
+ nr_cellid = 1;
+
+ ////////// Physical parameters:
+
+ pdsch_AntennaPorts_XP = 2;
+ pdsch_AntennaPorts_N1 = 1;
+ maxMIMO_layers = 2;
+ pusch_AntennaPorts = 2;
+ do_CSIRS = 1;
+ do_SRS = 0;
+ # force_UL256qam_off = 1;
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+ # n_TimingAdvanceOffset = 0;
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # center frequency = 3350.01 MHz
+ # selected SSB frequency = 3349.92 MHz
+ absoluteFrequencySSB = 623328;
+ dl_frequencyBand = 78;
+ # frequency point A = 3300.87 MHz
+ dl_absoluteFrequencyPointA = 620058;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 273;
+ #initialDownlinkBWP
+ #genericParameters
+ initialDLBWPlocationAndBandwidth = 1099; #38.101-1 Table 5.3.2-1
+ #
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 11;
+ initialDLBWPsearchSpaceZero = 0;
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 273;
+ pMax = 23;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 1099;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 152;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 0;
+ preambleReceivedTargetPower = -100;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 8;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 3;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
+#one (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
+ #
+ msg1_SubcarrierSpacing = 1,
+# restrictedSetConfig
+# 0=unrestricted, 1=restricted type A, 2=restricted type B
+ restrictedSetConfig = 0,
+
+# this is the offset between the last PRACH preamble power and the Msg3 PUSCH, 2 times the field value in dB
+ msg3_DeltaPreamble = 2;
+ p0_NominalWithGrant = -96;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 0;
+ p0_nominal = -96;
+
+ ssb_PositionsInBurst_Bitmap = 0x1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = 0;
+ }
+ );
+
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// AMF parameters:
+ amf_ip_address = ({ ipv4 = "172.21.6.5"; });
+
+ NETWORK_INTERFACES :
+ {
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.51";
+ GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.51";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+ }
+);
+
+MACRLCs = (
+{
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ pusch_TargetSNRx10 = 180;
+ pucch_TargetSNRx10 = 220;
+ dl_bler_target_upper = .35;
+ dl_bler_target_lower = .15;
+ ul_bler_target_upper = .35;
+ ul_bler_target_lower = .15;
+ pusch_FailureThres = 1000;
+ ul_max_mcs = 28;
+}
+);
+
+L1s = (
+{
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ prach_dtx_threshold = 100;
+ pucch0_dtx_threshold = 80;
+ pusch_dtx_threshold = 10;
+ max_ldpc_iterations = 15;
+ tx_amp_backoff_dB = 12; # needs to match O-RU configuration
+ L1_rx_thread_core = 8;
+ L1_tx_thread_core = 10;
+ phase_compensation = 0; # needs to match O-RU configuration
+}
+);
+
+RUs = (
+{
+ local_rf = "no";
+ nb_tx = 2;
+ nb_rx = 2;
+ att_tx = 0;
+ att_rx = 0;
+ bands = [78];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 75;
+ sf_extension = 0;
+ eNB_instances = [0];
+ ru_thread_core = 9;
+ sl_ahead = 10;
+ tr_preference = "raw_if4p5"; # important: activate FHI7.2
+ do_precoding = 0; # needs to match O-RU configuration
+}
+);
+
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
+log_config :
+{
+ global_log_level = "info";
+ hw_log_level = "info";
+ phy_log_level = "info";
+ mac_log_level = "info";
+ rlc_log_level = "info";
+ pdcp_log_level = "info";
+ rrc_log_level = "info";
+ ngap_log_level = "info";
+ f1ap_log_level = "info";
+};
+
+fhi_72 = {
+ dpdk_devices = ("0000:c1:11.0");
+ system_core = 0;
+ io_core = 1;
+ worker_cores = (2);
+ ru_addr = ("70:b3:d5:e1:5b:81");
+ mtu = 9216;
+ fh_config = ({
+ T1a_cp_dl = (419, 470);
+ T1a_cp_ul = (285, 336);
+ T1a_up = (294, 345);
+ Ta4 = (0, 200);
+ ru_config = {
+ iq_width = 16;
+ iq_width_prach = 16;
+ };
+ prach_config = {
+ eAxC_offset = 8;
+ };
+ });
+};
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf
index 715dcda78c..43d6ffd760 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x2-benetel550.conf
@@ -255,7 +255,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("70:b3:d5:e1:5b:81", "70:b3:d5:e1:5b:81");
- mtu = 9600;
+ mtu = 9216;
fh_config = ({
T1a_cp_dl = (419, 470);
T1a_cp_ul = (285, 336);
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf
index 2788e7f5f5..39636baa54 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf
@@ -257,7 +257,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("70:b3:d5:e1:5b:81", "70:b3:d5:e1:5b:81");
- mtu = 9600;
+ mtu = 9216;
fh_config = ({
T1a_cp_dl = (419, 470);
T1a_cp_ul = (285, 336);
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-foxconn.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-foxconn.conf
index e26e446f46..7f6845d8cd 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-foxconn.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-foxconn.conf
@@ -254,7 +254,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("6c:ad:ad:00:04:dc", "6c:ad:ad:00:04:dc");
- mtu = 9600;
+ mtu = 9216;
fh_config = ({
T1a_cp_dl = (285, 470);
T1a_cp_ul = (285, 429);
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf
index 2419df21bb..0c1ef0b2e8 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf
@@ -254,7 +254,7 @@ fhi_72 = {
io_core = 1;
worker_cores = (2);
ru_addr = ("e8:c7:4f:25:81:b3", "e8:c7:4f:25:81:b3");
- mtu = 9600; # note: 1500 works as well, with both E and F releases
+ mtu = 9216; # note: 1500 works as well, with both E and F releases
fh_config = ({
T1a_cp_dl = (285, 429);
T1a_cp_ul = (285, 429);
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf
index b486b52dec..7f22aee70c 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci0.rfsim.conf
@@ -205,14 +205,15 @@ RUs = (
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf
index c649c8b0f8..ae9b0ea5fc 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.pci1.rfsim.conf
@@ -205,14 +205,15 @@ RUs = (
);
-rfsimulator :
+rfsimulator = (
{
serveraddr = "server";
serverport = 4043;
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
-};
+}
+);
security = {
# preferred ciphering algorithms
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.redcap.yaml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.redcap.yaml
index 725b85a31e..c58c804050 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.redcap.yaml
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.redcap.yaml
@@ -195,11 +195,12 @@ RUs:
clock_src: internal
rfsimulator:
- serveraddr: server
- serverport: 4043
- options: [] #("saviq"); or/and "chanmod"
- modelname: AWGN
- IQfile: /tmp/rfsimulator.iqs
+ -
+ serveraddr: server
+ serverport: 4043
+ options: [] #("saviq"); or/and "chanmod"
+ modelname: AWGN
+ IQfile: /tmp/rfsimulator.iqs
security:
# preferred ciphering algorithms
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.yaml b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.yaml
index 8608ccd290..3c952ac967 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.yaml
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.yaml
@@ -176,11 +176,12 @@ RUs:
clock_src: internal
rfsimulator:
- serveraddr: server
- serverport: 4043
- options: [] #("saviq"); or/and "chanmod"
- modelname: AWGN
- IQfile: /tmp/rfsimulator.iqs
+ -
+ serveraddr: server
+ serverport: 4043
+ options: [] #("saviq"); or/and "chanmod"
+ modelname: AWGN
+ IQfile: /tmp/rfsimulator.iqs
security:
# preferred ciphering algorithms
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.189PRB.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.189PRB.rfsim.conf
index 22047cf06c..7df8360a8e 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.189PRB.rfsim.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.189PRB.rfsim.conf
@@ -208,9 +208,11 @@ RUs = (
);
-rfsimulator: {
+rfsimulator = (
+ {
serveraddr = "server";
-};
+ }
+);
security = {
# preferred ciphering algorithms
diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf
index 4cea93ea46..d4f51cd6ea 100644
--- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf
+++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf
@@ -2,9 +2,7 @@ uicc0 = {
imsi = "2089900007487";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
-dnn= "oai";
-nssai_sst=1;
-nssai_sd=1;
+pdu_sessions = ({ dnn = "oai"; nssai_sst = 1; nssai_sd = 1; });
}
position0 = {
diff --git a/tools/packages/packages.cmake b/tools/packages/packages.cmake
new file mode 100644
index 0000000000..8ec8581354
--- /dev/null
+++ b/tools/packages/packages.cmake
@@ -0,0 +1,435 @@
+set(COMPONENTS_LIST "")
+
+set(CPACK_PACKAGE_VERSION ${OAI_VERSION})
+set(CPACK_PACKAGE_VENDOR "OpenAirInterface")
+set(CPACK_PACKAGE_CONTACT "Robert Schmidt ") #Even though it does not appear on CPACK global documention it works, it appears here: https://cmake.org/cmake/help/latest/cpack_gen/deb.html#variable:CPACK_DEBIAN_PACKAGE_MAINTAINER
+set(CPACK_MONOLITHIC_INSTALL OFF)
+set(CPACK_PACKAGING_INSTALL_PREFIX "/")
+
+if(PACKAGING_RPM)
+ set(CPACK_GENERATOR "RPM")
+ set(CPACK_RPM_DEFAULT_DIR_PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+ )
+ set(CPACK_RPM_COMPONENT_INSTALL ON)
+ set(CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
+ set(CPACK_RPM_PACKAGE_URL "https://openairinterface.org")
+ set(CPACK_RPM_PACKAGE_LICENSE "OAI Public License v1.1")
+ set(CPACK_RPM_PACKAGE_GROUP "Development/Tools")
+ set(SYSTEMD_UNIT_DIR "/usr/lib/systemd/system")
+ set(CPACK_RPM_DEBUGINFO_PACKAGE ON)
+ set(CPACK_BUILD_SOURCE_DIRS "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/radio/USRP")
+ set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX .)
+else()
+ set(CPACK_GENERATOR "DEB")
+ set(CPACK_DEB_COMPONENT_INSTALL ON)
+ set(CPACK_DEBIAN_PACKAGE_SECTION "Networking")
+ set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "i386")
+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
+ else()
+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all") # fallback
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://openairinterface.org")
+ set(SYSTEMD_UNIT_DIR "/lib/systemd/system")
+ set(CPACK_DEBIAN_DEBUGINFO_PACKAGE ON)
+endif()
+
+
+##### LTE
+if(PACKAGING_LTE)
+ list(APPEND COMPONENTS_LIST oai-lte)
+ set(LTE_PACKAGE_DESCRIPTION "OAI is an open-source software dedicated to LTE and 5G NR networks, including both Radio Access Network and Core Network.
+ Allowing simulation of mobile networks, prototyping, testing and providing an environment for research. OAI supports real-time operations with hardware radios such as USRP and
+ software-only simulations using virtual radio interfaces. It includes modules for PHY, MAC, RLC, PDCP, RRC, SDAP, and core network functions, and offer tools for I/Q recording
+ and playback, channel coding tests, and performance evaluation of uplink and downlink channels. OAI enables multi-UE and multi-gNB deployments, supports centralized/distributed
+ 5G RAN architectures (CU/DU , (n)FAPI, and 7.2 splits) and provides software to setup testbeds for experimental purposes.
+ This package contains the RAN part of LTE built by OAI, including lte-softmodem a general full-stack modem, lte-uesoftmodem a UE-only softmodem, conf2uedata a converter tool
+ for configurations files to produce UE-specific binary data, nvram to stores permanently the UE or network parameters and finally usim to stores subscriber identity (IMSI),
+ authentication keys and operator credentials.")
+
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_OAI-LTE_PACKAGE_REQUIRES "liboai-common")
+ set(CPACK_RPM_OAI-LTE_PACKAGE_RELOCATABLE FALSE)
+ set(CPACK_RPM_PACKAGE_OAI-LTE_SUMMARY "OpenAirInterface LTE package")
+ set(CPACK_RPM_PACKAGE_OAI-LTE_DESCRIPTION "${LTE_PACKAGE_DESCRIPTION}")
+ else()
+ set(CPACK_DEBIAN_OAI-LTE_PACKAGE_DEPENDS "liboai-common, libblas3, liblapacke")
+ set(CPACK_DEBIAN_OAI-LTE_SUMMARY "OpenAirInterface LTE package")
+ set(CPACK_DEBIAN_OAI-LTE_DESCRIPTION "${LTE_PACKAGE_DESCRIPTION}")
+ endif()
+
+ # Retrieve all LTE related configuration files inside targets and ci-scripts folders
+ set(CONFIG_FILELIST_LTE "")
+ set(CONFIG_FILENAME_LIST_LTE "")
+ file(GLOB LTE_GENERIC_LIBS "${CMAKE_SOURCE_DIR}/targets/PROJECTS/GENERIC-LTE-EPC/CONF/*.conf")
+ file(GLOB LTE_LIBS "${CMAKE_SOURCE_DIR}/ci-scripts/conf_files/*lte*.conf")
+ foreach(file ${LTE_LIBS} ${LTE_GENERIC_LIBS})
+ get_filename_component(fname ${file} NAME)
+ list(APPEND CONFIG_FILENAME_LIST_LTE ${fname})
+ install(FILES "${file}" DESTINATION etc/openairinterface/lte COMPONENT oai-lte)
+ endforeach()
+ foreach(config ${CONFIG_FILENAME_LIST_LTE})
+ if(PACKAGING_RPM)
+ list(APPEND CONFIG_FILELIST_LTE "%config(noreplace) /etc/openairinterface/lte/${config}")
+ else()
+ list(APPEND CONFIG_FILELIST_LTE "/etc/openairinterface/lte/${config}")
+ endif()
+ endforeach()
+
+ #Add package control files to the package (postinst, prerm, conffiles)
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_OAI-LTE_USER_FILELIST "${CONFIG_FILELIST_LTE}")
+ set(CPACK_RPM_OAI-LTE_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/oai-lte/postinst")
+ set(CPACK_RPM_OAI-LTE_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/oai-lte/prerm")
+ else()
+ set(CONFFILES_PATH_LTE "${CMAKE_SOURCE_DIR}/tools/packages/oai-lte/conffiles")
+ file(WRITE "${CONFFILES_PATH_LTE}" "")
+ foreach(cfg IN LISTS CONFIG_FILELIST_LTE)
+ file(APPEND "${CONFFILES_PATH_LTE}" "${cfg}\n")
+ endforeach()
+ file(CHMOD "${CMAKE_SOURCE_DIR}/tools/packages/oai-lte/conffiles" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+ set(CPACK_DEBIAN_OAI-LTE_PACKAGE_CONTROL_EXTRA
+ "${CONFFILES_PATH_LTE}"
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/oai-lte/postinst"
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/oai-lte/prerm"
+ )
+ endif()
+
+ #Add the systemd services to the package
+ install(
+ FILES ${CMAKE_SOURCE_DIR}/tools/packages/systemd_services/oai-lte/lte-softmodem.service
+ DESTINATION ${SYSTEMD_UNIT_DIR}
+ COMPONENT oai-lte
+ )
+
+ #Add the targets to the package
+ install(TARGETS lte-softmodem lte-uesoftmodem conf2uedata usim nvram
+ COMPONENT oai-lte
+ RUNTIME DESTINATION /usr/bin
+ LIBRARY DESTINATION /usr/lib
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ )
+endif()
+
+##### NR
+
+if(PACKAGING_NR)
+ list(APPEND COMPONENTS_LIST oai-nr)
+ set(NR_PACKAGE_DESCRIPTION "OAI is an open-source software dedicated to LTE and 5G NR networks, including both Radio Access Network and Core Network.
+ Allowing simulation of mobile networks, prototyping, testing and providing an environment for research. OAI supports real-time operations with hardware radios such as USRP and
+ software-only simulations using virtual radio interfaces. It includes modules for PHY, MAC, RLC, PDCP, RRC, SDAP, and core network functions, and offer tools for I/Q recording
+ and playback, channel coding tests, and performance evaluation of uplink and downlink channels. OAI enables multi-UE and multi-gNB deployments, supports centralized/distributed
+ 5G RAN architectures (CU/DU , (n)FAPI, and 7.2 splits) and provides software to setup testbeds for experimental purposes.
+ This package contains the RAN part of 5G NR built by OAI, including nr-softmodem a general full-stack modem, nr-uesoftmodem a UE-only softmodem and nr-cuup a split 5G gNB
+ for distributed deployments.")
+
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_OAI-NR_PACKAGE_REQUIRES "liboai-common")
+ set(CPACK_RPM_OAI-NR_PACKAGE_RELOCATABLE FALSE)
+ set(CPACK_RPM_PACKAGE_OAI-NR_SUMMARY "OpenAirInterface NR package")
+ set(CPACK_RPM_PACKAGE_OAI-NR_DESCRIPTION "${NR_PACKAGE_DESCRIPTION}")
+ else()
+ set(CPACK_DEBIAN_OAI-NR_PACKAGE_DEPENDS "liboai-common")
+ set(CPACK_DEBIAN_OAI-NR_SUMMARY "OpenAirInterface NR package")
+ set(CPACK_DEBIAN_OAI-NR_DESCRIPTION "${NR_PACKAGE_DESCRIPTION}")
+ endif()
+
+
+ # Retrieve all NR related configuration files inside targets and ci-scripts folders
+ set(CONFIG_FILELIST_NR "")
+ set(CONFIG_FILENAME_LIST_NR "")
+ file(GLOB NR_CI_LIBS "${CMAKE_SOURCE_DIR}/ci-scripts/conf_files/*nr*.conf")
+ file(GLOB NR_LIBS "${CMAKE_SOURCE_DIR}/targets/PROJECTS/GENERIC-NR-5GC/CONF/*.conf")
+ file(GLOB CUUP_LIBS "${CMAKE_SOURCE_DIR}/ci-scripts/conf_files/*cuup*.conf")
+ foreach(file ${NR_LIBS} ${NR_CI_LIBS} ${CUUP_LIBS})
+ get_filename_component(fname ${file} NAME)
+ list(APPEND CONFIG_FILENAME_LIST_NR ${fname})
+ install(FILES "${file}" DESTINATION etc/openairinterface/nr COMPONENT oai-nr)
+ endforeach()
+ install(FILES "${CMAKE_SOURCE_DIR}/doc/tutorial_resources/oai-cn5g/conf/config.yaml" DESTINATION etc/openairinterface/nr COMPONENT oai-nr)
+ foreach(config ${CONFIG_FILENAME_LIST_NR})
+ if(PACKAGING_RPM)
+ list(APPEND CONFIG_FILELIST_NR "%config(noreplace) /etc/openairinterface/nr/${config}")
+ else()
+ list(APPEND CONFIG_FILELIST_NR "/etc/openairinterface/nr/${config}")
+ endif()
+ endforeach()
+
+ if(PACKAGING_RPM)
+ list(APPEND CONFIG_FILELIST_NR "%config(noreplace) /etc/openairinterface/nr/config.yaml")
+ else()
+ list(APPEND CONFIG_FILELIST_NR "/etc/openairinterface/nr/config.yaml")
+ endif()
+
+ #Add package control files to the package (postinst, prerm, conffiles)
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_OAI-NR_USER_FILELIST "${CONFIG_FILELIST_NR}")
+ set(CPACK_RPM_OAI-NR_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/oai-nr/postinst")
+ set(CPACK_RPM_OAI-NR_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/oai-nr/prerm")
+ else()
+ set(CONFFILES_PATH_NR "${CMAKE_SOURCE_DIR}/tools/packages/oai-nr/conffiles")
+ file(WRITE "${CONFFILES_PATH_NR}" "")
+ foreach(cfg IN LISTS CONFIG_FILELIST_NR)
+ file(APPEND "${CONFFILES_PATH_NR}" "${cfg}\n")
+ endforeach()
+ file(CHMOD "${CMAKE_SOURCE_DIR}/tools/packages/oai-nr/conffiles" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+ set(CPACK_DEBIAN_OAI-NR_PACKAGE_CONTROL_EXTRA
+ "${CONFFILES_PATH_NR}"
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/oai-nr/postinst"
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/oai-nr/prerm"
+ )
+ endif()
+
+ #Add documentation to the package
+ foreach(document NR_SA_Tutorial_COTS_UE NR_SA_Tutorial_OAI_CN5G NR_SA_Tutorial_OAI_multi_UE NR_SA_Tutorial_OAI_nrUE)
+ install(FILES "${CMAKE_SOURCE_DIR}/doc/${document}.md" DESTINATION share/doc/oai-nr COMPONENT oai-nr)
+ endforeach()
+
+ #Add the systemd services to the package
+ install(
+ FILES ${CMAKE_SOURCE_DIR}/tools/packages/systemd_services/oai-nr/nr-cuup.service ${CMAKE_SOURCE_DIR}/tools/packages/systemd_services/oai-nr/nr-softmodem.service
+ DESTINATION ${SYSTEMD_UNIT_DIR}
+ COMPONENT oai-nr
+ )
+
+
+ #Add the targets to the package
+ install(TARGETS nr-softmodem nr-cuup nr-uesoftmodem
+ COMPONENT oai-nr
+ RUNTIME DESTINATION /usr/bin
+ LIBRARY DESTINATION /usr/lib
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ )
+endif()
+
+##### PHYSIM
+
+if(PACKAGING_PHYSIM)
+ list(APPEND COMPONENTS_LIST oai-physim)
+ # NOTE: Following simulators have to be fixed before added -> pbchsim mbmssim pdcchsim pucchsim prachsim syncsim scansim
+ set(PHYSIM_PACKAGE_DESCRIPTION "This package contains several simulation programs allowing developers to validate, debug and benchmark specific algorithm and PHY channels in isolation
+ --------------------------------------------------------
+ Coding focused: polartest, smallblocktest, ldpctest
+ Downlink PHY: nr_dlschsim, nr_psbchsim, nr_dlsim
+ Uplink PHY: nr_pucchsim nr_prachsim nr_ulschsim nr_ulsim
+ --------------------------------------------------------
+ polartest: test polar codes which are used in 5G control channels, validates encoding, decoding and error correction performance*
+ smallblocktest: generic test for small channel coding blocks, validates encoding and decoding for small transport blocks
+ ldpctest: test low density parity check, validates encoding, decoding, throughput and bit error rates (BER)
+ nr_dlschsim: simulates the NR Downlink Shared Channel, including encoding, decoding, modulation, precoding, transmission
+ nr_psbchsim: simulates the Physical Broadcast Channel, including encoding, decoding, DMRS mapping and CRC checks
+ nr_pucchsim: simulates the Physical Uplink Control Channel, including uplink control signaling
+ nr_dlsim: simulates NR downlink, including multiple downlink channels and measurements of BLER/throughput
+ nr_prachsim: simulates the Physical Random Access Channel, including UE initial access, preamble detection and timing alignment
+ nr_ulschsim: simulates the Uplink Shared Channel, including LDPC encoding, modulation, transmission and decoding
+ nr_ulsim: simulates the NR uplink simulation, including PUCCH, PUSCH and PRACH")
+
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_PACKAGE_OAI-PHYSIM_SUMMARY "OpenAirInterface PhySim package")
+ set(CPACK_RPM_PACKAGE_OAI-PHYSIM_DESCRIPTION "${PHYSIM_PACKAGE_DESCRIPTION}")
+ set(CPACK_RPM_OAI-PHYSIM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/postinst")
+ set(CPACK_RPM_OAI-PHYSIM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/prerm")
+ else()
+ set(CPACK_DEBIAN_OAI-PHYSIM_SUMMARY "OpenAirInterface PhySim package")
+ set(CPACK_DEBIAN_OAI-PHYSIM_DESCRIPTION "${PHYSIM_PACKAGE_DESCRIPTION}")
+ set(CPACK_DEBIAN_OAI-PHYSIM_PACKAGE_CONTROL_EXTRA
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/postinst"
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/prerm"
+ )
+ endif()
+
+
+ #Add documentation to the package
+ install(FILES "${CMAKE_SOURCE_DIR}/doc/physical-simulators.md" DESTINATION share/doc/ COMPONENT oai-physim)
+
+ #Add the targets to the package
+ install(TARGETS polartest smallblocktest ldpctest nr_dlschsim nr_psbchsim nr_pucchsim nr_dlsim nr_prachsim nr_ulschsim nr_ulsim
+ COMPONENT oai-physim
+ RUNTIME DESTINATION /usr/bin
+ LIBRARY DESTINATION /usr/lib
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ )
+endif()
+
+##### USRP
+
+if(PACKAGING_USRP)
+ list(APPEND COMPONENTS_LIST liboai-usrp)
+ set(USRP_PACKAGE_DESCRIPTION "Universal Software Radio Peripheral (USRP) are radio equipments used for SDR (software-defined radio) applications.
+ They are used to transmit and receive radio signals, to do the conversions between analog RF signals and digital baseband and to handle real time signal processing tasks.
+ To use USRP, OAI depends on libuhd a shared library provided by Ettus Research, it allows the detection and connection to the device, configure the RF parameters and many
+ other features. OAI uses libuhd to send and receive I/Q samples with the USRP in real time.
+ oai_usrpdevif is the library used by OAI to connect the softmodem to the USRP, it provides an abstraction between phy layer of OAI and the USRP.")
+
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_LIBOAI-USRP_PACKAGE_REQUIRES "liboai-common")
+ set(CPACK_RPM_LIBOAI-USRP_PACKAGE_PROVIDES "liboai_usrpdevif.so()(64bit)")
+ set(CPACK_RPM_LIBOAI-USRP_PACKAGE_RELOCATABLE FALSE)
+ set(CPACK_RPM_PACKAGE_LIBOAI-USRP_SUMMARY "OpenAirInterface USRP package")
+ set(CPACK_RPM_PACKAGE_LIBOAI-USRP_DESCRIPTION "${USRP_PACKAGE_DESCRIPTION}")
+ set(CPACK_RPM_LIBOAI-USRP_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/postinst")
+ set(CPACK_RPM_LIBOAI-USRP_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/prerm")
+ else()
+ set(CPACK_DEBIAN_LIBOAI-USRP_PACKAGE_DEPENDS "liboai-common, libc6")
+ set(CPACK_DEBIAN_LIBOAI-USRP_SUMMARY "OpenAirInterface USRP package")
+ set(CPACK_DEBIAN_LIBOAI-USRP_DESCRIPTION "${USRP_PACKAGE_DESCRIPTION}")
+ set(CPACK_DEBIAN_LIBOAI-USRP_PACKAGE_CONTROL_EXTRA
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/postinst"
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/prerm"
+ )
+ endif()
+
+ #Add documentation to the package
+ install(FILES "${CMAKE_SOURCE_DIR}/radio/USRP/README.md" DESTINATION share/doc/liboai-usrp COMPONENT liboai-usrp)
+
+ # Retrieve all USRP related configuration files inside ci-scripts folder
+ set(CONFIG_FILELIST_USRP "")
+ set(CONFIG_FILENAME_LIST_USRP "")
+ file(GLOB USRP_LIBS "${CMAKE_SOURCE_DIR}/ci-scripts/conf_files/*usrp*.conf")
+ foreach(file ${USRP_LIBS})
+ get_filename_component(fname ${file} NAME)
+ list(APPEND CONFIG_FILENAME_LIST_USRP ${fname})
+ endforeach()
+ foreach(config ${CONFIG_FILENAME_LIST_USRP})
+ install(FILES "${CMAKE_SOURCE_DIR}/ci-scripts/conf_files/${config}" DESTINATION etc/openairinterface/usrp COMPONENT liboai-usrp)
+ if(PACKAGING_RPM)
+ list(APPEND CONFIG_FILELIST_USRP "%config(noreplace) /etc/openairinterface/usrp/${config}")
+ else()
+ list(APPEND CONFIG_FILELIST_USRP "/etc/openairinterface/usrp/${config}")
+ endif()
+ endforeach()
+
+ #Add package control files to the package (postinst, prerm, conffiles)
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_LIBOAI-USRP_USER_FILELIST "${CONFIG_FILELIST_USRP}")
+ else()
+ set(CONFFILES_PATH_USRP "${CMAKE_SOURCE_DIR}/tools/packages/liboai-usrp/conffiles")
+ file(WRITE "${CONFFILES_PATH_USRP}" "")
+ foreach(cfg IN LISTS CONFIG_FILELIST_USRP)
+ file(APPEND "${CONFFILES_PATH_USRP}" "${cfg}\n")
+ endforeach()
+ file(CHMOD "${CMAKE_SOURCE_DIR}/tools/packages/liboai-usrp/conffiles" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+ set(CPACK_DEBIAN_LIBOAI-USRP_PACKAGE_CONTROL_EXTRA "${CONFFILES_PATH_USRP};${CMAKE_SOURCE_DIR}/tools/packages/triggers;")
+ endif()
+
+
+ #Add the targets to the package
+ install(TARGETS oai_usrpdevif
+ COMPONENT liboai-usrp
+ RUNTIME DESTINATION /usr/bin
+ LIBRARY DESTINATION /usr/lib
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+ )
+endif()
+
+##### COMMON
+
+if(PACKAGING_COMMON)
+ list(APPEND COMPONENTS_LIST liboai-common)
+ set(COMMON_PACKAGE_DESCRIPTION "This package contains shared libraries for the other OAI packages
+ params_libconfig: helper library for configuration management, it abstracts the parsing of .conf files and organizes parameters in a structured way
+ dfts: provides Discrete Fourier Transformations functions
+ oai_iqplayer: a tool which allows any softmodem to capture subframes from a USRP into a file and later replay them, enabling offline testing, debugging and reproducible experiments without live RF transmission
+ params_yaml: YAML-based configuration sustem for defining and loading runtime parameters in a structured and readable way
+ telnetsrv: built-in server that lets you remotely monitor and interact with a running softmodem for debugging and testing
+ coding: handles all physical-layer channel coding, decoding, and error-checking operations
+ rfsimulator: emulates radio front-end to enables simulation of boardless RF transmissions and receptions
+ ldpc and ldpc_orig: two versions of LDPC implementation, first one is optimized but second one is simpler and easier to read
+ vrtsim: allows end-to-end PHY/MAC testing, does not requires real hardware")
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_LIBOAI-COMMON_PACKAGE_REQUIRES "libconfig-devel >= 1.4.9")
+ set(CPACK_RPM_LIBOAI-COMMON_PACKAGE_PROVIDES "libcoding.so()(64bit), libdfts.so()(64bit), libldpc.so()(64bit), libldpc_orig.so()(64bit), liboai_iqplayer.so()(64bit), libparams_libconfig.so()(64bit), libparams_yaml.so()(64bit), librfsimulator.so()(64bit), libtelnetsrv.so()(64bit), libvrtsim.so()(64bit)")
+ set(CPACK_RPM_LIBOAI-COMMON_PACKAGE_RELOCATABLE FALSE)
+ set(CPACK_RPM_PACKAGE_LIBOAI-COMMON_SUMMARY "OpenAirInterface shared libraries package")
+ set(CPACK_RPM_PACKAGE_LIBOAI-COMMON_DESCRIPTION "${COMMON_PACKAGE_DESCRIPTION}")
+ set(CPACK_RPM_LIBOAI-COMMON_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/postinst")
+ set(CPACK_RPM_LIBOAI-COMMON_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/prerm")
+ else()
+ set(CPACK_DEBIAN_LIBOAI-COMMON_PACKAGE_DEPENDS "libc6, libconfig-dev (>=1.4.9), libsctp1")
+ set(CPACK_DEBIAN_LIBOAI-COMMON_SUMMARY "OpenAirInterface shared libraries package")
+ set(CPACK_DEBIAN_LIBOAI-COMMON_DESCRIPTION "${COMMON_PACKAGE_DESCRIPTION}")
+ set(CPACK_DEBIAN_LIBOAI-COMMON_PACKAGE_CONTROL_EXTRA
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/postinst"
+ "${CMAKE_SOURCE_DIR}/tools/packages/systemd_scripts/prerm"
+ )
+ endif()
+
+ # Retrieve every rfsim related configuration files inside ci-scripts folder
+ set(CONFIG_FILELIST_COMMON "")
+ set(CONFIG_FILENAME_LIST_COMMON "")
+ file(GLOB COMMON_LIBS_PATH "${CMAKE_SOURCE_DIR}/ci-scripts/conf_files/*rfsim*.conf")
+ foreach(file ${COMMON_LIBS_PATH})
+ get_filename_component(fname ${file} NAME)
+ list(APPEND CONFIG_FILENAME_LIST_COMMON ${fname})
+ endforeach()
+
+ foreach(config ${CONFIG_FILENAME_LIST_COMMON})
+ install(FILES "${CMAKE_SOURCE_DIR}/ci-scripts/conf_files/${config}" DESTINATION etc/openairinterface/liboai-common COMPONENT liboai-common)
+ if(PACKAGING_RPM)
+ list(APPEND CONFIG_FILELIST_COMMON "%config(noreplace) /etc/openairinterface/liboai-common/${config}")
+ else()
+ list(APPEND CONFIG_FILELIST_COMMON "/etc/openairinterface/liboai-common/${config}")
+ endif()
+ endforeach()
+
+ #Add package control files to the package (postinst, prerm, conffiles)
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_LIBOAI-COMMON_USER_FILELIST "${CONFIG_FILELIST_COMMON}")
+ else()
+ set(CONFFILES_PATH_COMMON "${CMAKE_SOURCE_DIR}/tools/packages/liboai-common/conffiles")
+ file(WRITE "${CONFFILES_PATH_COMMON}" "")
+ foreach(cfg IN LISTS CONFIG_FILELIST_COMMON)
+ file(APPEND "${CONFFILES_PATH_COMMON}" "${cfg}\n")
+ endforeach()
+ file(CHMOD "${CMAKE_SOURCE_DIR}/tools/packages/liboai-common/conffiles" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+ set(CPACK_DEBIAN_LIBOAI-COMMON_PACKAGE_CONTROL_EXTRA "${CONFFILES_PATH_COMMON};${CMAKE_SOURCE_DIR}/tools/packages/triggers;")
+ endif()
+
+
+ #Add the targets to the package
+ install(TARGETS params_libconfig dfts oai_iqplayer params_yaml telnetsrv coding rfsimulator ldpc_orig ldpc vrtsim
+ COMPONENT liboai-common
+ RUNTIME DESTINATION /usr/bin
+ LIBRARY DESTINATION /usr/lib
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+ )
+endif()
+
+#Add the license to every package
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
+foreach(component IN LISTS COMPONENTS_LIST)
+ install(FILES "${CMAKE_SOURCE_DIR}/LICENSE"
+ DESTINATION "share/doc/${component}"
+ COMPONENT ${component}
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+ )
+endforeach()
+
+#Rename every package
+foreach(comp ${COMPONENTS_LIST})
+ string(TOUPPER ${comp} COMP_UP)
+ if(PACKAGING_RPM)
+ set(CPACK_RPM_${COMP_UP}_PACKAGE_NAME ${comp})
+ set(CPACK_RPM_${COMP_UP}_FILE_NAME "${comp}-${CPACK_PACKAGE_VERSION}-${OAI_SOVERSION}.${CMAKE_SYSTEM_PROCESSOR}.rpm")
+ set(CPACK_RPM_${COMP_UP}_DEBUGINFO_PACKAGE ON)
+ else()
+ set(CPACK_DEBIAN_${COMP_UP}_PACKAGE_NAME "${comp}")
+ set(CPACK_DEBIAN_${COMP_UP}_FILE_NAME "${comp}.deb")
+ endif()
+endforeach()
+
+INCLUDE(CPack)
+
diff --git a/tools/packages/systemd_scripts/oai-lte/postinst b/tools/packages/systemd_scripts/oai-lte/postinst
new file mode 100755
index 0000000000..5f336373d8
--- /dev/null
+++ b/tools/packages/systemd_scripts/oai-lte/postinst
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -x
+
+mkdir -p /var/log/lte-log
+echo "LTE demon-reload:" >> /var/log/lte-log/lte-systemctl.log
+systemctl daemon-reload >> /var/log/lte-log/lte-systemctl.log 2>&1
+echo "LTE-SOFTMODEM enable:" >> /var/log/lte-log/lte-systemctl.log
+systemctl enable lte-softmodem.service >> /var/log/lte-log/lte-systemctl.log 2>&1
+echo "LTE-SOFTMODEM start:" >> /var/log/lte-log/lte-systemctl.log
+systemctl start lte-softmodem.service >> /var/log/lte-log/lte-systemctl.log 2>&1
+# Add ldconfig
+echo "Running ldconfig..." >> /var/log/lte-log/lte-systemctl.log
+if command -v ldconfig >> /var/log/lte-log/lte-systemctl.log 2>&1; then
+ ldconfig
+else
+ echo "Warning: ldconfig not found"
+fi
diff --git a/tools/packages/systemd_scripts/oai-lte/prerm b/tools/packages/systemd_scripts/oai-lte/prerm
new file mode 100755
index 0000000000..c85dae7364
--- /dev/null
+++ b/tools/packages/systemd_scripts/oai-lte/prerm
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -x
+
+mkdir -p /var/log/lte-log
+echo "LTE-SOFTMODEM stop:" >> /var/log/lte-log/lte-systemctl.log
+systemctl stop lte-softmodem.service >> /var/log/lte-log/lte-systemctl.log 2>&1
+echo "LTE-SOFTMODEM disable:" >> /var/log/lte-log/lte-systemctl.log
+systemctl disable lte-softmodem.service >> /var/log/lte-log/lte-systemctl.log 2>&1
+# Then update library cache
+echo "Running ldconfig after uninstall..." >> /var/log/lte-log/lte-systemctl.log
+if command -v ldconfig >> /var/log/lte-log/lte-systemctl.log 2>&1; then
+ ldconfig
+else
+ echo "Warning: ldconfig not found"
+fi
diff --git a/tools/packages/systemd_scripts/oai-nr/postinst b/tools/packages/systemd_scripts/oai-nr/postinst
new file mode 100755
index 0000000000..07eb25c734
--- /dev/null
+++ b/tools/packages/systemd_scripts/oai-nr/postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+set -x
+
+mkdir -p /var/log/nr-log
+echo "NR demon-reload:" >> /var/log/nr-log/nr-systemctl.log
+systemctl daemon-reload >> /var/log/nr-log/nr-systemctl.log 2>&1
+echo "NR-CUUP enable:" >> /var/log/nr-log/nr-systemctl.log
+systemctl enable nr-cuup.service >> /var/log/nr-log/nr-systemctl.log 2>&1
+echo "NR-CUUP start:" >> /var/log/nr-log/nr-systemctl.log
+systemctl start nr-cuup.service >> /var/log/nr-log/nr-systemctl.log 2>&1
+echo "NR-SOFTMODEM enable:" >> /var/log/nr-log/nr-systemctl.log
+systemctl enable nr-softmodem.service >> /var/log/nr-log/nr-systemctl.log 2>&1
+echo "NR-SOFTMODEM start:" >> /var/log/nr-log/nr-systemctl.log
+systemctl start nr-softmodem.service >> /var/log/nr-log/nr-systemctl.log 2>&1
+# Add ldconfig
+echo "Running ldconfig..." >> /var/log/nr-log/nr-systemctl.log
+if command -v ldconfig >> /var/log/nr-log/nr-systemctl.log 2>&1; then
+ ldconfig
+else
+ echo "Warning: ldconfig not found"
+fi
diff --git a/tools/packages/systemd_scripts/oai-nr/prerm b/tools/packages/systemd_scripts/oai-nr/prerm
new file mode 100755
index 0000000000..a19ea73a6c
--- /dev/null
+++ b/tools/packages/systemd_scripts/oai-nr/prerm
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -x
+
+mkdir -p /var/log/nr-log
+echo "NR-CUUP stop:" >> /var/log/nr-log/nr-systemctl.log
+systemctl stop nr-cuup.service >> /var/log/nr-log/nr-systemctl.log 2>&1
+echo "NR-CUUP disable:" >> /var/log/nr-log/nr-systemctl.log
+systemctl disable nr-cuup.service >> /var/log/nr-log/nr-systemctl.log 2>&1
+echo "NR-SOFTMODEM stop:" >> /var/log/nr-log/nr-systemctl.log
+systemctl stop nr-softmodem.service >> /var/log/nr-log/nr-systemctl.log 2>&1
+echo "NR-SOFTMODEM disable:" >> /var/log/nr-log/nr-systemctl.log
+systemctl disable nr-softmodem.service >> /var/log/nr-log/nr-systemctl.log 2>&1
+# Then update library cache
+echo "Running ldconfig after uninstall..." >> /var/log/nr-log/nr-systemctl.log
+if command -v ldconfig >> /var/log/nr-log/nr-systemctl.log 2>&1; then
+ ldconfig
+else
+ echo "Warning: ldconfig not found"
+fi
diff --git a/tools/packages/systemd_scripts/postinst b/tools/packages/systemd_scripts/postinst
new file mode 100644
index 0000000000..57c51728a7
--- /dev/null
+++ b/tools/packages/systemd_scripts/postinst
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+mkdir -p /var/log/oai-log
+echo "Running ldconfig after package installation/upgrade" 2>&1
+if command -v ldconfig >> /var/log/oai-log/oai.log 2>&1; then
+ ldconfig
+else
+ echo "Warning: ldconfig not found"
+fi
+
+
+exit 0
diff --git a/tools/packages/systemd_scripts/prerm b/tools/packages/systemd_scripts/prerm
new file mode 100644
index 0000000000..13cabeffd6
--- /dev/null
+++ b/tools/packages/systemd_scripts/prerm
@@ -0,0 +1,27 @@
+#!/bin/sh
+set -e
+
+mkdir -p /var/log/oai-log
+echo "Running ldconfig after package removal" 2&>1
+# Only run ldconfig if this is not an apt purge
+if [ -n "$1" ]; then
+ if [ "$1" != "purge" ]; then
+ echo "Updating linker cache..."
+ echo "Running ldconfig after package installation/upgrade" 2>&1
+ if command -v ldconfig >> /var/log/oai-log/oai.log 2>&1; then
+ ldconfig
+ else
+ echo "Warning: ldconfig not found"
+ fi
+ fi
+else
+ # Likely running under RPM/dnf: just update linker cache
+ echo "Updating linker cache..."
+ echo "Running ldconfig after package installation/upgrade" 2>&1
+ if command -v ldconfig >> /var/log/oai-log/oai.log 2>&1; then
+ ldconfig
+ else
+ echo "Warning: ldconfig not found"
+ fi
+fi
+exit 0
diff --git a/tools/packages/systemd_services/oai-lte/lte-softmodem.service b/tools/packages/systemd_services/oai-lte/lte-softmodem.service
new file mode 100644
index 0000000000..c14de58c44
--- /dev/null
+++ b/tools/packages/systemd_services/oai-lte/lte-softmodem.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=lte-softmodem
+
+[Service]
+Type=simple
+User=root
+Group=root
+ExecStart=/usr/bin/lte-softmodem -O /etc/openairinterface/lte/enb.band7.tm1.50PRB.usrpb210.conf --device.name oai_usrpdevif
+Restart=on-failure
+RestartSec=5s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/packages/systemd_services/oai-nr/nr-cuup.service b/tools/packages/systemd_services/oai-nr/nr-cuup.service
new file mode 100644
index 0000000000..7dda61badf
--- /dev/null
+++ b/tools/packages/systemd_services/oai-nr/nr-cuup.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=nr-cuup
+
+[Service]
+Type=simple
+User=root
+Group=root
+ExecStart=/usr/bin/nr-cuup -O /etc/openairinterface/nr/gnb-cuup.sa.f1.conf
+Restart=on-failure
+RestartSec=5s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/packages/systemd_services/oai-nr/nr-softmodem.service b/tools/packages/systemd_services/oai-nr/nr-softmodem.service
new file mode 100644
index 0000000000..4271443439
--- /dev/null
+++ b/tools/packages/systemd_services/oai-nr/nr-softmodem.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=nr-softmodem
+
+[Service]
+Type=simple
+User=root
+Group=root
+ExecStart=/usr/bin/nr-softmodem -O /etc/openairinterface/nr/gnb.sa.band78.fr1.106PRB.usrpb210.conf -E --continuous-tx -A -2 --device.name oai_usrpdevif
+
+Restart=on-failure
+RestartSec=5s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/packages/triggers b/tools/packages/triggers
new file mode 100644
index 0000000000..2d682269b2
--- /dev/null
+++ b/tools/packages/triggers
@@ -0,0 +1 @@
+activate-noawait /sbin/ldconfig