Merge branch 'integration_2025_w14_p2' into 'develop'
Integration: `2025.w14` (part 2) See merge request oai/openairinterface5g!3362 * !3255 Fixes for E1 and PDU session usage * !3332 sched_ctrlCommon earlier * !3356 Avoid accessing current_DL_BWP structure when scheduling DCI for other SIBs * !3359 Fix inconsistent maxnoofPDUSessions definitions between NGAP and platform constants * !3357 CI: update VVDN configuration file * !3333 NR RLC improvements * !3342 Fix bugs detected gcc * !3347 feat(oran_fhlib_5g): O-RAN 7.2 FrontHaul Interface on Arm * !3153 [E2 agent] RAN Control SM - support for REPORT Style 1 ("RRC Message" and "UE ID" RAN Parameter IDs) * !3234 CI: minor tunings and improvements * !3276 Optimization for unused symbols in NR UE * !3317 Extend F1 Handover test
This commit is contained in:
@@ -453,6 +453,9 @@ target_include_directories(f1ap PUBLIC F1AP_DIR)
|
||||
target_link_libraries(f1ap PUBLIC asn1_f1ap GTPV1U)
|
||||
target_link_libraries(f1ap PRIVATE ngap nr_rrc HASHTABLE f1ap_lib)
|
||||
target_include_directories(f1ap PRIVATE ${F1AP_DIR}/lib)
|
||||
if(E2_AGENT)
|
||||
target_compile_definitions(f1ap PRIVATE E2_AGENT)
|
||||
endif()
|
||||
|
||||
# LPP
|
||||
##############
|
||||
|
||||
@@ -410,6 +410,7 @@ class Containerize():
|
||||
result = re.search('native_arm', self.imageKind)
|
||||
if result is not None:
|
||||
imageNames.append(('oai-gnb', 'gNB', 'oai-gnb', ''))
|
||||
imageNames.append(('ran-build-fhi72', 'build.fhi72.native_arm', 'ran-build-fhi72', ''))
|
||||
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup', ''))
|
||||
imageNames.append(('oai-nr-ue', 'nrUE', 'oai-nr-ue', ''))
|
||||
imageNames.append(('oai-gnb-aerial', 'gNB.aerial', 'oai-gnb-aerial', ''))
|
||||
@@ -889,7 +890,10 @@ class Containerize():
|
||||
if deployed:
|
||||
break
|
||||
elif (attempt < num_attempts - 1):
|
||||
logging.warning(f'Failed to deploy on attempt {attempt}, restart services {services}')
|
||||
warning_msg = f'Restart services {services}'
|
||||
logging.warning(warning_msg)
|
||||
imagesInfo.append(warning_msg)
|
||||
HTML.CreateHtmlTestRowQueue('N/A', 'NOK', ['\n'.join(imagesInfo)])
|
||||
for svc in services.split():
|
||||
CopyinServiceLog(ssh, lSourcePath, yaml_dir, svc, wd_yaml, f'{svc}-{HTML.testCase_id}-attempt{attempt}.log')
|
||||
ssh.run(f'docker compose -f {wd_yaml} down -- {services}')
|
||||
|
||||
@@ -210,7 +210,7 @@ def Iperf_analyzeV2UDP(server_filename, iperf_bitrate_threshold, iperf_packetlos
|
||||
jit_msg = f'Jitter : {jitter}'
|
||||
pal_msg = f'Packet Loss : {packetloss}'
|
||||
if float(packetloss) > float(iperf_packetloss_threshold):
|
||||
pal_msg += f' (too high! >{self.iperf_packetloss_threshold}%)'
|
||||
pal_msg += f' (too high! >{iperf_packetloss_threshold}%)'
|
||||
return (result, f'{req_msg}\n{bir_msg}\n{brl_msg}\n{jit_msg}\n{pal_msg}')
|
||||
|
||||
def Custom_Command(HTML, node, command, command_fail):
|
||||
|
||||
@@ -189,11 +189,11 @@ RUs = (
|
||||
nb_rx = 1
|
||||
# The higher att for TX than RX is because we use a circulator (as for TDD),
|
||||
# while we should use a duplexer in the FDD case. However, it uses the same setup.
|
||||
att_tx = 18
|
||||
att_tx = 16
|
||||
att_rx = 0;
|
||||
bands = [1];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 108;
|
||||
max_rxgain = 110;
|
||||
eNB_instances = [0];
|
||||
clock_src = "internal";
|
||||
}
|
||||
|
||||
@@ -194,11 +194,11 @@ RUs = (
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 10;
|
||||
att_rx = 10;
|
||||
att_tx = 4;
|
||||
att_rx = 4;
|
||||
bands = [78];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 114;
|
||||
max_rxgain = 106;
|
||||
eNB_instances = [0];
|
||||
clock_src = "internal";
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ MACRLCs = (
|
||||
remote_s_portd = 50010; // pnf p7 port [!]
|
||||
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 250;
|
||||
pusch_TargetSNRx10 = 300;
|
||||
pucch_TargetSNRx10 = 250;
|
||||
pusch_FailureThres = 100;
|
||||
ul_max_mcs = 28;
|
||||
|
||||
@@ -18,11 +18,12 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
pdsch_AntennaPorts_XP = 2;
|
||||
pdsch_AntennaPorts_N1 = 1;
|
||||
maxMIMO_layers = 2;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
maxMIMO_layers = 4;
|
||||
pusch_AntennaPorts = 4;
|
||||
do_CSIRS = 1;
|
||||
do_SRS = 0;
|
||||
force_UL256qam_off = 1;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
@@ -30,12 +31,12 @@ gNBs =
|
||||
physCellId = 0;
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# center frequency = 3999.36 MHz
|
||||
# selected SSB frequency = 3999.36 MHz
|
||||
absoluteFrequencySSB = 666624;
|
||||
# center frequency = 4049.76 MHz
|
||||
# selected SSB frequency = 4049.76 MHz
|
||||
absoluteFrequencySSB = 669984;
|
||||
dl_frequencyBand = 77;
|
||||
# frequency point A = 3950.22 MHz
|
||||
dl_absoluteFrequencyPointA = 663348;
|
||||
# frequency point A = 4000.62 MHz
|
||||
dl_absoluteFrequencyPointA = 666708;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
@@ -177,10 +178,8 @@ MACRLCs = (
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 180;
|
||||
pucch_TargetSNRx10 = 230;
|
||||
ul_bler_target_upper = .35;
|
||||
ul_bler_target_lower = .15;
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 250;
|
||||
pusch_FailureThres = 100;
|
||||
}
|
||||
);
|
||||
@@ -212,7 +211,7 @@ RUs = (
|
||||
sf_extension = 0;
|
||||
eNB_instances = [0];
|
||||
ru_thread_core = 5;
|
||||
sl_ahead = 5;
|
||||
sl_ahead = 10;
|
||||
tr_preference = "raw_if4p5"; # important: activate FHI7.2
|
||||
do_precoding = 0; # needs to match O-RU configuration
|
||||
}
|
||||
@@ -250,10 +249,11 @@ log_config :
|
||||
|
||||
fhi_72 = {
|
||||
dpdk_devices = ("0000:c3:11.0", "0000:c3:11.1");
|
||||
dpdk_iova_mode = "VA";
|
||||
system_core = 0;
|
||||
io_core = 1;
|
||||
worker_cores = (2);
|
||||
ru_addr = ("98:ae:71:01:c5:eb", "98:ae:71:01:c5:eb");
|
||||
ru_addr = ("98:ae:71:04:83:e3", "98:ae:71:04:83:e3");
|
||||
mtu = 9600;
|
||||
fh_config = ({
|
||||
T1a_cp_dl = (285, 470);
|
||||
|
||||
@@ -83,7 +83,7 @@ gNBs =
|
||||
ra_ResponseWindow = 4;
|
||||
#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;
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 2;
|
||||
#one (0..15) 4,8,12,16,...60,64
|
||||
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
|
||||
#ra_ContentionResolutionTimer
|
||||
@@ -192,8 +192,9 @@ L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
prach_dtx_threshold = 120;
|
||||
prach_dtx_threshold = 150;
|
||||
pucch0_dtx_threshold = 30;
|
||||
max_ldpc_iterations = 15;
|
||||
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
|
||||
}
|
||||
);
|
||||
@@ -203,11 +204,11 @@ RUs = (
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 10;
|
||||
att_rx = 10;
|
||||
att_tx = 6;
|
||||
att_rx = 6;
|
||||
bands = [78];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 114;
|
||||
max_rxgain = 110;
|
||||
eNB_instances = [0];
|
||||
clock_src = "internal";
|
||||
}
|
||||
|
||||
@@ -46,9 +46,15 @@
|
||||
020022
|
||||
040024
|
||||
000024
|
||||
000030
|
||||
040025
|
||||
000031
|
||||
030021
|
||||
040027
|
||||
040025
|
||||
000031
|
||||
020022
|
||||
040026
|
||||
100021
|
||||
222222
|
||||
</TestCaseRequestedList>
|
||||
@@ -222,6 +228,22 @@
|
||||
<command_fail>yes</command_fail>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040026">
|
||||
<class>Custom_Command</class>
|
||||
<desc>UE (1) connected to DU-PCI 0?</desc>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ci fetch_du_by_ue_id 1 | nc 192.168.71.150 9090 | grep "3584"</command>
|
||||
<command_fail>yes</command_fail>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040027">
|
||||
<class>Custom_Command</class>
|
||||
<desc>UE (1) connected to DU-PCI 1?</desc>
|
||||
<node>cacofonix</node>
|
||||
<command>echo ci fetch_du_by_ue_id 1 | nc 192.168.71.150 9090 | grep "3585"</command>
|
||||
<command_fail>yes</command_fail>
|
||||
</testCase>
|
||||
|
||||
<testCase id="100021">
|
||||
<class>Undeploy_Object</class>
|
||||
<always_exec>true</always_exec>
|
||||
|
||||
@@ -120,9 +120,12 @@
|
||||
</testCase>
|
||||
|
||||
<testCase id="000002">
|
||||
<class>IdleSleep</class>
|
||||
<desc>Sleep</desc>
|
||||
<idle_sleep_time_in_sec>10</idle_sleep_time_in_sec>
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 20pings</desc>
|
||||
<id>idefix</id>
|
||||
<svr_id>sabox-nepes</svr_id>
|
||||
<ping_args>-c 20 -i0.5 -w25</ping_args>
|
||||
<ping_packetloss_threshold>80</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
|
||||
|
||||
@@ -199,9 +199,12 @@
|
||||
</testCase>
|
||||
|
||||
<testCase id="100002">
|
||||
<class>IdleSleep</class>
|
||||
<desc>Sleep</desc>
|
||||
<idle_sleep_time_in_sec>10</idle_sleep_time_in_sec>
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 20pings</desc>
|
||||
<id>idefix</id>
|
||||
<svr_id>sabox-nepes</svr_id>
|
||||
<ping_args>-c 20 -i0.5 -w25</ping_args>
|
||||
<ping_packetloss_threshold>80</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="330201">
|
||||
|
||||
@@ -134,9 +134,12 @@
|
||||
</testCase>
|
||||
|
||||
<testCase id="100002">
|
||||
<class>IdleSleep</class>
|
||||
<desc>Sleep</desc>
|
||||
<idle_sleep_time_in_sec>10</idle_sleep_time_in_sec>
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 20pings</desc>
|
||||
<id>idefix</id>
|
||||
<svr_id>sabox-nepes</svr_id>
|
||||
<ping_args>-c 20 -i0.5 -w25</ping_args>
|
||||
<ping_packetloss_threshold>80</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="150000">
|
||||
|
||||
@@ -53,11 +53,10 @@
|
||||
</testCase>
|
||||
|
||||
<testCase id="110000">
|
||||
<class>Pull_Cluster_Image</class>
|
||||
<desc>Pull Images from Cluster</desc>
|
||||
<oc_project>oaicicd-ran</oc_project>
|
||||
<class>Pull_Local_Registry</class>
|
||||
<desc>Pull Images from Local Registry</desc>
|
||||
<svr_id>0</svr_id>
|
||||
<images>oai-gnb-fhi72</images>
|
||||
<node>cacofonix</node>
|
||||
</testCase>
|
||||
<testCase id="800813">
|
||||
<class>Create_Workspace</class>
|
||||
@@ -91,8 +90,8 @@
|
||||
|
||||
<testCase id="100010">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (DL/300Mbps/UDP)(30 sec)(multi-ue profile)</desc>
|
||||
<iperf_args>-u -b 300M -t 30 -R</iperf_args>
|
||||
<desc>iperf (DL/600Mbps/UDP)(30 sec)(multi-ue profile)</desc>
|
||||
<iperf_args>-u -b 600M -t 30 -R</iperf_args>
|
||||
<id>up2-fhi72</id>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
@@ -111,8 +110,8 @@
|
||||
|
||||
<testCase id="100020">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (UL/70Mbps/UDP)(30 sec)(multi-ue profile)</desc>
|
||||
<iperf_args>-u -b 70M -t 30</iperf_args>
|
||||
<desc>iperf (UL/80Mbps/UDP)(30 sec)(multi-ue profile)</desc>
|
||||
<iperf_args>-u -b 80M -t 30</iperf_args>
|
||||
<id>up2-fhi72</id>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
|
||||
@@ -125,7 +124,7 @@
|
||||
<desc>iperf (UL/TCP)(30 sec)(multi-ue profile)</desc>
|
||||
<iperf_args>-t 30</iperf_args>
|
||||
<id>up2-fhi72</id>
|
||||
<iperf_tcp_rate_target>40</iperf_tcp_rate_target>
|
||||
<iperf_tcp_rate_target>10</iperf_tcp_rate_target>
|
||||
<svr_id>oc-cn5g-20897</svr_id>
|
||||
</testCase>
|
||||
|
||||
|
||||
@@ -116,8 +116,8 @@
|
||||
|
||||
<testCase id="071000">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (DL/480Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 480M -t 30 -R</iperf_args>
|
||||
<desc>iperf (DL/450Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 450M -t 30 -R</iperf_args>
|
||||
<svr_id>matix-cn5g</svr_id>
|
||||
<id>up2</id>
|
||||
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
|
||||
|
||||
@@ -114,9 +114,12 @@
|
||||
</testCase>
|
||||
|
||||
<testCase id="200002">
|
||||
<class>IdleSleep</class>
|
||||
<desc>Sleep</desc>
|
||||
<idle_sleep_time_in_sec>10</idle_sleep_time_in_sec>
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 20pings</desc>
|
||||
<id>idefix</id>
|
||||
<svr_id>sabox-nepes</svr_id>
|
||||
<ping_args>-c 20 -i0.5 -w25</ping_args>
|
||||
<ping_packetloss_threshold>80</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
- ../../conf_files/gnb-vnf.sa.band77.162prb.nfapi.4x4.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
oai-pnf:
|
||||
@@ -36,6 +36,6 @@ services:
|
||||
- ../../conf_files/gnb-pnf.band77.usrpn310.4x4.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-softmodem"
|
||||
interval: 10s
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -9,7 +9,7 @@ services:
|
||||
environment:
|
||||
USE_ADDITIONAL_OPTIONS: --telnetsrv --telnetsrv.listenport 9090 --telnetsrv.shrmod ci
|
||||
--log_config.global_log_options level,nocolor,time,line_num,function
|
||||
--security.drb_integrity yes
|
||||
--security.drb_integrity no
|
||||
volumes:
|
||||
- ../../conf_files/gnb-cucp.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
# for performance reasons, we use host mode: in bridge mode, we have
|
||||
|
||||
@@ -2,7 +2,6 @@ services:
|
||||
oai-gnb:
|
||||
image: ${REGISTRY:-oaisoftwarealliance}/oai-gnb-fhi72:${TAG:-develop}
|
||||
cap_add:
|
||||
- SYS_ADMIN
|
||||
- IPC_LOCK
|
||||
- SYS_NICE
|
||||
cap_drop:
|
||||
@@ -10,14 +9,14 @@ services:
|
||||
container_name: oai-gnb
|
||||
environment:
|
||||
TZ: Europe/Paris
|
||||
USE_ADDITIONAL_OPTIONS: --thread-pool 6,7,8,9
|
||||
USE_ADDITIONAL_OPTIONS: --thread-pool 7,8,9,10,11,12
|
||||
devices:
|
||||
- /dev/vfio:/dev/vfio/
|
||||
volumes:
|
||||
- ../../conf_files/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf:/opt/oai-gnb/etc/gnb.conf
|
||||
- /dev/hugepages:/dev/hugepages
|
||||
# Please change these values based on your system
|
||||
cpuset: "0,1,2,3,4,5,6,7,8,9"
|
||||
cpuset: "0,1,2,3,4,5,6,7,8,9,10,11,12"
|
||||
networks:
|
||||
oai-net:
|
||||
ipv4_address: 172.21.18.20
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
# FindArmral
|
||||
# -------
|
||||
#
|
||||
# Finds the armral library.
|
||||
# the version is currently hardcoded to 25.01
|
||||
#
|
||||
# Optional options
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# ``armral_LOCATION``
|
||||
# The location of the library.
|
||||
#
|
||||
# Imported Targets
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This module provides the following imported targets, if found:
|
||||
#
|
||||
# ``armral``
|
||||
# The armral library
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This will define the following variables:
|
||||
#
|
||||
# ``armral_FOUND``
|
||||
# True if the system has the armral library.
|
||||
# ``armral_VERSION``
|
||||
# The version of the armral library which was found.
|
||||
# ``armral_INCLUDE_DIRS``
|
||||
# Include directories needed to use armral.
|
||||
# ``armral_LIBRARIES``
|
||||
# Libraries needed to link to armral.
|
||||
#
|
||||
# Cache Variables
|
||||
# ^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following cache variables may also be set:
|
||||
#
|
||||
# ``armral_INCLUDE_DIR``
|
||||
# The directory containing ``armral.h``.
|
||||
# ``armral_LIBRARY``
|
||||
# The path to the armral library.
|
||||
|
||||
option(armral_LOCATION "directory of ArmRAL library" "")
|
||||
if (NOT armral_LOCATION)
|
||||
set(armral_LOCATION "/usr/local")
|
||||
endif()
|
||||
if (NOT EXISTS ${armral_LOCATION})
|
||||
message(FATAL_ERROR "no such directory: ${armral_LOCATION}")
|
||||
endif()
|
||||
|
||||
find_path(armral_INCLUDE_DIR
|
||||
NAMES
|
||||
armral.h
|
||||
HINTS ${armral_LOCATION}
|
||||
PATH_SUFFIXES include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
if (NOT armral_INCLUDE_DIR)
|
||||
message(FATAL_ERROR "could not detect armral header at ${armral_LOCATION}/include")
|
||||
endif()
|
||||
|
||||
find_library(armral_LIBRARY
|
||||
NAMES armral
|
||||
HINTS ${armral_LOCATION}
|
||||
PATH_SUFFIXES lib build
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
if (NOT armral_LIBRARY)
|
||||
message(FATAL_ERROR "could not detect armral build artifacts at neither ${armral_LOCATION}/lib nor ${armral_LOCATION}/build")
|
||||
endif()
|
||||
|
||||
# No way to retrieve the version from header or library
|
||||
set(armral_VERSION 25.01)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(armral
|
||||
FOUND_VAR armral_FOUND
|
||||
REQUIRED_VARS
|
||||
armral_LIBRARY
|
||||
armral_INCLUDE_DIR
|
||||
VERSION_VAR armral_VERSION
|
||||
)
|
||||
|
||||
if(armral_FOUND)
|
||||
set(armral_LIBRARIES ${armral_LIBRARY})
|
||||
set(armral_INCLUDE_DIRS ${armral_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if(armral_FOUND AND NOT TARGET armral)
|
||||
add_library(armral UNKNOWN IMPORTED)
|
||||
set_target_properties(armral PROPERTIES
|
||||
IMPORTED_LOCATION "${armral_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${armral_INCLUDE_DIRS}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
armral_INCLUDE_DIR
|
||||
armral_LIBRARY
|
||||
)
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -84,6 +84,7 @@ static inline const char *rnti_types(nr_rnti_type_t rr)
|
||||
#define MU_SCS(m) (15 << m)
|
||||
#define MAX_GSCN_BAND 620 // n78 has the highest GSCN range of 619
|
||||
#define NR_NUMBER_OF_SYMBOLS_PER_SLOT 14
|
||||
#define NR_NUMBER_OF_SYMBOLS_PER_SLOT_EXTENDED_CP 12
|
||||
#define NR_MAX_NB_LAYERS 4 // 8
|
||||
|
||||
// Since the IQ samples are represented by SQ15 R+I (see https://en.wikipedia.org/wiki/Q_(number_format)) we need to compensate when
|
||||
|
||||
@@ -141,6 +141,29 @@ int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern nr_rrc_du_container_t *get_du_for_ue(gNB_RRC_INST *rrc, uint32_t ue_id);
|
||||
|
||||
/** @brief Get connected DU by the UE ID */
|
||||
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;
|
||||
if (buf) {
|
||||
ue_id = strtol(buf, NULL, 10);
|
||||
}
|
||||
nr_rrc_du_container_t *du = get_du_for_ue(RC.nrrrc[0], ue_id);
|
||||
|
||||
if (du) {
|
||||
prnt("gNB_DU_id %d is connected to ue_id %ld\n", du->setup_req->gNB_DU_id, ue_id);
|
||||
return 0;
|
||||
} else {
|
||||
ERROR_MSG_RET("No DU connected\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
extern void nr_HO_F1_trigger_telnet(gNB_RRC_INST *rrc, uint32_t rrc_ue_id);
|
||||
/**
|
||||
* @brief Trigger F1 handover for UE
|
||||
@@ -199,6 +222,7 @@ static telnetshell_cmddef_t cicmds[] = {
|
||||
{"force_ue_release", "[rnti(hex,opt)]", force_ue_release},
|
||||
{"force_ul_failure", "[rnti(hex,opt)]", force_ul_failure},
|
||||
{"trigger_f1_ho", "[rrc_ue_id(int,opt)]", rrc_gNB_trigger_f1_ho},
|
||||
{"fetch_du_by_ue_id", "[rrc_ue_id(int,opt)]", fetch_du_by_ue_id},
|
||||
{"", "", NULL},
|
||||
};
|
||||
|
||||
|
||||
@@ -621,26 +621,21 @@ int websrv_callback_get_softmodemcmd(const struct _u_request *request, struct _u
|
||||
snprintf(confstr, sizeof(confstr), "Confirm %s ?", modulestruct->cmd[j].cmdname);
|
||||
acmd = json_pack("{s:s,s:s}", "name", modulestruct->cmd[j].cmdname, "confirm", confstr);
|
||||
} else if (modulestruct->cmd[j].cmdflags & TELNETSRV_CMDFLAG_NEEDPARAM) {
|
||||
char *question[] = {NULL,NULL};
|
||||
char *helpcp = NULL;
|
||||
char *question[] = {NULL, NULL};
|
||||
json_t *jQ1=NULL, *jQ2=NULL;
|
||||
json_t *jQs = json_array();
|
||||
if (modulestruct->cmd[j].helpstr != NULL) {
|
||||
helpcp = strdup(modulestruct->cmd[j].helpstr);
|
||||
int ns=sscanf(helpcp,"<%m[^<>]> <%m[^<>]>",&question[0],&question[1]);
|
||||
if (ns == 0) {
|
||||
LOG_W(UTIL, "[websrv] Cannot find parameters for command %s %s\n", modulestruct->module, modulestruct->cmd[j].cmdname);
|
||||
continue;
|
||||
}
|
||||
jQ1=json_pack("{s:s,s:s,s:s}", "display",question[0], "pname", "P0", "type", "string");
|
||||
json_array_append_new(jQs, jQ1);
|
||||
if (ns >1) {
|
||||
jQ2=json_pack("{s:s,s:s,s:s}","display", (question[1] == NULL) ? "" : question[1], "pname", "P1" , "type", "string");
|
||||
json_array_append_new(jQs, jQ2);
|
||||
}
|
||||
int ns = sscanf(modulestruct->cmd[j].helpstr, "<%m[^<>]> <%m[^<>]>", &question[0], &question[1]);
|
||||
if (ns == 0) {
|
||||
LOG_W(UTIL, "[websrv] Cannot find parameters for command %s %s\n", modulestruct->module, modulestruct->cmd[j].cmdname);
|
||||
continue;
|
||||
}
|
||||
jQ1 = json_pack("{s:s,s:s,s:s}", "display", question[0], "pname", "P0", "type", "string");
|
||||
json_array_append_new(jQs, jQ1);
|
||||
if (ns > 1) {
|
||||
jQ2 = json_pack("{s:s,s:s,s:s}", "display", (question[1] == NULL) ? "" : question[1], "pname", "P1", "type", "string");
|
||||
json_array_append_new(jQs, jQ2);
|
||||
}
|
||||
acmd = json_pack("{s:s,s:o}", "name", modulestruct->cmd[j].cmdname, "question", jQs);
|
||||
free(helpcp);
|
||||
free(question[0]);
|
||||
free(question[1]);
|
||||
} else {
|
||||
|
||||
@@ -32,6 +32,8 @@ The hardware on which we have tried this tutorial:
|
||||
- The NIC card should support hardware PTP time stamping.
|
||||
- If you are using Intel servers then use only Ice Lake or newer generations. In case of AMD use only 4th generation, Genoa or newer.
|
||||
- If you try on any other server apart from the above listed, then choose a desktop/server with clock speed higher than 3.0 GHz and `avx512` capabilities.
|
||||
- This tutorial gives few instructions for Arm targets, but DU execution on Arm systems is yet not functional.
|
||||
This feature is intended to enable experiments and future improvements on Arm systems.
|
||||
|
||||
NICs we have tested so far:
|
||||
|
||||
@@ -403,7 +405,10 @@ git apply ~/openairinterface5g/cmake_targets/tools/oran_fhi_integration_patches/
|
||||
Compile the fronthaul interface library by calling `make` and the option
|
||||
`XRAN_LIB_SO=1` to have it build a shared object. Note that we provide two
|
||||
environment variables `RTE_SDK` for the path to the source tree of DPDK, and
|
||||
`XRAN_DIR` to set the path to the fronthaul library.
|
||||
`XRAN_DIR` to set the path to the fronthaul library.
|
||||
For building for a Arm target, set as well the environment variable `TARGET=armv8`.
|
||||
DU execution on Arm systems is yet not functional.
|
||||
This feature is intended to enable experiments and future improvements on Arm systems.
|
||||
|
||||
**Note**: you need at least gcc-11 and g++-11.
|
||||
|
||||
@@ -420,6 +425,31 @@ WIRELESS_SDK_TOOLCHAIN=gcc RTE_SDK=~/dpdk-stable-20.11.9/ XRAN_DIR=~/phy/fhi_lib
|
||||
The shared library object `~/phy/fhi_lib/lib/build/libxran.so` must be present
|
||||
before proceeding.
|
||||
|
||||
## For Arm targets only: Install the Arm RAN Acceleration library
|
||||
|
||||
DU execution on Arm systems is yet not functional.
|
||||
This feature is intended to enable experiments and future improvements on Arm systems.
|
||||
|
||||
Clone, configure and build ArmRAL:
|
||||
|
||||
Note: Use option `-DCMAKE_INSTALL_PREFIX=<install-dir>` of cmake to set the installation directory of ArmRAL to `<install-dir>`.
|
||||
If you omit this option, ArmRAL is installed into `/usr/local`.
|
||||
|
||||
```
|
||||
git clone https://git.gitlab.arm.com/networking/ral.git ~/ral
|
||||
cd ~/ral
|
||||
git checkout armral-25.01
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja -DBUILD_SHARED_LIBS=On ../
|
||||
ninja
|
||||
```
|
||||
|
||||
Once ArmRAL is configured at your convenience and built, you can install it:
|
||||
```
|
||||
ninja install
|
||||
```
|
||||
|
||||
## Build OAI gNB
|
||||
|
||||
You can now proceed building OAI. You build it the same way as for other
|
||||
|
||||
+26
-24
@@ -4,28 +4,25 @@
|
||||
|
||||
## Machines
|
||||
|
||||
| Machine | IP address | Lockable Resource | Function | Connected devices |
|
||||
| ------------- | --------------- | --------------------- | ------------------ | ----------------------------------------------------- |
|
||||
| asterix | 172.21.16.127 | CI-Asterix-Usage | *unused* | 172.21.19.14 |
|
||||
| obelix | 172.21.16.128 | CI-Obelix-Usage | eNB (n40, n78), nrUE | 172.21.19.13, X300 (192.168.60.2) |
|
||||
| porcepix | 172.21.16.136 | CI-Porcepix | Executor, EPC, 5GC | -- |
|
||||
| up2 | 172.21.19.68 | CI-UP2-Usage | COTS UE | Quectel RM520N |
|
||||
| nepes | 172.21.16.137 | CI-Nepes | gNB (n78), EPC/5GC | B200mini (30C51EB) |
|
||||
| ofqot | 172.21.16.109 | CI-Ofqot | gNB (n78) | B200mini (30C51D4) |
|
||||
| idefix | 172.21.16.135 | CI-Idefix | COTS UE | Quectel RM500Q |
|
||||
| caracal | 172.21.16.132 | CI-Caracal | gNB/phytest | N300 (192.168.10.2) |
|
||||
| amariue | 172.21.16.144 | CI-Amarisoft-UE-Usage | nrUE | Amarisoft UE simulator |
|
||||
| nano | 172.21.18.48 | CI-Nano-Legacy-EPC | Executor, EPC, adb | 2x COTS (adb) |
|
||||
| hutch | 172.21.18.46 | CI-Hutch-Legacy-FDD-eNB | eNB (B7) | B200mini (30C5239) |
|
||||
| starsky | 172.21.18.45 | CI-Starsky-Legacy-TDD-eNB | eNB (B40) | b200mini (30A3E3C) |
|
||||
| carabe | 172.21.18.47 | CI-Carabe-Legacy-FDD-OAI-LTE-UE | UE (B7UE) | B200mini (30AE8C9) |
|
||||
| nokiabox | 172.21.19.39 | _None_ | gNB (Nokia), 5GC | _Nokia RF integrated_ |
|
||||
| avra | 172.21.16.124 | CI-Avra-Usage | gNB (n78) | AW2S Jaguar (192.168.80.239) |
|
||||
| orion | 172.21.16.134 | CI-Orion-Build-Sanity-Check-Deploy-Test, CI-Orion-DsTester-Deploy-Test | Build | |
|
||||
| aerial2 | 172.21.16.131 | CI-Aerial2-Usage | gNB (PNF/Nvidia CUBB + VNF) | Foxconn RU, _Nvidia Aerial SDK integrated_ |
|
||||
| cacofonix | 172.21.16.150 | CI-Cacofonix-Usage | gNB (n78, FHI7.2) | |
|
||||
| matix | 172.21.19.58 | CI-Matix-Usage | gNB (n77) | N310 |
|
||||
| gracehopper1-oai | -- | Gracehopper1 | build, gNB/Aerial | _Nvidia Aerial SDK integrated_ |
|
||||
| Machine | Lockable Resource | Function | Connected devices |
|
||||
| ------------- | --------------------- | -------------------- | ----------------------------------------------------- |
|
||||
| obelix | Obelix | eNB (n40, n78), nrUE | 172.21.19.13, X300 (192.168.60.2) |
|
||||
| porcepix | Porcepix | Executor, EPC, 5GC | -- |
|
||||
| up2 | UP2 | COTS UE | Quectel RM520N |
|
||||
| nepes | Nepes | gNB (n78), EPC/5GC | B200mini (30C51EB) |
|
||||
| ofqot | Ofqot | gNB (n78) | B200mini (30C51D4) |
|
||||
| idefix | Idefix | COTS UE | Quectel RM500Q |
|
||||
| caracal | Caracal | gNB/phytest, OAI UE | N300 (192.168.10.2), _AMD T2 card_ |
|
||||
| amariue | Amarisoft-UE | nrUE | Amarisoft UE simulator |
|
||||
| nano | Nano_EPC/Nano_5G_COTS_UE | Executor, EPC, adb | 2x COTS (adb) |
|
||||
| hutch | Hutch | eNB (B7) | B200mini (30C5239) |
|
||||
| starsky | Starsky | eNB (B40) | b200mini (30A3E3C) |
|
||||
| carabe | Carabe | UE (B7UE) | B200mini (30AE8C9) |
|
||||
| avra | Avra | gNB (n78) | AW2S Jaguar (192.168.80.239) |
|
||||
| aerial2 | Aerial2 | gNB (PNF/Nvidia CUBB + VNF) | Foxconn RU, _Nvidia Aerial SDK integrated_ |
|
||||
| cacofonix | Cacofonix | gNB (n78, FHI7.2) | -- |
|
||||
| matix | Matix | gNB (n77) | N310 |
|
||||
| gracehopper1-oai | Gracehopper1 | build, gNB/Aerial | _Nvidia Aerial SDK integrated_ |
|
||||
|
||||
Note: The available resources, and their current usage, is indicated here:
|
||||
- [Lockable resources of jenkins-oai](https://jenkins-oai.eurecom.fr/lockable-resources/):
|
||||
@@ -107,6 +104,8 @@ information on how the images are built.
|
||||
- target image from `Dockerfile.nr-cuup.rhel9`
|
||||
- target image from `Dockerfile.lteUE.rhel9`
|
||||
- target image from `Dockerfile.nrUE.rhel9`
|
||||
- build image from `Dockerfile.build.fhi72.rhel9`, followed by
|
||||
- target image from `Dockerfile.gNB.fhi72.rhel9`
|
||||
- build image from `Dockerfile.phySim.rhel9` (creates as direct target physical simulator
|
||||
image)
|
||||
- build image from `Dockerfile.clang.rhel9` (compilation only, artifacts not used currently)
|
||||
@@ -122,6 +121,9 @@ information on how the images are built.
|
||||
- target image from `Dockerfile.nrUE.ubuntu22`
|
||||
- target image from `Dockerfile.lteUE.ubuntu22`
|
||||
- target image from `Dockerfile.lteRU.ubuntu22`
|
||||
- target image from `Dockerfile.gNB.aerial.ubuntu22`
|
||||
- build image from `Dockerfile.build.fhi72.ubuntu22`, followed by
|
||||
- target image from `Dockerfile.gNB.fhi72.ubuntu22`
|
||||
- build unit tests from `ci-scripts/docker/Dockerfile.unittest.ubuntu22`, and run them
|
||||
- [RAN-Ubuntu-ARM-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-Ubuntu-ARM-Image-Builder/)
|
||||
~BUILD-ONLY ~4G-LTE ~5G-NR
|
||||
@@ -137,7 +139,7 @@ information on how the images are built.
|
||||
|
||||
- [OAI-CN5G-COTS-UE-Test](https://jenkins-oai.eurecom.fr/job/OAI-CN5G-COTS-UE-Test/)
|
||||
~5G-NR
|
||||
- using 5GC bench (resources `CI-Cetautomatix-OC-oaicicd-session`, `CI-Dogmatix-CN5G-gNB`): Attach/Detach of UE with multiple PDU sessions
|
||||
- using 5GC bench (resources `Cetautomatix`, `Dogmatix`): Attach/Detach of UE with multiple PDU sessions
|
||||
- [OAI-FLEXRIC-RAN-Integration-Test](https://jenkins-oai.eurecom.fr/job/OAI-FLEXRIC-RAN-Integration-Test/) ~5G-NR ~nrUE
|
||||
- selfix (gNB, nrUE, OAI 5GC, FlexRIC)
|
||||
- uses RFsimulator, tests FlexRIC/E2 interface and xApps
|
||||
@@ -171,7 +173,7 @@ information on how the images are built.
|
||||
- basic NSA test
|
||||
- [RAN-PhySim-Cluster](https://jenkins-oai.eurecom.fr/job/RAN-PhySim-Cluster/)
|
||||
~4G-LTE ~5G-NR ~nrUE
|
||||
- cluster (`Asterix-OC-oaicicd-session` resource), tests in OpenShift Cluster
|
||||
- cluster (`RAN_OC` resource), tests in OpenShift Cluster
|
||||
- unitary simulators (`nr_dlsim`, etc.)
|
||||
- see [`./physical-simulators.md`](./physical-simulators.md) for an overview
|
||||
- [RAN-RF-Sim-Test-4G](https://jenkins-oai.eurecom.fr/job/RAN-RF-Sim-Test-4G/)
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
#/*
|
||||
# * 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
|
||||
# */
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
# Dockerfile for the Open-Air-Interface RAN Build for FHI 7.2
|
||||
# Valid for UBUNTU 22.04
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
FROM ran-base:latest AS ran-base
|
||||
|
||||
ARG E2AP_VERSION=E2AP_V3
|
||||
ARG KPM_VERSION=KPM_V3_00
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
meson \
|
||||
wget \
|
||||
xz-utils \
|
||||
pkg-config \
|
||||
libnuma-dev && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN rm -Rf /oai-ran
|
||||
WORKDIR /oai-ran
|
||||
COPY . .
|
||||
|
||||
## Download and build DPDK
|
||||
RUN wget http://fast.dpdk.org/rel/dpdk-20.11.9.tar.xz && \
|
||||
tar -xvf dpdk-20.11.9.tar.xz && \
|
||||
cd dpdk-stable-20.11.9 && \
|
||||
meson build && \
|
||||
ninja -C build && \
|
||||
ninja install -C build
|
||||
|
||||
## Build Fronthaul library
|
||||
RUN git clone https://gerrit.o-ran-sc.org/r/o-du/phy.git /opt/phy && \
|
||||
cd /opt/phy && \
|
||||
git checkout oran_f_release_v1.0 &&\
|
||||
git apply /oai-ran/cmake_targets/tools/oran_fhi_integration_patches/F/oaioran_F.patch && \
|
||||
cd /opt/phy/fhi_lib/lib && \
|
||||
TARGET=armv8 WIRELESS_SDK_TOOLCHAIN=gcc RTE_SDK=/oai-ran/dpdk-stable-20.11.9/ XRAN_DIR=/opt/phy/fhi_lib make XRAN_LIB_SO=1
|
||||
|
||||
## Build Arm RAN Acceleration Library
|
||||
RUN git clone https://git.gitlab.arm.com/networking/ral.git /opt/ral && \
|
||||
cd /opt/ral && \
|
||||
git checkout armral-25.01 &&\
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
cmake -GNinja -DBUILD_SHARED_LIBS=On /opt/ral/ && \
|
||||
ninja && \
|
||||
ninja install
|
||||
|
||||
FROM ran-base AS ran-build-fhi72
|
||||
## Build and install OAI
|
||||
#run build_oai to build the target image
|
||||
RUN /bin/sh oaienv && \
|
||||
cd cmake_targets && \
|
||||
mkdir -p log && \
|
||||
./build_oai \
|
||||
--gNB \
|
||||
--build-lib "telnetsrv enbscope uescope nrscope" \
|
||||
-t oran_fhlib_5g --cmake-opt -Dxran_LOCATION=/opt/phy/fhi_lib/lib \
|
||||
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \
|
||||
$BUILD_OPTION && \
|
||||
# Mainly to see if the sanitize option was perfectly executed
|
||||
ldd ran_build/build/nr-softmodem && \
|
||||
ldd ran_build/build/liboran_fhlib_5g.so && \
|
||||
ldd /opt/phy/fhi_lib/lib/build/libxran.so
|
||||
|
||||
## Build FlexRIC for SM Models
|
||||
RUN mkdir -p openair2/E2AP/flexric/build && \
|
||||
cd openair2/E2AP/flexric/build && \
|
||||
cmake -GNinja -DCMAKE_BUILD_TYPE=Release \
|
||||
-DXAPP_MULTILANGUAGE=OFF \
|
||||
-DKPM_VERSION=$KPM_VERSION \
|
||||
-DE2AP_VERSION=$E2AP_VERSION \
|
||||
-DCMAKE_C_COMPILER=gcc-12 \
|
||||
-DCMAKE_CXX_COMPILER=g++-12 .. && \
|
||||
ninja && \
|
||||
ninja install
|
||||
+6
-22
@@ -102,16 +102,12 @@ ngran_node_t get_node_type()
|
||||
return ngran_gNB_CUUP;
|
||||
}
|
||||
|
||||
rlc_op_status_t rlc_data_req(const protocol_ctxt_t *const pc,
|
||||
const srb_flag_t sf,
|
||||
const MBMS_flag_t mf,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t mui,
|
||||
const confirm_t c,
|
||||
const sdu_size_t size,
|
||||
uint8_t *const buf,
|
||||
const uint32_t *const a,
|
||||
const uint32_t *const b)
|
||||
rlc_op_status_t nr_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
sdu_size_t sdu_sizeP,
|
||||
uint8_t *sdu_pP)
|
||||
{
|
||||
abort();
|
||||
return 0;
|
||||
@@ -123,16 +119,6 @@ int nr_rlc_get_available_tx_space(const rnti_t rntiP, const logical_chan_id_t ch
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nr_rlc_add_drb(int rnti, int drb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
void prepare_and_send_ue_context_modification_f1(rrc_gNB_ue_context_t *ue_context_p, e1ap_bearer_setup_resp_t *e1ap_resp)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
f1ap_cudu_inst_t *getCxt(instance_t instanceP)
|
||||
{
|
||||
// the E1 module uses F1's getCxt() to decide whether there is F1-U and if
|
||||
@@ -146,8 +132,6 @@ f1ap_cudu_inst_t *getCxt(instance_t instanceP)
|
||||
}
|
||||
configmodule_interface_t *uniqCfg = NULL;
|
||||
|
||||
void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, uint32_t gNB_ue_ngap_id) { };
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/// static configuration for NR at the moment
|
||||
|
||||
@@ -553,9 +553,6 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action)
|
||||
|
||||
int tmp = openair0_write_reorder(&UE->rfdevice, writeTimestamp, txp, writeBlockSize, fp->nb_antennas_tx, flags);
|
||||
AssertFatal(tmp == writeBlockSize, "");
|
||||
|
||||
for (int i = 0; i < fp->nb_antennas_tx; i++)
|
||||
memset(txp[i], 0, writeBlockSize);
|
||||
}
|
||||
|
||||
void processSlotTX(void *arg)
|
||||
|
||||
@@ -75,7 +75,7 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include <openair2/LAYER2/NR_MAC_UE/mac_proto.h>
|
||||
#include <openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h>
|
||||
#include <openair1/SCHED_NR_UE/fapi_nr_ue_l1.h>
|
||||
|
||||
#include "nr_rlc/nr_rlc_oai_api.h"
|
||||
/* Callbacks, globals and object handlers */
|
||||
|
||||
//#include "stats.h"
|
||||
@@ -313,7 +313,7 @@ static void init_pdcp(int ue_id)
|
||||
// was always set. further refactoring could take it out
|
||||
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
|
||||
|
||||
if (get_softmodem_params()->nsa && rlc_module_init(0) != 0) {
|
||||
if (get_softmodem_params()->nsa && nr_rlc_module_init(0) != 0) {
|
||||
LOG_I(RLC, "Problem at RLC initiation \n");
|
||||
}
|
||||
nr_pdcp_layer_init();
|
||||
|
||||
@@ -292,42 +292,33 @@ static inline void nr_polar_deinterleaver(uint8_t *input, uint8_t *output, uint1
|
||||
* De-interleaving of coded bits implementation
|
||||
* TS 138.212: Section 5.4.1.3 - Interleaving of coded bits
|
||||
*/
|
||||
static inline void nr_polar_rm_deinterleaving_lut(uint16_t *out, const int E)
|
||||
static inline void nr_polar_rm_deinterleaving_lut(uint16_t *out, const uint E)
|
||||
{
|
||||
int16_t in[E];
|
||||
for (uint i = 0; i < E; i++)
|
||||
in[i] = i;
|
||||
int T = ceil((sqrt(8 * E + 1) - 1) / 2);
|
||||
int v_tab[T][T];
|
||||
memset(v_tab, 0, sizeof(v_tab));
|
||||
uint k = 0;
|
||||
for (int i = 0; i < T; i++) {
|
||||
for (int j = 0; j < T - i; j++) {
|
||||
if (k < E) {
|
||||
v_tab[i][j] = k + 1;
|
||||
}
|
||||
k++;
|
||||
uint T = ceil((sqrt(8 * E + 1) - 1) / 2);
|
||||
|
||||
bool v_tab[T][T];
|
||||
memset(v_tab, false, sizeof(v_tab));
|
||||
for (uint i = 0, k = 0; i < T; i++) {
|
||||
for (uint j = 0; j < T - i; j++, k++) {
|
||||
v_tab[i][j] = k < E;
|
||||
}
|
||||
}
|
||||
|
||||
int v[T][T];
|
||||
k = 0;
|
||||
for (int j = 0; j < T; j++) {
|
||||
for (int i = 0; i < T - j; i++) {
|
||||
if (k < E && v_tab[i][j] != 0) {
|
||||
v[i][j] = in[k];
|
||||
memset(v, -1, sizeof(v));
|
||||
for (uint j = 0, k = 0; j < T; j++) {
|
||||
for (uint i = 0; i < T - j; i++) {
|
||||
if (k < E && v_tab[i][j]) {
|
||||
v[i][j] = k;
|
||||
k++;
|
||||
} else {
|
||||
v[i][j] = INT_MAX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
k = 0;
|
||||
memset(out, 0, E * sizeof(*out));
|
||||
for (int i = 0; i < T; i++) {
|
||||
for (int j = 0; j < T - i; j++) {
|
||||
if (v[i][j] != INT_MAX) {
|
||||
for (uint i = 0, k = 0; i < T; i++) {
|
||||
for (uint j = 0; j < T - i; j++) {
|
||||
if (v[i][j] != -1) {
|
||||
out[k] = v[i][j];
|
||||
k++;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,12 @@ void PHY_ofdm_mod(const int *input,
|
||||
|
||||
|
||||
void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms);
|
||||
void nr_normal_prefix_mod(c16_t *txdataF, c16_t *txdata, uint8_t nsymb, const NR_DL_FRAME_PARMS *frame_parms, uint32_t slot);
|
||||
void nr_normal_prefix_mod(c16_t *txdataF,
|
||||
c16_t *txdata,
|
||||
uint8_t nsymb,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t slot,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT]);
|
||||
|
||||
void do_OFDM_mod(c16_t **txdataF, c16_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
|
||||
@@ -67,31 +67,55 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
|
||||
|
||||
}
|
||||
|
||||
void nr_normal_prefix_mod(c16_t *txdataF, c16_t *txdata, uint8_t nsymb, const NR_DL_FRAME_PARMS *frame_parms, uint32_t slot)
|
||||
void nr_normal_prefix_mod(c16_t *txdataF,
|
||||
c16_t *txdata,
|
||||
uint8_t nsymb,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t slot,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
// This function works only slot wise. For more generic symbol generation refer nr_feptx0()
|
||||
if (frame_parms->numerology_index != 0) { // case where numerology != 0
|
||||
if (!(slot%(frame_parms->slots_per_subframe/2))) {
|
||||
PHY_ofdm_mod((int *)txdataF,
|
||||
(int *)txdata,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1,
|
||||
frame_parms->nb_prefix_samples0,
|
||||
CYCLIC_PREFIX);
|
||||
PHY_ofdm_mod((int *)txdataF + frame_parms->ofdm_symbol_size,
|
||||
(int *)txdata + frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples0,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
nsymb - 1,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
if (was_symbol_used[0]) {
|
||||
PHY_ofdm_mod((int *)txdataF,
|
||||
(int *)txdata,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1,
|
||||
frame_parms->nb_prefix_samples0,
|
||||
CYCLIC_PREFIX);
|
||||
} else {
|
||||
memset(txdata, 0, (frame_parms->nb_prefix_samples0 + frame_parms->ofdm_symbol_size) * sizeof(c16_t));
|
||||
}
|
||||
for (int i = 1; i < nsymb; i++) {
|
||||
c16_t* tx_data_ptr = txdata + (i - 1) * (frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples) +
|
||||
frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples0;
|
||||
if (was_symbol_used[i]) {
|
||||
PHY_ofdm_mod((int *)txdataF + frame_parms->ofdm_symbol_size * i,
|
||||
(int *)tx_data_ptr,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
} else {
|
||||
memset(tx_data_ptr, 0, (frame_parms->nb_prefix_samples + frame_parms->ofdm_symbol_size) * sizeof(c16_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
PHY_ofdm_mod((int *)txdataF,
|
||||
(int *)txdata,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
nsymb,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
for (int i = 0; i < nsymb; i++) {
|
||||
c16_t* tx_data_ptr = txdata + i * (frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples);
|
||||
if (was_symbol_used[i]) {
|
||||
PHY_ofdm_mod((int *)txdataF + frame_parms->ofdm_symbol_size * i,
|
||||
(int *)tx_data_ptr,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
} else {
|
||||
memset(tx_data_ptr, 0, (frame_parms->nb_prefix_samples + frame_parms->ofdm_symbol_size) * sizeof(c16_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // numerology = 0, longer CP for every 7th symbol
|
||||
|
||||
@@ -144,7 +144,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
const uint32_t frame,
|
||||
const uint8_t slot,
|
||||
nr_phy_data_tx_t *phy_data,
|
||||
c16_t **txdataF);
|
||||
c16_t **txdataF,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT]);
|
||||
|
||||
/** \brief This function does IFFT for PUSCH
|
||||
*/
|
||||
@@ -154,7 +155,8 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const uint8_t n_antenna_ports,
|
||||
c16_t **txdataF,
|
||||
uint32_t linktype);
|
||||
uint32_t linktype,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT]);
|
||||
|
||||
void clean_UE_harq(PHY_VARS_NR_UE *UE);
|
||||
|
||||
|
||||
@@ -465,7 +465,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
const uint32_t frame,
|
||||
const uint8_t slot,
|
||||
nr_phy_data_tx_t *phy_data,
|
||||
c16_t **txdataF)
|
||||
c16_t **txdataF,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
|
||||
int harq_pid = phy_data->ulsch.pusch_pdu.pusch_data.harq_process_id;
|
||||
@@ -500,6 +501,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
uint16_t rnti = pusch_pdu->rnti;
|
||||
|
||||
for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) {
|
||||
was_symbol_used[i] = true;
|
||||
if ((ul_dmrs_symb_pos >> i) & 0x01)
|
||||
number_dmrs_symbols += 1;
|
||||
}
|
||||
@@ -831,37 +833,52 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
|
||||
const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const uint8_t n_antenna_ports,
|
||||
c16_t **txdataF,
|
||||
uint32_t linktype)
|
||||
uint32_t linktype,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
const int tx_offset = frame_parms->get_samples_slot_timestamp(slot, frame_parms, 0);
|
||||
|
||||
int N_RB = (linktype == link_type_sl) ? frame_parms->N_RB_SL : frame_parms->N_RB_UL;
|
||||
|
||||
c16_t **txdata = UE->common_vars.txData;
|
||||
for(int ap = 0; ap < n_antenna_ports; ap++) {
|
||||
apply_nr_rotation_TX(frame_parms,
|
||||
txdataF[ap],
|
||||
frame_parms->symbol_rotation[linktype],
|
||||
slot,
|
||||
N_RB,
|
||||
0,
|
||||
NR_NUMBER_OF_SYMBOLS_PER_SLOT);
|
||||
for (int i = 0; i < NR_NUMBER_OF_SYMBOLS_PER_SLOT; i++) {
|
||||
if (was_symbol_used[i] == false)
|
||||
continue;
|
||||
for(int ap = 0; ap < n_antenna_ports; ap++) {
|
||||
apply_nr_rotation_TX(frame_parms,
|
||||
txdataF[ap],
|
||||
frame_parms->symbol_rotation[linktype],
|
||||
slot,
|
||||
N_RB,
|
||||
i,
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int ap = 0; ap < n_antenna_ports; ap++) {
|
||||
if (frame_parms->Ncp == 1) { // extended cyclic prefix
|
||||
PHY_ofdm_mod((int *)txdataF[ap],
|
||||
(int *)&txdata[ap][tx_offset],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
12,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
for (int i = 0; i < NR_NUMBER_OF_SYMBOLS_PER_SLOT_EXTENDED_CP; i++) {
|
||||
if (was_symbol_used[i] == false) {
|
||||
memset(&txdata[ap][tx_offset + (frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples) * i],
|
||||
0,
|
||||
(frame_parms->nb_prefix_samples + frame_parms->ofdm_symbol_size) * sizeof(int32_t));
|
||||
continue;
|
||||
}
|
||||
PHY_ofdm_mod((int *)&txdataF[ap][frame_parms->ofdm_symbol_size * i],
|
||||
(int *)&txdata[ap][tx_offset + frame_parms->ofdm_symbol_size * i],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
}
|
||||
} else { // normal cyclic prefix
|
||||
nr_normal_prefix_mod(txdataF[ap],
|
||||
&txdata[ap][tx_offset],
|
||||
14,
|
||||
NR_NUMBER_OF_SYMBOLS_PER_SLOT,
|
||||
frame_parms,
|
||||
slot);
|
||||
slot,
|
||||
was_symbol_used);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -423,7 +423,10 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu,
|
||||
* send srs according to current configuration
|
||||
*
|
||||
*********************************************************************/
|
||||
int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, c16_t **txdataF)
|
||||
int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue,
|
||||
const UE_nr_rxtx_proc_t *proc,
|
||||
c16_t **txdataF,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
if(!ue->srs_vars[0]->active) {
|
||||
return -1;
|
||||
@@ -432,6 +435,14 @@ int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, c16_
|
||||
|
||||
nfapi_nr_srs_pdu_t *srs_config_pdu = (nfapi_nr_srs_pdu_t*)&ue->srs_vars[0]->srs_config_pdu;
|
||||
|
||||
int first_srs_symbol = ue->frame_parms.symbols_per_slot - 1 - srs_config_pdu->time_start_position;
|
||||
// Num consecutive SRS symbols according to 38.211 6.4.1.4.1
|
||||
int num_srs_symbols[] = {1, 2, 4, 8, 12};
|
||||
int last_srs_symbol = first_srs_symbol + num_srs_symbols[srs_config_pdu->num_symbols] - 1;
|
||||
for (int i = first_srs_symbol; i <= last_srs_symbol; i++) {
|
||||
was_symbol_used[i] = true;
|
||||
}
|
||||
|
||||
#ifdef SRS_DEBUG
|
||||
LOG_I(NR_PHY,"Frame = %i, slot = %i\n", proc->frame_tx, proc->nr_slot_tx);
|
||||
LOG_I(NR_PHY,"srs_config_pdu->rnti = 0x%04x\n", srs_config_pdu->rnti);
|
||||
|
||||
@@ -79,6 +79,6 @@ int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource,
|
||||
@param current gNB_id identifier
|
||||
@returns 0 if srs is transmitted -1 otherwise */
|
||||
|
||||
int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, c16_t **txdataF);
|
||||
int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, c16_t **txdataF, bool was_symbol_used[14]);
|
||||
|
||||
#endif /* SRS_MODULATION_NR_H */
|
||||
|
||||
@@ -474,7 +474,6 @@ static void timeResponse (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) {
|
||||
values[i] = SquaredNorm(samples[i]);
|
||||
}
|
||||
#ifdef WEBSRVSCOPE
|
||||
int uestart = nb_UEs - 1; // web scope shows one UE signal, that can be selected from GUI
|
||||
msg->header.msgtype = SCOPEMSG_TYPE_DATA;
|
||||
msg->header.chartid = graph->chartid;
|
||||
msg->header.datasetid = graph->datasetid;
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
// /usr/lib/gcc/x86_64-redhat-linux/8/include/gfniintrin.h:57:1: error: inlining failed in call to always_inline ‘_mm_gf2p8affine_epi64_epi8’: target specific option mismatch
|
||||
#include <simde/x86/clmul.h>
|
||||
|
||||
#include <simde/arm/neon.h>
|
||||
#endif // x86_64 || i386
|
||||
#include <stdbool.h>
|
||||
#include "assertions.h"
|
||||
|
||||
@@ -284,14 +284,15 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n
|
||||
txdataF[i] = &txdataF_buf[i * samplesF_per_slot];
|
||||
|
||||
LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT] = {0};
|
||||
|
||||
start_meas_nr_ue_phy(ue, PHY_PROC_TX);
|
||||
|
||||
nr_ue_ulsch_procedures(ue, frame_tx, slot_tx, phy_data, (c16_t **)&txdataF);
|
||||
nr_ue_ulsch_procedures(ue, frame_tx, slot_tx, phy_data, (c16_t **)&txdataF, was_symbol_used);
|
||||
|
||||
ue_srs_procedures_nr(ue, proc, (c16_t **)&txdataF);
|
||||
ue_srs_procedures_nr(ue, proc, (c16_t **)&txdataF, was_symbol_used);
|
||||
|
||||
pucch_procedures_ue_nr(ue, proc, phy_data, (c16_t **)&txdataF);
|
||||
pucch_procedures_ue_nr(ue, proc, phy_data, (c16_t **)&txdataF, was_symbol_used);
|
||||
|
||||
LOG_D(PHY, "Sending Uplink data \n");
|
||||
|
||||
@@ -304,7 +305,8 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n
|
||||
&ue->frame_parms,
|
||||
ue->frame_parms.nb_antennas_tx,
|
||||
(c16_t **)txdataF,
|
||||
link_type_ul);
|
||||
link_type_ul,
|
||||
was_symbol_used);
|
||||
stop_meas_nr_ue_phy(ue, OFDM_MOD_STATS);
|
||||
}
|
||||
|
||||
|
||||
@@ -308,9 +308,12 @@ void phy_procedures_nrUE_SL_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc
|
||||
tx_action = 1;
|
||||
}
|
||||
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT];
|
||||
for (int i = 0; i < 14; i++)
|
||||
was_symbol_used[i] = true;
|
||||
if (tx_action) {
|
||||
LOG_D(NR_PHY, "Sending Uplink data \n");
|
||||
nr_ue_pusch_common_procedures(ue, proc->nr_slot_tx, fp, fp->nb_antennas_tx, txdataF, link_type_sl);
|
||||
nr_ue_pusch_common_procedures(ue, proc->nr_slot_tx, fp, fp->nb_antennas_tx, txdataF, link_type_sl, was_symbol_used);
|
||||
}
|
||||
|
||||
LOG_D(NR_PHY, "****** end Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
|
||||
|
||||
@@ -132,8 +132,11 @@ binary_search_float_nr(
|
||||
* TS 38.213 9 UE procedure for reporting control information
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data, c16_t **txdataF)
|
||||
void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue,
|
||||
const UE_nr_rxtx_proc_t *proc,
|
||||
nr_phy_data_tx_t *phy_data,
|
||||
c16_t **txdataF,
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT])
|
||||
{
|
||||
const int nr_slot_tx = proc->nr_slot_tx;
|
||||
NR_UE_PUCCH *pucch_vars = &phy_data->pucch_vars;
|
||||
@@ -141,6 +144,10 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n
|
||||
for (int i=0; i<2; i++) {
|
||||
if(pucch_vars->active[i]) {
|
||||
const fapi_nr_ul_config_pucch_pdu *pucch_pdu = &pucch_vars->pucch_pdu[i];
|
||||
for (int symb_idx = 0; symb_idx < pucch_pdu->nr_of_symbols; symb_idx++) {
|
||||
int symb = pucch_pdu->start_symbol_index + symb_idx;
|
||||
was_symbol_used[symb] = true;
|
||||
}
|
||||
uint16_t nb_of_prbs = pucch_pdu->prb_size;
|
||||
/* Generate PUCCH signal according to its format and parameters */
|
||||
|
||||
|
||||
@@ -50,6 +50,6 @@
|
||||
|
||||
/*************** FUNCTIONS ****************************************/
|
||||
|
||||
void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data, c16_t **txdataF);
|
||||
void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data, c16_t **txdataF, bool was_symbol_used[14]);
|
||||
|
||||
#endif /* PUCCH_UCI_UE_NR_H */
|
||||
|
||||
@@ -1091,11 +1091,16 @@ printf("%d\n", slot);
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
} else {
|
||||
bool was_symbol_used[NR_NUMBER_OF_SYMBOLS_PER_SLOT];
|
||||
for (int i = 0; i < 14; i++) {
|
||||
was_symbol_used[i] = true;
|
||||
}
|
||||
nr_normal_prefix_mod(&gNB->common_vars.txdataF[0][aa][txdataF_offset],
|
||||
&txdata[aa][slot_offset],
|
||||
14,
|
||||
frame_parms,
|
||||
slot);
|
||||
slot,
|
||||
was_symbol_used);
|
||||
}
|
||||
}
|
||||
if (n_trials==1) {
|
||||
|
||||
@@ -1525,7 +1525,7 @@ int main(int argc, char *argv[])
|
||||
printStatIndent(&gNB->ulsch_decoding_stats,"ULSCH total decoding time");
|
||||
|
||||
printf("\nUE TX\n");
|
||||
for (int i = PHY_PROC_TX; i <= ULSCH_ENCODING_STATS; i++) {
|
||||
for (int i = PHY_PROC_TX; i <= OFDM_MOD_STATS; i++) {
|
||||
printStatIndent(&UE->phy_cpu_stats.cpu_time_stats[i], UE->phy_cpu_stats.cpu_time_stats[i].meas_name);
|
||||
}
|
||||
printStatIndent(&gNB->rx_srs_stats,"RX SRS time");
|
||||
|
||||
@@ -71,9 +71,6 @@
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
|
||||
// maxnoofPDUSessions in 3GPP TS 38.413
|
||||
#define NGAP_MAX_PDUSESSION 16 // 256 according to specs
|
||||
|
||||
/* Length of the transport layer address string
|
||||
* 160 bits / 8 bits by char.
|
||||
*/
|
||||
@@ -548,12 +545,12 @@ typedef struct ngap_initial_context_setup_resp_s {
|
||||
/* Number of pdusession setup-ed in the list */
|
||||
uint8_t nb_of_pdusessions;
|
||||
/* list of pdusession setup-ed by RRC layers */
|
||||
pdusession_setup_t pdusessions[NGAP_MAX_PDUSESSION];
|
||||
pdusession_setup_t pdusessions[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
/* Number of pdusession failed to be setup in list */
|
||||
uint8_t nb_of_pdusessions_failed;
|
||||
/* list of pdusessions that failed to be setup */
|
||||
pdusession_failed_t pdusessions_failed[NGAP_MAX_PDUSESSION];
|
||||
pdusession_failed_t pdusessions_failed[NGAP_MAX_PDU_SESSION];
|
||||
} ngap_initial_context_setup_resp_t;
|
||||
|
||||
typedef struct ngap_initial_context_setup_fail_s {
|
||||
@@ -633,7 +630,7 @@ typedef struct ngap_initial_context_setup_req_s {
|
||||
/* Number of pdusession to be setup in the list */
|
||||
uint8_t nb_of_pdusessions;
|
||||
/* list of pdusession to be setup by RRC layers */
|
||||
pdusession_t pdusession_param[NGAP_MAX_PDUSESSION];
|
||||
pdusession_t pdusession_param[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
/* Mobility Restriction List */
|
||||
uint8_t mobility_restriction_flag;
|
||||
@@ -689,7 +686,7 @@ typedef struct ngap_pdusession_setup_req_s {
|
||||
uint8_t nb_pdusessions_tosetup;
|
||||
|
||||
/* E RAB setup request */
|
||||
pdusession_t pdusession_setup_params[NGAP_MAX_PDUSESSION];
|
||||
pdusession_t pdusession_setup_params[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
/* UE Uplink Aggregated Max Bitrates */
|
||||
uint64_t ueAggMaxBitRateUplink;
|
||||
@@ -704,12 +701,12 @@ typedef struct ngap_pdusession_setup_resp_s {
|
||||
/* Number of pdusession setup-ed in the list */
|
||||
uint8_t nb_of_pdusessions;
|
||||
/* list of pdusession setup-ed by RRC layers */
|
||||
pdusession_setup_t pdusessions[NGAP_MAX_PDUSESSION];
|
||||
pdusession_setup_t pdusessions[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
/* Number of pdusession failed to be setup in list */
|
||||
uint8_t nb_of_pdusessions_failed;
|
||||
/* list of pdusessions that failed to be setup */
|
||||
pdusession_failed_t pdusessions_failed[NGAP_MAX_PDUSESSION];
|
||||
pdusession_failed_t pdusessions_failed[NGAP_MAX_PDU_SESSION];
|
||||
} ngap_pdusession_setup_resp_t;
|
||||
|
||||
typedef struct ngap_path_switch_req_s {
|
||||
@@ -719,7 +716,7 @@ typedef struct ngap_path_switch_req_s {
|
||||
uint8_t nb_of_pdusessions;
|
||||
|
||||
/* list of pdusession setup-ed by RRC layers */
|
||||
pdusession_setup_t pdusessions_tobeswitched[NGAP_MAX_PDUSESSION];
|
||||
pdusession_setup_t pdusessions_tobeswitched[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
/* AMF UE id */
|
||||
uint64_t amf_ue_ngap_id;
|
||||
@@ -749,13 +746,13 @@ typedef struct ngap_path_switch_req_ack_s {
|
||||
uint8_t nb_pdusessions_tobeswitched;
|
||||
|
||||
/* list of pdusession to be switched by RRC layers */
|
||||
pdusession_tobeswitched_t pdusessions_tobeswitched[NGAP_MAX_PDUSESSION];
|
||||
pdusession_tobeswitched_t pdusessions_tobeswitched[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
/* Number of pdusessions to be released by RRC */
|
||||
uint8_t nb_pdusessions_tobereleased;
|
||||
|
||||
/* list of pdusessions to be released */
|
||||
pdusession_failed_t pdusessions_tobereleased[NGAP_MAX_PDUSESSION];
|
||||
pdusession_failed_t pdusessions_tobereleased[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
/* Security key */
|
||||
int next_hop_chain_count;
|
||||
@@ -776,9 +773,9 @@ typedef struct ngap_pdusession_modification_ind_s {
|
||||
uint8_t nb_of_pdusessions_nottobemodified;
|
||||
|
||||
/* list of pdusession setup-ed by RRC layers */
|
||||
pdusession_setup_t pdusessions_tobemodified[NGAP_MAX_PDUSESSION];
|
||||
pdusession_setup_t pdusessions_tobemodified[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
pdusession_setup_t pdusessions_nottobemodified[NGAP_MAX_PDUSESSION];
|
||||
pdusession_setup_t pdusessions_nottobemodified[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
uint16_t ue_initial_id;
|
||||
|
||||
@@ -805,7 +802,7 @@ typedef struct ngap_ue_release_req_s {
|
||||
/* Number of pdusession resource in the list */
|
||||
uint8_t nb_of_pdusessions;
|
||||
/* list of pdusession resource by RRC layers */
|
||||
pdusession_release_t pdusessions[NGAP_MAX_PDUSESSION];
|
||||
pdusession_release_t pdusessions[NGAP_MAX_PDU_SESSION];
|
||||
ngap_cause_t cause;
|
||||
} ngap_ue_release_req_t, ngap_ue_release_resp_t;
|
||||
|
||||
@@ -820,7 +817,7 @@ typedef struct ngap_pdusession_modify_req_s {
|
||||
uint8_t nb_pdusessions_tomodify;
|
||||
|
||||
/* pdu session modify request */
|
||||
pdusession_t pdusession_modify_params[NGAP_MAX_PDUSESSION];
|
||||
pdusession_t pdusession_modify_params[NGAP_MAX_PDU_SESSION];
|
||||
} ngap_pdusession_modify_req_t;
|
||||
|
||||
typedef struct ngap_pdusession_modify_resp_s {
|
||||
@@ -829,12 +826,12 @@ typedef struct ngap_pdusession_modify_resp_s {
|
||||
/* Number of pdusession modify-ed in the list */
|
||||
uint8_t nb_of_pdusessions;
|
||||
/* list of pdusession modify-ed by RRC layers */
|
||||
pdusession_modify_t pdusessions[NGAP_MAX_PDUSESSION];
|
||||
pdusession_modify_t pdusessions[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
/* Number of pdusession failed to be modify in list */
|
||||
uint8_t nb_of_pdusessions_failed;
|
||||
/* list of pdusessions that failed to be modify */
|
||||
pdusession_failed_t pdusessions_failed[NGAP_MAX_PDUSESSION];
|
||||
pdusession_failed_t pdusessions_failed[NGAP_MAX_PDU_SESSION];
|
||||
} ngap_pdusession_modify_resp_t;
|
||||
|
||||
typedef struct ngap_pdusession_release_command_s {
|
||||
@@ -851,7 +848,7 @@ typedef struct ngap_pdusession_release_command_s {
|
||||
uint8_t nb_pdusessions_torelease;
|
||||
|
||||
/* PDUSession release command */
|
||||
pdusession_release_t pdusession_release_params[NGAP_MAX_PDUSESSION];
|
||||
pdusession_release_t pdusession_release_params[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
} ngap_pdusession_release_command_t;
|
||||
|
||||
@@ -866,12 +863,12 @@ typedef struct ngap_pdusession_release_resp_s {
|
||||
uint8_t nb_of_pdusessions_released;
|
||||
|
||||
/* list of pdusessions released */
|
||||
pdusession_release_t pdusession_release[NGAP_MAX_PDUSESSION];
|
||||
pdusession_release_t pdusession_release[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
/* Number of pdusession failed to be released in list */
|
||||
uint8_t nb_of_pdusessions_failed;
|
||||
/* list of pdusessions that failed to be released */
|
||||
pdusession_failed_t pdusessions_failed[NGAP_MAX_PDUSESSION];
|
||||
pdusession_failed_t pdusessions_failed[NGAP_MAX_PDU_SESSION];
|
||||
|
||||
} ngap_pdusession_release_resp_t;
|
||||
|
||||
|
||||
@@ -1,4 +1,44 @@
|
||||
set(UE_ID_COMMON_E2SM_SRCS
|
||||
../flexric/src/sm/rc_sm/ie/asn/AMFPointer.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/AMFRegionID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/AMFSetID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/AMF-UE-NGAP-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/ENB-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/ENB-UE-X2AP-ID-Extension.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/ENB-UE-X2AP-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/GlobalENB-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/GlobalGNB-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/GlobalNgENB-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/GlobalNGRANNodeID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/GNB-CU-CP-UE-E1AP-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/GNB-CU-UE-F1AP-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/GNB-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/GUAMI.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/GUMMEI.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/MME-Code.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/MME-Group-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/MME-UE-S1AP-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/NGENB-CU-UE-W1AP-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/NgENB-ID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/NG-RANnodeUEXnAPID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/PLMNIdentity.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/RANUEID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-ENB.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-EN-GNB.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-GNB-CU-CP-E1AP-ID-Item.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-GNB-CU-CP-E1AP-ID-List.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-GNB-CU-CP-F1AP-ID-Item.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-GNB-CU-F1AP-ID-List.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-GNB-CU-UP.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-GNB-DU.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-GNB.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-NG-ENB-DU.c
|
||||
../flexric/src/sm/rc_sm/ie/asn/UEID-NG-ENB.c
|
||||
)
|
||||
|
||||
add_library(e2_ran_func_cuup STATIC
|
||||
${UE_ID_COMMON_E2SM_SRCS}
|
||||
init_ran_func.c
|
||||
read_setup_ran.c
|
||||
O-RAN/ran_e2sm_ue_id.c
|
||||
@@ -13,11 +53,12 @@ add_library(e2_ran_func_cuup STATIC
|
||||
../flexric/test/rnd/fill_rnd_data_tc.c
|
||||
)
|
||||
|
||||
target_link_libraries(e2_ran_func_cuup PUBLIC asn1_nr_rrc nr_rrc asn1_nr_rrc_hdrs e2_time_obj kpm_ric_info_common_obj 3gpp_derived_ie_obj e2sm_rc_ir_obj sm_common_ie_obj ds alg)
|
||||
target_link_libraries(e2_ran_func_cuup PUBLIC asn1_nr_rrc nr_rrc asn1_nr_rrc_hdrs e2_time_obj kpm_ric_info_common_obj 3gpp_derived_ie_obj e2sm_rc_ir_obj sm_common_ie_obj ds alg sm_common_enc_asn_obj_rc 3gpp_derived_ie_enc_asn_obj_rc)
|
||||
target_compile_definitions(e2_ran_func_cuup PUBLIC ${E2AP_VERSION} ${KPM_VERSION} NGRAN_GNB_CUUP)
|
||||
|
||||
|
||||
add_library(e2_ran_func_du_cucp_cuup STATIC
|
||||
${UE_ID_COMMON_E2SM_SRCS}
|
||||
init_ran_func.c
|
||||
read_setup_ran.c
|
||||
O-RAN/ran_e2sm_ue_id.c
|
||||
@@ -36,7 +77,7 @@ add_library(e2_ran_func_du_cucp_cuup STATIC
|
||||
../flexric/test/rnd/fill_rnd_data_tc.c
|
||||
)
|
||||
|
||||
target_link_libraries(e2_ran_func_du_cucp_cuup PUBLIC asn1_nr_rrc nr_rrc asn1_nr_rrc_hdrs e2_time_obj kpm_ric_info_common_obj 3gpp_derived_ie_obj e2sm_rc_ir_obj sm_common_ie_obj ds)
|
||||
target_link_libraries(e2_ran_func_du_cucp_cuup PUBLIC asn1_nr_rrc nr_rrc asn1_nr_rrc_hdrs e2_time_obj kpm_ric_info_common_obj 3gpp_derived_ie_obj e2sm_rc_ir_obj sm_common_ie_obj ds sm_common_enc_asn_obj_rc 3gpp_derived_ie_enc_asn_obj_rc)
|
||||
target_compile_definitions(e2_ran_func_du_cucp_cuup PUBLIC ${E2AP_VERSION} ${KPM_VERSION} NGRAN_GNB_DU NGRAN_GNB_CUCP NGRAN_GNB_CUUP)
|
||||
|
||||
# Current implementation:
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "../../flexric/src/sm/rc_sm/ie/ir/lst_ran_param.h"
|
||||
#include "../../flexric/src/sm/rc_sm/ie/ir/ran_param_list.h"
|
||||
#include "../../flexric/src/agent/e2_agent_api.h"
|
||||
#include "openair2/E2AP/flexric/src/lib/sm/enc/enc_ue_id.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
@@ -53,37 +54,60 @@ static void init_once_rc(void)
|
||||
init_rc_subs_data(&rc_subs_data);
|
||||
}
|
||||
|
||||
static void fill_rc_ev_trig(ran_func_def_ev_trig_t* ev_trig)
|
||||
static seq_ev_trg_style_t fill_ev_tr_format_4(const char *ev_style_name)
|
||||
{
|
||||
// Sequence of EVENT TRIGGER styles
|
||||
// [1 - 63]
|
||||
ev_trig->sz_seq_ev_trg_style = 1;
|
||||
ev_trig->seq_ev_trg_style = calloc(ev_trig->sz_seq_ev_trg_style, sizeof(seq_ev_trg_style_t));
|
||||
assert(ev_trig->seq_ev_trg_style != NULL && "Memory exhausted");
|
||||
|
||||
seq_ev_trg_style_t* ev_trig_style = &ev_trig->seq_ev_trg_style[0];
|
||||
seq_ev_trg_style_t ev_trig_style = {0};
|
||||
|
||||
// RIC Event Trigger Style Type
|
||||
// Mandatory
|
||||
// 9.3.3
|
||||
// 6.2.2.2.
|
||||
// INTEGER
|
||||
ev_trig_style->style = 4;
|
||||
ev_trig_style.style = 4;
|
||||
|
||||
// RIC Event Trigger Style Name
|
||||
// Mandatory
|
||||
// 9.3.4
|
||||
// 6.2.2.3
|
||||
//PrintableString(SIZE(1..150,...))
|
||||
const char ev_style_name[] = "UE Information Change";
|
||||
ev_trig_style->name = cp_str_to_ba(ev_style_name);
|
||||
ev_trig_style.name = cp_str_to_ba(ev_style_name);
|
||||
|
||||
// RIC Event Trigger Format Type
|
||||
// Mandatory
|
||||
// 9.3.5
|
||||
// 6.2.2.4.
|
||||
// INTEGER
|
||||
ev_trig_style->format = FORMAT_4_E2SM_RC_EV_TRIGGER_FORMAT;
|
||||
ev_trig_style.format = FORMAT_4_E2SM_RC_EV_TRIGGER_FORMAT;
|
||||
|
||||
return ev_trig_style;
|
||||
}
|
||||
|
||||
static seq_ev_trg_style_t fill_ev_tr_format_1(const char *ev_style_name)
|
||||
{
|
||||
seq_ev_trg_style_t ev_trig_style = {0};
|
||||
|
||||
// RIC Event Trigger Style Type
|
||||
// Mandatory
|
||||
// 9.3.3
|
||||
ev_trig_style.style = 1;
|
||||
|
||||
// RIC Event Trigger Style Name
|
||||
// Mandatory
|
||||
// 9.3.4
|
||||
ev_trig_style.name = cp_str_to_ba(ev_style_name);
|
||||
|
||||
// RIC Event Trigger Format Type
|
||||
// Mandatory
|
||||
// 9.3.5
|
||||
ev_trig_style.format = FORMAT_1_E2SM_RC_EV_TRIGGER_FORMAT;
|
||||
|
||||
return ev_trig_style;
|
||||
}
|
||||
|
||||
static void fill_rc_ev_trig(ran_func_def_ev_trig_t* ev_trig)
|
||||
{
|
||||
// Sequence of EVENT TRIGGER styles
|
||||
// [1 - 63]
|
||||
ev_trig->sz_seq_ev_trg_style = 2;
|
||||
ev_trig->seq_ev_trg_style = calloc(ev_trig->sz_seq_ev_trg_style, sizeof(seq_ev_trg_style_t));
|
||||
assert(ev_trig->seq_ev_trg_style != NULL && "Memory exhausted");
|
||||
|
||||
ev_trig->seq_ev_trg_style[0] = fill_ev_tr_format_1("Message Event");
|
||||
ev_trig->seq_ev_trg_style[1] = fill_ev_tr_format_4("UE Information Change");
|
||||
|
||||
// Sequence of RAN Parameters for L2 Variables
|
||||
// [0 - 65535]
|
||||
@@ -106,82 +130,141 @@ static void fill_rc_ev_trig(ran_func_def_ev_trig_t* ev_trig)
|
||||
ev_trig->seq_ran_param_id_cell = NULL;
|
||||
}
|
||||
|
||||
static void fill_rc_report(ran_func_def_report_t* report)
|
||||
static seq_report_sty_t fill_report_style_4(const char *report_name)
|
||||
{
|
||||
// Sequence of REPORT styles
|
||||
// [1 - 63]
|
||||
report->sz_seq_report_sty = 1;
|
||||
report->seq_report_sty = calloc(report->sz_seq_report_sty, sizeof(seq_report_sty_t));
|
||||
assert(report->seq_report_sty != NULL && "Memory exhausted");
|
||||
seq_report_sty_t report_style = {0};
|
||||
|
||||
seq_report_sty_t* report_style = &report->seq_report_sty[0];
|
||||
|
||||
// RIC Report Style Type
|
||||
// RIC Report Style Type
|
||||
// Mandatory
|
||||
// 9.3.3
|
||||
// 6.2.2.2.
|
||||
// INTEGER
|
||||
report_style->report_type = 4;
|
||||
report_style.report_type = 4;
|
||||
|
||||
// RIC Report Style Name
|
||||
// Mandatory
|
||||
// 9.3.4
|
||||
// 6.2.2.3.
|
||||
// PrintableString(SIZE(1..150,...))
|
||||
const char report_name[] = "UE Information";
|
||||
report_style->name = cp_str_to_ba(report_name);
|
||||
report_style.name = cp_str_to_ba(report_name);
|
||||
|
||||
// Supported RIC Event Trigger Style Type
|
||||
// Mandatory
|
||||
// 9.3.3
|
||||
// 6.2.2.2.
|
||||
// INTEGER
|
||||
report_style->ev_trig_type = FORMAT_4_E2SM_RC_EV_TRIGGER_FORMAT;
|
||||
report_style.ev_trig_type = FORMAT_4_E2SM_RC_EV_TRIGGER_FORMAT;
|
||||
|
||||
// RIC Report Action Format Type
|
||||
// Mandatory
|
||||
// 9.3.5
|
||||
// 6.2.2.4.
|
||||
// INTEGER
|
||||
report_style->act_frmt_type = FORMAT_1_E2SM_RC_ACT_DEF;
|
||||
report_style.act_frmt_type = FORMAT_1_E2SM_RC_ACT_DEF;
|
||||
|
||||
// RIC Indication Header Format Type
|
||||
// Mandatory
|
||||
// 9.3.5
|
||||
// 6.2.2.4.
|
||||
// INTEGER
|
||||
report_style->ind_hdr_type = FORMAT_1_E2SM_RC_IND_HDR;
|
||||
report_style.ind_hdr_type = FORMAT_1_E2SM_RC_IND_HDR;
|
||||
|
||||
// RIC Indication Message Format Type
|
||||
// Mandatory
|
||||
// 9.3.5
|
||||
// 6.2.2.4.
|
||||
// INTEGER
|
||||
report_style->ind_msg_type = FORMAT_2_E2SM_RC_IND_MSG;
|
||||
report_style.ind_msg_type = FORMAT_2_E2SM_RC_IND_MSG;
|
||||
|
||||
// Sequence of RAN Parameters Supported
|
||||
// [0 - 65535]
|
||||
report_style->sz_seq_ran_param = 1;
|
||||
report_style->ran_param = calloc(report_style->sz_seq_ran_param, sizeof(seq_ran_param_3_t));
|
||||
assert(report_style->ran_param != NULL && "Memory exhausted");
|
||||
report_style.sz_seq_ran_param = 1;
|
||||
report_style.ran_param = calloc(report_style.sz_seq_ran_param, sizeof(seq_ran_param_3_t));
|
||||
assert(report_style.ran_param != NULL && "Memory exhausted");
|
||||
|
||||
// RAN Parameter ID
|
||||
// Mandatory
|
||||
// 9.3.8
|
||||
// [1- 4294967295]
|
||||
report_style->ran_param[0].id = E2SM_RC_RS4_RRC_STATE_CHANGED_TO;
|
||||
report_style.ran_param[0].id = E2SM_RC_RS4_RRC_STATE_CHANGED_TO;
|
||||
|
||||
// RAN Parameter Name
|
||||
// Mandatory
|
||||
// 9.3.9
|
||||
// [1-150]
|
||||
const char ran_param_name[] = "RRC State";
|
||||
report_style->ran_param[0].name = cp_str_to_ba(ran_param_name);
|
||||
const char ran_param_name[] = "RRC State Changed To";
|
||||
report_style.ran_param[0].name = cp_str_to_ba(ran_param_name);
|
||||
|
||||
// RAN Parameter Definition
|
||||
// Optional
|
||||
// 9.3.51
|
||||
report_style->ran_param[0].def = NULL;
|
||||
report_style.ran_param[0].def = NULL;
|
||||
|
||||
return report_style;
|
||||
}
|
||||
|
||||
static seq_report_sty_t fill_report_style_1(const char *report_name)
|
||||
{
|
||||
seq_report_sty_t report_style = {0};
|
||||
|
||||
// RIC Report Style Type
|
||||
// Mandatory
|
||||
// 9.3.3
|
||||
report_style.report_type = 1;
|
||||
|
||||
// RIC Report Style Name
|
||||
// Mandatory
|
||||
// 9.3.4
|
||||
report_style.name = cp_str_to_ba(report_name);
|
||||
|
||||
// Supported RIC Event Trigger Style Type
|
||||
// Mandatory
|
||||
// 9.3.3
|
||||
report_style.ev_trig_type = FORMAT_1_E2SM_RC_EV_TRIGGER_FORMAT;
|
||||
|
||||
// RIC Report Action Format Type
|
||||
// Mandatory
|
||||
// 9.3.5
|
||||
report_style.act_frmt_type = FORMAT_1_E2SM_RC_ACT_DEF;
|
||||
|
||||
// RIC Indication Header Format Type
|
||||
// Mandatory
|
||||
// 9.3.5
|
||||
report_style.ind_hdr_type = FORMAT_1_E2SM_RC_IND_HDR;
|
||||
|
||||
// RIC Indication Message Format Type
|
||||
// Mandatory
|
||||
// 9.3.5
|
||||
report_style.ind_msg_type = FORMAT_1_E2SM_RC_IND_MSG;
|
||||
|
||||
// Sequence of RAN Parameters Supported
|
||||
// [0 - 65535]
|
||||
report_style.sz_seq_ran_param = 2;
|
||||
report_style.ran_param = calloc_or_fail(report_style.sz_seq_ran_param, sizeof(seq_ran_param_3_t));
|
||||
|
||||
// RAN Parameter ID
|
||||
// Mandatory
|
||||
// 9.3.8
|
||||
// [1- 4294967295]
|
||||
report_style.ran_param[0].id = E2SM_RC_RS1_RRC_MESSAGE;
|
||||
report_style.ran_param[1].id = E2SM_RC_RS1_UE_ID;
|
||||
|
||||
// RAN Parameter Name
|
||||
// Mandatory
|
||||
// 9.3.9
|
||||
// [1-150]
|
||||
const char ran_param_name_0[] = "RRC Message";
|
||||
report_style.ran_param[0].name = cp_str_to_ba(ran_param_name_0);
|
||||
const char ran_param_name_1[] = "UE ID";
|
||||
report_style.ran_param[1].name = cp_str_to_ba(ran_param_name_1);
|
||||
|
||||
// RAN Parameter Definition
|
||||
// Optional
|
||||
// 9.3.51
|
||||
report_style.ran_param[0].def = NULL;
|
||||
report_style.ran_param[1].def = NULL;
|
||||
|
||||
return report_style;
|
||||
}
|
||||
|
||||
static void fill_rc_report(ran_func_def_report_t* report)
|
||||
{
|
||||
// Sequence of REPORT styles
|
||||
// [1 - 63]
|
||||
report->sz_seq_report_sty = 2;
|
||||
report->seq_report_sty = calloc(report->sz_seq_report_sty, sizeof(seq_report_sty_t));
|
||||
assert(report->seq_report_sty != NULL && "Memory exhausted");
|
||||
|
||||
report->seq_report_sty[0] = fill_report_style_1("Message Copy");
|
||||
report->seq_report_sty[1] = fill_report_style_4("UE Information");
|
||||
}
|
||||
|
||||
static void fill_rc_control(ran_func_def_ctrl_t* ctrl)
|
||||
@@ -476,7 +559,7 @@ void read_rc_setup_sm(void* data)
|
||||
DevAssert(ret == 0);
|
||||
}
|
||||
|
||||
static seq_ran_param_t fill_rrc_state_change_seq_ran(const rc_sm_rrc_state_e rrc_state)
|
||||
static seq_ran_param_t fill_rrc_state_change_seq_ran(const rrc_state_e2sm_rc_e rrc_state)
|
||||
{
|
||||
seq_ran_param_t seq_ran_param = {0};
|
||||
|
||||
@@ -490,14 +573,15 @@ static seq_ran_param_t fill_rrc_state_change_seq_ran(const rc_sm_rrc_state_e rrc
|
||||
return seq_ran_param;
|
||||
}
|
||||
|
||||
static rc_ind_data_t* fill_ue_rrc_state_change(const gNB_RRC_UE_t *rrc_ue_context, const rc_sm_rrc_state_e rrc_state)
|
||||
static rc_ind_data_t* fill_ue_rrc_state_change(const gNB_RRC_UE_t *rrc_ue_context, const rrc_state_e2sm_rc_e rrc_state, const uint16_t cond_id)
|
||||
{
|
||||
rc_ind_data_t* rc_ind = calloc(1, sizeof(rc_ind_data_t));
|
||||
assert(rc_ind != NULL && "Memory exhausted");
|
||||
|
||||
// Generate Indication Header
|
||||
rc_ind->hdr.format = FORMAT_1_E2SM_RC_IND_HDR;
|
||||
rc_ind->hdr.frmt_1.ev_trigger_id = NULL;
|
||||
rc_ind->hdr.frmt_1.ev_trigger_id = malloc_or_fail(sizeof(uint32_t));
|
||||
*rc_ind->hdr.frmt_1.ev_trigger_id = cond_id;
|
||||
|
||||
// Generate Indication Message
|
||||
rc_ind->msg.format = FORMAT_2_E2SM_RC_IND_MSG;
|
||||
@@ -531,21 +615,95 @@ static void send_aper_ric_ind(const uint32_t ric_req_id, rc_ind_data_t* rc_ind_d
|
||||
printf("[E2 AGENT] Event for RIC request ID %d generated\n", ric_req_id);
|
||||
}
|
||||
|
||||
static void check_rrc_state(const gNB_RRC_UE_t *rrc_ue_context, const rc_sm_rrc_state_e rrc_state, const uint32_t ric_req_id, const e2sm_rc_ev_trg_frmt_4_t *frmt_4)
|
||||
static rc_ind_data_t* fill_ue_id(const gNB_RRC_UE_t *rrc_ue_context, const uint16_t cond_id)
|
||||
{
|
||||
rc_ind_data_t* rc_ind = malloc_or_fail(sizeof(rc_ind_data_t));
|
||||
|
||||
// Generate Indication Header
|
||||
rc_ind->hdr.format = FORMAT_1_E2SM_RC_IND_HDR;
|
||||
rc_ind->hdr.frmt_1.ev_trigger_id = malloc_or_fail(sizeof(uint32_t));
|
||||
*rc_ind->hdr.frmt_1.ev_trigger_id = cond_id;
|
||||
|
||||
// Generate Indication Message
|
||||
rc_ind->msg.format = FORMAT_1_E2SM_RC_IND_MSG;
|
||||
|
||||
// Initialize RAN Parameter
|
||||
rc_ind->msg.frmt_1.sz_seq_ran_param = 1;
|
||||
rc_ind->msg.frmt_1.seq_ran_param = calloc_or_fail(rc_ind->msg.frmt_1.sz_seq_ran_param, sizeof(seq_ran_param_t));
|
||||
|
||||
// Fill the RAN Parameter details for UE ID
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_id = E2SM_RC_RS1_UE_ID;
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_val.type = ELEMENT_KEY_FLAG_FALSE_RAN_PARAMETER_VAL_TYPE;
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_val.flag_false = malloc_or_fail(sizeof(ran_parameter_value_t));
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_val.flag_false->type = OCTET_STRING_RAN_PARAMETER_VALUE;
|
||||
|
||||
const ngran_node_t node_type = get_e2_node_type();
|
||||
ue_id_e2sm_t ue_id_data = fill_ue_id_data[node_type](rrc_ue_context, 0, 0);
|
||||
|
||||
UEID_t enc_ue_id_data = enc_ue_id_asn(&ue_id_data);
|
||||
|
||||
const enum asn_transfer_syntax syntax = ATS_ALIGNED_BASIC_PER;
|
||||
asn_encode_to_new_buffer_result_t res = asn_encode_to_new_buffer(NULL, syntax, &asn_DEF_UEID, &enc_ue_id_data);
|
||||
assert(res.buffer != NULL && res.result.encoded > 0 && "[E2 agent] Failed to encode UE ID.");
|
||||
byte_array_t ba = {.buf = res.buffer, .len = res.result.encoded};
|
||||
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_val.flag_false->octet_str_ran = copy_byte_array(ba);
|
||||
|
||||
// Call Process ID
|
||||
rc_ind->proc_id = NULL;
|
||||
|
||||
free_ue_id_e2sm(&ue_id_data);
|
||||
ASN_STRUCT_RESET(asn_DEF_UEID, &enc_ue_id_data);
|
||||
free(res.buffer);
|
||||
|
||||
return rc_ind;
|
||||
}
|
||||
|
||||
static void check_ue_id_cond(const gNB_RRC_UE_t *rrc_ue_context, const uint16_t class, const uint32_t msg_id, const uint32_t ric_req_id, const e2sm_rc_ev_trg_frmt_1_t *frmt_1)
|
||||
{
|
||||
for (size_t i = 0; i < frmt_1->sz_msg_ev_trg; i++) {
|
||||
msg_ev_trg_t *ev_item = &frmt_1->msg_ev_trg[i];
|
||||
if ((ev_item->msg_type == RRC_MSG_MSG_TYPE_EV_TRG && ev_item->rrc_msg.type == NR_RRC_MESSAGE_ID && ev_item->rrc_msg.nr == class && ev_item->rrc_msg.rrc_msg_id == msg_id) // rrcSetupComplete
|
||||
|| (ev_item->msg_type == NETWORK_INTERFACE_MSG_TYPE_EV_TRG && ev_item->net.ni_type == class)) { // "F1 UE Context Setup Request", but in the subscription the class (F1) can only be specified which translates to any F1 msg
|
||||
rc_ind_data_t* rc_ind_data = fill_ue_id(rrc_ue_context, ev_item->ev_trigger_cond_id);
|
||||
send_aper_ric_ind(ric_req_id, rc_ind_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void signal_ue_id(const gNB_RRC_UE_t *rrc_ue_context, const uint16_t class, const uint32_t msg_id)
|
||||
{
|
||||
pthread_mutex_lock(&rc_mutex);
|
||||
if (rc_subs_data.rs1_param4.data == NULL) {
|
||||
pthread_mutex_unlock(&rc_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
const size_t num_subs = seq_arr_size(&rc_subs_data.rs1_param4);
|
||||
for (size_t sub_idx = 0; sub_idx < num_subs; sub_idx++) {
|
||||
const ran_param_data_t data = *(const ran_param_data_t *)seq_arr_at(&rc_subs_data.rs1_param4, sub_idx);
|
||||
check_ue_id_cond(rrc_ue_context, class, msg_id, data.ric_req_id, &data.ev_tr.frmt_1);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&rc_mutex);
|
||||
}
|
||||
|
||||
static void check_rrc_state(const gNB_RRC_UE_t *rrc_ue_context, const rrc_state_e2sm_rc_e rrc_state, const uint32_t ric_req_id, const e2sm_rc_ev_trg_frmt_4_t *frmt_4)
|
||||
{
|
||||
for (size_t i = 0; i < frmt_4->sz_ue_info_chng; i++) {
|
||||
const uint16_t cond_id = frmt_4->ue_info_chng[i].ev_trig_cond_id;
|
||||
const rrc_state_lst_t *rrc_elem = &frmt_4->ue_info_chng[i].rrc_state;
|
||||
for (size_t j = 0; j < rrc_elem->sz_rrc_state; j++) {
|
||||
const rrc_state_e2sm_rc_e ev_tr_rrc_state = rrc_elem->state_chng_to[j].state_chngd_to;
|
||||
if (ev_tr_rrc_state == (rrc_state_e2sm_rc_e)rrc_state || ev_tr_rrc_state == ANY_RRC_STATE_E2SM_RC) {
|
||||
rc_ind_data_t* rc_ind_data = fill_ue_rrc_state_change(rrc_ue_context, rrc_state);
|
||||
if (ev_tr_rrc_state == rrc_state || ev_tr_rrc_state == ANY_RRC_STATE_E2SM_RC) {
|
||||
rc_ind_data_t* rc_ind_data = fill_ue_rrc_state_change(rrc_ue_context, rrc_state, cond_id);
|
||||
send_aper_ric_ind(ric_req_id, rc_ind_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void signal_rrc_state_changed_to(const gNB_RRC_UE_t *rrc_ue_context, const rc_sm_rrc_state_e rrc_state)
|
||||
void signal_rrc_state_changed_to(const gNB_RRC_UE_t *rrc_ue_context, const rrc_state_e2sm_rc_e rrc_state)
|
||||
{
|
||||
pthread_mutex_lock(&rc_mutex);
|
||||
if (rc_subs_data.rs4_param202.data == NULL) {
|
||||
@@ -562,6 +720,67 @@ void signal_rrc_state_changed_to(const gNB_RRC_UE_t *rrc_ue_context, const rc_sm
|
||||
pthread_mutex_unlock(&rc_mutex);
|
||||
}
|
||||
|
||||
static rc_ind_data_t* fill_rrc_msg_copy(const byte_array_t rrc_ba, const uint16_t cond_id)
|
||||
{
|
||||
rc_ind_data_t* rc_ind = malloc_or_fail(sizeof(rc_ind_data_t));
|
||||
|
||||
// Generate Indication Header
|
||||
rc_ind->hdr.format = FORMAT_1_E2SM_RC_IND_HDR;
|
||||
rc_ind->hdr.frmt_1.ev_trigger_id = malloc_or_fail(sizeof(uint32_t));
|
||||
*rc_ind->hdr.frmt_1.ev_trigger_id = cond_id;
|
||||
|
||||
// Generate Indication Message
|
||||
rc_ind->msg.format = FORMAT_1_E2SM_RC_IND_MSG;
|
||||
|
||||
// Sequence of
|
||||
// RAN Parameter
|
||||
rc_ind->msg.frmt_1.sz_seq_ran_param = 1;
|
||||
rc_ind->msg.frmt_1.seq_ran_param = calloc_or_fail(rc_ind->msg.frmt_1.sz_seq_ran_param, sizeof(seq_ran_param_t));
|
||||
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_id = E2SM_RC_RS1_RRC_MESSAGE;
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_val.type = ELEMENT_KEY_FLAG_FALSE_RAN_PARAMETER_VAL_TYPE;
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_val.flag_false = malloc_or_fail(sizeof(ran_parameter_value_t));
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_val.flag_false->type = OCTET_STRING_RAN_PARAMETER_VALUE;
|
||||
|
||||
rc_ind->msg.frmt_1.seq_ran_param[0].ran_param_val.flag_false->octet_str_ran = copy_byte_array(rrc_ba);
|
||||
|
||||
// Call Process ID
|
||||
rc_ind->proc_id = NULL;
|
||||
|
||||
return rc_ind;
|
||||
}
|
||||
|
||||
static void check_rrc_msg_copy(const nr_rrc_class_e nr_channel, const uint32_t rrc_msg_id, const byte_array_t rrc_ba, const uint32_t ric_req_id, const e2sm_rc_ev_trg_frmt_1_t *frmt_1)
|
||||
{
|
||||
for (size_t i = 0; i < frmt_1->sz_msg_ev_trg; i++) {
|
||||
if (frmt_1->msg_ev_trg[i].msg_type != RRC_MSG_MSG_TYPE_EV_TRG)
|
||||
continue;
|
||||
if (frmt_1->msg_ev_trg[i].rrc_msg.type != NR_RRC_MESSAGE_ID)
|
||||
continue;
|
||||
if (frmt_1->msg_ev_trg[i].rrc_msg.nr == nr_channel && frmt_1->msg_ev_trg[i].rrc_msg.rrc_msg_id == rrc_msg_id) {
|
||||
rc_ind_data_t* rc_ind_data = fill_rrc_msg_copy(rrc_ba, frmt_1->msg_ev_trg[i].ev_trigger_cond_id);
|
||||
send_aper_ric_ind(ric_req_id, rc_ind_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void signal_rrc_msg(const nr_rrc_class_e nr_channel, const uint32_t rrc_msg_id, const byte_array_t rrc_ba)
|
||||
{
|
||||
pthread_mutex_lock(&rc_mutex);
|
||||
if (rc_subs_data.rs1_param3.data == NULL) {
|
||||
pthread_mutex_unlock(&rc_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
const size_t num_subs = seq_arr_size(&rc_subs_data.rs1_param3);
|
||||
for (size_t sub_idx = 0; sub_idx < num_subs; sub_idx++) {
|
||||
const ran_param_data_t data = *(const ran_param_data_t *)seq_arr_at(&rc_subs_data.rs1_param3, sub_idx);
|
||||
check_rrc_msg_copy(nr_channel, rrc_msg_id, rrc_ba, data.ric_req_id, &data.ev_tr.frmt_1);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&rc_mutex);
|
||||
}
|
||||
|
||||
static void free_aperiodic_subscription(uint32_t ric_req_id)
|
||||
{
|
||||
remove_rc_subs_data(&rc_subs_data, ric_req_id);
|
||||
@@ -572,6 +791,14 @@ static seq_arr_t *get_sa(const e2sm_rc_event_trigger_t *ev_tr, const uint32_t ra
|
||||
seq_arr_t *sa = NULL;
|
||||
|
||||
switch (ev_tr->format) {
|
||||
case FORMAT_1_E2SM_RC_EV_TRIGGER_FORMAT:
|
||||
if (ran_param_id == E2SM_RC_RS1_RRC_MESSAGE) {
|
||||
sa = &rc_subs_data.rs1_param3;
|
||||
} else if (ran_param_id == E2SM_RC_RS1_UE_ID) {
|
||||
sa = &rc_subs_data.rs1_param4;
|
||||
}
|
||||
break;
|
||||
|
||||
case FORMAT_4_E2SM_RC_EV_TRIGGER_FORMAT:
|
||||
if (ran_param_id == E2SM_RC_RS4_RRC_STATE_CHANGED_TO) {
|
||||
sa = &rc_subs_data.rs4_param202;
|
||||
|
||||
@@ -23,8 +23,14 @@
|
||||
#define RAN_FUNC_SM_RAN_CTRL_EXTERN_AGENT_H
|
||||
|
||||
#include "openair2/RRC/NR/nr_rrc_defs.h"
|
||||
#include "openair2/E2AP/flexric/src/lib/3gpp/ie/rrc_msg_id.h"
|
||||
#include "openair2/E2AP/flexric/src/lib/3gpp/ie/network_interface_type.h"
|
||||
#include "openair2/E2AP/flexric/src/sm/rc_sm/ie/ir/rrc_state.h"
|
||||
|
||||
typedef enum { RC_SM_RRC_CONNECTED, RC_SM_RRC_INACTIVE, RC_SM_RRC_IDLE, RC_SM_RRC_ANY } rc_sm_rrc_state_e;
|
||||
void signal_rrc_state_changed_to(const gNB_RRC_UE_t *rrc_ue_context, const rc_sm_rrc_state_e rrc_state);
|
||||
void signal_rrc_msg(const nr_rrc_class_e nr_channel, const uint32_t rrc_msg_id, const byte_array_t rrc_ba);
|
||||
|
||||
void signal_ue_id(const gNB_RRC_UE_t *rrc_ue_context, const uint16_t class, const uint32_t msg_id);
|
||||
|
||||
void signal_rrc_state_changed_to(const gNB_RRC_UE_t *rrc_ue_context, const rrc_state_e2sm_rc_e rrc_state);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,6 +41,8 @@ void init_rc_subs_data(rc_subs_data_t *rc_subs_data)
|
||||
{
|
||||
pthread_mutex_lock(&rc_mutex);
|
||||
// Initialize sequence array
|
||||
seq_arr_init(&rc_subs_data->rs1_param3, sizeof(ran_param_data_t));
|
||||
seq_arr_init(&rc_subs_data->rs1_param4, sizeof(ran_param_data_t));
|
||||
seq_arr_init(&rc_subs_data->rs4_param202, sizeof(ran_param_data_t));
|
||||
pthread_mutex_unlock(&rc_mutex);
|
||||
}
|
||||
@@ -57,9 +59,27 @@ void remove_rc_subs_data(rc_subs_data_t *rc_subs_data, uint32_t ric_req_id)
|
||||
{
|
||||
pthread_mutex_lock(&rc_mutex);
|
||||
/* find the sequence element that matches RIC request ID */
|
||||
elm_arr_t elm = find_if(&rc_subs_data->rs4_param202, (void *)&ric_req_id, eq_int);
|
||||
ran_param_data_t *data = elm.it;
|
||||
free_e2sm_rc_event_trigger(&data->ev_tr);
|
||||
seq_arr_erase(&rc_subs_data->rs4_param202, elm.it);
|
||||
elm_arr_t elm_rs1_param3 = find_if(&rc_subs_data->rs1_param3, (void *)&ric_req_id, eq_int);
|
||||
ran_param_data_t *data_rs1_param3 = elm_rs1_param3.it;
|
||||
if (data_rs1_param3 != NULL) {
|
||||
free_e2sm_rc_event_trigger(&data_rs1_param3->ev_tr);
|
||||
seq_arr_erase(&rc_subs_data->rs1_param3, elm_rs1_param3.it);
|
||||
}
|
||||
|
||||
/* find the sequence element that matches RIC request ID */
|
||||
elm_arr_t elm_rs1_param4 = find_if(&rc_subs_data->rs1_param4, (void *)&ric_req_id, eq_int);
|
||||
ran_param_data_t *data_rs1_param4 = elm_rs1_param4.it;
|
||||
if (data_rs1_param4 != NULL) {
|
||||
free_e2sm_rc_event_trigger(&data_rs1_param4->ev_tr);
|
||||
seq_arr_erase(&rc_subs_data->rs1_param4, elm_rs1_param4.it);
|
||||
}
|
||||
|
||||
/* find the sequence element that matches RIC request ID */
|
||||
elm_arr_t elm_rs4_param202 = find_if(&rc_subs_data->rs4_param202, (void *)&ric_req_id, eq_int);
|
||||
ran_param_data_t *data_rs4_param202 = elm_rs4_param202.it;
|
||||
if (data_rs4_param202 != NULL) {
|
||||
free_e2sm_rc_event_trigger(&data_rs4_param202->ev_tr);
|
||||
seq_arr_erase(&rc_subs_data->rs4_param202, elm_rs4_param202.it);
|
||||
}
|
||||
pthread_mutex_unlock(&rc_mutex);
|
||||
}
|
||||
|
||||
@@ -25,66 +25,14 @@
|
||||
#include "openair2/E2AP/flexric/src/sm/rc_sm/ie/rc_data_ie.h"
|
||||
#include "common/utils/ds/seq_arr.h"
|
||||
|
||||
typedef enum { // 8.2.1 RAN Parameters for Report Service Style 1
|
||||
E2SM_RC_RS1_UE_EVENT_ID = 1,
|
||||
E2SM_RC_RS1_NI_MESSAGE = 2,
|
||||
E2SM_RC_RS1_RRC_MESSAGE = 3,
|
||||
E2SM_RC_RS1_UE_ID = 4,
|
||||
E2SM_RC_RS1_OLD_AMF_UE_NGAP_ID = 5,
|
||||
E2SM_RC_RS1_CELL_GLOBAL_ID = 6,
|
||||
|
||||
END_E2SM_RC_RS1_RAN_PARAM_ID
|
||||
} report_style_1_ran_param_id_e;
|
||||
|
||||
typedef enum { // 8.2.2 RAN Parameters for Report Service Style 2
|
||||
E2SM_RC_RS2_CURRENT_UE_ID = 1,
|
||||
E2SM_RC_RS2_OLD_UE_ID = 2,
|
||||
E2SM_RC_RS2_CURRENT_RRC_STATE = 3,
|
||||
E2SM_RC_RS2_OLD_RRC_STATE = 4,
|
||||
E2SM_RC_RS2_UE_CONTEXT_INFORMATION_CONTAINER = 5,
|
||||
E2SM_RC_RS2_CELL_GLOBAL_ID = 6,
|
||||
E2SM_RC_RS2_UE_INFORMATION = 7,
|
||||
|
||||
END_E2SM_RC_RS2_RAN_PARAM_ID
|
||||
} report_style_2_ran_param_id_e;
|
||||
|
||||
typedef enum { // 8.2.3 RAN Parameters for Report Service Style 3
|
||||
E2SM_RC_RS3_CELL_CONTEXT_INFORMATION = 1,
|
||||
E2SM_RC_RS3_CELL_DELETED = 2,
|
||||
E2SM_RC_RS3_NEIGHBOUR_RELATION_TABLE = 3,
|
||||
|
||||
END_E2SM_RC_RS3_RAN_PARAM_ID
|
||||
} report_style_3_ran_param_id_e;
|
||||
|
||||
typedef enum { // 8.2.4 RAN Parameters for Report Service Style 4
|
||||
E2SM_RC_RS4_UL_MAC_CE = 100,
|
||||
E2SM_RC_RS4_DL_MAC_CE = 101,
|
||||
E2SM_RC_RS4_DL_BUFFER_OCCUPANCY = 102,
|
||||
E2SM_RC_RS4_CURRENT_RRC_STATE = 201,
|
||||
E2SM_RC_RS4_RRC_STATE_CHANGED_TO = 202,
|
||||
E2SM_RC_RS4_RRC_MESSAGE = 203,
|
||||
E2SM_RC_RS4_OLD_UE_ID = 300,
|
||||
E2SM_RC_RS4_CURRENT_UE_ID = 301,
|
||||
E2SM_RC_RS4_NI_MESSAGE = 302,
|
||||
E2SM_RC_RS4_CELL_GLOBAL_ID = 400,
|
||||
|
||||
END_E2SM_RC_RS4_RAN_PARAM_ID
|
||||
} report_style_4_ran_param_id_e;
|
||||
|
||||
typedef enum { // 8.2.5 RAN Parameters for Report Service Style 5
|
||||
E2SM_RC_RS5_UE_CONTEXT_INFORMATION = 1,
|
||||
E2SM_RC_RS5_CELL_CONTEXT_INFORMATION = 2,
|
||||
E2SM_RC_RS5_NEIGHBOUR_RELATION_TABLE = 3,
|
||||
|
||||
END_E2SM_RC_RS5_RAN_PARAM_ID
|
||||
} report_style_5_ran_param_id_e;
|
||||
|
||||
typedef struct ran_param_data {
|
||||
uint32_t ric_req_id;
|
||||
e2sm_rc_event_trigger_t ev_tr;
|
||||
} ran_param_data_t;
|
||||
|
||||
typedef struct {
|
||||
seq_arr_t rs1_param3; // E2SM_RC_RS1_RRC_MESSAGE
|
||||
seq_arr_t rs1_param4; // E2SM_RC_RS1_UE_ID
|
||||
seq_arr_t rs4_param202; // E2SM_RC_RS4_RRC_STATE_CHANGED_TO
|
||||
} rc_subs_data_t;
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ From O-RAN.WG3.E2SM-KPM-version specification, we implemented:
|
||||
We support RC v1.03. Uses ASN.1 encoding.
|
||||
|
||||
From ORAN.WG3.E2SM-RC-v01.03 specification, we implemented:
|
||||
* REPORT Service Style 1 ("Message copy" - section 7.4.2) - aperiodic subscription for "RRC Message" and "UE ID"
|
||||
* REPORT Service Style 4 ("UE Information" - section 7.4.5) - aperiodic subscription for "UE RRC State Change"
|
||||
* CONTROL Service Style 1 ("Radio Bearer Control" - section 7.6.2) - "QoS flow mapping configuration" (e.g creating a new DRB)
|
||||
|
||||
@@ -216,7 +217,7 @@ e2_agent = {
|
||||
```
|
||||
Note: we assume that each UE has only 1 DRB; CU-UP does not store the slices, therefore "coarse filtering" is used
|
||||
|
||||
* start the RC monitor xApp - aperiodic subscription for "UE RRC State Change"
|
||||
* start the RC monitor xApp - aperiodic subscriptions for "UE RRC State Change", "RRC Message" copy (`RRC Reconfiguration`, `Measurement Report`, `Security Mode Complete`, `RRC Setup Complete`), and "UE ID" when `RRC Setup Complete` and/or `F1 UE Context Setup Request` detected
|
||||
```bash
|
||||
cd flexric
|
||||
./build/examples/xApp/c/monitor/xapp_rc_moni
|
||||
|
||||
+1
-1
Submodule openair2/E2AP/flexric updated: beabdd072c...2638b58e20
@@ -150,12 +150,9 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id
|
||||
|
||||
nr_pdcp_data_ind(&ctxt,
|
||||
1, // srb_flag
|
||||
0, // embms_flag
|
||||
msg.srb_id,
|
||||
msg.rrc_container_length,
|
||||
mb,
|
||||
NULL,
|
||||
NULL);
|
||||
mb);
|
||||
/* Free UL RRC Message Transfer */
|
||||
free_ul_rrc_message_transfer(&msg);
|
||||
return 0;
|
||||
|
||||
@@ -39,6 +39,11 @@
|
||||
#include "rrc_extern.h"
|
||||
#include "openair2/RRC/NR/rrc_gNB_NGAP.h"
|
||||
|
||||
#ifdef E2_AGENT
|
||||
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
|
||||
#include "openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_extern.h"
|
||||
#endif
|
||||
|
||||
static void f1ap_write_drb_qos_param(const f1ap_qos_flow_level_qos_parameters_t *drb_qos_in, F1AP_QoSFlowLevelQoSParameters_t *asn1_qosparam)
|
||||
{
|
||||
int type = drb_qos_in->qos_characteristics.qos_type;
|
||||
@@ -587,6 +592,11 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setu
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef E2_AGENT
|
||||
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[0], f1ap_ue_context_setup_req->gNB_CU_ue_id);
|
||||
signal_ue_id(&ue_context_p->ue_context, F1_NETWORK_INTERFACE_TYPE, 0);
|
||||
#endif
|
||||
|
||||
// xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, (void *)pdu);
|
||||
// asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
|
||||
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
|
||||
@@ -638,7 +638,20 @@ unsigned int get_delta_f_RA_long(const unsigned int format)
|
||||
// the column 5, (SFN_nbr is a bitmap where we set bit to '1' in the position of the subframe where the RACH can be sent.
|
||||
// E.g. in row 4, and column 5 we have set value 512 ('1000000000') which means RACH can be sent at subframe 9.
|
||||
// E.g. in row 20 and column 5 we have set value 66 ('0001000010') which means RACH can be sent at subframe 1 or 6
|
||||
static const int64_t table_6_3_3_2_2_prachConfig_Index[256][9] = {
|
||||
|
||||
typedef struct {
|
||||
uint8_t format;
|
||||
uint8_t format2;
|
||||
int x;
|
||||
int y;
|
||||
uint64_t s_map;
|
||||
uint32_t start_symbol;
|
||||
uint32_t N_RA_slot;
|
||||
uint32_t N_t_slot;
|
||||
uint32_t N_dur;
|
||||
} nr_prach_info_3gpp_fr1_t;
|
||||
|
||||
static const nr_prach_info_3gpp_fr1_t table_6_3_3_2_2_prachConfig_Index[256] = {
|
||||
// format, format, x, y, SFN_nbr, star_symb, slots_sfn, occ_slot, duration
|
||||
{0, -1, 16, 1, 2, 0, 1, 1, 0}, // (subframe number) 1
|
||||
{0, -1, 16, 1, 16, 0, 1, 1, 0}, // (subframe number) 4
|
||||
@@ -898,7 +911,7 @@ static const int64_t table_6_3_3_2_2_prachConfig_Index[256][9] = {
|
||||
{0xc2, -1, 1, 0, 682, 0, 2, 2, 6} // (subframe number) 1,3,5,7,9
|
||||
};
|
||||
// Table 6.3.3.2-3: Random access configurations for FR1 and unpaired spectrum
|
||||
static const int64_t table_6_3_3_2_3_prachConfig_Index[256][9] = {
|
||||
static const nr_prach_info_3gpp_fr1_t table_6_3_3_2_3_prachConfig_Index[256] = {
|
||||
// format, format, x, y, SFN_nbr, star_symb, slots_sfn, occ_slot, duration
|
||||
{0, -1, 16, 1, 512, 0, 1, 1, 0}, // (subrame number 9)
|
||||
{0, -1, 8, 1, 512, 0, 1, 1, 0}, // (subrame number 9)
|
||||
@@ -1157,8 +1170,22 @@ static const int64_t table_6_3_3_2_3_prachConfig_Index[256][9] = {
|
||||
{0xa3, 0xb3, 1, 0, 682, 0, 1, 2, 6}, // (subrame number 1,3,5,7,9)
|
||||
{0xa3, 0xb3, 1, 0, 1023, 2, 1, 2, 6} // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint8_t format;
|
||||
uint8_t format2;
|
||||
int x;
|
||||
int y;
|
||||
int y2;
|
||||
uint64_t s_map;
|
||||
uint32_t start_symbol;
|
||||
uint32_t N_RA_slot;
|
||||
uint32_t N_t_slot;
|
||||
uint32_t N_dur;
|
||||
} nr_prach_info_3gpp_fr2_t;
|
||||
|
||||
// Table 6.3.3.2-4: Random access configurations for FR2 and unpaired spectrum
|
||||
static const int64_t table_6_3_3_2_4_prachConfig_Index[256][10] = {
|
||||
static const nr_prach_info_3gpp_fr2_t table_6_3_3_2_4_prachConfig_Index[256] = {
|
||||
// format, format, x, y, y, SFN_nbr, star_symb, slots_sfn, occ_slot,
|
||||
// duration
|
||||
{0xa1, -1, 16, 1, -1, 567489872400, 0, 2, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
@@ -1424,13 +1451,13 @@ int get_format0(uint8_t index, uint8_t unpaired, frequency_range_t frequency_ran
|
||||
int format = 0;
|
||||
if (unpaired) {
|
||||
if (frequency_range==FR1)
|
||||
format = table_6_3_3_2_3_prachConfig_Index[index][0];
|
||||
format = table_6_3_3_2_3_prachConfig_Index[index].format;
|
||||
else
|
||||
format = table_6_3_3_2_4_prachConfig_Index[index][0];
|
||||
format = table_6_3_3_2_4_prachConfig_Index[index].format;
|
||||
}
|
||||
else {
|
||||
if (frequency_range==FR1)
|
||||
format = table_6_3_3_2_2_prachConfig_Index[index][0];
|
||||
format = table_6_3_3_2_2_prachConfig_Index[index].format;
|
||||
else
|
||||
AssertFatal(0==1,"no paired spectrum for FR2\n");
|
||||
}
|
||||
@@ -1551,22 +1578,20 @@ void set_monitoring_periodicity_offset(NR_SearchSpace_t *ss,
|
||||
|
||||
nr_prach_info_t get_nr_prach_occasion_info_from_index(uint8_t index, frequency_range_t freq_range, uint8_t unpaired)
|
||||
{
|
||||
uint8_t format2 = 0xff;
|
||||
nr_prach_info_t info;
|
||||
nr_prach_info_t info = {};
|
||||
if (freq_range == FR2) {
|
||||
info.x = table_6_3_3_2_4_prachConfig_Index[index][2];
|
||||
info.y = table_6_3_3_2_4_prachConfig_Index[index][3];
|
||||
info.y2 = table_6_3_3_2_4_prachConfig_Index[index][4];
|
||||
info.s_map = table_6_3_3_2_4_prachConfig_Index[index][5];
|
||||
info.N_RA_sfn += count_bits64(info.s_map);
|
||||
info.N_RA_slot = table_6_3_3_2_4_prachConfig_Index[index][7];
|
||||
const nr_prach_info_3gpp_fr2_t *tmp = table_6_3_3_2_4_prachConfig_Index + index;
|
||||
info.x = tmp->x;
|
||||
info.y = tmp->y;
|
||||
info.y2 = tmp->y2;
|
||||
info.s_map = tmp->s_map;
|
||||
info.N_RA_sfn = count_bits64(info.s_map);
|
||||
info.N_RA_slot = tmp->N_RA_slot;
|
||||
info.max_association_period = 160 / (info.x * 10);
|
||||
info.start_symbol = table_6_3_3_2_4_prachConfig_Index[index][6];
|
||||
info.N_t_slot = table_6_3_3_2_4_prachConfig_Index[index][8];
|
||||
info.N_dur = table_6_3_3_2_4_prachConfig_Index[index][9];
|
||||
if (table_6_3_3_2_4_prachConfig_Index[index][1] != -1)
|
||||
format2 = (uint8_t)table_6_3_3_2_4_prachConfig_Index[index][1];
|
||||
info.format = ((uint8_t)table_6_3_3_2_4_prachConfig_Index[index][0]) | (format2 << 8);
|
||||
info.start_symbol = tmp->start_symbol;
|
||||
info.N_t_slot = tmp->N_t_slot;
|
||||
info.N_dur = tmp->N_dur;
|
||||
info.format = tmp->format | (tmp->format2 << 8);
|
||||
LOG_D(NR_MAC,
|
||||
"PRACH info from index %d frame_type %u start_symbol %u N_t_slot %u N_dur %u N_RA_sfn = %u\n",
|
||||
index,
|
||||
@@ -1577,77 +1602,42 @@ nr_prach_info_t get_nr_prach_occasion_info_from_index(uint8_t index, frequency_r
|
||||
info.N_RA_sfn);
|
||||
return info;
|
||||
}
|
||||
const nr_prach_info_3gpp_fr1_t *tmp =
|
||||
unpaired ? /* FR1 TDD*/ table_6_3_3_2_3_prachConfig_Index + index : /* FR1 FDD */ table_6_3_3_2_2_prachConfig_Index + index;
|
||||
|
||||
if (unpaired) { // FR1 TDD
|
||||
info.x = table_6_3_3_2_3_prachConfig_Index[index][2];
|
||||
info.y = table_6_3_3_2_3_prachConfig_Index[index][3];
|
||||
info.y2 = -1;
|
||||
info.s_map = table_6_3_3_2_3_prachConfig_Index[index][4];
|
||||
info.N_RA_sfn += count_bits64(info.s_map);
|
||||
info.N_RA_slot = table_6_3_3_2_3_prachConfig_Index[index][6];
|
||||
info.max_association_period = 160 / (info.x * 10);
|
||||
info.start_symbol = table_6_3_3_2_3_prachConfig_Index[index][5];
|
||||
info.N_t_slot = table_6_3_3_2_3_prachConfig_Index[index][7];
|
||||
info.N_dur = table_6_3_3_2_3_prachConfig_Index[index][8];
|
||||
if (table_6_3_3_2_3_prachConfig_Index[index][1] != -1)
|
||||
format2 = (uint8_t)table_6_3_3_2_3_prachConfig_Index[index][1];
|
||||
info.format = ((uint8_t)table_6_3_3_2_3_prachConfig_Index[index][0]) | (format2 << 8);
|
||||
LOG_D(NR_MAC,
|
||||
"PRACH info from index %d (col %lu) frame_type %u start_symbol %u N_t_slot %u N_dur %u N_RA_sfn = %u\n",
|
||||
index,
|
||||
table_6_3_3_2_3_prachConfig_Index[index][6],
|
||||
unpaired,
|
||||
info.start_symbol,
|
||||
info.N_t_slot,
|
||||
info.N_dur,
|
||||
info.N_RA_sfn);
|
||||
return info;
|
||||
}
|
||||
|
||||
// FR1 FDD
|
||||
info.x = table_6_3_3_2_2_prachConfig_Index[index][2];
|
||||
info.y = table_6_3_3_2_2_prachConfig_Index[index][3];
|
||||
info.x = tmp->x;
|
||||
info.y = tmp->y;
|
||||
info.y2 = -1;
|
||||
info.s_map = table_6_3_3_2_2_prachConfig_Index[index][4];
|
||||
info.N_RA_sfn += count_bits64(info.s_map);
|
||||
info.N_RA_slot = table_6_3_3_2_2_prachConfig_Index[index][6];
|
||||
info.s_map = tmp->s_map;
|
||||
info.N_RA_sfn = count_bits64(info.s_map);
|
||||
info.N_RA_slot = tmp->N_RA_slot;
|
||||
info.max_association_period = 160 / (info.x * 10);
|
||||
info.start_symbol = table_6_3_3_2_2_prachConfig_Index[index][5];
|
||||
info.N_t_slot = table_6_3_3_2_2_prachConfig_Index[index][7];
|
||||
info.N_dur = table_6_3_3_2_2_prachConfig_Index[index][8];
|
||||
if (table_6_3_3_2_2_prachConfig_Index[index][1] != -1)
|
||||
format2 = (uint8_t)table_6_3_3_2_2_prachConfig_Index[index][1];
|
||||
info.format = ((uint8_t)table_6_3_3_2_2_prachConfig_Index[index][0]) | (format2 << 8);
|
||||
info.start_symbol = tmp->start_symbol;
|
||||
info.N_t_slot = tmp->N_t_slot;
|
||||
info.N_dur = tmp->N_dur;
|
||||
info.format = tmp->format | (tmp->format2 << 8);
|
||||
LOG_D(NR_MAC,
|
||||
"PRACH info from index %d frame_type %u start_symbol %u N_t_slot %u N_dur %u \n",
|
||||
"PRACH info from index %d (col %u) frame_type %u start_symbol %u N_t_slot %u N_dur %u N_RA_sfn = %u\n",
|
||||
index,
|
||||
tmp->start_symbol,
|
||||
unpaired,
|
||||
info.start_symbol,
|
||||
info.N_t_slot,
|
||||
info.N_dur);
|
||||
info.N_dur,
|
||||
info.N_RA_sfn);
|
||||
return info;
|
||||
}
|
||||
|
||||
uint16_t get_nr_prach_format_from_index(uint8_t index, uint32_t pointa, uint8_t unpaired)
|
||||
{
|
||||
uint8_t format2 = 0xff;
|
||||
uint16_t format;
|
||||
if (get_freq_range_from_arfcn(pointa) == FR2) {
|
||||
if (table_6_3_3_2_4_prachConfig_Index[index][1] != -1)
|
||||
format2 = (uint8_t)table_6_3_3_2_4_prachConfig_Index[index][1];
|
||||
format = ((uint8_t)table_6_3_3_2_4_prachConfig_Index[index][0]) | (format2 << 8);
|
||||
const nr_prach_info_3gpp_fr2_t *tmp = table_6_3_3_2_4_prachConfig_Index + index;
|
||||
return tmp->format | (tmp->format2 << 8);
|
||||
} else {
|
||||
if (unpaired) {
|
||||
if (table_6_3_3_2_3_prachConfig_Index[index][1] != -1)
|
||||
format2 = (uint8_t)table_6_3_3_2_3_prachConfig_Index[index][1];
|
||||
format = ((uint8_t)table_6_3_3_2_3_prachConfig_Index[index][0]) | (format2 << 8);
|
||||
} else {
|
||||
if (table_6_3_3_2_2_prachConfig_Index[index][1] != -1)
|
||||
format2 = (uint8_t)table_6_3_3_2_2_prachConfig_Index[index][1];
|
||||
format = ((uint8_t)table_6_3_3_2_2_prachConfig_Index[index][0]) | (format2 << 8);
|
||||
}
|
||||
const nr_prach_info_3gpp_fr1_t *tmp =
|
||||
unpaired ? /* FR1 TDD*/ table_6_3_3_2_3_prachConfig_Index + index : /* FR1 FDD */ table_6_3_3_2_2_prachConfig_Index + index;
|
||||
return tmp->format | (tmp->format2 << 8);
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
||||
bool get_nr_prach_sched_from_info(nr_prach_info_t info,
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "RRC/NR_UE/rrc_proto.h"
|
||||
#include <pthread.h>
|
||||
#include "openair2/LAYER2/RLC/rlc.h"
|
||||
static NR_UE_MAC_INST_t *nr_ue_mac_inst;
|
||||
|
||||
void send_srb0_rrc(int ue_id, const uint8_t *sdu, sdu_size_t sdu_len, void *data)
|
||||
@@ -141,7 +140,7 @@ NR_UE_MAC_INST_t *nr_l2_init_ue(int nb_inst)
|
||||
ue_init_config_request(mac, get_slots_per_frame_from_scs(get_softmodem_params()->numerology));
|
||||
}
|
||||
|
||||
int rc = rlc_module_init(0);
|
||||
int rc = nr_rlc_module_init(0);
|
||||
AssertFatal(rc == 0, "Could not initialize RLC layer\n");
|
||||
|
||||
for (int j = 0; j < nb_inst; j++) {
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "NR_MAC_COMMON/nr_mac.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include <executables/softmodem-common.h>
|
||||
#include "openair2/LAYER2/RLC/rlc.h"
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
|
||||
int16_t get_prach_tx_power(NR_UE_MAC_INST_t *mac)
|
||||
{
|
||||
@@ -1105,17 +1105,12 @@ static uint8_t *fill_msg3_pdu_from_rlc(NR_UE_MAC_INST_t *mac, uint8_t *pdu, int
|
||||
// regular Msg3/MsgA_PUSCH with PDU coming from higher layers
|
||||
*(NR_MAC_SUBHEADER_FIXED *)pdu = (NR_MAC_SUBHEADER_FIXED){.LCID = UL_SCH_LCID_CCCH_48_BITS};
|
||||
pdu += sizeof(NR_MAC_SUBHEADER_FIXED);
|
||||
tbs_size_t len = mac_rlc_data_req(mac->ue_id,
|
||||
mac->ue_id,
|
||||
0,
|
||||
0,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
0, // SRB0 for messages sent in MSG3
|
||||
TBS_max - sizeof(NR_MAC_SUBHEADER_FIXED), /* size of mac_ce above */
|
||||
(char *)pdu,
|
||||
0,
|
||||
0);
|
||||
tbs_size_t len = nr_mac_rlc_data_req(mac->ue_id,
|
||||
mac->ue_id,
|
||||
false,
|
||||
0, // SRB0 for messages sent in MSG3
|
||||
TBS_max - sizeof(NR_MAC_SUBHEADER_FIXED), /* size of mac_ce above */
|
||||
(char *)pdu);
|
||||
AssertFatal(len > 0, "no data for Msg3/MsgA_PUSCH\n");
|
||||
// UE Contention Resolution Identity
|
||||
// Store the first 48 bits belonging to the uplink CCCH SDU within Msg3 to determine whether or not the
|
||||
|
||||
@@ -436,8 +436,7 @@ bool search_space_monitoring_ocasion_other_si(NR_UE_MAC_INST_t *mac,
|
||||
const int abs_slot,
|
||||
const int frame,
|
||||
const int slot,
|
||||
const int slots_per_frame,
|
||||
const int bwp_id)
|
||||
const int slots_per_frame)
|
||||
{
|
||||
const int duration = ss->duration ? *ss->duration : 1;
|
||||
int period, offset;
|
||||
@@ -478,7 +477,6 @@ bool monitor_dci_for_other_SI(NR_UE_MAC_INST_t *mac,
|
||||
{
|
||||
// according to 5.2.2.3.2 in 331
|
||||
const int abs_slot = frame * slots_per_frame + slot;
|
||||
const int bwp_id = mac->current_DL_BWP->bwp_id;
|
||||
|
||||
for (int i = 0; i < mac->si_SchedInfo.si_SchedInfo_list.count; i++) {
|
||||
si_schedinfo_config_t *config = mac->si_SchedInfo.si_SchedInfo_list.array[i];
|
||||
@@ -493,7 +491,7 @@ bool monitor_dci_for_other_SI(NR_UE_MAC_INST_t *mac,
|
||||
mac->si_SchedInfo.si_window_start = abs_slot; // in terms of absolute slot number
|
||||
}
|
||||
check_valid = is_window_valid(mac, window_slots, abs_slot);
|
||||
if (check_valid && search_space_monitoring_ocasion_other_si(mac, ss, abs_slot, frame, slot, slots_per_frame, bwp_id))
|
||||
if (check_valid && search_space_monitoring_ocasion_other_si(mac, ss, abs_slot, frame, slot, slots_per_frame))
|
||||
return true;
|
||||
break;
|
||||
case NR_SI_INFO_v1700 :
|
||||
@@ -504,7 +502,7 @@ bool monitor_dci_for_other_SI(NR_UE_MAC_INST_t *mac,
|
||||
window_slots = 10; // TODO window length hardcoded to 10 at gNB for NTN
|
||||
check_valid = is_window_valid(mac, window_slots, abs_slot);
|
||||
if (check_valid && (config->si_WindowPosition - 1) == slot)
|
||||
return search_space_monitoring_ocasion_other_si(mac, ss, abs_slot, frame, slot, slots_per_frame, bwp_id);
|
||||
return search_space_monitoring_ocasion_other_si(mac, ss, abs_slot, frame, slot, slots_per_frame);
|
||||
break;
|
||||
default :
|
||||
AssertFatal(false, "Invalid SI-SchedulingInfo case\n");
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include "oai_asn1.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "openair2/LAYER2/RLC/rlc.h"
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
|
||||
// #define DEBUG_MIB
|
||||
// #define ENABLE_MAC_PAYLOAD_DEBUG 1
|
||||
@@ -3613,17 +3613,7 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i
|
||||
|
||||
if (mac_len > 0) {
|
||||
LOG_DDUMP(NR_MAC, (void *)pduP, mac_subheader_len + mac_len, LOG_DUMP_CHAR, "DL_SCH_LCID_CCCH (e.g. RRCSetup) payload: ");
|
||||
mac_rlc_data_ind(mac->ue_id,
|
||||
mac->ue_id,
|
||||
gNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
0,
|
||||
(char *)(pduP + mac_subheader_len),
|
||||
mac_len,
|
||||
1,
|
||||
NULL);
|
||||
nr_mac_rlc_data_ind(mac->ue_id, mac->ue_id, false, rx_lcid, (char *)(pduP + mac_subheader_len), mac_len);
|
||||
}
|
||||
break;
|
||||
case DL_SCH_LCID_TCI_STATE_ACT_UE_SPEC_PDSCH:
|
||||
@@ -3738,18 +3728,7 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i
|
||||
if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len))
|
||||
return;
|
||||
LOG_D(NR_MAC, "%4d.%2d : DLSCH -> LCID %d %d bytes\n", frameP, slot, rx_lcid, mac_len);
|
||||
|
||||
mac_rlc_data_ind(mac->ue_id,
|
||||
mac->ue_id,
|
||||
gNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcid,
|
||||
(char *)(pduP + mac_subheader_len),
|
||||
mac_len,
|
||||
1,
|
||||
NULL);
|
||||
nr_mac_rlc_data_ind(mac->ue_id, mac->ue_id, false, rx_lcid, (char *)(pduP + mac_subheader_len), mac_len);
|
||||
break;
|
||||
default:
|
||||
LOG_W(MAC, "unknown lcid %02x\n", rx_lcid);
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "utils.h"
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "RRC/NR_UE/L2_interface_ue.h"
|
||||
|
||||
//#define SRS_DEBUG
|
||||
@@ -1268,8 +1268,7 @@ static void nr_update_rlc_buffers_status(NR_UE_MAC_INST_t *mac, frame_t frameP,
|
||||
nr_lcordered_info_t *lc_info = mac->lc_ordered_list.array[i];
|
||||
int lcid = lc_info->lcid;
|
||||
NR_LC_SCHEDULING_INFO *lc_sched_info = get_scheduling_info_from_lcid(mac, lcid);
|
||||
mac_rlc_status_resp_t rlc_status =
|
||||
mac_rlc_status_ind(mac->ue_id, mac->ue_id, gNB_index, frameP, slotP, ENB_FLAG_NO, MBMS_FLAG_NO, lcid, 0, 0);
|
||||
mac_rlc_status_resp_t rlc_status = nr_mac_rlc_status_ind(mac->ue_id, frameP, lcid);
|
||||
|
||||
if (rlc_status.bytes_in_buffer > 0) {
|
||||
LOG_D(NR_MAC,
|
||||
@@ -2589,17 +2588,12 @@ static bool fill_mac_sdu(NR_UE_MAC_INST_t *mac,
|
||||
&target);
|
||||
header_sz = bytes_requested < 256 ? sizeof(NR_MAC_SUBHEADER_SHORT) : sizeof(NR_MAC_SUBHEADER_LONG);
|
||||
|
||||
uint16_t sdu_length = mac_rlc_data_req(mac->ue_id,
|
||||
mac->ue_id,
|
||||
gNB_index,
|
||||
frame,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
bytes_requested,
|
||||
(char *)mac_ce_p->cur_ptr + header_sz,
|
||||
0,
|
||||
0);
|
||||
uint16_t sdu_length = nr_mac_rlc_data_req(mac->ue_id,
|
||||
mac->ue_id,
|
||||
false,
|
||||
lcid,
|
||||
bytes_requested,
|
||||
(char *)mac_ce_p->cur_ptr + header_sz);
|
||||
|
||||
AssertFatal(bytes_requested >= sdu_length,
|
||||
"LCID = 0x%02x RLC has segmented %d bytes but MAC has max %li remaining bytes\n",
|
||||
|
||||
@@ -35,17 +35,12 @@ void nr_mac_rrc_ra_ind(const module_id_t mod_id, bool success)
|
||||
void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti, bool prepare_payload)
|
||||
{
|
||||
}
|
||||
tbs_size_t mac_rlc_data_req(const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id)
|
||||
tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP,
|
||||
const uint16_t ue_id,
|
||||
const bool gnb_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -767,6 +767,52 @@ static void initialize_beam_information(NR_beam_info_t *beam_info, int mu, int s
|
||||
}
|
||||
}
|
||||
|
||||
static void config_sched_ctrlCommon(gNB_MAC_INST *nr_mac)
|
||||
{
|
||||
const NR_MIB_t *mib = nr_mac->common_channels[0].mib->message.choice.mib;
|
||||
NR_ServingCellConfigCommon_t *scc = nr_mac->common_channels[0].ServingCellConfigCommon;
|
||||
|
||||
NR_UE_sched_ctrl_t *sched_ctrlCommon = calloc_or_fail(1, sizeof(*sched_ctrlCommon));
|
||||
nr_mac->sched_ctrlCommon = sched_ctrlCommon;
|
||||
sched_ctrlCommon->search_space = calloc_or_fail(1, sizeof(*sched_ctrlCommon->search_space));
|
||||
sched_ctrlCommon->coreset = calloc_or_fail(1, sizeof(*sched_ctrlCommon->coreset));
|
||||
|
||||
NR_SubcarrierSpacing_t scs = *scc->ssbSubcarrierSpacing;
|
||||
const long band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
uint16_t ssb_start_symbol = get_ssb_start_symbol(band, scs, 0);
|
||||
|
||||
int8_t ssb_period = *scc->ssb_periodicityServingCell;
|
||||
uint8_t ssb_frame_periodicity = 1;
|
||||
if (ssb_period > 1)
|
||||
ssb_frame_periodicity = 1 << (ssb_period - 1);
|
||||
|
||||
const int8_t numb_slots_frame = nr_mac->frame_structure.numb_slots_frame;
|
||||
frequency_range_t frequency_range = scc->ssb_PositionsInBurst->present == 3 ? FR2 : FR1;
|
||||
const int prb_offset = frequency_range == FR1 ? nr_mac->ssb_OffsetPointA >> scs : nr_mac->ssb_OffsetPointA >> (scs - 2);
|
||||
|
||||
NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config = {0};
|
||||
get_type0_PDCCH_CSS_config_parameters(&type0_PDCCH_CSS_config,
|
||||
0,
|
||||
mib,
|
||||
numb_slots_frame,
|
||||
nr_mac->ssb_SubcarrierOffset,
|
||||
ssb_start_symbol,
|
||||
scs,
|
||||
frequency_range,
|
||||
band,
|
||||
0,
|
||||
ssb_frame_periodicity,
|
||||
prb_offset);
|
||||
|
||||
fill_searchSpaceZero(sched_ctrlCommon->search_space, numb_slots_frame, &type0_PDCCH_CSS_config);
|
||||
|
||||
fill_coresetZero(sched_ctrlCommon->coreset, &type0_PDCCH_CSS_config);
|
||||
nr_mac->cset0_bwp_start = type0_PDCCH_CSS_config.cset_start_rb;
|
||||
nr_mac->cset0_bwp_size = type0_PDCCH_CSS_config.num_rbs;
|
||||
sched_ctrlCommon->sched_pdcch =
|
||||
set_pdcch_structure(NULL, sched_ctrlCommon->search_space, sched_ctrlCommon->coreset, scc, NULL, &type0_PDCCH_CSS_config);
|
||||
}
|
||||
|
||||
void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, const nr_mac_config_t *config)
|
||||
{
|
||||
DevAssert(nrmac != NULL);
|
||||
@@ -820,6 +866,9 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, c
|
||||
|
||||
nr_fill_sched_osi(nrmac, scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon);
|
||||
NR_SCHED_UNLOCK(&nrmac->sched_lock);
|
||||
|
||||
if (IS_SA_MODE(get_softmodem_params()))
|
||||
config_sched_ctrlCommon(nrmac);
|
||||
}
|
||||
|
||||
void nr_fill_sched_osi(gNB_MAC_INST *nrmac, const struct NR_SetupRelease_PDCCH_ConfigCommon *pdcch_ConfigCommon)
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
/* rlc */
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "openair2/LAYER2/RLC/rlc.h"
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
|
||||
@@ -1880,12 +1879,12 @@ static void nr_generate_Msg4_MsgB(module_id_t module_idP,
|
||||
logical_chan_id_t lcid = DL_SCH_LCID_CCCH;
|
||||
if (current_harq_pid < 0) {
|
||||
// Check for data on SRB0 (RRCSetup)
|
||||
mac_rlc_status_resp_t srb_status = mac_rlc_status_ind(module_idP, ra->rnti, module_idP, frameP, slotP, ENB_FLAG_YES, MBMS_FLAG_NO, lcid, 0, 0);
|
||||
mac_rlc_status_resp_t srb_status = nr_mac_rlc_status_ind(ra->rnti, frameP, lcid);
|
||||
|
||||
if (srb_status.bytes_in_buffer == 0) {
|
||||
lcid = DL_SCH_LCID_DCCH;
|
||||
// Check for data on SRB1 (RRCReestablishment, RRCReconfiguration)
|
||||
srb_status = mac_rlc_status_ind(module_idP, ra->rnti, module_idP, frameP, slotP, ENB_FLAG_YES, MBMS_FLAG_NO, lcid, 0, 0);
|
||||
srb_status = nr_mac_rlc_status_ind(ra->rnti, frameP, lcid);
|
||||
}
|
||||
|
||||
// Need to wait until data for Msg4 is ready
|
||||
@@ -2051,17 +2050,7 @@ static void nr_generate_Msg4_MsgB(module_id_t module_idP,
|
||||
uint8_t buffer[CCCH_SDU_SIZE];
|
||||
uint8_t mac_subheader_len = sizeof(NR_MAC_SUBHEADER_SHORT);
|
||||
// Get RLC data on the SRB (RRCSetup, RRCReestablishment)
|
||||
mac_sdu_length = mac_rlc_data_req(module_idP,
|
||||
ra->rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
CCCH_SDU_SIZE,
|
||||
(char *)buffer,
|
||||
0,
|
||||
0);
|
||||
mac_sdu_length = nr_mac_rlc_data_req(module_idP, ra->rnti, true, lcid, CCCH_SDU_SIZE, (char *)buffer);
|
||||
|
||||
if (mac_sdu_length < 256) {
|
||||
((NR_MAC_SUBHEADER_SHORT *)&buf[mac_pdu_length])->R = 0;
|
||||
|
||||
@@ -354,29 +354,9 @@ static uint32_t schedule_control_sib1(module_id_t module_id,
|
||||
uint16_t num_total_bytes)
|
||||
{
|
||||
gNB_MAC_INST *gNB_mac = RC.nrmac[module_id];
|
||||
AssertFatal(gNB_mac->sched_ctrlCommon, "sched_ctrlCommon is NULL\n");
|
||||
NR_COMMON_channels_t *cc = &gNB_mac->common_channels[CC_id];
|
||||
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||
uint16_t *vrb_map = cc->vrb_map[beam];
|
||||
|
||||
if (gNB_mac->sched_ctrlCommon == NULL){
|
||||
LOG_D(NR_MAC,"schedule_control_common: Filling nr_mac->sched_ctrlCommon\n");
|
||||
gNB_mac->sched_ctrlCommon = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon));
|
||||
gNB_mac->sched_ctrlCommon->search_space = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->search_space));
|
||||
gNB_mac->sched_ctrlCommon->coreset = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->coreset));
|
||||
fill_searchSpaceZero(gNB_mac->sched_ctrlCommon->search_space,
|
||||
gNB_mac->frame_structure.numb_slots_frame,
|
||||
type0_PDCCH_CSS_config);
|
||||
fill_coresetZero(gNB_mac->sched_ctrlCommon->coreset, type0_PDCCH_CSS_config);
|
||||
gNB_mac->cset0_bwp_start = type0_PDCCH_CSS_config->cset_start_rb;
|
||||
gNB_mac->cset0_bwp_size = type0_PDCCH_CSS_config->num_rbs;
|
||||
gNB_mac->sched_ctrlCommon->sched_pdcch = set_pdcch_structure(NULL,
|
||||
gNB_mac->sched_ctrlCommon->search_space,
|
||||
gNB_mac->sched_ctrlCommon->coreset,
|
||||
scc,
|
||||
NULL,
|
||||
type0_PDCCH_CSS_config);
|
||||
}
|
||||
|
||||
NR_sched_pdsch_t *pdsch = &gNB_mac->sched_ctrlCommon->sched_pdsch;
|
||||
pdsch->time_domain_allocation = time_domain_allocation;
|
||||
pdsch->dmrs_parms = *dmrs_parms;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "NR_MAC_COMMON/nr_mac.h"
|
||||
#include "NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
|
||||
/*TAG*/
|
||||
#include "NR_TAG-Id.h"
|
||||
@@ -338,16 +338,7 @@ static void nr_store_dlsch_buffer(module_id_t module_id, frame_t frame, slot_t s
|
||||
if (lcid == DL_SCH_LCID_DTCH && nr_timer_is_active(&sched_ctrl->transm_interrupt))
|
||||
continue;
|
||||
start_meas(&RC.nrmac[module_id]->rlc_status_ind);
|
||||
sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
0,
|
||||
0);
|
||||
sched_ctrl->rlc_status[lcid] = nr_mac_rlc_status_ind(rnti, frame, lcid);
|
||||
stop_meas(&RC.nrmac[module_id]->rlc_status_ind);
|
||||
|
||||
if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0)
|
||||
@@ -1300,17 +1291,12 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
* such that TBS is full */
|
||||
const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer,
|
||||
bufEnd-buf-sizeof(NR_MAC_SUBHEADER_LONG));
|
||||
tbs_size_t len = mac_rlc_data_req(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
ndata,
|
||||
(char *)buf+sizeof(NR_MAC_SUBHEADER_LONG),
|
||||
0,
|
||||
0);
|
||||
tbs_size_t len = nr_mac_rlc_data_req(module_id,
|
||||
rnti,
|
||||
true,
|
||||
lcid,
|
||||
ndata,
|
||||
(char *)buf+sizeof(NR_MAC_SUBHEADER_LONG));
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %ld)\n",
|
||||
frame,
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "executables/nr-softmodem.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
|
||||
@@ -129,16 +129,7 @@ void nr_preprocessor_phytest(module_id_t module_id, frame_t frame, slot_t slot)
|
||||
const uint16_t rnti = UE->rnti;
|
||||
/* update sched_ctrl->num_total_bytes so that postprocessor schedules data,
|
||||
* if available */
|
||||
sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
0,
|
||||
0);
|
||||
sched_ctrl->rlc_status[lcid] = nr_mac_rlc_status_ind(rnti, frame, lcid);
|
||||
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
|
||||
|
||||
int CCEIndex = get_cce_index(mac,
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "utils.h"
|
||||
#include <openair2/UTIL/OPT/opt.h>
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
|
||||
//#define SRS_IND_DEBUG
|
||||
|
||||
@@ -354,17 +353,7 @@ static int nr_process_mac_pdu(instance_t module_idP,
|
||||
}
|
||||
|
||||
if (prepare_initial_ul_rrc_message(RC.nrmac[module_idP], UE)) {
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE->rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
0,
|
||||
(char *)(pduP + mac_subheader_len),
|
||||
mac_len,
|
||||
1,
|
||||
NULL);
|
||||
nr_mac_rlc_data_ind(module_idP, UE->rnti, true, 0, (char *)(pduP + mac_subheader_len), mac_len);
|
||||
} else {
|
||||
LOG_E(NR_MAC, "prepare_initial_ul_rrc_message() returned false, cannot forward CCCH message\n");
|
||||
}
|
||||
@@ -379,17 +368,7 @@ static int nr_process_mac_pdu(instance_t module_idP,
|
||||
slot,
|
||||
lcid);
|
||||
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE->rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
(char *)(pduP + mac_subheader_len),
|
||||
mac_len,
|
||||
1,
|
||||
NULL);
|
||||
nr_mac_rlc_data_ind(module_idP, UE->rnti, true, lcid, (char *)(pduP + mac_subheader_len), mac_len);
|
||||
|
||||
UE->mac_stats.ul.total_sdu_bytes += mac_len;
|
||||
UE->mac_stats.ul.lc_bytes[lcid] += mac_len;
|
||||
@@ -407,17 +386,7 @@ static int nr_process_mac_pdu(instance_t module_idP,
|
||||
mac_len);
|
||||
UE->mac_stats.ul.lc_bytes[lcid] += mac_len;
|
||||
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE->rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
(char *)(pduP + mac_subheader_len),
|
||||
mac_len,
|
||||
1,
|
||||
NULL);
|
||||
nr_mac_rlc_data_ind(module_idP, UE->rnti, true, lcid, (char *)(pduP + mac_subheader_len), mac_len);
|
||||
|
||||
sdus += 1;
|
||||
/* Updated estimated buffer when receiving data */
|
||||
|
||||
@@ -90,7 +90,7 @@ bool DURecvCb(protocol_ctxt_t *ctxt_pP,
|
||||
// The buffer comes from the stack in gtp-u thread, we have a make a separate buffer to enqueue in a inter-thread message queue
|
||||
uint8_t *sdu = malloc16(sdu_buffer_sizeP);
|
||||
memcpy(sdu, sdu_buffer_pP, sdu_buffer_sizeP);
|
||||
du_rlc_data_req(ctxt_pP, srb_flagP, false, rb_idP, muiP, confirmP, sdu_buffer_sizeP, sdu);
|
||||
du_rlc_data_req(ctxt_pP, srb_flagP, rb_idP, muiP, confirmP, sdu_buffer_sizeP, sdu);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
#include "nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "openair2/F1AP/f1ap_ids.h"
|
||||
#include "rlc.h"
|
||||
#include "seq_arr.h"
|
||||
#include "system.h"
|
||||
#include "time_meas.h"
|
||||
@@ -303,7 +302,7 @@ void mac_top_init_gNB(ngran_node_t node_type,
|
||||
mac_rrc_init(RC.nrmac[i], node_type);
|
||||
}//END for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
|
||||
|
||||
AssertFatal(rlc_module_init(1) == 0,"Could not initialize RLC layer\n");
|
||||
AssertFatal(nr_rlc_module_init(1) == 0,"Could not initialize RLC layer\n");
|
||||
|
||||
// These should be out of here later
|
||||
if (get_softmodem_params()->usim_test == 0 ) nr_pdcp_layer_init();
|
||||
|
||||
@@ -71,38 +71,6 @@ typedef enum rlc_confirm_e {
|
||||
RLC_SDU_CONFIRM_YES = 1,
|
||||
} rlc_confirm_t;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PRIVATE INTERNALS OF RLC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define RLC_MAX_MBMS_LC (LTE_maxSessionPerPMCH * LTE_maxServiceCount)
|
||||
#define RLC_MAX_LC ((max_val_LTE_DRB_Identity+1)* MAX_MOBILES_PER_ENB)
|
||||
|
||||
extern void (*rlc_rrc_data_ind)(
|
||||
const protocol_ctxt_t *const ctxtP,
|
||||
const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
const uint8_t *const sduP) __attribute__ ((aligned(32)));
|
||||
|
||||
extern void (*rlc_rrc_data_conf)(
|
||||
const protocol_ctxt_t *const ctxtP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const rlc_tx_status_t statusP) __attribute__ ((aligned(32)));
|
||||
|
||||
typedef void (rrc_data_ind_cb_t)(
|
||||
const protocol_ctxt_t *const ctxtP,
|
||||
const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
const uint8_t *const sduP);
|
||||
|
||||
typedef void (rrc_data_conf_cb_t)(
|
||||
const protocol_ctxt_t *const ctxtP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const rlc_tx_status_t statusP);
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PUBLIC INTERFACE WITH RRC
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -416,25 +384,4 @@ rlc_op_status_t rlc_stat_req (
|
||||
int rlc_module_init(int enb_flag);
|
||||
/** @} */
|
||||
|
||||
#define RLC_FG_COLOR_BLACK "\e[0;30m"
|
||||
#define RLC_FG_COLOR_RED "\e[0;31m"
|
||||
#define RLC_FG_COLOR_GREEN "\e[0;32m"
|
||||
#define RLC_FG_COLOR_ORANGE "\e[0;33m"
|
||||
#define RLC_FG_COLOR_BLUE "\e[0;34m"
|
||||
#define RLC_FG_COLOR_MAGENTA "\e[0;35m"
|
||||
#define RLC_FG_COLOR_CYAN "\e[0;36m"
|
||||
#define RLC_FG_COLOR_GRAY_BLACK "\e[0;37m"
|
||||
#define RLC_FG_COLOR_DEFAULT "\e[0;39m"
|
||||
#define RLC_FG_BRIGHT_COLOR_DARK_GRAY "\e[1;30m"
|
||||
#define RLC_FG_BRIGHT_COLOR_RED "\e[1;31m"
|
||||
#define RLC_FG_BRIGHT_COLOR_GREEN "\e[1;32m"
|
||||
#define RLC_FG_BRIGHT_COLOR_YELLOW "\e[1;33m"
|
||||
#define RLC_FG_BRIGHT_COLOR_BLUE "\e[1;34m"
|
||||
#define RLC_FG_BRIGHT_COLOR_MAGENTA "\e[1;35m"
|
||||
#define RLC_FG_BRIGHT_COLOR_CYAN "\e[1;36m"
|
||||
#define RLC_FG_BRIGHT_COLOR_WHITE "\e[1;37m"
|
||||
#define RLC_FG_BRIGHT_COLOR_DEFAULT "\e[0;39m"
|
||||
#define RLC_REVERSE_VIDEO "\e[7m"
|
||||
#define RLC_NORMAL_VIDEO "\e[27m"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -148,7 +148,7 @@ void e1_bearer_context_setup(const e1ap_bearer_setup_req_t *req)
|
||||
/* mirror the CU-CP UE ID for CU-UP */
|
||||
uint32_t cu_up_ue_id = req->gNB_cu_cp_ue_id;
|
||||
f1_ue_data_t ued = {.secondary_ue = req->gNB_cu_cp_ue_id};
|
||||
if (need_ue_id_mgmt) {
|
||||
if (need_ue_id_mgmt && !cu_exists_f1_ue_data(cu_up_ue_id)) {
|
||||
bool success = cu_add_f1_ue_data(cu_up_ue_id, &ued);
|
||||
DevAssert(success);
|
||||
LOG_I(E1AP, "adding UE with CU-CP UE ID %d and CU-UP UE ID %d\n", req->gNB_cu_cp_ue_id, cu_up_ue_id);
|
||||
@@ -163,8 +163,10 @@ void e1_bearer_context_setup(const e1ap_bearer_setup_req_t *req)
|
||||
};
|
||||
resp.numPDUSessions = req->numPDUSessions;
|
||||
for (int i = 0; i < resp.numPDUSessions; ++i) {
|
||||
pdu_session_setup_t *resp_pdu = resp.pduSession + i;
|
||||
const pdu_session_to_setup_t *req_pdu = req->pduSession + i;
|
||||
LOG_I(E1AP, "UE %d: add PDU session ID %ld (%d bearers)\n", cu_up_ue_id, req_pdu->sessionId, req_pdu->numDRB2Setup);
|
||||
|
||||
pdu_session_setup_t *resp_pdu = resp.pduSession + i;
|
||||
resp_pdu->id = req_pdu->sessionId;
|
||||
|
||||
AssertFatal(req_pdu->numDRB2Setup == 1, "can only handle one DRB per PDU session\n");
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
|
||||
#include "pdcp.h"
|
||||
#include "pdcp_messages_types.h"
|
||||
#include "rlc.h"
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "utils.h"
|
||||
|
||||
#define TODO do { \
|
||||
@@ -127,7 +127,6 @@ nr_pdcp_entity_t *nr_pdcp_get_rb(nr_pdcp_ue_t *ue, int rb_id, bool srb_flag)
|
||||
typedef struct {
|
||||
protocol_ctxt_t ctxt_pP;
|
||||
srb_flag_t srb_flagP;
|
||||
MBMS_flag_t MBMS_flagP;
|
||||
rb_id_t rb_idP;
|
||||
mui_t muiP;
|
||||
confirm_t confirmP;
|
||||
@@ -159,16 +158,12 @@ static void *rlc_data_req_thread(void *_)
|
||||
i = q.start;
|
||||
if (pthread_mutex_unlock(&q.m) != 0) abort();
|
||||
|
||||
rlc_data_req(&q.q[i].ctxt_pP,
|
||||
q.q[i].srb_flagP,
|
||||
q.q[i].MBMS_flagP,
|
||||
q.q[i].rb_idP,
|
||||
q.q[i].muiP,
|
||||
q.q[i].confirmP,
|
||||
q.q[i].sdu_sizeP,
|
||||
q.q[i].sdu_pP,
|
||||
NULL,
|
||||
NULL);
|
||||
nr_rlc_data_req(&q.q[i].ctxt_pP,
|
||||
q.q[i].srb_flagP,
|
||||
q.q[i].rb_idP,
|
||||
q.q[i].muiP,
|
||||
q.q[i].sdu_sizeP,
|
||||
q.q[i].sdu_pP);
|
||||
|
||||
if (pthread_mutex_lock(&q.m) != 0) abort();
|
||||
|
||||
@@ -195,7 +190,6 @@ static void init_nr_rlc_data_req_queue(void)
|
||||
|
||||
static void enqueue_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
confirm_t confirmP,
|
||||
@@ -219,7 +213,6 @@ static void enqueue_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
q.q[i].ctxt_pP = *ctxt_pP;
|
||||
q.q[i].srb_flagP = srb_flagP;
|
||||
q.q[i].MBMS_flagP = MBMS_flagP;
|
||||
q.q[i].rb_idP = rb_idP;
|
||||
q.q[i].muiP = muiP;
|
||||
q.q[i].confirmP = confirmP;
|
||||
@@ -232,7 +225,6 @@ static void enqueue_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
confirm_t confirmP,
|
||||
@@ -241,7 +233,6 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
{
|
||||
enqueue_rlc_data_req(ctxt_pP,
|
||||
srb_flagP,
|
||||
MBMS_flagP,
|
||||
rb_idP, muiP,
|
||||
confirmP,
|
||||
sdu_sizeP,
|
||||
@@ -259,7 +250,6 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
typedef struct {
|
||||
protocol_ctxt_t ctxt_pP;
|
||||
srb_flag_t srb_flagP;
|
||||
MBMS_flag_t MBMS_flagP;
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t sdu_buffer_size;
|
||||
uint8_t *sdu_buffer;
|
||||
@@ -279,7 +269,6 @@ static pdcp_data_ind_queue pq;
|
||||
|
||||
static void do_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
uint8_t *const sdu_buffer)
|
||||
@@ -329,7 +318,6 @@ static void *pdcp_data_ind_thread(void *_)
|
||||
|
||||
do_pdcp_data_ind(&pq.q[i].ctxt_pP,
|
||||
pq.q[i].srb_flagP,
|
||||
pq.q[i].MBMS_flagP,
|
||||
pq.q[i].rb_id,
|
||||
pq.q[i].sdu_buffer_size,
|
||||
pq.q[i].sdu_buffer);
|
||||
@@ -359,7 +347,6 @@ static void init_nr_pdcp_data_ind_queue(void)
|
||||
|
||||
static void enqueue_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
uint8_t *const sdu_buffer)
|
||||
@@ -381,7 +368,6 @@ static void enqueue_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
pq.q[i].ctxt_pP = *ctxt_pP;
|
||||
pq.q[i].srb_flagP = srb_flagP;
|
||||
pq.q[i].MBMS_flagP = MBMS_flagP;
|
||||
pq.q[i].rb_id = rb_id;
|
||||
pq.q[i].sdu_buffer_size = sdu_buffer_size;
|
||||
pq.q[i].sdu_buffer = sdu_buffer;
|
||||
@@ -392,19 +378,11 @@ static void enqueue_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
bool nr_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
uint8_t *const sdu_buffer,
|
||||
const uint32_t *const srcID,
|
||||
const uint32_t *const dstID)
|
||||
uint8_t *const sdu_buffer)
|
||||
{
|
||||
enqueue_pdcp_data_ind(ctxt_pP,
|
||||
srb_flagP,
|
||||
MBMS_flagP,
|
||||
rb_id,
|
||||
sdu_buffer_size,
|
||||
sdu_buffer);
|
||||
enqueue_pdcp_data_ind(ctxt_pP, srb_flagP, rb_id, sdu_buffer_size, sdu_buffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -583,12 +561,6 @@ static void set_node_type() {
|
||||
node_type = get_node_type();
|
||||
}
|
||||
|
||||
/* hack: dummy function needed due to LTE dependencies */
|
||||
void pdcp_layer_init(void)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
void nr_pdcp_layer_init(void)
|
||||
{
|
||||
/* hack: be sure to initialize only once */
|
||||
@@ -717,7 +689,7 @@ static void deliver_pdu_drb_ue(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
|
||||
uint8_t *memblock = malloc16(size);
|
||||
memcpy(memblock, buf, size);
|
||||
LOG_D(PDCP, "%s(): (drb %d) calling rlc_data_req size %d UE %ld/%04lx\n", __func__, rb_id, size, ctxt.rntiMaybeUEid, ctxt.rntiMaybeUEid);
|
||||
enqueue_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock);
|
||||
enqueue_rlc_data_req(&ctxt, 0, rb_id, sdu_id, 0, size, memblock);
|
||||
}
|
||||
|
||||
static void deliver_pdu_drb_gnb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
|
||||
@@ -735,7 +707,7 @@ static void deliver_pdu_drb_gnb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id
|
||||
uint8_t *memblock = malloc16(size);
|
||||
memcpy(memblock, buf, size);
|
||||
LOG_D(PDCP, "%s(): (drb %d) calling rlc_data_req size %d\n", __func__, rb_id, size);
|
||||
enqueue_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock);
|
||||
enqueue_rlc_data_req(&ctxt, 0, rb_id, sdu_id, 0, size, memblock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,7 +766,7 @@ void deliver_pdu_srb_rlc(void *deliver_pdu_data, ue_id_t ue_id, int srb_id,
|
||||
protocol_ctxt_t ctxt = { .enb_flag = 1, .rntiMaybeUEid = ue_id };
|
||||
uint8_t *memblock = malloc16(size);
|
||||
memcpy(memblock, buf, size);
|
||||
enqueue_rlc_data_req(&ctxt, 1, MBMS_FLAG_NO, srb_id, sdu_id, 0, size, memblock);
|
||||
enqueue_rlc_data_req(&ctxt, 1, srb_id, sdu_id, 0, size, memblock);
|
||||
}
|
||||
|
||||
void add_srb(int is_gnb,
|
||||
@@ -966,32 +938,11 @@ void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
|
||||
LOG_W(PDCP, "nr_pdcp_add_drbs() with void list\n");
|
||||
}
|
||||
|
||||
/* Dummy function due to dependency from LTE libraries */
|
||||
bool rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
LTE_SRB_ToAddModList_t *const srb2add_list,
|
||||
LTE_DRB_ToAddModList_t *const drb2add_list,
|
||||
LTE_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc,
|
||||
LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9,
|
||||
rb_id_t *const defaultDRB)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t get_pdcp_optmask(void)
|
||||
{
|
||||
return pdcp_optmask;
|
||||
}
|
||||
|
||||
/* hack: dummy function needed due to LTE dependencies */
|
||||
bool pdcp_remove_UE(const protocol_ctxt_t *const ctxt_pP)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
void nr_pdcp_remove_UE(ue_id_t ue_id)
|
||||
{
|
||||
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
|
||||
@@ -999,19 +950,6 @@ void nr_pdcp_remove_UE(ue_id_t ue_id)
|
||||
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
|
||||
}
|
||||
|
||||
/* hack: dummy function needed due to LTE dependencies */
|
||||
void pdcp_config_set_security(const protocol_ctxt_t *const ctxt_pP,
|
||||
pdcp_t *const pdcp_pP,
|
||||
const rb_id_t rb_id,
|
||||
const uint16_t lc_idP,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc_pP,
|
||||
uint8_t *const kRRCint_pP,
|
||||
uint8_t *const kUPenc_pP)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
void nr_pdcp_config_set_security(ue_id_t ue_id,
|
||||
rb_id_t rb_id,
|
||||
bool is_srb,
|
||||
@@ -1315,7 +1253,7 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
|
||||
exit(1);
|
||||
}
|
||||
memcpy(memblock, sdu_buffer, sdu_buffer_size);
|
||||
int ret = nr_pdcp_data_ind(ctxt_pP, srb_flagP, false, rb_id, sdu_buffer_size, memblock, NULL, NULL);
|
||||
int ret = nr_pdcp_data_ind(ctxt_pP, srb_flagP, rb_id, sdu_buffer_size, memblock);
|
||||
if (!ret) {
|
||||
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
/* what to do in case of failure? for the moment: nothing */
|
||||
@@ -1323,28 +1261,6 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* hack: dummy function needed due to LTE dependencies */
|
||||
bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
unsigned char *const sdu_buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id)
|
||||
{
|
||||
abort();
|
||||
return false;
|
||||
}
|
||||
|
||||
//Dummy function needed due to LTE dependencies
|
||||
void
|
||||
pdcp_mbms_run ( const protocol_ctxt_t *const ctxt_pP){
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
void nr_pdcp_tick(int frame, int subframe)
|
||||
{
|
||||
if (frame != nr_pdcp_current_time_last_frame ||
|
||||
|
||||
@@ -39,7 +39,6 @@ uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id);
|
||||
|
||||
void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
confirm_t confirmP,
|
||||
@@ -48,12 +47,9 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
bool nr_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
uint8_t *const sdu_buffer,
|
||||
const uint32_t *const srcID,
|
||||
const uint32_t *const dstID);
|
||||
uint8_t *const sdu_buffer);
|
||||
|
||||
void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
|
||||
ue_id_t UEid,
|
||||
|
||||
@@ -162,26 +162,15 @@ void nr_rlc_release_entity(int ue_id, logical_chan_id_t channel_id)
|
||||
nr_rlc_manager_unlock(nr_rlc_ue_manager);
|
||||
}
|
||||
|
||||
void mac_rlc_data_ind(const module_id_t module_idP,
|
||||
const uint16_t ue_id,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
char *buffer_pP,
|
||||
const tb_size_t tb_sizeP,
|
||||
num_tb_t num_tbP,
|
||||
crc_t *crcs_pP)
|
||||
void nr_mac_rlc_data_ind(const module_id_t module_idP,
|
||||
const uint16_t ue_id,
|
||||
const bool gnb_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
char *buffer_pP,
|
||||
const tb_size_t tb_sizeP)
|
||||
{
|
||||
if (eNB_index != 0 || /*enb_flagP != 1 ||*/ MBMS_flagP != 0) {
|
||||
LOG_E(RLC, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (enb_flagP)
|
||||
T(T_ENB_RLC_MAC_UL, T_INT(module_idP), T_INT(ue_id),
|
||||
T_INT(channel_idP), T_INT(tb_sizeP));
|
||||
if (gnb_flagP)
|
||||
T(T_ENB_RLC_MAC_UL, T_INT(module_idP), T_INT(ue_id), T_INT(channel_idP), T_INT(tb_sizeP));
|
||||
|
||||
nr_rlc_manager_lock(nr_rlc_ue_manager);
|
||||
nr_rlc_ue_t *ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, ue_id);
|
||||
@@ -203,17 +192,12 @@ void mac_rlc_data_ind(const module_id_t module_idP,
|
||||
nr_rlc_manager_unlock(nr_rlc_ue_manager);
|
||||
}
|
||||
|
||||
tbs_size_t mac_rlc_data_req(const module_id_t module_idP,
|
||||
const uint16_t ue_id,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id)
|
||||
tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP,
|
||||
const uint16_t ue_id,
|
||||
const bool gnb_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP)
|
||||
{
|
||||
int ret;
|
||||
int maxsize;
|
||||
@@ -234,23 +218,14 @@ tbs_size_t mac_rlc_data_req(const module_id_t module_idP,
|
||||
|
||||
nr_rlc_manager_unlock(nr_rlc_ue_manager);
|
||||
|
||||
if (enb_flagP)
|
||||
if (gnb_flagP)
|
||||
T(T_ENB_RLC_MAC_DL, T_INT(module_idP), T_INT(ue_id),
|
||||
T_INT(channel_idP), T_INT(ret));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
mac_rlc_status_resp_t mac_rlc_status_ind(const module_id_t module_idP,
|
||||
const uint16_t ue_id,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id)
|
||||
mac_rlc_status_resp_t nr_mac_rlc_status_ind(const uint16_t ue_id, const frame_t frame, const logical_chan_id_t channel_idP)
|
||||
{
|
||||
mac_rlc_status_resp_t ret;
|
||||
|
||||
@@ -266,12 +241,10 @@ mac_rlc_status_resp_t mac_rlc_status_ind(const module_id_t module_idP,
|
||||
* more than enough.
|
||||
*/
|
||||
// Fix me: temproary reduction meanwhile cpu cost of this computation is optimized
|
||||
buf_stat = rb->buffer_status(rb, 1000*1000);
|
||||
ret.bytes_in_buffer = buf_stat.status_size
|
||||
+ buf_stat.retx_size
|
||||
+ buf_stat.tx_size;
|
||||
buf_stat = rb->buffer_status(rb, 1000 * 1000);
|
||||
ret.bytes_in_buffer = buf_stat.status_size + buf_stat.retx_size + buf_stat.tx_size;
|
||||
} else {
|
||||
if (!(frameP%128) || channel_idP == 0) //to suppress this warning message
|
||||
if (!(frame % 128) || channel_idP == 0) //to suppress this warning message
|
||||
LOG_W(RLC, "Radio Bearer (channel ID %d) is NULL for UE %d\n", channel_idP, ue_id);
|
||||
ret.bytes_in_buffer = 0;
|
||||
}
|
||||
@@ -286,76 +259,18 @@ mac_rlc_status_resp_t mac_rlc_status_ind(const module_id_t module_idP,
|
||||
return ret;
|
||||
}
|
||||
|
||||
rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(const module_id_t module_idP,
|
||||
const uint16_t ue_id,
|
||||
const eNB_index_t eNB_index,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const eNB_flag_t enb_flagP,
|
||||
const logical_chan_id_t channel_idP)
|
||||
{
|
||||
rlc_buffer_occupancy_t ret;
|
||||
|
||||
if (enb_flagP) {
|
||||
LOG_E(RLC, "Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%u\n", channel_idP);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* TODO: handle time a bit more properly */
|
||||
lock_nr_rlc_current_time();
|
||||
if (nr_rlc_current_time_last_frame != frameP ||
|
||||
nr_rlc_current_time_last_subframe != subframeP) {
|
||||
nr_rlc_current_time++;
|
||||
nr_rlc_current_time_last_frame = frameP;
|
||||
nr_rlc_current_time_last_subframe = subframeP;
|
||||
}
|
||||
unlock_nr_rlc_current_time();
|
||||
|
||||
nr_rlc_manager_lock(nr_rlc_ue_manager);
|
||||
nr_rlc_ue_t *ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, ue_id);
|
||||
nr_rlc_entity_t *rb = get_rlc_entity_from_lcid(ue, channel_idP);
|
||||
|
||||
if (rb != NULL) {
|
||||
nr_rlc_entity_buffer_status_t buf_stat;
|
||||
rb->set_time(rb, get_nr_rlc_current_time());
|
||||
/* 38.321 deals with BSR values up to 81338368 bytes, after what it
|
||||
* reports '> 81338368' (table 6.1.3.1-2). Passing 100000000 is thus
|
||||
* more than enough.
|
||||
*/
|
||||
// Fixme : Laurent reduced size for CPU saving
|
||||
// Fix me: temproary reduction meanwhile cpu cost of this computation is optimized
|
||||
buf_stat = rb->buffer_status(rb, 1000*1000);
|
||||
ret = buf_stat.status_size
|
||||
+ buf_stat.retx_size
|
||||
+ buf_stat.tx_size;
|
||||
} else {
|
||||
if (!(frameP%128)) //to suppress this warning message
|
||||
LOG_W(RLC, "Radio Bearer (channel ID %d) is NULL for UE %d\n", channel_idP, ue_id);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
nr_rlc_manager_unlock(nr_rlc_ue_manager);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
rlc_op_status_t rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
confirm_t confirmP,
|
||||
sdu_size_t sdu_sizeP,
|
||||
uint8_t *sdu_pP,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id)
|
||||
rlc_op_status_t nr_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
sdu_size_t sdu_sizeP,
|
||||
uint8_t *sdu_pP)
|
||||
{
|
||||
int ue_id = ctxt_pP->rntiMaybeUEid;
|
||||
nr_rlc_ue_t *ue;
|
||||
nr_rlc_entity_t *rb;
|
||||
|
||||
LOG_D(RLC, "UE %d srb_flag %d rb_id %ld mui %d confirm %d sdu_size %d MBMS_flag %d\n",
|
||||
ue_id, srb_flagP, rb_idP, muiP, confirmP, sdu_sizeP, MBMS_flagP);
|
||||
LOG_D(RLC, "UE %d srb_flag %d rb_id %ld mui %d sdu_size %d\n", ue_id, srb_flagP, rb_idP, muiP, sdu_sizeP);
|
||||
|
||||
if (ctxt_pP->enb_flag)
|
||||
T(T_ENB_RLC_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rntiMaybeUEid), T_INT(rb_idP), T_INT(sdu_sizeP));
|
||||
@@ -407,7 +322,7 @@ int nr_rlc_get_available_tx_space(const int ue_id, const logical_chan_id_t chann
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rlc_module_init(int enb_flag)
|
||||
int nr_rlc_module_init(int gnb_flag)
|
||||
{
|
||||
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static int inited = 0;
|
||||
@@ -415,30 +330,28 @@ int rlc_module_init(int enb_flag)
|
||||
|
||||
if (pthread_mutex_lock(&lock)) abort();
|
||||
|
||||
if (enb_flag == 1 && inited) {
|
||||
if (gnb_flag == 1 && inited) {
|
||||
LOG_E(RLC, "%s:%d:%s: fatal, inited already 1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (enb_flag == 0 && inited_ue) {
|
||||
if (gnb_flag == 0 && inited_ue) {
|
||||
LOG_E(RLC, "%s:%d:%s: fatal, inited_ue already 1\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (enb_flag == 1) inited = 1;
|
||||
if (enb_flag == 0) inited_ue = 1;
|
||||
if (gnb_flag == 1)
|
||||
inited = 1;
|
||||
if (gnb_flag == 0)
|
||||
inited_ue = 1;
|
||||
|
||||
nr_rlc_ue_manager = new_nr_rlc_ue_manager(enb_flag);
|
||||
nr_rlc_ue_manager = new_nr_rlc_ue_manager(gnb_flag);
|
||||
|
||||
if (pthread_mutex_unlock(&lock)) abort();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char *dataP, const signed long sizeP)
|
||||
{
|
||||
}
|
||||
|
||||
static void deliver_sdu(void *_ue, nr_rlc_entity_t *entity, char *buf, int size)
|
||||
{
|
||||
nr_rlc_ue_t *ue = _ue;
|
||||
@@ -447,7 +360,6 @@ static void deliver_sdu(void *_ue, nr_rlc_entity_t *entity, char *buf, int size)
|
||||
protocol_ctxt_t ctx;
|
||||
uint8_t *memblock;
|
||||
int i;
|
||||
int is_enb;
|
||||
|
||||
/* is it SRB? */
|
||||
for (i = 0; i < sizeofArray(ue->srb); i++) {
|
||||
@@ -480,21 +392,21 @@ rb_found:
|
||||
ctx.eNB_index = 0;
|
||||
ctx.brOption = 0;
|
||||
|
||||
is_enb = nr_rlc_manager_get_enb_flag(nr_rlc_ue_manager);
|
||||
int is_gnb = nr_rlc_manager_get_gnb_flag(nr_rlc_ue_manager);
|
||||
|
||||
/* used fields? */
|
||||
ctx.module_id = 0;
|
||||
/* CU (PDCP, RRC, SDAP) use a different ID than RNTI, so below set the CU UE
|
||||
* ID if in gNB, else use RNTI normally */
|
||||
ctx.rntiMaybeUEid = ue->ue_id;
|
||||
if (is_enb) {
|
||||
if (is_gnb) {
|
||||
f1_ue_data_t ue_data = du_get_f1_ue_data(ue->ue_id);
|
||||
ctx.rntiMaybeUEid = ue_data.secondary_ue;
|
||||
}
|
||||
|
||||
ctx.enb_flag = is_enb;
|
||||
ctx.enb_flag = is_gnb;
|
||||
|
||||
if (is_enb) {
|
||||
if (is_gnb) {
|
||||
T(T_ENB_RLC_UL,
|
||||
T_INT(0 /*ctxt_pP->module_id*/),
|
||||
T_INT(ue->ue_id), T_INT(rb_id), T_INT(size));
|
||||
@@ -511,22 +423,22 @@ rb_found:
|
||||
|
||||
if (NODE_IS_DU(type)) {
|
||||
if(is_srb) {
|
||||
MessageDef *msg;
|
||||
msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE);
|
||||
uint8_t *message_buffer = itti_malloc (TASK_RLC_ENB, TASK_DU_F1, size);
|
||||
memcpy (message_buffer, buf, size);
|
||||
MessageDef *msg;
|
||||
msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE);
|
||||
uint8_t *message_buffer = itti_malloc (TASK_RLC_ENB, TASK_DU_F1, size);
|
||||
memcpy (message_buffer, buf, size);
|
||||
F1AP_UL_RRC_MESSAGE(msg).gNB_CU_ue_id = ctx.rntiMaybeUEid;
|
||||
F1AP_UL_RRC_MESSAGE(msg).gNB_DU_ue_id = ue->ue_id;
|
||||
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id;
|
||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container = message_buffer;
|
||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size;
|
||||
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg);
|
||||
return;
|
||||
F1AP_UL_RRC_MESSAGE(msg).gNB_DU_ue_id = ue->ue_id;
|
||||
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id;
|
||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container = message_buffer;
|
||||
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size;
|
||||
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg);
|
||||
return;
|
||||
} else {
|
||||
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
|
||||
extern instance_t DUuniqInstance;
|
||||
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
|
||||
extern instance_t DUuniqInstance;
|
||||
gtpv1uSendDirect(DUuniqInstance, ue->ue_id, rb_id, (uint8_t*) buf, size, false, false);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -539,7 +451,7 @@ rb_found:
|
||||
}
|
||||
memcpy(memblock, buf, size);
|
||||
LOG_D(PDCP, "Calling PDCP layer from RLC in %s\n", __FUNCTION__);
|
||||
if (!nr_pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock, NULL, NULL)) {
|
||||
if (!nr_pdcp_data_ind(&ctx, is_srb, rb_id, size, memblock)) {
|
||||
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
/* what to do in case of failure? for the moment: nothing */
|
||||
}
|
||||
@@ -554,7 +466,6 @@ static void successful_delivery(void *_ue, nr_rlc_entity_t *entity, int sdu_id)
|
||||
#if 0
|
||||
MessageDef *msg;
|
||||
#endif
|
||||
int is_enb;
|
||||
|
||||
/* is it SRB? */
|
||||
for (i = 0; i < 2; i++) {
|
||||
@@ -587,8 +498,8 @@ rb_found:
|
||||
if (is_srb == 0)
|
||||
return;
|
||||
|
||||
is_enb = nr_rlc_manager_get_enb_flag(nr_rlc_ue_manager);
|
||||
if (!is_enb)
|
||||
int is_gnb = nr_rlc_manager_get_gnb_flag(nr_rlc_ue_manager);
|
||||
if (!is_gnb)
|
||||
return;
|
||||
|
||||
#if 0
|
||||
@@ -944,18 +855,6 @@ void nr_rlc_add_drb(int ue_id, int drb_id, const NR_RLC_BearerConfig_t *rlc_Bear
|
||||
LOG_I(RLC, "Added DRB to UE %d\n", ue_id);
|
||||
}
|
||||
|
||||
/* Dummy function due to dependency from LTE libraries */
|
||||
rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const LTE_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const LTE_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const LTE_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
const uint32_t sourceL2Id,
|
||||
const uint32_t destinationL2Id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct srb0_data {
|
||||
int ue_id;
|
||||
void *data;
|
||||
@@ -996,61 +895,6 @@ bool nr_rlc_activate_srb0(int ue_id,
|
||||
return true;
|
||||
}
|
||||
|
||||
rlc_op_status_t rrc_rlc_config_req(const protocol_ctxt_t* const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t mbms_flagP,
|
||||
const config_action_t actionP,
|
||||
const rb_id_t rb_idP)
|
||||
{
|
||||
if (mbms_flagP) {
|
||||
LOG_E(RLC, "%s:%d:%s: todo (MBMS NOT supported)\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
if (actionP != CONFIG_ACTION_REMOVE) {
|
||||
LOG_E(RLC, "%s:%d:%s: todo (only CONFIG_ACTION_REMOVE supported)\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
if (ctxt_pP->module_id) {
|
||||
LOG_E(RLC, "%s:%d:%s: todo (only module_id 0 supported)\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
if ((srb_flagP && !(rb_idP >= 1 && rb_idP <= 2)) ||
|
||||
(!srb_flagP && !(rb_idP >= 1 && rb_idP <= MAX_DRBS_PER_UE))) {
|
||||
LOG_E(RLC, "%s:%d:%s: bad rb_id (%ld) (is_srb %d)\n", __FILE__, __LINE__, __FUNCTION__, rb_idP, srb_flagP);
|
||||
exit(1);
|
||||
}
|
||||
nr_rlc_manager_lock(nr_rlc_ue_manager);
|
||||
LOG_D(RLC, "%s:%d:%s: remove rb %ld (is_srb %d) for UE %lx\n", __FILE__, __LINE__, __FUNCTION__, rb_idP, srb_flagP, ctxt_pP->rntiMaybeUEid);
|
||||
nr_rlc_ue_t *ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, ctxt_pP->rntiMaybeUEid);
|
||||
if (srb_flagP) {
|
||||
if (ue->srb[rb_idP-1] != NULL) {
|
||||
ue->srb[rb_idP-1]->delete_entity(ue->srb[rb_idP-1]);
|
||||
ue->srb[rb_idP-1] = NULL;
|
||||
} else
|
||||
LOG_W(RLC, "removing non allocated SRB %ld, do nothing\n", rb_idP);
|
||||
} else {
|
||||
if (ue->drb[rb_idP-1] != NULL) {
|
||||
ue->drb[rb_idP-1]->delete_entity(ue->drb[rb_idP-1]);
|
||||
ue->drb[rb_idP-1] = NULL;
|
||||
} else
|
||||
LOG_W(RLC, "removing non allocated DRB %ld, do nothing\n", rb_idP);
|
||||
}
|
||||
/* remove UE if it has no more RB configured */
|
||||
int i;
|
||||
for (i = 0; i < 2; i++)
|
||||
if (ue->srb[i] != NULL)
|
||||
break;
|
||||
if (i == 2) {
|
||||
for (i = 0; i < MAX_DRBS_PER_UE; i++)
|
||||
if (ue->drb[i] != NULL)
|
||||
break;
|
||||
if (i == MAX_DRBS_PER_UE)
|
||||
nr_rlc_manager_remove_ue(nr_rlc_ue_manager, ctxt_pP->rntiMaybeUEid);
|
||||
}
|
||||
nr_rlc_manager_unlock(nr_rlc_ue_manager);
|
||||
return RLC_OP_STATUS_OK;
|
||||
}
|
||||
|
||||
void nr_rlc_remove_ue(int ue_id)
|
||||
{
|
||||
LOG_W(RLC, "Remove UE %d\n", ue_id);
|
||||
@@ -1124,16 +968,6 @@ void nr_rlc_tick(int frame, int subframe)
|
||||
unlock_nr_rlc_current_time();
|
||||
}
|
||||
|
||||
/* This is a hack, to compile the gNB.
|
||||
* TODO: remove it. The solution is to cleanup CMakeLists.txt
|
||||
*/
|
||||
void rlc_tick(int a, int b)
|
||||
{
|
||||
LOG_E(RLC, "%s:%d:%s: this code should not be reached\n",
|
||||
__FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void nr_rlc_activate_avg_time_to_tx(const int ue_id,
|
||||
const logical_chan_id_t channel_id,
|
||||
const bool is_on)
|
||||
|
||||
@@ -41,6 +41,27 @@
|
||||
struct NR_RLC_Config;
|
||||
struct NR_LogicalChannelConfig;
|
||||
|
||||
int nr_rlc_module_init(int gnb_flag);
|
||||
void nr_mac_rlc_data_ind(const module_id_t module_idP,
|
||||
const uint16_t ue_id,
|
||||
const bool gnb_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
char *buffer_pP,
|
||||
const tb_size_t tb_sizeP);
|
||||
tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP,
|
||||
const uint16_t ue_id,
|
||||
const bool gnb_flagP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP);
|
||||
rlc_op_status_t nr_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
sdu_size_t sdu_sizeP,
|
||||
uint8_t *sdu_pP);
|
||||
mac_rlc_status_resp_t nr_mac_rlc_status_ind(const uint16_t ue_id, const frame_t frame, const logical_chan_id_t channel_idP);
|
||||
|
||||
void nr_rlc_add_srb(int ue_id, int srb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig);
|
||||
void nr_rlc_add_drb(int ue_id, int drb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig);
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ typedef struct {
|
||||
pthread_mutex_t lock;
|
||||
nr_rlc_ue_t **ue_list;
|
||||
int ue_count;
|
||||
int enb_flag;
|
||||
int gnb_flag;
|
||||
} nr_rlc_ue_manager_internal_t;
|
||||
|
||||
nr_rlc_ue_manager_t *new_nr_rlc_ue_manager(int enb_flag)
|
||||
nr_rlc_ue_manager_t *new_nr_rlc_ue_manager(int gnb_flag)
|
||||
{
|
||||
nr_rlc_ue_manager_internal_t *ret;
|
||||
|
||||
@@ -45,15 +45,15 @@ nr_rlc_ue_manager_t *new_nr_rlc_ue_manager(int enb_flag)
|
||||
}
|
||||
|
||||
if (pthread_mutex_init(&ret->lock, NULL)) abort();
|
||||
ret->enb_flag = enb_flag;
|
||||
ret->gnb_flag = gnb_flag;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int nr_rlc_manager_get_enb_flag(nr_rlc_ue_manager_t *_m)
|
||||
int nr_rlc_manager_get_gnb_flag(nr_rlc_ue_manager_t *_m)
|
||||
{
|
||||
nr_rlc_ue_manager_internal_t *m = _m;
|
||||
return m->enb_flag;
|
||||
return m->gnb_flag;
|
||||
}
|
||||
|
||||
void nr_rlc_manager_lock(nr_rlc_ue_manager_t *_m)
|
||||
|
||||
@@ -52,9 +52,9 @@ typedef struct nr_rlc_ue_t {
|
||||
/* manager functions */
|
||||
/***********************************************************************/
|
||||
|
||||
nr_rlc_ue_manager_t *new_nr_rlc_ue_manager(int enb_flag);
|
||||
nr_rlc_ue_manager_t *new_nr_rlc_ue_manager(int gnb_flag);
|
||||
|
||||
int nr_rlc_manager_get_enb_flag(nr_rlc_ue_manager_t *m);
|
||||
int nr_rlc_manager_get_gnb_flag(nr_rlc_ue_manager_t *m);
|
||||
|
||||
void nr_rlc_manager_lock(nr_rlc_ue_manager_t *m);
|
||||
void nr_rlc_manager_unlock(nr_rlc_ue_manager_t *m);
|
||||
|
||||
@@ -255,6 +255,10 @@ typedef struct gNB_RRC_UE_s {
|
||||
/* Nas Pdu */
|
||||
ngap_pdu_t nas_pdu;
|
||||
|
||||
/* hack, see rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ() for more info */
|
||||
int max_delays_pdu_session;
|
||||
bool ongoing_pdusession_setup_request;
|
||||
|
||||
} gNB_RRC_UE_t;
|
||||
|
||||
typedef struct rrc_gNB_ue_context_s {
|
||||
|
||||
@@ -110,7 +110,6 @@ bool trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, int n, pdusession
|
||||
|
||||
int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib, uint32_t tmsi, uint8_t paging_drx);
|
||||
|
||||
void nr_rrc_transfer_protected_rrc_message(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue_p, uint8_t srb_id, const uint8_t* buffer, int size);
|
||||
/** @}*/
|
||||
|
||||
/* UE Management Procedures */
|
||||
|
||||
+60
-16
@@ -97,6 +97,12 @@
|
||||
|
||||
#ifdef E2_AGENT
|
||||
#include "openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_extern.h"
|
||||
#define E2_AGENT_SIGNAL_DL_DCCH_RRC_MSG(BUF, LEN, ID) \
|
||||
do { \
|
||||
byte_array_t buffer_ba = {.len = LEN}; \
|
||||
buffer_ba.buf = (uint8_t *)BUF; \
|
||||
signal_rrc_msg(DL_DCCH_NR_RRC_CLASS, ID, buffer_ba); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
mui_t rrc_gNB_mui = 0;
|
||||
@@ -184,11 +190,12 @@ static void rrc_deliver_dl_rrc_message(void *deliver_pdu_data, ue_id_t ue_id, in
|
||||
data->rrc->mac_rrc.dl_rrc_message_transfer(data->assoc_id, data->dl_rrc);
|
||||
}
|
||||
|
||||
void nr_rrc_transfer_protected_rrc_message(const gNB_RRC_INST *rrc,
|
||||
const gNB_RRC_UE_t *ue_p,
|
||||
uint8_t srb_id,
|
||||
const uint8_t *buffer,
|
||||
int size)
|
||||
static void nr_rrc_transfer_protected_rrc_message(const gNB_RRC_INST *rrc,
|
||||
const gNB_RRC_UE_t *ue_p,
|
||||
uint8_t srb_id,
|
||||
const uint32_t message_id,
|
||||
const uint8_t *buffer,
|
||||
int size)
|
||||
{
|
||||
DevAssert(size > 0);
|
||||
f1_ue_data_t ue_data = cu_get_f1_ue_data(ue_p->rrc_ue_id);
|
||||
@@ -202,6 +209,10 @@ void nr_rrc_transfer_protected_rrc_message(const gNB_RRC_INST *rrc,
|
||||
(unsigned char *const)buffer,
|
||||
rrc_deliver_dl_rrc_message,
|
||||
&data);
|
||||
|
||||
#ifdef E2_AGENT
|
||||
E2_AGENT_SIGNAL_DL_DCCH_RRC_MSG(buffer, size, message_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
///---------------------------------------------------------------------------------------------------------------///
|
||||
@@ -571,7 +582,8 @@ static void rrc_gNB_generate_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_
|
||||
DevAssert(size > 0 && size <= sizeof(buffer));
|
||||
|
||||
LOG_UE_DL_EVENT(ue_p, "Generate RRCReconfiguration (bytes %d, xid %d)\n", size, xid);
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size);
|
||||
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, buffer, size);
|
||||
}
|
||||
|
||||
void rrc_gNB_modify_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p)
|
||||
@@ -680,7 +692,8 @@ void rrc_gNB_modify_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t
|
||||
clear_nas_pdu(&ue_p->pduSession[i].param.nas_pdu);
|
||||
|
||||
LOG_I(NR_RRC, "UE %d: Generate RRCReconfiguration (bytes %d)\n", ue_p->rrc_ue_id, size);
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size);
|
||||
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, buffer, size);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -732,7 +745,8 @@ void rrc_gNB_generate_dedicatedRRCReconfiguration_release(gNB_RRC_INST *rrc,
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC, "UE %d: Generate NR_RRCReconfiguration (bytes %d)\n", ue_p->rrc_ue_id, size);
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size);
|
||||
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, buffer, size);
|
||||
}
|
||||
|
||||
static void fill_security_info(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, security_information_t *secInfo)
|
||||
@@ -887,6 +901,10 @@ static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context
|
||||
deliver_dl_rrc_message_data_t data = {.rrc = rrc, .dl_rrc = &dl_rrc, .assoc_id = ue_data.du_assoc_id};
|
||||
nr_pdcp_data_req_srb(ue_p->rrc_ue_id, DL_SCH_LCID_DCCH, rrc_gNB_mui++, size, (unsigned char *const)buffer, rrc_deliver_dl_rrc_message, &data);
|
||||
|
||||
#ifdef E2_AGENT
|
||||
E2_AGENT_SIGNAL_DL_DCCH_RRC_MSG(buffer, size, NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment);
|
||||
#endif
|
||||
|
||||
/* RRCReestablishment has been generated, let's enable ciphering now. */
|
||||
security_parameters.ciphering_algorithm = ue_p->ciphering_algorithm;
|
||||
/* SRBs */
|
||||
@@ -987,7 +1005,8 @@ static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RR
|
||||
ue_p->rrc_ue_id,
|
||||
ue_p->rnti,
|
||||
size);
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size);
|
||||
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, buffer, size);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -1008,7 +1027,8 @@ int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const int
|
||||
uint8_t buffer[NR_RRC_BUF_SIZE];
|
||||
int size = do_RRCReconfiguration(ue_p, buffer, NR_RRC_BUF_SIZE, xid, NULL, NULL, NULL, NULL, NULL, NULL, masterCellGroup);
|
||||
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size);
|
||||
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, buffer, size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1442,7 +1462,8 @@ void rrc_forward_ue_nas_message(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE)
|
||||
uint32_t length = do_NR_DLInformationTransfer(buffer, sizeof(buffer), xid, UE->nas_pdu.length, UE->nas_pdu.buffer);
|
||||
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, buffer, length, "[MSG] RRC DL Information Transfer\n");
|
||||
rb_id_t srb_id = UE->Srb[2].Active ? DL_SCH_LCID_DCCH1 : DL_SCH_LCID_DCCH;
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, UE, srb_id, buffer, length);
|
||||
const uint32_t msg_id = NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer;
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, UE, srb_id, msg_id, buffer, length);
|
||||
// no need to free UE->nas_pdu.buffer, do_NR_DLInformationTransfer() did that
|
||||
UE->nas_pdu.buffer = NULL;
|
||||
UE->nas_pdu.length = 0;
|
||||
@@ -1626,6 +1647,11 @@ static void handle_rrcSetupComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const N
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef E2_AGENT
|
||||
const uint32_t msg_id = NR_UL_DCCH_MessageType__c1_PR_rrcSetupComplete;
|
||||
signal_ue_id(UE, UL_DCCH_NR_RRC_CLASS, msg_id);
|
||||
#endif
|
||||
|
||||
rrc_gNB_process_RRCSetupComplete(rrc, UE, setup_complete->criticalExtensions.choice.rrcSetupComplete);
|
||||
return;
|
||||
}
|
||||
@@ -1666,6 +1692,10 @@ static void handle_rrcReconfigurationComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *U
|
||||
LOG_E(RRC, "UE %d: Received unexpected transaction type %d for xid %d\n", UE->rrc_ue_id, UE->xids[xid], xid);
|
||||
break;
|
||||
}
|
||||
|
||||
if (UE->xids[xid] == RRC_PDUSESSION_ESTABLISH)
|
||||
UE->ongoing_pdusession_setup_request = false;
|
||||
|
||||
UE->xids[xid] = RRC_ACTION_NONE;
|
||||
for (int i = 0; i < NR_RRC_TRANSACTION_IDENTIFIER_NUMBER; ++i) {
|
||||
if (UE->xids[i] != RRC_ACTION_NONE) {
|
||||
@@ -1694,7 +1724,8 @@ static void rrc_gNB_generate_UECapabilityEnquiry(gNB_RRC_INST *rrc, gNB_RRC_UE_t
|
||||
|
||||
AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
|
||||
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, ue, DL_SCH_LCID_DCCH, buffer, size);
|
||||
const uint32_t msg_id = NR_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry;
|
||||
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)
|
||||
@@ -1728,6 +1759,13 @@ static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *m
|
||||
}
|
||||
|
||||
if (ul_dcch_msg->message.present == NR_UL_DCCH_MessageType_PR_c1) {
|
||||
#ifdef E2_AGENT
|
||||
// 38.331 Sec 6.2.1: message index of UL-DCCH-Message
|
||||
const uint32_t rrc_msg_id = ul_dcch_msg->message.choice.c1->present;
|
||||
byte_array_t buffer_ba = {.len = msg->rrc_container_length};
|
||||
buffer_ba.buf = msg->rrc_container;
|
||||
signal_rrc_msg(UL_DCCH_NR_RRC_CLASS, rrc_msg_id, buffer_ba);
|
||||
#endif
|
||||
switch (ul_dcch_msg->message.choice.c1->present) {
|
||||
case NR_UL_DCCH_MessageType__c1_PR_NOTHING:
|
||||
LOG_I(NR_RRC, "Received PR_NOTHING on UL-DCCH-Message\n");
|
||||
@@ -2554,9 +2592,10 @@ void *rrc_gnb_task(void *args_p) {
|
||||
break;
|
||||
|
||||
case TIMER_HAS_EXPIRED:
|
||||
/* only this one handled for now */
|
||||
DevAssert(TIMER_HAS_EXPIRED(msg_p).timer_id == stats_timer_id);
|
||||
write_rrc_stats(RC.nrrrc[0]);
|
||||
if (TIMER_HAS_EXPIRED(msg_p).timer_id == stats_timer_id)
|
||||
write_rrc_stats(RC.nrrrc[0]);
|
||||
else
|
||||
itti_send_msg_to_task(TASK_RRC_GNB, 0, TIMER_HAS_EXPIRED(msg_p).arg); /* see rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ() */
|
||||
break;
|
||||
|
||||
case F1AP_INITIAL_UL_RRC_MESSAGE:
|
||||
@@ -2721,7 +2760,8 @@ void rrc_gNB_generate_SecurityModeCommand(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p)
|
||||
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Security Mode Command\n");
|
||||
LOG_I(NR_RRC, "UE %u Logical Channel DL-DCCH, Generate SecurityModeCommand (bytes %d)\n", ue_p->rrc_ue_id, size);
|
||||
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, buffer, size);
|
||||
const uint32_t msg_id = NR_DL_DCCH_MessageType__c1_PR_securityModeCommand;
|
||||
nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DL_SCH_LCID_DCCH, msg_id, buffer, size);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -2746,6 +2786,10 @@ void rrc_gNB_generate_RRCRelease(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE)
|
||||
};
|
||||
deliver_ue_ctxt_release_data_t data = {.rrc = rrc, .release_cmd = &ue_context_release_cmd, .assoc_id = ue_data.du_assoc_id};
|
||||
nr_pdcp_data_req_srb(UE->rrc_ue_id, DL_SCH_LCID_DCCH, rrc_gNB_mui++, size, buffer, rrc_deliver_ue_ctxt_release_cmd, &data);
|
||||
|
||||
#ifdef E2_AGENT
|
||||
E2_AGENT_SIGNAL_DL_DCCH_RRC_MSG(buffer, size, NR_DL_DCCH_MessageType__c1_PR_rrcRelease);
|
||||
#endif
|
||||
}
|
||||
|
||||
int rrc_gNB_generate_pcch_msg(sctp_assoc_t assoc_id, const NR_SIB1_t *sib1, uint32_t tmsi, uint8_t paging_drx)
|
||||
|
||||
@@ -550,7 +550,7 @@ int rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, instance_t
|
||||
}
|
||||
|
||||
#ifdef E2_AGENT
|
||||
signal_rrc_state_changed_to(UE, RC_SM_RRC_CONNECTED);
|
||||
signal_rrc_state_changed_to(UE, RRC_CONNECTED_RRC_STATE_E2SM_RC);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
@@ -815,6 +815,29 @@ void rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE
|
||||
return;
|
||||
}
|
||||
|
||||
/* \brief checks if any transaction is ongoing for any xid of this UE */
|
||||
static bool transaction_ongoing(const gNB_RRC_UE_t *UE)
|
||||
{
|
||||
for (int xid = 0; xid < NR_RRC_TRANSACTION_IDENTIFIER_NUMBER; ++xid) {
|
||||
if (UE->xids[xid] != RRC_ACTION_NONE)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* \brief delays the ongoing transaction (in msg_p) by setting a timer to wait
|
||||
* 10ms; upon expiry, delivers to RRC, which sends the message to itself */
|
||||
static void delay_transaction(MessageDef *msg_p, int wait_us)
|
||||
{
|
||||
MessageDef *new = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_PDUSESSION_SETUP_REQ);
|
||||
ngap_pdusession_setup_req_t *n = &NGAP_PDUSESSION_SETUP_REQ(new);
|
||||
*n = NGAP_PDUSESSION_SETUP_REQ(msg_p);
|
||||
|
||||
int instance = msg_p->ittiMsgHeader.originInstance;
|
||||
long timer_id;
|
||||
timer_setup(0, wait_us, TASK_RRC_GNB, instance, TIMER_ONE_SHOT, new, &timer_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Fill PDU Session Resource Setup Response with a list of PDU Session Resources Failed to Setup
|
||||
* and send ITTI message to TASK_NGAP
|
||||
@@ -871,17 +894,52 @@ void rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(MessageDef *msg_p, instance_t ins
|
||||
return;
|
||||
}
|
||||
|
||||
// Reject PDU session if at least one exists already with that ID.
|
||||
// At least one because marking one as existing, and setting up another, that
|
||||
// might be more work than is worth it. See 8.2.1.4 in 38.413
|
||||
for (int i = 0; i < msg->nb_pdusessions_tosetup; ++i) {
|
||||
const pdusession_t *p = &msg->pdusession_setup_params[i];
|
||||
rrc_pdu_session_param_t *exist = find_pduSession(UE, p->pdusession_id, false /* don't create */);
|
||||
if (exist) {
|
||||
LOG_E(NR_RRC, "UE %d: already has existing PDU session %d rejecting PDU Session Resource Setup Request\n", UE->rrc_ue_id, p->pdusession_id);
|
||||
ngap_cause_t cause = {.type = NGAP_CAUSE_RADIO_NETWORK, .value = NGAP_CAUSE_RADIO_NETWORK_MULTIPLE_PDU_SESSION_ID_INSTANCES};
|
||||
send_ngap_pdu_session_setup_resp_fail(instance, msg, cause);
|
||||
rrc_forward_ue_nas_message(rrc, UE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
UE->amf_ue_ngap_id = msg->amf_ue_ngap_id;
|
||||
|
||||
/* This is a hack. We observed that with some UEs, PDU session requests might
|
||||
* come in quick succession, faster than the RRC reconfiguration for the PDU
|
||||
* session requests can be carried out (UE is doing reconfig, and second PDU
|
||||
* session request arrives). We don't have currently the means to "queue up"
|
||||
* these transactions, which would probably involve some rework of the RRC.
|
||||
* To still allow these requests to come in and succeed, we below check and delay transactions
|
||||
* for 10ms. However, to not accidentally end up in infinite loops, the
|
||||
* maximum number is capped on a per-UE basis as indicated in variable
|
||||
* max_delays_pdu_session. */
|
||||
if (!UE->ongoing_pdusession_setup_request)
|
||||
UE->max_delays_pdu_session = 100;
|
||||
|
||||
if (UE->max_delays_pdu_session > 0 && (transaction_ongoing(UE) || UE->ongoing_pdusession_setup_request)) {
|
||||
int wait_us = 10000;
|
||||
LOG_I(RRC, "UE %d: delay PDU session setup by %d us, pending %d retries\n", UE->rrc_ue_id, wait_us, UE->max_delays_pdu_session);
|
||||
delay_transaction(msg_p, wait_us);
|
||||
UE->max_delays_pdu_session--;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!trigger_bearer_setup(rrc, UE, msg->nb_pdusessions_tosetup, msg->pdusession_setup_params, msg->ueAggMaxBitRateDownlink)) {
|
||||
// Reject PDU Session Resource setup if there's no CU-UP associated
|
||||
LOG_W(NR_RRC, "UE %d: reject PDU Session Setup in PDU Session Resource Setup Response\n", UE->rrc_ue_id);
|
||||
ngap_cause_t cause = {.type = NGAP_CAUSE_RADIO_NETWORK, .value = NGAP_CAUSE_RADIO_NETWORK_RESOURCES_NOT_AVAILABLE_FOR_THE_SLICE};
|
||||
send_ngap_pdu_session_setup_resp_fail(instance, msg, cause);
|
||||
rrc_forward_ue_nas_message(rrc, UE);
|
||||
} else {
|
||||
UE->ongoing_pdusession_setup_request = true;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void fill_qos2(NGAP_QosFlowAddOrModifyRequestList_t *qos, pdusession_t *session)
|
||||
@@ -1209,7 +1267,7 @@ int rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(MessageDef *msg_p, instance_
|
||||
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
|
||||
UE->an_release = true;
|
||||
#ifdef E2_AGENT
|
||||
signal_rrc_state_changed_to(UE, RC_SM_RRC_IDLE);
|
||||
signal_rrc_state_changed_to(UE, RRC_IDLE_RRC_STATE_E2SM_RC);
|
||||
#endif
|
||||
|
||||
/* a UE might not be associated to a CU-UP if it never requested a PDU
|
||||
@@ -1326,10 +1384,6 @@ int rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(MessageDef *msg_p, instance_
|
||||
uint32_t gNB_ue_ngap_id;
|
||||
ngap_pdusession_release_command_t *cmd = &NGAP_PDUSESSION_RELEASE_COMMAND(msg_p);
|
||||
gNB_ue_ngap_id = cmd->gNB_ue_ngap_id;
|
||||
if (cmd->nb_pdusessions_torelease > NGAP_MAX_PDUSESSION) {
|
||||
LOG_E(NR_RRC, "incorrect number of pdu session do release %d\n", cmd->nb_pdusessions_torelease);
|
||||
return -1;
|
||||
}
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[instance];
|
||||
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(rrc, gNB_ue_ngap_id);
|
||||
|
||||
|
||||
@@ -206,6 +206,8 @@ rrc_gNB_ue_context_t *rrc_gNB_create_ue_context(sctp_assoc_t assoc_id,
|
||||
ue->rrc_ue_id);
|
||||
bool success = cu_add_f1_ue_data(ue->rrc_ue_id, &ue_data);
|
||||
DevAssert(success);
|
||||
ue->max_delays_pdu_session = 20; /* see rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ() */
|
||||
ue->ongoing_pdusession_setup_request = false;
|
||||
|
||||
RB_INSERT(rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_p);
|
||||
LOG_UE_EVENT(ue,
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
#include "openair3/SECU/key_nas_deriver.h"
|
||||
#include "openair2/RRC/NR/rrc_gNB_NGAP.h"
|
||||
|
||||
#ifdef E2_AGENT
|
||||
#include "openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_extern.h"
|
||||
#endif
|
||||
|
||||
typedef enum { HO_CTX_BOTH, HO_CTX_SOURCE, HO_CTX_TARGET } ho_ctx_type_t;
|
||||
static nr_handover_context_t *alloc_ho_ctx(ho_ctx_type_t type)
|
||||
{
|
||||
@@ -242,6 +246,12 @@ static void rrc_gNB_trigger_reconfiguration_for_handover(gNB_RRC_INST *rrc, gNB_
|
||||
(unsigned char *const)rrc_reconf,
|
||||
rrc_deliver_ue_ctxt_modif_req,
|
||||
&data);
|
||||
#ifdef E2_AGENT
|
||||
uint32_t message_id = NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration;
|
||||
byte_array_t buffer_ba = {.len = rrc_reconf_len};
|
||||
buffer_ba.buf = rrc_reconf;
|
||||
signal_rrc_msg(DL_DCCH_NR_RRC_CLASS, message_id, buffer_ba);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void nr_rrc_f1_ho_acknowledge(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, uint8_t *rrc_reconf_buf, uint32_t rrc_reconf_len)
|
||||
|
||||
@@ -17,12 +17,12 @@ add_library(oran_fhlib_5g MODULE
|
||||
)
|
||||
|
||||
find_package(xran REQUIRED)
|
||||
if(xran_VERSION VERSION_EQUAL 5.1.4)
|
||||
if(xran_VERSION VERSION_EQUAL 5.1.5)
|
||||
target_compile_definitions(oran_fhlib_5g PRIVATE E_RELEASE)
|
||||
elseif(xran_VERSION VERSION_EQUAL 6.1.1)
|
||||
elseif(xran_VERSION VERSION_EQUAL 6.1.2)
|
||||
target_compile_definitions(oran_fhlib_5g PRIVATE F_RELEASE)
|
||||
else()
|
||||
message(FATAL_ERROR "Found xran version ${xran_VERSION} but needed 5.1.4 (E release) or 6.1.1 (F release)")
|
||||
message(FATAL_ERROR "Found xran version ${xran_VERSION} but needed 5.1.5 (E release) or 6.1.2 (F release)")
|
||||
endif()
|
||||
|
||||
# Ignore xran-specific warning: we don't care/can't change the following warning, so suppress
|
||||
@@ -32,6 +32,11 @@ add_compile_options(-Wno-packed-not-aligned)
|
||||
set_target_properties(oran_fhlib_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native")
|
||||
target_link_libraries(oran_fhlib_5g PRIVATE xran::xran ${dpdk_LINK_LIBRARIES} ${T_LIB} pthread dl rt m numa)
|
||||
target_include_directories(oran_fhlib_5g PRIVATE ${dpdk_INCLUDE_DIRS})
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||
find_package(armral REQUIRED)
|
||||
target_sources(oran_fhlib_5g PRIVATE armral_bfp_compression.c)
|
||||
target_link_libraries(oran_fhlib_5g PRIVATE armral)
|
||||
endif()
|
||||
|
||||
add_boolean_option(OAI_FHI72_USE_POLLING OFF "Enable polling in FHI72 driver" ON)
|
||||
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
/*! \file radio/fhi_72/armral_bfp_compression.c
|
||||
* \brief BFP compression for the O-RAN 7.2 FrontHaul Interface for Arm systems using the Arm RAN Acceleration Library
|
||||
* \author Romain Beurdouche
|
||||
* \date 2025
|
||||
* \company EURECOM
|
||||
* \email romain.beurdouche@eurecom.fr
|
||||
* \note ArmRAL available at https://git.gitlab.arm.com/networking/ral.git
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "armral.h"
|
||||
#include <rte_branch_prediction.h>
|
||||
|
||||
#include "armral_bfp_compression.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
/**
|
||||
* The function operates on a fixed block size of one Physical Resource Block
|
||||
* (PRB). Each block consists of 12 16-bit complex resource elements. Each block
|
||||
* taken as input is compressed into 24 samples with a common unsigned scaling factor.
|
||||
*
|
||||
* @param[in] iq_width Width in bits of compressed samples.
|
||||
* @param[in] n_prb The number of input resource blocks.
|
||||
* @param[in] src Points to the input complex samples sequence.
|
||||
* @param[out] dst Points to the output compressed data.
|
||||
*/
|
||||
void armral_bfp_compression(uint32_t iq_width, uint32_t n_prb, int16_t *src, int8_t *dst)
|
||||
{
|
||||
armral_status ret = ARMRAL_ARGUMENT_ERROR;
|
||||
switch (iq_width) {
|
||||
case 8:
|
||||
ret = armral_block_float_compr_8bit(n_prb, (armral_cmplx_int16_t *)src, (armral_compressed_data_8bit *)dst, NULL);
|
||||
if (unlikely(ret != ARMRAL_SUCCESS)) {
|
||||
LOG_E(HW, "armral_block_scaling_compr_8bit returned an error: %d\n", (int)ret);
|
||||
}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
ret = armral_block_float_compr_9bit(n_prb, (armral_cmplx_int16_t *)src, (armral_compressed_data_9bit *)dst, NULL);
|
||||
if (unlikely(ret != ARMRAL_SUCCESS)) {
|
||||
LOG_E(HW, "armral_block_scaling_compr_9bit returned an error: %d\n", (int)ret);
|
||||
}
|
||||
break;
|
||||
|
||||
case 14:
|
||||
ret = armral_block_float_compr_14bit(n_prb, (armral_cmplx_int16_t *)src, (armral_compressed_data_14bit *)dst, NULL);
|
||||
if (unlikely(ret != ARMRAL_SUCCESS)) {
|
||||
LOG_E(HW, "armral_block_scaling_compr_14bit returned an error: %d\n", (int)ret);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(HW, "Unsupported IQ width in BFP compression: %d\n", iq_width);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The function operates on a fixed block size of one Physical Resource Block
|
||||
* (PRB). Each block consists of 12 compressed complex resource elements.
|
||||
* Each block taken as input is expanded into 12 16-bit complex samples.
|
||||
*
|
||||
* @param[in] iq_width Width in bits of compressed samples.
|
||||
* @param[in] n_prb The number of input resource blocks.
|
||||
* @param[in] src Points to the input compressed data.
|
||||
* @param[out] dst Points to the output complex samples sequence.
|
||||
*/
|
||||
void armral_bfp_decompression(uint32_t iq_width, uint32_t n_prb, int8_t *src, int16_t *dst)
|
||||
{
|
||||
armral_status ret = ARMRAL_ARGUMENT_ERROR;
|
||||
switch (iq_width) {
|
||||
case 8:
|
||||
ret = armral_block_float_decompr_8bit(n_prb, (armral_compressed_data_8bit *)src, (armral_cmplx_int16_t *)dst, NULL);
|
||||
if (unlikely(ret != ARMRAL_SUCCESS)) {
|
||||
LOG_E(HW, "armral_block_scaling_decompr_8bit returned an error: %d\n", (int)ret);
|
||||
}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
ret = armral_block_float_decompr_9bit(n_prb, (armral_compressed_data_9bit *)src, (armral_cmplx_int16_t *)dst, NULL);
|
||||
if (unlikely(ret != ARMRAL_SUCCESS)) {
|
||||
LOG_E(HW, "armral_block_scaling_decompr_9bit returned an error: %d\n", (int)ret);
|
||||
}
|
||||
break;
|
||||
|
||||
case 14:
|
||||
ret = armral_block_float_decompr_14bit(n_prb, (armral_compressed_data_14bit *)src, (armral_cmplx_int16_t *)dst, NULL);
|
||||
if (unlikely(ret != ARMRAL_SUCCESS)) {
|
||||
LOG_E(HW, "armral_block_scaling_decompr_14bit returned an error: %d\n", (int)ret);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(HW, "Unsupported IQ width in BFP decompression: %d\n", iq_width);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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 radio/fhi_72/armral_bfp_compression.h
|
||||
* \brief BFP compression for the O-RAN 7.2 FrontHaul Interface for Arm systems using the Arm RAN Acceleration Library
|
||||
* \author Romain Beurdouche
|
||||
* \date 2025
|
||||
* \company EURECOM
|
||||
* \email romain.beurdouche@eurecom.fr
|
||||
* \note ArmRAL available at https://git.gitlab.arm.com/networking/ral.git
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __ARMRAL_BFP_COMPRESSION_H__
|
||||
#define __ARMRAL_BFP_COMPRESSION_H__
|
||||
|
||||
/**
|
||||
* The function operates on a fixed block size of one Physical Resource Block
|
||||
* (PRB). Each block consists of 12 16-bit complex resource elements. Each block
|
||||
* taken as input is compressed into 24 samples with a common unsigned scaling factor.
|
||||
*
|
||||
* @param[in] iq_width Width in bits of compressed samples.
|
||||
* @param[in] n_prb The number of input resource blocks.
|
||||
* @param[in] src Points to the input complex samples sequence.
|
||||
* @param[out] dst Points to the output compressed data.
|
||||
*/
|
||||
void armral_bfp_compression(uint32_t iq_width, uint32_t n_prb, int16_t *src, int8_t *dst);
|
||||
|
||||
/**
|
||||
* The function operates on a fixed block size of one Physical Resource Block
|
||||
* (PRB). Each block consists of 12 compressed complex resource elements.
|
||||
* Each block taken as input is expanded into 12 16-bit complex samples.
|
||||
*
|
||||
* @param[in] iq_width Width in bits of compressed samples.
|
||||
* @param[in] n_prb The number of input resource blocks.
|
||||
* @param[in] src Points to the input compressed data.
|
||||
* @param[out] dst Points to the output complex samples sequence.
|
||||
*/
|
||||
void armral_bfp_decompression(uint32_t iq_width, uint32_t n_prb, int8_t *src, int16_t *dst);
|
||||
|
||||
#endif
|
||||
+30
-6
@@ -24,9 +24,13 @@
|
||||
#include <stdlib.h>
|
||||
#include "xran_fh_o_du.h"
|
||||
#include "xran_compression.h"
|
||||
#include "armral_bfp_compression.h"
|
||||
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
#else
|
||||
// xran_cp_api.h uses SIMD, but does not include it
|
||||
#include <immintrin.h>
|
||||
#endif
|
||||
#include "xran_cp_api.h"
|
||||
#include "xran_sync_api.h"
|
||||
#include "oran_isolate.h"
|
||||
@@ -212,12 +216,14 @@ static int read_prach_data(ru_info_t *ru, int frame, int slot)
|
||||
}
|
||||
}
|
||||
} else if (ru_conf->compMeth_PRACH == XRAN_COMPMETHOD_BLKFLOAT) {
|
||||
struct xranlib_decompress_request bfp_decom_req = {};
|
||||
struct xranlib_decompress_response bfp_decom_rsp = {};
|
||||
|
||||
int16_t local_dst[12 * 2 * N_SC_PER_PRB] __attribute__((aligned(64)));
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
struct xranlib_decompress_request bfp_decom_req = {};
|
||||
struct xranlib_decompress_response bfp_decom_rsp = {};
|
||||
int payload_len = (3 * ru_conf->iqWidth_PRACH + 1) * 12; // 12 = closest number of PRBs to 139 REs
|
||||
|
||||
bfp_decom_req.data_in = (int8_t *)src;
|
||||
bfp_decom_req.numRBs = 12; // closest number of PRBs to 139 REs
|
||||
bfp_decom_req.len = payload_len;
|
||||
@@ -227,6 +233,11 @@ static int read_prach_data(ru_info_t *ru, int frame, int slot)
|
||||
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(ru_conf->iqWidth_PRACH, 12, (int8_t *)src, (int16_t *)local_dst);
|
||||
#else
|
||||
AssertFatal(1 == 0, "BFP decompression not supported on this architecture");
|
||||
#endif
|
||||
// note: this is hardwired for 139 point PRACH sequence, kbar=2
|
||||
if (sym_idx == 0) //
|
||||
for (idx = 0; idx < (139 * 2); idx++)
|
||||
@@ -377,8 +388,6 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
|
||||
|
||||
uint32_t idxElm = 0;
|
||||
uint8_t *src = (uint8_t *)ptr;
|
||||
int16_t payload_len = 0;
|
||||
|
||||
|
||||
LOG_D(HW, "pRbMap->nPrbElm %d\n", pRbMap->nPrbElm);
|
||||
for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
|
||||
@@ -409,10 +418,12 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
|
||||
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 = {};
|
||||
|
||||
payload_len = (3 * pRbElm->iqWidth + 1) * pRbElm->nRBSize;
|
||||
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;
|
||||
@@ -423,6 +434,11 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
|
||||
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++;
|
||||
@@ -549,9 +565,12 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
for (idx = 0; idx < (pos_len + neg_len) * 2; idx++)
|
||||
((uint16_t *)dst16)[idx] = htons(((uint16_t *)local_src)[idx]);
|
||||
} else if (p_prbMapElm->compMethod == XRAN_COMPMETHOD_BLKFLOAT) {
|
||||
payload_len = (3 * p_prbMapElm->iqWidth + 1) * p_prbMapElm->nRBSize;
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
struct xranlib_compress_request bfp_com_req = {};
|
||||
struct xranlib_compress_response bfp_com_rsp = {};
|
||||
payload_len = (3 * p_prbMapElm->iqWidth + 1) * p_prbMapElm->nRBSize;
|
||||
|
||||
bfp_com_req.data_in = (int16_t *)local_src;
|
||||
bfp_com_req.numRBs = p_prbMapElm->nRBSize;
|
||||
bfp_com_req.len = payload_len;
|
||||
@@ -562,6 +581,11 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
bfp_com_rsp.len = 0;
|
||||
|
||||
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);
|
||||
#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);
|
||||
|
||||
@@ -306,7 +306,14 @@ static void oran_allocate_buffers(void *handle,
|
||||
uint32_t xran_max_antenna_nr = RTE_MAX(fh_config->neAxc, fh_config->neAxcUl);
|
||||
uint32_t xran_max_sections_per_slot = RTE_MAX(fh_config->max_sections_per_slot, XRAN_MIN_SECTIONS_PER_SLOT);
|
||||
|
||||
pi->buf_list = _mm_malloc(sizeof(*pi->buf_list), 256);
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
// ARM-specific memory allocation
|
||||
int ret = posix_memalign((void**)&pi->buf_list, 256, sizeof(*pi->buf_list));
|
||||
AssertFatal(ret == 0, "out of memory\n");
|
||||
#else
|
||||
// Intel-specific memory allocation
|
||||
pi->buf_list = _mm_malloc(sizeof(*pi->buf_list), 256);
|
||||
#endif
|
||||
AssertFatal(pi->buf_list != NULL, "out of memory\n");
|
||||
oran_buf_list_t *bl = pi->buf_list;
|
||||
|
||||
|
||||
@@ -33,12 +33,12 @@ gNBs =
|
||||
# n_TimingAdvanceOffset = 0;
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# center frequency = 3999.36 MHz
|
||||
# selected SSB frequency = 3999.36 MHz
|
||||
absoluteFrequencySSB = 666624;
|
||||
# center frequency = 4049.76 MHz
|
||||
# selected SSB frequency = 4049.76 MHz
|
||||
absoluteFrequencySSB = 669984;
|
||||
dl_frequencyBand = 77;
|
||||
# frequency point A = 3980.28 MHz
|
||||
dl_absoluteFrequencyPointA = 665352;
|
||||
# frequency point A = 4030.68 MHz
|
||||
dl_absoluteFrequencyPointA = 668712;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
@@ -259,7 +259,7 @@ fhi_72 = {
|
||||
system_core = 0;
|
||||
io_core = 1;
|
||||
worker_cores = (2);
|
||||
ru_addr = ("98:ae:71:01:c5:eb", "98:ae:71:01:c5:eb");
|
||||
ru_addr = ("98:ae:71:04:83:e3", "98:ae:71:04:83:e3");
|
||||
mtu = 9600;
|
||||
fh_config = ({
|
||||
T1a_cp_dl = (285, 470);
|
||||
|
||||
@@ -31,12 +31,12 @@ gNBs =
|
||||
# n_TimingAdvanceOffset = 0;
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# center frequency = 3999.36 MHz
|
||||
# selected SSB frequency = 3999.36 MHz
|
||||
absoluteFrequencySSB = 666624;
|
||||
# center frequency = 4049.76 MHz
|
||||
# selected SSB frequency = 4049.76 MHz
|
||||
absoluteFrequencySSB = 669984;
|
||||
dl_frequencyBand = 77;
|
||||
# frequency point A = 3950.22 MHz
|
||||
dl_absoluteFrequencyPointA = 663348;
|
||||
# frequency point A = 4000.62 MHz
|
||||
dl_absoluteFrequencyPointA = 666708;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
@@ -256,7 +256,7 @@ fhi_72 = {
|
||||
system_core = 0;
|
||||
io_core = 1;
|
||||
worker_cores = (2);
|
||||
ru_addr = ("98:ae:71:01:c5:eb", "98:ae:71:01:c5:eb");
|
||||
ru_addr = ("98:ae:71:04:83:e3", "98:ae:71:04:83:e3");
|
||||
mtu = 9600;
|
||||
fh_config = ({
|
||||
T1a_cp_dl = (285, 470);
|
||||
|
||||
@@ -33,12 +33,12 @@ gNBs =
|
||||
# n_TimingAdvanceOffset = 0;
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# center frequency = 3999.36 MHz
|
||||
# selected SSB frequency = 3999.36 MHz
|
||||
absoluteFrequencySSB = 666624;
|
||||
# center frequency = 4049.76 MHz
|
||||
# selected SSB frequency = 4049.76 MHz
|
||||
absoluteFrequencySSB = 669984;
|
||||
dl_frequencyBand = 77;
|
||||
# frequency point A = 3950.22 MHz
|
||||
dl_absoluteFrequencyPointA = 663348;
|
||||
# frequency point A = 4000.62 MHz
|
||||
dl_absoluteFrequencyPointA = 666708;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
@@ -258,7 +258,7 @@ fhi_72 = {
|
||||
system_core = 0;
|
||||
io_core = 1;
|
||||
worker_cores = (2);
|
||||
ru_addr = ("98:ae:71:01:c5:eb", "98:ae:71:01:c5:eb");
|
||||
ru_addr = ("98:ae:71:04:83:e3", "98:ae:71:04:83:e3");
|
||||
mtu = 9600;
|
||||
fh_config = ({
|
||||
T1a_cp_dl = (285, 470);
|
||||
|
||||
Reference in New Issue
Block a user