diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..1ed392ef0647193896da498a7033b84921b35f81 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +cmake_targets/log/ +cmake_targets/ran_build/ +targets/bin/ + diff --git a/ci-scripts/buildOnVM.sh b/ci-scripts/buildOnVM.sh index fb1e995f6bbe1190d52f185df80f53ccc59a4217..7aeedb605086bc36ccc454af55eac4a80e54cbae 100755 --- a/ci-scripts/buildOnVM.sh +++ b/ci-scripts/buildOnVM.sh @@ -135,7 +135,7 @@ case $key in ARCHIVES_LOC=cppcheck LOG_PATTERN=cppcheck.xml NB_PATTERN_FILES=1 - BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2" + BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c" shift ;; -v5) @@ -200,7 +200,7 @@ case $key in ARCHIVES_LOC=cppcheck LOG_PATTERN=cppcheck.xml NB_PATTERN_FILES=1 - BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2" + BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c" ;; gnb-usrp) VM_NAME=ci-gnb-usrp diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index e77c7355dc7c8aa1fde8a63aa7d4f0b6e51b56b5..79e33fa4d18afc5579a4907a44d501a5c8a47a47 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -350,7 +350,7 @@ add_custom_command ( add_list2_option(NR_RRC_ASN1_VERSION "NR_Rel15" "ASN.1 version of NR_RRC interface") if (${NR_RRC_ASN1_VERSION} STREQUAL "NR_Rel15") - set (NR_RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1c/ASN1_files/NR-RRC-Definitions.asn) + set (NR_RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1c/ASN1_files/NR-RRC-38331-f10.asn) endif (${NR_RRC_ASN1_VERSION} STREQUAL "NR_Rel15") set (NR_RRC_FULL_DIR ${asn1_generated_dir}/${NR_RRC_ASN1_VERSION}) @@ -359,7 +359,7 @@ if(NOT EXISTS ${asn1c_call}) message( FATAL_ERROR "The script ${asn1c_call} must be present" ) endif(NOT EXISTS ${asn1c_call}) -message("calling ASN1C_PREFIX=NR_ asn1c -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}") +message("calling ASN1C_PREFIX=NR_ asn1c -findirect-choice -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}") execute_process(COMMAND ${asn1c_call} ${NR_RRC_FULL_DIR} ${NR_RRC_GRAMMAR} @@ -388,8 +388,10 @@ file(GLOB nr_rrc_source ${NR_RRC_FULL_DIR}/*.c) file(GLOB nr_rrc_h ${NR_RRC_FULL_DIR}/*.h) set(nr_rrc_h ${nr_rrc_h} ${NR_RRC_FULL_DIR}/asn1_constants.h) set_source_files_properties(${nr_rrc_source} PROPERTIES COMPILE_FLAGS -w) # suppress warnings from generated code -add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source} - ${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c) +add_library(NR_RRC_LIB + ${nr_rrc_h} + ${nr_rrc_source} + ${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c) include_directories ("${NR_RRC_FULL_DIR}") # add the command to generate the source code @@ -433,6 +435,7 @@ execute_process(COMMAND mkdir -p ${S1AP_C_DIR} COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES} RESULT_VARIABLE ret) + if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif (NOT ${ret} STREQUAL 0) @@ -448,6 +451,7 @@ add_custom_command ( DEPENDS ${S1AP_ASN_DIR}/${S1AP_ASN_FILES} ) + add_library(S1AP_LIB ${S1AP_source} ${S1AP_DIR}/s1ap_common.c @@ -491,10 +495,19 @@ endif(${X2AP_VERSION} STREQUAL "R14") set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR}) set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${ASN1RELDIR}) + message("calling asn1c -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}") + execute_process(COMMAND mkdir -p ${X2AP_C_DIR} COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} RESULT_VARIABLE ret) + +#execute_process(COMMAND ${asn1c_call} +# ${X2AP_C_DIR} +# ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} +# X2AP +# RESULT_VARIABLE ret) + if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${asn1c_call}: error") endif (NOT ${ret} STREQUAL 0) @@ -510,6 +523,13 @@ add_custom_command ( DEPENDS ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} ) +#add_custom_command ( +# OUTPUT ${X2AP_C_DIR}/X2AP_asn_constant.h +# COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} X2AP +# COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION} +# DEPENDS ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} +# ) + add_library(X2AP_LIB ${X2AP_source} ${X2AP_DIR}/x2ap_common.c @@ -794,6 +814,7 @@ include_directories("${OPENAIR_DIR}/targets/ARCH/COMMON") include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/USERSPACE/LIB/") include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/DEFS") include_directories("${OPENAIR2_DIR}/ENB_APP") +include_directories("${OPENAIR2_DIR}/GNB_APP") include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC") include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC") include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PDCP") @@ -1261,7 +1282,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/TOOLS/lut.c ${PHY_POLARSRC} ) - set(PHY_NR_UE_SRC # depend on code generation from asn1c ${RRC_FULL_DIR}/asn1_constants.h @@ -1297,10 +1317,10 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c ${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c #${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_common_ue.c + ${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c ${PHY_POLARSRC} ) - if (${SMBV}) set(PHY_SRC "${PHY_SRC} ${OPENAIR1_DIR}/PHY/TOOLS/smbv.c") endif (${SMBV}) @@ -1320,13 +1340,17 @@ add_library(PHY_RU ${PHY_SRC_RU}) #Layer 2 library ##################### set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC) +set(NR_MAC_DIR ${OPENAIR2_DIR}/LAYER2/NR_MAC_gNB) set(NR_UE_MAC_DIR ${OPENAIR2_DIR}/LAYER2/NR_MAC_UE) set(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE) +set(NR_PHY_INTERFACE_DIR ${OPENAIR2_DIR}/NR_PHY_INTERFACE) +set(NR_UE_PHY_INTERFACE_DIR ${OPENAIR2_DIR}/NR_UE_PHY_INTERFACE) set(RLC_DIR ${OPENAIR2_DIR}/LAYER2/RLC) set(RLC_UM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0) set(RLC_AM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0) set(RLC_TM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/TM_v9.3.0) set(RRC_DIR ${OPENAIR2_DIR}/RRC/LTE) +set(NR_RRC_DIR ${OPENAIR2_DIR}/RRC/NR) set(NR_UE_RRC_DIR ${OPENAIR2_DIR}/RRC/NR_UE) set(PDCP_DIR ${OPENAIR2_DIR}/LAYER2/PDCP_v10.1.0) set(L2_SRC @@ -1373,6 +1397,9 @@ set(L2_SRC ${RRC_DIR}/L2_interface.c ${RRC_DIR}/L2_interface_common.c ${RRC_DIR}/L2_interface_ue.c + ${NR_RRC_DIR}/rrc_gNB.c + ${NR_RRC_DIR}/nr_rrc_common.c + ${NR_RRC_DIR}/L2_nr_interface.c ) set(L2_SRC_UE @@ -1439,8 +1466,14 @@ set (MAC_SRC ${MAC_DIR}/pre_processor.c ${MAC_DIR}/config.c ${MAC_DIR}/config_ue.c + ${NR_PHY_INTERFACE_DIR}/NR_IF_Module.c + ${NR_MAC_DIR}/main.c + ${NR_MAC_DIR}/config.c + ${NR_MAC_DIR}/gNB_scheduler.c + ${NR_MAC_DIR}/gNB_scheduler_bch.c ) + set (MAC_SRC_UE ${MAC_DIR}/main_ue.c ${MAC_DIR}/ue_procedures.c @@ -1448,11 +1481,16 @@ set (MAC_SRC_UE ${MAC_DIR}/l1_helpers.c ${MAC_DIR}/rar_tools_ue.c ${MAC_DIR}/config_ue.c + + ) + +set (MAC_NR_SRC_UE + ${NR_UE_PHY_INTERFACE_DIR}/NR_IF_Module.c ${NR_UE_MAC_DIR}/config_ue.c ${NR_UE_MAC_DIR}/mac_vars.c ${NR_UE_MAC_DIR}/main_ue_nr.c ${NR_UE_MAC_DIR}/nr_ue_procedures.c - ) +) set (ENB_APP_SRC ${OPENAIR2_DIR}/ENB_APP/enb_app.c @@ -1460,17 +1498,25 @@ set (ENB_APP_SRC ${OPENAIR2_DIR}/ENB_APP/RRC_config_tools.c ) +set (GNB_APP_SRC + ${OPENAIR2_DIR}/GNB_APP/gnb_app.c + ${OPENAIR2_DIR}/GNB_APP/gnb_config.c + ) + add_library(L2 ${L2_SRC} ${MAC_SRC} - ${ENB_APP_SRC}) + ${ENB_APP_SRC} + ${GNB_APP_SRC}) # ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c) add_library(L2_UE ${L2_SRC_UE} ${MAC_SRC_UE} + ${MAC_NR_SRC_UE} ) +include_directories(${NR_UE_PHY_INTERFACE_DIR}) include_directories(${NFAPI_USER_DIR}) @@ -2154,6 +2200,7 @@ add_executable(nr-softmodem ${OPENAIR_TARGETS}/RT/USER/nr-softmodem.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c + ${OPENAIR_TARGETS}/COMMON/create_nr_tasks.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR_DIR}/common/utils/utils.c @@ -2210,7 +2257,7 @@ target_link_libraries (nr-softmodem -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${MIH_LIB} - RRC_LIB S1AP_LIB S1AP_ENB L2 + RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2 NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -Wl,--end-group z dl) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index f0ae7e79c8240c34f0b196613f0e54f556601122..29687ca5e813ba419a50bd6e91cd977bbe6e9fcc 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -277,7 +277,7 @@ check_install_usrp_uhd_driver(){ $SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then $SUDO $INSTALLER -y install python boost libusb-devel libusbx-devel boost-devel python-mako python-docutils cmake - $SUDO pip install requests + $SUDO -H pip install requests if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then # until EPEL repo hasn't bumped UHD driver to >=3.10 in EPEL, build driver from source $SUDO $INSTALLER -y remove uhd uhd-devel uhd-firmware @@ -460,8 +460,8 @@ check_install_additional_tools (){ #The packages below are already installed for Redhat distros (RHEL, CentOS, Fedora) if [[ "$OS_DISTRO" == "ubuntu" ]]; then - $SUDO pip install paramiko - $SUDO pip install pyroute2 colorama + $SUDO -H pip install paramiko + $SUDO -H pip install pyroute2 colorama log_netiface=$OPENAIR_DIR/cmake_targets/log/netiface_install_log.txt echo_info "Installing Netinterfaces package. The logfile for installation is in $log_netiface" ( @@ -659,10 +659,9 @@ install_asn1c_from_source(){ echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log " ( $SUDO rm -rf /tmp/asn1c - # GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c - git clone https://github.com/velichkov/asn1c /tmp/asn1c + git clone https://github.com/brchiu/asn1c /tmp/asn1c cd /tmp/asn1c - git checkout s1ap + git checkout velichkov_s1ap_plus_option_group test -f configure || autoreconf -iv ./configure make -j`nproc` diff --git a/cmake_targets/tools/generate_asn1 b/cmake_targets/tools/generate_asn1 index fb38455a126a809026fb306e8663a53a4ed01c2a..b53a14114ba5c343bc107bd89be96b98852ecf66 100755 --- a/cmake_targets/tools/generate_asn1 +++ b/cmake_targets/tools/generate_asn1 @@ -107,12 +107,16 @@ case "$module" in ;; NR_RRC ) export ASN1C_PREFIX=NR_ - asn1c -gen-PER -fcompound-names -no-gen-example fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample + asn1c -gen-PER -fcompound-names -findirect-choice -no-gen-example fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample ;; S1AP ) export ASN1C_PREFIX=S1AP_ asn1c -gen-PER -fcompound-names -no-gen-example fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample ;; + X2AP ) + export ASN1C_PREFIX=X2AP_ + asn1c -gen-PER -fcompound-names -no-gen-example fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample + ;; esac @@ -129,12 +133,16 @@ case "$module" in ;; NR_RRC ) export ASN1C_PREFIX=NR_ - asn1c -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample + asn1c -fcompound-names -findirect-choice -fno-include-deps -gen-PER -no-gen-OER -no-gen-example $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample ;; S1AP ) export ASN1C_PREFIX=S1AP_ asn1c -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample ;; + X2AP ) + export ASN1C_PREFIX=X2AP_ + asn1c -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample + ;; esac fi diff --git a/common/ran_context.h b/common/ran_context.h index e616595d15f1b184fcb39338ef897c1c4e0cea0e..61e2ac477e81eedafbf395cb04c5a231cddd41a4 100644 --- a/common/ran_context.h +++ b/common/ran_context.h @@ -49,7 +49,8 @@ #include "PHY/defs_L1_NB_IoT.h" #include "RRC/LTE/defs_NB_IoT.h" -#include "RRC/NR/defs_NR.h" +#include "RRC/NR/nr_rrc_defs.h" + typedef struct { /// RAN context config file name @@ -68,14 +69,22 @@ typedef struct { int nb_macrlc_inst; /// Number of NB_IoT MACRLC instances in this node int nb_nb_iot_macrlc_inst; + /// Number of NR MACRLC instances in this node + int nb_nr_macrlc_inst; /// Number of component carriers per instance in this node int *nb_mac_CC; + /// Number of component carriers per instance in this node + int *nb_nr_mac_CC; /// Number of L1 instances in this node int nb_L1_inst; /// Number of NB_IoT L1 instances in this node int nb_nb_iot_L1_inst; + /// Number of NR L1 instances in this node + int nb_nr_L1_inst; /// Number of Component Carriers per instance in this node int *nb_L1_CC; + /// Number of NR Component Carriers per instance in this node + int *nb_nr_L1_CC; /// Number of RU instances in this node int nb_RU; /// FlexRAN context variables @@ -96,6 +105,8 @@ typedef struct { struct eNB_MAC_INST_s **mac; /// NB_IoT MAC context variables struct eNB_MAC_INST_NB_IoT_s **nb_iot_mac; + /// NR MAC context variables + struct gNB_MAC_INST_s **nrmac; /// GTPu descriptor gtpv1u_data_t *gtpv1u_data_g; /// RU descriptors. These describe what each radio unit is supposed to do and contain the necessary functions for fronthaul interfaces diff --git a/nfapi/open-nFAPI/nfapi/public_inc/BAK/nr_ue_fapi_interface.h.bak b/nfapi/open-nFAPI/nfapi/public_inc/BAK/nr_ue_fapi_interface.h.bak new file mode 100644 index 0000000000000000000000000000000000000000..d389b06936f3731e606bcfa07b47a8d8a8853009 --- /dev/null +++ b/nfapi/open-nFAPI/nfapi/public_inc/BAK/nr_ue_fapi_interface.h.bak @@ -0,0 +1,3981 @@ +/* + * Copyright 2017 Cisco Systems, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef _NFAPI_INTERFACE_NR_EXTENSION_H_ +#define _NFAPI_INTERFACE_NR_EXTENSION_H_ +#define _NFAPI_INTERFACE_H_ + +#include "stddef.h" + +// Constants - update based on implementation +#define NR_NFAPI_MAX_PHY_RF_INSTANCES 2 +#define NR_NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH 16 +#define NR_NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH 3 +#define NR_NFAPI_MAX_NUM_RF_BANDS 16 + +// The following definition control the size of arrays used in the interface. +// These may be changed if desired. They are used in the encoder to make sure +// that the user has not specified a 'count' larger than the max array, and also +// used by the decoder when decode an array. If the 'count' received is larger +// than the array it is to be stored in the decode fails. +#define NR_NFAPI_MAX_NUM_ANTENNAS 8 +#define NR_NFAPI_MAX_NUM_SUBBANDS 13 +#define NR_NFAPI_MAX_BF_VECTORS 8 +#define NR_NFAPI_MAX_CC 1 +#define NR_NFAPI_MAX_NUM_PHYSICAL_ANTENNAS 8 +#define NR_NFAPI_MAX_RSSI 8 +#define NR_NFAPI_MAX_PSC_LIST 32 +#define NR_NFAPI_MAX_PCI_LIST 32 +#define NR_NFAPI_MAX_CARRIER_LIST 32 +#define NR_NFAPI_MAX_ARFCN_LIST 128 +#define NR_NFAPI_MAX_LTE_CELLS_FOUND 8 +#define NR_NFAPI_MAX_UTRAN_CELLS_FOUND 8 +#define NR_NFAPI_MAX_GSM_CELLS_FOUND 8 +#define NR_NFAPI_MAX_NB_IOT_CELLS_FOUND 8 +#define NR_NFAPI_MAX_SI_PERIODICITY 8 +#define NR_NFAPI_MAX_SI_INDEX 8 +#define NR_NFAPI_MAX_MIB_LENGTH 32 +#define NR_NFAPI_MAX_SIB_LENGTH 256 +#define NR_NFAPI_MAX_SI_LENGTH 256 +#define NR_NFAPI_MAX_OPAQUE_DATA 64 +#define NR_NFAPI_MAX_NUM_SCHEDULED_UES 8 // Used in the TPM structure +#define NR_NFAPI_MAX_PNF_PHY 5 +#define NR_NFAPI_MAX_PNF_PHY_RF_CONFIG 5 +#define NR_NFAPI_MAX_PNF_RF 5 +#define NR_NFAPI_MAX_NMM_FREQUENCY_BANDS 32 +#define NR_NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS 100 +#define NR_NFAPI_MAX_UL_DL_CONFIGURATIONS 5 +#define NR_NFAPI_MAX_CSI_RS_RESOURCE_CONFIG 4 +#define NR_NFAPI_MAX_ANTENNA_PORT_COUNT 8 +#define NR_NFAPI_MAX_EPDCCH_PRB 8 +#define NR_NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS 8 +#define NR_NFAPI_MAX_NUMBER_ACK_NACK_TDD 8 +#define NR_NFAPI_MAX_RO_DL 8 + +#define NR_NFAPI_HEADER_LENGTH 8 +#define NR_NFAPI_P7_HEADER_LENGTH 16 + +#define NR_NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE 0xF000 +#define NR_NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE 0xFFFF + +#define NR_NFAPI_VERSION_3_0_11 0x000 +#define NR_NFAPI_VERSION_3_0_12 0x001 + +#define NR_NFAPI_HALF_FRAME_INDEX_FIRST_HALF 0 +#define NR_NFAPI_HALF_FRAME_INDEX_SECOND_HALF 1 + +// The IANA agreed port definition of the P5 SCTP VNF enpoint +// http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=7701 +#define NR_NFAPI_P5_SCTP_PORT 7701 + +typedef unsigned int uint32_t; +typedef unsigned short uint16_t; +typedef unsigned char uint8_t; +typedef signed int int32_t; +typedef signed short int16_t; +typedef signed char int8_t; + +typedef struct { + uint16_t phy_id; + uint16_t message_id; + uint16_t message_length; + uint16_t spare; +} nr_nfapi_p4_p5_message_header_t; + +typedef struct { + uint16_t phy_id; + uint16_t message_id; + uint16_t message_length; + uint16_t m_segment_sequence; /* This consists of 3 fields - namely, M, Segement & Sequence number*/ + uint32_t checksum; + uint32_t transmit_timestamp; +} nr_nfapi_p7_message_header_t; + +#define NR_NFAPI_PHY_ID_NA 0 + +//#define NR_NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x80) >> 7 ) +//#define NR_NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x70) >> 4 ) +#define NR_NFAPI_P7_GET_MORE(_mss) ( ((_mss) & 0x8000) >> 15 ) +#define NR_NFAPI_P7_GET_SEGMENT(_mss) ( ((_mss) & 0x7F00) >> 8 ) +#define NR_NFAPI_P7_GET_SEQUENCE(_mss) ( (_mss) & 0x00FF ) +#define NR_NFAPI_P7_SET_MSS(_more, _segm, _sequ) ( (((_more) & 0x1) << 7) | (((_segm) & 0x7) << 4) | ((_sequ) & 0xF) ) + +typedef struct { + uint16_t tag; + uint16_t length; +} nr_nfapi_tl_t; +#define NR_NFAPI_TAG_LENGTH_PACKED_LEN 4 + +// Convenience methods to convert between SFN/SFN formats +#define NR_NFAPI_SFNSF2DEC(_sfnsf) ((((_sfnsf) >> 4) * 10) + ((_sfnsf) & 0xF)) +#define NR_NFAPI_SFNSFDEC2SFNSF(_sfnsf_dec) ((((_sfnsf_dec) / 10) << 4) | (((_sfnsf_dec) - (((_sfnsf_dec) / 10) * 10)) & 0xF)) + +#define NR_NFAPI_SFNSF2SFN(_sfnsf) ((_sfnsf) >> 4) +#define NR_NFAPI_SFNSF2SF(_sfnsf) ((_sfnsf) & 0xF) + +#define NR_NFAPI_MAX_SFNSFDEC 10240 + +typedef nr_nfapi_tl_t* nr_nfapi_vendor_extension_tlv_t; + + +// nFAPI Message IDs +typedef enum { + NR_NFAPI_DL_CONFIG_REQUEST = 0x0080, + NR_NFAPI_UL_CONFIG_REQUEST, + NR_NFAPI_SUBFRAME_INDICATION, + NR_NFAPI_HI_DCI0_REQUEST, + NR_NFAPI_TX_REQUEST, + NR_NFAPI_HARQ_INDICATION, + NR_NFAPI_CRC_INDICATION, + NR_NFAPI_RX_ULSCH_INDICATION, + NR_NFAPI_RACH_INDICATION, + NR_NFAPI_SRS_INDICATION, + NR_NFAPI_RX_SR_INDICATION, + NR_NFAPI_RX_CQI_INDICATION, + NR_NFAPI_LBT_DL_CONFIG_REQUEST, + NR_NFAPI_LBT_DL_INDICATION, + NR_NFAPI_NB_HARQ_INDICATION, + NR_NFAPI_NRACH_INDICATION, + + NR_NFAPI_PNF_PARAM_REQUEST = 0x0100, + NR_NFAPI_PNF_PARAM_RESPONSE, + NR_NFAPI_PNF_CONFIG_REQUEST, + NR_NFAPI_PNF_CONFIG_RESPONSE, + NR_NFAPI_PNF_START_REQUEST, + NR_NFAPI_PNF_START_RESPONSE, + NR_NFAPI_PNF_STOP_REQUEST, + NR_NFAPI_PNF_STOP_RESPONSE, + NR_NFAPI_PARAM_REQUEST, + NR_NFAPI_PARAM_RESPONSE, + NR_NFAPI_CONFIG_REQUEST, + NR_NFAPI_CONFIG_RESPONSE, + NR_NFAPI_START_REQUEST, + NR_NFAPI_START_RESPONSE, + NR_NFAPI_STOP_REQUEST, + NR_NFAPI_STOP_RESPONSE, + NR_NFAPI_MEASUREMENT_REQUEST, + NR_NFAPI_MEASUREMENT_RESPONSE, + + NR_NFAPI_UL_NODE_SYNC = 0x0180, + NR_NFAPI_DL_NODE_SYNC, + NR_NFAPI_TIMING_INFO, + + + NR_NFAPI_RSSI_REQUEST = 0x0200, + NR_NFAPI_RSSI_RESPONSE, + NR_NFAPI_RSSI_INDICATION, + NR_NFAPI_CELL_SEARCH_REQUEST, + NR_NFAPI_CELL_SEARCH_RESPONSE, + NR_NFAPI_CELL_SEARCH_INDICATION, + NR_NFAPI_BROADCAST_DETECT_REQUEST, + NR_NFAPI_BROADCAST_DETECT_RESPONSE, + NR_NFAPI_BROADCAST_DETECT_INDICATION, + NR_NFAPI_SYSTEM_INFORMATION_SCHEDULE_REQUEST, + NR_NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE, + NR_NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION, + NR_NFAPI_SYSTEM_INFORMATION_REQUEST, + NR_NFAPI_SYSTEM_INFORMATION_RESPONSE, + NR_NFAPI_SYSTEM_INFORMATION_INDICATION, + NR_NFAPI_NMM_STOP_REQUEST, + NR_NFAPI_NMM_STOP_RESPONSE, + + NR_NFAPI_VENDOR_EXT_MSG_MIN = 0x0300, + NR_NFAPI_VENDOR_EXT_MSG_MAX = 0x03FF, + + + NR_NFAPI_MAX_MESSAGE_ID, +} nr_nfapi_message_id_e; + +// nFAPI Error Codes +typedef enum { + NR_NFAPI_MSG_OK = 0, + NR_NFAPI_MSG_INVALID_STATE, + NR_NFAPI_MSG_INVALID_CONFIG, + NR_NFAPI_SFN_OUT_OF_SYNC, + NR_NFAPI_MSG_SUBFRAME_ERR, + NR_NFAPI_MSG_BCH_MISSING, + NR_NFAPI_MSG_INVALID_SFN, + NR_NFAPI_MSG_HI_ERR, + NR_NFAPI_MSG_TX_ERR, + + NR_NFAPI_LBT_NO_PDU_IN_DL_REQ, + NR_NFAPI_LBT_NO_VALID_CONFIG_REQ_RECEIVED, + NR_NFAPI_FAPI_E_LBT_SF_SFN_PASSED_END_SF_SFN, + NR_NFAPI_FAPI_E_LBT_OVERLAP, + NR_NFAPI_MSG_BCH_PRESENT, + + NR_NFAPI_NBIOT_UNEXPECTED_REQ, + + // This is special return code that indicates that a response has + // been send via P9 + NR_NFAPI_MSG_P9_RESPONSE = 0xAA +} nr_nfapi_error_code_e; + + +typedef enum { + NR_NFAPI_P4_MSG_OK = 100, + NR_NFAPI_P4_MSG_INVALID_STATE = 101, + NR_NFAPI_P4_MSG_INVALID_CONFIG = 102, + NR_NFAPI_P4_MSG_RAT_NOT_SUPPORTED = 103, + NR_NFAPI_P4_MSG_NMM_STOP_OK = 200, + NR_NFAPI_P4_MSG_NMM_STOP_IGNOREDED = 201, + NR_NFAPI_P4_MSG_NMM_STOP_INVALID_STATE = 202, + NR_NFAPI_P4_MSG_PROCEDURE_COMPLETE = 300, + NR_NFAPI_P4_MSG_PROCEDURE_STOPPED = 301, + NR_NFAPI_P4_MSG_PARTIAL_RESULTS = 302, + NR_NFAPI_P4_MSG_TIMEOUT = 303 +} nr_nfapi_p4_error_code_e; + +// nFAPI enums +typedef enum { + NR_NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE = 0, + NR_NFAPI_DL_CONFIG_BCH_PDU_TYPE, + NR_NFAPI_DL_CONFIG_MCH_PDU_TYPE, + NR_NFAPI_DL_CONFIG_DLSCH_PDU_TYPE, + NR_NFAPI_DL_CONFIG_PCH_PDU_TYPE, + NR_NFAPI_DL_CONFIG_PRS_PDU_TYPE, + NR_NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE, + NR_NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE, + NR_NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE, + NR_NFAPI_DL_CONFIG_NBCH_PDU_TYPE, + NR_NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE, + NR_NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE +} nr_nfapi_dl_config_pdu_type_e; + +typedef enum { + NR_NFAPI_DCI_FORMAT_0_0 = 0, + NR_NFAPI_DCI_FORMAT_0_1, + NR_NFAPI_DCI_FORMAT_1_0, + NR_NFAPI_DCI_FORMAT_1_1, + NR_NFAPI_DCI_FORMAT_2_0, + NR_NFAPI_DCI_FORMAT_2_1, + NR_NFAPI_DCI_FORMAT_2_2, + NR_NFAPI_DCI_FORMAT_2_3 +} nr_nfapi_dci_format_e; + +ypedef enum { + NR_NFAPI_UCI_FORMAT_0_0 = 0, +} nr_nfapi_dci_format_e; + +typedef enum { + NR_NFAPI_UL_CONFIG_ULSCH_PDU_TYPE = 0, + NR_NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE, + NR_NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE, + NR_NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE, + NR_NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE, + NR_NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE, + NR_NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE, + NR_NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE, + NR_NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE, + NR_NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE, + NR_NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE, + NR_NFAPI_UL_CONFIG_SRS_PDU_TYPE, + NR_NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE, + NR_NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE, + NR_NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE, + NR_NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE, + NR_NFAPI_UL_CONFIG_NULSCH_PDU_TYPE, + NR_NFAPI_UL_CONFIG_NRACH_PDU_TYPE, +} nr_nfapi_ul_config_pdu_type_e; + +typedef enum { + NR_NFAPI_HI_DCI0_HI_PDU_TYPE = 0, + NR_NFAPI_HI_DCI0_DCI_PDU_TYPE, + NR_NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE, + NR_NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE, + NR_NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE, +} nr_nfapi_hi_dci0_pdu_type_e; + +typedef enum { + NR_NFAPI_HARQ_ACK = 1, + NR_NFAPI_HARQ_NACK, + NR_NFAPI_HARQ_ACK_OR_NACK, + NR_NFAPI_HARQ_DTX, + NR_NFAPI_HARQ_ACK_OR_DTX, + NR_NFAPI_HARQ_NACK_OR_DTX, + NR_NFAPI_HARQ_ACK_OR_NACK_OR_DTX +} nr_nfapi_harq_type_e; + +typedef enum { + NR_NFAPI_CSI_REPORT_TYPE_PERIODIC = 0, + NR_NFAPI_CSI_REPORT_TYPE_APERIODIC +} nr_nfapi_csi_report_type_e; + +typedef enum { + NR_NFAPI_DL_BW_SUPPORTED_6 = 1, + NR_NFAPI_DL_BW_SUPPORTED_15 = 2, + NR_NFAPI_DL_BW_SUPPORTED_25 = 4, + NR_NFAPI_DL_BW_SUPPORTED_50 = 8, + NR_NFAPI_DL_BW_SUPPORTED_75 = 16, + NR_NFAPI_DL_BW_SUPPORTED_100 = 32 +} nr_nfapi_dl_bandwith_supported_e; + +typedef enum { + NR_NFAPI_UL_BW_SUPPORTED_6 = 1, + NR_NFAPI_UL_BW_SUPPORTED_15 = 2, + NR_NFAPI_UL_BW_SUPPORTED_25 = 4, + NR_NFAPI_UL_BW_SUPPORTED_50 = 8, + NR_NFAPI_UL_BW_SUPPORTED_75 = 16, + NR_NFAPI_UL_BW_SUPPORTED_100 = 32 +} nr_nfapi_ul_bandwith_supported_e; + +typedef enum { + NR_NFAPI_3GPP_REL_SUPPORTED_8 = 0, + NR_NFAPI_3GPP_REL_SUPPORTED_9 = 1, + NR_NFAPI_3GPP_REL_SUPPORTED_10 = 2, + NR_NFAPI_3GPP_REL_SUPPORTED_11 = 4, + NR_NFAPI_3GPP_REL_SUPPORTED_12 = 8, + NR_NFAPI_3GPP_REL_SUPPORTED_15 = 64 +} nr_nfapi_3gpp_release_supported_e; + + +typedef enum { + NR_NFAPI_DUPLEXING_MODE_TDD = 0, + NR_NFAPI_DUPLEXING_MODE_FDD = 1, + NR_NFAPI_DUPLEXING_MODE_HD_FDD = 2, +} nr_nfapi_duplexing_mode_e; + +typedef enum { + NR_NFAPI_CP_NORMAL = 0, + NR_NFAPI_CP_EXTENDED = 1 +} nr_nfapi_cyclic_prefix_type_e; + +typedef enum { + NR_NFAPI_RAT_TYPE_LTE = 0, + NR_NFAPI_RAT_TYPE_UTRAN = 1, + NR_NFAPI_RAT_TYPE_GERAN = 2, + NR_NFAPI_RAT_TYPE_NB_IOT = 3, + NR_NFAPI_RAT_TYPE_NR = 4 +} nr_nfapi_rat_type_e; + +typedef enum { + NR_NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING, + NR_NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING, + NR_NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING, + NR_NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION, + NR_NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3, + NR_NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4, + NR_NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5 +} nr_nfapi_harq_indication_tdd_ack_nackformat_e; + + +typedef enum { + NR_NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE = 0, + NR_NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE +} nr_nfapi_lbt_dl_config_pdu_type_e; + +typedef enum { + NR_NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE = 0, + NR_NFAPI_LBT_DL_RSP_DRS_PDU_TYPE +} nr_nfapi_lbt_dl_rsp_pdu_type_e; + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t length; + uint8_t value[NR_NFAPI_MAX_OPAQUE_DATA]; +} nr_nfapi_opaqaue_data_t; + +// Utility functions to turn enums into char* +const char* nr_nfapi_error_code_to_str(nr_nfapi_error_code_e value); + + +// P5 Sub Structures +typedef struct { + nr_nfapi_tl_t tl; + uint8_t nr_nfapi_sync_mode; + uint8_t location_mode; + uint16_t location_coordinates_length; + uint8_t location_coordinates[NR_NFAPI_PNF_PARAM_GENERAL_LOCATION_LENGTH]; + uint32_t dl_config_timing; + uint32_t tx_timing; + uint32_t ul_config_timing; + uint32_t hi_dci0_timing; + uint16_t maximum_number_phys; + uint16_t maximum_total_bandwidth; + uint8_t maximum_total_number_dl_layers; + uint8_t maximum_total_number_ul_layers; + uint8_t shared_bands; + uint8_t shared_pa; + int16_t maximum_total_power; + uint8_t oui[NR_NFAPI_PNF_PARAM_GENERAL_OUI_LENGTH]; +} nr_nfapi_pnf_param_general_t; +#define NR_NFAPI_PNF_PARAM_GENERAL_TAG 0x1000 + + + + + +typedef struct { + uint16_t rf_config_index; +} nr_nfapi_rf_config_info_t; + +typedef struct { + uint16_t phy_config_index; + uint16_t number_of_rfs; + nr_nfapi_rf_config_info_t rf_config[NR_NFAPI_MAX_PNF_PHY_RF_CONFIG]; + uint16_t number_of_rf_exclusions; + nr_nfapi_rf_config_info_t excluded_rf_config[NR_NFAPI_MAX_PNF_PHY_RF_CONFIG]; + uint16_t downlink_channel_bandwidth_supported; + uint16_t uplink_channel_bandwidth_supported; + uint8_t number_of_dl_layers_supported; + uint8_t number_of_ul_layers_supported; + uint16_t maximum_3gpp_release_supported; + uint8_t nmm_modes_supported; +} nr_nfapi_pnf_phy_info_t; + + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_phys; + nr_nfapi_pnf_phy_info_t phy[NR_NFAPI_MAX_PNF_PHY]; +} nr_nfapi_pnf_phy_t; +#define NR_NFAPI_PNF_PHY_TAG 0x1001 + +typedef struct { + uint16_t phy_config_index; + uint16_t transmission_mode_7_supported; + uint16_t transmission_mode_8_supported; + uint16_t two_antenna_ports_for_pucch; + uint16_t transmission_mode_9_supported; + uint16_t simultaneous_pucch_pusch; + uint16_t four_layer_tx_with_tm3_and_tm4; +} nr_nfapi_pnf_phy_rel10_info_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_phys; + nr_nfapi_pnf_phy_rel10_info_t phy[NR_NFAPI_MAX_PNF_PHY]; +} nr_nfapi_pnf_phy_rel10_t; +#define NR_NFAPI_PNF_PHY_REL10_TAG 0x100A + +typedef struct { + uint16_t phy_config_index; + uint16_t edpcch_supported; + uint16_t multi_ack_csi_reporting; + uint16_t pucch_tx_diversity; + uint16_t ul_comp_supported; + uint16_t transmission_mode_5_supported; +} nr_nfapi_pnf_phy_rel11_info_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_phys; + nr_nfapi_pnf_phy_rel11_info_t phy[NR_NFAPI_MAX_PNF_PHY]; +} nr_nfapi_pnf_phy_rel11_t; +#define NR_NFAPI_PNF_PHY_REL11_TAG 0x100B + + +typedef struct { + uint16_t phy_config_index; + uint16_t csi_subframe_set; + uint16_t enhanced_4tx_codebook; + uint16_t drs_supported; + uint16_t ul_64qam_supported; + uint16_t transmission_mode_10_supported; + uint16_t alternative_bts_indices; +} nr_nfapi_pnf_phy_rel12_info_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_phys; + nr_nfapi_pnf_phy_rel12_info_t phy[NR_NFAPI_MAX_PNF_PHY]; +} nr_nfapi_pnf_phy_rel12_t; +#define NR_NFAPI_PNF_PHY_REL12_TAG 0x100C + +typedef struct { + uint16_t phy_config_index; + uint16_t pucch_format4_supported; + uint16_t pucch_format5_supported; + uint16_t more_than_5_ca_support; + uint16_t laa_supported; + uint16_t laa_ending_in_dwpts_supported; + uint16_t laa_starting_in_second_slot_supported; + uint16_t beamforming_supported; + uint16_t csi_rs_enhancement_supported; + uint16_t drms_enhancement_supported; + uint16_t srs_enhancement_supported; +} nr_nfapi_pnf_phy_rel13_info_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_phys; + nr_nfapi_pnf_phy_rel13_info_t phy[NR_NFAPI_MAX_PNF_PHY]; +} nr_nfapi_pnf_phy_rel13_t; +#define NR_NFAPI_PNF_PHY_REL13_TAG 0x100D + +typedef struct { + uint16_t phy_config_index; + uint16_t number_of_rfs; + nr_nfapi_rf_config_info_t rf_config[NR_NFAPI_MAX_PNF_PHY_RF_CONFIG]; + uint16_t number_of_rf_exclusions; + nr_nfapi_rf_config_info_t excluded_rf_config[NR_NFAPI_MAX_PNF_PHY_RF_CONFIG]; + uint8_t number_of_dl_layers_supported; + uint8_t number_of_ul_layers_supported; + uint16_t maximum_3gpp_release_supported; + uint8_t nmm_modes_supported; +} nr_nfapi_pnf_phy_rel13_nb_iot_info_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_phys; + nr_nfapi_pnf_phy_rel13_nb_iot_info_t phy[NR_NFAPI_MAX_PNF_PHY]; +} nr_nfapi_pnf_phy_rel13_nb_iot_t; +#define NR_NFAPI_PNF_PHY_REL13_NB_IOT_TAG 0x100E + +typedef struct { + uint16_t phy_config_index; +} nr_nfapi_pnf_phy_rel15_info_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_phys; + nr_nfapi_pnf_phy_rel15_info_t phy[NR_NFAPI_MAX_PNF_PHY]; +} nr_nfapi_pnf_phy_rel15_t; +#define NR_NFAPI_PNF_PHY_REL15_TAG 0x100H + + +typedef struct { + uint16_t rf_config_index; + uint16_t band; + int16_t maximum_transmit_power; + int16_t minimum_transmit_power; + uint8_t number_of_antennas_suppported; + uint32_t minimum_downlink_frequency; + uint32_t maximum_downlink_frequency; + uint32_t minimum_uplink_frequency; + uint32_t maximum_uplink_frequency; +} nr_nfapi_pnf_rf_info_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_rfs; + nr_nfapi_pnf_rf_info_t rf[NR_NFAPI_MAX_PNF_RF]; +} nr_nfapi_pnf_rf_t; +#define NR_NFAPI_PNF_RF_TAG 0x1002 + +typedef struct { + uint16_t phy_id; + uint16_t phy_config_index; + uint16_t rf_config_index; +} nr_nfapi_phy_rf_config_info_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_phy_rf_config_info; + nr_nfapi_phy_rf_config_info_t phy_rf_config[NR_NFAPI_MAX_PHY_RF_INSTANCES]; +} nr_nfapi_pnf_phy_rf_config_t; +#define NR_NFAPI_PNF_PHY_RF_TAG 0x1003 + +// Generic strucutre for single tlv value. +typedef struct { + nr_nfapi_tl_t tl; + uint16_t value; +} nr_nfapi_uint16_tlv_t; + +typedef struct { + nr_nfapi_tl_t tl; + int16_t value; +} nr_nfapi_int16_tlv_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t value; +} nr_nfapi_uint8_tlv_t; + +typedef struct { + nr_nfapi_uint16_tlv_t phy_state; +} nr_nfapi_l1_status; + +#define NR_NFAPI_L1_STATUS_PHY_STATE_TAG 0x00FA + +typedef struct { + nr_nfapi_uint16_tlv_t dl_bandwidth_support; + nr_nfapi_uint16_tlv_t ul_bandwidth_support; + nr_nfapi_uint16_tlv_t dl_modulation_support; + nr_nfapi_uint16_tlv_t ul_modulation_support; + nr_nfapi_uint16_tlv_t phy_antenna_capability; + nr_nfapi_uint16_tlv_t release_capability; + nr_nfapi_uint16_tlv_t mbsfn_capability; +} nr_nfapi_phy_capabilities_t; + +#define NR_NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG 0x00C8 +#define NR_NFAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG 0x00C9 +#define NR_NFAPI_PHY_CAPABILITIES_DL_MODULATION_SUPPORT_TAG 0x00CA +#define NR_NFAPI_PHY_CAPABILITIES_UL_MODULATION_SUPPORT_TAG 0x00CB +#define NR_NFAPI_PHY_CAPABILITIES_PHY_ANTENNA_CAPABILITY_TAG 0x00CC +#define NR_NFAPI_PHY_CAPABILITIES_RELEASE_CAPABILITY_TAG 0x00CD +#define NR_NFAPI_PHY_CAPABILITIES_MBSFN_CAPABILITY_TAG 0x00CE + + +typedef struct { + nr_nfapi_uint16_tlv_t data_report_mode; + nr_nfapi_uint16_tlv_t sfnsf; +} nr_nfapi_l23_config_t; + + +#define NR_NFAPI_L23_CONFIG_DATA_REPORT_MODE_TAG 0x00F0 +#define NR_NFAPI_L23_CONFIG_SFNSF_TAG 0x00F1 + +typedef struct { + nr_nfapi_uint16_tlv_t numerology_index_mu; + nr_nfapi_uint16_tlv_t duplex_mode; + nr_nfapi_uint16_tlv_t pcfich_power_offset; + nr_nfapi_uint16_tlv_t pb; + nr_nfapi_uint16_tlv_t dl_cyclic_prefix_type; + nr_nfapi_uint16_tlv_t ul_cyclic_prefix_type; +} nr_nfapi_subframe_config_t; + +#define NR_NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG 0x0001 +#define NR_NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG 0x0002 +#define NR_NFAPI_SUBFRAME_CONFIG_PB_TAG 0x0003 +#define NR_NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG 0x0004 +#define NR_NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG 0x0005 +#define NR_NFAPI_SUBFRAME_CONFIG_NUMEROLOGY_INDEX_MU_TAG 0x0006 + +typedef struct { + nr_nfapi_uint16_tlv_t dl_channel_bandwidth; + nr_nfapi_uint16_tlv_t ul_channel_bandwidth; + nr_nfapi_uint16_tlv_t reference_signal_power; + nr_nfapi_uint16_tlv_t tx_antenna_ports; + nr_nfapi_uint16_tlv_t rx_antenna_ports; +} nr_nfapi_rf_config_t; + +#define NR_NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG 0x000A +#define NR_NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG 0x000B +#define NR_NFAPI_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG 0x000C +#define NR_NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG 0x000D +#define NR_NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG 0x000E + +typedef struct { + nr_nfapi_uint16_tlv_t phich_resource; + nr_nfapi_uint16_tlv_t phich_duration; + nr_nfapi_uint16_tlv_t phich_power_offset; +} nr_nfapi_phich_config_t; + +#define NR_NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG 0x0014 +#define NR_NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG 0x0015 +#define NR_NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG 0x0016 + + +typedef struct { + nr_nfapi_uint16_tlv_t primary_synchronization_signal_epre_eprers; + nr_nfapi_uint16_tlv_t secondary_synchronization_signal_epre_eprers; + nr_nfapi_uint16_tlv_t physical_cell_id; + nr_nfapi_uint16_tlv_t half_frame_index; + nr_nfapi_uint16_tlv_t ssb_subcarrier_offset; + nr_nfapi_uint16_tlv_t ssb_position_in_burst; + nr_nfapi_uint16_tlv_t ssb_periodicity; + nr_nfapi_uint16_tlv_t ss_pbch_block_power; + nr_nfapi_uint16_tlv_t n_ssb_crb; +} nr_nfapi_sch_config_t; + +#define NR_NFAPI_SCH_CONFIG_PRIMARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001E +#define NR_NFAPI_SCH_CONFIG_SECONDARY_SYNCHRONIZATION_SIGNAL_EPRE_EPRERS_TAG 0x001F +#define NR_NFAPI_SCH_CONFIG_PHYSICAL_CELL_ID_TAG 0x0020 +#define NR_NFAPI_SCH_CONFIG_HALF_FRAME_INDEX_TAG 0x0021 +#define NR_NFAPI_SCH_CONFIG_SSB_SUBCARRIER_OFFSET_TAG 0x0022 +#define NR_NFAPI_SCH_CONFIG_SSB_POSITION_IN_BURST 0x0023 +#define NR_NFAPI_SCH_CONFIG_SSB_PERIODICITY 0x0024 +#define NR_NFAPI_SCH_CONFIG_SS_PBCH_BLOCK_POWER 0x0025 +#define NR_NFAPI_SCH_CONFIG_N_SSB_CRB 0x0025 + +typedef struct { + nr_nfapi_uint16_tlv_t configuration_index; + nr_nfapi_uint16_tlv_t root_sequence_index; + nr_nfapi_uint16_tlv_t zero_correlation_zone_configuration; + nr_nfapi_uint16_tlv_t high_speed_flag; + nr_nfapi_uint16_tlv_t frequency_offset; +} nr_nfapi_prach_config_t; + +#define NR_NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG 0x0028 +#define NR_NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG 0x0029 +#define NR_NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x002A +#define NR_NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG 0x002B +#define NR_NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG 0x002C + +typedef struct { + nr_nfapi_uint16_tlv_t hopping_mode; + nr_nfapi_uint16_tlv_t hopping_offset; + nr_nfapi_uint16_tlv_t number_of_subbands; +} nr_nfapi_pusch_config_t; + +#define NR_NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG 0x0032 +#define NR_NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG 0x0033 +#define NR_NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG 0x0034 + +typedef struct { + nr_nfapi_uint16_tlv_t delta_pucch_shift; + nr_nfapi_uint16_tlv_t n_cqi_rb; + nr_nfapi_uint16_tlv_t n_an_cs; + nr_nfapi_uint16_tlv_t n1_pucch_an; +} nr_nfapi_pucch_config_t; + +#define NR_NFAPI_PUCCH_CONFIG_DELTA_PUCCH_SHIFT_TAG 0x003C +#define NR_NFAPI_PUCCH_CONFIG_N_CQI_RB_TAG 0x003D +#define NR_NFAPI_PUCCH_CONFIG_N_AN_CS_TAG 0x003E +#define NR_NFAPI_PUCCH_CONFIG_N1_PUCCH_AN_TAG 0x003F + +typedef struct { + nr_nfapi_uint16_tlv_t bandwidth_configuration; + nr_nfapi_uint16_tlv_t max_up_pts; + nr_nfapi_uint16_tlv_t srs_subframe_configuration; + nr_nfapi_uint16_tlv_t srs_acknack_srs_simultaneous_transmission; +} nr_nfapi_srs_config_t; + +#define NR_NFAPI_SRS_CONFIG_BANDWIDTH_CONFIGURATION_TAG 0x0046 +#define NR_NFAPI_SRS_CONFIG_MAX_UP_PTS_TAG 0x0047 +#define NR_NFAPI_SRS_CONFIG_SRS_SUBFRAME_CONFIGURATION_TAG 0x0048 +#define NR_NFAPI_SRS_CONFIG_SRS_ACKNACK_SRS_SIMULTANEOUS_TRANSMISSION_TAG 0x0049 + +typedef struct { + nr_nfapi_uint16_tlv_t uplink_rs_hopping; + nr_nfapi_uint16_tlv_t group_assignment; + nr_nfapi_uint16_tlv_t cyclic_shift_1_for_drms; +} nr_nfapi_uplink_reference_signal_config_t; + +#define NR_NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG 0x0050 +#define NR_NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG 0x0051 +#define NR_NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG 0x0052 + + +typedef struct { + nr_nfapi_uint16_tlv_t ed_threshold_lbt_pdsch; + nr_nfapi_uint16_tlv_t ed_threshold_lbt_drs; + nr_nfapi_uint16_tlv_t pd_threshold; + nr_nfapi_uint16_tlv_t multi_carrier_type; + nr_nfapi_uint16_tlv_t multi_carrier_tx; + nr_nfapi_uint16_tlv_t multi_carrier_freeze; + nr_nfapi_uint16_tlv_t tx_antenna_ports_drs; + nr_nfapi_uint16_tlv_t tx_power_drs; +} nr_nfapi_laa_config_t; + +#define NR_NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_PDSCH_TAG 0x0064 +#define NR_NFAPI_LAA_CONFIG_ED_THRESHOLD_FOR_LBT_FOR_DRS_TAG 0x0065 +#define NR_NFAPI_LAA_CONFIG_PD_THRESHOLD_TAG 0x0066 +#define NR_NFAPI_LAA_CONFIG_MULTI_CARRIER_TYPE_TAG 0x0067 +#define NR_NFAPI_LAA_CONFIG_MULTI_CARRIER_TX_TAG 0x0068 +#define NR_NFAPI_LAA_CONFIG_MULTI_CARRIER_FREEZE_TAG 0x0069 +#define NR_NFAPI_LAA_CONFIG_TX_ANTENNA_PORTS_FOR_DRS_TAG 0x006A +#define NR_NFAPI_LAA_CONFIG_TRANSMISSION_POWER_FOR_DRS_TAG 0x006B + +typedef struct { + + nr_nfapi_uint16_tlv_t pbch_repetitions_enable_r13; + nr_nfapi_uint16_tlv_t prach_catm_root_sequence_index; + nr_nfapi_uint16_tlv_t prach_catm_zero_correlation_zone_configuration; + nr_nfapi_uint16_tlv_t prach_catm_high_speed_flag; + nr_nfapi_uint16_tlv_t prach_ce_level_0_enable; + nr_nfapi_uint16_tlv_t prach_ce_level_0_configuration_index; + nr_nfapi_uint16_tlv_t prach_ce_level_0_frequency_offset; + nr_nfapi_uint16_tlv_t prach_ce_level_0_number_of_repetitions_per_attempt; + nr_nfapi_uint16_tlv_t prach_ce_level_0_starting_subframe_periodicity; + nr_nfapi_uint16_tlv_t prach_ce_level_0_hopping_enable; + nr_nfapi_uint16_tlv_t prach_ce_level_0_hopping_offset; + nr_nfapi_uint16_tlv_t prach_ce_level_1_enable; + nr_nfapi_uint16_tlv_t prach_ce_level_1_configuration_index; + nr_nfapi_uint16_tlv_t prach_ce_level_1_frequency_offset; + nr_nfapi_uint16_tlv_t prach_ce_level_1_number_of_repetitions_per_attempt; + nr_nfapi_uint16_tlv_t prach_ce_level_1_starting_subframe_periodicity; + nr_nfapi_uint16_tlv_t prach_ce_level_1_hopping_enable; + nr_nfapi_uint16_tlv_t prach_ce_level_1_hopping_offset; + nr_nfapi_uint16_tlv_t prach_ce_level_2_enable; + nr_nfapi_uint16_tlv_t prach_ce_level_2_configuration_index; + nr_nfapi_uint16_tlv_t prach_ce_level_2_frequency_offset; + nr_nfapi_uint16_tlv_t prach_ce_level_2_number_of_repetitions_per_attempt; + nr_nfapi_uint16_tlv_t prach_ce_level_2_starting_subframe_periodicity; + nr_nfapi_uint16_tlv_t prach_ce_level_2_hopping_enable; + nr_nfapi_uint16_tlv_t prach_ce_level_2_hopping_offset; + nr_nfapi_uint16_tlv_t prach_ce_level_3_enable; + nr_nfapi_uint16_tlv_t prach_ce_level_3_configuration_index; + nr_nfapi_uint16_tlv_t prach_ce_level_3_frequency_offset; + nr_nfapi_uint16_tlv_t prach_ce_level_3_number_of_repetitions_per_attempt; + nr_nfapi_uint16_tlv_t prach_ce_level_3_starting_subframe_periodicity; + nr_nfapi_uint16_tlv_t prach_ce_level_3_hopping_enable; + nr_nfapi_uint16_tlv_t prach_ce_level_3_hopping_offset; + nr_nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodea; + nr_nfapi_uint16_tlv_t pucch_interval_ulhoppingconfigcommonmodeb; +} nr_nfapi_emtc_config_t; + +#define NR_NFAPI_EMTC_CONFIG_PBCH_REPETITIONS_ENABLE_R13_TAG 0x0078 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CATM_ROOT_SEQUENCE_INDEX_TAG 0x0079 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CATM_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG 0x007A +#define NR_NFAPI_EMTC_CONFIG_PRACH_CATM_HIGH_SPEED_FLAG 0x007B +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_ENABLE_TAG 0x007C +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_CONFIGURATION_INDEX_TAG 0x007D +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_FREQUENCY_OFFSET_TAG 0x007E +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x007F +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_STARTING_SUBFRAME_PERIODICITY_TAG 0x0080 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_ENABLE_TAG 0x0081 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_0_HOPPING_OFFSET_TAG 0x0082 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_ENABLE_TAG 0x0083 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_CONFIGURATION_INDEX_TAG 0x0084 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_FREQUENCY_OFFSET_TAG 0x0085 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0086 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_STARTING_SUBFRAME_PERIODICITY_TAG 0x0087 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_ENABLE_TAG 0x0088 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_1_HOPPING_OFFSET_TAG 0x0089 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_ENABLE_TAG 0x008A +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_CONFIGURATION_INDEX_TAG 0x008B +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_FREQUENCY_OFFSET_TAG 0x008C +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x008D +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_STARTING_SUBFRAME_PERIODICITY_TAG 0x008E +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_ENABLE_TAG 0x008F +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_2_HOPPING_OFFSET_TAG 0x0090 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_ENABLE_TAG 0x0091 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_CONFIGURATION_INDEX_TAG 0x0092 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_FREQUENCY_OFFSET_TAG 0x0093 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x0094 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_STARTING_SUBFRAME_PERIODICITY_TAG 0x0095 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_ENABLE_TAG 0x0096 +#define NR_NFAPI_EMTC_CONFIG_PRACH_CE_LEVEL_3_HOPPING_OFFSET_TAG 0x0097 +#define NR_NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEA_TAG 0x0098 +#define NR_NFAPI_EMTC_CONFIG_PUCCH_INTERVAL_ULHOPPINGCONFIGCOMMONMODEB_TAG 0x0099 + +typedef struct { + nr_nfapi_uint16_tlv_t operating_mode; + nr_nfapi_uint16_tlv_t anchor; + nr_nfapi_uint16_tlv_t prb_index; + nr_nfapi_uint16_tlv_t control_region_size; + nr_nfapi_uint16_tlv_t assumed_crs_aps; + nr_nfapi_uint16_tlv_t nprach_config_0_enabled; + nr_nfapi_uint16_tlv_t nprach_config_0_sf_periodicity; + nr_nfapi_uint16_tlv_t nprach_config_0_start_time; + nr_nfapi_uint16_tlv_t nprach_config_0_subcarrier_offset; + nr_nfapi_uint16_tlv_t nprach_config_0_number_of_subcarriers; + nr_nfapi_uint16_tlv_t nprach_config_0_cp_length; + nr_nfapi_uint16_tlv_t nprach_config_0_number_of_repetitions_per_attempt; + nr_nfapi_uint16_tlv_t nprach_config_1_enabled; + nr_nfapi_uint16_tlv_t nprach_config_1_sf_periodicity; + nr_nfapi_uint16_tlv_t nprach_config_1_start_time; + nr_nfapi_uint16_tlv_t nprach_config_1_subcarrier_offset; + nr_nfapi_uint16_tlv_t nprach_config_1_number_of_subcarriers; + nr_nfapi_uint16_tlv_t nprach_config_1_cp_length; + nr_nfapi_uint16_tlv_t nprach_config_1_number_of_repetitions_per_attempt; + nr_nfapi_uint16_tlv_t nprach_config_2_enabled; + nr_nfapi_uint16_tlv_t nprach_config_2_sf_periodicity; + nr_nfapi_uint16_tlv_t nprach_config_2_start_time; + nr_nfapi_uint16_tlv_t nprach_config_2_subcarrier_offset; + nr_nfapi_uint16_tlv_t nprach_config_2_number_of_subcarriers; + nr_nfapi_uint16_tlv_t nprach_config_2_cp_length; + nr_nfapi_uint16_tlv_t nprach_config_2_number_of_repetitions_per_attempt; + nr_nfapi_uint16_tlv_t three_tone_base_sequence; + nr_nfapi_uint16_tlv_t six_tone_base_sequence; + nr_nfapi_uint16_tlv_t twelve_tone_base_sequence; + nr_nfapi_uint16_tlv_t three_tone_cyclic_shift; + nr_nfapi_uint16_tlv_t six_tone_cyclic_shift; + nr_nfapi_uint16_tlv_t dl_gap_config_enable; + nr_nfapi_uint16_tlv_t dl_gap_threshold; + nr_nfapi_uint16_tlv_t dl_gap_periodicity; + nr_nfapi_uint16_tlv_t dl_gap_duration_coefficient; +} nr_nfapi_nb_iot_config_t; + +#define NR_NFAPI_NB_IOT_CONFIG_OPERATING_MODE_TAG 0x00A5 +#define NR_NFAPI_NB_IOT_CONFIG_ANCHOR_TAG 0x00A6 +#define NR_NFAPI_NB_IOT_CONFIG_PRB_INDEX_TAG 0x00A7 +#define NR_NFAPI_NB_IOT_CONFIG_CONTROL_REGION_SIZE_TAG 0x00A8 +#define NR_NFAPI_NB_IOT_CONFIG_ASSUMED_CRS_APS_TAG 0x00A9 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_ENABLED_TAG 0x00AA +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SF_PERIODICITY_TAG 0x00AB +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_START_TIME_TAG 0x00AC +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_SUBCARRIER_OFFSET_TAG 0x00AD +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_SUBCARRIERS_TAG 0x00AE +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_CP_LENGTH_TAG 0x00AF +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_0_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B0 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_ENABLED_TAG 0x00B1 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SF_PERIODICITY_TAG 0x00B2 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_START_TIME_TAG 0x00B3 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_SUBCARRIER_OFFSET_TAG 0x00B4 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_SUBCARRIERS_TAG 0x00B5 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_CP_LENGTH_TAG 0x00B6 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_1_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00B7 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_ENABLED_TAG 0x00B8 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SF_PERIODICITY_TAG 0x00B9 +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_START_TIME_TAG 0x00BA +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_SUBCARRIER_OFFSET_TAG 0x00BB +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_SUBCARRIERS_TAG 0x00BC +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_CP_LENGTH_TAG 0x00BD +#define NR_NFAPI_NB_IOT_CONFIG_NPRACH_CONFIG_2_NUMBER_OF_REPETITIONS_PER_ATTEMPT_TAG 0x00BE +#define NR_NFAPI_NB_IOT_CONFIG_THREE_TONE_BASE_SEQUENCE_TAG 0x00BF +#define NR_NFAPI_NB_IOT_CONFIG_SIX_TONE_BASE_SEQUENCE_TAG 0x00C0 +#define NR_NFAPI_NB_IOT_CONFIG_TWELVE_TONE_BASE_SEQUENCE_TAG 0x00C1 +#define NR_NFAPI_NB_IOT_CONFIG_THREE_TONE_CYCLIC_SHIFT_TAG 0x00C2 +#define NR_NFAPI_NB_IOT_CONFIG_SIX_TONE_CYCLIC_SHIFT_TAG 0x00C3 +#define NR_NFAPI_NB_IOT_CONFIG_DL_GAP_CONFIG_ENABLE_TAG 0x00C4 +#define NR_NFAPI_NB_IOT_CONFIG_DL_GAP_THRESHOLD_TAG 0x00C5 +#define NR_NFAPI_NB_IOT_CONFIG_DL_GAP_PERIODICITY_TAG 0x00C6 +#define NR_NFAPI_NB_IOT_CONFIG_DL_GAP_DURATION_COEFFICIENT_TAG 0x00C7 + +typedef struct { + nr_nfapi_uint16_tlv_t laa_support; + nr_nfapi_uint16_tlv_t pd_sensing_lbt_support; + nr_nfapi_uint16_tlv_t multi_carrier_lbt_support; + nr_nfapi_uint16_tlv_t partial_sf_support; +} nr_nfapi_laa_capability_t; + +#define NR_NFAPI_LAA_CAPABILITY_LAA_SUPPORT_TAG 0x00D1 +#define NR_NFAPI_LAA_CAPABILITY_PD_SENSING_LBT_SUPPORT_TAG 0x00D2 +#define NR_NFAPI_LAA_CAPABILITY_MULTI_CARRIER_LBT_SUPPORT_TAG 0x00D3 +#define NR_NFAPI_LAA_CAPABILITY_PARTIAL_SF_SUPPORT_TAG 0x00D4 + +typedef struct { + nr_nfapi_uint16_tlv_t nb_iot_support; + nr_nfapi_uint16_tlv_t nb_iot_operating_mode_capability; +} nr_nfapi_nb_iot_capability_t; + +#define NR_NFAPI_LAA_CAPABILITY_NB_IOT_SUPPORT_TAG 0x00D5 +#define NR_NFAPI_LAA_CAPABILITY_NB_IOT_OPERATING_MODE_CAPABILITY_TAG 0x00D6 + +typedef struct { + nr_nfapi_uint16_tlv_t subframe_assignment; + nr_nfapi_uint16_tlv_t special_subframe_patterns; +} nr_nfapi_tdd_frame_structure_t; + +#define NR_NFAPI_TDD_FRAME_STRUCTURE_SUBFRAME_ASSIGNMENT_TAG 0x005A +#define NR_NFAPI_TDD_FRAME_STRUCTURE_SPECIAL_SUBFRAME_PATTERNS_TAG 0x005B + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_rf_bands; + uint16_t rf_band[NR_NFAPI_MAX_NUM_RF_BANDS]; +} nr_nfapi_rf_bands_t; +#define NR_NFAPI_PHY_RF_BANDS_TAG 0x0114 + +#define NR_NFAPI_IPV4_ADDRESS_LENGTH 4 +#define NR_NFAPI_IPV6_ADDRESS_LENGTH 16 + +// Convience enum to allow the ip addres type to be distinguished +typedef enum { + NR_NFAPI_IP_ADDRESS_IPV4 = 0, + NR_NFAPI_IP_ADDRESS_IPV6 +} nr_nfapi_ip_address_type_e; + +// The type could be infered from the length, but it is clearer in +// code to have a type variable set +typedef struct { + nr_nfapi_tl_t tl; + uint8_t type; + union { + uint8_t ipv4_address[NR_NFAPI_IPV4_ADDRESS_LENGTH]; + uint8_t ipv6_address[NR_NFAPI_IPV6_ADDRESS_LENGTH]; + } u; +} nr_nfapi_ip_address_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t address[NR_NFAPI_IPV4_ADDRESS_LENGTH]; +} nr_nfapi_ipv4_address_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t address[NR_NFAPI_IPV6_ADDRESS_LENGTH]; +} nr_nfapi_ipv6_address_t; + + + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_rf_bands; + uint16_t bands[NR_NFAPI_MAX_NMM_FREQUENCY_BANDS]; +} nr_nfapi_nmm_frequency_bands_t; + +//These TLVs are used exclusively by nFAPI +typedef struct +{ + // These TLVs are used to setup the transport connection between VNF and PNF + nr_nfapi_ipv4_address_t p7_vnf_address_ipv4; + nr_nfapi_ipv6_address_t p7_vnf_address_ipv6; + nr_nfapi_uint16_tlv_t p7_vnf_port; + + nr_nfapi_ipv4_address_t p7_pnf_address_ipv4; + nr_nfapi_ipv6_address_t p7_pnf_address_ipv6; + nr_nfapi_uint16_tlv_t p7_pnf_port; + + // These TLVs are used to setup the transport connection between VNF and PNF + nr_nfapi_uint8_tlv_t dl_ue_per_sf; + nr_nfapi_uint8_tlv_t ul_ue_per_sf; + + // These TLVs are used by PNF to report its RF capabilities to the VNF software + nr_nfapi_rf_bands_t rf_bands; + + // These TLVs are used by the VNF to configure the synchronization with the PNF. + nr_nfapi_uint8_tlv_t timing_window; + nr_nfapi_uint8_tlv_t timing_info_mode; + nr_nfapi_uint8_tlv_t timing_info_period; + + // These TLVs are used by the VNF to configure the RF in the PNF + nr_nfapi_uint16_tlv_t max_transmit_power; + nr_nfapi_uint16_tlv_t earfcn; + + nr_nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands; + nr_nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands; + nr_nfapi_nmm_frequency_bands_t nmm_lte_frequency_bands; + nr_nfapi_uint8_tlv_t nmm_uplink_rssi_supported; + +} nr_nfapi_nfapi_t; + +#define NR_NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG 0x0100 +#define NR_NFAPI_NFAPI_P7_VNF_ADDRESS_IPV6_TAG 0x0101 +#define NR_NFAPI_NFAPI_P7_VNF_PORT_TAG 0x0102 +#define NR_NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG 0x0103 +#define NR_NFAPI_NFAPI_P7_PNF_ADDRESS_IPV6_TAG 0x0104 +#define NR_NFAPI_NFAPI_P7_PNF_PORT_TAG 0x0105 + +#define NR_NFAPI_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG 0x010A +#define NR_NFAPI_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG 0x010B +#define NR_NFAPI_NFAPI_RF_BANDS_TAG 0x0114 +#define NR_NFAPI_NFAPI_TIMING_WINDOW_TAG 0x011E +#define NR_NFAPI_NFAPI_TIMING_INFO_MODE_TAG 0x011F +#define NR_NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG 0x0120 +#define NR_NFAPI_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG 0x0128 +#define NR_NFAPI_NFAPI_EARFCN_TAG 0x0129 +#define NR_NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG 0x0130 +#define NR_NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG 0x0131 +#define NR_NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG 0x0132 +#define NR_NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG 0x0133 + + +// P5 Message Structures +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_pnf_param_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_pnf_param_general_t pnf_param_general; + nr_nfapi_pnf_phy_t pnf_phy; + nr_nfapi_pnf_rf_t pnf_rf; + nr_nfapi_pnf_phy_rel10_t pnf_phy_rel10; + nr_nfapi_pnf_phy_rel11_t pnf_phy_rel11; + nr_nfapi_pnf_phy_rel12_t pnf_phy_rel12; + nr_nfapi_pnf_phy_rel13_t pnf_phy_rel13; + nr_nfapi_pnf_phy_rel13_nb_iot_t pnf_phy_rel13_nb_iot; + nr_nfapi_pnf_phy_rel15_t pnf_phy_rel15; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_pnf_param_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + nr_nfapi_pnf_phy_rf_config_t pnf_phy_rf_config; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_pnf_config_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_pnf_config_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_pnf_start_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_pnf_start_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_pnf_stop_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_pnf_stop_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_param_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint8_t error_code; + uint8_t num_tlv; + // fdd or tdd in idle or configured tlvs + nr_nfapi_l1_status l1_status; + nr_nfapi_phy_capabilities_t phy_capabilities; + nr_nfapi_laa_capability_t laa_capability; + nr_nfapi_nb_iot_capability_t nb_iot_capability; + + nr_nfapi_subframe_config_t subframe_config; + nr_nfapi_rf_config_t rf_config; + nr_nfapi_phich_config_t phich_config; + nr_nfapi_sch_config_t sch_config; + nr_nfapi_prach_config_t prach_config; + nr_nfapi_pusch_config_t pusch_config; + nr_nfapi_pucch_config_t pucch_config; + nr_nfapi_srs_config_t srs_config; + nr_nfapi_uplink_reference_signal_config_t uplink_reference_signal_config; + nr_nfapi_tdd_frame_structure_t tdd_frame_structure_config; + nr_nfapi_l23_config_t l23_config; + nr_nfapi_nb_iot_config_t nb_iot_config; + + // addition nfapi tlvs as per table 2-16 in idle or configure + nr_nfapi_nfapi_t nr_nfapi_config; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_param_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint8_t num_tlv; + nr_nfapi_subframe_config_t subframe_config; + nr_nfapi_rf_config_t rf_config; + nr_nfapi_phich_config_t phich_config; + nr_nfapi_sch_config_t sch_config; + nr_nfapi_prach_config_t prach_config; + nr_nfapi_pusch_config_t pusch_config; + nr_nfapi_pucch_config_t pucch_config; + nr_nfapi_srs_config_t srs_config; + nr_nfapi_uplink_reference_signal_config_t uplink_reference_signal_config; + nr_nfapi_laa_config_t laa_config; + nr_nfapi_emtc_config_t emtc_config; + nr_nfapi_tdd_frame_structure_t tdd_frame_structure_config; + nr_nfapi_l23_config_t l23_config; + nr_nfapi_nb_iot_config_t nb_iot_config; + + // addition nfapi tlvs as per table 2-16 in idle or configure + nr_nfapi_nfapi_t nr_nfapi_config; + + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_config_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_config_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_start_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_start_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_stop_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_stop_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + nr_nfapi_uint16_tlv_t dl_rs_tx_power; + nr_nfapi_uint16_tlv_t received_interference_power; + nr_nfapi_uint16_tlv_t thermal_noise_power; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_measurement_request_t; + +#define NR_NFAPI_MEASUREMENT_REQUEST_DL_RS_XTX_POWER_TAG 0x1004 +#define NR_NFAPI_MEASUREMENT_REQUEST_RECEIVED_INTERFERENCE_POWER_TAG 0x1005 +#define NR_NFAPI_MEASUREMENT_REQUEST_THERMAL_NOISE_POWER_TAG 0x1006 + + + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_resource_blocks; + int16_t received_interference_power[NR_NFAPI_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS]; +} nr_nfapi_received_interference_power_measurement_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_int16_tlv_t dl_rs_tx_power_measurement; + nr_nfapi_received_interference_power_measurement_t received_interference_power_measurement; + nr_nfapi_int16_tlv_t thermal_noise_power_measurement; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_measurement_response_t; + +#define NR_NFAPI_MEASUREMENT_RESPONSE_DL_RS_POWER_MEASUREMENT_TAG 0x1007 +#define NR_NFAPI_MEASUREMENT_RESPONSE_RECEIVED_INTERFERENCE_POWER_MEASUREMENT_TAG 0x1008 +#define NR_NFAPI_MEASUREMENT_RESPONSE_THERMAL_NOISE_MEASUREMENT_TAG 0x1009 + +// P7 Sub Structures +typedef struct { + nr_nfapi_tl_t tl; + uint8_t dci_format; + uint8_t cce_idx; + uint8_t aggregation_level; + uint16_t rnti; + uint8_t resource_allocation_type; + uint8_t virtual_resource_block_assignment_flag; + uint32_t resource_block_coding; + uint8_t mcs_1; + uint8_t redundancy_version_1; + uint8_t new_data_indicator_1; + uint8_t transport_block_to_codeword_swap_flag; + uint8_t mcs_2; + uint8_t redundancy_version_2; + uint8_t new_data_indicator_2; + uint8_t harq_process; + uint8_t tpmi; + uint8_t pmi; + uint8_t precoding_information; + uint8_t tpc; + uint8_t downlink_assignment_index; + uint8_t ngap; + uint8_t transport_block_size_index; + uint8_t downlink_power_offset; + uint8_t allocate_prach_flag; + uint8_t preamble_index; + uint8_t prach_mask_index; + uint8_t rnti_type; + uint16_t transmission_power; +} nr_nfapi_dl_config_dci_dl_pdu_rel8_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG 0x2001 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t mcch_flag; + uint8_t mcch_change_notification; + uint8_t scrambling_identity; +} nr_nfapi_dl_config_dci_dl_pdu_rel9_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG 0x2002 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t cross_carrier_scheduling_flag; + uint8_t carrier_indicator; + uint8_t srs_flag; + uint8_t srs_request; + uint8_t antenna_ports_scrambling_and_layers; + uint8_t total_dci_length_including_padding; + uint8_t n_dl_rb; +} nr_nfapi_dl_config_dci_dl_pdu_rel10_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG 0x2003 + + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t harq_ack_resource_offset; + uint8_t pdsch_re_mapping_quasi_co_location_indicator; +} nr_nfapi_dl_config_dci_dl_pdu_rel11_t; + +#define NR_NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG 0x2039 + + + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t primary_cell_type; + uint8_t ul_dl_configuration_flag; + uint8_t number_ul_dl_configurations; + uint8_t ul_dl_configuration_indication[NR_NFAPI_MAX_UL_DL_CONFIGURATIONS]; +} nr_nfapi_dl_config_dci_dl_pdu_rel12_t; + +#define NR_NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG 0x203a + + + +typedef struct { + uint8_t subband_index; + uint8_t scheduled_ues; + uint16_t precoding_value[NR_NFAPI_MAX_NUM_PHYSICAL_ANTENNAS][NR_NFAPI_MAX_NUM_SCHEDULED_UES]; +} nr_nfapi_dl_config_dci_dl_tpm_subband_info_t; + +typedef struct { + uint8_t num_prb_per_subband; + uint8_t number_of_subbands; + uint8_t num_antennas; + nr_nfapi_dl_config_dci_dl_tpm_subband_info_t subband_info[NR_NFAPI_MAX_NUM_SUBBANDS]; +} nr_nfapi_dl_config_dci_dl_tpm_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t laa_end_partial_sf_flag; + uint8_t laa_end_partial_sf_configuration; + uint8_t initial_lbt_sf; + uint8_t codebook_size_determination; + uint8_t drms_table_flag; + uint8_t tpm_struct_flag; + nr_nfapi_dl_config_dci_dl_tpm_t tpm; +} nr_nfapi_dl_config_dci_dl_pdu_rel13_t; + +#define NR_NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG 0x203b + +typedef struct { + nr_nfapi_dl_config_dci_dl_pdu_rel8_t dci_dl_pdu_rel8; + nr_nfapi_dl_config_dci_dl_pdu_rel9_t dci_dl_pdu_rel9; + nr_nfapi_dl_config_dci_dl_pdu_rel10_t dci_dl_pdu_rel10; + nr_nfapi_dl_config_dci_dl_pdu_rel11_t dci_dl_pdu_rel11; + nr_nfapi_dl_config_dci_dl_pdu_rel12_t dci_dl_pdu_rel12; + nr_nfapi_dl_config_dci_dl_pdu_rel13_t dci_dl_pdu_rel13; +} nr_nfapi_dl_config_dci_dl_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t transmission_power; +} nr_nfapi_dl_config_bch_pdu_rel8_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG 0x2004 + +typedef struct { + nr_nfapi_dl_config_bch_pdu_rel8_t bch_pdu_rel8; +} nr_nfapi_dl_config_bch_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t rnti; + uint8_t resource_allocation_type; + uint32_t resource_block_coding; + uint8_t modulation; + uint16_t transmission_power; + uint16_t mbsfn_area_id; +} nr_nfapi_dl_config_mch_pdu_rel8_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG 0x2005 + +typedef struct { + nr_nfapi_dl_config_mch_pdu_rel8_t mch_pdu_rel8; +} nr_nfapi_dl_config_mch_pdu; + + +typedef struct { + uint8_t subband_index; + uint8_t num_antennas; + uint16_t bf_value[NR_NFAPI_MAX_NUM_ANTENNAS]; +} nr_nfapi_bf_vector_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t rnti; + uint8_t resource_allocation_type; + uint8_t virtual_resource_block_assignment_flag; + uint32_t resource_block_coding; + uint8_t modulation; + uint8_t redundancy_version; + uint8_t transport_blocks; + uint8_t transport_block_to_codeword_swap_flag; + uint8_t transmission_scheme; + uint8_t number_of_layers; + uint8_t number_of_subbands; + uint8_t codebook_index[NR_NFAPI_MAX_NUM_SUBBANDS]; + uint8_t ue_category_capacity; + uint8_t pa; + uint8_t delta_power_offset_index; + uint8_t ngap; + uint8_t nprb; + uint8_t transmission_mode; + uint8_t num_bf_prb_per_subband; + uint8_t num_bf_vector; + nr_nfapi_bf_vector_t bf_vector[NR_NFAPI_MAX_BF_VECTORS]; +} nr_nfapi_dl_config_dlsch_pdu_rel8_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG 0x2006 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t nscid; +} nr_nfapi_dl_config_dlsch_pdu_rel9_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG 0x2007 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t csi_rs_flag; + uint8_t csi_rs_resource_config_r10; + uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10; + uint8_t csi_rs_number_nzp_configuration; + uint8_t csi_rs_resource_config[NR_NFAPI_MAX_CSI_RS_RESOURCE_CONFIG]; + uint8_t pdsch_start; +} nr_nfapi_dl_config_dlsch_pdu_rel10_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG 0x2008 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t drms_config_flag; + uint16_t drms_scrambling; + uint8_t csi_config_flag; + uint16_t csi_scrambling; + uint8_t pdsch_re_mapping_flag; + uint8_t pdsch_re_mapping_atenna_ports; + uint8_t pdsch_re_mapping_freq_shift; +} nr_nfapi_dl_config_dlsch_pdu_rel11_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG 0x203C + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t altcqi_table_r12; + uint8_t maxlayers; + uint8_t n_dl_harq; +} nr_nfapi_dl_config_dlsch_pdu_rel12_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG 0x203D + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t dwpts_symbols; + uint8_t initial_lbt_sf; + uint8_t ue_type; + uint8_t pdsch_payload_type; + uint16_t initial_transmission_sf_io; + uint8_t drms_table_flag; +} nr_nfapi_dl_config_dlsch_pdu_rel13_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG 0x203E + +typedef struct { + nr_nfapi_dl_config_dlsch_pdu_rel8_t dlsch_pdu_rel8; + nr_nfapi_dl_config_dlsch_pdu_rel9_t dlsch_pdu_rel9; + nr_nfapi_dl_config_dlsch_pdu_rel10_t dlsch_pdu_rel10; + nr_nfapi_dl_config_dlsch_pdu_rel11_t dlsch_pdu_rel11; + nr_nfapi_dl_config_dlsch_pdu_rel12_t dlsch_pdu_rel12; + nr_nfapi_dl_config_dlsch_pdu_rel13_t dlsch_pdu_rel13; +} nr_nfapi_dl_config_dlsch_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t p_rnti; + uint8_t resource_allocation_type; + uint8_t virtual_resource_block_assignment_flag; + uint32_t resource_block_coding; + uint8_t mcs; + uint8_t redundancy_version; + uint8_t number_of_transport_blocks; + uint8_t transport_block_to_codeword_swap_flag; + uint8_t transmission_scheme; + uint8_t number_of_layers; + uint8_t codebook_index; + uint8_t ue_category_capacity; + uint8_t pa; + uint16_t transmission_power; + uint8_t nprb; + uint8_t ngap; +} nr_nfapi_dl_config_pch_pdu_rel8_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG 0x2009 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t ue_mode; + uint16_t initial_transmission_sf_io; +} nr_nfapi_dl_config_pch_pdu_rel13_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG 0x203F + +typedef struct { + nr_nfapi_dl_config_pch_pdu_rel8_t pch_pdu_rel8; + nr_nfapi_dl_config_pch_pdu_rel13_t pch_pdu_rel13; +} nr_nfapi_dl_config_pch_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t transmission_power; + uint8_t prs_bandwidth; + uint8_t prs_cyclic_prefix_type; + uint8_t prs_muting; +} nr_nfapi_dl_config_prs_pdu_rel9_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG 0x200A + +typedef struct { + nr_nfapi_dl_config_prs_pdu_rel9_t prs_pdu_rel9; +} nr_nfapi_dl_config_prs_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t csi_rs_antenna_port_count_r10; + uint8_t csi_rs_resource_config_r10; + uint16_t transmission_power; + uint16_t csi_rs_zero_tx_power_resource_config_bitmap_r10; + uint8_t csi_rs_number_of_nzp_configuration; + uint8_t csi_rs_resource_config[NR_NFAPI_MAX_CSI_RS_RESOURCE_CONFIG]; +} nr_nfapi_dl_config_csi_rs_pdu_rel10_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG 0x200B + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t csi_rs_class; + uint8_t cdm_type; + uint8_t num_bf_vector; + struct { + uint8_t csi_rs_resource_index; + uint16_t bf_value[NR_NFAPI_MAX_ANTENNA_PORT_COUNT]; + } bf_vector[NR_NFAPI_MAX_BF_VECTORS]; + +} nr_nfapi_dl_config_csi_rs_pdu_rel13_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG 0x2040 + +typedef struct { + nr_nfapi_dl_config_csi_rs_pdu_rel10_t csi_rs_pdu_rel10; + nr_nfapi_dl_config_csi_rs_pdu_rel13_t csi_rs_pdu_rel13; +} nr_nfapi_dl_config_csi_rs_pdu; + +#define NR_NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG 0x2001 +#define NR_NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG 0x2002 +#define NR_NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG 0x2003 +#define NR_NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG 0x2039 +#define NR_NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG 0x203a +#define NR_NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG 0x203b + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t epdcch_resource_assignment_flag; + uint16_t epdcch_id; + uint8_t epdcch_start_symbol; + uint8_t epdcch_num_prb; + uint8_t epdcch_prb_index[NR_NFAPI_MAX_EPDCCH_PRB]; + nr_nfapi_bf_vector_t bf_vector; +} nr_nfapi_dl_config_epdcch_parameters_rel11_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG 0x2041 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t dwpts_symbols; + uint8_t initial_lbt_sf; +} nr_nfapi_dl_config_epdcch_parameters_rel13_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG 0x2042 + +typedef struct { + nr_nfapi_dl_config_dci_dl_pdu_rel8_t epdcch_pdu_rel8; + nr_nfapi_dl_config_dci_dl_pdu_rel9_t epdcch_pdu_rel9; + nr_nfapi_dl_config_dci_dl_pdu_rel10_t epdcch_pdu_rel10; + nr_nfapi_dl_config_dci_dl_pdu_rel11_t epdcch_pdu_rel11; + nr_nfapi_dl_config_dci_dl_pdu_rel12_t epdcch_pdu_rel12; + nr_nfapi_dl_config_dci_dl_pdu_rel13_t epdcch_pdu_rel13; + nr_nfapi_dl_config_epdcch_parameters_rel11_t epdcch_params_rel11; + nr_nfapi_dl_config_epdcch_parameters_rel13_t epdcch_params_rel13; +} nr_nfapi_dl_config_epdcch_pdu; + + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t mpdcch_narrow_band; + uint8_t number_of_prb_pairs; + uint8_t resource_block_assignment; + uint8_t mpdcch_tansmission_type; + uint8_t start_symbol; + uint8_t ecce_index; + uint8_t aggregation_level; + uint8_t rnti_type; + uint16_t rnti; + uint8_t ce_mode; + uint16_t drms_scrambling_init; + uint16_t initial_transmission_sf_io; + uint16_t transmission_power; + uint8_t dci_format; + uint16_t resource_block_coding; + uint8_t mcs; + uint8_t pdsch_reptition_levels; + uint8_t redundancy_version; + uint8_t new_data_indicator; + uint8_t harq_process; + uint8_t tpmi_length; + uint8_t tpmi; + uint8_t pmi_flag; + uint8_t pmi; + uint8_t harq_resource_offset; + uint8_t dci_subframe_repetition_number; + uint8_t tpc; + uint8_t downlink_assignment_index_length; + uint8_t downlink_assignment_index; + uint8_t allocate_prach_flag; + uint8_t preamble_index; + uint8_t prach_mask_index; + uint8_t starting_ce_level; + uint8_t srs_request; + uint8_t antenna_ports_and_scrambling_identity_flag; + uint8_t antenna_ports_and_scrambling_identity; + uint8_t frequency_hopping_enabled_flag; + uint8_t paging_direct_indication_differentiation_flag; + uint8_t direct_indication; + uint8_t total_dci_length_including_padding; + uint8_t number_of_tx_antenna_ports; + uint16_t precoding_value[NR_NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS]; +} nr_nfapi_dl_config_mpdcch_pdu_rel13_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG 0x205B + + +typedef struct { + nr_nfapi_dl_config_mpdcch_pdu_rel13_t mpdcch_pdu_rel13; +} nr_nfapi_dl_config_mpdcch_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t transmission_power; + uint16_t hyper_sfn_2_lsbs; +} nr_nfapi_dl_config_nbch_pdu_rel13_t; + +#define NR_NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG 0x205C + +typedef struct { + nr_nfapi_dl_config_nbch_pdu_rel13_t nbch_pdu_rel13; +} nr_nfapi_dl_config_nbch_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint8_t ncce_index; + uint8_t aggregation_level; + uint8_t start_symbol; + uint8_t rnti_type; + uint16_t rnti; + uint8_t scrambling_reinitialization_batch_index; + uint8_t nrs_antenna_ports_assumed_by_the_ue; + uint8_t dci_format; + uint8_t scheduling_delay; + uint8_t resource_assignment; + uint8_t repetition_number; + uint8_t mcs; + uint8_t new_data_indicator; + uint8_t harq_ack_resource; + uint8_t npdcch_order_indication; + uint8_t starting_number_of_nprach_repetitions; + uint8_t subcarrier_indication_of_nprach; + uint8_t paging_direct_indication_differentation_flag; + uint8_t direct_indication; + uint8_t dci_subframe_repetition_number; + uint8_t total_dci_length_including_padding; +} nr_nfapi_dl_config_npdcch_pdu_rel13_t; + +#define NR_NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG 0x205D + +typedef struct { + nr_nfapi_dl_config_npdcch_pdu_rel13_t npdcch_pdu_rel13; +} nr_nfapi_dl_config_npdcch_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint8_t start_symbol; + uint8_t rnti_type; + uint16_t rnti; + uint16_t resource_assignment; + uint16_t repetition_number; + uint8_t modulation; + uint8_t number_of_subframes_for_resource_assignment; + uint8_t scrambling_sequence_initialization_cinit; + uint16_t sf_idx; + uint8_t nrs_antenna_ports_assumed_by_the_ue; +} nr_nfapi_dl_config_ndlsch_pdu_rel13_t; + +#define NR_NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG 0x205E + +typedef struct { + nr_nfapi_dl_config_ndlsch_pdu_rel13_t ndlsch_pdu_rel13; +} nr_nfapi_dl_config_ndlsch_pdu; + + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nr_nfapi_dl_config_dci_dl_pdu dci_dl_pdu; + nr_nfapi_dl_config_bch_pdu bch_pdu; + nr_nfapi_dl_config_mch_pdu mch_pdu; + nr_nfapi_dl_config_dlsch_pdu dlsch_pdu; + nr_nfapi_dl_config_pch_pdu pch_pdu; + nr_nfapi_dl_config_prs_pdu prs_pdu; + nr_nfapi_dl_config_csi_rs_pdu csi_rs_pdu; + nr_nfapi_dl_config_epdcch_pdu epdcch_pdu; + nr_nfapi_dl_config_mpdcch_pdu mpdcch_pdu; + nr_nfapi_dl_config_nbch_pdu nbch_pdu; + nr_nfapi_dl_config_npdcch_pdu npdcch_pdu; + nr_nfapi_dl_config_ndlsch_pdu ndlsch_pdu; + }; +} nr_nfapi_dl_config_request_pdu_t; + +#define NR_NFAPI_DL_CONFIG_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + nr_nfapi_dl_config_request_pdu_t dl_config_pdu_list; +} nr_nfapi_dl_config_request_body_t; +#define NR_NFAPI_DL_CONFIG_REQUEST_BODY_TAG 0x2000 + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t handle; + uint16_t size; + uint16_t rnti; + uint8_t resource_block_start; + uint8_t number_of_resource_blocks; + uint8_t modulation_type; + uint8_t cyclic_shift_2_for_drms; + uint8_t frequency_hopping_enabled_flag; + uint8_t frequency_hopping_bits; + uint8_t new_data_indication; + uint8_t redundancy_version; + uint8_t harq_process_number; + uint8_t ul_tx_mode; + uint8_t current_tx_nb; + uint8_t n_srs; +} nr_nfapi_ul_config_ulsch_pdu_rel8_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG 0x200D + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t resource_allocation_type; + uint32_t resource_block_coding; + uint8_t transport_blocks; + uint8_t transmission_scheme; + uint8_t number_of_layers; + uint8_t codebook_index; + uint8_t disable_sequence_hopping_flag; +} nr_nfapi_ul_config_ulsch_pdu_rel10_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG 0x200E + + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t virtual_cell_id_enabled_flag; + uint16_t npusch_identity; + uint8_t dmrs_config_flag; + uint16_t ndmrs_csh_identity; +} nr_nfapi_ul_config_ulsch_pdu_rel11_t; + +#define NR_NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG 0x2043 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t ue_type; + uint16_t total_number_of_repetitions; + uint16_t repetition_number; + uint16_t initial_transmission_sf_io; + uint8_t empty_symbols_due_to_re_tunning; +} nr_nfapi_ul_config_ulsch_pdu_rel13_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG 0x2044 + +typedef struct { + nr_nfapi_ul_config_ulsch_pdu_rel8_t ulsch_pdu_rel8; + nr_nfapi_ul_config_ulsch_pdu_rel10_t ulsch_pdu_rel10; + nr_nfapi_ul_config_ulsch_pdu_rel11_t ulsch_pdu_rel11; + nr_nfapi_ul_config_ulsch_pdu_rel13_t ulsch_pdu_rel13; +} nr_nfapi_ul_config_ulsch_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t dl_cqi_pmi_size_rank_1; + uint8_t dl_cqi_pmi_size_rank_greater_1; + uint8_t ri_size; + uint8_t delta_offset_cqi; + uint8_t delta_offset_ri; +} nr_nfapi_ul_config_cqi_ri_information_rel8_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG 0x2010 + +typedef struct { + uint8_t dl_cqi_pmi_ri_size; + uint8_t control_type; +} nr_nfapi_ul_config_periodic_cqi_pmi_ri_report_t; + +typedef struct { + uint8_t number_of_cc; + struct { + uint8_t ri_size; + uint8_t dl_cqi_pmi_size[8]; + } cc[NR_NFAPI_MAX_CC]; +} nr_nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t report_type; + uint8_t delta_offset_cqi; + uint8_t delta_offset_ri; + union { + nr_nfapi_ul_config_periodic_cqi_pmi_ri_report_t periodic_cqi_pmi_ri_report; + nr_nfapi_ul_config_aperiodic_cqi_pmi_ri_report_t aperiodic_cqi_pmi_ri_report; + }; +} nr_nfapi_ul_config_cqi_ri_information_rel9_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG 0x2011 + +typedef struct { + uint16_t dl_cqi_pmi_ri_size_2; +} nr_nfapi_ul_config_periodic_cqi_pmi_ri_report_re13_t; + +typedef struct { +} nr_nfapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t report_type; // Convience parameter, not sent on the wire + union { + nr_nfapi_ul_config_periodic_cqi_pmi_ri_report_re13_t periodic_cqi_pmi_ri_report; + nr_nfapi_ul_config_aperiodic_cqi_pmi_ri_report_re13_t aperiodic_cqi_pmi_ri_report; + }; +} nr_nfapi_ul_config_cqi_ri_information_rel13_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG 0x2045 + +typedef struct { + nr_nfapi_ul_config_cqi_ri_information_rel8_t cqi_ri_information_rel8; + nr_nfapi_ul_config_cqi_ri_information_rel9_t cqi_ri_information_rel9; + nr_nfapi_ul_config_cqi_ri_information_rel13_t cqi_ri_information_rel13; +} nr_nfapi_ul_config_cqi_ri_information; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t harq_size; + uint8_t delta_offset_harq; + uint8_t ack_nack_mode; +} nr_nfapi_ul_config_ulsch_harq_information_rel10_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG 0x2012 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t harq_size_2; + uint8_t delta_offset_harq_2; +} nr_nfapi_ul_config_ulsch_harq_information_rel13_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG 0x2046 + +typedef struct { + nr_nfapi_ul_config_ulsch_harq_information_rel10_t harq_information_rel10; + nr_nfapi_ul_config_ulsch_harq_information_rel13_t harq_information_rel13; +} nr_nfapi_ul_config_ulsch_harq_information; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t n_srs_initial; + uint8_t initial_number_of_resource_blocks; +} nr_nfapi_ul_config_initial_transmission_parameters_rel8_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG 0x200F + +typedef struct { + nr_nfapi_ul_config_initial_transmission_parameters_rel8_t initial_transmission_parameters_rel8; +} nr_nfapi_ul_config_initial_transmission_parameters; + +typedef struct { + nr_nfapi_ul_config_ulsch_pdu ulsch_pdu; + nr_nfapi_ul_config_cqi_ri_information cqi_ri_information; + nr_nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters; +} nr_nfapi_ul_config_ulsch_cqi_ri_pdu; + +typedef struct { + nr_nfapi_ul_config_ulsch_pdu ulsch_pdu; + nr_nfapi_ul_config_ulsch_harq_information harq_information; + nr_nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters; +} nr_nfapi_ul_config_ulsch_harq_pdu; + +typedef struct { + nr_nfapi_ul_config_ulsch_pdu ulsch_pdu; + nr_nfapi_ul_config_cqi_ri_information cqi_ri_information; + nr_nfapi_ul_config_ulsch_harq_information harq_information; + nr_nfapi_ul_config_initial_transmission_parameters initial_transmission_parameters; +} nr_nfapi_ul_config_ulsch_cqi_harq_ri_pdu; + + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t handle; + uint16_t rnti; +} nr_nfapi_ul_config_ue_information_rel8_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG 0x2013 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t virtual_cell_id_enabled_flag; + uint16_t npusch_identity; +} nr_nfapi_ul_config_ue_information_rel11_t; + +#define NR_NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG 0x2047 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t ue_type; + uint8_t empty_symbols; + uint16_t total_number_of_repetitions; + uint16_t repetition_number; +} nr_nfapi_ul_config_ue_information_rel13_t; + +#define NR_NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG 0x2048 + +typedef struct { + nr_nfapi_ul_config_ue_information_rel8_t ue_information_rel8; + nr_nfapi_ul_config_ue_information_rel11_t ue_information_rel11; + nr_nfapi_ul_config_ue_information_rel13_t ue_information_rel13; +} nr_nfapi_ul_config_ue_information; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t pucch_index; + uint8_t dl_cqi_pmi_size; +} nr_nfapi_ul_config_cqi_information_rel8_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG 0x2014 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t number_of_pucch_resource; + uint16_t pucch_index_p1; +} nr_nfapi_ul_config_cqi_information_rel10_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG 0x2015 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t csi_mode; + uint16_t dl_cqi_pmi_size_2; + uint8_t starting_prb; + uint8_t n_prb; + uint8_t cdm_index; + uint8_t n_srs; +} nr_nfapi_ul_config_cqi_information_rel13_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG 0x2049 + +typedef struct { + nr_nfapi_ul_config_cqi_information_rel8_t cqi_information_rel8; + nr_nfapi_ul_config_cqi_information_rel10_t cqi_information_rel10; + nr_nfapi_ul_config_cqi_information_rel13_t cqi_information_rel13; +} nr_nfapi_ul_config_cqi_information; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t pucch_index; +} nr_nfapi_ul_config_sr_information_rel8_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG 0x2016 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t number_of_pucch_resources; + uint16_t pucch_index_p1; +} nr_nfapi_ul_config_sr_information_rel10_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG 0x2017 + +typedef struct { + nr_nfapi_ul_config_sr_information_rel8_t sr_information_rel8; + nr_nfapi_ul_config_sr_information_rel10_t sr_information_rel10; +} nr_nfapi_ul_config_sr_information; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t harq_size; + uint8_t ack_nack_mode; + uint8_t number_of_pucch_resources; + uint16_t n_pucch_1_0; + uint16_t n_pucch_1_1; + uint16_t n_pucch_1_2; + uint16_t n_pucch_1_3; +} nr_nfapi_ul_config_harq_information_rel10_tdd_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG 0x2018 + + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t n_pucch_1_0; + uint8_t harq_size; +} nr_nfapi_ul_config_harq_information_rel8_fdd_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG 0x2019 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t harq_size; + uint8_t ack_nack_mode; + uint8_t number_of_pucch_resources; + uint16_t n_pucch_1_0; + uint16_t n_pucch_1_1; + uint16_t n_pucch_1_2; + uint16_t n_pucch_1_3; +} nr_nfapi_ul_config_harq_information_rel9_fdd_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG 0x201a + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t num_ant_ports; + uint16_t n_pucch_2_0; + uint16_t n_pucch_2_1; + uint16_t n_pucch_2_2; + uint16_t n_pucch_2_3; +} nr_nfapi_ul_config_harq_information_rel11_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG 0x204A + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t harq_size_2; + uint8_t starting_prb; + uint8_t n_prb; + uint8_t cdm_index; + uint8_t n_srs; +} nr_nfapi_ul_config_harq_information_rel13_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG 0x204B + +typedef struct { + nr_nfapi_ul_config_harq_information_rel10_tdd_t harq_information_rel10_tdd; + nr_nfapi_ul_config_harq_information_rel8_fdd_t harq_information_rel8_fdd; + nr_nfapi_ul_config_harq_information_rel9_fdd_t harq_information_rel9_fdd; + nr_nfapi_ul_config_harq_information_rel11_t harq_information_rel11; + nr_nfapi_ul_config_harq_information_rel13_t harq_information_rel13; +} nr_nfapi_ul_config_harq_information; + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t handle; + uint16_t size; + uint16_t rnti; + uint8_t srs_bandwidth; + uint8_t frequency_domain_position; + uint8_t srs_hopping_bandwidth; + uint8_t transmission_comb; + uint16_t i_srs; + uint8_t sounding_reference_cyclic_shift; +} nr_nfapi_ul_config_srs_pdu_rel8_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG 0x201b + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t antenna_port; +} nr_nfapi_ul_config_srs_pdu_rel10_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG 0x201c + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t number_of_combs; +} nr_nfapi_ul_config_srs_pdu_rel13_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG 0x204c + +typedef struct { + nr_nfapi_ul_config_srs_pdu_rel8_t srs_pdu_rel8; + nr_nfapi_ul_config_srs_pdu_rel10_t srs_pdu_rel10; + nr_nfapi_ul_config_srs_pdu_rel13_t srs_pdu_rel13; +} nr_nfapi_ul_config_srs_pdu; + +typedef struct { + nr_nfapi_ul_config_ue_information ue_information; + nr_nfapi_ul_config_cqi_information cqi_information; +} nr_nfapi_ul_config_uci_cqi_pdu; + +typedef struct { + nr_nfapi_ul_config_ue_information ue_information; + nr_nfapi_ul_config_sr_information sr_information; +} nr_nfapi_ul_config_uci_sr_pdu; + +typedef struct { + nr_nfapi_ul_config_ue_information ue_information; + nr_nfapi_ul_config_harq_information harq_information; +} nr_nfapi_ul_config_uci_harq_pdu; + +typedef struct { + nr_nfapi_ul_config_ue_information ue_information; + nr_nfapi_ul_config_sr_information sr_information; + nr_nfapi_ul_config_harq_information harq_information; +} nr_nfapi_ul_config_uci_sr_harq_pdu; + +typedef struct { + nr_nfapi_ul_config_ue_information ue_information; + nr_nfapi_ul_config_cqi_information cqi_information; + nr_nfapi_ul_config_harq_information harq_information; +} nr_nfapi_ul_config_uci_cqi_harq_pdu; + +typedef struct { + nr_nfapi_ul_config_ue_information ue_information; + nr_nfapi_ul_config_cqi_information cqi_information; + nr_nfapi_ul_config_sr_information sr_information; +} nr_nfapi_ul_config_uci_cqi_sr_pdu; + +typedef struct { + nr_nfapi_ul_config_ue_information ue_information; + nr_nfapi_ul_config_cqi_information cqi_information; + nr_nfapi_ul_config_sr_information sr_information; + nr_nfapi_ul_config_harq_information harq_information; +} nr_nfapi_ul_config_uci_cqi_sr_harq_pdu; + +typedef struct { + nr_nfapi_ul_config_ue_information ue_information; +} nr_nfapi_ul_config_harq_buffer_pdu; + +typedef struct { + nr_nfapi_ul_config_ulsch_pdu ulsch_pdu; + nr_nfapi_ul_config_cqi_information csi_information; +} nr_nfapi_ul_config_ulsch_uci_csi_pdu; + +typedef struct { + nr_nfapi_ul_config_ulsch_pdu ulsch_pdu; + nr_nfapi_ul_config_harq_information harq_information; +} nr_nfapi_ul_config_ulsch_uci_harq_pdu; + +typedef struct { + nr_nfapi_ul_config_ulsch_pdu ulsch_pdu; + nr_nfapi_ul_config_cqi_information csi_information; + nr_nfapi_ul_config_harq_information harq_information; +} nr_nfapi_ul_config_ulsch_csi_uci_harq_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t harq_ack_resource; +} nr_nfapi_ul_config_nb_harq_information_rel13_fdd_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG 0x2061 + +typedef struct { + nr_nfapi_ul_config_nb_harq_information_rel13_fdd_t nb_harq_information_rel13_fdd; +} nr_nfapi_ul_config_nb_harq_information; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t nulsch_format; + uint32_t handle; + uint16_t size; + uint16_t rnti; + uint8_t subcarrier_indication; + uint8_t resource_assignment; + uint8_t mcs; + uint8_t redudancy_version; + uint8_t repetition_number; + uint8_t new_data_indication; + uint8_t n_srs; + uint16_t scrambling_sequence_initialization_cinit; + uint16_t sf_idx; + nr_nfapi_ul_config_ue_information ue_information; + nr_nfapi_ul_config_nb_harq_information nb_harq_information; +} nr_nfapi_ul_config_nulsch_pdu_rel13_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG 0x205F + +typedef struct { + nr_nfapi_ul_config_nulsch_pdu_rel13_t nulsch_pdu_rel13; +} nr_nfapi_ul_config_nulsch_pdu; + + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t nprach_config_0; + uint8_t nprach_config_1; + uint8_t nprach_config_2; +} nr_nfapi_ul_config_nrach_pdu_rel13_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG 0x2067 + +typedef struct { + nr_nfapi_ul_config_nrach_pdu_rel13_t nrach_pdu_rel13; +} nr_nfapi_ul_config_nrach_pdu; + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nr_nfapi_ul_config_ulsch_pdu ulsch_pdu; + nr_nfapi_ul_config_ulsch_cqi_ri_pdu ulsch_cqi_ri_pdu; + nr_nfapi_ul_config_ulsch_harq_pdu ulsch_harq_pdu; + nr_nfapi_ul_config_ulsch_cqi_harq_ri_pdu ulsch_cqi_harq_ri_pdu; + nr_nfapi_ul_config_uci_cqi_pdu uci_cqi_pdu; + nr_nfapi_ul_config_uci_sr_pdu uci_sr_pdu; + nr_nfapi_ul_config_uci_harq_pdu uci_harq_pdu; + nr_nfapi_ul_config_uci_sr_harq_pdu uci_sr_harq_pdu; + nr_nfapi_ul_config_uci_cqi_harq_pdu uci_cqi_harq_pdu; + nr_nfapi_ul_config_uci_cqi_sr_pdu uci_cqi_sr_pdu; + nr_nfapi_ul_config_uci_cqi_sr_harq_pdu uci_cqi_sr_harq_pdu; + nr_nfapi_ul_config_srs_pdu srs_pdu; + nr_nfapi_ul_config_harq_buffer_pdu harq_buffer_pdu; + nr_nfapi_ul_config_ulsch_uci_csi_pdu ulsch_uci_csi_pdu; + nr_nfapi_ul_config_ulsch_uci_harq_pdu ulsch_uci_harq_pdu; + nr_nfapi_ul_config_ulsch_csi_uci_harq_pdu ulsch_csi_uci_harq_pdu; + nr_nfapi_ul_config_nulsch_pdu nulsch_pdu; + nr_nfapi_ul_config_nrach_pdu nrach_pdu; + }; +} nr_nfapi_ul_config_request_pdu_t; + +#define NR_NFAPI_UL_CONFIG_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + uint8_t number_of_pdus; + uint8_t rach_prach_frequency_resources; + uint8_t srs_present; + nr_nfapi_ul_config_request_pdu_t* ul_config_pdu_list; +} nr_nfapi_ul_config_request_body_t; +#define NR_NFAPI_UL_CONFIG_REQUEST_BODY_TAG 0x200C + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t resource_block_start; + uint8_t cyclic_shift_2_for_drms; + uint8_t hi_value; + uint8_t i_phich; + uint16_t transmission_power; +} nr_nfapi_hi_dci0_hi_pdu_rel8_t; +#define NR_NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG 0x201e + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t flag_tb2; + uint8_t hi_value_2; +} nr_nfapi_hi_dci0_hi_pdu_rel10_t; +#define NR_NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG 0x201f + +typedef struct { + nr_nfapi_hi_dci0_hi_pdu_rel8_t hi_pdu_rel8; + nr_nfapi_hi_dci0_hi_pdu_rel10_t hi_pdu_rel10; +} nr_nfapi_hi_dci0_hi_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + // common C-RNTI + uint8_t dci_format; + uint8_t frequency_domain_resouce_assignment; // 38.214 chapter 5.1.2.2 + uint8_t time_domain_resource_assignment; // 38.214 chapter 5.1.2.1 + uint8_t frequency_hopping_enabled_flag; + uint8_t frequency_hopping_bits; + uint8_t mcs; + uint8_t new_data_indication; + uint8_t redundancy_version; + uint8_t harq_process; + uint8_t tpc_command; + + // format 0_0 C-RNTI + uint8_t ul_sul_ind; + + // format 0_1 C-RNTI + uint8_t carrier_indicator; + uint8_t bwp_indndicator; + uint8_t vrb_to_prb_mapping; + uint8_t downlink_assignment_index_1; + uint8_t downlink_assignment_index_2; + uint8_t srs_resource_indicator; + uint8_t precoding_information; + uint8_t antenna_ports; + uint8_t srs_request; + uint8_t cqi_csi_request; + uint8_t cbg_transmission_information; + uint8_t ptrs_dmrs_association; + + // format 0_1 CS-RNTI + + // format 0_1 SP-CSI-RNTI + +} nr_nfapi_dci0_pdu_rel15_t; +#define NR_NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG 0x2020 + +typedef struct { + nr_nfapi_tl_t tl; + // common C-RNTI, TC-RNTI and RA-RNTI + uint8_t dci_format; + uint8_t frequency_domain_resouce_assignment; + uint8_t time_domain_resource_assignment; + uint8_t vrb_to_prb_mapping; + uint8_t mcs; + uint8_t new_data_indication; + uint8_t redundancy_version; + uint8_t harq_process; + uint8_t downlink_assignment_index; + uint8_t tpc_command; + uint8_t pucch_resource_indicator; + uint8_t pdsch_to_harq_feedback_timing_indicator; + + // format 1_0 P-RNTI + uint8_t short_messages_indicator; + + // format 1_0 SI-RNTI + + // format 1_0 CS-RNTI + + + // format 1_1 C-RNTI + uint8_t carrier_indicator; + uint8_t bwp_indndicator; + uint8_t prb_bundling_size_indicator; // 38.214 chapter 5.1.2.3 + uint8_t rate_matching_indicator; + uint8_t zp_csi_rs_trigger; + uint8_t antenna_ports; + uint8_t transmission_configuration_indication; + uint8_t srs_request; + uint8_t cbg_transmission_information; + uint8_t cbg_flushing_out_information; + + // format 1_1 CS-RNTI + +} nr_nfapi_dci1_pdu_rel15_t; +#define NR_NFAPI_DCI1_REQUEST_DCI_PDU_REL8_TAG 0x2020 + +typedef struct { + nr_nfapi_tl_t tl; + // common + uint8_t dci_format; + + // format 2_0 SFI-RNTI (SFI) + uint8_t slot_format_count; + uint8_t *slot_format_indicators; // 38.213 chapter 11.1.1 + + // format 2_1 INT-RNTI (INT) + uint8_t preemption_indication_count; + uint8_t *preemption_indications; // 38.213 chapter 11.2 + + // format 2_2 TPC-PUSCH-RNTI and TPC-PUCCH-RNTI (TPC for PUSCH, PUCCH) + uint8_t tpc_command_count; + uint8_t *tpc_command_numbers; + + // format 2_3 TPC-SRS-RNTI (TPC for SRS) + uint8_t block_number_count; + uint8_t *block_numbers; + // 38.212 chapter 7.3.1.3.4 + uint8_t srs_request; // 38.212 table 7.3.1.1.2-5 + uint8_t tpc_command; + +} nr_nfapi_dci2_pdu_rel15_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t uci_format; + uint8_t uci_channel; + uint8_t harq_ack_bits; + uint32_t harq_ack; + uint8_t csi_bits; + uint32_t csi; + uint8_t sr_bits; + uint32_t sr; +} nr_nfapi_uci_pdu_rel15_t; + + + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t cross_carrier_scheduling_flag; + uint8_t carrier_indicator; + uint8_t size_of_cqi_csi_feild; + uint8_t srs_flag; + uint8_t srs_request; + uint8_t resource_allocation_flag; + uint8_t resource_allocation_type; + uint32_t resource_block_coding; + uint8_t mcs_2; + uint8_t new_data_indication_2; + uint8_t number_of_antenna_ports; + uint8_t tpmi; + uint8_t total_dci_length_including_padding; + uint8_t n_ul_rb; +} nr_nfapi_hi_dci0_dci_pdu_rel10_t; +#define NR_NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG 0x2021 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t pscch_resource; + uint8_t time_resource_pattern; +} nr_nfapi_hi_dci0_dci_pdu_rel12_t; + +#define NR_NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG 0x204D + +typedef struct { + nr_nfapi_hi_dci0_dci_pdu_rel8_t dci_pdu_rel8; + nr_nfapi_hi_dci0_dci_pdu_rel10_t dci_pdu_rel10; + nr_nfapi_hi_dci0_dci_pdu_rel12_t dci_pdu_rel12; +} nr_nfapi_hi_dci0_dci_pdu; + +typedef nr_nfapi_hi_dci0_dci_pdu_rel8_t nr_nfapi_hi_dci0_epdcch_dci_pdu_rel8_t; +#define NR_NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG 0x2020 + +typedef nr_nfapi_hi_dci0_dci_pdu_rel10_t nr_nfapi_hi_dci0_epdcch_dci_pdu_rel10_t; +#define NR_NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG 0x2021 + +typedef nr_nfapi_dl_config_epdcch_parameters_rel11_t nr_nfapi_hi_dci0_epdcch_parameters_rel11_t; +#define NR_NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG 0x2041 + +typedef struct { + nr_nfapi_hi_dci0_epdcch_dci_pdu_rel8_t epdcch_dci_pdu_rel8; + nr_nfapi_hi_dci0_epdcch_dci_pdu_rel10_t epdcch_dci_pdu_rel10; + nr_nfapi_hi_dci0_epdcch_parameters_rel11_t epdcch_parameters_rel11; +} nr_nfapi_hi_dci0_epdcch_dci_pdu; + + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t mpdcch_narrowband; + uint8_t number_of_prb_pairs; + uint8_t resource_block_assignment; + uint8_t mpdcch_transmission_type; + uint8_t start_symbol; + uint8_t ecce_index; + uint8_t aggreagation_level; + uint8_t rnti_type; + uint16_t rnti; + uint8_t ce_mode; + uint16_t drms_scrambling_init; + uint16_t initial_transmission_sf_io; + uint16_t transmission_power; + uint8_t dci_format; + uint8_t resource_block_start; + uint8_t number_of_resource_blocks; + uint8_t mcs; + uint8_t pusch_repetition_levels; + uint8_t frequency_hopping_flag; + uint8_t new_data_indication; + uint8_t harq_process; + uint8_t redudency_version; + uint8_t tpc; + uint8_t csi_request; + uint8_t ul_inex; + uint8_t dai_presence_flag; + uint8_t dl_assignment_index; + uint8_t srs_request; + uint8_t dci_subframe_repetition_number; + uint32_t tcp_bitmap; + uint8_t total_dci_length_include_padding; + uint8_t number_of_tx_antenna_ports; + uint16_t precoding_value[NR_NFAPI_MAX_ANTENNA_PORT_COUNT]; +} nr_nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t; +#define NR_NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG 0x204E + +typedef struct { + nr_nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t mpdcch_dci_pdu_rel13; +} nr_nfapi_hi_dci0_mpdcch_dci_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t ncce_index; + uint8_t aggregation_level; + uint8_t start_symbol; + uint16_t rnti; + uint8_t scrambling_reinitialization_batch_index; + uint8_t nrs_antenna_ports_assumed_by_the_ue; + uint8_t subcarrier_indication; + uint8_t resource_assignment; + uint8_t scheduling_delay; + uint8_t mcs; + uint8_t redudancy_version; + uint8_t repetition_number; + uint8_t new_data_indicator; + uint8_t dci_subframe_repetition_number; +} nr_nfapi_hi_dci0_npdcch_dci_pdu_rel13_t; + +#define NR_NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG 0x2062 + +typedef struct { + nr_nfapi_hi_dci0_npdcch_dci_pdu_rel13_t npdcch_dci_pdu_rel13; +} nr_nfapi_hi_dci0_npdcch_dci_pdu; + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nr_nfapi_hi_dci0_hi_pdu hi_pdu; + nr_nfapi_hi_dci0_dci_pdu dci_pdu; + nr_nfapi_hi_dci0_epdcch_dci_pdu epdcch_dci_pdu; + nr_nfapi_hi_dci0_mpdcch_dci_pdu mpdcch_dci_pdu; + nr_nfapi_hi_dci0_npdcch_dci_pdu npdcch_dci_pdu; + }; +} nr_nfapi_hi_dci0_request_pdu_t; + +#define NR_NFAPI_HI_DCI0_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t sfnsf; + uint8_t number_of_dci; + uint8_t number_of_hi; + nr_nfapi_hi_dci0_request_pdu_t* hi_dci0_pdu_list; +} nr_nfapi_hi_dci0_request_body_t; +#define NR_NFAPI_HI_DCI0_REQUEST_BODY_TAG 0x201D + +#define NR_NFAPI_TX_MAX_SEGMENTS 32 +typedef struct { + uint16_t pdu_length; + uint16_t pdu_index; + uint8_t num_segments; + struct { + uint32_t segment_length; + uint8_t* segment_data; + } segments[NR_NFAPI_TX_MAX_SEGMENTS]; +} nr_nfapi_tx_request_pdu_t; + +#define NR_NFAPI_TX_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_pdus; + nr_nfapi_tx_request_pdu_t* tx_pdu_list; +} nr_nfapi_tx_request_body_t; +#define NR_NFAPI_TX_REQUEST_BODY_TAG 0x2022 + +// P7 Message Structures + +typedef struct nr_nfapi_dci_indication_s{ + nr_nfapi_p7_message_header_t header; + uint32_t t1; + +} nr_nfapi_dci_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint32_t t1; + int32_t delta_sfn_sf; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_dl_node_sync_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint32_t t1; + uint32_t t2; + uint32_t t3; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_ul_node_sync_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint32_t last_sfn_sf; + uint32_t time_since_last_timing_info; + uint32_t dl_config_jitter; + uint32_t tx_request_jitter; + uint32_t ul_config_jitter; + uint32_t hi_dci0_jitter; + int32_t dl_config_latest_delay; + int32_t tx_request_latest_delay; + int32_t ul_config_latest_delay; + int32_t hi_dci0_latest_delay; + int32_t dl_config_earliest_arrival; + int32_t tx_request_earliest_arrival; + int32_t ul_config_earliest_arrival; + int32_t hi_dci0_earliest_arrival; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_timing_info_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t handle; + uint16_t rnti; +} nr_nfapi_rx_ue_information; +#define NR_NFAPI_RX_UE_INFORMATION_TAG 0x2038 + +typedef struct { + uint8_t value_0; + uint8_t value_1; +} nr_nfapi_harq_indication_tdd_harq_data_bundling_t; + +typedef struct { + uint8_t value_0; + uint8_t value_1; + uint8_t value_2; + uint8_t value_3; +} nr_nfapi_harq_indication_tdd_harq_data_multiplexing_t; + +typedef struct { + uint8_t value_0; +} nr_nfapi_harq_indication_tdd_harq_data_special_bundling_t; + +typedef struct { + uint8_t value_0; +} nr_nfapi_harq_indication_tdd_harq_data_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t mode; + uint8_t number_of_ack_nack; + union{ + nr_nfapi_harq_indication_tdd_harq_data_bundling_t bundling; + nr_nfapi_harq_indication_tdd_harq_data_multiplexing_t multiplex; + nr_nfapi_harq_indication_tdd_harq_data_special_bundling_t special_bundling; + } harq_data; +} nr_nfapi_harq_indication_tdd_rel8_t; +#define NR_NFAPI_HARQ_INDICATION_TDD_REL8_TAG 0x2027 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t mode; + uint8_t number_of_ack_nack; + union{ + nr_nfapi_harq_indication_tdd_harq_data_t bundling; + nr_nfapi_harq_indication_tdd_harq_data_t multiplex; + nr_nfapi_harq_indication_tdd_harq_data_special_bundling_t special_bundling; + nr_nfapi_harq_indication_tdd_harq_data_t channel_selection; + nr_nfapi_harq_indication_tdd_harq_data_t format_3; + } harq_data[NR_NFAPI_MAX_NUMBER_ACK_NACK_TDD]; +} nr_nfapi_harq_indication_tdd_rel9_t; +#define NR_NFAPI_HARQ_INDICATION_TDD_REL9_TAG 0x2028 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t mode; + uint16_t number_of_ack_nack; + union{ + nr_nfapi_harq_indication_tdd_harq_data_t bundling; + nr_nfapi_harq_indication_tdd_harq_data_t multiplex; + nr_nfapi_harq_indication_tdd_harq_data_special_bundling_t special_bundling; + nr_nfapi_harq_indication_tdd_harq_data_t channel_selection; + nr_nfapi_harq_indication_tdd_harq_data_t format_3; + nr_nfapi_harq_indication_tdd_harq_data_t format_4; + nr_nfapi_harq_indication_tdd_harq_data_t format_5; + } harq_data[NR_NFAPI_MAX_NUMBER_ACK_NACK_TDD]; +} nr_nfapi_harq_indication_tdd_rel13_t; +#define NR_NFAPI_HARQ_INDICATION_TDD_REL13_TAG 0x204F + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t harq_tb1; + uint8_t harq_tb2; +} nr_nfapi_harq_indication_fdd_rel8_t; +#define NR_NFAPI_HARQ_INDICATION_FDD_REL8_TAG 0x2029 + +#define NR_NFAPI_HARQ_ACK_NACK_REL9_MAX 10 +typedef struct { + nr_nfapi_tl_t tl; + uint8_t mode; + uint8_t number_of_ack_nack; + uint8_t harq_tb_n[NR_NFAPI_HARQ_ACK_NACK_REL9_MAX]; +} nr_nfapi_harq_indication_fdd_rel9_t; +#define NR_NFAPI_HARQ_INDICATION_FDD_REL9_TAG 0x202a + +#define NR_NFAPI_HARQ_ACK_NACK_REL13_MAX 22 // Need to check this max? +typedef struct { + nr_nfapi_tl_t tl; + uint8_t mode; + uint16_t number_of_ack_nack; + uint8_t harq_tb_n[NR_NFAPI_HARQ_ACK_NACK_REL13_MAX]; +} nr_nfapi_harq_indication_fdd_rel13_t; +#define NR_NFAPI_HARQ_INDICATION_FDD_REL13_TAG 0x2050 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t ul_cqi; + uint8_t channel; +} nr_nfapi_ul_cqi_information_t; +#define NR_NFAPI_UL_CQI_INFORMATION_TAG 0x2052 + +// Only expect 1 harq_indication TLV.tag to be set +// Would this be a better a an union, but not clear which combinations +// are valid +typedef struct { + uint16_t instance_length; + nr_nfapi_rx_ue_information rx_ue_information; + nr_nfapi_harq_indication_tdd_rel8_t harq_indication_tdd_rel8; + nr_nfapi_harq_indication_tdd_rel9_t harq_indication_tdd_rel9; + nr_nfapi_harq_indication_tdd_rel13_t harq_indication_tdd_rel13; + nr_nfapi_harq_indication_fdd_rel8_t harq_indication_fdd_rel8; + nr_nfapi_harq_indication_fdd_rel9_t harq_indication_fdd_rel9; + nr_nfapi_harq_indication_fdd_rel13_t harq_indication_fdd_rel13; + nr_nfapi_ul_cqi_information_t ul_cqi_information; +} nr_nfapi_harq_indication_pdu_t; + +#define NR_NFAPI_HARQ_IND_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_harqs; + nr_nfapi_harq_indication_pdu_t* harq_pdu_list; +} nr_nfapi_harq_indication_body_t; +#define NR_NFAPI_HARQ_INDICATION_BODY_TAG 0x2026 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t crc_flag; +} nr_nfapi_crc_indication_rel8_t; +#define NR_NFAPI_CRC_INDICATION_REL8_TAG 0x202c + +typedef struct { + uint16_t instance_length; + nr_nfapi_rx_ue_information rx_ue_information; + nr_nfapi_crc_indication_rel8_t crc_indication_rel8; +} nr_nfapi_crc_indication_pdu_t; + +#define NR_NFAPI_CRC_IND_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_crcs; + nr_nfapi_crc_indication_pdu_t* crc_pdu_list; +} nr_nfapi_crc_indication_body_t; +#define NR_NFAPI_CRC_INDICATION_BODY_TAG 0x202b + +typedef struct { + uint16_t instance_length; + nr_nfapi_rx_ue_information rx_ue_information; + nr_nfapi_ul_cqi_information_t ul_cqi_information; +} nr_nfapi_sr_indication_pdu_t; + +#define NR_NFAPI_SR_IND_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_srs; // Question : should this be srs + nr_nfapi_sr_indication_pdu_t* sr_pdu_list; +} nr_nfapi_sr_indication_body_t; +#define NR_NFAPI_SR_INDICATION_BODY_TAG 0x202d + +// The data offset should be set to 0 or 1 before encoding +// If it is set to 1 the nfapi library will detemine the correct offset + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t data_offset; + uint8_t ul_cqi; + uint8_t ri; + uint16_t timing_advance; +} nr_nfapi_cqi_indication_rel8_t; +#define NR_NFAPI_CQI_INDICATION_REL8_TAG 0x202f + +#define NR_NFAPI_CC_MAX 4 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t data_offset; + uint8_t ul_cqi; + uint8_t number_of_cc_reported; + uint8_t ri[NR_NFAPI_CC_MAX]; + uint16_t timing_advance; + uint16_t timing_advance_r9; +} nr_nfapi_cqi_indication_rel9_t; +#define NR_NFAPI_CQI_INDICATION_REL9_TAG 0x2030 + +typedef struct { + uint16_t instance_length; + nr_nfapi_rx_ue_information rx_ue_information; + nr_nfapi_cqi_indication_rel8_t cqi_indication_rel8; + nr_nfapi_cqi_indication_rel9_t cqi_indication_rel9; + nr_nfapi_ul_cqi_information_t ul_cqi_information; +} nr_nfapi_cqi_indication_pdu_t; + +#define NR_NFAPI_CQI_RAW_MAX_LEN 12 +typedef struct { + uint8_t pdu[NR_NFAPI_CQI_RAW_MAX_LEN]; +} nr_nfapi_cqi_indication_raw_pdu_t; + +#define NR_NFAPI_CQI_IND_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_cqis; + nr_nfapi_cqi_indication_pdu_t* cqi_pdu_list; + nr_nfapi_cqi_indication_raw_pdu_t* cqi_raw_pdu_list; +} nr_nfapi_cqi_indication_body_t; +#define NR_NFAPI_CQI_INDICATION_BODY_TAG 0x202e + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t rnti; + uint8_t preamble; + uint16_t timing_advance; +} nr_nfapi_preamble_pdu_rel8_t; +#define NR_NFAPI_PREAMBLE_REL8_TAG 0x2032 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t timing_advance_r9; +} nr_nfapi_preamble_pdu_rel9_t; +#define NR_NFAPI_PREAMBLE_REL9_TAG 0x2033 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t rach_resource_type; +} nr_nfapi_preamble_pdu_rel13_t; +#define NR_NFAPI_PREAMBLE_REL13_TAG 0x2051 + +typedef struct { + uint16_t instance_length; + nr_nfapi_preamble_pdu_rel8_t preamble_rel8; + nr_nfapi_preamble_pdu_rel9_t preamble_rel9; + nr_nfapi_preamble_pdu_rel13_t preamble_rel13; +} nr_nfapi_preamble_pdu_t; + +#define NR_NFAPI_PREAMBLE_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_preambles; + nr_nfapi_preamble_pdu_t* preamble_list; +} nr_nfapi_rach_indication_body_t; +#define NR_NFAPI_RACH_INDICATION_BODY_TAG 0x2031 + +#define NR_NFAPI_NUM_RB_MAX 1000 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t doppler_estimation; + uint16_t timing_advance; + uint8_t number_of_resource_blocks; + uint8_t rb_start; + uint8_t snr[NR_NFAPI_NUM_RB_MAX]; +} nr_nfapi_srs_indication_fdd_rel8_t; +#define NR_NFAPI_SRS_INDICATION_FDD_REL8_TAG 0x2035 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t timing_advance_r9; +} nr_nfapi_srs_indication_fdd_rel9_t; +#define NR_NFAPI_SRS_INDICATION_FDD_REL9_TAG 0x2036 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t uppts_symbol; +} nr_nfapi_srs_indication_ttd_rel10_t; +#define NR_NFAPI_SRS_INDICATION_TDD_REL10_TAG 0x2037 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t ul_rtoa; +} nr_nfapi_srs_indication_fdd_rel11_t; +#define NR_NFAPI_SRS_INDICATION_FDD_REL11_TAG 0x2053 + + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t num_prb_per_subband; + uint8_t number_of_subbands; + uint8_t num_atennas; + struct { + uint8_t subband_index; + uint16_t channel[NR_NFAPI_MAX_NUM_PHYSICAL_ANTENNAS]; + } subands[NR_NFAPI_MAX_NUM_SUBBANDS]; +} nr_nfapi_tdd_channel_measurement_t; +#define NR_NFAPI_TDD_CHANNEL_MEASUREMENT_TAG 0x2054 + +typedef struct { + uint16_t instance_length; + nr_nfapi_rx_ue_information rx_ue_information; + nr_nfapi_srs_indication_fdd_rel8_t srs_indication_fdd_rel8; + nr_nfapi_srs_indication_fdd_rel9_t srs_indication_fdd_rel9; + nr_nfapi_srs_indication_ttd_rel10_t srs_indication_tdd_rel10; + nr_nfapi_srs_indication_fdd_rel11_t srs_indication_fdd_rel11; + nr_nfapi_tdd_channel_measurement_t tdd_channel_measurement; +} nr_nfapi_srs_indication_pdu_t; + +#define NR_NFAPI_SRS_IND_MAX_PDU 16 +typedef struct { + nr_nfapi_tl_t tl; + uint8_t number_of_ues; + nr_nfapi_srs_indication_pdu_t* srs_pdu_list; +} nr_nfapi_srs_indication_body_t; +#define NR_NFAPI_SRS_INDICATION_BODY_TAG 0x2034 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t length; + uint16_t offset; + uint8_t ul_cqi; + uint16_t timing_advance; +} nr_nfapi_rx_indication_rel8_t; +#define NR_NFAPI_RX_INDICATION_REL8_TAG 0x2024 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t timing_advance_r9; + } nr_nfapi_rx_indication_rel9_t; +#define NR_NFAPI_RX_INDICATION_REL9_TAG 0x2025 + +typedef struct { + nr_nfapi_rx_ue_information rx_ue_information; + nr_nfapi_rx_indication_rel8_t rx_indication_rel8; + nr_nfapi_rx_indication_rel9_t rx_indication_rel9; + uint8_t* data; +} nr_nfapi_rx_indication_pdu_t; + +#define NR_NFAPI_RX_IND_MAX_PDU 100 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_pdus; + nr_nfapi_rx_indication_pdu_t* rx_pdu_list; +} nr_nfapi_rx_indication_body_t; +#define NR_NFAPI_RX_INDICATION_BODY_TAG 0x2023 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t harq_tb1; +} nr_nfapi_nb_harq_indication_fdd_rel13_t; +#define NR_NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG 0x2064 + +typedef struct { + uint16_t instance_length; + nr_nfapi_rx_ue_information rx_ue_information; + nr_nfapi_nb_harq_indication_fdd_rel13_t nb_harq_indication_fdd_rel13; + nr_nfapi_ul_cqi_information_t ul_cqi_information; +} nr_nfapi_nb_harq_indication_pdu_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_harqs; + nr_nfapi_nb_harq_indication_pdu_t* nb_harq_pdu_list; +} nr_nfapi_nb_harq_indication_body_t; +#define NR_NFAPI_NB_HARQ_INDICATION_BODY_TAG 0x2063 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t rnti; + uint8_t initial_sc; + uint16_t timing_advance; + uint8_t nrach_ce_level; +} nr_nfapi_nrach_indication_pdu_rel13_t; +#define NR_NFAPI_NRACH_INDICATION_REL13_TAG 0x2066 + +typedef struct { + nr_nfapi_nrach_indication_pdu_rel13_t nrach_indication_rel13; +} nr_nfapi_nrach_indication_pdu_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t number_of_initial_scs_detected; + nr_nfapi_nrach_indication_pdu_t* nrach_pdu_list; +} nr_nfapi_nrach_indication_body_t; +#define NR_NFAPI_NRACH_INDICATION_BODY_TAG 0x2065 + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t handle; + uint32_t mp_cca; + uint32_t n_cca; + uint32_t offset; + uint32_t lte_txop_sf; + uint16_t txop_sfn_sf_end; + uint32_t lbt_mode; +} nr_nfapi_lbt_pdsch_req_pdu_rel13_t; +#define NR_NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG 0x2056 + +typedef struct { + nr_nfapi_lbt_pdsch_req_pdu_rel13_t lbt_pdsch_req_pdu_rel13; +} nr_nfapi_lbt_pdsch_req_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t handle; + uint32_t offset; + uint16_t sfn_sf_end; + uint32_t lbt_mode; +} nr_nfapi_lbt_drs_req_pdu_rel13_t; +#define NR_NFAPI_LBT_DRS_REQ_PDU_REL13_TAG 0x2057 + +typedef struct { + nr_nfapi_lbt_drs_req_pdu_rel13_t lbt_drs_req_pdu_rel13; +} nr_nfapi_lbt_drs_req_pdu; + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nr_nfapi_lbt_pdsch_req_pdu lbt_pdsch_req_pdu; + nr_nfapi_lbt_drs_req_pdu lbt_drs_req_pdu; + }; +} nr_nfapi_lbt_dl_config_request_pdu_t; + +#define NR_NFAPI_LBT_DL_CONFIG_REQ_MAX_PDU 16 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_pdus; + nr_nfapi_lbt_dl_config_request_pdu_t* lbt_dl_config_req_pdu_list; +} nr_nfapi_lbt_dl_config_request_body_t; +#define NR_NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG 0x2055 + + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t handle; + uint32_t result; + uint32_t lte_txop_symbols; + uint32_t initial_partial_sf; +} nr_nfapi_lbt_pdsch_rsp_pdu_rel13_t; +#define NR_NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG 0x2059 + +typedef struct { + nr_nfapi_lbt_pdsch_rsp_pdu_rel13_t lbt_pdsch_rsp_pdu_rel13; +} nr_nfapi_lbt_pdsch_rsp_pdu; + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t handle; + uint32_t result; +} nr_nfapi_lbt_drs_rsp_pdu_rel13_t; +#define NR_NFAPI_LBT_DRS_RSP_PDU_REL13_TAG 0x205A + +typedef struct { + nr_nfapi_lbt_drs_rsp_pdu_rel13_t lbt_drs_rsp_pdu_rel13; +} nr_nfapi_lbt_drs_rsp_pdu; + + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nr_nfapi_lbt_pdsch_rsp_pdu lbt_pdsch_rsp_pdu; + nr_nfapi_lbt_drs_rsp_pdu lbt_drs_rsp_pdu; + }; +} nr_nfapi_lbt_dl_indication_pdu_t; + +#define NR_NFAPI_LBT_IND_MAX_PDU 16 +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_pdus; + nr_nfapi_lbt_dl_indication_pdu_t* lbt_indication_pdu_list; +} nr_nfapi_lbt_dl_indication_body_t; +#define NR_NFAPI_LBT_DL_INDICATION_BODY_TAG 0x2058 + +typedef struct { +} nr_nfapi_error_indication_msg_invalid_state; + +typedef struct { +} nr_nfapi_error_indication_msg_bch_missing; + +typedef struct { + uint16_t recieved_sfn_sf; + uint16_t expected_sfn_sf; +} nr_nfapi_error_indication_sfn_out_of_sync; + +typedef struct { + uint8_t sub_error_code; + uint8_t direction; + uint16_t rnti; + uint8_t pdu_type; +} nr_nfapi_error_indication_msg_pdu_err; + +typedef struct { + uint16_t recieved_sfn_sf; + uint16_t expected_sfn_sf; +} nr_nfapi_error_indication_msg_invalid_sfn; + +typedef struct { + uint8_t sub_error_code; + uint8_t phich_lowest_ul_rb_index; +} nr_nfapi_error_indication_msg_hi_err; + +typedef struct { + uint8_t sub_error_code; + uint16_t pdu_index; +} nr_nfapi_error_indication_msg_tx_err; + +// +// P4 Message Structures +// + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t frequency_band_indicator; + uint16_t measurement_period; + uint8_t bandwidth; + uint32_t timeout; + uint8_t number_of_earfcns; + uint16_t earfcn[NR_NFAPI_MAX_CARRIER_LIST]; +} nr_nfapi_lte_rssi_request_t; + +#define NR_NFAPI_LTE_RSSI_REQUEST_TAG 0x3000 + +#define NR_NFAPI_P4_START_TAG NR_NFAPI_LTE_RSSI_REQUEST_TAG + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t frequency_band_indicator; + uint16_t measurement_period; + uint32_t timeout; + uint8_t number_of_uarfcns; + uint16_t uarfcn[NR_NFAPI_MAX_CARRIER_LIST]; +} nr_nfapi_utran_rssi_request_t; + +#define NR_NFAPI_UTRAN_RSSI_REQUEST_TAG 0x3001 + +typedef struct { + uint16_t arfcn; + uint8_t direction; +} nr_nfapi_arfcn_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t frequency_band_indicator; + uint16_t measurement_period; + uint32_t timeout; + uint8_t number_of_arfcns; + nr_nfapi_arfcn_t arfcn[NR_NFAPI_MAX_CARRIER_LIST]; +} nr_nfapi_geran_rssi_request_t; + +#define NR_NFAPI_GERAN_RSSI_REQUEST_TAG 0x3002 + + + +typedef struct { + uint16_t earfcn; + uint8_t number_of_ro_dl; + uint8_t ro_dl[NR_NFAPI_MAX_RO_DL]; +} nr_nfapi_earfcn_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t frequency_band_indicator; + uint16_t measurement_period; + uint32_t timeout; + uint8_t number_of_earfcns; + nr_nfapi_earfcn_t earfcn[NR_NFAPI_MAX_CARRIER_LIST]; +} nr_nfapi_nb_iot_rssi_request_t; + +#define NR_NFAPI_NB_IOT_RSSI_REQUEST_TAG 0x3020 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_rssi; + int16_t rssi[NR_NFAPI_MAX_RSSI]; +} nr_nfapi_rssi_indication_body_t; + +#define NR_NFAPI_RSSI_INDICATION_TAG 0x3003 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t earfcn; + uint8_t measurement_bandwidth; + uint8_t exhaustive_search; + uint32_t timeout; + uint8_t number_of_pci; + uint16_t pci[NR_NFAPI_MAX_PCI_LIST]; +} nr_nfapi_lte_cell_search_request_t; + +#define NR_NFAPI_LTE_CELL_SEARCH_REQUEST_TAG 0x3004 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t uarfcn; + uint8_t exhaustive_search; + uint32_t timeout; + uint8_t number_of_psc; + uint16_t psc[NR_NFAPI_MAX_PSC_LIST]; +} nr_nfapi_utran_cell_search_request_t; + +#define NR_NFAPI_UTRAN_CELL_SEARCH_REQUEST_TAG 0x3005 + +typedef struct { + nr_nfapi_tl_t tl; + uint32_t timeout; + uint8_t number_of_arfcn; + uint16_t arfcn[NR_NFAPI_MAX_ARFCN_LIST]; +} nr_nfapi_geran_cell_search_request_t; + +#define NR_NFAPI_GERAN_CELL_SEARCH_REQUEST_TAG 0x3006 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t earfcn; + uint8_t ro_dl; + uint8_t exhaustive_search; + uint32_t timeout; + uint8_t number_of_pci; + uint16_t pci[NR_NFAPI_MAX_PCI_LIST]; +} nr_nfapi_nb_iot_cell_search_request_t; + +#define NR_NFAPI_NB_IOT_CELL_SEARCH_REQUEST_TAG 0x3021 + +typedef struct { + uint16_t pci; + uint8_t rsrp; + uint8_t rsrq; + int16_t frequency_offset; +} nr_nfapi_lte_found_cell_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_lte_cells_found; + nr_nfapi_lte_found_cell_t lte_found_cells[NR_NFAPI_MAX_LTE_CELLS_FOUND]; +} nr_nfapi_lte_cell_search_indication_t; + +#define NR_NFAPI_LTE_CELL_SEARCH_INDICATION_TAG 0x3007 + +typedef struct { + uint16_t psc; + uint8_t rscp; + uint8_t ecno; + int16_t frequency_offset; +} nr_nfapi_utran_found_cell_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_utran_cells_found; + nr_nfapi_utran_found_cell_t utran_found_cells[NR_NFAPI_MAX_UTRAN_CELLS_FOUND]; +} nr_nfapi_utran_cell_search_indication_t; + +#define NR_NFAPI_UTRAN_CELL_SEARCH_INDICATION_TAG 0x3008 + +typedef struct { + uint16_t arfcn; + uint8_t bsic; + uint8_t rxlev; + uint8_t rxqual; + int16_t frequency_offset; + uint32_t sfn_offset; +} nr_nfapi_gsm_found_cell_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_gsm_cells_found; + nr_nfapi_gsm_found_cell_t gsm_found_cells[NR_NFAPI_MAX_GSM_CELLS_FOUND]; +} nr_nfapi_geran_cell_search_indication_t; + +#define NR_NFAPI_GERAN_CELL_SEARCH_INDICATION_TAG 0x3009 + +typedef struct { + uint16_t pci; + uint8_t rsrp; + uint8_t rsrq; + int16_t frequency_offset; +} nr_nfapi_nb_iot_found_cell_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t number_of_nb_iot_cells_found; + nr_nfapi_nb_iot_found_cell_t nb_iot_found_cells[NR_NFAPI_MAX_NB_IOT_CELLS_FOUND]; +} nr_nfapi_nb_iot_cell_search_indication_t; + +#define NR_NFAPI_NB_IOT_CELL_SEARCH_INDICATION_TAG 0x3022 + +typedef nr_nfapi_opaqaue_data_t nr_nfapi_pnf_cell_search_state_t; + +#define NR_NFAPI_PNF_CELL_SEARCH_STATE_TAG 0x300A + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t earfcn; + uint16_t pci; + uint32_t timeout; +} nr_nfapi_lte_broadcast_detect_request_t; + +#define NR_NFAPI_LTE_BROADCAST_DETECT_REQUEST_TAG 0x300B + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t uarfcn; + uint16_t psc; + uint32_t timeout; +} nr_nfapi_utran_broadcast_detect_request_t; + +#define NR_NFAPI_UTRAN_BROADCAST_DETECT_REQUEST_TAG 0x300C + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t earfcn; + uint8_t ro_dl; + uint16_t pci; + uint32_t timeout; +} nr_nfapi_nb_iot_broadcast_detect_request_t; + +#define NR_NFAPI_NB_IOT_BROADCAST_DETECT_REQUEST_TAG 0x3023 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t number_of_tx_antenna; + uint16_t mib_length; + uint8_t mib[NR_NFAPI_MAX_MIB_LENGTH]; + uint32_t sfn_offset; +} nr_nfapi_lte_broadcast_detect_indication_t; + +#define NR_NFAPI_LTE_BROADCAST_DETECT_INDICATION_TAG 0x300E + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t mib_length; + uint8_t mib[NR_NFAPI_MAX_MIB_LENGTH]; + uint32_t sfn_offset; +} nr_nfapi_utran_broadcast_detect_indication_t; + +#define NR_NFAPI_UTRAN_BROADCAST_DETECT_INDICATION_TAG 0x300F + + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t number_of_tx_antenna; + uint16_t mib_length; + uint8_t mib[NR_NFAPI_MAX_MIB_LENGTH]; + uint32_t sfn_offset; +} nr_nfapi_nb_iot_broadcast_detect_indication_t; + +#define NR_NFAPI_NB_IOT_BROADCAST_DETECT_INDICATION_TAG 0x3024 + +#define NR_NFAPI_PNF_CELL_BROADCAST_STATE_TAG 0x3010 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t earfcn; + uint16_t pci; + uint16_t downlink_channel_bandwidth; + uint8_t phich_configuration; + uint8_t number_of_tx_antenna; + uint8_t retry_count; + uint32_t timeout; +} nr_nfapi_lte_system_information_schedule_request_t; + +#define NR_NFAPI_LTE_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG 0x3011 + + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t earfcn; + uint8_t ro_dl; + uint16_t pci; + uint8_t scheduling_info_sib1_nb; + uint32_t timeout; +} nr_nfapi_nb_iot_system_information_schedule_request_t; + +#define NR_NFAPI_NB_IOT_SYSTEM_INFORMATION_SCHEDULE_REQUEST_TAG 0x3025 + +typedef nr_nfapi_opaqaue_data_t nr_nfapi_pnf_cell_broadcast_state_t; + +typedef struct { + uint8_t si_periodicity; + uint8_t si_index; +} nr_nfapi_lte_system_information_si_periodicity_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t earfcn; + uint16_t pci; + uint16_t downlink_channel_bandwidth; + uint8_t phich_configuration; + uint8_t number_of_tx_antenna; + uint8_t number_of_si_periodicity; + nr_nfapi_lte_system_information_si_periodicity_t si_periodicity[NR_NFAPI_MAX_SI_PERIODICITY]; + uint8_t si_window_length; + uint32_t timeout; +} nr_nfapi_lte_system_information_request_t; + +#define NR_NFAPI_LTE_SYSTEM_INFORMATION_REQUEST_TAG 0x3014 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t uarfcn; + uint16_t psc; + uint32_t timeout; +} nr_nfapi_utran_system_information_request_t; + +#define NR_NFAPI_UTRAN_SYSTEM_INFORMATION_REQUEST_TAG 0x3015 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t arfcn; + uint8_t bsic; + uint32_t timeout; +} nr_nfapi_geran_system_information_request_t; + +#define NR_NFAPI_GERAN_SYSTEM_INFORMATION_REQUEST_TAG 0x3016 + +typedef struct { + uint8_t si_periodicity; + uint8_t si_repetition_pattern; + uint8_t si_tb_size; + uint8_t number_of_si_index; + uint8_t si_index[NR_NFAPI_MAX_SI_INDEX]; +} nr_nfapi_nb_iot_system_information_si_periodicity_t; + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t earfcn; + uint8_t ro_dl; + uint16_t pci; + uint8_t number_of_si_periodicity; + nr_nfapi_nb_iot_system_information_si_periodicity_t si_periodicity[NR_NFAPI_MAX_SI_PERIODICITY]; + uint8_t si_window_length; + uint32_t timeout; +} nr_nfapi_nb_iot_system_information_request_t; + +#define NR_NFAPI_NB_IOT_SYSTEM_INFORMATION_REQUEST_TAG 0x3027 + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t sib_type; + uint16_t sib_length; + uint8_t sib[NR_NFAPI_MAX_SIB_LENGTH]; +} nr_nfapi_lte_system_information_indication_t; + +#define NR_NFAPI_LTE_SYSTEM_INFORMATION_INDICATION_TAG 0x3018 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t sib_length; + uint8_t sib[NR_NFAPI_MAX_SIB_LENGTH]; +} nr_nfapi_utran_system_information_indication_t; + +#define NR_NFAPI_UTRAN_SYSTEM_INFORMATION_INDICATION_TAG 0x3019 + +typedef struct { + nr_nfapi_tl_t tl; + uint16_t si_length; + uint8_t si[NR_NFAPI_MAX_SI_LENGTH]; +} nr_nfapi_geran_system_information_indication_t; + +#define NR_NFAPI_GERAN_SYSTEM_INFORMATION_INDICATION_TAG 0x301a + +typedef struct { + nr_nfapi_tl_t tl; + uint8_t sib_type; + uint16_t sib_length; + uint8_t sib[NR_NFAPI_MAX_SIB_LENGTH]; +} nr_nfapi_nb_iot_system_information_indication_t; + +#define NR_NFAPI_NB_IOT_SYSTEM_INFORMATION_INDICATION_TAG 0x3026 + + +// +// Top level NFAP messages +// + +// +// P7 +// + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_dl_config_request_body_t dl_config_request_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_dl_config_request_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_ul_config_request_body_t ul_config_request_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_ul_config_request_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_hi_dci0_request_body_t hi_dci0_request_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_hi_dci0_request_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_tx_request_body_t tx_request_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_tx_request_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; +} nr_nfapi_subframe_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_harq_indication_body_t harq_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_harq_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_crc_indication_body_t crc_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_crc_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_sr_indication_body_t sr_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_sr_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_cqi_indication_body_t cqi_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_cqi_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_rach_indication_body_t rach_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_rach_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_srs_indication_body_t srs_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_srs_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_rx_indication_body_t rx_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_rx_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_nb_harq_indication_body_t nb_harq_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_nb_harq_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_nrach_indication_body_t nrach_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_nrach_indication_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_lbt_dl_config_request_body_t lbt_dl_config_request_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_lbt_dl_config_request_t; + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nr_nfapi_lbt_dl_indication_body_t lbt_dl_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_lbt_dl_indication_t; + + +typedef struct { + nr_nfapi_p7_message_header_t header; + uint8_t message_id; + uint8_t error_code; + union { + nr_nfapi_error_indication_msg_invalid_state msg_invalid_state; + nr_nfapi_error_indication_msg_bch_missing msg_bch_missing; + nr_nfapi_error_indication_sfn_out_of_sync sfn_out_of_sync; + nr_nfapi_error_indication_msg_pdu_err msg_pdu_err; + nr_nfapi_error_indication_msg_invalid_sfn msg_invalid_sfn; + nr_nfapi_error_indication_msg_hi_err msg_hi_err; + nr_nfapi_error_indication_msg_tx_err msg_tx_err; + }; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_error_indication_t; + +// +// P4 Messages +// + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nr_nfapi_lte_rssi_request_t lte_rssi_request; + nr_nfapi_utran_rssi_request_t utran_rssi_request; + nr_nfapi_geran_rssi_request_t geran_rssi_request; + nr_nfapi_nb_iot_rssi_request_t nb_iot_rssi_request; + }; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_rssi_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_rssi_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_rssi_indication_body_t rssi_indication_body; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_rssi_indication_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nr_nfapi_lte_cell_search_request_t lte_cell_search_request; + nr_nfapi_utran_cell_search_request_t utran_cell_search_request; + nr_nfapi_geran_cell_search_request_t geran_cell_search_request; + nr_nfapi_nb_iot_cell_search_request_t nb_iot_cell_search_request; + }; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_cell_search_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_cell_search_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_lte_cell_search_indication_t lte_cell_search_indication; + nr_nfapi_utran_cell_search_indication_t utran_cell_search_indication; + nr_nfapi_geran_cell_search_indication_t geran_cell_search_indication; + nr_nfapi_pnf_cell_search_state_t pnf_cell_search_state; + nr_nfapi_nb_iot_cell_search_indication_t nb_iot_cell_search_indication; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_cell_search_indication_t; + + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nr_nfapi_lte_broadcast_detect_request_t lte_broadcast_detect_request; + nr_nfapi_utran_broadcast_detect_request_t utran_broadcast_detect_request; + nr_nfapi_nb_iot_broadcast_detect_request_t nb_iot_broadcast_detect_request; + }; + nr_nfapi_pnf_cell_search_state_t pnf_cell_search_state; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_broadcast_detect_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_broadcast_detect_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_lte_broadcast_detect_indication_t lte_broadcast_detect_indication; + nr_nfapi_utran_broadcast_detect_indication_t utran_broadcast_detect_indication; + nr_nfapi_nb_iot_broadcast_detect_indication_t nb_iot_broadcast_detect_indication; + nr_nfapi_pnf_cell_broadcast_state_t pnf_cell_broadcast_state; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_broadcast_detect_indication_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nr_nfapi_lte_system_information_schedule_request_t lte_system_information_schedule_request; + nr_nfapi_nb_iot_system_information_schedule_request_t nb_iot_system_information_schedule_request; + }; + nr_nfapi_pnf_cell_broadcast_state_t pnf_cell_broadcast_state; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_system_information_schedule_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_system_information_schedule_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_lte_system_information_indication_t lte_system_information_indication; + nr_nfapi_nb_iot_system_information_indication_t nb_iot_system_information_indication; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_system_information_schedule_indication_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint8_t rat_type; + union { + nr_nfapi_lte_system_information_request_t lte_system_information_request; + nr_nfapi_utran_system_information_request_t utran_system_information_request; + nr_nfapi_geran_system_information_request_t geran_system_information_request; + nr_nfapi_nb_iot_system_information_request_t nb_iot_system_information_request; + }; + nr_nfapi_pnf_cell_broadcast_state_t pnf_cell_broadcast_state; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_system_information_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_system_information_response_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_lte_system_information_indication_t lte_system_information_indication; + nr_nfapi_utran_system_information_indication_t utran_system_information_indication; + nr_nfapi_geran_system_information_indication_t geran_system_information_indication; + nr_nfapi_nb_iot_system_information_indication_t nb_iot_system_information_indication; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_system_information_indication_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_nmm_stop_request_t; + +typedef struct { + nr_nfapi_p4_p5_message_header_t header; + uint32_t error_code; + nr_nfapi_vendor_extension_tlv_t vendor_extension; +} nr_nfapi_nmm_stop_response_t; + +// +// Configuration options for the encode decode functions +// + +/*! Configuration options for the p7 pack unpack functions + * + */ +typedef struct nr_nfapi_p7_codec_config { + + /*! Optional call back to allow the user to define the memory allocator. + * \param size The size of the memory to allocate + * \return a pointer to a valid memory block or 0 if it has failed. + * + * If not set the nfapi unpack functions will use malloc + */ + void* (*allocate)(size_t size); + + /*! Optional call back to allow the user to define the memory deallocator. + * \param ptr A poiner to a memory block allocated by the allocate callback + * + * If not set the client should use free + */ + void (*deallocate)(void* ptr); + + /*! Optional call back function to handle unpacking vendor extension tlv. + * \param tl A pointer to a decoded tag length structure + * \param ppReadPackedMsg A handle to the read buffer. + * \param end The end of the read buffer + * \param ve A handle to a vendor extention structure that the call back should allocate if the structure can be decoded + * \param config A pointer to the p7 codec configuration + * \return return 0 if packed successfully, -1 if failed. + * + * If not set the tlv will be skipped + * + * Client should use the help methods in nfapi.h to decode the vendor extention. + * + * \todo Add code example + */ + int (*unpack_vendor_extension_tlv)(nr_nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, void** ve, struct nr_nfapi_p7_codec_config* config); + + /*! Optional call back function to handle packing vendor extension tlv. + * \param ve A pointer to a vendor extention structure. + * \param ppWritePackedMsg A handle to the write buffer + * \param end The end of the write buffer. The callee should make sure not to write beyond the end + * \param config A pointer to the p7 codec configuration + * \return return 0 if packed successfully, -1 if failed. + * + * If not set the the tlv will be skipped + * + * Client should use the help methods in nfapi.h to encode the vendor extention + * + * \todo Add code example + */ + int (*pack_vendor_extension_tlv)(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, struct nr_nfapi_p7_codec_config* config); + + /*! Optional call back function to handle unpacking vendor extension messages. + * \param header A pointer to a decode P7 message header for the vendor extention message + * \param ppReadPackedMsg A handle to the encoded data buffer + * \param end A pointer to the end of the encoded data buffer + * \param config A pointer to the p7 codec configuration + * \return 0 if unpacked successfully, -1 if failed + * + * If not set the message will be ignored + * + * If the message if is unknown the function should return -1 + */ + int (*unpack_p7_vendor_extension)(nr_nfapi_p7_message_header_t* header, uint8_t **ppReadPackedMsg, uint8_t *end, struct nr_nfapi_p7_codec_config* config); + + /*! Optional call back function to handle packing vendor extension messages. + * \param header A poiner to a P7 message structure for the venfor extention message + * \param ppWritePackedmsg A handle to the buffer to write the encoded message into + * \param end A pointer to the end of the buffer + * \param cofig A pointer to the p7 codec configuration + * \return 0 if packed successfully, -1 if failed + * + * If not set the the message will be ingored + * + * If the message if is unknown the function should return -1 + */ + int (*pack_p7_vendor_extension)(nr_nfapi_p7_message_header_t* header, uint8_t **ppWritePackedmsg, uint8_t *end, struct nr_nfapi_p7_codec_config* config); + + /*! Optional user data that will be passed back with callbacks + */ + void* user_data; + +} nr_nfapi_p7_codec_config_t; + +/*! Configuration options for the p4 & p5 pack unpack functions + * + */ +typedef struct nr_nfapi_p4_p5_codec_config { + + /*! Optional call back to allow the user to define the memory allocator. + * \param size The size of the memory to allocate + * \return a pointer to a valid memory block or 0 if it has failed. + * + * If not set the nfapi unpack functions will use malloc + */ + void* (*allocate)(size_t size); + + /*! Optional call back to allow the user to define the memory deallocator. + * \param ptr A poiner to a memory block allocated by the allocate callback + * + * If not set free will be used + */ + void (*deallocate)(void* ptr); + + /*! Optional call back function to handle unpacking vendor extension tlv. + * \param tl A pointer to a decoded tag length structure + * \param ppReadPackedMsg A handle to the data buffer to decode + * \param end A pointer to the end of the buffer + * \param ve A handle to a vendor extention structure that will be allocated by this callback + * \param config A pointer to the P4/P5 codec configuration + * \return 0 if unpacked successfully, -1 if failed + * + * If not set the tlv will be skipped + */ + int (*unpack_vendor_extension_tlv)(nr_nfapi_tl_t* tl, uint8_t **ppReadPackedMsg, uint8_t *end, void** ve, struct nr_nfapi_p4_p5_codec_config* config); + + /*! Optional call back function to handle packing vendor extension tlv. + * \param ve + * \param ppWritePackedMsg A handle to the data buffer pack the tlv into + * \param end A pointer to the end of the buffer + * \param config A pointer to the P4/P5 codec configuration + * \return 0 if packed successfully, -1 if failed + * + * If not set the the tlv will be skipped + */ + int (*pack_vendor_extension_tlv)(void* ve, uint8_t **ppWritePackedMsg, uint8_t *end, struct nr_nfapi_p4_p5_codec_config* config); + + /*! Optional call back function to handle unpacking vendor extension messages. + * \param header A pointer to a decode P4/P5 message header + * \param ppReadPackgedMsg A handle to the data buffer to decode + * \param end A pointer to the end of the buffer + * \param config A pointer to the P4/P5 codec configuration + * \return 0 if packed successfully, -1 if failed + * + * If not set the message will be ignored + */ + int (*unpack_p4_p5_vendor_extension)(nr_nfapi_p4_p5_message_header_t* header, uint8_t **ppReadPackedMsg, uint8_t *end, struct nr_nfapi_p4_p5_codec_config* config); + + /*! Optional call back function to handle packing vendor extension messages. + * \param header A pointer to the P4/P5 message header to be encoded + * \param ppWritePackedMsg A handle to the data buffer pack the message into + * \param end A pointer to the end of the buffer + * \param config A pointer to the P4/P5 codec configuration + * \return 0 if packed successfully, -1 if failed + * + * If not set the the message will be ingored + */ + int (*pack_p4_p5_vendor_extension)(nr_nfapi_p4_p5_message_header_t* header, uint8_t **ppwritepackedmsg, uint8_t *end, struct nr_nfapi_p4_p5_codec_config* config); + + /*! Optional user data that will be passed back with callbacks + */ + void* user_data; + +} nr_nfapi_p4_p5_codec_config_t; + +// +// Functions +// + +/*! \brief Encodes an NFAPI P4 message to a buffer + * \param pMessageBuf A pointer to a nfapi p4 message structure + * \param messageBufLen The size of the p4 message structure + * \param pPackedBuf A pointer to the buffer that the p4 message will be packed into + * \param packedBufLen The size of the buffer + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will encode a nFAPI P4 message structure pointed to be pMessageBuf into a byte stream pointed to by pPackedBuf. + * + */ +int nr_nfapi_p4_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nr_nfapi_p4_p5_codec_config_t* config); + +/*! \brief Decodes a NFAPI P4 message header + * \param pMessageBuf A pointer to an encoded P4 message header + * \param messageBufLen The size of the encoded P4 message header + * \param pUnpackedBuf A pointer to the nr_nfapi_message_header + * \param unpackedBufLen The size of nr_nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nr_nfapi_p4_p5_message_header structure pointer to by pUnpackedBuf + */ +int nr_nfapi_p4_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nr_nfapi_p4_p5_codec_config_t* config); + +/*! \brief Decodes a NFAPI P4 message + * \param pMessageBuf A pointer to an encoded P4 message + * \param messageBufLen The size of the encoded P4 message + * \param pUnpackedBuf A pointer to the nr_nfapi_message_header + * \param unpackedBufLen The size of nr_nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nfapi p4 message structure pointer to by pUnpackedBuf + */ +int nr_nfapi_p4_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nr_nfapi_p4_p5_codec_config_t* config); + +/*! \brief Encodes an NFAPI P5 message to a buffer + * \param pMessageBuf A pointer to a nfapi p5 message structure + * \param messageBufLen The size of the p5 message structure + * \param pPackedBuf A pointer to the buffer that the p5 message will be packed into + * \param packedBufLen The size of the buffer + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will encode a nFAPI P5 message structure pointed to be pMessageBuf into a byte stream pointed to by pPackedBuf. + * + */ +int nr_nfapi_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nr_nfapi_p4_p5_codec_config_t* config); + +/*! \brief Decodes an NFAPI P5 message header + * \param pMessageBuf A pointer to an encoded P5 message header + * \param messageBufLen The size of the encoded P5 message header + * \param pUnpackedBuf A pointer to the nr_nfapi_message_header + * \param unpackedBufLen The size of nr_nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nr_nfapi_p4_p5_message_header structure pointer to by pUnpackedBuf + */ +int nr_nfapi_p5_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nr_nfapi_p4_p5_codec_config_t* config); + +/*! \brief Decodes a NFAPI P5 message + * \param pMessageBuf A pointer to an encoded P5 message + * \param messageBufLen The size of the encoded P5 message + * \param pUnpackedBuf A pointer to the nr_nfapi_message_header + * \param unpackedBufLen The size of nr_nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nfapi p5 message structure pointer to by pUnpackedBuf + */ +int nr_nfapi_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nr_nfapi_p4_p5_codec_config_t* config); + +/*! \brief Encodes an NFAPI P7 message to a buffer + * \param pMessageBuf A pointer to a nfapi p7 message structure + * \param pPackedBuf A pointer to the buffer that the p7 message will be packed into + * \param packedBufLen The size of the buffer + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will encode a nFAPI P7 message structure pointed to be pMessageBuf into a byte stream pointed to by pPackedBuf. + * + */ +int nr_nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nr_nfapi_p7_codec_config_t* config); + +/*! \brief Decodes an NFAPI P7 message header + * \param pMessageBuf A pointer to an encoded P7 message header + * \param messageBufLen The size of the encoded P7 message header + * \param pUnpackedBuf A pointer to the nr_nfapi_message_header + * \param unpackedBufLen The size of nr_nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nr_nfapi_p7_message_header structure pointer to by pUnpackedBuf + + */ +int nr_nfapi_p7_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nr_nfapi_p7_codec_config_t* config); + +/*! \brief Decodes a NFAPI P7 message + * \param pMessageBuf A pointer to an encoded P7 message + * \param messageBufLen The size of the encoded P7 message + * \param pUnpackedBuf A pointer to the nr_nfapi_message_header + * \param unpackedBufLen The size of nr_nfapi_message_header structure. + * \param config A pointer to the nfapi configuration structure + * \return 0 means success, -1 means failure. + * + * The function will decode a byte stream pointed to by pMessageBuf into a nfapi p7 message structure pointer to by pUnpackedBuf + */ +int nr_nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nr_nfapi_p7_codec_config_t* config); + +/*! \brief Calculates the checksum of a message + * + * \param buffer Pointer to the packed message + * \param len The length of the message + * \return The checksum. If there is an error the function with return -1 + */ +uint32_t nr_nfapi_p7_calculate_checksum(uint8_t* buffer, uint32_t len); + +/*! \brief Calculates & updates the checksum in the message + * + * \param buffer Pointer to the packed message + * \param len The length of the message + * \return 0 means success, -1 means failure. + */ +int nr_nfapi_p7_update_checksum(uint8_t* buffer, uint32_t len); + +/*! \brief Updates the transmition time stamp in the p7 message header + * + * \param buffer Pointer to the packed message + * \param timestamp The time stamp value + * \return 0 means success, -1 means failure. + */ +int nr_nfapi_p7_update_transmit_timestamp(uint8_t* buffer, uint32_t timestamp); + +#endif /* _NFAPI_INTERFACE_H_ */ diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h new file mode 100755 index 0000000000000000000000000000000000000000..ad4dcc349b9e853733e372cc67cfc04e3095bbfb --- /dev/null +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -0,0 +1,745 @@ +/* + * Copyright 2017 Cisco Systems, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef _FAPI_NR_INTERFACE_NR_EXTENSION_H_ +#define _FAPI_NR_INTERFACE_NR_EXTENSION_H_ +#define _FAPI_NR_INTERFACE_H_ + +#include "stddef.h" + + + +#define FAPI_NR_MAX_NUM_DL_ALLOCATIONS 16 +#define FAPI_NR_MAX_NUM_UL_ALLOCATIONS 16 +#define FAPI_NR_MAX_NUM_SERVING_CELLS 32 +#define FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET 16 +#define FAPI_NR_MAX_NUM_CANDIDATE_BEAMS 16 +#define FAPI_NR_MAX_RA_OCCASION_PER_CSIRS 64 + +typedef unsigned int uint32_t; +typedef unsigned short uint16_t; +typedef unsigned char uint8_t; +typedef signed int int32_t; +typedef signed short int16_t; +typedef signed char int8_t; + + +typedef enum { + FAPI_NR_RX_PDU_BCCH_BCH_TYPE = 0, + FAPI_NR_RX_PDU_BCCH_DLSCH_TYPE +} fapi_nr_rx_pdu_type_e; + + +typedef struct { + uint16_t phy_id; + uint16_t message_id; + uint16_t message_length; + uint16_t spare; +} fapi_nr_p4_p5_message_header_t; + +typedef struct { + uint16_t phy_id; + uint16_t message_id; + uint16_t message_length; + uint16_t m_segment_sequence; /* This consists of 3 fields - namely, M, Segement & Sequence number*/ + uint32_t checksum; + uint32_t transmit_timestamp; +} fapi_nr_p7_message_header_t; + +typedef struct { + uint16_t tag; + uint16_t length; +} fapi_nr_tl_t; +#define FAPI_NR_TAG_LENGTH_PACKED_LEN 4 + +typedef struct { + fapi_nr_tl_t tl; + // common C-RNTI + uint8_t dci_format; + uint8_t frequency_domain_resouce_assignment; // 38.214 chapter 5.1.2.2 + uint8_t time_domain_resource_assignment; // 38.214 chapter 5.1.2.1 + uint8_t frequency_hopping_enabled_flag; + uint8_t frequency_hopping_bits; + uint8_t mcs; + uint8_t new_data_indication; + uint8_t redundancy_version; + uint8_t harq_process; + uint8_t tpc_command; + + uint8_t ul_sul_ind; + + uint8_t carrier_indicator; + uint8_t bwp_indndicator; + uint8_t vrb_to_prb_mapping; + uint8_t downlink_assignment_index1; + uint8_t downlink_assignment_index2; + uint8_t srs_resource_indicator; + uint8_t precoding_information; + uint8_t antenna_ports; + uint8_t srs_request; + uint8_t cqi_csi_request; + uint8_t cbg_transmission_information; + uint8_t ptrs_dmrs_association; + + uint8_t downlink_assignment_index; + uint8_t pucch_resource_indicator; + uint8_t pdsch_to_harq_feedback_timing_indicator; + + uint8_t short_messages_indicator; + + uint8_t prb_bundling_size_indicator; // 38.214 chapter 5.1.2.3 + uint8_t rate_matching_indicator; + uint8_t zp_csi_rs_trigger; + uint8_t transmission_configuration_indication; + uint8_t cbg_flushing_out_information; + + uint8_t slot_format_count; + uint8_t *slot_format_indicators; // 38.213 chapter 11.1.1 + + uint8_t preemption_indication_count; + uint8_t *preemption_indications; // 38.213 chapter 11.2 + + uint8_t tpc_command_count; + uint8_t *tpc_command_numbers; + + uint8_t block_number_count; + uint8_t *block_numbers; + uint8_t dci2_3_srs_request; // 38.212 table 7.3.1.1.2-5 + uint8_t dci2_3_tpc_command; + +} fapi_nr_dci_pdu_rel15_t; +#define FAPI_NR_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG 0x2020 + +typedef struct { + fapi_nr_tl_t tl; + uint8_t uci_format; + uint8_t uci_channel; + uint8_t harq_ack_bits; + uint32_t harq_ack; + uint8_t csi_bits; + uint32_t csi; + uint8_t sr_bits; + uint32_t sr; +} fapi_nr_uci_pdu_rel15_t; + + + +// +// Top level FAPI messages +// + + + +// +// P7 +// + + typedef struct { + uint16_t rnti; + uint8_t dci_type; + uint8_t dci_size; + fapi_nr_dci_pdu_rel15_t dci; + }fapi_nr_dci_indication_pdu_t; + + typedef struct { + fapi_nr_tl_t tl; + uint16_t number_of_dcis; + fapi_nr_dci_indication_pdu_t* dci_list; + } fapi_nr_dci_indication_body_t; + +/// +typedef struct { + fapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + fapi_nr_dci_indication_body_t dci_indication_body; +} fapi_nr_dci_indication_t; + + #define FAPI_NR_TX_MAX_PDU 100 + typedef struct { + fapi_nr_tl_t tl; + uint32_t pdu_index; + uint32_t pdu_length; + uint8_t* pdu; + } fapi_nr_rx_request_body_t; + #define FAPI_NR_TX_REQUEST_BODY_TAG 0x2022 + +/// +typedef struct { + fapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + fapi_nr_rx_request_body_t rx_request_body; +} fapi_nr_rx_indication_t; + + typedef struct { + fapi_nr_tl_t tl; + uint8_t ul_cqi; + uint16_t timing_advance; + uint16_t rnti; + } fapi_nr_tx_config_t; + + + #define FAPI_NR_TX_MAX_SEGMENTS 32 + typedef struct { + uint16_t pdu_length; + uint16_t pdu_index; + uint8_t* pdu; + } fapi_nr_tx_request_pdu_t; + + #define FAPI_NR_RX_IND_MAX_PDU 100 + typedef struct { + fapi_nr_tl_t tl; + fapi_nr_tx_config_t tx_config; + uint16_t number_of_pdus; + fapi_nr_tx_request_pdu_t* tx_pdu_list; + } fapi_nr_tx_request_body_t; + #define FAPI_NR_RX_INDICATION_BODY_TAG 0x2023 + +/// +typedef struct { + fapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + fapi_nr_tx_request_body_t tx_request_body; +} fapi_nr_tx_request_t; + + + typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + /*fapi_nr_ul_config_ulsch_pdu ulsch_pdu; + fapi_nr_ul_config_ulsch_cqi_ri_pdu ulsch_cqi_ri_pdu; + fapi_nr_ul_config_ulsch_harq_pdu ulsch_harq_pdu; + fapi_nr_ul_config_ulsch_cqi_harq_ri_pdu ulsch_cqi_harq_ri_pdu; + fapi_nr_ul_config_uci_cqi_pdu uci_cqi_pdu; + fapi_nr_ul_config_uci_sr_pdu uci_sr_pdu; + fapi_nr_ul_config_uci_harq_pdu uci_harq_pdu; + fapi_nr_ul_config_uci_sr_harq_pdu uci_sr_harq_pdu; + fapi_nr_ul_config_uci_cqi_harq_pdu uci_cqi_harq_pdu; + fapi_nr_ul_config_uci_cqi_sr_pdu uci_cqi_sr_pdu; + fapi_nr_ul_config_uci_cqi_sr_harq_pdu uci_cqi_sr_harq_pdu; + fapi_nr_ul_config_srs_pdu srs_pdu; + fapi_nr_ul_config_harq_buffer_pdu harq_buffer_pdu; + fapi_nr_ul_config_ulsch_uci_csi_pdu ulsch_uci_csi_pdu; + fapi_nr_ul_config_ulsch_uci_harq_pdu ulsch_uci_harq_pdu; + fapi_nr_ul_config_ulsch_csi_uci_harq_pdu ulsch_csi_uci_harq_pdu;*/ + }; + } fapi_nr_ul_config_request_pdu_t; + + typedef struct { + fapi_nr_tl_t tl; + fapi_nr_ul_config_request_pdu_t ul_config_pdu_list; + } fapi_nr_ul_config_request_body_t; +/// +typedef struct { + fapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + fapi_nr_ul_config_request_body_t ul_config_request_body; +} fapi_nr_ul_config_request_t; + + + + typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + /*fapi_nr_dl_config_dlsch_pdu dlsch_pdu; + fapi_nr_dl_config_prs_pdu prs_pdu; + fapi_nr_dl_config_csi_rs_pdu csi_rs_pdu;*/ + }; + } fapi_nr_dl_config_request_pdu_t; + +typedef struct { + fapi_nr_p7_message_header_t header; + uint16_t sfn_sf_slot; + fapi_nr_dl_config_request_pdu_t dl_config_request_body; +} fapi_nr_dl_config_request_t; + + +// +// P5 +// + + typedef struct { + uint32_t frequency_domain_resource; + uint8_t duration; + uint8_t cce_reg_mapping_type; // interleaved or noninterleaved + uint8_t cce_reg_interleaved_reg_bundle_size; // valid if CCE to REG mapping type is interleaved type + uint8_t cce_reg_interleaved_interleaver_size; // valid if CCE to REG mapping type is interleaved type + uint8_t cce_reg_interleaved_shift_index; // valid if CCE to REG mapping type is interleaved type + uint8_t precoder_granularity; + uint8_t tci_state_pdcch; + + uint8_t tci_present_in_dci; + uint16_t pdcch_dmrs_scrambling_id; + } fapi_nr_coreset_t; + + typedef struct { + fapi_nr_coreset_t coreset; + + uint8_t monitoring_slot_peridicity; + uint8_t monitoring_slot_offset; + uint16_t duration; + uint16_t monitoring_symbols_within_slot; + uint8_t number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16 + + uint8_t dci_2_0_number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16 + uint8_t dci_2_3_monitorying_periodicity; + uint8_t dci_2_3_number_of_candidates; + + } fapi_nr_search_space_t; + + typedef struct { + fapi_nr_search_space_t search_space_sib1; + fapi_nr_search_space_t search_space_others_sib; + fapi_nr_search_space_t search_space_paging; + fapi_nr_coreset_t coreset_ra; // common coreset + fapi_nr_search_space_t search_space_ra; + } fapi_nr_pdcch_config_common_t; + + typedef struct { + uint8_t k0; + uint8_t mapping_type; + uint8_t symbol_starting; + uint8_t symbol_length; + } fapi_nr_pdsch_time_domain_resource_allocation_t; + + typedef struct { + fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS]; + } fapi_nr_pdsch_config_common_t; + + typedef struct { + uint8_t prach_configuration_index; + uint8_t msg1_fdm; + uint8_t msg1_frequency_start; + uint8_t zero_correlation_zone_config; + uint8_t preamble_received_target_power; + uint8_t preamble_transmission_max; + uint8_t power_ramping_step; + uint8_t ra_window_size; + + uint8_t total_number_of_preamble; + uint8_t ssb_occasion_per_rach; + uint8_t cb_preamble_per_ssb; + + uint8_t group_a_msg3_size; + uint8_t group_a_number_of_preamble; + uint8_t group_b_power_offset; + uint8_t contention_resolution_timer; + uint8_t rsrp_threshold_ssb; + uint8_t rsrp_threshold_ssb_sul; + uint8_t prach_length; // l839, l139 + uint8_t prach_root_sequence_index; // 0 - 837 for l839, 0 - 137 for l139 + uint8_t msg1_subcarrier_spacing; + uint8_t restrictedset_config; + uint8_t msg3_transform_precoding; + } fapi_nr_rach_config_common_t; + + typedef struct { + uint8_t k2; + uint8_t mapping_type; + uint8_t symbol_starting; + uint8_t symbol_length; + } fapi_nr_pusch_time_domain_resource_allocation_t; + + typedef struct { + uint8_t group_hopping_enabled_transform_precoding; + fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS]; + uint8_t msg3_delta_preamble; + uint8_t p0_nominal_with_grant; + } fapi_nr_pusch_config_common_t; + + typedef struct { + uint8_t pucch_resource_common; + uint8_t pucch_group_hopping; + uint8_t hopping_id; + uint8_t p0_nominal; + } fapi_nr_pucch_config_common_t; + + typedef struct { + + uint8_t subcarrier_spacing_common; + uint8_t ssb_subcarrier_offset; + uint8_t dmrs_type_a_position; + uint8_t pdcch_config_sib1; + uint8_t cell_barred; + uint8_t intra_frquency_reselection; + + uint16_t system_frame_number; + uint8_t ssb_index; + uint8_t half_frame_bit; + } fapi_nr_pbch_config_t; + + typedef struct { + fapi_nr_tl_t tl; + + fapi_nr_pdcch_config_common_t pdcch_config_common; + fapi_nr_pdsch_config_common_t pdsch_config_common; + + } fapi_nr_dl_bwp_common_config_t; + + + + typedef struct { + uint16_t int_rnti; + uint8_t time_frequency_set; + uint8_t dci_payload_size; + uint8_t serving_cell_id[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell + uint8_t position_in_dci[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell + } fapi_nr_downlink_preemption_t; + + typedef struct { + uint8_t tpc_index; + uint8_t tpc_index_sul; + uint8_t target_cell; + } fapi_nr_pusch_tpc_command_config_t; + + typedef struct { + uint8_t tpc_index_pcell; + uint8_t tpc_index_pucch_scell; + } fapi_nr_pucch_tpc_command_config_t; + + typedef struct { + uint8_t starting_bit_of_format_2_3; + uint8_t feild_type_format_2_3; + } fapi_nr_srs_tpc_command_config_t; + + typedef struct { + fapi_nr_downlink_preemption_t downlink_preemption; + fapi_nr_pusch_tpc_command_config_t tpc_pusch; + fapi_nr_pucch_tpc_command_config_t tpc_pucch; + fapi_nr_srs_tpc_command_config_t tpc_srs; + } fapi_nr_pdcch_config_dedicated_t; + + typedef struct { + uint8_t dmrs_type; + uint8_t dmrs_addition_position; + uint8_t max_length; + uint16_t scrambling_id0; + uint16_t scrambling_id1; + uint8_t ptrs_frequency_density[2]; // phase tracking rs + uint8_t ptrs_time_density[3]; // phase tracking rs + uint8_t ptrs_epre_ratio; // phase tracking rs + uint8_t ptrs_resource_element_offset; // phase tracking rs + } fapi_nr_dmrs_downlink_config_t; + + typedef struct { + uint8_t bwp_or_cell_level; + uint8_t pattern_type; + uint32_t resource_blocks[9]; // bitmaps type 275 bits + uint8_t slot_type; // bitmaps type one/two slot(s) + uint32_t symbols_in_resouece_block; // bitmaps type 14/28 bits + uint8_t periodic; // bitmaps type + uint32_t pattern[2]; // bitmaps type 2/4/5/8/10/20/40 bits + + fapi_nr_coreset_t coreset; // coreset + + uint8_t subcarrier_spacing; + uint8_t mode; + } fapi_nr_rate_matching_pattern_group_t; + + typedef struct { + // resource mapping + uint8_t row; // row1/row2/row4/other + uint16_t frequency_domain_allocation; // 4/12/3/6 bits + uint8_t number_of_ports; + uint8_t first_ofdm_symbol_in_time_domain; + uint8_t first_ofdm_symbol_in_time_domain2; + uint8_t cdm_type; + uint8_t density; // .5/1/3 + uint8_t density_dot5_type; // even/odd PRBs + + uint8_t frequency_band_starting_rb; // freqBand + uint8_t frequency_band_number_of_rb; // freqBand + + // periodicityAndOffset + uint8_t periodicity; // slot4/5/8/10/16/20/32/40/64/80/160/320/640 + uint32_t offset; // 0..639 bits + } fapi_nr_zp_csi_rs_resource_t; + + typedef struct { + uint16_t data_scrambling_id_pdsch; + fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_a; + fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_b; + uint8_t vrb_to_prb_interleaver; + uint8_t resource_allocation; + fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS]; + uint8_t pdsch_aggregation_factor; + fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group1; + fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group2; + uint8_t rbg_size; + uint8_t mcs_table; + uint8_t max_num_of_code_word_scheduled_by_dci; + uint8_t bundle_size; // prb_bundling static + uint8_t bundle_size_set1; // prb_bundling dynamic + uint8_t bundle_size_set2; // prb_bundling dynamic + fapi_nr_zp_csi_rs_resource_t periodically_zp_csi_rs_resource_set[FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET]; + } fapi_nr_pdsch_config_dedicated_t; + + typedef struct { + uint16_t starting_prb; + uint8_t intra_slot_frequency_hopping; + uint16_t second_hop_prb; + uint8_t format; // pucch format 0..4 + uint8_t initial_cyclic_shift; + uint8_t number_of_symbols; + uint8_t starting_symbol_index; + uint8_t time_domain_occ; + uint8_t number_of_prbs; + uint8_t occ_length; + uint8_t occ_index; + } fapi_nr_pucch_resource_t; + + typedef struct { + uint8_t periodicity; + uint8_t number_of_harq_process; + fapi_nr_pucch_resource_t n1_pucch_an; + } fapi_nr_sps_config_t; + + typedef struct { + uint8_t beam_failure_instance_max_count; + uint8_t beam_failure_detection_timer; + } fapi_nr_radio_link_monitoring_config_t; + + typedef struct { + fapi_nr_pdcch_config_dedicated_t pdcch_config_dedicated; + fapi_nr_pdsch_config_dedicated_t pdsch_config_dedicated; + fapi_nr_sps_config_t sps_config; + fapi_nr_radio_link_monitoring_config_t radio_link_monitoring_config; + + } fapi_nr_dl_bwp_dedicated_config_t; + + typedef struct { + fapi_nr_rach_config_common_t rach_config_common; + fapi_nr_pusch_config_common_t pusch_config_common; + fapi_nr_pucch_config_common_t pucch_config_common; + + } fapi_nr_ul_bwp_common_config_t; + + typedef struct { + uint8_t inter_slot_frequency_hopping; + uint8_t additional_dmrs; + uint8_t max_code_rate; + uint8_t number_of_slots; + uint8_t pi2bpsk; + uint8_t simultaneous_harq_ack_csi; + } fapi_nr_pucch_format_config_t; + + typedef struct { + fapi_nr_pucch_format_config_t format1; + fapi_nr_pucch_format_config_t format2; + fapi_nr_pucch_format_config_t format3; + fapi_nr_pucch_format_config_t format4; + fapi_nr_pucch_resource_t multi_csi_pucch_resources[2]; + uint8_t dl_data_to_ul_ack[8]; + // pucch power control + uint8_t deltaF_pucch_f0; + uint8_t deltaF_pucch_f1; + uint8_t deltaF_pucch_f2; + uint8_t deltaF_pucch_f3; + uint8_t deltaF_pucch_f4; + uint8_t two_pucch_pc_adjusment_states; + } fapi_nr_pucch_config_dedicated_t; + + typedef struct { + uint8_t dmrs_type; + uint8_t dmrs_addition_position; + + uint8_t ptrs_type; //cp-OFDM, dft-S-OFDM + uint16_t ptrs_frequency_density[2]; + uint8_t ptrs_time_density[3]; + uint8_t ptrs_max_number_of_ports; + uint8_t ptrs_resource_element_offset; + uint8_t ptrs_power; + uint16_t ptrs_sample_density[5]; + uint8_t ptrs_time_density_transform_precoding; + + uint8_t max_length; + uint16_t scrambling_id0; + uint16_t scrambling_id1; + uint8_t npusch_identity; + uint8_t disable_sequence_group_hopping; + uint8_t sequence_hopping_enable; + } fapi_nr_dmrs_uplink_config_t; + + typedef struct { + uint8_t tpc_accmulation; + uint8_t msg3_alpha; + uint8_t p0_nominal_with_grant; + uint8_t two_pusch_pc_adjustments_states; + uint8_t delta_mcs; + } fapi_nr_pusch_power_control_t; + + typedef struct { + uint16_t data_scrambling_identity; + uint8_t tx_config; + fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_a; + fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_b; + fapi_nr_pusch_power_control_t pusch_power_control; + uint8_t frequency_hopping; + uint16_t frequency_hopping_offset_lists[4]; + uint8_t resource_allocation; + fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS]; + uint8_t pusch_aggregation_factor; + uint8_t mcs_table; + uint8_t mcs_table_transform_precoder; + uint8_t transform_precoder; + uint8_t codebook_subset; + uint8_t max_rank; + uint8_t rbg_size; + + //uci-OnPUSCH + uint8_t uci_on_pusch_type; //dynamic, semi-static + uint8_t beta_offset_ack_index1[4]; + uint8_t beta_offset_ack_index2[4]; + uint8_t beta_offset_ack_index3[4]; + uint8_t beta_offset_csi_part1_index1[4]; + uint8_t beta_offset_csi_part1_index2[4]; + uint8_t beta_offset_csi_part2_index1[4]; + uint8_t beta_offset_csi_part2_index2[4]; + + uint8_t tp_pi2BPSK; + } fapi_nr_pusch_config_dedicated_t; + + typedef struct { + uint8_t frequency_hopping; + fapi_nr_dmrs_uplink_config_t cg_dmrs_configuration; + uint8_t mcs_table; + uint8_t mcs_table_transform_precoder; + + //uci-OnPUSCH + uint8_t uci_on_pusch_type; //dynamic, semi-static + uint8_t beta_offset_ack_index1[4]; + uint8_t beta_offset_ack_index2[4]; + uint8_t beta_offset_ack_index3[4]; + uint8_t beta_offset_csi_part1_index1[4]; + uint8_t beta_offset_csi_part1_index2[4]; + uint8_t beta_offset_csi_part2_index1[4]; + uint8_t beta_offset_csi_part2_index2[4]; + + uint8_t resource_allocation; + // rgb-Size structure missing in spec. + uint8_t power_control_loop_to_use; + // p0-PUSCH-Alpha + uint8_t p0; + uint8_t alpha; + + uint8_t transform_precoder; + uint8_t number_of_harq_process; + uint8_t rep_k; + uint8_t rep_k_rv; + uint8_t periodicity; + uint8_t configured_grant_timer; + // rrc-ConfiguredUplinkGrant + uint16_t time_domain_offset; + uint8_t time_domain_allocation; + uint32_t frequency_domain_allocation; + uint8_t antenna_ports; + uint8_t dmrs_seq_initialization; + uint8_t precoding_and_number_of_layers; + uint8_t srs_resource_indicator; + uint8_t mcs_and_tbs; + uint8_t frequency_hopping_offset; + uint8_t path_loss_reference_index; + + } fapi_nr_configured_grant_config_t; + + typedef struct { + uint8_t qcl_type1_serving_cell_index; + uint8_t qcl_type1_bwp_id; + uint8_t qcl_type1_rs_type; // csi-rs or ssb + uint8_t qcl_type1_nzp_csi_rs_resource_id; + uint8_t qcl_type1_ssb_index; + uint8_t qcl_type1_type; + + uint8_t qcl_type2_serving_cell_index; + uint8_t qcl_type2_bwp_id; + uint8_t qcl_type2_rs_type; // csi-rs or ssb + uint8_t qcl_type2_nzp_csi_rs_resource_id; + uint8_t qcl_type2_ssb_index; + uint8_t qcl_type2_type; + + } fapi_nr_tci_state_t; + + typedef struct { + uint8_t root_sequence_index; + // rach genertic + uint8_t prach_configuration_index; + uint8_t msg1_fdm; + uint8_t msg1_frequency_start; + uint8_t zero_correlation_zone_config; + uint8_t preamble_received_target_power; + uint8_t preamble_transmission_max; + uint8_t power_ramping_step; + uint8_t ra_window_size; + + uint8_t rsrp_threshold_ssb; + // PRACH-ResourceDedicatedBFR + uint8_t bfr_ssb_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + uint8_t bfr_ssb_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + // NZP-CSI-RS-Resource + uint8_t bfr_csi_rs_nzp_resource_mapping[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + uint8_t bfr_csi_rs_power_control_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + uint8_t bfr_csi_rs_power_control_offset_ss[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + uint16_t bfr_csi_rs_scrambling_id[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + uint8_t bfr_csi_rs_resource_periodicity[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + uint16_t bfr_csi_rs_resource_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + fapi_nr_tci_state_t qcl_infomation_periodic_csi_rs[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + + uint8_t bfr_csirs_ra_occasions[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; + uint8_t bfr_csirs_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS][FAPI_NR_MAX_RA_OCCASION_PER_CSIRS]; + + uint8_t ssb_per_rach_occasion; + uint8_t ra_ssb_occasion_mask_index; + fapi_nr_search_space_t recovery_search_space; + // RA-Prioritization + uint8_t power_ramping_step_high_priority; + uint8_t scaling_factor_bi; + uint8_t beam_failure_recovery_timer; + } fapi_nr_beam_failure_recovery_config_t; + + typedef struct { + fapi_nr_pucch_config_dedicated_t pucch_config_dedicated; + fapi_nr_pusch_config_dedicated_t pusch_config_dedicated; + fapi_nr_configured_grant_config_t configured_grant_config; + // SRS-Config + uint8_t srs_tpc_accumulation; + fapi_nr_beam_failure_recovery_config_t beam_failure_recovery_config; + + } fapi_nr_ul_bwp_dedicated_config_t; + +#define FAPI_NR_CONFIG_REQUEST_MASK_PBCH 0x01 +#define FAPI_NR_CONFIG_REQUEST_MASK_DL_BWP_COMMON 0x02 +#define FAPI_NR_CONFIG_REQUEST_MASK_UL_BWP_COMMON 0x04 +#define FAPI_NR_CONFIG_REQUEST_MASK_DL_BWP_DEDICATED 0x08 +#define FAPI_NR_CONFIG_REQUEST_MASK_UL_BWP_DEDICATED 0x10 + +typedef struct { + fapi_nr_p4_p5_message_header_t header; + uint8_t num_tlv; + uint32_t config_mask; + + fapi_nr_pbch_config_t pbch_config; // MIB + + fapi_nr_dl_bwp_common_config_t dl_bwp_common; + fapi_nr_dl_bwp_dedicated_config_t dl_bwp_dedicated; + + fapi_nr_ul_bwp_common_config_t ul_bwp_common; + fapi_nr_ul_bwp_dedicated_config_t ul_bwp_dedicated; + +} fapi_nr_config_request_t; + +#endif /* _FAPI_INTERFACE_H_ */ diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h index 21e0fab8ca2992d475acd06f7d584534c66aefd0..9a219df43e072975a349d85e0182e90bfe9f3051 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h @@ -1,5 +1,5 @@ -#ifndef _NFAPI_INTERFACE_NR_H_ -#define _NFAPI_INTERFACE_NR_H_ +#ifndef _NFAPI_NR_INTERFACE_H_ +#define _NFAPI_NR_INTERFACE_H_ #include "nfapi_interface.h" @@ -62,6 +62,8 @@ typedef struct typedef struct { nfapi_uint16_tlv_t numerology_index_mu; nfapi_uint16_tlv_t duplex_mode; + nfapi_uint16_tlv_t dl_cyclic_prefix_type; + nfapi_uint16_tlv_t ul_cyclic_prefix_type; } nfapi_nr_subframe_config_t; #define NFAPI_NR_SUBFRAME_CONFIG_DUPLEX_MODE_TAG 0x5001 @@ -74,6 +76,23 @@ typedef struct { typedef struct { nfapi_uint16_tlv_t tx_antenna_ports; nfapi_uint16_tlv_t rx_antenna_ports; + nfapi_uint16_tlv_t dl_channel_bandwidth; + nfapi_uint16_tlv_t ul_channel_bandwidth; + nfapi_uint16_tlv_t dl_BWP_carrierBandwidth; + nfapi_uint16_tlv_t ul_BWP_carrierBandwidth; + nfapi_uint16_tlv_t dl_locationAndBandwidth; + nfapi_uint16_tlv_t ul_locationAndBandwidth; + nfapi_uint16_tlv_t dl_BWP_SubcarrierSpacing; + nfapi_uint16_tlv_t ul_BWP_SubcarrierSpacing; + nfapi_uint16_tlv_t dl_absoluteFrequencyPointA; + nfapi_uint16_tlv_t ul_absoluteFrequencyPointA; + nfapi_uint16_tlv_t dl_offsetToCarrier; + nfapi_uint16_tlv_t ul_offsetToCarrier; + nfapi_uint16_tlv_t dl_SCS_SubcarrierSpacing; + nfapi_uint16_tlv_t ul_SCS_SubcarrierSpacing; + nfapi_uint16_tlv_t dl_SCS_SpecificCarrier_k0; + nfapi_uint16_tlv_t ul_SCS_SpecificCarrier_k0; + nfapi_uint16_tlv_t NIA_SubcarrierSpacing; } nfapi_nr_rf_config_t; #define NFAPI_NR_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG 0x500A @@ -86,7 +105,8 @@ typedef struct { nfapi_uint16_tlv_t physical_cell_id; nfapi_uint16_tlv_t half_frame_index; nfapi_uint16_tlv_t ssb_subcarrier_offset; - nfapi_uint16_tlv_t ssb_position_in_burst; + nfapi_uint16_tlv_t ssb_sib1_position_in_burst; + nfapi_uint16_tlv_t ssb_scg_position_in_burst; nfapi_uint16_tlv_t ssb_periodicity; nfapi_uint16_tlv_t ss_pbch_block_power; nfapi_uint16_tlv_t n_ssb_crb; @@ -115,45 +135,10 @@ typedef struct { } nfapi_nr_rach_config_t; typedef struct { - //NR FrequencyInfoDL - nfapi_uint16_tlv_t absoluteFrequencySSB; - nfapi_uint16_tlv_t ssb_SubcarrierOffset; ///// L1 parameter 'kssb' - nfapi_uint16_tlv_t DL_FreqBandIndicatorNR; - nfapi_uint16_tlv_t DL_absoluteFrequencyPointA; ///// L1 parameter 'offset-ref-low-scs-ref-PRB' - //NR DL SCS-SpecificCarrier ///// L1 parameter 'offset-pointA-set' - nfapi_uint16_tlv_t DL_offsetToCarrier; ///// L1 parameter 'offset-pointA-low-scs ' - nfapi_uint16_tlv_t DL_SCS_SubcarrierSpacing; ///// L1 parameter 'ref-scs' - nfapi_uint16_tlv_t DL_SCS_SpecificCarrier_k0; ///// L1 parameter 'k0' - nfapi_uint16_tlv_t DL_carrierBandwidth; ///// L1 parameter 'BW' -} nfapi_nr_dl_frequencyinfo_t; - -typedef struct { - //NR BWP-DownlinkCommon - nfapi_uint16_tlv_t DL_locationAndBandwidth; ///// L1 parameter 'DL-BWP-loc' - nfapi_uint16_tlv_t DL_BWP_SubcarrierSpacing; ///// Corresponds to subcarrier spacing according to 38.211, Table 4.2-1 - nfapi_uint16_tlv_t DL_BWP_prefix_type; -} nfapi_nr_bwp_dl_t; - -typedef struct { - //NR FrequencyInfoUL - nfapi_uint16_tlv_t UL_FreqBandIndicatorNR; - nfapi_uint16_tlv_t UL_absoluteFrequencyPointA; ///// L1 parameter 'offset-ref-low-scs-ref-PRB' - nfapi_uint16_tlv_t UL_additionalSpectrumEmission; - nfapi_uint16_tlv_t UL_p_Max; - nfapi_uint16_tlv_t UL_frequencyShift7p5khz; - //NR UL SCS-SpecificCarrier ///// L1 parameter 'offset-pointA-set' - nfapi_uint16_tlv_t UL_offsetToCarrier; ///// L1 parameter 'offset-pointA-low-scs ' - nfapi_uint16_tlv_t UL_SCS_SubcarrierSpacing; ///// L1 parameter 'ref-scs' - nfapi_uint16_tlv_t UL_SCS_SpecificCarrier_k0; ///// L1 parameter 'k0' - nfapi_uint16_tlv_t UL_carrierBandwidth; ///// L1 parameter 'BW' -} nfapi_nr_ul_frequencyinfo_t; - -typedef struct { - //NR BWP-UplinkCommon ///// L1 parameter 'initial-UL-BWP' - nfapi_uint16_tlv_t UL_locationAndBandwidth; ///// L1 parameter 'DL-BWP-loc' - nfapi_uint16_tlv_t UL_BWP_SubcarrierSpacing; ///// Corresponds to subcarrier spacing according to 38.211, Table 4.2-1 - nfapi_uint16_tlv_t UL_BWP_prefix_type; -} nfapi_nr_bwp_ul_t; + nfapi_uint16_tlv_t dmrs_TypeA_Position; ///// Position of (first) DL DM-RS + nfapi_uint16_tlv_t TimeDomainResourceAllocation_k0; ///// L1 parameter 'K0' + nfapi_uint16_tlv_t TimeDomainResourceAllocation_mappingType; ///// L1 parameter 'Mapping-type' +} nfapi_nr_pdsch_config_t; typedef struct { nfapi_uint16_tlv_t groupHoppingEnabledTransformPrecoding; ///// L1 parameter 'Group-hopping-enabled-Transform-precoding' @@ -168,60 +153,6 @@ typedef struct { nfapi_uint16_tlv_t p0_nominal; ///// L1 parameter 'p0-nominal-pucch' } nfapi_nr_pucch_config_t; -typedef struct { - nfapi_uint16_tlv_t TimeDomainResourceAllocation_k0; ///// L1 parameter 'K0' - nfapi_uint16_tlv_t TimeDomainResourceAllocation_mappingType; ///// L1 parameter 'Mapping-type' -} nfapi_nr_pdsch_config_t; - -typedef struct{ - nfapi_uint16_tlv_t controlResourceSetId; ///// L1 parameter 'CORESET-ID' - nfapi_uint16_tlv_t frequencyDomainResources ///// L1 parameter 'CORESET-freq-dom' - nfapi_uint16_tlv_t duration; ///// L1 parameter 'CORESET-time-duration' - nfapi_uint16_tlv_t cce_REG_MappingType; ///// L1 parameter 'CORESET-CCE-REG-mapping-type' - nfapi_uint16_tlv_t reg_BundleSize; ///// L1 parameter 'CORESET-REG-bundle-size' - nfapi_uint16_tlv_t interleaverSize; ///// L1 parameter 'CORESET-interleaver-size' - nfapi_uint16_tlv_t shiftIndex; ///// L1 parameter 'CORESET-shift-index' - nfapi_uint16_tlv_t precoderGranularity; ///// L1 parameter 'CORESET-precoder-granuality' - nfapi_uint16_tlv_t TCI_StateId; ///// L1 parameter 'TCI-StatesPDCCH' - nfapi_uint16_tlv_t tci_PresentInDCI; ///// L1 parameter 'TCI-PresentInDCI' - nfapi_uint16_tlv_t pdcch_DMRS_ScramblingID; ///// L1 parameter 'PDCCH-DMRS-Scrambling-ID' -} nfapi_nr_pdcch_commonControlResourcesSets_t; - -typedef struct{ - nfapi_uint16_tlv_t SearchSpaceId; - nfapi_uint16_tlv_t commonSearchSpaces_controlResourceSetId; - nfapi_uint16_tlv_t SearchSpace_monitoringSlotPeriodicityAndOffset; ///// L1 parameters 'Montoring-periodicity-PDCCH-slot' - nfapi_uint16_tlv_t monitoringSymbolsWithinSlot ///// L1 parameter 'Montoring-symbols-PDCCH-within-slot' - nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel1; ///// L1 parameter 'Aggregation-level-1' - nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel2; ///// L1 parameter 'Aggregation-level-2' - nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel4; ///// L1 parameter 'Aggregation-level-4' - nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel8; ///// L1 parameter 'Aggregation-level-8' - nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel16; ///// L1 parameter 'Aggregation-level-16' - nfapi_uint16_tlv_t Common_dci_Format2_0_nrofCandidates_SFI_And_aggregationLevel; ///// L1 parameters 'SFI-Num-PDCCH-cand' and 'SFI-Aggregation-Level' - nfapi_uint16_tlv_t Common_dci_Format2_3_monitoringPeriodicity; ///// L1 parameter 'SRS-monitoring-periodicity' - nfapi_uint16_tlv_t Common_dci_Format2_3_nrofPDCCH_Candidates; ///// L1 parameter 'SRS-Num-PDCCH-cand' - nfapi_uint16_tlv_t ue_Specific__dci_Formats; -} nfapi_nr_pdcch_commonSearchSpaces_t; - -typedef struct { - nfapi_nr_pdcch_commonControlResourcesSets_t commonControlResourcesSets; - nfapi_nr_pfcch_commonSearchSpaces_t commonSearchSpaces; - nfapi_uint16_tlv_t searchSpaceSIB1; ///// L1 parameter 'rmsi-SearchSpace' - nfapi_uint16_tlv_t searchSpaceOtherSystemInformation; ///// L1 parameter 'osi-SearchSpace' - nfapi_uint16_tlv_t pagingSearchSpace; ///// L1 parameter 'paging-SearchSpace' - nfapi_uint16_tlv_t ra_SearchSpace; ///// L1 parameter 'ra-SearchSpace' - nfapi_uint16_tlv_t rach_ra_ControlResourceSet; ///// L1 parameter 'rach-coreset-configuration' - -} nfapi_nr_pdcch_common_config_t; - -typedef struct { - nfapi_uint16_tlv_t ssb_PositionsInBurst_PR; ///// L1 parameter 'SSB-Transmitted - nfapi_uint16_tlv_t ssb_periodicityServingCell; - nfapi_uint16_tlv_t dmrs_TypeA_Position; ///// Position of (first) DL DM-RS - nfapi_uint16_tlv_t NIA_SubcarrierSpacing; ///// Used only for non-initial access (e.g. SCells, PCell of SCG) - nfapi_uint16_tlv_t ss_PBCH_BlockPower; -} nfapi_nr_servingcellconfigcommon_t; - typedef struct { //NR TDD-UL-DL-ConfigCommon ///// L1 parameter 'UL-DL-configuration-common' nfapi_uint16_tlv_t referenceSubcarrierSpacing; ///// L1 parameter 'reference-SCS' @@ -255,25 +186,16 @@ typedef struct { nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_subframeAllocation_choice; } nfapi_nr_ratematchpattern_lte_crs_t; - - - typedef struct { nfapi_p4_p5_message_header_t header; - uint8_t num_tlv; + uint8_t num_tlv; nfapi_nr_subframe_config_t subframe_config; nfapi_nr_rf_config_t rf_config; nfapi_nr_sch_config_t sch_config; nfapi_nr_rach_config_t rach_config; - nfapi_nr_dl_frequencyinfo_t dl_frequencyinfo; - nfapi_nr_bwp_dl_t bwp_dl; - nfapi_nr_ul_frequencyinfo_t ul_frequencyinfo; - nfapi_nr_bwp_ul_t bwp_ul; + nfapi_nr_pdsch_config_t pdsch_config; nfapi_nr_pusch_config_t pusch_config; nfapi_nr_pucch_config_t pucch_config; - nfapi_nr_pdsch_config_t pdsch_config; - nfapi_nr_pucch_config_t pdcch_config; - nfapi_nr_servingcellconfigcommon_t servingcellconfigcommon; nfapi_nr_tdd_ul_dl_config_t tdd_ul_dl_config; nfapi_nr_ratematchpattern_t ratematchpattern; nfapi_nr_ratematchpattern_lte_crs_t ratematchpattern_lte_crs; @@ -283,35 +205,229 @@ typedef struct { } nfapi_nr_config_request_t; typedef enum { - NFAPI_NR_DL_DCI_FORMAT_1_0 = 0, - NFAPI_NR_DL_DCI_FORMAT_1_1, + NFAPI_NR_DL_DCI_FORMAT_1_0 = 0, + NFAPI_NR_DL_DCI_FORMAT_1_1, NFAPI_NR_DL_DCI_FORMAT_2_0, NFAPI_NR_DL_DCI_FORMAT_2_1, NFAPI_NR_DL_DCI_FORMAT_2_2, - NFAPI_NR_DL_DCI_FORMAT_2_3, + NFAPI_NR_DL_DCI_FORMAT_2_3 } nfapi_nr_dl_dci_format_e; typedef enum { - NFAPI_NR_UL_DCI_FORMAT_0_0 = 0, - NFAPI_NR_UL_DCI_FORMAT_1_0, + NFAPI_NR_UL_DCI_FORMAT_0_0 = 0, + NFAPI_NR_UL_DCI_FORMAT_1_0, } nfapi_nr_ul_dci_format_e; +typedef enum { + NFAPI_NR_RNTI_new = 0, + NFAPI_NR_RNTI_C, + NFAPI_NR_RNTI_RA, + NFAPI_NR_RNTI_P, + NFAPI_NR_RNTI_CS, + NFAPI_NR_RNTI_TC, + NFAPI_NR_RNTI_SP_CSI, + NFAPI_NR_RNTI_SI, + NFAPI_NR_RNTI_SFI, + NFAPI_NR_RNTI_INT, + NFAPI_NR_RNTI_TPC_PUSCH, + NFAPI_NR_RNTI_TPC_PUCCH, + NFAPI_NR_RNTI_TPC_SRS +} nfapi_nr_rnti_type_e ; + // P7 Sub Structures +//formats 0_0 and 0_1 +typedef struct { + +nfapi_tl_t tl; + +uint8_t cce_idx; +uint8_t aggregation_level; +uint16_t rnti; + +uint8_t dci_format; //1 bit +uint16_t frequency_domain_resource_assignment; //up to 9 bits +uint8_t time_domain_resource_assignment; //0, 1, 2, 3 or 4 bits +uint8_t frequency_hopping_flag; //1 bit +uint8_t mcs; //5 bits +uint8_t new_data_indicator; //1 bit +uint8_t redundancy_version; //2 bits +uint8_t harq_process; //4 bits +uint8_t tpc; //2 bits +uint16_t padding; +uint8_t ul_sul_indicator; //0 or 1 bit + +uint8_t carrier_indicator; //0 or 3 bits +uint8_t bwp_indicator; //0, 1 or 2 bits +uint8_t downlink_assignment_index1; //1 or 2 bits +uint8_t downlink_assignment_index2; //0 or 2 bits +uint8_t srs_resource_indicator; +uint8_t precoding_information; +uint8_t antenna_ports; +uint8_t srs_request; +uint8_t csi_request; +uint8_t cbgti; //CBG Transmission Information: 0, 2, 4, 6 or 8 bits +uint8_t ptrs_dmrs_association; +uint8_t beta_offset_indicator; //0 or 2 bits +uint8_t dmrs_sequence_initialization; //0 or 1 bit +uint8_t ul_sch_indicator; //1 bit + +} nfapi_nr_ul_config_dci_ul_pdu_rel15_t; +//#define NFAPI_NR_UL_CONFIG_REQUEST_DCI_UL_PDU_REL15_TAG 0x???? + +//formats 1_0, 1_1, 2_0, 2_1, 2_2 and 2_3 typedef struct { - nfapi_tl_t tl; - // conf - uint8_t dci_format; - uint8_t cce_idx; - uint8_t aggregation_level; - uint16_t rnti; - // DCI fields + +nfapi_tl_t tl; + +uint8_t cce_idx; +uint8_t aggregation_level; +uint16_t rnti; + +uint8_t dci_format; //1 bit +uint16_t frequency_domain_resource_assignment; //up to 9 bits + +uint8_t ra_preamble_index; //6 bits +uint8_t ul_sul_indicator; //1 bit +uint8_t ss_pbch_index; //6 bits +uint8_t prach_mask_index; //4 bits +uint16_t reserved; //1_0/C-RNTI:10 bits, 1_0/P-RNTI: 6 bits, 1_0/SI-&RA-RNTI: 16 bits + +uint8_t time_domain_resource_assignment; //0, 1, 2, 3 or 4 bits +uint8_t vrb_to_prb_mapping; //0 or 1 bit +uint8_t mcs; //5 bits +uint8_t new_data_indicator; //1 bit +uint8_t redundancy_version; //2 bits +uint8_t harq_process; //4 bits +uint8_t downlink_assignment_index; //0, 2 or 4 bits +uint8_t tpc; //2 bits +uint8_t pucch_resource_indicator; //3 bits +uint8_t pdsch_to_harq_feedback_timing_indicator; //0, 1, 2 or 3 bits + +uint8_t short_messages_indicator; //2 bits +uint8_t short_messages; //8 bits +uint8_t tb_scaling; //2 bits + +uint8_t carrier_indicator; //0 or 3 bits +uint8_t bwp_indicator; //0, 1 or 2 bits +uint8_t prb_bundling_size_indicator; //0 or 1 bits +uint8_t rate_matching_indicator; //0, 1 or 2 bits +uint8_t zp_csi_rs_trigger; //0, 1 or 2 bits +uint8_t antenna_ports; //4, 5 or 6 bits +uint8_t transmission_configuration_indication; //0 or 3 bits +uint8_t srs_request; //2 bits +uint8_t cbgti; //CBG Transmission Information: 0, 2, 4, 6 or 8 bits +uint8_t cbgfi; //CBG Flushing Out Information: 0 or 1 bit +uint8_t dmrs_sequence_initialization; //0 or 1 bit + +uint8_t slot_format_indicator_count; +uint8_t *slot_format_indicators; + +uint8_t pre_emption_indication_count; +uint16_t *pre_emption_indications; //14 bit + +uint8_t block_number_count; +uint8_t *block_numbers; } nfapi_nr_dl_config_dci_dl_pdu_rel15_t; -#define NFAPI_NR_DL_CONFIG_REQUEST_DCI_DL_PDU_REL15_TAG +//#define NFAPI_NR_DL_CONFIG_REQUEST_DCI_DL_PDU_REL15_TAG 0x???? + + +typedef struct{ + nfapi_uint16_tlv_t controlResourceSetId; ///// L1 parameter 'CORESET-ID' + nfapi_uint16_tlv_t frequencyDomainResources; ///// L1 parameter 'CORESET-freq-dom' + nfapi_uint16_tlv_t duration; ///// L1 parameter 'CORESET-time-duration' + nfapi_uint16_tlv_t cce_REG_MappingType; ///// L1 parameter 'CORESET-CCE-REG-mapping-type' + nfapi_uint16_tlv_t reg_BundleSize; ///// L1 parameter 'CORESET-REG-bundle-size' + nfapi_uint16_tlv_t interleaverSize; ///// L1 parameter 'CORESET-interleaver-size' + nfapi_uint16_tlv_t shiftIndex; ///// L1 parameter 'CORESET-shift-index' + nfapi_uint16_tlv_t precoderGranularity; ///// L1 parameter 'CORESET-precoder-granuality' + nfapi_uint16_tlv_t TCI_StateId; ///// L1 parameter 'TCI-StatesPDCCH' + nfapi_uint16_tlv_t tci_PresentInDCI; ///// L1 parameter 'TCI-PresentInDCI' + nfapi_uint16_tlv_t pdcch_DMRS_ScramblingID; ///// L1 parameter 'PDCCH-DMRS-Scrambling-ID' +} nfapi_nr_ControlResourcesSets_t; + +typedef struct{ + nfapi_uint16_tlv_t SearchSpaceId; + nfapi_uint16_tlv_t controlResourceSetId; + nfapi_uint16_tlv_t monitoringSlotPeriodicityAndOffset; ///// L1 parameters 'Montoring-periodicity-PDCCH-slot' + nfapi_uint16_tlv_t monitoringSymbolsWithinSlot; ///// L1 parameter 'Montoring-symbols-PDCCH-within-slot' + nfapi_uint16_tlv_t nrofCand_aggLevel1; ///// L1 parameter 'Aggregation-level-1' + nfapi_uint16_tlv_t nrofCand_aggLevel2; ///// L1 parameter 'Aggregation-level-2' + nfapi_uint16_tlv_t nrofCand_aggLevel4; ///// L1 parameter 'Aggregation-level-4' + nfapi_uint16_tlv_t nrofCand_aggLevel8; ///// L1 parameter 'Aggregation-level-8' + nfapi_uint16_tlv_t nrofCand_aggLevel16; ///// L1 parameter 'Aggregation-level-16' + nfapi_uint16_tlv_t Com_dci_Format2_0_nrofCand_SFI_And_aggLevel; ///// L1 parameters 'SFI-Num-PDCCH-cand' and 'SFI-Aggregation-Level' + nfapi_uint16_tlv_t Com_dci_Format2_3_monitoringPeriodicity; ///// L1 parameter 'SRS-monitoring-periodicity' + nfapi_uint16_tlv_t Com_dci_Format2_3_nrofPDCCH_Candidates; ///// L1 parameter 'SRS-Num-PDCCH-cand' + nfapi_uint16_tlv_t ue_Specific_dci_Formats; +} nfapi_nr_SearchSpaces_t; typedef struct { - nfapi_nr_dl_config_dci_dl_pdu_rel15_t dci_dl_pdu_rel15; -} nfapi_nr_dl_config_dci_dl_pdu; + nfapi_tl_t tl; + uint16_t length; + uint16_t pdu_index; + uint16_t transmission_power; +}nfapi_nr_dl_config_bch_pdu_rel15_t; +#define NFAPI_NR_DL_CONFIG_REQUEST_BCH_PDU_REL15_TAG 0x5025 -#endif +typedef struct { + nfapi_tl_t tl; + nfapi_nr_SearchSpaces_t sib1searchSpace; + nfapi_nr_ControlResourcesSets_t sib1ControlResourceSets; + nfapi_nr_SearchSpaces_t sibssearchSpace; + nfapi_nr_ControlResourcesSets_t sibsControlResourceSets; + nfapi_nr_SearchSpaces_t ra_SearchSpace; + nfapi_nr_ControlResourcesSets_t ra_ControlResourceSets; +}nfapi_nr_dl_config_dlsch_pdu_rel15_t; + +typedef struct { + nfapi_tl_t tl; + nfapi_nr_SearchSpaces_t pagingSearchSpace; + nfapi_nr_ControlResourcesSets_t pagingControlResourceSets; +}nfapi_nr_dl_config_pch_pdu_rel15_t; + +typedef struct { + +}nfapi_nr_dl_config_nbch_pdu_rel15_t; + +typedef struct { + +}nfapi_nr_dl_config_npdcch_pdu_rel15_t; + +typedef struct { + +}nfapi_nr_dl_config_ndlsch_pdu_rel15_t; + +typedef struct { + uint8_t pdu_type; + uint8_t pdu_size; + union { + nfapi_nr_dl_config_dci_dl_pdu_rel15_t dci_dl_pdu_rel15; + nfapi_nr_ul_config_dci_ul_pdu_rel15_t dci_ul_pdu_rel15; + nfapi_nr_dl_config_bch_pdu_rel15_t bch_pdu; + nfapi_nr_dl_config_dlsch_pdu_rel15_t dlsch_pdu; + nfapi_nr_dl_config_pch_pdu_rel15_t pch_pdu; + nfapi_nr_dl_config_nbch_pdu_rel15_t nbch_pdu; + nfapi_nr_dl_config_npdcch_pdu_rel15_t npdcch_pdu; + nfapi_nr_dl_config_ndlsch_pdu_rel15_t ndlsch_pdu; + }; +} nfapi_nr_dl_config_request_pdu_t; + +typedef struct { + nfapi_tl_t tl; + //uint8_t number_pdcch_ofdm_symbols; + uint8_t number_dci; + uint16_t number_pdu; + uint8_t number_pdsch_rnti; + nfapi_nr_dl_config_request_pdu_t *dl_config_pdu_list; +} nfapi_nr_dl_config_request_body_t; + +typedef struct { + nfapi_p7_message_header_t header; + uint16_t sfn_sf; + nfapi_nr_dl_config_request_body_t dl_config_request_body; + nfapi_vendor_extension_tlv_t vendor_extension; +} nfapi_nr_dl_config_request_t; + +#endif diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h deleted file mode 100644 index 627c052df55651d49af81af9f3e886a5db4b882b..0000000000000000000000000000000000000000 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Copyright 2017 Cisco Systems, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef _NFAPI_NR_INTERFACE_NR_EXTENSION_H_ -#define _NFAPI_NR_INTERFACE_NR_EXTENSION_H_ -#define _NFAPI_NR_INTERFACE_H_ - -#include "stddef.h" - - - -#define NFAPI_NR_MAX_NUM_DL_ALLOCATIONS 16 -#define NFAPI_NR_MAX_NUM_UL_ALLOCATIONS 16 -#define NFAPI_NR_MAX_NUM_SERVING_CELLS 32 -#define NFAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET 16 - -typedef unsigned int uint32_t; -typedef unsigned short uint16_t; -typedef unsigned char uint8_t; -typedef signed int int32_t; -typedef signed short int16_t; -typedef signed char int8_t; - -typedef struct { - uint16_t phy_id; - uint16_t message_id; - uint16_t message_length; - uint16_t spare; -} nfapi_nr_p4_p5_message_header_t; - -typedef struct { - uint16_t phy_id; - uint16_t message_id; - uint16_t message_length; - uint16_t m_segment_sequence; /* This consists of 3 fields - namely, M, Segement & Sequence number*/ - uint32_t checksum; - uint32_t transmit_timestamp; -} nfapi_nr_p7_message_header_t; - -typedef struct { - uint16_t tag; - uint16_t length; -} nfapi_nr_tl_t; -#define NFAPI_NR_TAG_LENGTH_PACKED_LEN 4 - - - - - -typedef struct { - nfapi_nr_tl_t tl; - // common C-RNTI - uint8_t dci_format; - uint8_t frequency_domain_resouce_assignment; // 38.214 chapter 5.1.2.2 - uint8_t time_domain_resource_assignment; // 38.214 chapter 5.1.2.1 - uint8_t frequency_hopping_enabled_flag; - uint8_t frequency_hopping_bits; - uint8_t mcs; - uint8_t new_data_indication; - uint8_t redundancy_version; - uint8_t harq_process; - uint8_t tpc_command; - - uint8_t ul_sul_ind; - - uint8_t carrier_indicator; - uint8_t bwp_indndicator; - uint8_t vrb_to_prb_mapping; - uint8_t downlink_assignment_index_1; - uint8_t downlink_assignment_index_2; - uint8_t srs_resource_indicator; - uint8_t precoding_information; - uint8_t antenna_ports; - uint8_t srs_request; - uint8_t cqi_csi_request; - uint8_t cbg_transmission_information; - uint8_t ptrs_dmrs_association; - - uint8_t downlink_assignment_index; - uint8_t pucch_resource_indicator; - uint8_t pdsch_to_harq_feedback_timing_indicator; - - uint8_t short_messages_indicator; - - uint8_t prb_bundling_size_indicator; // 38.214 chapter 5.1.2.3 - uint8_t rate_matching_indicator; - uint8_t zp_csi_rs_trigger; - uint8_t transmission_configuration_indication; - uint8_t cbg_flushing_out_information; - - uint8_t slot_format_count; - uint8_t *slot_format_indicators; // 38.213 chapter 11.1.1 - - uint8_t preemption_indication_count; - uint8_t *preemption_indications; // 38.213 chapter 11.2 - - uint8_t tpc_command_count; - uint8_t *tpc_command_numbers; - - uint8_t block_number_count; - uint8_t *block_numbers; - uint8_t dci2_3_srs_request; // 38.212 table 7.3.1.1.2-5 - uint8_t dci2_3_tpc_command; - -} nfapi_nr_dci_pdu_rel15_t; -#define NFAPI_NR_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG 0x2020 - -typedef struct { - nfapi_nr_tl_t tl; - uint8_t uci_format; - uint8_t uci_channel; - uint8_t harq_ack_bits; - uint32_t harq_ack; - uint8_t csi_bits; - uint32_t csi; - uint8_t sr_bits; - uint32_t sr; -} nfapi_nr_uci_pdu_rel15_t; - - - - -// -// Top level NFAPI messages -// - - - -// -// P7 -// - - typedef struct { - uint16_t rnti; - uint8_t dci_type; - uint8_t dci_size; - nfapi_nr_dci_pdu_rel15_t dci; - }nfapi_nr_dci_indication_pdu_t; - - typedef struct { - nfapi_nr_tl_t tl; - uint16_t number_of_dcis; - nfapi_nr_dci_indication_pdu_t* dci_list; - } nfapi_nr_dci_indication_body_t; - -/// -typedef struct { - nfapi_nr_p7_message_header_t header; - uint16_t sfn_sf_slot; - nfapi_nr_dci_indication_body_t dci_indication_body; -} nfapi_nr_dci_indication_t; - - #define NFAPI_NR_TX_MAX_PDU 100 - typedef struct { - nfapi_nr_tl_t tl; - uint8_t* data; - } nfapi_nr_rx_request_body_t; - #define NFAPI_NR_TX_REQUEST_BODY_TAG 0x2022 - -/// -typedef struct { - nfapi_nr_p7_message_header_t header; - uint16_t sfn_sf_slot; - nfapi_nr_rx_request_body_t rx_request_body; -} nfapi_nr_rx_indication_t; - - typedef struct { - nfapi_nr_tl_t tl; - uint8_t ul_cqi; - uint16_t timing_advance; - } nfapi_nr_tx_indication_t; - - - #define NFAPI_NR_TX_MAX_SEGMENTS 32 - typedef struct { - uint16_t pdu_length; - uint16_t pdu_index; - uint8_t num_segments; - struct { - uint32_t segment_length; - uint8_t* segment_data; - } segments[NFAPI_NR_TX_MAX_SEGMENTS]; - - } nfapi_nr_tx_indication_pdu_t; - - #define NFAPI_NR_RX_IND_MAX_PDU 100 - typedef struct { - nfapi_nr_tl_t tl; - nfapi_nr_tx_indication_t tx_indication; - uint16_t number_of_pdus; - nfapi_nr_tx_indication_pdu_t* tx_pdu_list; - } nfapi_nr_tx_indication_body_t; - #define NFAPI_NR_RX_INDICATION_BODY_TAG 0x2023 - -/// -typedef struct { - nfapi_nr_p7_message_header_t header; - uint16_t sfn_sf_slot; - nfapi_nr_tx_indication_body_t tx_indication_body; -} nfapi_nr_tx_request_t; - - - typedef struct { - uint8_t pdu_type; - uint8_t pdu_size; - union { - /*nfapi_nr_ul_config_ulsch_pdu ulsch_pdu; - nfapi_nr_ul_config_ulsch_cqi_ri_pdu ulsch_cqi_ri_pdu; - nfapi_nr_ul_config_ulsch_harq_pdu ulsch_harq_pdu; - nfapi_nr_ul_config_ulsch_cqi_harq_ri_pdu ulsch_cqi_harq_ri_pdu; - nfapi_nr_ul_config_uci_cqi_pdu uci_cqi_pdu; - nfapi_nr_ul_config_uci_sr_pdu uci_sr_pdu; - nfapi_nr_ul_config_uci_harq_pdu uci_harq_pdu; - nfapi_nr_ul_config_uci_sr_harq_pdu uci_sr_harq_pdu; - nfapi_nr_ul_config_uci_cqi_harq_pdu uci_cqi_harq_pdu; - nfapi_nr_ul_config_uci_cqi_sr_pdu uci_cqi_sr_pdu; - nfapi_nr_ul_config_uci_cqi_sr_harq_pdu uci_cqi_sr_harq_pdu; - nfapi_nr_ul_config_srs_pdu srs_pdu; - nfapi_nr_ul_config_harq_buffer_pdu harq_buffer_pdu; - nfapi_nr_ul_config_ulsch_uci_csi_pdu ulsch_uci_csi_pdu; - nfapi_nr_ul_config_ulsch_uci_harq_pdu ulsch_uci_harq_pdu; - nfapi_nr_ul_config_ulsch_csi_uci_harq_pdu ulsch_csi_uci_harq_pdu;*/ - }; - } nfapi_nr_ul_config_request_pdu_t; - - typedef struct { - nfapi_nr_tl_t tl; - nfapi_nr_ul_config_request_pdu_t ul_config_pdu_list; - } nfapi_nr_ul_config_request_body_t; -/// -typedef struct { - nfapi_nr_p7_message_header_t header; - uint16_t sfn_sf_slot; - nfapi_nr_ul_config_request_body_t ul_config_request_body; -} nfapi_nr_ul_config_request_t; - - - - typedef struct { - uint8_t pdu_type; - uint8_t pdu_size; - union { - /*nfapi_nr_dl_config_dlsch_pdu dlsch_pdu; - nfapi_nr_dl_config_prs_pdu prs_pdu; - nfapi_nr_dl_config_csi_rs_pdu csi_rs_pdu;*/ - }; - } nfapi_nr_dl_config_request_pdu_t; - -/// -typedef struct { - nfapi_nr_p7_message_header_t header; - uint16_t sfn_sf_slot; - nfapi_nr_dl_config_request_pdu_t dl_config_request_body; -} nfapi_nr_dl_config_request_t; - - - -// -// P5 -// - - typedef struct { - uint32_t frequency_domain_resource; - uint8_t duration; - uint8_t cce_reg_mapping_type; // interleaved or noninterleaved - uint8_t cce_reg_interleaved_reg_bundle_size; // valid if CCE to REG mapping type is interleaved type - uint8_t cce_reg_interleaved_interleaver_size; // valid if CCE to REG mapping type is interleaved type - uint8_t cce_reg_interleaved_shift_index; // valid if CCE to REG mapping type is interleaved type - uint8_t precoder_granularity; - uint8_t tci_state_pdcch; - uint8_t tci_present_in_dci; - uint16_t pdcch_dmrs_scrambling_id; - } nfapi_nr_coreset_t; - - typedef struct { - nfapi_nr_coreset_t coreset; - - uint8_t monitoring_slot_peridicity; - uint8_t monitoring_slot_offset; - uint16_t duration; - uint16_t monitoring_symbols_within_slot; - uint8_t number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16 - - uint8_t dci_2_0_number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16 - uint8_t dci_2_3_monitorying_periodicity; - uint8_t dci_2_3_number_of_candidates; - - } nfapi_nr_search_space_t; - - typedef struct { - nfapi_nr_search_space_t search_space_sib1; - nfapi_nr_search_space_t search_space_others_sib; - nfapi_nr_search_space_t search_space_paging; - nfapi_nr_coreset_t coreset_ra; // common coreset - nfapi_nr_search_space_t search_space_ra; - } nfapi_nr_pdcch_config_common_t; - - typedef struct { - uint8_t k0; - uint8_t mapping_type; - uint8_t symbol_starting; - uint8_t symbol_length; - } nfapi_nr_pdsch_time_domain_resource_allocation_t; - - typedef struct { - nfapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[NFAPI_NR_MAX_NUM_DL_ALLOCATIONS]; - } nfapi_nr_pdsch_config_common_t; - - typedef struct { - uint8_t prach_configuration_index; - uint8_t msg1_fdm; - uint8_t msg1_frequency_start; - uint8_t zero_correlation_zone_config; - uint8_t preamble_received_target_power; - uint8_t preamble_transmission_max; - uint8_t power_ramping_step; - uint8_t ra_window_size; - - uint8_t total_number_of_preamble; - uint8_t ssb_occasion_per_rach; - uint8_t cb_preamble_per_ssb; - - uint8_t group_a_msg3_size; - uint8_t group_a_number_of_preamble; - uint8_t group_b_power_offset; - uint8_t contention_resolution_timer; - uint8_t rsrp_threshold_ssb; - uint8_t rsrp_threshold_ssb_sul; - uint8_t prach_length; // l839, l139 - uint8_t prach_root_sequence_index; // 0 - 837 for l839, 0 - 137 for l139 - uint8_t msg1_subcarrier_spacing; - uint8_t restrictedset_config; - uint8_t msg3_transform_precoding; - } nfapi_nr_rach_config_common_t; - - typedef struct { - uint8_t k2; - uint8_t mapping_type; - uint8_t symbol_starting; - uint8_t symbol_length; - } nfapi_nr_pusch_time_domain_resource_allocation_t; - - typedef struct { - uint8_t group_hopping_enabled_transform_precoding; - nfapi_nr_pusch_time_domain_resource_allocation_t allocation_list[NFAPI_NR_MAX_NUM_UL_ALLOCATIONS]; - uint8_t msg3_delta_preamble; - uint8_t p0_nominal_with_grant; - } nfapi_nr_pusch_config_common_t; - - typedef struct { - uint8_t pucch_resource_common; - uint8_t pucch_group_hopping; - uint8_t hopping_id; - uint8_t p0_nominal; - } nfapi_nr_pucch_config_common_t; - - typedef struct { - uint8_t subcarrier_spacing_common; - uint8_t ssb_subcarrier_offset; - uint8_t dmrs_type_a_position; - uint8_t pdcch_config_sib1; - uint8_t cell_barred; - uint8_t intra_frquency_reselection; - } nfapi_nr_pbch_config_t; - - typedef struct { - nfapi_nr_tl_t tl; - - nfapi_nr_pdcch_config_common_t pdcch_config_common; - nfapi_nr_pdsch_config_common_t pdsch_config_common; - - } nfapi_nr_dl_bwp_common_config_t; - - - - typedef struct { - uint16_t int_rnti; - uint8_t time_frequency_set; - uint8_t dci_payload_size; - uint8_t serving_cell_id[NFAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell - uint8_t position_in_dci[NFAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell - } nfapi_nr_downlink_preemption_t; - - typedef struct { - uint8_t tpc_index; - uint8_t tpc_index_sul; - uint8_t target_cell; - } nfapi_nr_pusch_tpc_command_config_t; - - typedef struct { - uint8_t tpc_index_pcell; - uint8_t tpc_index_pucch_scell; - } nfapi_nr_pucch_tpc_command_config_t; - - typedef struct { - uint8_t starting_bit_of_format_2_3; - uint8_t feild_type_format_2_3; - } nfapi_nr_srs_tpc_command_config_t; - - typedef struct { - nfapi_nr_downlink_preemption_t downlink_preemption; - nfapi_nr_pusch_tpc_command_config_t tpc_pusch; - nfapi_nr_pucch_tpc_command_config_t tpc_pucch; - nfapi_nr_srs_tpc_command_config_t tpc_srs; - } nfapi_nr_pdcch_config_dedicated_t; - - typedef struct { - uint8_t dmrs_type; - uint8_t dmrs_addition_position; - uint8_t max_length; - uint16_t scrambling_id_0; - uint16_t scrambling_id_1; - uint8_t ptrs_frequency_density[2]; // phase tracking rs - uint8_t ptrs_time_density[3]; // phase tracking rs - uint8_t ptrs_epre_ratio; // phase tracking rs - uint8_t ptrs_resource_element_offset; // phase tracking rs - } nfapi_nr_dmrs_downlink_config_t; - - typedef struct { - uint8_t bwp_or_cell_level; - uint8_t pattern_type; - uint32_t resource_blocks[9]; // bitmaps type 275 bits - uint8_t slot_type; // bitmaps type one/two slot(s) - uint32_t symbols_in_resouece_block; // bitmaps type 14/28 bits - uint8_t periodic; // bitmaps type - uint32_t pattern[2]; // bitmaps type 2/4/5/8/10/20/40 bits - - nfapi_nr_coreset_t coreset; // coreset - - uint8_t subcarrier_spacing; - uint8_t mode; - } nfapi_nr_rate_matching_pattern_group_t; - - typedef struct { - // resource mapping - uint8_t row; // row1/row2/row4/other - uint16_t frequency_domain_allocation; // 4/12/3/6 bits - uint8_t number_of_ports; - uint8_t first_ofdm_symbol_in_time_domain; - uint8_t first_ofdm_symbol_in_time_domain2; - uint8_t cdm_type; - uint8_t density; // .5/1/3 - uint8_t density_dot5_type; // even/odd PRBs - - uint8_t frequency_band_starting_rb; // freqBand - uint8_t frequency_band_number_of_rb; // freqBand - - // periodicityAndOffset - uint8_t periodicity; // slot4/5/8/10/16/20/32/40/64/80/160/320/640 - uint32_t offset; // 0..639 bits - } nfapi_nr_zp_csi_rs_resource_t; - - typedef struct { - uint16_t data_scrambling_id_pdsch; - nfapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_a; - nfapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_b; - uint8_t vrb_to_prb_interleaver; - uint8_t resource_allocation; - nfapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[NFAPI_NR_MAX_NUM_DL_ALLOCATIONS]; - uint8_t pdsch_aggregation_factor; - nfapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group1; - nfapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group2; - uint8_t rbg_size; - uint8_t mcs_table; - uint8_t max_num_of_code_word_scheduled_by_dci; - uint8_t bundle_size; // prb_bundling static - uint8_t bundle_size_set1; // prb_bundling dynamic - uint8_t bundle_size_set2; // prb_bundling dynamic - nfapi_nr_zp_csi_rs_resource_t periodically_zp_csi_rs_resource_set[NFAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET]; - } nfapi_nr_pdsch_config_dedicated_t; - - typedef struct { - uint16_t starting_prb; - uint8_t intra_slot_frequency_hopping; - uint16_t second_hop_prb; - uint8_t format; // pucch format 0..4 - uint8_t initial_cyclic_shift; - uint8_t number_of_symbols; - uint8_t starting_symbol_index; - uint8_t time_domain_occ; - uint8_t number_of_prbs; - uint8_t occ_length; - uint8_t occ_index; - } nfapi_nr_pucch_resource_t; - - typedef struct { - uint8_t periodicity; - uint8_t number_of_harq_process; - nfapi_nr_pucch_resource_t n1_pucch_an; - } nfapi_nr_sps_config_t; - - typedef struct { - uint8_t beam_failure_instance_max_count; - uint8_t beam_failure_detection_timer; - } nfapi_nr_radio_link_monitoring_config_t; - - typedef struct { - nfapi_nr_pdcch_config_dedicated_t pdcch_config_dedicated; - nfapi_nr_pdsch_config_dedicated_t pdsch_config_dedicated; - nfapi_nr_sps_config_t sps_config; - nfapi_nr_radio_link_monitoring_config_t radio_link_monitoring_config; - - } nfapi_nr_dl_bwp_dedicated_config_t; - - typedef struct { - nfapi_nr_rach_config_common_t rach_config_common; - nfapi_nr_pusch_config_common_t pusch_config_common; - nfapi_nr_pucch_config_common_t pucch_config_common; - - } nfapi_nr_ul_bwp_common_config_t; - - typedef struct { - uint8_t inter_slot_frequency_hopping; - uint8_t additional_dmrs; - uint8_t max_code_rate; - uint8_t number_of_slots; - uint8_t pi2bpsk; - uint8_t simultaneous_harq_ack_csi; - } nfapi_nr_pucch_format_config_t; - - typedef struct { - nfapi_nr_pucch_format_config_t format1; - nfapi_nr_pucch_format_config_t format2; - nfapi_nr_pucch_format_config_t format3; - nfapi_nr_pucch_format_config_t format4; - nfapi_nr_pucch_resource_t multi_csi_pucch_resources[2]; - uint8_t dl_data_to_ul_ack[8]; - // pucch power control - uint8_t deltaF_pucch_f0; - uint8_t deltaF_pucch_f1; - uint8_t deltaF_pucch_f2; - uint8_t deltaF_pucch_f3; - uint8_t deltaF_pucch_f4; - uint8_t two_pucch_pc_adjusment_states; - } nfapi_nr_ul_bwp_dedicated_config_t; - -typedef struct { - nfapi_nr_p4_p5_message_header_t header; - uint8_t num_tlv; - - nfapi_nr_pbch_config_t pbch_config_common; // MIB - - nfapi_nr_dl_bwp_common_config_t dl_bwp_common; - nfapi_nr_dl_bwp_dedicated_config_t dl_bwp_dedicated; - - nfapi_nr_ul_bwp_common_config_t ul_bwp_common; - nfapi_nr_ul_bwp_dedicated_config_t ul_bwp_dedicated; - -} nfapi_nr_config_request_t; - -#endif /* _NFAPI_INTERFACE_H_ */ diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index a0b3b9f6990c58bcd6f0bf003b8f6fc647ca9908..b6038d2792a2f19fd80e9570f198f74980b48b46 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -34,6 +34,9 @@ #include "assertions.h" #include <math.h> +#include "PHY/NR_REFSIG/defs.h" +#include "PHY/LTE_REFSIG/lte_refsig.h" + extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn); extern int32_t get_uldl_offset(int eutra_bandP); @@ -41,36 +44,35 @@ int l1_north_init_gNB() { int i,j; - if (RC.nb_L1_inst > 0 && RC.nb_L1_CC != NULL && RC.gNB != NULL) + if (RC.nb_nr_L1_inst > 0 && RC.nb_nr_L1_CC != NULL && RC.gNB != NULL) { - AssertFatal(RC.nb_L1_inst>0,"nb_L1_inst=%d\n",RC.nb_L1_inst); - AssertFatal(RC.nb_L1_CC!=NULL,"nb_L1_CC is null\n"); + AssertFatal(RC.nb_nr_L1_inst>0,"nb_nr_L1_inst=%d\n",RC.nb_nr_L1_inst); + AssertFatal(RC.nb_nr_L1_CC!=NULL,"nb_nr_L1_CC is null\n"); AssertFatal(RC.gNB!=NULL,"RC.gNB is null\n"); - LOG_I(PHY,"%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst); + LOG_I(PHY,"%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst); - for (i=0;i<RC.nb_L1_inst;i++) { + for (i=0;i<RC.nb_nr_L1_inst;i++) { AssertFatal(RC.gNB[i]!=NULL,"RC.gNB[%d] is null\n",i); - AssertFatal(RC.nb_L1_CC[i]>0,"RC.nb_L1_CC[%d]=%d\n",i,RC.nb_L1_CC[i]); + AssertFatal(RC.nb_nr_L1_CC[i]>0,"RC.nb_nr_L1_CC[%d]=%d\n",i,RC.nb_nr_L1_CC[i]); - LOG_I(PHY,"%s() RC.nb_L1_CC[%d]:%d\n", __FUNCTION__, i, RC.nb_L1_CC[i]); + LOG_I(PHY,"%s() RC.nb_nr_L1_CC[%d]:%d\n", __FUNCTION__, i, RC.nb_nr_L1_CC[i]); - for (j=0;j<RC.nb_L1_CC[i];j++) { + for (j=0;j<RC.nb_nr_L1_CC[i];j++) { AssertFatal(RC.gNB[i][j]!=NULL,"RC.gNB[%d][%d] is null\n",i,j); - if ((RC.gNB[i][j]->if_inst = IF_Module_init(i))<0) return(-1); + if ((RC.gNB[i][j]->if_inst = NR_IF_Module_init(i))<0) return(-1); LOG_I(PHY,"%s() RC.gNB[%d][%d] installing callbacks\n", __FUNCTION__, i, j); - RC.gNB[i][j]->if_inst->PHY_config_req = phy_config_request; - nr_phy_config_request(RC.gNB[i][j]); + RC.gNB[i][j]->if_inst->PHY_config_req = nr_phy_config_request; RC.gNB[i][j]->if_inst->schedule_response = schedule_response; } } } else { - LOG_I(PHY,"%s() Not installing PHY callbacks - RC.nb_L1_inst:%d RC.nb_L1_CC:%p RC.gNB:%p\n", __FUNCTION__, RC.nb_L1_inst, RC.nb_L1_CC, RC.gNB); + LOG_I(PHY,"%s() Not installing PHY callbacks - RC.nb_nr_L1_inst:%d RC.nb_nr_L1_CC:%p RC.gNB:%p\n", __FUNCTION__, RC.nb_nr_L1_inst, RC.nb_nr_L1_CC, RC.gNB); } return(0); } @@ -83,7 +85,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, // shortcuts NR_DL_FRAME_PARMS* const fp = &gNB->frame_parms; - nfapi_config_request_t* cfg = &gNB->gNB_config; + nfapi_nr_config_request_t* cfg = &gNB->gNB_config; NR_gNB_COMMON* const common_vars = &gNB->common_vars; LTE_eNB_PUSCH** const pusch_vars = gNB->pusch_vars; LTE_eNB_SRS* const srs_vars = gNB->srs_vars; @@ -238,7 +240,7 @@ void phy_config_request(PHY_Config_t *phy_config) { uint8_t Mod_id = phy_config->Mod_id; int CC_id = phy_config->CC_id; - nfapi_config_request_t *cfg = phy_config->cfg; + nfapi_nr_config_request_t *cfg = phy_config->cfg; NR_DL_FRAME_PARMS *fp; PHICH_RESOURCE_t phich_resource_table[4]={oneSixth,half,one,two}; @@ -280,7 +282,7 @@ void phy_config_request(PHY_Config_t *phy_config) { void phy_free_nr_gNB(PHY_VARS_gNB *gNB) { // NR_DL_FRAME_PARMS* const fp = &gNB->frame_parms; - nfapi_config_request_t *cfg = &gNB->gNB_config; + nfapi_nr_config_request_t *cfg = &gNB->gNB_config; NR_gNB_COMMON* const common_vars = &gNB->common_vars; LTE_eNB_PUSCH** const pusch_vars = gNB->pusch_vars; LTE_eNB_SRS* const srs_vars = gNB->srs_vars; @@ -353,10 +355,11 @@ void install_schedule_handlers(IF_Module_t *if_inst) }*/ /// this function is a temporary addition for NR configuration -void nr_phy_config_request(PHY_VARS_gNB *gNB) + +/*void nr_phy_config_request(PHY_VARS_gNB *gNB) { NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; - nfapi_config_request_t *gNB_config = &gNB->gNB_config; + nfapi_nr_config_request_t *gNB_config = &gNB->gNB_config; //overwrite for new NR parameters gNB_config->nfapi_config.rf_bands.rf_band[0] = 22; @@ -382,4 +385,63 @@ void nr_phy_config_request(PHY_VARS_gNB *gNB) gNB->configured = 1; LOG_I(PHY,"gNB configured\n"); +}*/ + + +void nr_phy_config_request(NR_PHY_Config_t *phy_config) +{ + + uint8_t Mod_id = phy_config->Mod_id; + int CC_id = phy_config->CC_id; + + NR_DL_FRAME_PARMS *fp = &RC.gNB[Mod_id][CC_id]->frame_parms; + nfapi_nr_config_request_t *gNB_config = &RC.gNB[Mod_id][CC_id]->gNB_config; + + + gNB_config->nfapi_config.rf_bands.rf_band[0] = phy_config->cfg->nfapi_config.rf_bands.rf_band[0]; //22 + gNB_config->nfapi_config.earfcn.value = phy_config->cfg->nfapi_config.earfcn.value; //6600 + gNB_config->subframe_config.numerology_index_mu.value = phy_config->cfg->subframe_config.numerology_index_mu.value;//1 + gNB_config->rf_config.tx_antenna_ports.value = phy_config->cfg->rf_config.tx_antenna_ports.value; //1 + gNB_config->rf_config.dl_channel_bandwidth.value = phy_config->cfg->rf_config.dl_channel_bandwidth.value;//106; + gNB_config->rf_config.ul_channel_bandwidth.value = phy_config->cfg->rf_config.ul_channel_bandwidth.value;//106; + gNB_config->sch_config.half_frame_index.value = 0; + gNB_config->sch_config.ssb_subcarrier_offset.value = phy_config->cfg->sch_config.ssb_subcarrier_offset.value;//0; + gNB_config->sch_config.n_ssb_crb.value = 86; + gNB_config->sch_config.physical_cell_id.value = phy_config->cfg->sch_config.physical_cell_id.value; + + if (phy_config->cfg->subframe_config.duplex_mode.value == 0) { + gNB_config->subframe_config.duplex_mode.value = TDD; + } + else { + gNB_config->subframe_config.duplex_mode.value = FDD; + } + + RC.gNB[Mod_id][CC_id]->mac_enabled = 1; + + fp->dl_CarrierFreq = from_earfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.earfcn.value); + fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000); + fp->threequarter_fs = 0; + + LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d, N_RB_UL %d, Nid_cell %d,gNB_tx_antenna_ports %d,DL freq %u)\n", + Mod_id, + CC_id, + gNB_config->nfapi_config.rf_bands.rf_band[0], + gNB_config->rf_config.dl_channel_bandwidth.value, + gNB_config->rf_config.ul_channel_bandwidth.value, + gNB_config->sch_config.physical_cell_id.value, + gNB_config->rf_config.tx_antenna_ports.value, + fp->dl_CarrierFreq ); + + nr_init_frame_parms(gNB_config, fp); + + if (RC.gNB[Mod_id][CC_id]->configured == 1){ + LOG_E(PHY,"Already gNB already configured, do nothing\n"); + return; + } + + RC.gNB[Mod_id][CC_id]->configured = 1; + LOG_I(PHY,"gNB %d/%d configured\n",Mod_id,CC_id); + + + } diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index d11624557d49e26ac024ae9495bb23d2d735ede0..e3d3fff762f37b8ef82a0a49f3c60ec051c19c11 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -100,12 +100,12 @@ int nr_phy_init_RU(RU_t *ru) { LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,ru->prach_rxsigF[i]); } - AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"gNB instances %d > %d\n", - RC.nb_L1_inst,NUMBER_OF_eNB_MAX); + AssertFatal(RC.nb_nr_L1_inst <= NUMBER_OF_eNB_MAX,"gNB instances %d > %d\n", + RC.nb_nr_L1_inst,NUMBER_OF_gNB_MAX); - LOG_E(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst); + LOG_E(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst); - for (i=0; i<RC.nb_L1_inst; i++) { + for (i=0; i<RC.nb_nr_L1_inst; i++) { for (p=0;p<15;p++) { LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->gNB_list[i]->gNB_config.rf_config.tx_antenna_ports.value); if (p<ru->gNB_list[i]->gNB_config.rf_config.tx_antenna_ports.value || p==5) { @@ -178,7 +178,7 @@ void nr_phy_free_RU(RU_t *ru) free_and_zero(ru->prach_rxsigF); /* ru->prach_rxsigF_br is not allocated -> don't free */ - for (i = 0; i < RC.nb_L1_inst; i++) { + for (i = 0; i < RC.nb_nr_L1_inst; i++) { for (p = 0; p < 15; p++) { if (p < ru->gNB_list[i]->gNB_config.rf_config.tx_antenna_ports.value || p == 5) { for (j=0; j<ru->nb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]); diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index d2186b45a3c06c06203324180603a0e237d2f164..c541b4dc5758cd5c08f6c61096fe0594ec890a38 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -26,7 +26,7 @@ uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3, 30e3, 60e3, 120e3, 240e3}; uint16_t nr_slots_per_subframe[MAX_NUM_SUBCARRIER_SPACING] = {1, 2, 4, 16, 32}; -int nr_init_frame_parms(nfapi_config_request_t* config, +int nr_init_frame_parms(nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms) { @@ -146,12 +146,12 @@ int nr_init_frame_parms(nfapi_config_request_t* config, frame_parms->samples_per_subframe = (frame_parms->samples_per_subframe_wCP + (frame_parms->nb_prefix_samples0 * frame_parms->slots_per_subframe) + (frame_parms->nb_prefix_samples * frame_parms->slots_per_subframe * (frame_parms->symbols_per_slot - 1))); frame_parms->samples_per_frame = 10 * frame_parms->samples_per_subframe; - + frame_parms->freq_range = (frame_parms->dl_CarrierFreq < 6e9)? nr_FR1 : nr_FR2; return 0; } -int nr_init_frame_parms_ue(nfapi_config_request_t* config, +int nr_init_frame_parms_ue(nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms) { @@ -284,7 +284,7 @@ int nr_init_frame_parms_ue(nfapi_config_request_t* config, //frame_parms->samples_per_subframe = (frame_parms->samples_per_subframe_wCP + (frame_parms->nb_prefix_samples0 * frame_parms->slots_per_subframe) + // (frame_parms->nb_prefix_samples * frame_parms->slots_per_subframe * (frame_parms->symbols_per_slot - 1))); frame_parms->samples_per_frame = 10 * frame_parms->samples_per_subframe; - + frame_parms->freq_range = (frame_parms->dl_CarrierFreq < 6e9)? nr_FR1 : nr_FR2; return 0; } diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 40ec1bd308a9a29dbbdf20571ee5e72ed1c8e71c..5735fad132773fa34063d591a28d196ea75833e3 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -374,12 +374,13 @@ void phy_config_request(PHY_Config_t *phy_config); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); -int nr_init_frame_parms(nfapi_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); -int nr_init_frame_parms_ue(nfapi_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); +int nr_init_frame_parms(nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); +int nr_init_frame_parms_ue(nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag); -void nr_phy_config_request(PHY_VARS_gNB *gNB); +void nr_phy_config_request(NR_PHY_Config_t *gNB); void phy_free_nr_gNB(PHY_VARS_gNB *gNB); +int l1_north_init_gNB(void); /** @} */ #endif diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index fecf98298a269faf884729cacc1ef1c60bc985ef..28d1be34801aa2b834826c4c9fdd36cfcfb99813 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -23,12 +23,10 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB) { - - uint32_t x1, x2; - uint8_t Nid, i_ssb, i_ssb2; - uint8_t Lmax, l, n_hf, N_hf; - uint8_t reset = 1; - nfapi_config_request_t *cfg = &gNB->gNB_config; + unsigned int n, x1, x2; + unsigned char Nid, i_ssb, i_ssb2; + unsigned char Lmax, l, n_hf, N_hf; + nfapi_nr_config_request_t *cfg = &gNB->gNB_config; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; Nid = cfg->sch_config.physical_cell_id.value; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index c9056ec6078700b20b464f1ed76fef2b08d6e4c1..2ac6c405f0e42669d333dbc1969595f37a9dd2ee 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -135,7 +135,7 @@ uint8_t nr_generate_dci_top(NR_gNB_DCI_ALLOC_t dci_alloc, int32_t** txdataF, int16_t amp, NR_DL_FRAME_PARMS* frame_parms, - nfapi_config_request_t* config) + nfapi_nr_config_request_t* config) { uint16_t mod_dmrs[NR_MAX_PDCCH_DMRS_LENGTH<<1]; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index 061dd85bd54fb673f792d8a1ae8682142e3c3b25..630e4781bb7b8d98089453abfe64bf3f8ba51bd9 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -18,6 +18,7 @@ * For more information about the OpenAirInterface (OAI) Software Alliance: * contact@openairinterface.org */ + #ifndef __PHY_NR_TRANSPORT_DCI__H #define __PHY_NR_TRANSPORT_DCI__H @@ -100,6 +101,7 @@ typedef struct { uint8_t dci_pdu[8]; } NR_gNB_DCI_ALLOC_t; +typedef unsigned __int128 uint128_t; uint8_t nr_get_dci_size(nr_dci_format_e format, nr_rnti_type_e rnti, @@ -111,6 +113,6 @@ uint8_t nr_generate_dci_top(NR_gNB_DCI_ALLOC_t dci_alloc, int32_t** txdataF, int16_t amp, NR_DL_FRAME_PARMS* frame_parms, - nfapi_config_request_t* config); + nfapi_nr_config_request_t* config) #endif //__PHY_NR_TRANSPORT_DCI__H diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index 642b5c290541026ce7660f5ebc84bbed6b4f87bc..2ec3b41893585f6611e4fd5dbb258540d373f472 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -45,19 +45,19 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs, int32_t **txdataF, int16_t amp, uint8_t ssb_start_symbol, - uint8_t nushift, - nfapi_config_request_t* config, + nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms) { int k,l; int16_t a; int16_t mod_dmrs[NR_PBCH_DMRS_LENGTH<<1]; uint8_t idx=0; + uint8_t nushift = config->sch_config.physical_cell_id.value &3; LOG_I(PHY, "PBCH DMRS mapping started at symbol %d shift %d\n", ssb_start_symbol+1, nushift); /// QPSK modulation - for (int m=0; m<NR_PBCH_DMRS_LENGTH>>1; m++) { + for (int m=0; m<NR_PBCH_DMRS_LENGTH; m++) { idx = ((((gold_pbch_dmrs[(m<<1)>>5])>>((m<<1)&0x1f))&1)<<1) ^ (((gold_pbch_dmrs[((m<<1)+1)>>5])>>(((m<<1)+1)&0x1f))&1); mod_dmrs[m<<1] = nr_mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1]; mod_dmrs[(m<<1)+1] = nr_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1]; @@ -131,84 +131,161 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs, return 0; } -void nr_pbch_scrambling(uint32_t Nid, +void nr_pbch_scrambling(NR_gNB_PBCH *pbch, + uint32_t Nid, uint8_t nushift, - uint8_t *pbch_a, - uint32_t length) + uint16_t M, + uint16_t length, + uint8_t bitwise) { uint8_t reset, offset; uint32_t x1, x2, s=0; - uint8_t M = length - 3; // case Lmax = 4--> 29 + uint8_t *pbch_e = pbch->pbch_e; + uint32_t *pbch_a_prime = (uint32_t*)pbch->pbch_a_prime; + uint32_t *pbch_a_interleaved = (uint32_t*)pbch->pbch_a_interleaved; + uint32_t unscrambling_mask = 0x87002D; reset = 1; // x1 is set in lte_gold_generic x2 = Nid; // The Gold sequence is shifted by nushift* M, so we skip (nushift*M /32) double words - for (int i=0; i<(uint16_t)ceil((nushift*M)/5); i++) { + for (int i=0; i<(uint16_t)ceil((nushift*M)/32); i++) { s = lte_gold_generic(&x1, &x2, reset); reset = 0; } + // Scrambling is now done with offset (nushift*M)%32 offset = (nushift*M)&0x1f; +#ifdef DEBUG_PBCH_ENCODING + printf("Scrambling params: nushift %d M %d length %d bitwise %d offset %d\n", nushift, M, length, bitwise, offset); +#endif for (int i=0; i<length; i++) { if (((i+offset)&0x1f)==0) { s = lte_gold_generic(&x1, &x2, reset); reset = 0; } - pbch_a[i] = (pbch_a[i]&1) ^ ((s>>((i+offset)&0x1f))&1); +#ifdef DEBUG_PBCH_ENCODING + printf("s: %04x\t", s); +#endif + if (bitwise) { + (*pbch_a_prime) ^= ((unscrambling_mask>>i)&1)? (((*pbch_a_interleaved)>>i)&1)<<i : ((((*pbch_a_interleaved)>>i)&1) ^ ((s>>((i+offset)&0x1f))&1))<<i; + } + + else + pbch_e[i] = (pbch_e[i]&1) ^ ((s>>((i+offset)&0x1f))&1); } } +uint8_t nr_pbch_payload_interleaving_pattern[32] = {16, 23, 18, 17, 8, 30, 10, 6, 24, 7, 0, 5, 3, 2, 1, 4, + 9, 11, 12, 13, 14, 15, 19, 20, 21, 22, 25, 26, 27, 28, 29, 31}; + +uint8_t nr_pbch_payload_interleaver(uint8_t i) { + uint8_t j_sfn=0, j_hrf=10, j_ssb=11, j_other=14; + + if (24<=i && i<=27) //Sfn bits + return nr_pbch_payload_interleaving_pattern[j_sfn + i -24]; + else if (i==28) // Hrf bit + return nr_pbch_payload_interleaving_pattern[j_hrf]; + else if (29<=i) // Ssb bits + return nr_pbch_payload_interleaving_pattern[j_ssb + (i-29)]; + else + return nr_pbch_payload_interleaving_pattern[j_other + i]; +} int nr_generate_pbch(NR_gNB_PBCH *pbch, uint8_t *pbch_pdu, int32_t **txdataF, int16_t amp, uint8_t ssb_start_symbol, - uint8_t nushift, uint8_t n_hf, + uint8_t Lmax, + uint8_t ssb_index, int sfn, - int frame_mod8, - nfapi_config_request_t* config, + nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms) { int k,l,m; int16_t a; - int16_t mod_pbch_e[NR_POLAR_PBCH_E<<1]; - uint8_t sfn_4lsb, idx=0; + int16_t mod_pbch_e[NR_POLAR_PBCH_E]; + uint8_t idx=0; + uint16_t M; + uint8_t nushift; LOG_I(PHY, "PBCH generation started\n"); ///Payload generation // Fix byte endian - if (!frame_mod8) - for (int i=0; i<NR_PBCH_PDU_BITS; i++) - pbch->pbch_a[NR_PBCH_PDU_BITS-i-1] = pbch_pdu[i]; + if (!(sfn&7)) + for (int i=0; i<(NR_PBCH_PDU_BITS>>3); i++) + pbch->pbch_a[(NR_POLAR_PBCH_PAYLOAD_BITS>>3)-i-1] = pbch_pdu[i]; +#ifdef DEBUG_PBCH_ENCODING + printf("Byte endian fix:\n"); + for (int i=0; i<4; i++) + printf("pbch_a[%d]: 0x%04x\n", i, pbch->pbch_a[i]); + +#endif - // Extra bits generation - sfn_4lsb = sfn&3; + // Extra byte generation + uint8_t *xbyte = pbch->pbch_a; + //memset((void*) xbyte, 0, 1); for (int i=0; i<4; i++) - pbch->pbch_a[NR_PBCH_PDU_BITS+i] = (sfn_4lsb>>i)&1; // 4 lsb of sfn + (*xbyte) ^= ((sfn>>i)&1)<<i; // 4 lsb of sfn - pbch->pbch_a[NR_PBCH_PDU_BITS+4] = n_hf; // half frame index bit + (*xbyte) ^= n_hf<<4; // half frame index bit - pbch->pbch_a[NR_PBCH_PDU_BITS+5] = (config->sch_config.ssb_subcarrier_offset.value>>5)&1; //MSB of k0 -- Note the case Lssb=64 is not supported (FR2) + if (Lmax == 64) + for (int i=0; i<3; i++) + (*xbyte) ^= ((ssb_index>>(3+i))&1)<<(5+i); // resp. 4th, 5th and 6th bits of ssb_index + else + (*xbyte) ^= ((config->sch_config.ssb_subcarrier_offset.value>>5)&1)<<5; //MSB of k_SSB #ifdef DEBUG_PBCH_ENCODING - + printf("Extra byte:\n"); + for (int i=0; i<4; i++) + printf("pbch_a[%d]: 0x%04x\n", i, pbch->pbch_a[i]); +#endif + + // Payload interleaving + uint32_t* input = (uint32_t*)pbch->pbch_a; + uint32_t* output = (uint32_t*)pbch->pbch_a_interleaved; + for (int i=0; i<32; i++) + (*output) |= (((*input)>>i)&1)<<(nr_pbch_payload_interleaver(i)); +#ifdef DEBUG_PBCH_ENCODING + printf("Interleaving:\n"); + for (int i=0; i<4; i++) + printf("pbch_a_interleaved[%d]: 0x%04x\n", i, pbch->pbch_a_interleaved[i]); #endif // Scrambling - nr_pbch_scrambling((uint32_t)config->sch_config.physical_cell_id.value, nushift, pbch->pbch_a, NR_POLAR_PBCH_PAYLOAD_BITS); + M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3); + nushift = (((sfn>>2)&1)<<1) ^ ((sfn>>1)&1); + nr_pbch_scrambling(pbch, (uint32_t)config->sch_config.physical_cell_id.value, nushift, M, NR_POLAR_PBCH_PAYLOAD_BITS, 1); #ifdef DEBUG_PBCH_ENCODING - + printf("Payload scrambling:\n"); + for (int i=0; i<4; i++) + printf("pbch_a_prime[%d]: 0x%04x\n", i, pbch->pbch_a_prime[i]); #endif + /// CRC, coding and rate matching - polar_encoder (pbch->pbch_a, pbch->pbch_e, &frame_parms->pbch_polar_params); + polar_encoder (pbch->pbch_a_prime, pbch->pbch_e, &frame_parms->pbch_polar_params); #ifdef DEBUG_PBCH_ENCODING - + printf("Channel coding:\n"); + for (int i=0; i<NR_POLAR_PBCH_E>>3; i++) + printf("pbch_e[%d]: 0x%04x\t", i, pbch->pbch_e[i]); + printf("\n"); +#endif + + /// Scrambling + M = NR_POLAR_PBCH_E; + nushift = config->sch_config.physical_cell_id.value &3;; + nr_pbch_scrambling(pbch, (uint32_t)config->sch_config.physical_cell_id.value, nushift, M, NR_POLAR_PBCH_E, 0); +#ifdef DEBUG_PBCH_ENCODING + printf("Scrambling:\n"); + for (int i=0; i<NR_POLAR_PBCH_E>>3; i++) + printf("pbch_e[%d]: 0x%04x\t", i, pbch->pbch_e[i]); + printf("\n"); #endif /// QPSK modulation diff --git a/openair1/PHY/NR_TRANSPORT/nr_pss.c b/openair1/PHY/NR_TRANSPORT/nr_pss.c index bb0d43da76c87d866b4561ae9c5eab010b2f912d..3c4f296cd616794c7dc190e1b408033fde04082a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pss.c @@ -28,7 +28,7 @@ int nr_generate_pss( int16_t *d_pss, int32_t **txdataF, int16_t amp, uint8_t ssb_start_symbol, - nfapi_config_request_t* config, + nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms) { int i,k,l,m; diff --git a/openair1/PHY/NR_TRANSPORT/nr_sss.c b/openair1/PHY/NR_TRANSPORT/nr_sss.c index a9ed801faf91e5526c39218955e6ec9bf759cb08..9b318d74ef9d8016ad3d18fab04bbf07df025582 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sss.c @@ -27,7 +27,7 @@ int nr_generate_sss( int16_t *d_sss, int32_t **txdataF, int16_t amp, uint8_t ssb_start_symbol, - nfapi_config_request_t* config, + nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms) { int i,k,l; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport.h b/openair1/PHY/NR_TRANSPORT/nr_transport.h index 58a4344e9dea09b2d1ed44f4629a06cda20d2c75..e5a60dc021baf59ddf3274896b45288c93077983 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport.h @@ -36,7 +36,7 @@ int nr_generate_pss( int16_t *d_pss, int32_t **txdataF, int16_t amp, uint8_t ssb_start_symbol, - nfapi_config_request_t* config, + nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); /*! @@ -49,7 +49,7 @@ int nr_generate_sss( int16_t *d_sss, int32_t **txdataF, int16_t amp, uint8_t ssb_start_symbol, - nfapi_config_request_t* config, + nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); /*! @@ -62,8 +62,7 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs, int32_t **txdataF, int16_t amp, uint8_t ssb_start_symbol, - uint8_t nushift, - nfapi_config_request_t* config, + nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); /*! @@ -71,10 +70,12 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs, \brief PBCH scrambling function @param */ -void nr_pbch_scrambling(uint32_t Nid, +void nr_pbch_scrambling(NR_gNB_PBCH *pbch, + uint32_t Nid, uint8_t nushift, - uint8_t *pbch_a, - uint32_t length); + uint16_t M, + uint16_t length, + uint8_t bitwise); /*! \fn int nr_generate_pbch @@ -87,11 +88,19 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, int32_t **txdataF, int16_t amp, uint8_t ssb_start_symbol, - uint8_t nushift, uint8_t n_hf, + uint8_t Lmax, + uint8_t ssb_index, int sfn, - int frame_mod8, - nfapi_config_request_t* config, + nfapi_nr_config_request_t* config, NR_DL_FRAME_PARMS *frame_parms); +/*! +\fn int nr_generate_pbch +\brief PBCH interleaving function +@param bit index i of the input payload +@returns the bit index of the output + */ +uint8_t nr_pbch_payload_interleaver(uint8_t i); + #endif /*__NR_TRANSPORT__H__*/ diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index fd079b9f7bd74a7ee4850a6ffd7002c29c1ac01b..dc69183ea43b68d84b812f7ec5836148432abb5a 100755 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -2142,6 +2142,14 @@ short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; mmtmpPD1 = _mm_shufflelo_epi16(dl_ch128[0], _MM_SHUFFLE(2,3,0,1)); mmtmpPD1 = _mm_shufflehi_epi16(mmtmpPD1, _MM_SHUFFLE(2,3,0,1)); mmtmpPD1 = _mm_sign_epi16(mmtmpPD1, *(__m128i * )&conjugate[0]); + + #ifdef NR_PDCCH_DCI_DEBUG + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_pdcch_channel_compensation)-> conjugate\t ### \t"); + for (int conjugate_index=0 ; conjugate_index< 8 ; conjugate_index++) + printf("conjugate[%d]=%d",conjugate_index,conjugate[conjugate_index]); + printf("\n"); + #endif + // print_ints("im",&mmtmpPD1); mmtmpPD1 = _mm_madd_epi16(mmtmpPD1, rxdataF128[0]); // mmtmpPD1 contains imag part of 4 consecutive outputs (32-bit) mmtmpPD0 = _mm_srai_epi32(mmtmpPD0, output_shift); @@ -3940,37 +3948,26 @@ int get_nCCE_offset_l1(int *CCE_table, #ifdef NR_PDCCH_DCI_RUN -void nr_dci_decoding_procedure0(int s, - int p, - NR_UE_PDCCH **pdcch_vars, - int do_common, - //dci_detect_mode_t mode, - uint8_t nr_tti_rx, - NR_DCI_ALLOC_t *dci_alloc, - // uint8_t nr_tti_rx, NR_DCI_ALLOC_t *dci_alloc, - int16_t eNB_id, - uint8_t current_thread_id, - NR_DL_FRAME_PARMS *frame_parms, +void nr_dci_decoding_procedure0(int s, //x + int p, //x + NR_UE_PDCCH **pdcch_vars, //x + int do_common, //x + //dci_detect_mode_t mode, //not sure if necessary + uint8_t nr_tti_rx, //x + NR_DCI_ALLOC_t *dci_alloc, //x + int16_t eNB_id, //x + uint8_t current_thread_id, //x + NR_DL_FRAME_PARMS *frame_parms, //x uint8_t mi, - uint16_t si_rnti, - uint16_t ra_rnti, - uint16_t p_rnti, - uint16_t tc_rnti, - uint16_t int_rnti, - uint16_t sfi_rnti, - uint16_t tpc_pusch_rnti, - uint16_t tpc_pucch_rnti, - uint16_t tpc_srs_rnti, + uint16_t crc_scrambled_values[13], //x uint8_t L, - uint8_t format_si, - uint8_t format_p, - uint8_t format_ra, - uint8_t format_c, + NR_UE_SEARCHSPACE_CSS_DCI_FORMAT_t format_css, + NR_UE_SEARCHSPACE_USS_DCI_FORMAT_t format_uss, uint8_t sizeof_bits, uint8_t sizeof_bytes, uint8_t *dci_cnt, - uint8_t *format0_found, - uint8_t *format_c_found, + crc_scrambled_t *crc_scrambled, + format_found_t *format_found, uint32_t *CCEmap0, uint32_t *CCEmap1, uint32_t *CCEmap2) { @@ -3991,15 +3988,15 @@ void nr_dci_decoding_procedure0(int s, int coreset_nbr_cce_per_symbol=0; #ifdef NR_PDCCH_DCI_DEBUG - printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> \n"); + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> format_found is %d \n", *format_found); #endif -// if (mode == NO_DCI) { -// #ifdef NR_PDCCH_DCI_DEBUG -// printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> skip DCI decoding: expect no DCIs at nr_tti_rx %d in current searchSpace\n", nr_tti_rx); -// #endif -// return; -// } + //if (mode == NO_DCI) { + // #ifdef NR_PDCCH_DCI_DEBUG + // printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> skip DCI decoding: expect no DCIs at nr_tti_rx %d in current searchSpace\n", nr_tti_rx); + // #endif + // return; + //} #ifdef NR_PDCCH_DCI_DEBUG printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> frequencyDomainResources=%llx, duration=%d\n", @@ -4093,7 +4090,7 @@ void nr_dci_decoding_procedure0(int s, // compute Yk Yk = (unsigned int) pdcch_vars[eNB_id]->crnti; for (i = 0; i <= nr_tti_rx; i++) - Yk = (Yk * A[p]) % 65537; + Yk = (Yk * A[p%3]) % 65537; } #ifdef NR_PDCCH_DCI_DEBUG printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> L2(%d) | nCCE[%d](%d) | Yk(%d) | nb_candidates(%d)\n",L2,p,nCCE[p],Yk,nb_candidates); @@ -4105,7 +4102,7 @@ void nr_dci_decoding_procedure0(int s, // nb_candidates = nCCE[p] / L2; // In the next code line there is maybe a bug. The spec is not comparing Table 10.1-2 with nb_candidates, but with total number of candidates for all s and all p - int m_p_s_L_max = (m_max_slot_pdcch_Table10_1_2[L]<=nb_candidates ? m_max_slot_pdcch_Table10_1_2[L] : nb_candidates); + int m_p_s_L_max = (m_max_slot_pdcch_Table10_1_2[1]<=nb_candidates ? m_max_slot_pdcch_Table10_1_2[1] : nb_candidates); if (L==4) m_p_s_L_max=1; // Table 10.1-2 is not defined for L=4 #ifdef NR_PDCCH_DCI_DEBUG printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> m_max_slot_pdcch_Table10_1_2(%d)=%d\n",L,m_max_slot_pdcch_Table10_1_2[L]); @@ -4183,18 +4180,74 @@ void nr_dci_decoding_procedure0(int s, */ crc = (crc16(&dci_decoded_output[current_thread_id][0], sizeof_bits) >> 16) ^ extract_crc(&dci_decoded_output[current_thread_id][0], sizeof_bits); #ifdef NR_PDCCH_DCI_DEBUG - printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> ... we end function dci_decoding() with crc=%d\n",crc); + printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> ... we end function dci_decoding() with crc=%x\n",crc); printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> ... we have to replace this part of the code by polar decoding\n"); #endif #ifdef DEBUG_DCI_DECODING printf("crc =>%x\n",crc); #endif //uint16_t tc_rnti, uint16_t int_rnti, uint16_t sfi_rnti, uint16_t tpc_pusch_rnti, uint16_t tpc_pucch_rnti, uint16_t tpc_srs__rnti - - if ((crc == si_rnti) || (crc == p_rnti) || (crc == ra_rnti) || (crc == tc_rnti) - || (crc == int_rnti) || (crc == sfi_rnti) || (crc == tpc_pusch_rnti) || (crc == tpc_pucch_rnti) || (crc == tpc_srs_rnti) - || (crc == pdcch_vars[eNB_id]->crnti)) { -/* if (((L > 1) && ((crc == si_rnti) || (crc == p_rnti) || (crc == ra_rnti))) - || (crc == pdcch_vars[eNB_id]->crnti)) {*/ + #ifdef NR_PDCCH_DCI_DEBUG + printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> format_found=%d\n",*format_found); + printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> crc_scrambled=%d\n",*crc_scrambled); + #endif + + if (crc == crc_scrambled_values[_C_RNTI_]) { + *crc_scrambled =_c_rnti; + *format_found=1; + } + if (crc == crc_scrambled_values[_CS_RNTI_]) { + *crc_scrambled =_cs_rnti; + *format_found=1; + } + if (crc == crc_scrambled_values[_NEW_RNTI_]) { + *crc_scrambled =_new_rnti; + *format_found=1; + } + if (crc == crc_scrambled_values[_TC_RNTI_]) { + *crc_scrambled =_tc_rnti; + *format_found=_format_1_0_found; + } + if (crc == crc_scrambled_values[_P_RNTI_]) { + *crc_scrambled =_p_rnti; + *format_found=_format_1_0_found; + } + if (crc == crc_scrambled_values[_SI_RNTI_]) { + *crc_scrambled =_si_rnti; + *format_found=_format_1_0_found; + } + if (crc == crc_scrambled_values[_RA_RNTI_]) { + *crc_scrambled =_ra_rnti; + *format_found=_format_1_0_found; + } + if (crc == crc_scrambled_values[_SP_CSI_RNTI_]) { + *crc_scrambled =_sp_csi_rnti; + *format_found=_format_0_1_found; + } + if (crc == crc_scrambled_values[_SFI_RNTI_]) { + *crc_scrambled =_sfi_rnti; + *format_found=_format_2_0_found; + } + if (crc == crc_scrambled_values[_INT_RNTI_]) { + *crc_scrambled =_int_rnti; + *format_found=_format_2_1_found; + } + if (crc == crc_scrambled_values[_TPC_PUSCH_RNTI_]) { + *crc_scrambled =_tpc_pusch_rnti; + *format_found=_format_2_2_found; + } + if (crc == crc_scrambled_values[_TPC_PUCCH_RNTI_]) { + *crc_scrambled =_tpc_pucch_rnti; + *format_found=_format_2_2_found; + } + if (crc == crc_scrambled_values[_TPC_SRS_RNTI_]) { + *crc_scrambled =_tpc_srs_rnti; + *format_found=_format_2_3_found; + } +#ifdef NR_PDCCH_DCI_DEBUG + printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> format_found=%d %d %d\n",*format_found, format_found, &format_found); + printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> crc_scrambled=%d\n",*crc_scrambled); +#endif + if (*format_found!=255) { #ifdef NR_PDCCH_DCI_DEBUG printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> rnti matches -> DCI FOUND !!! crc =>%x, sizeof_bits %d, sizeof_bytes %d \n",crc, sizeof_bits, sizeof_bytes); #endif @@ -4220,7 +4273,9 @@ void nr_dci_decoding_procedure0(int s, dci_alloc[*dci_cnt].dci_pdu[4] = dci_decoded_output[current_thread_id][3]; dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[current_thread_id][4]; dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[current_thread_id][5]; - dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[current_thread_id][7]; + dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[current_thread_id][6]; + dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[current_thread_id][7]; + // MAX_DCI_SIZE_BITS has to be redefined for dci_decoded_output FIXME // format2_0, format2_1 can be longer than 8 bytes. FIXME #ifdef DEBUG_DCI_DECODING printf("DCI => %x,%x,%x,%x,%x,%x,%x,%x\n", @@ -4228,37 +4283,45 @@ void nr_dci_decoding_procedure0(int s, dci_decoded_output[current_thread_id][4],dci_decoded_output[current_thread_id][5],dci_decoded_output[current_thread_id][6],dci_decoded_output[current_thread_id][7]); #endif } - if (crc == si_rnti) { - dci_alloc[*dci_cnt].format = format1_0; - *dci_cnt = *dci_cnt + 1; - } else if (crc == p_rnti) { - dci_alloc[*dci_cnt].format = format1_0; - *dci_cnt = *dci_cnt + 1; - } else if (crc == ra_rnti) { - dci_alloc[*dci_cnt].format = format1_0; - *dci_cnt = *dci_cnt + 1; - } else if (crc == tc_rnti) { - dci_alloc[*dci_cnt].format = cformat0_0_and_1_0; // this tc-rnti scrambled crc can contain formats 0_0 or 0_1. FIXME - *dci_cnt = *dci_cnt + 1; - } else if (crc == int_rnti) { - dci_alloc[*dci_cnt].format = format2_1; - *dci_cnt = *dci_cnt + 1; - } else if (crc == sfi_rnti) { + if ((format_css == cformat0_0_and_1_0) || (format_uss == uformat0_0_and_1_0)){ + if ((crc_scrambled == _p_rnti) || (crc_scrambled == _si_rnti) || (crc_scrambled == _ra_rnti)){ + dci_alloc[*dci_cnt].format = format1_0; + *dci_cnt = *dci_cnt + 1; + format_found=_format_1_0_found; + } else { + if ((dci_decoded_output[current_thread_id][7]>>(sizeof_bits-1))&1 == 0){ + dci_alloc[*dci_cnt].format = format0_0; + *dci_cnt = *dci_cnt + 1; + format_found=_format_0_0_found; + } + if ((dci_decoded_output[current_thread_id][7]>>(sizeof_bits-1))&1 == 1){ + dci_alloc[*dci_cnt].format = format1_0; + *dci_cnt = *dci_cnt + 1; + format_found=_format_1_0_found; + } + } + } + if (format_css == cformat2_0){ dci_alloc[*dci_cnt].format = format2_0; *dci_cnt = *dci_cnt + 1; - } else if (crc == tpc_pusch_rnti) { - dci_alloc[*dci_cnt].format = format2_2; + } + if (format_css == cformat2_1){ + dci_alloc[*dci_cnt].format = format2_1; *dci_cnt = *dci_cnt + 1; - } else if (crc == tpc_pucch_rnti) { + } + if (format_css == cformat2_2){ dci_alloc[*dci_cnt].format = format2_2; *dci_cnt = *dci_cnt + 1; - } else if (crc == tpc_srs_rnti) { + } + if (format_css == cformat2_3){ dci_alloc[*dci_cnt].format = format2_3; *dci_cnt = *dci_cnt + 1; - } else if (crc == pdcch_vars[eNB_id]->crnti) { - dci_alloc[*dci_cnt].format = uformat0_0_and_1_0; // or uformat0_1_and_1_1. FIXME - *dci_cnt = *dci_cnt + 1; } + if (format_uss == uformat0_1_and_1_1){ + // Not implemented yet FIXME + } + // store first nCCE of group for PUCCH transmission of ACK/NAK + pdcch_vars[eNB_id]->nCCE[nr_tti_rx] = CCEind; /* if (crc == si_rnti) { dci_alloc[*dci_cnt].format = format_si; *dci_cnt = *dci_cnt + 1; @@ -4345,6 +4408,7 @@ void nr_dci_decoding_procedure0(int s, + /*void dci_decoding_procedure0(NR_UE_PDCCH **pdcch_vars, int do_common, dci_detect_mode_t mode, @@ -4793,137 +4857,173 @@ uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_NR_UE *ue, */ #ifdef NR_PDCCH_DCI_RUN -uint16_t nr_dci_format_size (NR_DCI_format_t format, + +uint16_t nr_dci_format_size (crc_scrambled_t crc_scrambled, uint8_t pusch_alloc_list, uint16_t n_RB_ULBWP, uint16_t n_RB_DLBWP, - uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS]){ + uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS]){ #ifdef NR_PDCCH_DCI_DEBUG - printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size)-> \n"); + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size)-> crc_scrambled=%d, pusch_alloc_list=%d, n_RB_ULBWP=%d, n_RB_DLBWP=%d\n",crc_scrambled,pusch_alloc_list,n_RB_ULBWP,n_RB_DLBWP); #endif /* * Formats 0_1, not completely implemented. See (*) */ // format {0_0,0_1,1_0,1_1,2_0,2_1,2_2,2_3} according to 38.212 Section 7.3.1 -/*#define NBR_NR_FORMATS 8 -#define NBR_NR_DCI FIELDS 48 -#define CARRIER_IND 0 -#define SUL_IND_0_1 1 -#define IDENTIFIER_DCI_FORMATS 2 +/* +#define NBR_NR_FORMATS 8 +#define NBR_NR_DCI_FIELDS 56 + +#define IDENTIFIER_DCI_FORMATS 0 +#define CARRIER_IND 1 +#define SUL_IND_0_1 2 #define SLOT_FORMAT_IND 3 #define PRE_EMPTION_IND 4 #define TPC_CMD_NUMBER 5 #define BLOCK_NUMBER 6 #define BANDWIDTH_PART_IND 7 -#define FREQ_DOM_RESOURCE_ASSIGNMENT_UL 8 -#define FREQ_DOM_RESOURCE_ASSIGNMENT_DL 9 -#define TIME_DOM_RESOURCE_ASSIGNMENT 10 -#define VRB_TO_PRB_MAPPING 11 -#define PRB_BUNDLING_SIZE_IND 12 -#define RATE_MATCHING_IND 13 -#define ZP_CSI_RS_TRIGGER 14 -#define FREQ_HOPPING_FLAG 15 -#define TB1_MCS 16 -#define TB1_NDI 17 -#define TB1_RV 18 -#define TB2_MCS 19 -#define TB2_NDI 20 -#define TB2_RV 21 -#define MCS 22 -#define NDI 23 -#define RV 24 -#define HARQ_PROCESS_NUMBER 25 -#define DAI 26 -#define FIRST_DAI 27 -#define SECOND_DAI 28 -#define TPC_PUSCH 29 -#define TPC_PUCCH 30 -#define PUCCH_RESOURCE_IND 31 -#define PDSCH_TO_HARQ_FEEDBACK_TIME_IND 32 -#define SHORT_MESSAGE_IND 33 -#define SRS_RESOURCE_IND 34 -#define PRECOD_NBR_LAYERS 35 -#define ANTENNA_PORTS 36 -#define TCI 37 -#define SRS_REQUEST 38 -#define TPC_CMD_NUMBER_FORMAT2_3 39 -#define CSI_REQUEST 40 -#define CBGTI 41 -#define CBGFI 42 -#define PTRS_DMRS 43 -#define BETA_OFFSET_IND 44 -#define DMRS_SEQ_INI 45 -#define SUL_IND_0_0 46 -#define PADDING 47*/ +#define SHORT_MESSAGE_IND 8 +#define SHORT_MESSAGES 9 +#define FREQ_DOM_RESOURCE_ASSIGNMENT_UL 10 +#define FREQ_DOM_RESOURCE_ASSIGNMENT_DL 11 +#define TIME_DOM_RESOURCE_ASSIGNMENT 12 +#define VRB_TO_PRB_MAPPING 13 +#define PRB_BUNDLING_SIZE_IND 14 +#define RATE_MATCHING_IND 15 +#define ZP_CSI_RS_TRIGGER 16 +#define FREQ_HOPPING_FLAG 17 +#define TB1_MCS 18 +#define TB1_NDI 19 +#define TB1_RV 20 +#define TB2_MCS 21 +#define TB2_NDI 22 +#define TB2_RV 23 +#define MCS 24 +#define NDI 25 +#define RV 26 +#define HARQ_PROCESS_NUMBER 27 +#define DAI_ 28 +#define FIRST_DAI 29 +#define SECOND_DAI 30 +#define TB_SCALING 31 +#define TPC_PUSCH 32 +#define TPC_PUCCH 33 +#define PUCCH_RESOURCE_IND 34 +#define PDSCH_TO_HARQ_FEEDBACK_TIME_IND 35 +//#define SHORT_MESSAGE_IND 33 +#define SRS_RESOURCE_IND 36 +#define PRECOD_NBR_LAYERS 37 +#define ANTENNA_PORTS 38 +#define TCI 39 +#define SRS_REQUEST 40 +#define TPC_CMD_NUMBER_FORMAT2_3 41 +#define CSI_REQUEST 42 +#define CBGTI 43 +#define CBGFI 44 +#define PTRS_DMRS 45 +#define BETA_OFFSET_IND 46 +#define DMRS_SEQ_INI 47 +#define UL_SCH_IND 48 +#define PADDING_NR_DCI 49 +#define SUL_IND_0_0 50 +#define RA_PREAMBLE_INDEX 51 +#define SUL_IND_1_0 52 +#define SS_PBCH_INDEX 53 +#define PRACH_MASK_INDEX 54 +#define RESERVED_NR_DCI 55 +*/ //uint8_t pusch_alloc_list=1; - uint8_t n_zp = 1; // number of ZP CSI-RS resource sets in the higher layer parameter [ZP-CSI-RS-ResourceConfigList]. + // number of ZP CSI-RS resource sets in the higher layer parameter [ZP-CSI-RS-ResourceConfigList] + uint8_t n_zp = 1; uint8_t n_SRS=1; + // for PUSCH hopping with resource allocation type 1 + // n_UL_hopping = 1 if the higher layer parameter frequencyHoppingOffsetLists contains two offset values + // n_UL_hopping = 2 if the higher layer parameter frequencyHoppingOffsetLists contains four offset values + uint8_t n_UL_hopping=0; uint8_t dci_field_size_table [NBR_NR_DCI_FIELDS][NBR_NR_FORMATS] = { // This table contains the number of bits for each field (row) contained in each dci format (column). // The values of the variables indicate field sizes in number of bits -//Format0_0 Format0_1 Format1_0 Format1_1 Formats2_0/1/2/3 -{0, 3, 0, 3, 0,0,0,0}, // 0 CARRIER_IND: 0 or 3 bits, as defined in Subclause x.x of [5, TS38.213] -{0, 0, 0, 0, 0,0,0,0}, // 1 SUL_IND_0_1: -{1, 1, 1, 1, 1,1,1,1}, // 2 IDENTIFIER_DCI_FORMATS: -{0, 0, 0, 0, 1,0,0,0}, // 3 SLOT_FORMAT_IND: size of DCI format 2_0 is configurable by higher layers up to 128 bits, according to Subclause 11.1.1 of [5, TS 38.213] -{0, 0, 0, 0, 0,1,0,0}, // 4 PRE_EMPTION_IND: size of DCI format 2_1 is configurable by higher layers up to 126 bits, according to Subclause 11.2 of [5, TS 38.213]. Each pre-emption indication is 14 bits -{0, 0, 0, 0, 0,0,1,0}, // 5 TPC_CMD_NUMBER: The parameter xxx provided by higher layers determines the index to the TPC command number for an UL of a cell. Each TPC command number is 2 bits -{0, 0, 0, 0, 0,0,0,1}, // 6 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3 -{0, ceil(log2(n_RB_ULBWP)), 0, ceil(log2(n_RB_ULBWP)), 0,0,0,0}, // 7 BANDWIDTH_PART_IND: -{ceil(log2(n_RB_ULBWP*(n_RB_ULBWP+1)/2)),ceil(log2(n_RB_ULBWP*(n_RB_ULBWP+1)/2)),0, 0, 0,0,0,0}, // 8 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: PUSCH hopping with resource allocation type 1 not considered - // (NOTE 1) If DCI format 0_0 is monitored in common search space - // and if the number of information bits in the DCI format 0_0 prior to padding - // is larger than the payload size of the DCI format 1_0 monitored in common search space - // the bitwidth of the frequency domain resource allocation field in the DCI format 0_0 - // is reduced such that the size of DCI format 0_0 equals to the size of the DCI format 1_0 -{0, 0, ceil(log2(n_RB_DLBWP*(n_RB_DLBWP+1)/2)),ceil(log2(n_RB_DLBWP*(n_RB_DLBWP+1)/2)),0,0,0,0}, // 9 FREQ_DOM_RESOURCE_ASSIGNMENT_DL: -{log2(pusch_alloc_list), log2(pusch_alloc_list), log2(pusch_alloc_list), log2(pusch_alloc_list), 0,0,0,0}, // 10 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 6.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits, - // where I the number of entries in the higher layer parameter pusch-AllocationList -{0, 1, 1, 1, 0,0,0,0}, // 11 VRB_TO_PRB_MAPPING: 0 bit if only resource allocation type 0 -{0, 0, 0, 1, 0,0,0,0}, // 12 PRB_BUNDLING_SIZE_IND:0 bit if the higher layer parameter PRB_bundling is not configured or is set to 'static', or 1 bit if the higher layer parameter PRB_bundling is set to 'dynamic' according to Subclause 5.1.2.3 of [6, TS 38.214] -{0, 0, 0, 2, 0,0,0,0}, // 13 RATE_MATCHING_IND: 0, 1, or 2 bits according to higher layer parameter rate-match-PDSCH-resource-set -{0, 0, 0, log2(n_zp)+1, 0,0,0,0}, // 14 ZP_CSI_RS_TRIGGER: -{1, 1, 0, 0, 0,0,0,0}, // 15 FREQ_HOPPING_FLAG: 0 bit if only resource allocation type 0 -{0, 0, 0, 5, 0,0,0,0}, // 16 TB1_MCS: -{0, 0, 0, 1, 0,0,0,0}, // 17 TB1_NDI: -{0, 0, 0, 2, 0,0,0,0}, // 18 TB1_RV: -{0, 0, 0, 5, 0,0,0,0}, // 19 TB2_MCS: -{0, 0, 0, 1, 0,0,0,0}, // 20 TB2_NDI: -{0, 0, 0, 2, 0,0,0,0}, // 21 TB2_RV: -{5, 5, 5, 0, 0,0,0,0}, // 22 MCS: -{1, 1, 1, 0, 0,0,0,0}, // 23 NDI: -{2, 2, 2, 0, 0,0,0,0}, // 24 RV: -{4, 4, 4, 4, 0,0,0,0}, // 25 HARQ_PROCESS_NUMBER: -{0, 0, 2, 4, 0,0,0,0}, // 26 DAI: For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI - // 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI - // 0 otherwise -{0, 2, 0, 0, 0,0,0,0}, // 27 FIRST_DAI: (1 or 2 bits) 1 bit for semi-static HARQ-ACK // 2 bits for dynamic HARQ-ACK codebook with single HARQ-ACK codebook -{0, 2, 0, 0, 0,0,0,0}, // 28 SECOND_DAI: (0 or 2 bits) 2 bits for dynamic HARQ-ACK codebook with two HARQ-ACK sub-codebooks // 0 bits otherwise -{2, 2, 0, 0, 0,0,0,0}, // 29 TPC_PUSCH: -{0, 0, 2, 2, 0,0,0,0}, // 30 TPC_PUCCH: -{0, 0, 3, 3, 0,0,0,0}, // 31 PUCCH_RESOURCE_IND: -{0, 0, 3, 3, 0,0,0,0}, // 32 PDSCH_TO_HARQ_FEEDBACK_TIME_IND: -{0, 0, 0, 0, 0,0,0,0}, // 33 SHORT_MESSAGE_IND: 1 bit if crc scrambled with P-RNTI - // not implemented at the moment -{0, log2(n_SRS), 0, 0, 0,0,0,0}, // 34 SRS_RESOURCE_IND: -{0, 0, 0, 0, 0,0,0,0}, // 35 PRECOD_NBR_LAYERS: -{0, 0, 0, 0, 0,0,0,0}, // 36 ANTENNA_PORTS: -{0, 0, 0, 3, 0,0,0,0}, // 37 TCI: 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits -{0, 3, 0, 0, 0,0,0,2}, // 38 SRS_REQUEST: -{0, 0, 0, 0, 0,0,0,2}, // 39 TPC_CMD_NUMBER_FORMAT2_3: -{0, 6, 0, 0, 0,0,0,0}, // 40 CSI_REQUEST: -{0, 8, 0, 8, 0,0,0,0}, // 41 CBGTI: 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH -{0, 0, 0, 1, 0,0,0,0}, // 42 CBGFI: 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator -{0, 2, 0, 0, 0,0,0,0}, // 43 PTRS_DMRS: -{0, 2, 0, 0, 0,0,0,0}, // 44 BETA_OFFSET_IND: -{0, 1, 0, 1, 0,0,0,0}, // 45 DMRS_SEQ_INI: 1 bit if the cell has two ULs and the number of bits for DCI format 1_0 before padding - //is larger than the number of bits for DCI format 0_0 before padding; 0 bit otherwise -{0, 0, 0, 0, 0,0,0,0}, // 46 SUL_IND_0_0: -{0, 0, 0, 0, 0,0,0,0} // 47 PADDING: (Note 2) If DCI format 0_0 is monitored in common search space - // and if the number of information bits in the DCI format 0_0 prior to padding - // is less than the payload size of the DCI format 1_0 monitored in common search space - // zeros shall be appended to the DCI format 0_0 - // until the payload size equals that of the DCI format 1_0 +//Format0_0 Format0_1 Format1_0 Format1_1 Formats2_0/1/2/3 +{1, 1, (((crc_scrambled == _p_rnti) || (crc_scrambled == _si_rnti) || (crc_scrambled == _ra_rnti)) ? 0:1), + 1, 0,0,0,0}, // 0 IDENTIFIER_DCI_FORMATS: +{0, 3, 0, 3, 0,0,0,0}, // 1 CARRIER_IND: 0 or 3 bits, as defined in Subclause x.x of [5, TS38.213] +{0, 0, 0, 0, 0,0,0,0}, // 2 SUL_IND_0_1: +{0, 0, 0, 0, 1,0,0,0}, // 3 SLOT_FORMAT_IND: size of DCI format 2_0 is configurable by higher layers up to 128 bits, according to Subclause 11.1.1 of [5, TS 38.213] +{0, 0, 0, 0, 0,1,0,0}, // 4 PRE_EMPTION_IND: size of DCI format 2_1 is configurable by higher layers up to 126 bits, according to Subclause 11.2 of [5, TS 38.213]. Each pre-emption indication is 14 bits +{0, 0, 0, 0, 0,0,1,0}, // 5 TPC_CMD_NUMBER: The parameter xxx provided by higher layers determines the index to the TPC command number for an UL of a cell. Each TPC command number is 2 bits +{0, 0, 0, 0, 0,0,0,1}, // 6 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3 +{0, ceil(log2(n_RB_ULBWP)), 0, ceil(log2(n_RB_ULBWP)), 0,0,0,0}, // 7 BANDWIDTH_PART_IND: +{0, 0, ((crc_scrambled == _p_rnti) ? 2:0), + 0, 0,0,0,0}, // 8 SHORT_MESSAGE_IND 2 bits if crc scrambled with P-RNTI +{0, 0, ((crc_scrambled == _p_rnti) ? 8:0), + 0, 0,0,0,0}, // 9 SHORT_MESSAGES 8 bit8 if crc scrambled with P-RNTI +{(ceil(log2(n_RB_ULBWP*(n_RB_ULBWP+1)/2)))-n_UL_hopping, + (ceil(log2(n_RB_ULBWP*(n_RB_ULBWP+1)/2)))-n_UL_hopping, + 0, 0, 0,0,0,0}, // 10 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: PUSCH hopping with resource allocation type 1 not considered + // (NOTE 1) If DCI format 0_0 is monitored in common search space + // and if the number of information bits in the DCI format 0_0 prior to padding + // is larger than the payload size of the DCI format 1_0 monitored in common search space + // the bitwidth of the frequency domain resource allocation field in the DCI format 0_0 + // is reduced such that the size of DCI format 0_0 equals to the size of the DCI format 1_0 +{0, 0, ceil(log2(n_RB_DLBWP*(n_RB_DLBWP+1)/2)), + ceil(log2(n_RB_DLBWP*(n_RB_DLBWP+1)/2)), + 0,0,0,0}, // 11 FREQ_DOM_RESOURCE_ASSIGNMENT_DL: +{4, log2(pusch_alloc_list), 4, log2(pusch_alloc_list), 0,0,0,0}, // 12 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 6.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits, + // where I the number of entries in the higher layer parameter pusch-AllocationList +{0, 1, 1, 1, 0,0,0,0}, // 13 VRB_TO_PRB_MAPPING: 0 bit if only resource allocation type 0 +{0, 0, 0, 1, 0,0,0,0}, // 14 PRB_BUNDLING_SIZE_IND:0 bit if the higher layer parameter PRB_bundling is not configured or is set to 'static', or 1 bit if the higher layer parameter PRB_bundling is set to 'dynamic' according to Subclause 5.1.2.3 of [6, TS 38.214] +{0, 0, 0, 2, 0,0,0,0}, // 15 RATE_MATCHING_IND: 0, 1, or 2 bits according to higher layer parameter rate-match-PDSCH-resource-set +{0, 0, 0, log2(n_zp)+1, 0,0,0,0}, // 16 ZP_CSI_RS_TRIGGER: +{1, 1, 0, 0, 0,0,0,0}, // 17 FREQ_HOPPING_FLAG: 0 bit if only resource allocation type 0 +{0, 0, 0, 5, 0,0,0,0}, // 18 TB1_MCS: +{0, 0, 0, 1, 0,0,0,0}, // 19 TB1_NDI: +{0, 0, 0, 2, 0,0,0,0}, // 20 TB1_RV: +{0, 0, 0, 5, 0,0,0,0}, // 21 TB2_MCS: +{0, 0, 0, 1, 0,0,0,0}, // 22 TB2_NDI: +{0, 0, 0, 2, 0,0,0,0}, // 23 TB2_RV: +{5, 5, 5, 0, 0,0,0,0}, // 24 MCS: +{1, 1, (crc_scrambled == _c_rnti)?1:0,0, 0,0,0,0}, // 25 NDI: +{2, 2, (((crc_scrambled == _c_rnti) || (crc_scrambled == _si_rnti)) ? 2:0), + 0, 0,0,0,0}, // 26 RV: +{4, 4, (crc_scrambled == _c_rnti)?4:0,4, 0,0,0,0}, // 27 HARQ_PROCESS_NUMBER: +{0, 0, (crc_scrambled == _c_rnti)?2:0,2, 0,0,0,0}, // 28 DAI: For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI + // 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI + // 0 otherwise +{0, 2, 0, 0, 0,0,0,0}, // 29 FIRST_DAI: (1 or 2 bits) 1 bit for semi-static HARQ-ACK // 2 bits for dynamic HARQ-ACK codebook with single HARQ-ACK codebook +{0, 2, 0, 0, 0,0,0,0}, // 30 SECOND_DAI: (0 or 2 bits) 2 bits for dynamic HARQ-ACK codebook with two HARQ-ACK sub-codebooks // 0 bits otherwise +{0, 0, (((crc_scrambled == _p_rnti) || (crc_scrambled == _ra_rnti)) ? 2:0), + 0, 0,0,0,0}, // 31 TB_SCALING +{2, 2, 0, 0, 0,0,0,0}, // 32 TPC_PUSCH: +{0, 0, (crc_scrambled == _c_rnti)?2:0,2, 0,0,0,0}, // 33 TPC_PUCCH: +{0, 0, (crc_scrambled == _c_rnti)?3:0,3, 0,0,0,0}, // 34 PUCCH_RESOURCE_IND: +{0, 0, (crc_scrambled == _c_rnti)?3:0,3, 0,0,0,0}, // 35 PDSCH_TO_HARQ_FEEDBACK_TIME_IND: +{0, log2(n_SRS), 0, 0, 0,0,0,0}, // 36 SRS_RESOURCE_IND: +{0, 0, 0, 0, 0,0,0,0}, // 37 PRECOD_NBR_LAYERS: +{0, 0, 0, 0, 0,0,0,0}, // 38 ANTENNA_PORTS: +{0, 0, 0, 3, 0,0,0,0}, // 39 TCI: 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits +{0, 3, 0, 0, 0,0,0,2}, // 40 SRS_REQUEST: +{0, 0, 0, 0, 0,0,0,2}, // 41 TPC_CMD_NUMBER_FORMAT2_3: +{0, 6, 0, 0, 0,0,0,0}, // 42 CSI_REQUEST: +{0, 8, 0, 8, 0,0,0,0}, // 43 CBGTI: 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH +{0, 0, 0, 1, 0,0,0,0}, // 44 CBGFI: 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator +{0, 2, 0, 0, 0,0,0,0}, // 45 PTRS_DMRS: +{0, 2, 0, 0, 0,0,0,0}, // 46 BETA_OFFSET_IND: +{0, 1, 0, 1, 0,0,0,0}, // 47 DMRS_SEQ_INI: 1 bit if the cell has two ULs and the number of bits for DCI format 1_0 before padding + // is larger than the number of bits for DCI format 0_0 before padding; 0 bit otherwise +{0, 1, 0, 0, 0,0,0,0}, // 48 UL_SCH_IND: value of "1" indicates UL-SCH shall be transmitted on the PUSCH and a value of "0" indicates UL-SCH shall not be transmitted on the PUSCH +{0, 0, 0, 0, 0,0,0,0}, // 49 PADDING_NR_DCI: + // (NOTE 2) If DCI format 0_0 is monitored in common search space + // and if the number of information bits in the DCI format 0_0 prior to padding + // is less than the payload size of the DCI format 1_0 monitored in common search space + // zeros shall be appended to the DCI format 0_0 + // until the payload size equals that of the DCI format 1_0 +{0, 0, 0, 0, 0,0,0,0}, // 50 SUL_IND_0_0: +{0, 0, 0, 0, 0,0,0,0}, // 51 RA_PREAMBLE_INDEX (random access procedure initiated by a PDCCH order not implemented, FIXME!!!) +{0, 0, 0, 0, 0,0,0,0}, // 52 SUL_IND_1_0 (random access procedure initiated by a PDCCH order not implemented, FIXME!!!) +{0, 0, 0, 0, 0,0,0,0}, // 53 SS_PBCH_INDEX (random access procedure initiated by a PDCCH order not implemented, FIXME!!!) +{0, 0, 0, 0, 0,0,0,0}, // 54 PRACH_MASK_INDEX (random access procedure initiated by a PDCCH order not implemented, FIXME!!!) +{0, 0, ((crc_scrambled == _p_rnti)?6:(((crc_scrambled == _si_rnti) || (crc_scrambled == _ra_rnti))?16:0)), + 0, 0,0,0,0} // 55 RESERVED_NR_DCI }; // NOTE 1: adjustments in freq_dom_resource_assignment_UL to be done if necessary @@ -4932,60 +5032,76 @@ uint16_t nr_dci_format_size (NR_DCI_format_t format, uint8_t dci_size [8] = {0,0,0,0,0,0,0,0}; // will contain size for each format for (int i=0 ; i<NBR_NR_FORMATS ; i++) { +//#ifdef NR_PDCCH_DCI_DEBUG +// printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size)-> i=%d, j=%d\n", i, j); +//#endif for (int j=0; j<NBR_NR_DCI_FIELDS; j++) { - #ifdef NR_PDCCH_DCI_DEBUG - //printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size)-> i=%d, j=%d\n", i, j); - #endif dci_size [i] = dci_size [i] + dci_field_size_table[j][i]; // dci_size[i] contains the size in bits of the dci pdu format i - if (i==(int)format) { // (int)format indicates the position of each format in the table (e.g. format1_0=2 -> position in table is 2) - dci_fields_sizes[j] = dci_field_size_table[j][i]; // dci_fields_sizes[j] contains the sizes of each field (j) for a determined format i - } + //if (i==(int)format-15) { // (int)format-15 indicates the position of each format in the table (e.g. format1_0=17 -> position in table is 2) + dci_fields_sizes[j][i] = dci_field_size_table[j][i]; // dci_fields_sizes[j] contains the sizes of each field (j) for a determined format i + //} } #ifdef NR_PDCCH_DCI_DEBUG printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size) dci_size[%d]=%d for n_RB_ULBWP=%d\n", i,dci_size[i],n_RB_ULBWP); #endif } - #ifdef NR_PDCCH_DCI_DEBUG - printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size) dci_field_size_table[%d] = { ",format); - for (int j=0; j<NBR_NR_DCI_FIELDS; j++) printf("%d, ",dci_field_size_table[j][(int)format-15]); - printf(" }\n"); - #endif +#ifdef NR_PDCCH_DCI_DEBUG + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size) dci_fields_sizes[][] = { \n"); + for (int j=0; j<NBR_NR_DCI_FIELDS; j++){ + printf("\t\t"); + for (int i=0; i<NBR_NR_FORMATS ; i++) printf("%d\t",dci_fields_sizes[j][i]); + printf("\n"); + } + printf(" }\n"); + printf("\n\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size) dci_size[0]=%d, dci_size[2]=%d\n",dci_size[0],dci_size[2]); +#endif - if ((format == format0_0) || (format == format1_0)) { +// if ((format == format0_0) || (format == format1_0)) { // According to Section 7.3.1.1.1 in TS 38.212 // If DCI format 0_0 is monitored in common search space and if the number of information bits in the DCI format 0_0 prior to padding // is less than the payload size of the DCI format 1_0 monitored in common search space for scheduling the same serving cell, // zeros shall be appended to the DCI format 0_0 until the payload size equals that of the DCI format 1_0. - if (dci_size[0] < dci_size[2]) { // '0' corresponding to index for format0_0 and '2' corresponding to index of format1_0 - if (format == format0_0) { - dci_fields_sizes[PADDING] = dci_size[2] - dci_size[0]; - dci_size[0] = dci_size[2]; - #ifdef NR_PDCCH_DCI_DEBUG - printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size) new dci_size[format0_0]=%d\n",dci_size[0]); - #endif - } - } + if (dci_size[0] < dci_size[2]) { // '0' corresponding to index for format0_0 and '2' corresponding to index of format1_0 + //if (format == format0_0) { + dci_fields_sizes[PADDING_NR_DCI][0] = dci_size[2] - dci_size[0]; + dci_size[0] = dci_size[2]; + #ifdef NR_PDCCH_DCI_DEBUG + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size) new dci_size[format0_0]=%d\n",dci_size[0]); + #endif + //} + } // If DCI format 0_0 is monitored in common search space and if the number of information bits in the DCI format 0_0 prior to padding // is larger than the payload size of the DCI format 1_0 monitored in common search space for scheduling the same serving cell, // the bitwidth of the frequency domain resource allocation field in the DCI format 0_0 is reduced // such that the size of DCI format 0_0 equals to the size of the DCI format 1_0.. - if (dci_size[0] > dci_size[2]) { - if (format == format0_0) { - dci_fields_sizes[BANDWIDTH_PART_IND] -= (dci_size[0] - dci_size[2]); - dci_size[0] = dci_size[2]; - #ifdef NR_PDCCH_DCI_DEBUG - printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size) new dci_size[format0_0]=%d\n",dci_size[0]); - #endif - } - } + if (dci_size[0] > dci_size[2]) { + //if (format == format0_0) { + dci_fields_sizes[FREQ_DOM_RESOURCE_ASSIGNMENT_UL][0] -= (dci_size[0] - dci_size[2]); + dci_size[0] = dci_size[2]; + #ifdef NR_PDCCH_DCI_DEBUG + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size) new dci_size[format0_0]=%d\n",dci_size[0]); + #endif + //} } +// } + #ifdef NR_PDCCH_DCI_DEBUG + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_format_size) dci_fields_sizes[][] = { \n"); + for (int j=0; j<NBR_NR_DCI_FIELDS; j++){ + printf("\t\t"); + for (int i=0; i<NBR_NR_FORMATS ; i++) printf("%d\t",dci_fields_sizes[j][i]); + printf("\n"); + } + printf(" }\n"); + #endif - return dci_size[(int)format]; + return dci_size[0]; } + #endif #ifdef NR_PDCCH_DCI_RUN + uint8_t nr_dci_decoding_procedure(int s, int p, PHY_VARS_NR_UE *ue, @@ -4993,11 +5109,17 @@ uint8_t nr_dci_decoding_procedure(int s, int do_common, int16_t eNB_id, uint8_t nr_tti_rx, - uint8_t dci_fields_sizes[48], + uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS], + uint8_t dci_fields_sizes_cnt[MAX_NR_DCI_DECODED_SLOT][NBR_NR_DCI_FIELDS][NBR_NR_FORMATS], uint16_t n_RB_ULBWP, - uint16_t n_RB_DLBWP) { + uint16_t n_RB_DLBWP, + crc_scrambled_t *crc_scrambled, + format_found_t *format_found) { + + crc_scrambled_t crc_scrambled_ = *crc_scrambled; + format_found_t format_found_ = *format_found; #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure) nr_tti_rx=%d\n",nr_tti_rx); + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure) nr_tti_rx=%d and format_found=%d %d\n",nr_tti_rx,*format_found,format_found_); #endif uint8_t dci_cnt = 0, old_dci_cnt = 0; uint32_t CCEmap0 = 0, CCEmap1 = 0, CCEmap2 = 0; @@ -5005,39 +5127,25 @@ uint8_t nr_dci_decoding_procedure(int s, NR_UE_PDCCH **pdcch_vars = ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]]; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; uint8_t mi;// = get_mi(&ue->frame_parms, nr_tti_rx); - uint16_t ra_rnti = 99; - uint16_t tc_rnti = 1; // FIXME - uint16_t int_rnti = 1; // FIXME - uint16_t sfi_rnti = 1; // FIXME - uint16_t tpc_pusch_rnti =1; // FIXME - uint16_t tpc_pucch_rnti = 1; // FIXME - uint16_t tpc_srs_rnti = 1; // FIXME - uint8_t format0_found = 0, format_c_found = 0; + // we need to initialize this values as crc is going to be compared with them + uint16_t c_rnti=pdcch_vars[eNB_id]->crnti; + uint16_t cs_rnti,new_rnti,tc_rnti; + uint16_t p_rnti=P_RNTI; + uint16_t si_rnti=SI_RNTI; + uint16_t ra_rnti=99; + uint16_t sp_csi_rnti,sfi_rnti,int_rnti,tpc_pusch_rnti,tpc_pucch_rnti,tpc_srs_rnti; //FIXME + uint16_t crc_scrambled_values[13] = {c_rnti,cs_rnti,new_rnti,tc_rnti,p_rnti,si_rnti,ra_rnti,sp_csi_rnti,sfi_rnti,int_rnti,tpc_pusch_rnti,tpc_pucch_rnti,tpc_srs_rnti}; + + //uint8_t format0_found = 0, format_c_found = 0; uint8_t tmode = ue->transmission_mode[eNB_id]; uint8_t frame_type = frame_parms->frame_type; - //uint8_t dci_fields_sizes[48]; - uint8_t format0_0_size_bits = 0, format0_0_size_bytes = 0; //FIXME - uint8_t format0_1_size_bits = 0, format0_1_size_bytes = 0; //FIXME - uint8_t format1_0_size_bits = 0, format1_0_size_bytes = 0; //FIXME - uint8_t format1_1_size_bits = 0, format1_1_size_bytes = 0; //FIXME - uint8_t format2_0_size_bits = 0, format2_0_size_bytes = 0; //FIXME - uint8_t format2_1_size_bits = 0, format2_1_size_bytes = 0; //FIXME - uint8_t format2_2_size_bits = 0, format2_2_size_bytes = 0; //FIXME - uint8_t format2_3_size_bits = 0, format2_3_size_bytes = 0; //FIXME - - /* - * the following variables have to be removed - */ - uint8_t format1A_size_bits = 0, format1A_size_bytes = 0; - uint8_t format1C_size_bits = 0, format1C_size_bytes = 0; - uint8_t format0_size_bits = 0, format0_size_bytes = 0; - uint8_t format1_size_bits = 0, format1_size_bytes = 0; - uint8_t format2_size_bits = 0, format2_size_bytes = 0; - uint8_t format2A_size_bits = 0, format2A_size_bytes = 0; - /* - * - */ + uint8_t format_0_0_1_0_size_bits = 0, format_0_0_1_0_size_bytes = 0; //FIXME + uint8_t format_0_1_1_1_size_bits = 0, format_0_1_1_1_size_bytes = 0; //FIXME + uint8_t format_2_0_size_bits = 0, format_2_0_size_bytes = 0; //FIXME + uint8_t format_2_1_size_bits = 0, format_2_1_size_bytes = 0; //FIXME + uint8_t format_2_2_size_bits = 0, format_2_2_size_bytes = 0; //FIXME + uint8_t format_2_3_size_bits = 0, format_2_3_size_bytes = 0; //FIXME /* * * The implementation of this function will depend on the information given by the searchSpace IE @@ -5104,237 +5212,298 @@ uint8_t nr_dci_decoding_procedure(int s, // blind decoding (Type0-PDCCH,Type0A-PDCCH,Type1-PDCCH,Type2-PDCCH) // for format0_0 => we are NOT implementing format0_0 for common search spaces. FIXME! - // for format1_0, first we calculate dci pdu size - format1_0_size_bits = nr_dci_format_size(format1_0,1,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); - // the second parameter '1' is the pusch_alloc_list used to calculate size of field TIME_DOM_RESOURCE_ASSIGNMENT - //format1_0_size_bits = nr_dci_format_size(2,1,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); - format1_0_size_bytes = (format1_0_size_bits%8 == 0) ? (uint8_t)floor(format1_0_size_bits/8) : (uint8_t)(floor(format1_0_size_bits/8) + 1); + // for format0_0 and format1_0, first we calculate dci pdu size + format_0_0_1_0_size_bits = nr_dci_format_size(_c_rnti,16,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); + format_0_0_1_0_size_bytes = (format_0_0_1_0_size_bits%8 == 0) ? (uint8_t)floor(format_0_0_1_0_size_bits/8) : (uint8_t)(floor(format_0_0_1_0_size_bits/8) + 1); #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for common searchSpaces with format css_dci_format=%d, format1_0_size_bits=%d, format1_0_size_bytes=%d\n", - css_dci_format,format1_0_size_bits,format1_0_size_bytes); + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for common searchSpaces with format css_dci_format=%d, format_0_0_1_0_size_bits=%d, format_0_0_1_0_size_bytes=%d\n", + css_dci_format,format_0_0_1_0_size_bits,format_0_0_1_0_size_bytes); #endif // for aggregation level 4. The number of candidates (L2=4) will be calculated in function nr_dci_decoding_procedure0 #ifdef NR_PDCCH_DCI_DEBUG printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> common searchSpaces with format css_dci_format=%d and aggregation_level=%d\n", css_dci_format,(1<<2)); #endif + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 2, - cformat0_0_and_1_0, format1A, format1A, format0, - format1_0_size_bits, format1A_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 2, + cformat0_0_and_1_0, uformat0_0_and_1_0, + format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + format_0_0_1_0_size_bits = nr_dci_format_size(crc_scrambled_,16,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); // after decoding dci successfully we recalculate dci pdu size with correct crc scrambled to get the right field sizes + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } // for aggregation level 8. The number of candidates (L2=8) will be calculated in function nr_dci_decoding_procedure0 #ifdef NR_PDCCH_DCI_DEBUG printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> common searchSpaces with format css_dci_format=%d and aggregation_level=%d\n", css_dci_format,(1<<3)); #endif + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 3, - cformat0_0_and_1_0, format1A, format1A, format0, - format1_0_size_bits, format1A_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 3, + cformat0_0_and_1_0, uformat0_0_and_1_0, + format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + format_0_0_1_0_size_bits = nr_dci_format_size(crc_scrambled_,16,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); // after decoding dci successfully we recalculate dci pdu size with correct crc scrambled to get the right field sizes + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } // for aggregation level 16. The number of candidates (L2=16) will be calculated in function nr_dci_decoding_procedure0 #ifdef NR_PDCCH_DCI_DEBUG printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> common searchSpaces with format css_dci_format=%d and aggregation_level=%d\n", css_dci_format,(1<<4)); #endif + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 4, - cformat0_0_and_1_0, format1A, format1A, format0, - format1_0_size_bits, format1A_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 4, + cformat0_0_and_1_0, uformat0_0_and_1_0, + format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + format_0_0_1_0_size_bits = nr_dci_format_size(crc_scrambled_,16,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); // after decoding dci successfully we recalculate dci pdu size with correct crc scrambled to get the right field sizes + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } } // Type3-PDCCH common search space for a DCI format with CRC scrambled by INT-RNTI, or SFI-RNTI, // or TPC-PUSCH-RNTI, or TPC-PUCCH-RNTI, or TPC-SRS-RNTI, or C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI if (css_dci_format == cformat2_0) { // for format2_0, first we calculate dci pdu size - format2_0_size_bits = nr_dci_format_size(format2_0,0,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); - format2_0_size_bytes = (format2_0_size_bits%8 == 0) ? (uint8_t)floor(format2_0_size_bits/8) : (uint8_t)(floor(format2_0_size_bits/8) + 1); + format_2_0_size_bits = nr_dci_format_size(_sfi_rnti,0,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); + format_2_0_size_bytes = (format_2_0_size_bits%8 == 0) ? (uint8_t)floor(format_2_0_size_bits/8) : (uint8_t)(floor(format_2_0_size_bits/8) + 1); #ifdef NR_PDCCH_DCI_DEBUG printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for common searchSpaces with format css_dci_format=%d, format2_0_size_bits=%d, format2_0_size_bytes=%d\n", - css_dci_format,format2_0_size_bits,format2_0_size_bytes); + css_dci_format,format_2_0_size_bits,format_2_0_size_bytes); #endif // for aggregation level 1. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0 + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 0, - format1A, format1A, format1A, format0, - format1A_size_bits, format1A_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 0, + cformat2_0, uformat0_0_and_1_0, + format_2_0_size_bits, format_2_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } // for aggregation level 2. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0 + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 1, - format1A, format1A, format1A, format0, - format1A_size_bits, format1A_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 1, + cformat2_0, uformat0_0_and_1_0, + format_2_0_size_bits, format_2_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } // for aggregation level 4. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0 + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 2, - format1A, format1A, format1A, format0, - format1A_size_bits, format1A_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 2, + cformat2_0, uformat0_0_and_1_0, + format_2_0_size_bits, format_2_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } // for aggregation level 8. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0 + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 3, - format1A, format1A, format1A, format0, - format1A_size_bits, format1A_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 3, + cformat2_0, uformat0_0_and_1_0, + format_2_0_size_bits, format_2_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } // for aggregation level 16. The number of candidates (nrofCandidates-SFI) will be calculated in function nr_dci_decoding_procedure0 + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 1, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 4, - format1A, format1A, format1A, format0, - format1A_size_bits, format1A_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 4, + cformat2_0, uformat0_0_and_1_0, + format_2_0_size_bits, format_2_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } } if (css_dci_format == cformat2_1) { // for format2_1, first we calculate dci pdu size - format2_1_size_bits = nr_dci_format_size(format2_1,0,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); - format2_1_size_bytes = (format2_1_size_bits%8 == 0) ? (uint8_t)floor(format2_1_size_bits/8) : (uint8_t)(floor(format2_1_size_bits/8) + 1); + format_2_1_size_bits = nr_dci_format_size(_int_rnti,0,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); + format_2_1_size_bytes = (format_2_1_size_bits%8 == 0) ? (uint8_t)floor(format_2_1_size_bits/8) : (uint8_t)(floor(format_2_1_size_bits/8) + 1); #ifdef NR_PDCCH_DCI_DEBUG printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for common searchSpaces with format css_dci_format=%d, format2_1_size_bits=%d, format2_1_size_bytes=%d\n", - css_dci_format,format2_1_size_bits,format2_1_size_bytes); + css_dci_format,format_2_1_size_bits,format_2_1_size_bytes); #endif } if (css_dci_format == cformat2_2) { // for format2_2, first we calculate dci pdu size - format2_2_size_bits = nr_dci_format_size(format2_2,0,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); - format2_2_size_bytes = (format2_2_size_bits%8 == 0) ? (uint8_t)floor(format2_2_size_bits/8) : (uint8_t)(floor(format2_2_size_bits/8) + 1); + format_2_2_size_bits = nr_dci_format_size(_tpc_pucch_rnti,0,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); + format_2_2_size_bytes = (format_2_2_size_bits%8 == 0) ? (uint8_t)floor(format_2_2_size_bits/8) : (uint8_t)(floor(format_2_2_size_bits/8) + 1); #ifdef NR_PDCCH_DCI_DEBUG printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for common searchSpaces with format css_dci_format=%d, format2_2_size_bits=%d, format2_2_size_bytes=%d\n", - css_dci_format,format2_2_size_bits,format2_2_size_bytes); + css_dci_format,format_2_2_size_bits,format_2_2_size_bytes); #endif } if (css_dci_format == cformat2_3) { // for format2_1, first we calculate dci pdu size - format2_3_size_bits = nr_dci_format_size(format2_3,0,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); - format2_3_size_bytes = (format2_3_size_bits%8 == 0) ? (uint8_t)floor(format2_3_size_bits/8) : (uint8_t)(floor(format2_3_size_bits/8) + 1); + format_2_3_size_bits = nr_dci_format_size(_tpc_srs_rnti,0,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); + format_2_3_size_bytes = (format_2_3_size_bits%8 == 0) ? (uint8_t)floor(format_2_3_size_bits/8) : (uint8_t)(floor(format_2_3_size_bits/8) + 1); #ifdef NR_PDCCH_DCI_DEBUG printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for common searchSpaces with format css_dci_format=%d, format2_3_size_bits=%d, format2_3_size_bytes=%d\n", - css_dci_format,format2_3_size_bits,format2_3_size_bytes); + css_dci_format,format_2_3_size_bits,format_2_3_size_bytes); #endif } } else { // UE-SPECIFIC SearchSpaceType assigned to current SearchSpace/CORESET // UE-specific search space for a DCI format with CRC scrambled by C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI if (uss_dci_format == uformat0_0_and_1_0) { - // for format0_0, first we calculate dci pdu size - format0_0_size_bits = nr_dci_format_size(format0_0,1,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); - format0_0_size_bytes = (format0_0_size_bits%8 == 0) ? (uint8_t)floor(format0_0_size_bits/8) : (uint8_t)(floor(format0_0_size_bits/8) + 1); + // for format0_0 and format1_0, first we calculate dci pdu size + format_0_0_1_0_size_bits = nr_dci_format_size(_c_rnti,16,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); + format_0_0_1_0_size_bytes = (format_0_0_1_0_size_bits%8 == 0) ? (uint8_t)floor(format_0_0_1_0_size_bits/8) : (uint8_t)(floor(format_0_0_1_0_size_bits/8) + 1); #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for UE-specific searchSpaces with format uss_dci_format=%d, format0_0_size_bits=%d, format0_0_size_bytes=%d\n", - css_dci_format,format0_0_size_bits,format0_0_size_bytes); + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for UE-specific searchSpaces with format uss_dci_format=%d, format_0_0_1_0_size_bits=%d, format_0_0_1_0_size_bytes=%d\n", + css_dci_format,format_0_0_1_0_size_bits,format_0_0_1_0_size_bytes); #endif // blind decoding format0_0 for aggregation level 1. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 1, format0_0_size_bits=%d, format0_0_size_bytes=%d\n", - uss_dci_format,format0_0_size_bits,format0_0_size_bytes); + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 1, format_0_0_1_0_size_bits=%d, format_0_0_1_0_size_bytes=%d\n", + uss_dci_format,format_0_0_1_0_size_bits,format_0_0_1_0_size_bytes); #endif + old_dci_cnt = dci_cnt; +/* + * To be removed, just for unitary testing + */ +//#ifdef NR_PDCCH_DCI_DEBUG +// printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ### WE PROVOKE DCI DETECTION !!! ### old_dci_cnt=%d and dci_cnt=%d\n", +// old_dci_cnt,dci_cnt); +// dci_cnt++; +//#endif +/* + * To be removed until here + */ nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 0, - format1A, format1A, format1A, format0, - format0_0_size_bits, format0_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 0, + cformat0_0_and_1_0, uformat0_0_and_1_0, + format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++){ + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; +/* + * To be removed, just for unitary testing + */ +//#ifdef NR_PDCCH_DCI_DEBUG +// printf("dci_fields_sizes_cnt(%d,0,1][%d][%d]=(%d,%d,%d)\t\tdci_fields_sizes[%d][%d]=(%d)\n", +// dci_cnt-1,i,j,dci_fields_sizes_cnt[dci_cnt-1][i][j],dci_fields_sizes_cnt[0][i][j],dci_fields_sizes_cnt[1][i][j],i,j,dci_fields_sizes[i][j]); +//#endif +/* + * To be removed until here + */ + } + } // blind decoding format0_0 for aggregation level 2. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 2, format0_0_size_bits=%d, format0_0_size_bytes=%d\n", - uss_dci_format,format0_0_size_bits,format0_0_size_bytes); + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 2, format_0_0_1_0_size_bits=%d, format_0_0_1_0_size_bytes=%d\n", + uss_dci_format,format_0_0_1_0_size_bits,format_0_0_1_0_size_bytes); #endif + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 1, - format1A, format1A, format1A, format0, - format0_0_size_bits, format0_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 1, + cformat0_0_and_1_0, uformat0_0_and_1_0, + format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } // blind decoding format0_0 for aggregation level 4. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 4, format0_0_size_bits=%d, format0_0_size_bytes=%d\n", - uss_dci_format,format0_0_size_bits,format0_0_size_bytes); + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 4, format_0_0_1_0_size_bits=%d, format_0_0_1_0_size_bytes=%d\n", + uss_dci_format,format_0_0_1_0_size_bits,format_0_0_1_0_size_bytes); #endif + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 2, - format1A, format1A, format1A, format0, - format0_0_size_bits, format0_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 2, + cformat0_0_and_1_0, uformat0_0_and_1_0, + format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } // blind decoding format0_0 for aggregation level 8. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 8, format0_0_size_bits=%d, format0_0_size_bytes=%d\n", - uss_dci_format,format0_0_size_bits,format0_0_size_bytes); + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 8, format_0_0_1_0_size_bits=%d, format_0_0_1_0_size_bytes=%d\n", + uss_dci_format,format_0_0_1_0_size_bits,format_0_0_1_0_size_bytes); #endif + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 3, - format1A, format1A, format1A, format0, - format0_0_size_bits, format0_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 3, + cformat0_0_and_1_0, uformat0_0_and_1_0, + format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } // blind decoding format0_0 for aggregation level 16. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 16, format0_0_size_bits=%d, format0_0_size_bytes=%d\n", - uss_dci_format,format0_0_size_bits,format0_0_size_bytes); - #endif - nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 4, - format1A, format1A, format1A, format0, - format0_0_size_bits, format0_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); - - // for format1_0, first we calculate dci pdu size - format1_0_size_bits = nr_dci_format_size(format1_0,1,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); - format1_0_size_bytes = (format1_0_size_bits%8 == 0) ? (uint8_t)floor(format1_0_size_bits/8) : (uint8_t)(floor(format1_0_size_bits/8) + 1); - #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for UE-specific searchSpaces with format uss_dci_format=%d, format1_0_size_bits=%d, format1_0_size_bytes=%d\n", - css_dci_format,format1_0_size_bits,format1_0_size_bytes); - #endif - // blind decoding format1_0 for aggregation level 1. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 - #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 1, format1_0_size_bits=%d, format1_0_size_bytes=%d\n", - uss_dci_format,format1_0_size_bits,format1_0_size_bytes); + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 16, format_0_0_1_0_size_bits=%d, format_0_0_1_0_size_bytes=%d\n", + uss_dci_format,format_0_0_1_0_size_bits,format_0_0_1_0_size_bytes); #endif + old_dci_cnt = dci_cnt; nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 0, - format1A, format1A, format1A, format0, - format1_0_size_bits, format1_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); - // blind decoding format1_0 for aggregation level 2. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 - #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 2, format1_0_size_bits=%d, format1_0_size_bytes=%d\n", - uss_dci_format,format1_0_size_bits,format1_0_size_bytes); - #endif - nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 1, - format1A, format1A, format1A, format0, - format1_0_size_bits, format1_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); - // blind decoding format1_0 for aggregation level 4. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 - #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 4, format1_0_size_bits=%d, format1_0_size_bytes=%d\n", - uss_dci_format,format1_0_size_bits,format1_0_size_bytes); - #endif - nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 2, - format1A, format1A, format1A, format0, - format1_0_size_bits, format1_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); - // blind decoding format1_0 for aggregation level 8. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 - #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 8, format1_0_size_bits=%d, format1_0_size_bytes=%d\n", - uss_dci_format,format1_0_size_bits,format1_0_size_bytes); - #endif - nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 3, - format1A, format1A, format1A, format0, - format1_0_size_bits, format1_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); - // blind decoding format1_0 for aggregation level 16. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 - #ifdef NR_PDCCH_DCI_DEBUG - printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> ue-Specific searchSpaces with format uss_dci_format=%d and aggregation level 16, format1_0_size_bits=%d, format1_0_size_bytes=%d\n", - uss_dci_format,format1_0_size_bits,format1_0_size_bytes); - #endif - nr_dci_decoding_procedure0(s,p,pdcch_vars, 0, nr_tti_rx, dci_alloc, eNB_id, ue->current_thread_id[nr_tti_rx], frame_parms, mi, - ((ue->decode_SIB == 1) ? SI_RNTI : 0), ra_rnti, P_RNTI, tc_rnti, int_rnti, sfi_rnti, tpc_pusch_rnti, tpc_pucch_rnti, tpc_srs_rnti, 4, - format1A, format1A, format1A, format0, - format1_0_size_bits, format1_0_size_bytes, &dci_cnt, - &format0_found, &format_c_found, &CCEmap0, &CCEmap1, &CCEmap2); + crc_scrambled_values, 4, + cformat0_0_and_1_0, uformat0_0_and_1_0, + format_0_0_1_0_size_bits, format_0_0_1_0_size_bytes, &dci_cnt, + &crc_scrambled_, &format_found_, &CCEmap0, &CCEmap1, &CCEmap2); + if (dci_cnt != old_dci_cnt){ + old_dci_cnt = dci_cnt; + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) + for (int j=0; j<NBR_NR_FORMATS; j++) + dci_fields_sizes_cnt[dci_cnt-1][i][j]=dci_fields_sizes[i][j]; + } } - if (uss_dci_format == uformat0_1_and_1_1) { // Not implemented yet. FIXME!!! + *crc_scrambled = crc_scrambled_; + *format_found = format_found_; +#ifdef NR_PDCCH_DCI_DEBUG + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> at the end crc_scrambled=%d and format_found=%d\n",*crc_scrambled,*format_found); +#endif + /*if (uss_dci_format == uformat0_1_and_1_1) { // Not implemented yet. FIXME!!! // for format0_1, first we calculate dci pdu size - format0_1_size_bits = nr_dci_format_size(format0_1,1,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); + format0_1_size_bits = nr_dci_format_size(format0_1,c_rnti,16,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); format0_1_size_bytes = (format0_1_size_bits%8 == 0) ? (uint8_t)floor(format0_1_size_bits/8) : (uint8_t)(floor(format0_1_size_bits/8) + 1); #ifdef NR_PDCCH_DCI_DEBUG printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for UE-specific searchSpaces with format uss_dci_format=%d, format0_1_size_bits=%d, format0_1_size_bytes=%d\n", @@ -5347,7 +5516,7 @@ uint8_t nr_dci_decoding_procedure(int s, // blind decoding format0_1 for aggregation level 16. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 // for format1_1, first we calculate dci pdu size - format1_1_size_bits = nr_dci_format_size(format1_1,1,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); + format1_1_size_bits = nr_dci_format_size(format1_1,c_rnti,16,n_RB_ULBWP,n_RB_DLBWP,dci_fields_sizes); format1_1_size_bytes = (format1_1_size_bits%8 == 0) ? (uint8_t)floor(format1_1_size_bits/8) : (uint8_t)(floor(format1_1_size_bits/8) + 1); #ifdef NR_PDCCH_DCI_DEBUG printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> calculating dci format size for UE-specific searchSpaces with format uss_dci_format=%d, format1_1_size_bits=%d, format1_1_size_bytes=%d\n", @@ -5358,10 +5527,17 @@ uint8_t nr_dci_decoding_procedure(int s, // blind decoding format1_1 for aggregation level 4. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 // blind decoding format1_1 for aggregation level 8. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 // blind decoding format1_1 for aggregation level 16. The number of candidates (nrofCandidates) will be calculated in function nr_dci_decoding_procedure0 - } + }*/ } +#ifdef NR_PDCCH_DCI_DEBUG + printf("\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure)-> at the end dci_cnt=%d \n",dci_cnt); +#endif return(dci_cnt); } + + + + #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.h b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.h index 5d12b1e2a01f9cefaa6674615f608322f6afa40d..4aa441c83706c535b0af43b5b0f9ab5bebff1e09 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.h @@ -42,70 +42,80 @@ #define NR_PDCCH_DCI_H #ifdef NR_PDCCH_DCI_H + struct NR_DCI_INFO_EXTRACTED { - uint8_t carrier_ind ; // 0 CARRIER_IND: 0 or 3 bits, as defined in Subclause x.x of [5, TS38.213] - uint8_t sul_ind_0_1 ; // 1 SUL_IND_0_1: - uint8_t identifier_dci_formats ; // 2 IDENTIFIER_DCI_FORMATS: + uint8_t identifier_dci_formats ; // 0 IDENTIFIER_DCI_FORMATS: + uint8_t carrier_ind ; // 1 CARRIER_IND: 0 or 3 bits, as defined in Subclause x.x of [5, TS38.213] + uint8_t sul_ind_0_1 ; // 2 SUL_IND_0_1: uint8_t slot_format_ind ; // 3 SLOT_FORMAT_IND: size of DCI format 2_0 is configurable by higher layers up to 128 bits, according to Subclause 11.1.1 of [5, TS 38.213] uint8_t pre_emption_ind ; // 4 PRE_EMPTION_IND: size of DCI format 2_1 is configurable by higher layers up to 126 bits, according to Subclause 11.2 of [5, TS 38.213]. Each pre-emption indication is 14 bits uint8_t tpc_cmd_number ; // 5 TPC_CMD_NUMBER: The parameter xxx provided by higher layers determines the index to the TPC command number for an UL of a cell. Each TPC command number is 2 bits uint8_t block_number ; // 6 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3 uint8_t bandwidth_part_ind ; // 7 BANDWIDTH_PART_IND: - uint16_t freq_dom_resource_assignment_UL; // 8 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: PUSCH hopping with resource allocation type 1 not considered - // (NOTE 1) If DCI format 0_0 is monitored in common search space - // and if the number of information bits in the DCI format 0_0 prior to padding - // is larger than the payload size of the DCI format 1_0 monitored in common search space - // the bitwidth of the frequency domain resource allocation field in the DCI format 0_0 - // is reduced such that the size of DCI format 0_0 equals to the size of the DCI format 1_0 - uint16_t freq_dom_resource_assignment_DL; // 9 FREQ_DOM_RESOURCE_ASSIGNMENT_DL: - uint8_t time_dom_resource_assignment ; // 10 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 6.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits, - // where I the number of entries in the higher layer parameter pusch-AllocationList - uint8_t vrb_to_prb_mapping ; // 11 VRB_TO_PRB_MAPPING: 0 bit if only resource allocation type 0 - uint8_t prb_bundling_size_ind ; // 12 PRB_BUNDLING_SIZE_IND:0 bit if the higher layer parameter PRB_bundling is not configured or is set to 'static', or 1 bit if the higher layer parameter PRB_bundling is set to 'dynamic' according to Subclause 5.1.2.3 of [6, TS 38.214] - uint8_t rate_matching_ind ; // 13 RATE_MATCHING_IND: 0, 1, or 2 bits according to higher layer parameter rate-match-PDSCH-resource-set - uint8_t zp_csi_rs_trigger ; // 14 ZP_CSI_RS_TRIGGER: - uint8_t freq_hopping_flag ; // 15 FREQ_HOPPING_FLAG: 0 bit if only resource allocation type 0 - uint8_t tb1_mcs ; // 16 TB1_MCS: - uint8_t tb1_ndi ; // 17 TB1_NDI: - uint8_t tb1_rv ; // 18 TB1_RV: - uint8_t tb2_mcs ; // 19 TB2_MCS: - uint8_t tb2_ndi ; // 20 TB2_NDI: - uint8_t tb2_rv ; // 21 TB2_RV: - uint8_t mcs ; // 22 MCS: - uint8_t ndi ; // 23 NDI: - uint8_t rv ; // 24 RV: - uint8_t harq_process_number ; // 25 HARQ_PROCESS_NUMBER: - uint8_t dai ; // 26 DAI: For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI - // 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI - // 0 otherwise - uint8_t first_dai ; // 27 FIRST_DAI: (1 or 2 bits) 1 bit for semi-static HARQ-ACK - uint8_t second_dai ; // 28 SECOND_DAI: (0 or 2 bits) 2 bits for dynamic HARQ-ACK codebook with two HARQ-ACK sub-codebooks - uint8_t tpc_pusch ; // 29 TPC_PUSCH: - uint8_t tpc_pucch ; // 30 TPC_PUCCH: - uint8_t pucch_resource_ind ; // 31 PUCCH_RESOURCE_IND: - uint8_t pdsch_to_harq_feedback_time_ind ; // 32 PDSCH_TO_HARQ_FEEDBACK_TIME_IND: - uint8_t short_message_ind ; // 33 SHORT_MESSAGE_IND: 1 bit if crc scrambled with P-RNTI - uint8_t srs_resource_ind ; // 34 SRS_RESOURCE_IND: - uint8_t precod_nbr_layers ; // 35 PRECOD_NBR_LAYERS: - uint8_t antenna_ports ; // 36 ANTENNA_PORTS: - uint8_t tci ; // 37 TCI: 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits - uint8_t srs_request ; // 38 SRS_REQUEST: - uint8_t tpc_cmd_number_format2_3 ; // 39 TPC_CMD_NUMBER_FORMAT2_3: - uint8_t csi_request ; // 40 CSI_REQUEST: - uint8_t cbgti ; // 41 CBGTI: 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH - uint8_t cbgfi ; // 42 CBGFI: 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator - uint8_t ptrs_dmrs ; // 43 PTRS_DMRS: - uint8_t beta_offset_ind ; // 44 BETA_OFFSET_IND: - uint8_t dmrs_seq_ini ; // 45 DMRS_SEQ_INI: 1 bit if the cell has two ULs and the number of bits for DCI format 1_0 before padding - // is larger than the number of bits for DCI format 0_0 before padding; 0 bit otherwise - uint8_t sul_ind_0_0 ; // 46 SUL_IND_0_0: - uint16_t padding ; // 47 PADDING: (Note 2) If DCI format 0_0 is monitored in common search space - // and if the number of information bits in the DCI format 0_0 prior to padding - // is less than the payload size of the DCI format 1_0 monitored in common search space - // zeros shall be appended to the DCI format 0_0 - // until the payload size equals that of the DCI format 1_0 - + uint8_t short_message_ind ; // 8 SHORT_MESSAGE_IND: + uint8_t short_messages ; // 9 SHORT_MESSAGES: + uint16_t freq_dom_resource_assignment_UL; // 10 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: PUSCH hopping with resource allocation type 1 not considered + // (NOTE 1) If DCI format 0_0 is monitored in common search space + // and if the number of information bits in the DCI format 0_0 prior to padding + // is larger than the payload size of the DCI format 1_0 monitored in common search space + // the bitwidth of the frequency domain resource allocation field in the DCI format 0_0 + // is reduced such that the size of DCI format 0_0 equals to the size of the DCI format 1_0 + uint16_t freq_dom_resource_assignment_DL; // 11 FREQ_DOM_RESOURCE_ASSIGNMENT_DL: + uint8_t time_dom_resource_assignment ; // 12 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 6.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits, + // where I the number of entries in the higher layer parameter pusch-AllocationList + uint8_t vrb_to_prb_mapping ; // 13 VRB_TO_PRB_MAPPING: 0 bit if only resource allocation type 0 + uint8_t prb_bundling_size_ind ; // 14 PRB_BUNDLING_SIZE_IND:0 bit if the higher layer parameter PRB_bundling is not configured or is set to 'static', or 1 bit if the higher layer parameter PRB_bundling is set to 'dynamic' according to Subclause 5.1.2.3 of [6, TS 38.214] + uint8_t rate_matching_ind ; // 15 RATE_MATCHING_IND: 0, 1, or 2 bits according to higher layer parameter rate-match-PDSCH-resource-set + uint8_t zp_csi_rs_trigger ; // 16 ZP_CSI_RS_TRIGGER: + uint8_t freq_hopping_flag ; // 17 FREQ_HOPPING_FLAG: 0 bit if only resource allocation type 0 + uint8_t tb1_mcs ; // 18 TB1_MCS: + uint8_t tb1_ndi ; // 19 TB1_NDI: + uint8_t tb1_rv ; // 20 TB1_RV: + uint8_t tb2_mcs ; // 21 TB2_MCS: + uint8_t tb2_ndi ; // 22 TB2_NDI: + uint8_t tb2_rv ; // 23 TB2_RV: + uint8_t mcs ; // 24 MCS: + uint8_t ndi ; // 25 NDI: + uint8_t rv ; // 26 RV: + uint8_t harq_process_number ; // 27 HARQ_PROCESS_NUMBER: + uint8_t dai ; // 28 DAI: For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI + // 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI + // 0 otherwise + uint8_t first_dai ; // 29 FIRST_DAI: (1 or 2 bits) 1 bit for semi-static HARQ-ACK + uint8_t second_dai ; // 30 SECOND_DAI: (0 or 2 bits) 2 bits for dynamic HARQ-ACK codebook with two HARQ-ACK sub-codebooks + uint8_t tb_scaling ; // 31 TB_SCALING: + uint8_t tpc_pusch ; // 32 TPC_PUSCH: + uint8_t tpc_pucch ; // 33 TPC_PUCCH: + uint8_t pucch_resource_ind ; // 34 PUCCH_RESOURCE_IND: + uint8_t pdsch_to_harq_feedback_time_ind ; // 35 PDSCH_TO_HARQ_FEEDBACK_TIME_IND: + uint8_t srs_resource_ind ; // 36 SRS_RESOURCE_IND: + uint8_t precod_nbr_layers ; // 37 PRECOD_NBR_LAYERS: + uint8_t antenna_ports ; // 38 ANTENNA_PORTS: + uint8_t tci ; // 39 TCI: 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits + uint8_t srs_request ; // 40 SRS_REQUEST: + uint8_t tpc_cmd_number_format2_3 ; // 41 TPC_CMD_NUMBER_FORMAT2_3: + uint8_t csi_request ; // 42 CSI_REQUEST: + uint8_t cbgti ; // 43 CBGTI: 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH + uint8_t cbgfi ; // 44 CBGFI: 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator + uint8_t ptrs_dmrs ; // 45 PTRS_DMRS: + uint8_t beta_offset_ind ; // 46 BETA_OFFSET_IND: + uint8_t dmrs_seq_ini ; // 47 DMRS_SEQ_INI: 1 bit if the cell has two ULs and the number of bits for DCI format 1_0 before padding + // is larger than the number of bits for DCI format 0_0 before padding; 0 bit otherwise + uint8_t ul_sch_ind ; // 48 UL_SCH_IND: value of "1" indicates UL-SCH shall be transmitted on the PUSCH and a value of "0" indicates UL-SCH shall not be transmitted on the PUSCH + uint16_t padding_nr_dci ; // 49 PADDING_NR_DCI: (Note 2) If DCI format 0_0 is monitored in common search space + // and if the number of information bits in the DCI format 0_0 prior to padding + // is less than the payload size of the DCI format 1_0 monitored in common search space + // zeros shall be appended to the DCI format 0_0 + // until the payload size equals that of the DCI format 1_0 + uint8_t sul_ind_0_0 ; // 50 SUL_IND_0_0: + uint8_t ra_preamble_index ; // 51 RA_PREAMBLE_INDEX: + uint8_t sul_ind_1_0 ; // 52 SUL_IND_1_0: + uint8_t ss_pbch_index ; // 53 SS_PBCH_INDEX + uint8_t prach_mask_index ; // 54 PRACH_MASK_INDEX + uint8_t reserved_nr_dci ; // 55 RESERVED_NR_DCI }; typedef struct NR_DCI_INFO_EXTRACTED NR_DCI_INFO_EXTRACTED_t; + + #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c index 03fb91e7fa3a7ce9c14cc6e05f8a5998381d87b2..2ea25406fba9795c64c19f4c6d89b83c1708784c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c @@ -3951,25 +3951,23 @@ int dump_dci(NR_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) } #endif //(0) #ifdef NR_PDCCH_DCI_TOOLS + int nr_extract_dci_info(PHY_VARS_NR_UE *ue, uint8_t eNB_id, lte_frame_type_t frame_type, uint8_t dci_length, + uint16_t rnti, void *dci_pdu, NR_DCI_INFO_EXTRACTED_t *nr_pdci_info_extracted, - uint8_t dci_fields_sizes[48], + uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS], NR_DL_UE_HARQ_t *pdlsch0_harq, NR_UE_DLSCH_t *pdlsch0, NR_UE_ULSCH_t *ulsch0, NR_DCI_format_t dci_format, uint8_t nr_tti_rx, - uint16_t rnti, - uint16_t si_rnti, - uint16_t p_rnti, - uint16_t ra_rnti, - uint16_t tc_rnti, uint16_t n_RB_ULBWP, - uint16_t n_RB_DLBWP) + uint16_t n_RB_DLBWP, + uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES]) { /* * This function will extract the different elements of the dci pdu and interpret the values extracted to update correctly the parameters in: @@ -3979,7 +3977,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, * We need to know the dci length and the dci_fields_sizes (array containing each field size in number of bits) * In order to get the value of a specific field we will proceed as follows (let's have a look to an example: * If the length of the pdu is 38 bits and the content of the dci_pdu is 0x3A8900789A (pdu is 11 1010 1000 1001 0000 0000 0111 1000 1001 1010) - * If the dci_fields_sizes is {0 0 1 0 0 0 0 0 0 13 0 1 0 0 0 0 0 0 0 0 0 0 5 1 2 4 2 0 0 0 2 3 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0} + * If the dci_fields_sizes is {0 0 1 0 0 0 0 0 0 13 0 1 0 0 0 0 0 0 0 0 0 0 5 1 2 4 2 0 0 0 2 3 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...} * This means: * number bits for carrier_ind field is 0 * number bits for sul_ind_0_1 field is 0 @@ -3997,33 +3995,39 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, * * At the moment we have implemented: * Format 0_0, that contains the following fields according to Specification 38.212 V15.1.1 Section 7.3.1 - * 2 IDENTIFIER_DCI_FORMATS: - * 8 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: PUSCH hopping with resource allocation type 1 not considered - * 10 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 6.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits, - * 15 FREQ_HOPPING_FLAG: 0 bit if only resource allocation type 0 - * 22 MCS: - * 23 NDI: - * 24 RV: - * 25 HARQ_PROCESS_NUMBER: - * 29 TPC_PUSCH: - * 46 SUL_IND_0_0: - * 47 PADDING: (Note 2) If DCI format 0_0 is monitored in common search space + * 0 IDENTIFIER_DCI_FORMATS: + * 10 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: PUSCH hopping with resource allocation type 1 not considered + * 12 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 6.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits, + * 17 FREQ_HOPPING_FLAG: 0 bit if only resource allocation type 0 + * 24 MCS: + * 25 NDI: + * 26 RV: + * 27 HARQ_PROCESS_NUMBER: + * 32 TPC_PUSCH: + * 49 PADDING_NR_DCI: (Note 2) If DCI format 0_0 is monitored in common search space + * 50 SUL_IND_0_0: * * Format 1_0, that contains the following fields - * 2 IDENTIFIER_DCI_FORMATS: - * 9 FREQ_DOM_RESOURCE_ASSIGNMENT_DL: - * 10 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 5.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits, - * 11 VRB_TO_PRB_MAPPING: 0 bit if only resource allocation type 0 - * 22 MCS: - * 23 NDI: - * 24 RV: - * 25 HARQ_PROCESS_NUMBER: - * 26 DAI: For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI - * 30 TPC_PUCCH: - * 31 PUCCH_RESOURCE_IND: - * 32 PDSCH_TO_HARQ_FEEDBACK_TIME_IND: - * 33 SHORT_MESSAGE_IND: 1 bit if crc scrambled with P-RNTI - * 47 PADDING: (Note 2) If DCI format 0_0 is monitored in common search space + * 0 IDENTIFIER_DCI_FORMATS: + * 8 SHORT_MESSAGE_IND + * 9 SHORT_MESSAGES + * 11 FREQ_DOM_RESOURCE_ASSIGNMENT_DL: + * 12 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 5.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits, + * 13 VRB_TO_PRB_MAPPING: 0 bit if only resource allocation type 0 + * 24 MCS: + * 25 NDI: + * 26 RV: + * 27 HARQ_PROCESS_NUMBER: + * 28 DAI_: For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI + * 31 TB_SCALING + * 33 TPC_PUCCH: + * 34 PUCCH_RESOURCE_IND: + * 35 PDSCH_TO_HARQ_FEEDBACK_TIME_IND: + * 51 RA_PREAMBLE_INDEX: + * 52 SUL_IND_1_0: + * 53 SS_PBCH_INDEX: + * 54 PRACH_MASK_INDEX: + * 55 RESERVED_NR_DCI * */ uint64_t pdu_bitmap = 0xFFFFFFFFFFFFFFFF; @@ -4031,12 +4035,13 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, uint8_t dci_field=0; uint8_t sizes_count=0; uint8_t left_shift=0; -#ifdef NR_PDCCH_DCI_TOOLS_DEBUG - printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> Entering function nr_extract_dci_info() with dci_pdu=%llx with pdu_bitmap=%llx dci_length=%d\n",(*(uint64_t *)dci_pdu), pdu_bitmap, dci_length); - printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> dci_fields_sizes {"); - for (int i=0; i<NBR_NR_DCI_FIELDS; i++) printf("%d ",dci_fields_sizes[i]); - printf("}\n"); -#endif + #ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> Entering function nr_extract_dci_info() with dci_pdu=%llx with pdu_bitmap=%llx dci_length=%d\n",(*(uint64_t *)dci_pdu), pdu_bitmap, dci_length); + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> for format %d, dci_fields_sizes {",dci_format-15); + for (int i=0; i<NBR_NR_DCI_FIELDS; i++) printf("%d ",dci_fields_sizes[i][dci_format-15]); + printf("}\n"); + #endif + uint8_t prev_ndi = pdlsch0_harq->DCINdi; uint16_t l_RB; uint16_t start_RB; @@ -4045,12 +4050,13 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, uint16_t start_symbol; uint16_t tmp_symbol; + /* * Some dci fields need to be interpreted before the others. */ - if (dci_fields_sizes[HARQ_PROCESS_NUMBER] != 0) { // E.g: 25 HARQ_PROCESS_NUMBER (25 is the position in dci_fields_sizes array for field HARQ_PROCESS_NUMBER) - for (int i=0; i<=HARQ_PROCESS_NUMBER; i++) left_shift = left_shift + dci_fields_sizes[i]; - nr_pdci_info_extracted->harq_process_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[HARQ_PROCESS_NUMBER]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[HARQ_PROCESS_NUMBER])); + if (dci_fields_sizes[HARQ_PROCESS_NUMBER][dci_format-15] != 0) { // E.g: 27 HARQ_PROCESS_NUMBER (27 is the position in dci_fields_sizes array for field HARQ_PROCESS_NUMBER) + for (int i=0; i<=HARQ_PROCESS_NUMBER; i++) left_shift = left_shift + dci_fields_sizes[i][dci_format-15]; + nr_pdci_info_extracted->harq_process_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[HARQ_PROCESS_NUMBER][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[HARQ_PROCESS_NUMBER][dci_format-15])); left_shift = 0; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->harq_process_number=%x\n",nr_pdci_info_extracted->harq_process_number); @@ -4058,11 +4064,11 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, } if ((dci_format == format1_0) || (dci_format == format1_1)) { - if (rnti==si_rnti) { + if (rnti==crc_scrambled_values[_SI_RNTI_]) { ue->dlsch_SI[eNB_id]->active = 1; - } else if (rnti==p_rnti) { + } else if (rnti==crc_scrambled_values[_P_RNTI_]) { ue->dlsch_p[eNB_id]->active = 1; - } else if (rnti==ra_rnti) { + } else if (rnti==crc_scrambled_values[_RA_RNTI_]) { ue->dlsch_ra[eNB_id]->active = 1; } else { pdlsch0->active = 1; @@ -4073,7 +4079,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, // pdlsch0_harq->mimo_mode = frame_parms->mode1_flag == 1 ?SISO : ALAMOUTI; pdlsch0_harq->dl_power_off = 1; //no power offset - if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) { + if ((rnti==crc_scrambled_values[_SI_RNTI_]) || (rnti==crc_scrambled_values[_P_RNTI_]) || (rnti==crc_scrambled_values[_RA_RNTI_])) { pdlsch0_harq->round = 0; pdlsch0_harq->status = ACTIVE; } else { @@ -4081,77 +4087,91 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, } for (dci_field=0; dci_field<NBR_NR_DCI_FIELDS; dci_field++) { - left_shift = left_shift + dci_fields_sizes[dci_field]; - if (dci_fields_sizes[dci_field] != 0){ - sizes_count = dci_fields_sizes[dci_field]; + left_shift = left_shift + dci_fields_sizes[dci_field][dci_format-15]; + if (dci_fields_sizes[dci_field][dci_format-15] != 0){ + sizes_count = dci_fields_sizes[dci_field][dci_format-15]; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG - printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> sizes_count = dci_fields_sizes[%d] = %d\n",dci_field,sizes_count); + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> sizes_count = dci_fields_sizes[%d][%d] = %d\n",dci_field,dci_format-15,sizes_count); #endif switch (dci_field){ - case 0: // 0 CARRIER_IND: (field defined for -,format0_1,-,format1_1,-,-,-,-) + case IDENTIFIER_DCI_FORMATS: // 0 IDENTIFIER_DCI_FORMATS: (field defined for format0_0,format0_1,format1_0,format1_1,format2_0,format2_1,format2_2,format2_3) + // if format 0_0: The value of this bit field is always set to 0, indicating an UL DCI format (TS38.212 Section 7.3.1.1.1) + // if format 1_0: The value of this bit field is always set to 1, indicating a DL DCI format (TS38.212 Section 7.3.1.2.1) + nr_pdci_info_extracted->identifier_dci_formats = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); + #ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->identifier_dci_formats=%x\n",nr_pdci_info_extracted->identifier_dci_formats); + #endif + break; + + case CARRIER_IND: // 1 CARRIER_IND: (field defined for -,format0_1,-,format1_1,-,-,-,-) // 0 or 3 bits, as defined in Subclause x.x of [5, TS38.213] - nr_pdci_info_extracted->carrier_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->carrier_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->carrier_ind=%x\n",nr_pdci_info_extracted->carrier_ind); #endif break; - case 1: // 1 SUL_IND_0_1: (field defined for -,format0_1,-,-,-,-,-,-) - nr_pdci_info_extracted->sul_ind_0_1 = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case SUL_IND_0_1: // 2 SUL_IND_0_1: (field defined for -,format0_1,-,-,-,-,-,-) + nr_pdci_info_extracted->sul_ind_0_1 = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->sul_ind_0_1=%x\n",nr_pdci_info_extracted->sul_ind_0_1); #endif break; - case 2: // 2 IDENTIFIER_DCI_FORMATS: (field defined for format0_0,format0_1,format1_0,format1_1,format2_0,format2_1,format2_2,format2_3) - // if format 0_0: The value of this bit field is always set to 0, indicating an UL DCI format (TS38.212 Section 7.3.1.1.1) - // if format 1_0: The value of this bit field is always set to 1, indicating a DL DCI format (TS38.212 Section 7.3.1.2.1) - nr_pdci_info_extracted->identifier_dci_formats = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); - #ifdef NR_PDCCH_DCI_TOOLS_DEBUG - printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->identifier_dci_formats=%x\n",nr_pdci_info_extracted->identifier_dci_formats); - #endif - break; - - case 3: // 3 SLOT_FORMAT_IND: (field defined for -,-,-,-,format2_0,-,-,-) + case SLOT_FORMAT_IND: // 3 SLOT_FORMAT_IND: (field defined for -,-,-,-,format2_0,-,-,-) // size of DCI format 2_0 is configurable by higher layers up to 128 bits, according to Subclause 11.1.1 of [5, TS 38.213] - nr_pdci_info_extracted->slot_format_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->slot_format_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->slot_format_ind=%x\n",nr_pdci_info_extracted->slot_format_ind); #endif break; - case 4: // 4 PRE_EMPTION_IND: (field defined for -,-,-,-,-,format2_1,-,-) + case PRE_EMPTION_IND: // 4 PRE_EMPTION_IND: (field defined for -,-,-,-,-,format2_1,-,-) // size of DCI format 2_1 is configurable by higher layers up to 126 bits, according to Subclause 11.2 of [5, TS 38.213]. Each pre-emption indication is 14 bits - nr_pdci_info_extracted->pre_emption_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->pre_emption_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->pre_emption_ind=%x\n",nr_pdci_info_extracted->pre_emption_ind); #endif break; - case 5: // 5 TPC_CMD_NUMBER: (field defined for -,-,-,-,-,-,format2_2,-) + case TPC_CMD_NUMBER: // 5 TPC_CMD_NUMBER: (field defined for -,-,-,-,-,-,format2_2,-) // The parameter xxx provided by higher layers determines the index to the TPC command number for an UL of a cell. Each TPC command number is 2 bits - nr_pdci_info_extracted->tpc_cmd_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->tpc_cmd_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tpc_cmd_number=%x\n",nr_pdci_info_extracted->tpc_cmd_number); #endif break; - case 6: // 6 BLOCK_NUMBER: (field defined for -,-,-,-,-,-,-,format2_3) + case BLOCK_NUMBER: // 6 BLOCK_NUMBER: (field defined for -,-,-,-,-,-,-,format2_3) // starting position of a block is determined by the parameter startingBitOfFormat2_3 - nr_pdci_info_extracted->block_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->block_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->block_number=%x\n",nr_pdci_info_extracted->block_number); #endif break; - case 7: // 7 BANDWIDTH_PART_IND: (field defined for -,format0_1,-,format1_1,-,-,-,-) - nr_pdci_info_extracted->bandwidth_part_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case BANDWIDTH_PART_IND: // 7 BANDWIDTH_PART_IND: (field defined for -,format0_1,-,format1_1,-,-,-,-) + nr_pdci_info_extracted->bandwidth_part_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->bandwidth_part_ind=%x\n",nr_pdci_info_extracted->bandwidth_part_ind); #endif break; - case 8: // 8 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: (field defined for format0_0,format0_1,-,-,-,-,-,-) + case SHORT_MESSAGE_IND: // 8 SHORT_MESSAGE_IND: (field defined for -,-,format1_0,format1_1,-,-,-,-) + nr_pdci_info_extracted->short_message_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); +#ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->short_message_ind=%x\n",nr_pdci_info_extracted->short_message_ind); +#endif + break; + + case SHORT_MESSAGES: // 9 SHORT_MESSAGES: (field defined for -,-,format1_0,format1_1,-,-,-,-) + nr_pdci_info_extracted->short_messages = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); +#ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->short_messages=%x\n",nr_pdci_info_extracted->short_messages); +#endif + break; + + case FREQ_DOM_RESOURCE_ASSIGNMENT_UL: // 10 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: (field defined for format0_0,format0_1,-,-,-,-,-,-) // PUSCH hopping with resource allocation type 1 not considered // According to 38.214 V15.1.0 Section 6.1.2.2 Two uplink resource allocation schemes, type 0 and type 1, are supported. // The UE shall assume that when the scheduling PDCCH is received with DCI format 0_0, then uplink resource allocation type 1 is used. - nr_pdci_info_extracted->freq_dom_resource_assignment_UL = (uint16_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->freq_dom_resource_assignment_UL = (uint16_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (dci_format == format0_1){ // uplink resource allocation type 0 or 1 can be used } if (dci_format == format0_0){ // only uplink resource allocation type 1 @@ -4177,10 +4197,10 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif break; - case 9: // 9 FREQ_DOM_RESOURCE_ASSIGNMENT_DL: (field defined for -,-,format1_0,format1_1,-,-,-,-) + case FREQ_DOM_RESOURCE_ASSIGNMENT_DL: // 11 FREQ_DOM_RESOURCE_ASSIGNMENT_DL: (field defined for -,-,format1_0,format1_1,-,-,-,-) // According to 38.214 V15.1.0 Section 5.1.2.2 Two downlink resource allocation schemes, type 0 and type 1, are supported. // The UE shall assume that when the scheduling grant is received with DCI format 1_0, then downlink resource allocation type 1 is used. - nr_pdci_info_extracted->freq_dom_resource_assignment_DL = (uint16_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->freq_dom_resource_assignment_DL = (uint16_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (dci_format == format1_1){ // uplink resource allocation type 0 or 1 can be used } if (dci_format == format1_0){ // only uplink resource allocation type 1 @@ -4205,7 +4225,20 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->freq_dom_resource_assignment_DL=%x, RIV = %d\n",nr_pdci_info_extracted->freq_dom_resource_assignment_DL,nr_pdci_info_extracted->freq_dom_resource_assignment_DL); printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> l_RB=%d, start_RB=%d, n_RB_DLBWP=%d\n",l_RB,start_RB,n_RB_DLBWP); - /* + /* + * According to TC 38.212 Subclause 7.3.1.2.1 (V15.2.0) (not implemented FIXME!!!) + * If the CRC of the DCI format 1_0 is scrambled by C-RNTI + * and the "Frequency domain resource assignment" field are of all ones, + * the DCI format 1_0 is for random access procedure initiated by a PDCCH order, + * with all remaining fields set as follows: + * - Random Access Preamble index (6 bits) + * - UL/SUL indicator (1 bit) + * - SS/PBCH index (6 bits) + * - PRACH Mask index (4 bits) + * - Reserved bits (10 bits) + * + */ + /* * The following commented code is used to verify that l_RB and start_RB are correctly calculated * * @@ -4235,13 +4268,13 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif break; - case 10: // 10 TIME_DOM_RESOURCE_ASSIGNMENT: (field defined for format0_0,format0_1,format1_0,format1_1,-,-,-,-) + case TIME_DOM_RESOURCE_ASSIGNMENT: // 12 TIME_DOM_RESOURCE_ASSIGNMENT: (field defined for format0_0,format0_1,format1_0,format1_1,-,-,-,-) // 0, 1, 2, 3, or 4 bits as defined in: // Subclause 6.1.2.1 of [6, TS 38.214] for formats format0_0,format0_1 // Subclause 5.1.2.1 of [6, TS 38.214] for formats format1_0,format1_1 // The bitwidth for this field is determined as log2(I) bits, // where I the number of entries in the higher layer parameter pusch-AllocationList - nr_pdci_info_extracted->time_dom_resource_assignment = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->time_dom_resource_assignment = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (dci_format == format0_0 || dci_format == format0_1){ // Subclause 6.1.2.1 of [6, TS 38.214] } @@ -4254,13 +4287,13 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif break; - case 11: // 11 VRB_TO_PRB_MAPPING: (field defined for -,format0_1,format1_0,format1_1,-,-,-,-) + case VRB_TO_PRB_MAPPING: // 13 VRB_TO_PRB_MAPPING: (field defined for -,format0_1,format1_0,format1_1,-,-,-,-) //0 bit if resource allocation type 0 //1 bit if resource allocation type 1 //Table 7.3.1.1.2-33: VRB-to-PRB mapping // 0 Non-interleaved // 1 Interleaved - nr_pdci_info_extracted->vrb_to_prb_mapping = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->vrb_to_prb_mapping = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (nr_pdci_info_extracted->vrb_to_prb_mapping == 0) { // Non-interleaved } else { // Interleaved // format 0_1 defined in TS 38.211 Section 6.3.1.7 @@ -4271,31 +4304,31 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif break; - case 12: // 12 PRB_BUNDLING_SIZE_IND: (field defined for -,-,-,format1_1,-,-,-,-) + case PRB_BUNDLING_SIZE_IND: // 14 PRB_BUNDLING_SIZE_IND: (field defined for -,-,-,format1_1,-,-,-,-) // 0 bit if the higher layer parameter PRB_bundling is not configured or is set to 'static', or 1 bit if the higher layer parameter PRB_bundling is set to 'dynamic' according to Subclause 5.1.2.3 of [6, TS 38.214] - nr_pdci_info_extracted->prb_bundling_size_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->prb_bundling_size_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->prb_bundling_size_ind=%x\n",nr_pdci_info_extracted->prb_bundling_size_ind); #endif break; - case 13: // 13 RATE_MATCHING_IND: (field defined for -,-,-,format1_1,-,-,-,-) + case RATE_MATCHING_IND: // 15 RATE_MATCHING_IND: (field defined for -,-,-,format1_1,-,-,-,-) // 0, 1, or 2 bits according to higher layer parameter rate-match-PDSCH-resource-set - nr_pdci_info_extracted->rate_matching_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->rate_matching_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->rate_matching_ind=%x\n",nr_pdci_info_extracted->rate_matching_ind); #endif break; - case 14: // 14 ZP_CSI_RS_TRIGGER: (field defined for -,-,-,format1_1,-,-,-,-) - nr_pdci_info_extracted->zp_csi_rs_trigger = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case ZP_CSI_RS_TRIGGER: // 16 ZP_CSI_RS_TRIGGER: (field defined for -,-,-,format1_1,-,-,-,-) + nr_pdci_info_extracted->zp_csi_rs_trigger = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->zp_csi_rs_trigger=%x\n",nr_pdci_info_extracted->zp_csi_rs_trigger); #endif break; - case 15: // 15 FREQ_HOPPING_FLAG: (field defined for format0_0,format0_1,-,-,-,-,-,-) + case FREQ_HOPPING_FLAG: // 17 FREQ_HOPPING_FLAG: (field defined for format0_0,format0_1,-,-,-,-,-,-) // 0 bit if only resource allocation type 0 // 1 bit otherwise, only applicable to resource allocation type 1, as defined in Subclause 6.3 of [6, TS 38.214] - nr_pdci_info_extracted->freq_hopping_flag = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->freq_hopping_flag = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (nr_pdci_info_extracted->freq_hopping_flag != 0) { // PUSCH frequency hopping is performed (only resource allocation type 1) } else { // PUSCH frequency hopping is not performed (only resource allocation type 1) @@ -4306,51 +4339,51 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif break; - case 16: // 16 TB1_MCS: (field defined for -,-,-,format1_1,-,-,-,-) - nr_pdci_info_extracted->tb1_mcs = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case TB1_MCS: // 18 TB1_MCS: (field defined for -,-,-,format1_1,-,-,-,-) + nr_pdci_info_extracted->tb1_mcs = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (nr_pdci_info_extracted->mcs < 29) pdlsch0_harq->mcs = nr_pdci_info_extracted->tb1_mcs; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tb1_mcs=%x\n",nr_pdci_info_extracted->tb1_mcs); #endif break; - case 17: // 17 TB1_NDI: (field defined for -,-,-,format1_1,-,-,-,-) - nr_pdci_info_extracted->tb1_ndi = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case TB1_NDI: // 19 TB1_NDI: (field defined for -,-,-,format1_1,-,-,-,-) + nr_pdci_info_extracted->tb1_ndi = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); pdlsch0_harq->DCINdi = nr_pdci_info_extracted->tb1_ndi; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tb1_ndi=%x\n",nr_pdci_info_extracted->tb1_ndi); #endif break; - case 18: // 18 TB1_RV: (field defined for -,-,-,format1_1,-,-,-,-) - nr_pdci_info_extracted->tb1_rv = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case TB1_RV: // 20 TB1_RV: (field defined for -,-,-,format1_1,-,-,-,-) + nr_pdci_info_extracted->tb1_rv = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); pdlsch0_harq->rvidx = nr_pdci_info_extracted->tb1_rv; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tb1_rv=%x\n",nr_pdci_info_extracted->tb1_rv); #endif break; - case 19: // 19 TB2_MCS: (field defined for -,-,-,format1_1,-,-,-,-) - nr_pdci_info_extracted->tb2_mcs = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case TB2_MCS: // 21 TB2_MCS: (field defined for -,-,-,format1_1,-,-,-,-) + nr_pdci_info_extracted->tb2_mcs = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (nr_pdci_info_extracted->mcs < 29) pdlsch0_harq->mcs = nr_pdci_info_extracted->tb2_mcs; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tb2_mcs=%x\n",nr_pdci_info_extracted->tb2_mcs); #endif break; - case 20: // 20 TB2_NDI: (field defined for -,-,-,format1_1,-,-,-,-) - nr_pdci_info_extracted->tb2_ndi = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case TB2_NDI: // 22 TB2_NDI: (field defined for -,-,-,format1_1,-,-,-,-) + nr_pdci_info_extracted->tb2_ndi = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); pdlsch0_harq->DCINdi = nr_pdci_info_extracted->tb2_ndi; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tb2_ndi=%x\n",nr_pdci_info_extracted->tb2_ndi); #endif break; - case 21: // 21 TB2_RV: (field defined for -,-,-,format1_1,-,-,-,-) - nr_pdci_info_extracted->tb2_rv = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case TB2_RV: // 23 TB2_RV: (field defined for -,-,-,format1_1,-,-,-,-) + nr_pdci_info_extracted->tb2_rv = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); pdlsch0_harq->rvidx = nr_pdci_info_extracted->tb2_rv; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tb2_rv=%x\n",nr_pdci_info_extracted->tb2_rv); #endif break; - case 22: // 22 MCS: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-) - nr_pdci_info_extracted->mcs = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case MCS: // 24 MCS: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-) + nr_pdci_info_extracted->mcs = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (nr_pdci_info_extracted->mcs < 29) { if (dci_format == format0_0 || dci_format == format0_1) ulsch0->harq_processes[nr_pdci_info_extracted->harq_process_number]->mcs = nr_pdci_info_extracted->mcs; @@ -4364,8 +4397,8 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif break; - case 23: // 23 NDI: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-) - nr_pdci_info_extracted->ndi = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case NDI: // 25 NDI: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-) + nr_pdci_info_extracted->ndi = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (dci_format == format0_0 || dci_format == format0_1) { ulsch0->harq_processes[nr_pdci_info_extracted->harq_process_number]->DCINdi = nr_pdci_info_extracted->ndi; if (ulsch0->harq_processes[nr_pdci_info_extracted->harq_process_number]->first_tx==1) { @@ -4379,7 +4412,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, } } } else { - if (rnti == tc_rnti) { //fix for standalone Contention Resolution Id + if (rnti == crc_scrambled_values[_TC_RNTI_]) { //fix for standalone Contention Resolution Id pdlsch0_harq->DCINdi = (uint8_t)-1; } else { if ((prev_ndi != nr_pdci_info_extracted->ndi) || (pdlsch0_harq->first_tx==1)) { @@ -4395,8 +4428,8 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif break; - case 24: // 24 RV: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-) - nr_pdci_info_extracted->rv = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case RV: // 26 RV: (field defined for format0_0,format0_1,format1_0,-,-,-,-,-) + nr_pdci_info_extracted->rv = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); if (dci_format == format0_0 || dci_format == format0_1) ulsch0->harq_processes[nr_pdci_info_extracted->harq_process_number]->rvidx = nr_pdci_info_extracted->rv; else @@ -4420,44 +4453,52 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif break; - case 25: // 25 HARQ_PROCESS_NUMBER: (field defined for format0_0,format0_1,format1_0,format1_1,-,-,-,-) - nr_pdci_info_extracted->harq_process_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case HARQ_PROCESS_NUMBER: // 27 HARQ_PROCESS_NUMBER: (field defined for format0_0,format0_1,format1_0,format1_1,-,-,-,-) + nr_pdci_info_extracted->harq_process_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); pdlsch0->current_harq_pid = nr_pdci_info_extracted->harq_process_number; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->harq_process_number=%x\n",nr_pdci_info_extracted->harq_process_number); #endif break; - case 26: // 26 DAI: (field defined for -,-,format1_0,format1_1,-,-,-,-) + case DAI_: // 28 DAI_: (field defined for -,-,format1_0,format1_1,-,-,-,-) // For format1_0: 2 bits as defined in Subclause 9.1.3 at TS 38.213 // For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI // 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI // 0 otherwise - nr_pdci_info_extracted->dai = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->dai = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); pdlsch0->harq_ack[nr_tti_rx].vDAI_DL = nr_pdci_info_extracted->dai+1; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->dai=%x\n",nr_pdci_info_extracted->dai); #endif break; - case 27: // 27 FIRST_DAI: (field defined for -,format0_1,-,-,-,-,-,-) + case FIRST_DAI: // 29 FIRST_DAI: (field defined for -,format0_1,-,-,-,-,-,-) // (1 or 2 bits) 1 bit for semi-static HARQ-ACK - nr_pdci_info_extracted->first_dai = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->first_dai = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->first_dai=%x\n",nr_pdci_info_extracted->first_dai); #endif break; - case 28: // 28 SECOND_DAI: (field defined for -,format0_1,-,-,-,-,-,-) + case SECOND_DAI: // 30 SECOND_DAI: (field defined for -,format0_1,-,-,-,-,-,-) // (0 or 2 bits) 2 bits for dynamic HARQ-ACK codebook with two HARQ-ACK sub-codebooks - nr_pdci_info_extracted->second_dai = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->second_dai = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->second_dai=%x\n",nr_pdci_info_extracted->second_dai); #endif break; - case 29: // 29 TPC_PUSCH: (field defined for format0_0,format0_1,-,-,-,-,-,-) + case TB_SCALING: // 31 TB_SCALING: (field defined for -,format0_1,-,-,-,-,-,-) + // (0 or 2 bits) 2 bits for dynamic HARQ-ACK codebook with two HARQ-ACK sub-codebooks + nr_pdci_info_extracted->tb_scaling = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); +#ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tb_scaling=%x\n",nr_pdci_info_extracted->tb_scaling); +#endif + break; + + case TPC_PUSCH: // 32 TPC_PUSCH: (field defined for format0_0,format0_1,-,-,-,-,-,-) // defined in Subclause 7.1.1 TS 38.213 - nr_pdci_info_extracted->tpc_pusch = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->tpc_pusch = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); ulsch0->harq_processes[nr_pdci_info_extracted->harq_process_number]->TPC = nr_pdci_info_extracted->tpc_pusch; if (ue->ul_power_control_dedicated[eNB_id].accumulationEnabled == 1) { ulsch0->f_pusch += delta_PUSCH_acc[ulsch0->harq_processes[nr_pdci_info_extracted->harq_process_number]->TPC]; @@ -4469,133 +4510,167 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif break; - case 30: // 30 TPC_PUCCH: (field defined for -,-,format1_0,format1_1,-,-,-,-) + case TPC_PUCCH: // 33 TPC_PUCCH: (field defined for -,-,format1_0,format1_1,-,-,-,-) // defined in Subclause 7.2.1 TS 38.213 - nr_pdci_info_extracted->tpc_pucch = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->tpc_pucch = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); pdlsch0_harq->delta_PUCCH = delta_PUCCH_lut[nr_pdci_info_extracted->tpc_pucch &3]; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tpc_pucch=%x\n",nr_pdci_info_extracted->tpc_pucch); #endif break; - case 31: // 31 PUCCH_RESOURCE_IND: (field defined for -,-,format1_0,format1_1,-,-,-,-) + case PUCCH_RESOURCE_IND: // 34 PUCCH_RESOURCE_IND: (field defined for -,-,format1_0,format1_1,-,-,-,-) // defined in Subclause 9.2.3 TS 38.213 // PUCCH_RESOURCE_IND points to PUCCH-ResourceId, but PUCCH-ResourceId is not defined yet - nr_pdci_info_extracted->pucch_resource_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->pucch_resource_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->pucch_resource_ind=%x\n",nr_pdci_info_extracted->pucch_resource_ind); #endif break; - case 32: // 32 PDSCH_TO_HARQ_FEEDBACK_TIME_IND: (field defined for -,-,format1_0,format1_1,-,-,-,-) + case PDSCH_TO_HARQ_FEEDBACK_TIME_IND: // 35 PDSCH_TO_HARQ_FEEDBACK_TIME_IND: (field defined for -,-,format1_0,format1_1,-,-,-,-) // defined in Subclause 9.2.3 TS 38.213 // PDSCH_TO_HARQ_FEEDBACK_TIME_IND points to DL-data-DL-acknowledgement, but DL-data-DL-acknowledgement is not defined yet - nr_pdci_info_extracted->pdsch_to_harq_feedback_time_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->pdsch_to_harq_feedback_time_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->pdsch_to_harq_feedback_time_ind=%x\n",nr_pdci_info_extracted->pdsch_to_harq_feedback_time_ind); #endif break; - case 33: // 33 SHORT_MESSAGE_IND: (field defined for -,-,format1_0,-,-,-,-,-) - // 1 bit if crc scrambled with P-RNTI - if (rnti == p_rnti) { - nr_pdci_info_extracted->short_message_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); - // short message indication flag not implemented in NR_UE_DLSCH_t - } - #ifdef NR_PDCCH_DCI_TOOLS_DEBUG - printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->short_message_ind=%x\n",nr_pdci_info_extracted->short_message_ind); - #endif - break; - - case 34: // 34 SRS_RESOURCE_IND: (field defined for -,format0_1,-,-,-,-,-,-) - nr_pdci_info_extracted->srs_resource_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case SRS_RESOURCE_IND: // 36 SRS_RESOURCE_IND: (field defined for -,format0_1,-,-,-,-,-,-) + nr_pdci_info_extracted->srs_resource_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->srs_resource_ind=%x\n",nr_pdci_info_extracted->srs_resource_ind); #endif break; - case 35: // 35 PRECOD_NBR_LAYERS: (field defined for -,format0_1,-,-,-,-,-,-) - nr_pdci_info_extracted->precod_nbr_layers = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case PRECOD_NBR_LAYERS: // 37 PRECOD_NBR_LAYERS: (field defined for -,format0_1,-,-,-,-,-,-) + nr_pdci_info_extracted->precod_nbr_layers = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->precod_nbr_layers=%x\n",nr_pdci_info_extracted->precod_nbr_layers); #endif break; - case 36: // 36 ANTENNA_PORTS: (field defined for -,format0_1,-,format1_1,-,-,-,-) - nr_pdci_info_extracted->antenna_ports = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case ANTENNA_PORTS: // 38 ANTENNA_PORTS: (field defined for -,format0_1,-,format1_1,-,-,-,-) + nr_pdci_info_extracted->antenna_ports = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->antenna_ports=%x\n",nr_pdci_info_extracted->antenna_ports); #endif break; - case 37: // 37 TCI: (field defined for -,-,-,format1_1,-,-,-,-) + case TCI: // 39 TCI: (field defined for -,-,-,format1_1,-,-,-,-) // 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits - nr_pdci_info_extracted->tci = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->tci = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tci=%x\n",nr_pdci_info_extracted->tci); #endif break; - case 38: // 38 SRS_REQUEST: (field defined for -,format0_1,-,format1_1,-,-,-,format2_3) - nr_pdci_info_extracted->srs_request = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case SRS_REQUEST: // 40 SRS_REQUEST: (field defined for -,format0_1,-,format1_1,-,-,-,format2_3) + nr_pdci_info_extracted->srs_request = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->srs_request=%x\n",nr_pdci_info_extracted->srs_request); #endif break; - case 39: // 39 TPC_CMD_NUMBER_FORMAT2_3: (field defined for -,-,-,-,-,-,-,format2_3) - nr_pdci_info_extracted->tpc_cmd_number_format2_3 = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case TPC_CMD_NUMBER_FORMAT2_3: // 41 TPC_CMD_NUMBER_FORMAT2_3: (field defined for -,-,-,-,-,-,-,format2_3) + nr_pdci_info_extracted->tpc_cmd_number_format2_3 = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->tpc_cmd_number_format2_3=%x\n",nr_pdci_info_extracted->tpc_cmd_number_format2_3); #endif break; - case 40: // 40 CSI_REQUEST: (field defined for -,format0_1,-,-,-,-,-,-) - nr_pdci_info_extracted->csi_request = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case CSI_REQUEST: // 42 CSI_REQUEST: (field defined for -,format0_1,-,-,-,-,-,-) + nr_pdci_info_extracted->csi_request = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->csi_request=%x\n",nr_pdci_info_extracted->csi_request); #endif break; - case 41: // 41 CBGTI: (field defined for -,format0_1,-,format1_1,-,-,-,-) + case CBGTI: // 43 CBGTI: (field defined for -,format0_1,-,format1_1,-,-,-,-) // 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH - nr_pdci_info_extracted->cbgti = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->cbgti = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->cbgti=%x\n",nr_pdci_info_extracted->cbgti); #endif break; - case 42: // 42 CBGFI: (field defined for -,-,-,format1_1,-,-,-,-) - // 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator - nr_pdci_info_extracted->cbgfi = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case CBGFI: // 44 CBGFI: (field defined for -,-,-,format1_1,-,-,-,-) + // 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator + nr_pdci_info_extracted->cbgfi = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->cbgfi=%x\n",nr_pdci_info_extracted->cbgfi); #endif break; - case 43: // 43 PTRS_DMRS: (field defined for -,format0_1,-,-,-,-,-,-) - nr_pdci_info_extracted->ptrs_dmrs = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case PTRS_DMRS: // 45 PTRS_DMRS: (field defined for -,format0_1,-,-,-,-,-,-) + nr_pdci_info_extracted->ptrs_dmrs = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->ptrs_dmrs=%x\n",nr_pdci_info_extracted->ptrs_dmrs); #endif break; - case 44: // 44 BETA_OFFSET_IND: (field defined for -,format0_1,-,-,-,-,-,-) - nr_pdci_info_extracted->beta_offset_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case BETA_OFFSET_IND: // 46 BETA_OFFSET_IND: (field defined for -,format0_1,-,-,-,-,-,-) + nr_pdci_info_extracted->beta_offset_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->beta_offset_ind=%x\n",nr_pdci_info_extracted->beta_offset_ind); #endif break; - case 45: // 45 DMRS_SEQ_INI: (field defined for -,format0_1,-,format1_1,-,-,-,-) + case DMRS_SEQ_INI: // 47 DMRS_SEQ_INI: (field defined for -,format0_1,-,format1_1,-,-,-,-) // 1 bit if the cell has two ULs and the number of bits for DCI format 1_0 before padding is larger than the number of bits for DCI format 0_0 before padding; 0 bit otherwise - nr_pdci_info_extracted->dmrs_seq_ini = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->dmrs_seq_ini = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->dmrs_seq_ini=%x\n",nr_pdci_info_extracted->dmrs_seq_ini); #endif break; - case 46: // 46 SUL_IND_0_0: (field defined for format0_0,-,-,-,-,-,-,-) - nr_pdci_info_extracted->sul_ind_0_0 = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + case UL_SCH_IND: // 48 UL_SCH_IND: (field defined for -,format0_1,-,-,-,-,-,-) + // value of "1" indicates UL-SCH shall be transmitted on the PUSCH and a value of "0" indicates UL-SCH shall not be transmitted on the PUSCH + nr_pdci_info_extracted->ul_sch_ind = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG - printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->sul_ind_0_0=%x\n",nr_pdci_info_extracted->sul_ind_0_0); + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->dmrs_seq_ini=%x\n",nr_pdci_info_extracted->ul_sch_ind); #endif break; - case 47: // 47 PADDING: (field defined for format0_0,-,format1_0,-,-,-,-,-) + + case PADDING_NR_DCI: // 49 PADDING_NR_DCI: (field defined for format0_0,-,format1_0,-,-,-,-,-) // (Note 2) If DCI format 0_0 is monitored in common search space - nr_pdci_info_extracted->padding = (uint16_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field])); + nr_pdci_info_extracted->padding_nr_dci = (uint16_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); +#ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->padding=%x\n",nr_pdci_info_extracted->padding_nr_dci); +#endif + break; + + case SUL_IND_0_0: // 50 SUL_IND_0_0: (field defined for format0_0,-,-,-,-,-,-,-) + nr_pdci_info_extracted->sul_ind_0_0 = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG - printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->padding=%x\n",nr_pdci_info_extracted->padding); + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->sul_ind_0_0=%x\n",nr_pdci_info_extracted->sul_ind_0_0); +#endif + break; + + case RA_PREAMBLE_INDEX: // 51 RA_PREAMBLE_INDEX: (field defined for format0_0,-,-,-,-,-,-,-) + nr_pdci_info_extracted->ra_preamble_index = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); +#ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->ra_preamble_index=%x\n",nr_pdci_info_extracted->ra_preamble_index); +#endif + break; + + case SUL_IND_1_0: // 52 SUL_IND_1_0: (field defined for -,-,format1_0,-,-,-,-,-) + nr_pdci_info_extracted->sul_ind_1_0 = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); +#ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->sul_ind_1_0=%x\n",nr_pdci_info_extracted->sul_ind_1_0); +#endif + break; + + case SS_PBCH_INDEX: // 53 SS_PBCH_INDEX: (field defined for -,-,format1_0,-,-,-,-,-) + nr_pdci_info_extracted->ss_pbch_index = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); +#ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->ss_pbch_index=%x\n",nr_pdci_info_extracted->ss_pbch_index); #endif break; + + case PRACH_MASK_INDEX: // 54 PRACH_MASK_INDEX: (field defined for -,-,-,format1_0,-,-,-,-) + nr_pdci_info_extracted->prach_mask_index = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); +#ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->prach_mask_index=%x\n",nr_pdci_info_extracted->prach_mask_index); +#endif + break; + + case RESERVED_NR_DCI: // 55 RESERVED_NR_DCI: (field defined for -,-,-,format1_0,-,-,-,-) + nr_pdci_info_extracted->reserved_nr_dci = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[dci_field][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[dci_field][dci_format-15])); +#ifdef NR_PDCCH_DCI_TOOLS_DEBUG + printf("\t\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_extract_dci_info) -> nr_pdci_info_extracted->reserved_nr_dci=%x\n",nr_pdci_info_extracted->reserved_nr_dci); +#endif + break; + } } } @@ -4604,6 +4679,7 @@ int nr_extract_dci_info(PHY_VARS_NR_UE *ue, #endif return(1); } + #endif #if 0 @@ -6698,12 +6774,14 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, #endif //(0) #ifdef NR_PDCCH_DCI_TOOLS + int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue, uint8_t eNB_id, int frame, uint8_t nr_tti_rx, void *dci_pdu, uint16_t rnti, + uint8_t dci_length, NR_DCI_format_t dci_format, NR_UE_PDCCH *pdcch_vars, NR_UE_PDSCH *pdsch_vars, @@ -6711,15 +6789,11 @@ int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue, NR_UE_ULSCH_t *ulsch, NR_DL_FRAME_PARMS *frame_parms, PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, - uint16_t si_rnti, - uint16_t ra_rnti, - uint16_t p_rnti, uint8_t beamforming_mode, - uint16_t tc_rnti, - uint8_t dci_length, - uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS], + uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS], uint16_t n_RB_ULBWP, - uint16_t n_RB_DLBWP) + uint16_t n_RB_DLBWP, + uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES]) { /* * Note only format0_0 and format1_0 are implemented @@ -6738,14 +6812,16 @@ int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue, dlsch0 = dlsch[0]; dlsch0->active = 0; - if (dci_fields_sizes[HARQ_PROCESS_NUMBER] != 0) { // 25 HARQ_PROCESS_NUMBER (25 is the position in dci_fields_sizes array for field HARQ_PROCESS_NUMBER) - for (int i=0; i<=HARQ_PROCESS_NUMBER; i++) left_shift = left_shift + dci_fields_sizes[i]; - nr_dci_info_extracted.harq_process_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[HARQ_PROCESS_NUMBER]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[HARQ_PROCESS_NUMBER])); + if (dci_fields_sizes[HARQ_PROCESS_NUMBER][dci_format-15] != 0) { // 27 HARQ_PROCESS_NUMBER (27 is the position in dci_fields_sizes array for field HARQ_PROCESS_NUMBER) + for (int i=0; i<=HARQ_PROCESS_NUMBER; i++) left_shift = left_shift + dci_fields_sizes[i][dci_format-15]; + nr_dci_info_extracted.harq_process_number = (uint8_t)(((((*(uint64_t *)dci_pdu) << (left_shift - dci_fields_sizes[HARQ_PROCESS_NUMBER][dci_format-15]))) & pdu_bitmap) >> (dci_length - dci_fields_sizes[HARQ_PROCESS_NUMBER][dci_format-15])); left_shift = 0; #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_generate_ue_ul_dlsch_params_from_dci) -> nr_dci_info_extracted->harq_process_number=%x\n",nr_dci_info_extracted.harq_process_number); #endif } + + dlsch0_harq = dlsch[0]->harq_processes[nr_dci_info_extracted.harq_process_number]; ulsch0 = ulsch; /* printf("nr_dci_info_extracted.harq_process_number = %d\n",nr_dci_info_extracted.harq_process_number); @@ -6757,16 +6833,17 @@ int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue, memset(&nr_dci_info_extracted,0,sizeof(nr_dci_info_extracted)); // printf("we reach this point\n"); - switch (dci_format) { +// switch (dci_format) { - case format0_0: +// case format0_0: #ifdef NR_PDCCH_DCI_TOOLS_DEBUG - printf("\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_generate_ue_ul_dlsch_params_from_dci) -> Entering function nr_extract_dci_info(dci_format=%d) for PUSCH allocation\n",dci_format); + printf("\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_generate_ue_ul_dlsch_params_from_dci) -> Entering function nr_extract_dci_info(dci_format=%d) \n",dci_format); #endif status = nr_extract_dci_info(ue, eNB_id, frame_type, dci_length, + rnti, dci_pdu, &nr_dci_info_extracted, dci_fields_sizes, @@ -6775,13 +6852,9 @@ int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue, ulsch0, dci_format, nr_tti_rx, - rnti, - si_rnti, - p_rnti, - ra_rnti, - tc_rnti, n_RB_ULBWP, - n_RB_DLBWP); + n_RB_DLBWP, + crc_scrambled_values); //status = check_dci_format1_1a_coherency(format1_1, frame_parms->N_RB_DL, rnti, tc_rnti, si_rnti, ra_rnti, p_rnti,frame,nr_tti_rx, &nr_dci_info_extracted, dlsch0_harq); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG if(status == 0) @@ -6790,8 +6863,8 @@ int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue, return(-1); } #endif - break; - +// break; +/* case format0_1: #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_generate_ue_ul_dlsch_params_from_dci) -> format %d not implemented yet\n",dci_format); @@ -6806,7 +6879,7 @@ int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue, eNB_id, frame_type, dci_length, - dci_pdu, + dci_pdu,rnti, &nr_dci_info_extracted, dci_fields_sizes, dlsch0_harq, @@ -6814,13 +6887,8 @@ int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue, ulsch0, dci_format, nr_tti_rx, - rnti, - si_rnti, - p_rnti, - ra_rnti, - tc_rnti, n_RB_ULBWP, - n_RB_DLBWP); + n_RB_DLBWP,crc_scrambled_values); //status = check_dci_format1_1a_coherency(format1_1, frame_parms->N_RB_DL, rnti, tc_rnti, si_rnti, ra_rnti, p_rnti,frame,nr_tti_rx, &nr_dci_info_extracted, dlsch0_harq); #ifdef NR_PDCCH_DCI_TOOLS_DEBUG if(status == 0) @@ -6866,12 +6934,16 @@ int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue, //LOG_E(PHY,"format %d not yet implemented\n",dci_format); return(-1); break; - } + }*/ #ifdef NR_PDCCH_DCI_TOOLS_DEBUG printf("\t<-NR_PDCCH_DCI_TOOLS_DEBUG (nr_generate_ue_ul_dlsch_params_from_dci) -> Ending function nr_extract_dci_info()\n"); #endif return(0); } + + + + #endif #if 0 int generate_ue_dlsch_params_from_dci(int frame, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index a4b8679f37d70e84102a4078835baea0f8ea0a47..6baa08cf2cb12303f058126d36ea98319a016692 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -45,10 +45,10 @@ #include "PHY/NR_REFSIG/refsig_defs_ue.h" extern openair0_config_t openair0_cfg[]; -static nfapi_config_request_t config_t; -static nfapi_config_request_t* config =&config_t; +static nfapi_nr_config_request_t config_t; +static nfapi_nr_config_request_t* config =&config_t; /* forward declarations */ -void set_default_frame_parms_single(nfapi_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms); +void set_default_frame_parms_single(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms); //#define DEBUG_INITIAL_SYNCH @@ -164,7 +164,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode) NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; int ret=-1; int aarx,rx_power=0; - //nfapi_config_request_t* config; + //nfapi_nr_config_request_t* config; /*offset parameters to be updated from higher layer */ k_ssb =0; diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h new file mode 100644 index 0000000000000000000000000000000000000000..9ca33c9404d610cc29d4c1eac6f9210147db6790 --- /dev/null +++ b/openair1/PHY/defs.h @@ -0,0 +1,1683 @@ +/* + * 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 PHY/defs.h + \brief Top-level defines and structure definitions + \author R. Knopp, F. Kaltenberger + \date 2011 + \version 0.1 + \company Eurecom + \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr + \note + \warning +*/ +#ifndef __PHY_DEFS__H__ +#define __PHY_DEFS__H__ + + +#define _GNU_SOURCE +#include <sched.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/mman.h> +#include <linux/sched.h> +#include <signal.h> +#include <execinfo.h> +#include <getopt.h> +#include <sys/sysinfo.h> + + +#include <stdio.h> +#include <stdlib.h> +#include <malloc.h> +#include <string.h> +#include <math.h> +#include "common_lib.h" +#include "msc.h" + +#include "openair2/PHY_INTERFACE/IF_Module.h" + +//#include <complex.h> +#include "assertions.h" +#ifdef MEX +# define msg mexPrintf +#endif +//use msg in the real-time thread context +#define msg_nrt printf +//use msg_nrt in the non real-time context (for initialization, ...) +#ifndef malloc16 +# ifdef __AVX2__ +# define malloc16(x) memalign(32,x) +# else +# define malloc16(x) memalign(16,x) +# endif +#endif +#define free16(y,x) free(y) +#define bigmalloc malloc +#define bigmalloc16 malloc16 +#define openair_free(y,x) free((y)) +#define PAGE_SIZE 4096 +#define free_and_zero(PtR) do { \ + if (PtR) { \ + free(PtR); \ + PtR = NULL; \ + } \ + } while (0) + +#define RX_NB_TH_MAX 2 +#define RX_NB_TH 2 + + +//! \brief Allocate \c size bytes of memory on the heap with alignment 16 and zero it afterwards. +//! If no more memory is available, this function will terminate the program with an assertion error. +static inline void* malloc16_clear( size_t size ) +{ +#ifdef __AVX2__ + void* ptr = memalign(32, size); +#else + void* ptr = memalign(16, size); +#endif + DevAssert(ptr); + memset( ptr, 0, size ); + return ptr; +} + + + +#define PAGE_MASK 0xfffff000 +#define virt_to_phys(x) (x) + +#define openair_sched_exit() exit(-1) + + +#define max(a,b) ((a)>(b) ? (a) : (b)) +#define min(a,b) ((a)<(b) ? (a) : (b)) + + +#define bzero(s,n) (memset((s),0,(n))) + +#define cmax(a,b) ((a>b) ? (a) : (b)) +#define cmin(a,b) ((a<b) ? (a) : (b)) + +#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c)) + +/// suppress compiler warning for unused arguments +#define UNUSED(x) (void)x; + + +#include "impl_defs_top.h" +#include "impl_defs_lte.h" + +#include "PHY/TOOLS/time_meas.h" +#include "PHY/CODING/defs.h" +#include "PHY/TOOLS/defs.h" +#include "platform_types.h" +#define MAX_NUM_RU_PER_eNB 64 + +#include "PHY/LTE_TRANSPORT/defs.h" +#include <pthread.h> + +#include "targets/ARCH/COMMON/common_lib.h" +#include "targets/COMMON/openairinterface5g_limits.h" + +#if defined(EXMIMO) || defined(OAI_USRP) +//#define NUMBER_OF_eNB_MAX 1 +//#define NUMBER_OF_UE_MAX 16 + +//#define NUMBER_OF_CONNECTED_eNB_MAX 3 +#else +#ifdef LARGE_SCALE +//#define NUMBER_OF_eNB_MAX 2 +//#define NUMBER_OF_UE_MAX 120 +//#define NUMBER_OF_CONNECTED_eNB_MAX 1 // to save some memory +#else +//#define NUMBER_OF_eNB_MAX 3 +//#define NUMBER_OF_UE_MAX 16 +//#define NUMBER_OF_RU_MAX 64 +//#define NUMBER_OF_CONNECTED_eNB_MAX 1 +#endif +#endif +#define NUMBER_OF_SUBBANDS_MAX 13 +#define NUMBER_OF_HARQ_PID_MAX 8 + +#define MAX_FRAME_NUMBER 0x400 + + + +#define NUMBER_OF_RN_MAX 3 +typedef enum {no_relay=1,unicast_relay_type1,unicast_relay_type2, multicast_relay} relaying_type_t; + + + +#define MCS_COUNT 28 +#define MCS_TABLE_LENGTH_MAX 64 + + +#define NUM_DCI_MAX 32 + +#define NUMBER_OF_eNB_SECTORS_MAX 3 + +#define NB_BANDS_MAX 8 + +#define MAX_BANDS_PER_RRU 4 + + +#ifdef OCP_FRAMEWORK +#include <enums.h> +#else +typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3,debug_prach=4,no_L2_connect=5,calib_prach_tx=6,rx_dump_frame=7,loop_through_memory=8} runmode_t; + +/*! \brief Extension Type */ +typedef enum { + CYCLIC_PREFIX, + CYCLIC_SUFFIX, + ZEROS, + NONE +} Extension_t; + +enum transmission_access_mode { + NO_ACCESS=0, + POSTPONED_ACCESS, + CANCELED_ACCESS, + UNKNOWN_ACCESS, + SCHEDULED_ACCESS, + CBA_ACCESS}; + +typedef enum { + eNodeB_3GPP=0, // classical eNodeB function + NGFI_RAU_IF5, // RAU with NGFI IF5 + NGFI_RAU_IF4p5, // RAU with NFGI IF4p5 + NGFI_RRU_IF5, // NGFI_RRU (NGFI remote radio-unit,IF5) + NGFI_RRU_IF4p5, // NGFI_RRU (NGFI remote radio-unit,IF4p5) + MBP_RRU_IF5 // Mobipass RRU +} node_function_t; + +typedef enum { + + synch_to_ext_device=0, // synch to RF or Ethernet device + synch_to_other, // synch to another source_(timer, other RU) + synch_to_mobipass_standalone // special case for mobipass in standalone mode +} node_timing_t; +#endif + +typedef struct UE_SCAN_INFO_s { + /// 10 best amplitudes (linear) for each pss signals + int32_t amp[3][10]; + /// 10 frequency offsets (kHz) corresponding to best amplitudes, with respect do minimum DL frequency in the band + int32_t freq_offset_Hz[3][10]; +} UE_SCAN_INFO_t; + +/// Top-level PHY Data Structure for RN +typedef struct { + /// Module ID indicator for this instance + uint8_t Mod_id; + uint32_t frame; + // phy_vars_eNB + // phy_vars ue + // cuurently only used to store and forward the PMCH + uint8_t mch_avtive[10]; + uint8_t sync_area[10]; // num SF + LTE_UE_DLSCH_t *dlsch_rn_MCH[10]; + +} PHY_VARS_RN; + +/// Context data structure for RX/TX portion of subframe processing +typedef struct { + /// Component Carrier index + uint8_t CC_id; + /// timestamp transmitted to HW + openair0_timestamp timestamp_tx; + /// subframe to act upon for transmission + int subframe_tx; + /// subframe to act upon for reception + int subframe_rx; + /// frame to act upon for transmission + int frame_tx; + /// frame to act upon for reception + int frame_rx; + /// \brief Instance count for RXn-TXnp4 processing thread. + /// \internal This variable is protected by \ref mutex_rxtx. + int instance_cnt_rxtx; + /// pthread structure for RXn-TXnp4 processing thread + pthread_t pthread_rxtx; + /// pthread attributes for RXn-TXnp4 processing thread + pthread_attr_t attr_rxtx; + /// condition variable for tx processing thread + pthread_cond_t cond_rxtx; + /// mutex for RXn-TXnp4 processing thread + pthread_mutex_t mutex_rxtx; + /// scheduling parameters for RXn-TXnp4 thread + struct sched_param sched_param_rxtx; +} eNB_rxtx_proc_t; + +typedef struct { + struct PHY_VARS_eNB_s *eNB; + int UE_id; + int harq_pid; + int llr8_flag; + int ret; +} td_params; + +typedef struct { + struct PHY_VARS_eNB_s *eNB; + LTE_eNB_DLSCH_t *dlsch; + int G; + int harq_pid; +} te_params; + +typedef struct RU_proc_t_s { + /// Pointer to associated RU descriptor + struct RU_t_s *ru; + /// timestamp received from HW + openair0_timestamp timestamp_rx; + /// timestamp to send to "slave rru" + openair0_timestamp timestamp_tx; + /// subframe to act upon for reception + int subframe_rx; + /// subframe to act upon for transmission + int subframe_tx; + /// subframe to act upon for reception of prach + int subframe_prach; +#ifdef Rel14 + /// subframe to act upon for reception of prach BL/CE UEs + int subframe_prach_br; +#endif + /// frame to act upon for reception + int frame_rx; + /// frame to act upon for transmission + int frame_tx; + /// unwrapped frame count + int frame_tx_unwrap; + /// frame to act upon for reception of prach + int frame_prach; +#ifdef Rel14 + /// frame to act upon for reception of prach + int frame_prach_br; +#endif + /// frame offset for slave RUs (to correct for frame asynchronism at startup) + int frame_offset; + /// \brief Instance count for FH processing thread. + /// \internal This variable is protected by \ref mutex_FH. + int instance_cnt_FH; + /// \internal This variable is protected by \ref mutex_prach. + int instance_cnt_prach; +#ifdef Rel14 + /// \internal This variable is protected by \ref mutex_prach. + int instance_cnt_prach_br; +#endif + /// \internal This variable is protected by \ref mutex_synch. + int instance_cnt_synch; + /// \internal This variable is protected by \ref mutex_eNBs. + int instance_cnt_eNBs; + /// \brief Instance count for rx processing thread. + /// \internal This variable is protected by \ref mutex_asynch_rxtx. + int instance_cnt_asynch_rxtx; + /// \internal This variable is protected by \ref mutex_fep + int instance_cnt_fep; + /// \internal This variable is protected by \ref mutex_fep + int instance_cnt_feptx; + /// pthread structure for RU FH processing thread + pthread_t pthread_FH; + /// pthread structure for RU prach processing thread + pthread_t pthread_prach; +#ifdef Rel14 + /// pthread structure for RU prach processing thread BL/CE UEs + pthread_t pthread_prach_br; +#endif + /// pthread struct for RU synch thread + pthread_t pthread_synch; + /// pthread struct for RU RX FEP worker thread + pthread_t pthread_fep; + /// pthread struct for RU RX FEPTX worker thread + pthread_t pthread_feptx; + /// pthread structure for asychronous RX/TX processing thread + pthread_t pthread_asynch_rxtx; + /// flag to indicate first RX acquisition + int first_rx; + /// flag to indicate first TX transmission + int first_tx; + /// pthread attributes for RU FH processing thread + pthread_attr_t attr_FH; + /// pthread attributes for RU prach + pthread_attr_t attr_prach; +#ifdef Rel14 + /// pthread attributes for RU prach BL/CE UEs + pthread_attr_t attr_prach_br; +#endif + /// pthread attributes for RU synch thread + pthread_attr_t attr_synch; + /// pthread attributes for asynchronous RX thread + pthread_attr_t attr_asynch_rxtx; + /// pthread attributes for worker fep thread + pthread_attr_t attr_fep; + /// pthread attributes for worker feptx thread + pthread_attr_t attr_feptx; + /// scheduling parameters for RU FH thread + struct sched_param sched_param_FH; + /// scheduling parameters for RU prach thread + struct sched_param sched_param_prach; +#ifdef Rel14 + /// scheduling parameters for RU prach thread BL/CE UEs + struct sched_param sched_param_prach_br; +#endif + /// scheduling parameters for RU synch thread + struct sched_param sched_param_synch; + /// scheduling parameters for asynch_rxtx thread + struct sched_param sched_param_asynch_rxtx; + /// condition variable for RU FH thread + pthread_cond_t cond_FH; + /// condition variable for RU prach thread + pthread_cond_t cond_prach; +#ifdef Rel14 + /// condition variable for RU prach thread BL/CE UEs + pthread_cond_t cond_prach_br; +#endif + /// condition variable for RU synch thread + pthread_cond_t cond_synch; + /// condition variable for asynch RX/TX thread + pthread_cond_t cond_asynch_rxtx; + /// condition varaible for RU RX FEP thread + pthread_cond_t cond_fep; + /// condition varaible for RU RX FEPTX thread + pthread_cond_t cond_feptx; + /// condition variable for eNB signal + pthread_cond_t cond_eNBs; + /// mutex for RU FH + pthread_mutex_t mutex_FH; + /// mutex for RU prach + pthread_mutex_t mutex_prach; +#ifdef Rel14 + /// mutex for RU prach BL/CE UEs + pthread_mutex_t mutex_prach_br; +#endif + /// mutex for RU synch + pthread_mutex_t mutex_synch; + /// mutex for eNB signal + pthread_mutex_t mutex_eNBs; + /// mutex for asynch RX/TX thread + pthread_mutex_t mutex_asynch_rxtx; + /// mutex for fep RX worker thread + pthread_mutex_t mutex_fep; + /// mutex for fep TX worker thread + pthread_mutex_t mutex_feptx; + /// symbol mask for IF4p5 reception per subframe + uint32_t symbol_mask[10]; + /// number of slave threads + int num_slaves; + /// array of pointers to slaves + struct RU_proc_t_s **slave_proc; +} RU_proc_t; + +/// Context data structure for eNB subframe processing +typedef struct eNB_proc_t_s { + /// Component Carrier index + uint8_t CC_id; + /// thread index + int thread_index; + /// timestamp received from HW + openair0_timestamp timestamp_rx; + /// timestamp to send to "slave rru" + openair0_timestamp timestamp_tx; + /// subframe to act upon for reception + int subframe_rx; + /// subframe to act upon for PRACH + int subframe_prach; +#ifdef Rel14 + /// subframe to act upon for reception of prach BL/CE UEs + int subframe_prach_br; +#endif + /// frame to act upon for reception + int frame_rx; + /// frame to act upon for transmission + int frame_tx; + /// frame to act upon for PRACH + int frame_prach; +#ifdef Rel14 + /// frame to act upon for PRACH BL/CE UEs + int frame_prach_br; +#endif + /// \internal This variable is protected by \ref mutex_td. + int instance_cnt_td; + /// \internal This variable is protected by \ref mutex_te. + int instance_cnt_te; + /// \internal This variable is protected by \ref mutex_prach. + int instance_cnt_prach; +#ifdef Rel14 + /// \internal This variable is protected by \ref mutex_prach for BL/CE UEs. + int instance_cnt_prach_br; +#endif + // instance count for over-the-air eNB synchronization + int instance_cnt_synch; + /// \internal This variable is protected by \ref mutex_asynch_rxtx. + int instance_cnt_asynch_rxtx; + /// pthread structure for eNB single processing thread + pthread_t pthread_single; + /// pthread structure for asychronous RX/TX processing thread + pthread_t pthread_asynch_rxtx; + /// flag to indicate first RX acquisition + int first_rx; + /// flag to indicate first TX transmission + int first_tx; + /// pthread attributes for parallel turbo-decoder thread + pthread_attr_t attr_td; + /// pthread attributes for parallel turbo-encoder thread + pthread_attr_t attr_te; + /// pthread attributes for single eNB processing thread + pthread_attr_t attr_single; + /// pthread attributes for prach processing thread + pthread_attr_t attr_prach; +#ifdef Rel14 + /// pthread attributes for prach processing thread BL/CE UEs + pthread_attr_t attr_prach_br; +#endif + /// pthread attributes for asynchronous RX thread + pthread_attr_t attr_asynch_rxtx; + /// scheduling parameters for parallel turbo-decoder thread + struct sched_param sched_param_td; + /// scheduling parameters for parallel turbo-encoder thread + struct sched_param sched_param_te; + /// scheduling parameters for single eNB thread + struct sched_param sched_param_single; + /// scheduling parameters for prach thread + struct sched_param sched_param_prach; +#ifdef Rel14 + /// scheduling parameters for prach thread + struct sched_param sched_param_prach_br; +#endif + /// scheduling parameters for asynch_rxtx thread + struct sched_param sched_param_asynch_rxtx; + /// pthread structure for parallel turbo-decoder thread + pthread_t pthread_td; + /// pthread structure for parallel turbo-encoder thread + pthread_t pthread_te; + /// pthread structure for PRACH thread + pthread_t pthread_prach; +#ifdef Rel14 + /// pthread structure for PRACH thread BL/CE UEs + pthread_t pthread_prach_br; +#endif + /// condition variable for parallel turbo-decoder thread + pthread_cond_t cond_td; + /// condition variable for parallel turbo-encoder thread + pthread_cond_t cond_te; + /// condition variable for PRACH processing thread; + pthread_cond_t cond_prach; +#ifdef Rel14 + /// condition variable for PRACH processing thread BL/CE UEs; + pthread_cond_t cond_prach_br; +#endif + /// condition variable for asynch RX/TX thread + pthread_cond_t cond_asynch_rxtx; + /// mutex for parallel turbo-decoder thread + pthread_mutex_t mutex_td; + /// mutex for parallel turbo-encoder thread + pthread_mutex_t mutex_te; + /// mutex for PRACH thread + pthread_mutex_t mutex_prach; +#ifdef Rel14 + /// mutex for PRACH thread for BL/CE UEs + pthread_mutex_t mutex_prach_br; +#endif + /// mutex for asynch RX/TX thread + pthread_mutex_t mutex_asynch_rxtx; + /// mutex for RU access to eNB processing (PDSCH/PUSCH) + pthread_mutex_t mutex_RU; + /// mutex for RU access to eNB processing (PRACH) + pthread_mutex_t mutex_RU_PRACH; + /// mutex for RU access to eNB processing (PRACH BR) + pthread_mutex_t mutex_RU_PRACH_br; + /// mask for RUs serving eNB (PDSCH/PUSCH) + int RU_mask; + /// mask for RUs serving eNB (PRACH) + int RU_mask_prach; +#ifdef Rel14 + /// mask for RUs serving eNB (PRACH) + int RU_mask_prach_br; +#endif + /// parameters for turbo-decoding worker thread + td_params tdp; + /// parameters for turbo-encoding worker thread + te_params tep; + /// set of scheduling variables RXn-TXnp4 threads + eNB_rxtx_proc_t proc_rxtx[2]; +} eNB_proc_t; + + +/// Context data structure for RX/TX portion of subframe processing +typedef struct { + /// index of the current UE RX/TX proc + int proc_id; + /// Component Carrier index + uint8_t CC_id; + /// timestamp transmitted to HW + openair0_timestamp timestamp_tx; + /// subframe to act upon for transmission + int subframe_tx; + /// subframe to act upon for reception + int subframe_rx; + /// frame to act upon for transmission + int frame_tx; + /// frame to act upon for reception + int frame_rx; + /// \brief Instance count for RXn-TXnp4 processing thread. + /// \internal This variable is protected by \ref mutex_rxtx. + int instance_cnt_rxtx; + /// pthread structure for RXn-TXnp4 processing thread + pthread_t pthread_rxtx; + /// pthread attributes for RXn-TXnp4 processing thread + pthread_attr_t attr_rxtx; + /// condition variable for tx processing thread + pthread_cond_t cond_rxtx; + /// mutex for RXn-TXnp4 processing thread + pthread_mutex_t mutex_rxtx; + /// scheduling parameters for RXn-TXnp4 thread + struct sched_param sched_param_rxtx; + + /// internal This variable is protected by ref mutex_fep_slot1. + //int instance_cnt_slot0_dl_processing; + int instance_cnt_slot1_dl_processing; + /// pthread descriptor fep_slot1 thread + //pthread_t pthread_slot0_dl_processing; + pthread_t pthread_slot1_dl_processing; + /// pthread attributes for fep_slot1 processing thread + // pthread_attr_t attr_slot0_dl_processing; + pthread_attr_t attr_slot1_dl_processing; + /// condition variable for UE fep_slot1 thread; + //pthread_cond_t cond_slot0_dl_processing; + pthread_cond_t cond_slot1_dl_processing; + /// mutex for UE synch thread + //pthread_mutex_t mutex_slot0_dl_processing; + pthread_mutex_t mutex_slot1_dl_processing; + // + uint8_t chan_est_pilot0_slot1_available; + uint8_t chan_est_slot1_available; + uint8_t llr_slot1_available; + uint8_t dci_slot0_available; + uint8_t first_symbol_available; + //uint8_t channel_level; + /// scheduling parameters for fep_slot1 thread + struct sched_param sched_param_fep_slot1; + + int sub_frame_start; + int sub_frame_step; + unsigned long long gotIQs; +} UE_rxtx_proc_t; + +/// Context data structure for eNB subframe processing +typedef struct { + /// Component Carrier index + uint8_t CC_id; + /// Last RX timestamp + openair0_timestamp timestamp_rx; + /// pthread attributes for main UE thread + pthread_attr_t attr_ue; + /// scheduling parameters for main UE thread + struct sched_param sched_param_ue; + /// pthread descriptor main UE thread + pthread_t pthread_ue; + /// \brief Instance count for synch thread. + /// \internal This variable is protected by \ref mutex_synch. + int instance_cnt_synch; + /// pthread attributes for synch processing thread + pthread_attr_t attr_synch; + /// scheduling parameters for synch thread + struct sched_param sched_param_synch; + /// pthread descriptor synch thread + pthread_t pthread_synch; + /// condition variable for UE synch thread; + pthread_cond_t cond_synch; + /// mutex for UE synch thread + pthread_mutex_t mutex_synch; + /// instance count for eNBs + int instance_cnt_eNBs; + /// set of scheduling variables RXn-TXnp4 threads + UE_rxtx_proc_t proc_rxtx[RX_NB_TH]; +} UE_proc_t; + +typedef enum { + LOCAL_RF =0, + REMOTE_IF5 =1, + REMOTE_MBP_IF5 =2, + REMOTE_IF4p5 =3, + REMOTE_IF1pp =4, + MAX_RU_IF_TYPES =5 +} RU_if_south_t; + +typedef struct RU_t_s{ + /// index of this ru + uint32_t idx; + /// Pointer to configuration file + char *rf_config_file; + /// southbound interface + RU_if_south_t if_south; + /// timing + node_timing_t if_timing; + /// function + node_function_t function; + /// Ethernet parameters for fronthaul interface + eth_params_t eth_params; + /// flag to indicate the RU is in synch with a master reference + int in_synch; + /// timing offset + int rx_offset; + /// flag to indicate the RU is a slave to another source + int is_slave; + /// Total gain of receive chain + uint32_t rx_total_gain_dB; + /// number of bands that this device can support + int num_bands; + /// band list + int band[MAX_BANDS_PER_RRU]; + /// number of RX paths on device + int nb_rx; + /// number of TX paths on device + int nb_tx; + /// maximum PDSCH RS EPRE + int max_pdschReferenceSignalPower; + /// maximum RX gain + int max_rxgain; + /// Attenuation of RX paths on device + int att_rx; + /// Attenuation of TX paths on device + int att_tx; + /// flag to indicate precoding operation in RU + int do_precoding; + /// Frame parameters + LTE_DL_FRAME_PARMS frame_parms; + ///timing offset used in TDD + int N_TA_offset; + /// RF device descriptor + openair0_device rfdevice; + /// HW configuration + openair0_config_t openair0_cfg; + /// Number of eNBs using this RU + int num_eNB; + /// list of eNBs using this RU + struct PHY_VARS_eNB_s *eNB_list[NUMBER_OF_eNB_MAX]; + /// Mapping of antenna ports to RF chain index + openair0_rf_map rf_map; + /// IF device descriptor + openair0_device ifdevice; + /// Pointer for ifdevice buffer struct + if_buffer_t ifbuffer; + /// if prach processing is to be performed in RU + int do_prach; + /// function pointer to synchronous RX fronthaul function (RRU,3GPP_eNB) + void (*fh_south_in)(struct RU_t_s *ru,int *frame, int *subframe); + /// function pointer to synchronous TX fronthaul function + void (*fh_south_out)(struct RU_t_s *ru); + /// function pointer to synchronous RX fronthaul function (RRU) + void (*fh_north_in)(struct RU_t_s *ru,int *frame, int *subframe); + /// function pointer to synchronous RX fronthaul function (RRU) + void (*fh_north_out)(struct RU_t_s *ru); + /// function pointer to asynchronous fronthaul interface + void (*fh_north_asynch_in)(struct RU_t_s *ru,int *frame, int *subframe); + /// function pointer to asynchronous fronthaul interface + void (*fh_south_asynch_in)(struct RU_t_s *ru,int *frame, int *subframe); + /// function pointer to initialization function for radio interface + int (*start_rf)(struct RU_t_s *ru); + /// function pointer to release function for radio interface + int (*stop_rf)(struct RU_t_s *ru); + /// function pointer to initialization function for radio interface + int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_eNB_s *eNB); + /// function pointer to RX front-end processing routine (DFTs/prefix removal or NULL) + void (*feprx)(struct RU_t_s *ru); + /// function pointer to TX front-end processing routine (IDFTs and prefix removal or NULL) + void (*feptx_ofdm)(struct RU_t_s *ru); + /// function pointer to TX front-end processing routine (PRECODING) + void (*feptx_prec)(struct RU_t_s *ru); + /// function pointer to wakeup routine in lte-enb. + int (*wakeup_rxtx)(struct PHY_VARS_eNB_s *eNB, struct RU_t_s *ru); + /// function pointer to wakeup routine in lte-enb. + void (*wakeup_prach_eNB)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe); +#ifdef Rel14 + /// function pointer to wakeup routine in lte-enb. + void (*wakeup_prach_eNB_br)(struct PHY_VARS_eNB_s *eNB,struct RU_t_s *ru,int frame,int subframe); +#endif + /// function pointer to eNB entry routine + void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string); + /// Timing statistics + time_stats_t ofdm_demod_stats; + /// Timing statistics (TX) + time_stats_t ofdm_mod_stats; + /// Timing statistics (RX Fronthaul + Compression) + time_stats_t rx_fhaul; + /// Timing statistics (TX Fronthaul + Compression) + time_stats_t tx_fhaul; + /// Timong statistics (Compression) + time_stats_t compression; + /// Timing statistics (Fronthaul transport) + time_stats_t transport; + /// RX and TX buffers for precoder output + RU_COMMON common; + /// beamforming weight vectors per eNB + int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15]; + + /// received frequency-domain signal for PRACH (IF4p5 RRU) + int16_t **prach_rxsigF; + /// received frequency-domain signal for PRACH BR (IF4p5 RRU) + int16_t **prach_rxsigF_br[4]; + /// sequence number for IF5 + uint8_t seqno; + /// initial timestamp used as an offset make first real timestamp 0 + openair0_timestamp ts_offset; + /// process scheduling variables + RU_proc_t proc; + /// stats thread pthread descriptor + pthread_t ru_stats_thread; +} RU_t; + + +typedef struct { + //unsigned int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (linear) + //unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (dB) + //unsigned short rx_avg_power_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //! estimated avg received signal power (dB) + + // RRC measurements + uint32_t rssi; + int n_adj_cells; + unsigned int adj_cell_id[6]; + uint32_t rsrq[7]; + uint32_t rsrp[7]; + float rsrp_filtered[7]; // after layer 3 filtering + float rsrq_filtered[7]; + // common measurements + //! estimated noise power (linear) + unsigned int n0_power[NB_ANTENNAS_RX]; + //! estimated noise power (dB) + unsigned short n0_power_dB[NB_ANTENNAS_RX]; + //! total estimated noise power (linear) + unsigned int n0_power_tot; + //! total estimated noise power (dB) + unsigned short n0_power_tot_dB; + //! average estimated noise power (linear) + unsigned int n0_power_avg; + //! average estimated noise power (dB) + unsigned short n0_power_avg_dB; + //! total estimated noise power (dBm) + short n0_power_tot_dBm; + + // UE measurements + //! estimated received spatial signal power (linear) + int rx_spatial_power[NUMBER_OF_CONNECTED_eNB_MAX][2][2]; + //! estimated received spatial signal power (dB) + unsigned short rx_spatial_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][2][2]; + + /// estimated received signal power (sum over all TX antennas) + //int wideband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; + int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; + /// estimated received signal power (sum over all TX antennas) + //int wideband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; + unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; + + /// estimated received signal power (sum over all TX/RX antennas) + int rx_power_tot[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW + /// estimated received signal power (sum over all TX/RX antennas) + unsigned short rx_power_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW + + //! estimated received signal power (sum of all TX/RX antennas, time average) + int rx_power_avg[NUMBER_OF_CONNECTED_eNB_MAX]; + //! estimated received signal power (sum of all TX/RX antennas, time average, in dB) + unsigned short rx_power_avg_dB[NUMBER_OF_CONNECTED_eNB_MAX]; + + /// SINR (sum of all TX/RX antennas, in dB) + int wideband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX]; + /// SINR (sum of all TX/RX antennas, time average, in dB) + int wideband_cqi_avg[NUMBER_OF_CONNECTED_eNB_MAX]; + + //! estimated rssi (dBm) + short rx_rssi_dBm[NUMBER_OF_CONNECTED_eNB_MAX]; + //! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation) + int rx_correlation[NUMBER_OF_CONNECTED_eNB_MAX][2]; + //! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation) + int rx_correlation_dB[NUMBER_OF_CONNECTED_eNB_MAX][2]; + + /// Wideband CQI (sum of all RX antennas, in dB, for precoded transmission modes (3,4,5,6), up to 4 spatial streams) + int precoded_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX+1][4]; + /// Subband CQI per RX antenna (= SINR) + int subband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX]; + /// Total Subband CQI (= SINR) + int subband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX]; + /// Subband CQI in dB (= SINR dB) + int subband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX]; + /// Total Subband CQI + int subband_cqi_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX]; + /// Wideband PMI for each RX antenna + int wideband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; + /// Wideband PMI for each RX antenna + int wideband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; + ///Subband PMI for each RX antenna + int subband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX][NB_ANTENNAS_RX]; + ///Subband PMI for each RX antenna + int subband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX][NB_ANTENNAS_RX]; + /// chosen RX antennas (1=Rx antenna 1, 2=Rx antenna 2, 3=both Rx antennas) + unsigned char selected_rx_antennas[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX]; + /// Wideband Rank indication + unsigned char rank[NUMBER_OF_CONNECTED_eNB_MAX]; + /// Number of RX Antennas + unsigned char nb_antennas_rx; + /// DLSCH error counter + // short dlsch_errors; + +} PHY_MEASUREMENTS; + +typedef struct { + //unsigned int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (linear) + //unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //! estimated received signal power (dB) + //unsigned short rx_avg_power_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //! estimated avg received signal power (dB) + + // common measurements + //! estimated noise power (linear) + unsigned int n0_power[MAX_NUM_RU_PER_eNB]; + //! estimated noise power (dB) + unsigned short n0_power_dB[MAX_NUM_RU_PER_eNB]; + //! total estimated noise power (linear) + unsigned int n0_power_tot; + //! estimated avg noise power (dB) + unsigned short n0_power_tot_dB; + //! estimated avg noise power (dB) + short n0_power_tot_dBm; + //! estimated avg noise power per RB per RX ant (lin) + unsigned short n0_subband_power[MAX_NUM_RU_PER_eNB][100]; + //! estimated avg noise power per RB per RX ant (dB) + unsigned short n0_subband_power_dB[MAX_NUM_RU_PER_eNB][100]; + //! estimated avg noise power per RB (dB) + short n0_subband_power_tot_dB[100]; + //! estimated avg noise power per RB (dBm) + short n0_subband_power_tot_dBm[100]; + // eNB measurements (per user) + //! estimated received spatial signal power (linear) + unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2]; + //! estimated received spatial signal power (dB) + unsigned short rx_spatial_power_dB[NUMBER_OF_UE_MAX][2][2]; + //! estimated rssi (dBm) + short rx_rssi_dBm[NUMBER_OF_UE_MAX]; + //! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation) + int rx_correlation[NUMBER_OF_UE_MAX][2]; + //! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation) + int rx_correlation_dB[NUMBER_OF_UE_MAX][2]; + + /// Wideband CQI (= SINR) + int wideband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB]; + /// Wideband CQI in dB (= SINR dB) + int wideband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB]; + /// Wideband CQI (sum of all RX antennas, in dB) + char wideband_cqi_tot[NUMBER_OF_UE_MAX]; + /// Subband CQI per RX antenna and RB (= SINR) + int subband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100]; + /// Total Subband CQI and RB (= SINR) + int subband_cqi_tot[NUMBER_OF_UE_MAX][100]; + /// Subband CQI in dB and RB (= SINR dB) + int subband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100]; + /// Total Subband CQI and RB + int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100]; + /// PRACH background noise level + int prach_I0; +} PHY_MEASUREMENTS_eNB; + + +/// Top-level PHY Data Structure for eNB +typedef struct PHY_VARS_eNB_s { + /// Module ID indicator for this instance + module_id_t Mod_id; + uint8_t CC_id; + uint8_t configured; + eNB_proc_t proc; + int single_thread_flag; + int abstraction_flag; + int num_RU; + RU_t *RU_list[MAX_NUM_RU_PER_eNB]; + /// Ethernet parameters for northbound midhaul interface + eth_params_t eth_params_n; + /// Ethernet parameters for fronthaul interface + eth_params_t eth_params; + int rx_total_gain_dB; + int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag); + int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *); + int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_eNB_s *eNB); + uint8_t local_flag; + LTE_DL_FRAME_PARMS frame_parms; + PHY_MEASUREMENTS_eNB measurements; + IF_Module_t *if_inst; + UL_IND_t UL_INFO; + pthread_mutex_t UL_INFO_mutex; + /// NFAPI RX ULSCH information + nfapi_rx_indication_pdu_t rx_pdu_list[NFAPI_RX_IND_MAX_PDU]; + /// NFAPI RX ULSCH CRC information + nfapi_crc_indication_pdu_t crc_pdu_list[NFAPI_CRC_IND_MAX_PDU]; + /// NFAPI HARQ information + nfapi_harq_indication_pdu_t harq_pdu_list[NFAPI_HARQ_IND_MAX_PDU]; + /// NFAPI SR information + nfapi_sr_indication_pdu_t sr_pdu_list[NFAPI_SR_IND_MAX_PDU]; + /// NFAPI CQI information + nfapi_cqi_indication_pdu_t cqi_pdu_list[NFAPI_CQI_IND_MAX_PDU]; + /// NFAPI CQI information (raw component) + nfapi_cqi_indication_raw_pdu_t cqi_raw_pdu_list[NFAPI_CQI_IND_MAX_PDU]; + /// NFAPI PRACH information + nfapi_preamble_pdu_t preamble_list[MAX_NUM_RX_PRACH_PREAMBLES]; +#ifdef Rel14 + /// NFAPI PRACH information BL/CE UEs + nfapi_preamble_pdu_t preamble_list_br[MAX_NUM_RX_PRACH_PREAMBLES]; +#endif + Sched_Rsp_t Sched_INFO; + LTE_eNB_PDCCH pdcch_vars[2]; + LTE_eNB_PHICH phich_vars[2]; +#ifdef Rel14 + LTE_eNB_EPDCCH epdcch_vars[2]; + LTE_eNB_MPDCCH mpdcch_vars[2]; + LTE_eNB_PRACH prach_vars_br; +#endif + LTE_eNB_COMMON common_vars; + LTE_eNB_UCI uci_vars[NUMBER_OF_UE_MAX]; + LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX]; + LTE_eNB_PBCH pbch; + LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX]; + LTE_eNB_PRACH prach_vars; + LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams + LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA + LTE_eNB_DLSCH_t *dlsch_SI,*dlsch_ra,*dlsch_p; + LTE_eNB_DLSCH_t *dlsch_MCH; + LTE_eNB_DLSCH_t *dlsch_PCH; + LTE_eNB_UE_stats UE_stats[NUMBER_OF_UE_MAX]; + LTE_eNB_UE_stats *UE_stats_ptr[NUMBER_OF_UE_MAX]; + + /// cell-specific reference symbols + uint32_t lte_gold_table[20][2][14]; + + /// UE-specific reference symbols (p=5), TM 7 + uint32_t lte_gold_uespec_port5_table[NUMBER_OF_UE_MAX][20][38]; + + /// UE-specific reference symbols (p=7...14), TM 8/9/10 + uint32_t lte_gold_uespec_table[2][20][2][21]; + + /// mbsfn reference symbols + uint32_t lte_gold_mbsfn_table[10][3][42]; + + uint32_t X_u[64][839]; +#ifdef Rel14 + uint32_t X_u_br[4][64][839]; +#endif + uint8_t pbch_configured; + uint8_t pbch_pdu[4]; //PBCH_PDU_SIZE + char eNB_generate_rar; + + /// Indicator set to 0 after first SR + uint8_t first_sr[NUMBER_OF_UE_MAX]; + + uint32_t max_peak_val; + int max_eNB_id, max_sync_pos; + + /// \brief sinr for all subcarriers of the current link (used only for abstraction). + /// first index: ? [0..N_RB_DL*12[ + double *sinr_dB; + + /// N0 (used for abstraction) + double N0; + + unsigned char first_run_timing_advance[NUMBER_OF_UE_MAX]; + unsigned char first_run_I0_measurements; + + + unsigned char is_secondary_eNB; // primary by default + unsigned char is_init_sync; /// Flag to tell if initial synchronization is performed. This affects how often the secondary eNB will listen to the PSS from the primary system. + unsigned char has_valid_precoder; /// Flag to tell if secondary eNB has channel estimates to create NULL-beams from, and this B/F vector is created. + unsigned char PeNB_id; /// id of Primary eNB + + /// hold the precoder for NULL beam to the primary user + int **dl_precoder_SeNB[3]; + char log2_maxp; /// holds the maximum channel/precoder coefficient + + /// if ==0 enables phy only test mode + int mac_enabled; + /// counter to average prach energh over first 100 prach opportunities + int prach_energy_counter; + + // PDSCH Varaibles + PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_UE_MAX]; + + // PUSCH Varaibles + PUSCH_CONFIG_DEDICATED pusch_config_dedicated[NUMBER_OF_UE_MAX]; + + // PUCCH variables + PUCCH_CONFIG_DEDICATED pucch_config_dedicated[NUMBER_OF_UE_MAX]; + + // UL-POWER-Control + UL_POWER_CONTROL_DEDICATED ul_power_control_dedicated[NUMBER_OF_UE_MAX]; + + // TPC + TPC_PDCCH_CONFIG tpc_pdcch_config_pucch[NUMBER_OF_UE_MAX]; + TPC_PDCCH_CONFIG tpc_pdcch_config_pusch[NUMBER_OF_UE_MAX]; + + // CQI reporting + CQI_REPORT_CONFIG cqi_report_config[NUMBER_OF_UE_MAX]; + + // SRS Variables + SOUNDINGRS_UL_CONFIG_DEDICATED soundingrs_ul_config_dedicated[NUMBER_OF_UE_MAX]; + uint8_t ncs_cell[20][7]; + + // Scheduling Request Config + SCHEDULING_REQUEST_CONFIG scheduling_request_config[NUMBER_OF_UE_MAX]; + + // Transmission mode per UE + uint8_t transmission_mode[NUMBER_OF_UE_MAX]; + + /// cba_last successful reception for each group, used for collision detection + uint8_t cba_last_reception[4]; + + // Pointers for active physicalConfigDedicated to be applied in current subframe + struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX]; + + + uint32_t rb_mask_ul[4]; + + /// Information regarding TM5 + MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX]; + + + /// target_ue_dl_mcs : only for debug purposes + uint32_t target_ue_dl_mcs; + /// target_ue_ul_mcs : only for debug purposes + uint32_t target_ue_ul_mcs; + /// target_ue_dl_rballoc : only for debug purposes + uint32_t ue_dl_rb_alloc; + /// target ul PRBs : only for debug + uint32_t ue_ul_nb_rb; + + ///check for Total Transmissions + uint32_t check_for_total_transmissions; + + ///check for MU-MIMO Transmissions + uint32_t check_for_MUMIMO_transmissions; + + ///check for SU-MIMO Transmissions + uint32_t check_for_SUMIMO_transmissions; + + ///check for FULL MU-MIMO Transmissions + uint32_t FULL_MUMIMO_transmissions; + + /// Counter for total bitrate, bits and throughput in downlink + uint32_t total_dlsch_bitrate; + uint32_t total_transmitted_bits; + uint32_t total_system_throughput; + + int hw_timing_advance; + + time_stats_t phy_proc; + time_stats_t phy_proc_tx; + time_stats_t phy_proc_rx; + time_stats_t rx_prach; + + time_stats_t ofdm_mod_stats; + time_stats_t dlsch_encoding_stats; + time_stats_t dlsch_modulation_stats; + time_stats_t dlsch_scrambling_stats; + time_stats_t dlsch_rate_matching_stats; + time_stats_t dlsch_turbo_encoding_stats; + time_stats_t dlsch_interleaving_stats; + + time_stats_t rx_dft_stats; + time_stats_t ulsch_channel_estimation_stats; + time_stats_t ulsch_freq_offset_estimation_stats; + time_stats_t ulsch_decoding_stats; + time_stats_t ulsch_demodulation_stats; + time_stats_t ulsch_rate_unmatching_stats; + time_stats_t ulsch_turbo_decoding_stats; + time_stats_t ulsch_deinterleaving_stats; + time_stats_t ulsch_demultiplexing_stats; + time_stats_t ulsch_llr_stats; + time_stats_t ulsch_tc_init_stats; + time_stats_t ulsch_tc_alpha_stats; + time_stats_t ulsch_tc_beta_stats; + time_stats_t ulsch_tc_gamma_stats; + time_stats_t ulsch_tc_ext_stats; + time_stats_t ulsch_tc_intl1_stats; + time_stats_t ulsch_tc_intl2_stats; + +#ifdef LOCALIZATION + /// time state for localization + time_stats_t localization_stats; +#endif + + int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10]; + int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024]; + int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024]; + int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10]; + int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][2*10*1024]; + int32_t pusch_stats_rb[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_round[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240]; +} PHY_VARS_eNB; + +#define debug_msg if (((mac_xface->frame%100) == 0) || (mac_xface->frame < 50)) msg + +/// Top-level PHY Data Structure for UE +typedef struct { + /// \brief Module ID indicator for this instance + uint8_t Mod_id; + /// \brief Component carrier ID for this PHY instance + uint8_t CC_id; + /// \brief Mapping of CC_id antennas to cards + openair0_rf_map rf_map; + //uint8_t local_flag; + /// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach) + runmode_t mode; + /// \brief Indicator that UE should perform band scanning + int UE_scan; + /// \brief Indicator that UE should perform coarse scanning around carrier + int UE_scan_carrier; + /// \brief Indicator that UE is synchronized to an eNB + int is_synchronized; + /// Data structure for UE process scheduling + UE_proc_t proc; + /// Flag to indicate the UE shouldn't do timing correction at all + int no_timing_correction; + /// \brief Total gain of the TX chain (16-bit baseband I/Q to antenna) + uint32_t tx_total_gain_dB; + /// \brief Total gain of the RX chain (antenna to baseband I/Q) This is a function of rx_gain_mode (and the corresponding gain) and the rx_gain of the card. + uint32_t rx_total_gain_dB; + /// \brief Total gains with maximum RF gain stage (ExpressMIMO2/Lime) + uint32_t rx_gain_max[4]; + /// \brief Total gains with medium RF gain stage (ExpressMIMO2/Lime) + uint32_t rx_gain_med[4]; + /// \brief Total gains with bypassed RF gain stage (ExpressMIMO2/Lime) + uint32_t rx_gain_byp[4]; + /// \brief Current transmit power + int16_t tx_power_dBm[10]; + /// \brief Total number of REs in current transmission + int tx_total_RE[10]; + /// \brief Maximum transmit power + int8_t tx_power_max_dBm; + /// \brief Number of eNB seen by UE + uint8_t n_connected_eNB; + /// \brief indicator that Handover procedure has been initiated + uint8_t ho_initiated; + /// \brief indicator that Handover procedure has been triggered + uint8_t ho_triggered; + /// \brief Measurement variables. + PHY_MEASUREMENTS measurements; + LTE_DL_FRAME_PARMS frame_parms; + /// \brief Frame parame before ho used to recover if ho fails. + LTE_DL_FRAME_PARMS frame_parms_before_ho; + LTE_UE_COMMON common_vars; + + // point to the current rxTx thread index + uint8_t current_thread_id[10]; + + LTE_UE_PDSCH *pdsch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_eNB_MAX+1]; // two RxTx Threads + LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1]; + LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1]; + LTE_UE_PDSCH *pdsch_vars_ra[NUMBER_OF_CONNECTED_eNB_MAX+1]; + LTE_UE_PDSCH *pdsch_vars_p[NUMBER_OF_CONNECTED_eNB_MAX+1]; + LTE_UE_PDSCH *pdsch_vars_MCH[NUMBER_OF_CONNECTED_eNB_MAX]; + LTE_UE_PBCH *pbch_vars[NUMBER_OF_CONNECTED_eNB_MAX]; + LTE_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_eNB_MAX]; + LTE_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_eNB_MAX]; + LTE_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_eNB_MAX][2]; // two RxTx Threads + LTE_UE_ULSCH_t *ulsch[NUMBER_OF_CONNECTED_eNB_MAX]; + LTE_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_eNB_MAX]; + LTE_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_eNB_MAX]; + LTE_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_eNB_MAX]; + LTE_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_eNB_MAX]; + // This is for SIC in the UE, to store the reencoded data + LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_CONNECTED_eNB_MAX]; + + //Paging parameters + uint32_t IMSImod1024; + uint32_t PF; + uint32_t PO; + + // For abstraction-purposes only + uint8_t sr[10]; + uint8_t pucch_sel[10]; + uint8_t pucch_payload[22]; + + UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX]; + /// cell-specific reference symbols + uint32_t lte_gold_table[7][20][2][14]; + + /// UE-specific reference symbols (p=5), TM 7 + uint32_t lte_gold_uespec_port5_table[20][38]; + + /// ue-specific reference symbols + uint32_t lte_gold_uespec_table[2][20][2][21]; + + /// mbsfn reference symbols + uint32_t lte_gold_mbsfn_table[10][3][42]; + + uint32_t X_u[64][839]; + + uint32_t high_speed_flag; + uint32_t perfect_ce; + int16_t ch_est_alpha; + int generate_ul_signal[NUMBER_OF_CONNECTED_eNB_MAX]; + + UE_SCAN_INFO_t scan_info[NB_BANDS_MAX]; + + char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX]; + + + + unsigned char ulsch_Msg3_active[NUMBER_OF_CONNECTED_eNB_MAX]; + uint32_t ulsch_Msg3_frame[NUMBER_OF_CONNECTED_eNB_MAX]; + unsigned char ulsch_Msg3_subframe[NUMBER_OF_CONNECTED_eNB_MAX]; + PRACH_RESOURCES_t *prach_resources[NUMBER_OF_CONNECTED_eNB_MAX]; + int turbo_iterations, turbo_cntl_iterations; + /// \brief ?. + /// - first index: eNB [0..NUMBER_OF_CONNECTED_eNB_MAX[ (hard coded) + uint32_t total_TBS[NUMBER_OF_CONNECTED_eNB_MAX]; + /// \brief ?. + /// - first index: eNB [0..NUMBER_OF_CONNECTED_eNB_MAX[ (hard coded) + uint32_t total_TBS_last[NUMBER_OF_CONNECTED_eNB_MAX]; + /// \brief ?. + /// - first index: eNB [0..NUMBER_OF_CONNECTED_eNB_MAX[ (hard coded) + uint32_t bitrate[NUMBER_OF_CONNECTED_eNB_MAX]; + /// \brief ?. + /// - first index: eNB [0..NUMBER_OF_CONNECTED_eNB_MAX[ (hard coded) + uint32_t total_received_bits[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_errors[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_errors_last[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_received[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_received_last[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_fer[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_SI_received[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_SI_errors[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_ra_received[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_ra_errors[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_p_received[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_p_errors[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_mch_received_sf[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_mch_received[NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_mcch_received[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_mtch_received[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_mcch_errors[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_mtch_errors[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_mcch_trials[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX]; + int dlsch_mtch_trials[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX]; + int current_dlsch_cqi[NUMBER_OF_CONNECTED_eNB_MAX]; + unsigned char first_run_timing_advance[NUMBER_OF_CONNECTED_eNB_MAX]; + uint8_t generate_prach; + uint8_t prach_cnt; + uint8_t prach_PreambleIndex; + // uint8_t prach_timer; + uint8_t decode_SIB; + uint8_t decode_MIB; + int rx_offset; /// Timing offset + int rx_offset_diff; /// Timing adjustment for ofdm symbol0 on HW USRP + int time_sync_cell; + int timing_advance; ///timing advance signalled from eNB + int hw_timing_advance; + int N_TA_offset; ///timing offset used in TDD + /// Flag to tell if UE is secondary user (cognitive mode) + unsigned char is_secondary_ue; + /// Flag to tell if secondary eNB has channel estimates to create NULL-beams from. + unsigned char has_valid_precoder; + /// hold the precoder for NULL beam to the primary eNB + int **ul_precoder_S_UE; + /// holds the maximum channel/precoder coefficient + char log2_maxp; + + /// if ==0 enables phy only test mode + int mac_enabled; + + /// Flag to initialize averaging of PHY measurements + int init_averaging; + + /// \brief sinr for all subcarriers of the current link (used only for abstraction). + /// - first index: ? [0..12*N_RB_DL[ + double *sinr_dB; + + /// \brief sinr for all subcarriers of first symbol for the CQI Calculation. + /// - first index: ? [0..12*N_RB_DL[ + double *sinr_CQI_dB; + + /// sinr_effective used for CQI calulcation + double sinr_eff; + + /// N0 (used for abstraction) + double N0; + + /// PDSCH Varaibles + PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX]; + + /// PUSCH Varaibles + PUSCH_CONFIG_DEDICATED pusch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX]; + + /// PUSCH contention-based access vars + PUSCH_CA_CONFIG_DEDICATED pusch_ca_config_dedicated[NUMBER_OF_eNB_MAX]; // lola + + /// PUCCH variables + + PUCCH_CONFIG_DEDICATED pucch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX]; + + uint8_t ncs_cell[20][7]; + + /// UL-POWER-Control + UL_POWER_CONTROL_DEDICATED ul_power_control_dedicated[NUMBER_OF_CONNECTED_eNB_MAX]; + + /// TPC + TPC_PDCCH_CONFIG tpc_pdcch_config_pucch[NUMBER_OF_CONNECTED_eNB_MAX]; + TPC_PDCCH_CONFIG tpc_pdcch_config_pusch[NUMBER_OF_CONNECTED_eNB_MAX]; + + /// CQI reporting + CQI_REPORT_CONFIG cqi_report_config[NUMBER_OF_CONNECTED_eNB_MAX]; + + /// SRS Variables + SOUNDINGRS_UL_CONFIG_DEDICATED soundingrs_ul_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX]; + + /// Scheduling Request Config + SCHEDULING_REQUEST_CONFIG scheduling_request_config[NUMBER_OF_CONNECTED_eNB_MAX]; + + /// Transmission mode per eNB + uint8_t transmission_mode[NUMBER_OF_CONNECTED_eNB_MAX]; + + time_stats_t phy_proc[RX_NB_TH]; + time_stats_t phy_proc_tx; + time_stats_t phy_proc_rx[RX_NB_TH]; + + uint32_t use_ia_receiver; + + time_stats_t ofdm_mod_stats; + time_stats_t ulsch_encoding_stats; + time_stats_t ulsch_modulation_stats; + time_stats_t ulsch_segmentation_stats; + time_stats_t ulsch_rate_matching_stats; + time_stats_t ulsch_turbo_encoding_stats; + time_stats_t ulsch_interleaving_stats; + time_stats_t ulsch_multiplexing_stats; + + time_stats_t generic_stat; + time_stats_t generic_stat_bis[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; + time_stats_t ue_front_end_stat[RX_NB_TH]; + time_stats_t ue_front_end_per_slot_stat[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; + time_stats_t pdcch_procedures_stat[RX_NB_TH]; + time_stats_t pdsch_procedures_stat[RX_NB_TH]; + time_stats_t pdsch_procedures_per_slot_stat[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; + time_stats_t dlsch_procedures_stat[RX_NB_TH]; + + time_stats_t ofdm_demod_stats; + time_stats_t dlsch_rx_pdcch_stats; + time_stats_t rx_dft_stats; + time_stats_t dlsch_channel_estimation_stats; + time_stats_t dlsch_freq_offset_estimation_stats; + time_stats_t dlsch_decoding_stats[2]; + time_stats_t dlsch_demodulation_stats; + time_stats_t dlsch_rate_unmatching_stats; + time_stats_t dlsch_turbo_decoding_stats; + time_stats_t dlsch_deinterleaving_stats; + time_stats_t dlsch_llr_stats; + time_stats_t dlsch_llr_stats_parallelization[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; + time_stats_t dlsch_unscrambling_stats; + time_stats_t dlsch_rate_matching_stats; + time_stats_t dlsch_turbo_encoding_stats; + time_stats_t dlsch_interleaving_stats; + time_stats_t dlsch_tc_init_stats; + time_stats_t dlsch_tc_alpha_stats; + time_stats_t dlsch_tc_beta_stats; + time_stats_t dlsch_tc_gamma_stats; + time_stats_t dlsch_tc_ext_stats; + time_stats_t dlsch_tc_intl1_stats; + time_stats_t dlsch_tc_intl2_stats; + time_stats_t tx_prach; + + /// RF and Interface devices per CC + + openair0_device rfdevice; +} PHY_VARS_UE; + +/* this structure is used to pass both UE phy vars and + * proc to the function UE_thread_rxn_txnp4 + */ +struct rx_tx_thread_data { + PHY_VARS_UE *UE; + UE_rxtx_proc_t *proc; +}; + +void exit_fun(const char* s); + +#include "UTIL/LOG/log_extern.h" +extern pthread_cond_t sync_cond; +extern pthread_mutex_t sync_mutex; +extern int sync_var; + + +#define MODE_DECODE_NONE 0 +#define MODE_DECODE_SSE 1 +#define MODE_DECODE_C 2 +#define MODE_DECODE_AVX2 3 + +#define DECODE_INITTD8_SSE_FPTRIDX 0 +#define DECODE_INITTD16_SSE_FPTRIDX 1 +#define DECODE_INITTD_AVX2_FPTRIDX 2 +#define DECODE_TD8_SSE_FPTRIDX 3 +#define DECODE_TD16_SSE_FPTRIDX 4 +#define DECODE_TD_C_FPTRIDX 5 +#define DECODE_TD16_AVX2_FPTRIDX 6 +#define DECODE_FREETD8_FPTRIDX 7 +#define DECODE_FREETD16_FPTRIDX 8 +#define DECODE_FREETD_AVX2_FPTRIDX 9 +#define ENCODE_SSE_FPTRIDX 10 +#define ENCODE_C_FPTRIDX 11 +#define ENCODE_INIT_SSE_FPTRIDX 12 +#define DECODE_NUM_FPTR 13 + + +typedef uint8_t(*decoder_if_t)(int16_t *y, + int16_t *y2, + uint8_t *decoded_bytes, + uint8_t *decoded_bytes2, + uint16_t n, + uint16_t f1, + uint16_t f2, + uint8_t max_iterations, + uint8_t crc_type, + uint8_t F, + time_stats_t *init_stats, + time_stats_t *alpha_stats, + time_stats_t *beta_stats, + time_stats_t *gamma_stats, + time_stats_t *ext_stats, + time_stats_t *intl1_stats, + time_stats_t *intl2_stats); + +typedef uint8_t(*encoder_if_t)(uint8_t *input, + uint16_t input_length_bytes, + uint8_t *output, + uint8_t F, + uint16_t interleaver_f1, + uint16_t interleaver_f2); + +#define MAX_RRU_CONFIG_SIZE 1024 +typedef enum { + RAU_tick=0, + RRU_capabilities=1, + RRU_config=2, + RRU_MSG_max_num=3 +} rru_config_msg_type_t; + +typedef struct RRU_CONFIG_msg_s { + rru_config_msg_type_t type; + ssize_t len; + uint8_t msg[MAX_RRU_CONFIG_SIZE]; +} RRU_CONFIG_msg_t; + +typedef enum { + OAI_IF5_only =0, + OAI_IF4p5_only =1, + OAI_IF5_and_IF4p5 =2, + MBP_IF5 =3, + MAX_FH_FMTs =4 +} FH_fmt_options_t; + +#define MAX_BANDS_PER_RRU 4 + +typedef struct RRU_capabilities_s { + /// Fronthaul format + FH_fmt_options_t FH_fmt; + /// number of EUTRA bands (<=4) supported by RRU + uint8_t num_bands; + /// EUTRA band list supported by RRU + uint8_t band_list[MAX_BANDS_PER_RRU]; + /// Number of concurrent bands (component carriers) + uint8_t num_concurrent_bands; + /// Maximum TX EPRE of each band + int8_t max_pdschReferenceSignalPower[MAX_BANDS_PER_RRU]; + /// Maximum RX gain of each band + uint8_t max_rxgain[MAX_BANDS_PER_RRU]; + /// Number of RX ports of each band + uint8_t nb_rx[MAX_BANDS_PER_RRU]; + /// Number of TX ports of each band + uint8_t nb_tx[MAX_BANDS_PER_RRU]; + /// max DL bandwidth (1,6,15,25,50,75,100) + uint8_t N_RB_DL[MAX_BANDS_PER_RRU]; + /// max UL bandwidth (1,6,15,25,50,75,100) + uint8_t N_RB_UL[MAX_BANDS_PER_RRU]; +} RRU_capabilities_t; + +typedef struct RRU_config_s { + + /// Fronthaul format + RU_if_south_t FH_fmt; + /// number of EUTRA bands (<=4) configured in RRU + uint8_t num_bands; + /// EUTRA band list configured in RRU + uint8_t band_list[MAX_BANDS_PER_RRU]; + /// TDD configuration (0-6) + uint8_t tdd_config[MAX_BANDS_PER_RRU]; + /// TDD special subframe configuration (0-10) + uint8_t tdd_config_S[MAX_BANDS_PER_RRU]; + /// TX frequency + uint32_t tx_freq[MAX_BANDS_PER_RRU]; + /// RX frequency + uint32_t rx_freq[MAX_BANDS_PER_RRU]; + /// TX attenation w.r.t. max + uint8_t att_tx[MAX_BANDS_PER_RRU]; + /// RX attenuation w.r.t. max + uint8_t att_rx[MAX_BANDS_PER_RRU]; + /// DL bandwidth + uint8_t N_RB_DL[MAX_BANDS_PER_RRU]; + /// UL bandwidth + uint8_t N_RB_UL[MAX_BANDS_PER_RRU]; + /// 3/4 sampling rate + uint8_t threequarter_fs[MAX_BANDS_PER_RRU]; + /// prach_FreqOffset for IF4p5 + int prach_FreqOffset[MAX_BANDS_PER_RRU]; + /// prach_ConfigIndex for IF4p5 + int prach_ConfigIndex[MAX_BANDS_PER_RRU]; +#ifdef Rel14 + int emtc_prach_CElevel_enable[MAX_BANDS_PER_RRU][4]; + /// emtc_prach_FreqOffset for IF4p5 per CE Level + int emtc_prach_FreqOffset[MAX_BANDS_PER_RRU][4]; + /// emtc_prach_ConfigIndex for IF4p5 per CE Level + int emtc_prach_ConfigIndex[MAX_BANDS_PER_RRU][4]; +#endif +} RRU_config_t; + + +static inline void wait_sync(char *thread_name) { + + printf( "waiting for sync (%s)\n",thread_name); + pthread_mutex_lock( &sync_mutex ); + + while (sync_var<0) + pthread_cond_wait( &sync_cond, &sync_mutex ); + + pthread_mutex_unlock(&sync_mutex); + + printf( "got sync (%s)\n", thread_name); + +} + +static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) { + if (pthread_mutex_lock(mutex) != 0) { + LOG_E( PHY, "[SCHED][eNB] error locking mutex for %s\n",name); + exit_fun("nothing to add"); + return(-1); + } + + while (*instance_cnt < 0) { + // most of the time the thread is waiting here + // proc->instance_cnt_rxtx is -1 + pthread_cond_wait(cond,mutex); // this unlocks mutex_rxtx while waiting and then locks it again + } + + if (pthread_mutex_unlock(mutex) != 0) { + LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for %s\n",name); + exit_fun("nothing to add"); + return(-1); + } + return(0); +} + +static inline int wait_on_busy_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) { + + if (pthread_mutex_lock(mutex) != 0) { + LOG_E( PHY, "[SCHED][eNB] error locking mutex for %s\n",name); + exit_fun("nothing to add"); + return(-1); + } + + while (*instance_cnt == 0) { + // most of the time the thread will skip this + // waits only if proc->instance_cnt_rxtx is 0 + pthread_cond_wait(cond,mutex); // this unlocks mutex_rxtx while waiting and then locks it again + } + + if (pthread_mutex_unlock(mutex) != 0) { + LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for %s\n",name); + exit_fun("nothing to add"); + return(-1); + } + return(0); +} + +static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *name) { + + if (pthread_mutex_lock(mutex) != 0) { + LOG_E( PHY, "[SCHED][eNB] error locking mutex for %s\n",name); + exit_fun("nothing to add"); + return(-1); + } + + *instance_cnt=*instance_cnt-1; + + if (pthread_mutex_unlock(mutex) != 0) { + LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for %s\n",name); + exit_fun("nothing to add"); + return(-1); + } + return(0); +} + + +#include "PHY/INIT/defs.h" +#include "PHY/LTE_REFSIG/defs.h" +#include "PHY/MODULATION/defs.h" +#include "PHY/LTE_TRANSPORT/proto.h" +#include "PHY/LTE_ESTIMATION/defs.h" + +#include "SIMULATION/ETH_TRANSPORT/defs.h" +#endif // __PHY_DEFS__H__ diff --git a/openair1/PHY/defs_NR.h b/openair1/PHY/defs_NR.h index bd48157700d4c6c419c29efee671661dd01d494e..b705ef4c2eb40d7c9260dd870e9a8a5f1560f261 100644 --- a/openair1/PHY/defs_NR.h +++ b/openair1/PHY/defs_NR.h @@ -114,11 +114,11 @@ typedef struct PHY_VARS_gNB_s { int (*te)(struct PHY_VARS_gNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *); int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_gNB_s *eNB); uint8_t local_flag; - nfapi_config_request_t gNB_config; + nfapi_nr_config_request_t gNB_config; NR_DL_FRAME_PARMS frame_parms; PHY_MEASUREMENTS_gNB measurements; - IF_Module_t *if_inst; - UL_IND_t UL_INFO; + NR_IF_Module_t *if_inst; + NR_UL_IND_t UL_INFO; pthread_mutex_t UL_INFO_mutex; /// NFAPI RX ULSCH information nfapi_rx_indication_pdu_t rx_pdu_list[NFAPI_RX_IND_MAX_PDU]; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index e0d7b165f09331746a2a13a715680da15098242d..c4969ef6724a7d27639c5ba2f8db32bdbde43695 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -35,10 +35,12 @@ #include "defs_eNB.h" #include "defs_nr_common.h" #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" - +#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" typedef struct { - uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS]; + uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; + uint8_t pbch_a_interleaved[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; + uint8_t pbch_a_prime[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; uint8_t pbch_e[NR_POLAR_PBCH_E]; } NR_gNB_PBCH; @@ -240,11 +242,11 @@ typedef struct PHY_VARS_gNB_s { int rx_total_gain_dB; int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_gNB_s *gNB); uint8_t local_flag; - nfapi_config_request_t gNB_config; + nfapi_nr_config_request_t gNB_config; NR_DL_FRAME_PARMS frame_parms; PHY_MEASUREMENTS_gNB measurements; - IF_Module_t *if_inst; - UL_IND_t UL_INFO; + NR_IF_Module_t *if_inst; + NR_UL_IND_t UL_INFO; pthread_mutex_t UL_INFO_mutex; /// NFAPI RX ULSCH information nfapi_rx_indication_pdu_t rx_pdu_list[NFAPI_RX_IND_MAX_PDU]; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 4a25e62c771e6aed1d67317cb6a064e608c8276b..bbae8e58259c2692262551104c71cf3fdb94f835 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -578,57 +578,109 @@ typedef struct { #define NR_NBR_SEARCHSPACE_ACT_BWP 10 // The number of SearchSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0) #ifdef NR_PDCCH_DEFS_NR_UE +#define MAX_NR_DCI_DECODED_SLOT 10 #define NBR_NR_FORMATS 8 -#define NBR_NR_DCI_FIELDS 48 -// The following parameters define 'position' of each DCI field described in TS 38.212 -#define CARRIER_IND 0 -#define SUL_IND_0_1 1 -#define IDENTIFIER_DCI_FORMATS 2 +#define NBR_NR_DCI_FIELDS 56 + +#define IDENTIFIER_DCI_FORMATS 0 +#define CARRIER_IND 1 +#define SUL_IND_0_1 2 #define SLOT_FORMAT_IND 3 #define PRE_EMPTION_IND 4 #define TPC_CMD_NUMBER 5 #define BLOCK_NUMBER 6 #define BANDWIDTH_PART_IND 7 -#define FREQ_DOM_RESOURCE_ASSIGNMENT_UL 8 -#define FREQ_DOM_RESOURCE_ASSIGNMENT_DL 9 -#define TIME_DOM_RESOURCE_ASSIGNMENT 10 -#define VRB_TO_PRB_MAPPING 11 -#define PRB_BUNDLING_SIZE_IND 12 -#define RATE_MATCHING_IND 13 -#define ZP_CSI_RS_TRIGGER 14 -#define FREQ_HOPPING_FLAG 15 -#define TB1_MCS 16 -#define TB1_NDI 17 -#define TB1_RV 18 -#define TB2_MCS 19 -#define TB2_NDI 20 -#define TB2_RV 21 -#define MCS 22 -#define NDI 23 -#define RV 24 -#define HARQ_PROCESS_NUMBER 25 -#define DAI_ 26 -#define FIRST_DAI 27 -#define SECOND_DAI 28 -#define TPC_PUSCH 29 -#define TPC_PUCCH 30 -#define PUCCH_RESOURCE_IND 31 -#define PDSCH_TO_HARQ_FEEDBACK_TIME_IND 32 -#define SHORT_MESSAGE_IND 33 -#define SRS_RESOURCE_IND 34 -#define PRECOD_NBR_LAYERS 35 -#define ANTENNA_PORTS 36 -#define TCI 37 -#define SRS_REQUEST 38 -#define TPC_CMD_NUMBER_FORMAT2_3 39 -#define CSI_REQUEST 40 -#define CBGTI 41 -#define CBGFI 42 -#define PTRS_DMRS 43 -#define BETA_OFFSET_IND 44 -#define DMRS_SEQ_INI 45 -#define SUL_IND_0_0 46 -#define PADDING 47 +#define SHORT_MESSAGE_IND 8 +#define SHORT_MESSAGES 9 +#define FREQ_DOM_RESOURCE_ASSIGNMENT_UL 10 +#define FREQ_DOM_RESOURCE_ASSIGNMENT_DL 11 +#define TIME_DOM_RESOURCE_ASSIGNMENT 12 +#define VRB_TO_PRB_MAPPING 13 +#define PRB_BUNDLING_SIZE_IND 14 +#define RATE_MATCHING_IND 15 +#define ZP_CSI_RS_TRIGGER 16 +#define FREQ_HOPPING_FLAG 17 +#define TB1_MCS 18 +#define TB1_NDI 19 +#define TB1_RV 20 +#define TB2_MCS 21 +#define TB2_NDI 22 +#define TB2_RV 23 +#define MCS 24 +#define NDI 25 +#define RV 26 +#define HARQ_PROCESS_NUMBER 27 +#define DAI_ 28 +#define FIRST_DAI 29 +#define SECOND_DAI 30 +#define TB_SCALING 31 +#define TPC_PUSCH 32 +#define TPC_PUCCH 33 +#define PUCCH_RESOURCE_IND 34 +#define PDSCH_TO_HARQ_FEEDBACK_TIME_IND 35 +//#define SHORT_MESSAGE_IND 33 +#define SRS_RESOURCE_IND 36 +#define PRECOD_NBR_LAYERS 37 +#define ANTENNA_PORTS 38 +#define TCI 39 +#define SRS_REQUEST 40 +#define TPC_CMD_NUMBER_FORMAT2_3 41 +#define CSI_REQUEST 42 +#define CBGTI 43 +#define CBGFI 44 +#define PTRS_DMRS 45 +#define BETA_OFFSET_IND 46 +#define DMRS_SEQ_INI 47 +#define UL_SCH_IND 48 +#define PADDING_NR_DCI 49 +#define SUL_IND_0_0 50 +#define RA_PREAMBLE_INDEX 51 +#define SUL_IND_1_0 52 +#define SS_PBCH_INDEX 53 +#define PRACH_MASK_INDEX 54 +#define RESERVED_NR_DCI 55 + + +typedef enum { + _format_0_0_found=0, + _format_0_1_found=1, + _format_1_0_found=2, + _format_1_1_found=3, + _format_2_0_found=4, + _format_2_1_found=5, + _format_2_2_found=6, + _format_2_3_found=7} format_found_t; +#define TOTAL_NBR_SCRAMBLED_VALUES 13 +#define _C_RNTI_ 0 +#define _CS_RNTI_ 1 +#define _NEW_RNTI_ 2 +#define _TC_RNTI_ 3 +#define _P_RNTI_ 4 +#define _SI_RNTI_ 5 +#define _RA_RNTI_ 6 +#define _SP_CSI_RNTI_ 7 +#define _SFI_RNTI_ 8 +#define _INT_RNTI_ 9 +#define _TPC_PUSCH_RNTI_ 10 +#define _TPC_PUCCH_RNTI_ 11 +#define _TPC_SRS_RNTI_ 12 + typedef enum { + _c_rnti = _C_RNTI_, + _cs_rnti = _CS_RNTI_, + _new_rnti = _NEW_RNTI_, + _tc_rnti = _TC_RNTI_, + _p_rnti = _P_RNTI_, + _si_rnti = _SI_RNTI_, + _ra_rnti = _RA_RNTI_, + _sp_csi_rnti = _SP_CSI_RNTI_, + _sfi_rnti = _SFI_RNTI_, + _int_rnti = _INT_RNTI_, + _tpc_pusch_rnti = _TPC_PUSCH_RNTI_, + _tpc_pucch_rnti = _TPC_PUCCH_RNTI_, + _tpc_srs_rnti = _TPC_SRS_RNTI_} crc_scrambled_t; + + + typedef enum {bundle_n2=2,bundle_n3=3,bundle_n6=6} NR_UE_CORESET_REG_bundlesize_t; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index e55f2391c0e6dc45d592f178c2efdde5e53d7dbe..a3abfd866004de0753b0a9d8c1a2b9fdc50b5d8d 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -34,7 +34,7 @@ #define __PHY_DEFS_NR_COMMON__H__ #include "defs_common.h" -#include "nfapi_interface.h" +#include "nfapi_nr_interface.h" #include "impl_defs_nr.h" #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" @@ -54,8 +54,8 @@ #define NR_PSS_LENGTH 127 #define NR_SSS_LENGTH 127 -#define NR_PBCH_DMRS_LENGTH 144 -#define NR_PBCH_DMRS_LENGTH_DWORD 5 // roundup(NR_PBCH_DMRS_LENGTH/32) +#define NR_PBCH_DMRS_LENGTH 144 // in mod symbols +#define NR_PBCH_DMRS_LENGTH_DWORD 10 // roundup(2(QPSK)*NR_PBCH_DMRS_LENGTH/32) #define NR_MAX_PDCCH_DMRS_LENGTH 100 #define NR_MAX_PDCCH_DMRS_LENGTH_DWORD 5 @@ -79,6 +79,11 @@ typedef enum{ nr_ssb_type_E } nr_ssb_type_e; +typedef enum { + nr_FR1 = 0, + nr_FR2 +} nr_frequency_range_e; + typedef struct NR_BWP_PARMS { /// Associated numerology index uint8_t numerology_index; @@ -91,6 +96,8 @@ typedef struct NR_BWP_PARMS { } NR_BWP_PARMS; typedef struct NR_DL_FRAME_PARMS { + /// frequency range + nr_frequency_range_e freq_range; /// Number of resource blocks (RB) in DL uint8_t N_RB_DL; /// Number of resource blocks (RB) in UL diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h new file mode 100644 index 0000000000000000000000000000000000000000..066dc7012c317f08da23c8b5433be624f1937f6a --- /dev/null +++ b/openair1/PHY/impl_defs_lte.h @@ -0,0 +1,1291 @@ +/* + * 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 PHY/impl_defs_lte.h +* \brief LTE Physical channel configuration and variable structure definitions +* \author R. Knopp, F. Kaltenberger +* \date 2011 +* \version 0.1 +* \company Eurecom +* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr +* \note +* \warning +*/ + +#ifndef __PHY_IMPLEMENTATION_DEFS_LTE_H__ +#define __PHY_IMPLEMENTATION_DEFS_LTE_H__ + + +#include "types.h" +#include "nfapi_interface.h" +//#include "defs.h" +#include "openair2/COMMON/platform_types.h" + +#define RX_NB_TH_MAX 2 +#define RX_NB_TH 2 + +#define LTE_SLOTS_PER_SUBFRAME 2 + +#define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10 +#define LTE_SLOTS_PER_FRAME 20 +#define LTE_CE_FILTER_LENGTH 5 +#define LTE_CE_OFFSET LTE_CE_FILTER_LENGTH +#define TX_RX_SWITCH_SYMBOL (NUMBER_OF_SYMBOLS_PER_FRAME>>1) +#define PBCH_PDU_SIZE 3 //bytes + +#define PRACH_SYMBOL 3 //position of the UL PSS wrt 2nd slot of special subframe + +#define NUMBER_OF_FREQUENCY_GROUPS (lte_frame_parms->N_RB_DL) + +#define SSS_AMP 1148 + +#define MAX_NUM_PHICH_GROUPS 56 //110 RBs Ng=2, p.60 36-212, Sec. 6.9 + +#define MAX_MBSFN_AREA 8 + +#define NB_RX_ANTENNAS_MAX 64 + +#ifdef OCP_FRAMEWORK +#include "enums.h" +#else +typedef enum {TDD=1,FDD=0} lte_frame_type_t; + +typedef enum {EXTENDED=1,NORMAL=0} lte_prefix_type_t; + +typedef enum {LOCALIZED=0,DISTRIBUTED=1} vrb_t; + +/// Enumeration for parameter PHICH-Duration \ref PHICH_CONFIG_COMMON::phich_duration. +typedef enum { + normal=0, + extended=1 +} PHICH_DURATION_t; + +/// Enumeration for parameter Ng \ref PHICH_CONFIG_COMMON::phich_resource. +typedef enum { + oneSixth=1, + half=3, + one=6, + two=12 +} PHICH_RESOURCE_t; +#endif +/// PHICH-Config from 36.331 RRC spec +typedef struct { + /// Parameter: PHICH-Duration, see TS 36.211 (Table 6.9.3-1). + PHICH_DURATION_t phich_duration; + /// Parameter: Ng, see TS 36.211 (6.9). \details Value oneSixth corresponds to 1/6, half corresponds to 1/2 and so on. + PHICH_RESOURCE_t phich_resource; +} PHICH_CONFIG_COMMON; + +/// PRACH-ConfigInfo from 36.331 RRC spec +typedef struct { + /// Parameter: prach-ConfigurationIndex, see TS 36.211 (5.7.1). \vr{[0..63]} + uint8_t prach_ConfigIndex; + /// Parameter: High-speed-flag, see TS 36.211 (5.7.2). \vr{[0..1]} 1 corresponds to Restricted set and 0 to Unrestricted set. + uint8_t highSpeedFlag; + /// Parameter: \f$N_\text{CS}\f$, see TS 36.211 (5.7.2). \vr{[0..15]}\n Refer to table 5.7.2-2 for preamble format 0..3 and to table 5.7.2-3 for preamble format 4. + uint8_t zeroCorrelationZoneConfig; + /// Parameter: prach-FrequencyOffset, see TS 36.211 (5.7.1). \vr{[0..94]}\n For TDD the value range is dependent on the value of \ref prach_ConfigIndex. + uint8_t prach_FreqOffset; +} PRACH_CONFIG_INFO; + + + +/// PRACH-ConfigSIB or PRACH-Config from 36.331 RRC spec +typedef struct { + /// Parameter: RACH_ROOT_SEQUENCE, see TS 36.211 (5.7.1). \vr{[0..837]} + uint16_t rootSequenceIndex; + /// prach_Config_enabled=1 means enabled. \vr{[0..1]} + uint8_t prach_Config_enabled; + /// PRACH Configuration Information + PRACH_CONFIG_INFO prach_ConfigInfo; +} PRACH_CONFIG_COMMON; + +#ifdef Rel14 + +/// PRACH-eMTC-Config from 36.331 RRC spec +typedef struct { + /// Parameter: High-speed-flag, see TS 36.211 (5.7.2). \vr{[0..1]} 1 corresponds to Restricted set and 0 to Unrestricted set. + uint8_t highSpeedFlag; +/// Parameter: \f$N_\text{CS}\f$, see TS 36.211 (5.7.2). \vr{[0..15]}\n Refer to table 5.7.2-2 for preamble format 0..3 and to table 5.7.2-3 for preamble format 4. + uint8_t zeroCorrelationZoneConfig; + /// Parameter: prach-FrequencyOffset, see TS 36.211 (5.7.1). \vr{[0..94]}\n For TDD the value range is dependent on the value of \ref prach_ConfigIndex. + + /// PRACH starting subframe periodicity, expressed in number of subframes available for preamble transmission (PRACH opportunities), see TS 36.211. Value 2 corresponds to 2 subframes, 4 corresponds to 4 subframes and so on. EUTRAN configures the PRACH starting subframe periodicity larger than or equal to the Number of PRACH repetitions per attempt for each CE level (numRepetitionPerPreambleAttempt). + uint8_t prach_starting_subframe_periodicity[4]; + /// number of repetitions per preamble attempt per CE level + uint8_t prach_numRepetitionPerPreambleAttempt[4]; + /// prach configuration index for each CE level + uint8_t prach_ConfigIndex[4]; + /// indicator for CE level activation + uint8_t prach_CElevel_enable[4]; + /// prach frequency offset for each CE level + uint8_t prach_FreqOffset[4]; + /// indicator for CE level hopping activation + uint8_t prach_hopping_enable[4]; + /// indicator for CE level hopping activation + uint8_t prach_hopping_offset[4]; +} PRACH_eMTC_CONFIG_INFO; + +/// PRACH-ConfigSIB or PRACH-Config from 36.331 RRC spec +typedef struct { + /// Parameter: RACH_ROOT_SEQUENCE, see TS 36.211 (5.7.1). \vr{[0..837]} + uint16_t rootSequenceIndex; + /// prach_Config_enabled=1 means enabled. \vr{[0..1]} + uint8_t prach_Config_enabled; + /// PRACH Configuration Information +#ifdef Rel14 + PRACH_eMTC_CONFIG_INFO prach_ConfigInfo; +#endif +} PRACH_eMTC_CONFIG_COMMON; + +#endif + +/// Enumeration for parameter \f$N_\text{ANRep}\f$ \ref PUCCH_CONFIG_DEDICATED::repetitionFactor. +typedef enum { + n2=0, + n4, + n6 +} ACKNAKREP_t; + +/// Enumeration for \ref PUCCH_CONFIG_DEDICATED::tdd_AckNackFeedbackMode. +typedef enum { + bundling=0, + multiplexing +} ANFBmode_t; + +/// PUCCH-ConfigDedicated from 36.331 RRC spec +typedef struct { + /// Flag to indicate ACK NAK repetition activation, see TS 36.213 (10.1). \vr{[0..1]} + uint8_t ackNackRepetition; + /// Parameter: \f$N_\text{ANRep}\f$, see TS 36.213 (10.1). + ACKNAKREP_t repetitionFactor; + /// Parameter: \f$n^{(1)}_\text{PUCCH,ANRep}\f$, see TS 36.213 (10.1). \vr{[0..2047]} + uint16_t n1PUCCH_AN_Rep; + /// Feedback mode, see TS 36.213 (7.3). \details Applied to both PUCCH and PUSCH feedback. For TDD, should always be set to bundling. + ANFBmode_t tdd_AckNackFeedbackMode; +} PUCCH_CONFIG_DEDICATED; + +/// PUCCH-ConfigCommon from 36.331 RRC spec +typedef struct { + /// Parameter: \f$\Delta^\text{PUCCH}_\text{shift}\f$, see TS 36.211 (5.4.1). \vr{[1..3]} \note the specification sais it is an enumerated value. + uint8_t deltaPUCCH_Shift; + /// Parameter: \f$N^{(2)}_\text{RB}\f$, see TS 36.211 (5.4). \vr{[0..98]} + uint8_t nRB_CQI; + /// Parameter: \f$N^{(1)}_\text{CS}\f$, see TS 36.211 (5.4). \vr{[0..7]} + uint8_t nCS_AN; + /// Parameter: \f$N^{(1)}_\text{PUCCH}\f$ see TS 36.213 (10.1). \vr{[0..2047]} + uint16_t n1PUCCH_AN; + + /// group hopping sequence for DRS \note not part of offical UL-PUCCH_CONFIG_COMMON ASN1 specification. + uint8_t grouphop[20]; + /// sequence hopping sequence for DRS \note not part of offical UL-PUCCH_CONFIG_COMMON ASN1 specification. + uint8_t seqhop[20]; +} PUCCH_CONFIG_COMMON; + +/// UL-ReferenceSignalsPUSCH from 36.331 RRC spec +typedef struct { + /// Parameter: Group-hopping-enabled, see TS 36.211 (5.5.1.3). \vr{[0..1]} + uint8_t groupHoppingEnabled; + /// Parameter: \f$\Delta SS\f$, see TS 36.211 (5.5.1.3). \vr{[0..29]} + uint8_t groupAssignmentPUSCH; + /// Parameter: Sequence-hopping-enabled, see TS 36.211 (5.5.1.4). \vr{[0..1]} + uint8_t sequenceHoppingEnabled; + /// Parameter: cyclicShift, see TS 36.211 (Table 5.5.2.1.1-2). \vr{[0..7]} + uint8_t cyclicShift; + /// nPRS for cyclic shift of DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification. + uint8_t nPRS[20]; + /// group hopping sequence for DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification. + uint8_t grouphop[20]; + /// sequence hopping sequence for DRS \note not part of offical UL-ReferenceSignalsPUSCH ASN1 specification. + uint8_t seqhop[20]; +} UL_REFERENCE_SIGNALS_PUSCH_t; + +/// Enumeration for parameter Hopping-mode \ref PUSCH_CONFIG_COMMON::hoppingMode. +#ifndef OCP_FRAMEWORK +typedef enum { + interSubFrame=0, + intraAndInterSubFrame=1 +} PUSCH_HOPPING_t; +#endif + +/// PUSCH-ConfigCommon from 36.331 RRC spec. +typedef struct { + /// Parameter: \f$N_{sb}\f$, see TS 36.211 (5.3.4). \vr{[1..4]} + uint8_t n_SB; + /// Parameter: Hopping-mode, see TS 36.211 (5.3.4). + PUSCH_HOPPING_t hoppingMode; + /// Parameter: \f$N^{HO}_{RB}\f$, see TS 36.211 (5.3.4). \vr{[0..98]} + uint8_t pusch_HoppingOffset; + /// See TS 36.213 (8.6.1). \vr{[0..1]} 1 indicates 64QAM is allowed, 0 not allowed. + uint8_t enable64QAM; + /// Ref signals configuration + UL_REFERENCE_SIGNALS_PUSCH_t ul_ReferenceSignalsPUSCH; +} PUSCH_CONFIG_COMMON; + +/// UE specific PUSCH configuration. +typedef struct { + /// Parameter: \f$I^\text{HARQ-ACK}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-1). \vr{[0..15]} + uint16_t betaOffset_ACK_Index; + /// Parameter: \f$I^{RI}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-2). \vr{[0..15]} + uint16_t betaOffset_RI_Index; + /// Parameter: \f$I^{CQI}_\text{offset}\f$, see TS 36.213 (Table 8.6.3-3). \vr{[0..15]} + uint16_t betaOffset_CQI_Index; +} PUSCH_CONFIG_DEDICATED; + +/// lola CBA information +typedef struct { + /// + uint16_t betaOffset_CA_Index; + /// + uint16_t cShift; +} PUSCH_CA_CONFIG_DEDICATED; + +/// PDSCH-ConfigCommon from 36.331 RRC spec +typedef struct { + /// Parameter: Reference-signal power, see TS 36.213 (5.2). \vr{[-60..50]}\n Provides the downlink reference-signal EPRE. The actual value in dBm. + int8_t referenceSignalPower; + /// Parameter: \f$P_B\f$, see TS 36.213 (Table 5.2-1). \vr{[0..3]} + uint8_t p_b; +} PDSCH_CONFIG_COMMON; + +/// Enumeration for Parameter \f$P_A\f$ \ref PDSCH_CONFIG_DEDICATED::p_a. +typedef enum { + dBm6=0, ///< (dB-6) corresponds to -6 dB + dBm477, ///< (dB-4dot77) corresponds to -4.77 dB + dBm3, ///< (dB-3) corresponds to -3 dB + dBm177, ///< (dB-1dot77) corresponds to -1.77 dB + dB0, ///< corresponds to 0 dB + dB1, ///< corresponds to 1 dB + dB2, ///< corresponds to 2 dB + dB3 ///< corresponds to 3 dB +} PA_t; + +/// PDSCH-ConfigDedicated from 36.331 RRC spec +typedef struct { + /// Parameter: \f$P_A\f$, see TS 36.213 (5.2). + PA_t p_a; +} PDSCH_CONFIG_DEDICATED; + +/// SoundingRS-UL-ConfigCommon Information Element from 36.331 RRC spec +typedef struct { + /// enabled flag=1 means SRS is enabled. \vr{[0..1]} + uint8_t enabled_flag; + /// Parameter: SRS Bandwidth Configuration, see TS 36.211 (table 5.5.3.2-1, 5.5.3.2-2, 5.5.3.2-3 and 5.5.3.2-4). \vr{[0..7]}\n Actual configuration depends on UL bandwidth. \note the specification sais it is an enumerated value. + uint8_t srs_BandwidthConfig; + /// Parameter: SRS SubframeConfiguration, see TS 36.211 (table 5.5.3.3-1 for FDD, table 5.5.3.3-2 for TDD). \vr{[0..15]} \note the specification sais it is an enumerated value. + uint8_t srs_SubframeConfig; + /// Parameter: Simultaneous-AN-and-SRS, see TS 36.213 (8.2). \vr{[0..1]} + uint8_t ackNackSRS_SimultaneousTransmission; + /// Parameter: srsMaxUpPts, see TS 36.211 (5.5.3.2). \details If this field is present, reconfiguration of \f$m^\text{max}_\text{SRS,0}\f$ applies for UpPts, otherwise reconfiguration does not apply. + uint8_t srs_MaxUpPts; +} SOUNDINGRS_UL_CONFIG_COMMON; + +/// \note UNUSED +typedef enum { + ulpc_al0=0, + ulpc_al04=1, + ulpc_al05=2, + ulpc_al06=3, + ulpc_al07=4, + ulpc_al08=5, + ulpc_al09=6, + ulpc_al11=7 +} UL_POWER_CONTROL_COMMON_alpha_t; + +/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format1. +typedef enum { + deltaF_PUCCH_Format1_deltaF_2 = 0, + deltaF_PUCCH_Format1_deltaF0 = 1, + deltaF_PUCCH_Format1_deltaF2 = 2 +} deltaF_PUCCH_Format1_t; + +/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format1b. +typedef enum { + deltaF_PUCCH_Format1b_deltaF1 = 0, + deltaF_PUCCH_Format1b_deltaF3 = 1, + deltaF_PUCCH_Format1b_deltaF5 = 2 +} deltaF_PUCCH_Format1b_t; + +/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format2. +typedef enum { + deltaF_PUCCH_Format2_deltaF_2 = 0, + deltaF_PUCCH_Format2_deltaF0 = 1, + deltaF_PUCCH_Format2_deltaF1 = 2, + deltaF_PUCCH_Format2_deltaF2 = 3 +} deltaF_PUCCH_Format2_t; + +/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format2a. +typedef enum { + deltaF_PUCCH_Format2a_deltaF_2 = 0, + deltaF_PUCCH_Format2a_deltaF0 = 1, + deltaF_PUCCH_Format2a_deltaF2 = 2 +} deltaF_PUCCH_Format2a_t; + +/// Enumeration for \ref deltaFList_PUCCH_t::deltaF_PUCCH_Format2b. +typedef enum { + deltaF_PUCCH_Format2b_deltaF_2 = 0, + deltaF_PUCCH_Format2b_deltaF0 = 1, + deltaF_PUCCH_Format2b_deltaF2 = 2 +} deltaF_PUCCH_Format2b_t; + +/// DeltaFList-PUCCH from 36.331 RRC spec +typedef struct { + deltaF_PUCCH_Format1_t deltaF_PUCCH_Format1; + deltaF_PUCCH_Format1b_t deltaF_PUCCH_Format1b; + deltaF_PUCCH_Format2_t deltaF_PUCCH_Format2; + deltaF_PUCCH_Format2a_t deltaF_PUCCH_Format2a; + deltaF_PUCCH_Format2b_t deltaF_PUCCH_Format2b; +} deltaFList_PUCCH_t; + +/// SoundingRS-UL-ConfigDedicated Information Element from 36.331 RRC spec +typedef struct { + /// This descriptor is active + uint8_t active; + /// This descriptor's frame + uint16_t frame; + /// This descriptor's subframe + uint8_t subframe; + /// rnti + uint16_t rnti; + /// Parameter: \f$B_\text{SRS}\f$, see TS 36.211 (table 5.5.3.2-1, 5.5.3.2-2, 5.5.3.2-3 and 5.5.3.2-4). \vr{[0..3]} \note the specification sais it is an enumerated value. + uint8_t srs_Bandwidth; + /// Parameter: SRS hopping bandwidth \f$b_\text{hop}\in\{0,1,2,3\}\f$, see TS 36.211 (5.5.3.2) \vr{[0..3]} \note the specification sais it is an enumerated value. + uint8_t srs_HoppingBandwidth; + /// Parameter: \f$n_\text{RRC}\f$, see TS 36.211 (5.5.3.2). \vr{[0..23]} + uint8_t freqDomainPosition; + /// Parameter: Duration, see TS 36.213 (8.2). \vr{[0..1]} 0 corresponds to "single" and 1 to "indefinite". + uint8_t duration; + /// Parameter: \f$k_\text{TC}\in\{0,1\}\f$, see TS 36.211 (5.5.3.2). \vr{[0..1]} + uint8_t transmissionComb; + /// Parameter: \f$I_\text{SRS}\f$, see TS 36.213 (table 8.2-1). \vr{[0..1023]} + uint16_t srs_ConfigIndex; + /// Parameter: \f$n^\text{CS}_\text{SRS}\f$. See TS 36.211 (5.5.3.1). \vr{[0..7]} \note the specification sais it is an enumerated value. + uint8_t cyclicShift; + // Parameter: internal implementation: UE SRS configured + uint8_t srsConfigDedicatedSetup; + // Parameter: cell srs subframe for internal implementation + uint8_t srsCellSubframe; + // Parameter: ue srs subframe for internal implementation + uint8_t srsUeSubframe; +} SOUNDINGRS_UL_CONFIG_DEDICATED; + +/// UplinkPowerControlDedicated Information Element from 36.331 RRC spec +typedef struct { + /// Parameter: \f$P_\text{0\_UE\_PUSCH}(1)\f$, see TS 36.213 (5.1.1.1), unit dB. \vr{[-8..7]}\n This field is applicable for non-persistent scheduling, only. + int8_t p0_UE_PUSCH; + /// Parameter: Ks, see TS 36.213 (5.1.1.1). \vr{[0..1]}\n en0 corresponds to value 0 corresponding to state “disabledâ€. en1 corresponds to value 1.25 corresponding to “enabledâ€. \note the specification sais it is an enumerated value. \warning the enumeration values do not correspond to the given values in the specification (en1 should be 1.25). + uint8_t deltaMCS_Enabled; + /// Parameter: Accumulation-enabled, see TS 36.213 (5.1.1.1). \vr{[0..1]} 1 corresponds to "enabled" whereas 0 corresponds to "disabled". + uint8_t accumulationEnabled; + /// Parameter: \f$P_\text{0\_UE\_PUCCH}(1)\f$, see TS 36.213 (5.1.2.1), unit dB. \vr{[-8..7]} + int8_t p0_UE_PUCCH; + /// Parameter: \f$P_\text{SRS\_OFFSET}\f$, see TS 36.213 (5.1.3.1). \vr{[0..15]}\n For Ks=1.25 (\ref deltaMCS_Enabled), the actual parameter value is pSRS_Offset value - 3. For Ks=0, the actual parameter value is -10.5 + 1.5*pSRS_Offset value. + int8_t pSRS_Offset; + /// Specifies the filtering coefficient for RSRP measurements used to calculate path loss, as specified in TS 36.213 (5.1.1.1).\details The same filtering mechanism applies as for quantityConfig described in 5.5.3.2. \note the specification sais it is an enumerated value. + uint8_t filterCoefficient; +} UL_POWER_CONTROL_DEDICATED; + +#ifndef OCP_FRAMEWORK +/// Enumeration for parameter \f$\alpha\f$ \ref UL_POWER_CONTROL_CONFIG_COMMON::alpha. +typedef enum { + al0=0, + al04=1, + al05=2, + al06=3, + al07=4, + al08=5, + al09=6, + al1=7 +} PUSCH_alpha_t; +#endif + +/// \note UNUSED +typedef enum { + deltaFm2=0, + deltaF0, + deltaF1, + deltaF2, + deltaF3, + deltaF5 +} deltaF_PUCCH_t; + +/// UplinkPowerControlCommon Information Element from 36.331 RRC spec \note this structure does not currently make use of \ref deltaFList_PUCCH_t. +typedef struct { + /// Parameter: \f$P_\text{0\_NOMINAL\_PUSCH}(1)\f$, see TS 36.213 (5.1.1.1), unit dBm. \vr{[-126..24]}\n This field is applicable for non-persistent scheduling, only. + int8_t p0_NominalPUSCH; + /// Parameter: \f$\alpha\f$, see TS 36.213 (5.1.1.1) \warning the enumeration values do not correspond to the given values in the specification (al04 should be 0.4, ...)! + PUSCH_alpha_t alpha; + /// Parameter: \f$P_\text{0\_NOMINAL\_PUCCH}\f$ See TS 36.213 (5.1.2.1), unit dBm. \vr{[-127..-96]} + int8_t p0_NominalPUCCH; + /// Parameter: \f$\Delta_\text{PREAMBLE\_Msg3}\f$ see TS 36.213 (5.1.1.1). \vr{[-1..6]}\n Actual value = IE value * 2 [dB]. + int8_t deltaPreambleMsg3; + /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 1, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value. + long deltaF_PUCCH_Format1; + /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 1a, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value. + long deltaF_PUCCH_Format1a; + /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 1b, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value. + long deltaF_PUCCH_Format1b; + /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 2, see TS 36.213 (5.1.2). \vr{[0..3]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value. + long deltaF_PUCCH_Format2; + /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 2a, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value. + long deltaF_PUCCH_Format2a; + /// Parameter: \f$\Delta_\text{F\_PUCCH}(F)\f$ for the PUCCH format 2b, see TS 36.213 (5.1.2). \vr{[0..2]} \warning check value range, why is this a long? \note the specification sais it is an enumerated value. + long deltaF_PUCCH_Format2b; +} UL_POWER_CONTROL_CONFIG_COMMON; + +/// Union for \ref TPC_PDCCH_CONFIG::tpc_Index. +typedef union { + /// Index of N when DCI format 3 is used. See TS 36.212 (5.3.3.1.6). \vr{[1..15]} + uint8_t indexOfFormat3; + /// Index of M when DCI format 3A is used. See TS 36.212 (5.3.3.1.7). \vr{[1..31]} + uint8_t indexOfFormat3A; +} TPC_INDEX_t; + +/// TPC-PDCCH-Config Information Element from 36.331 RRC spec +typedef struct { + /// RNTI for power control using DCI format 3/3A, see TS 36.212. \vr{[0..65535]} + uint16_t rnti; + /// Index of N or M, see TS 36.212 (5.3.3.1.6 and 5.3.3.1.7), where N or M is dependent on the used DCI format (i.e. format 3 or 3a). + TPC_INDEX_t tpc_Index; +} TPC_PDCCH_CONFIG; + +/// Enumeration for parameter SR transmission \ref SCHEDULING_REQUEST_CONFIG::dsr_TransMax. +typedef enum { + sr_n4=0, + sr_n8=1, + sr_n16=2, + sr_n32=3, + sr_n64=4 +} DSR_TRANSMAX_t; + +/// SchedulingRequestConfig Information Element from 36.331 RRC spec +typedef struct { + /// Parameter: \f$n^{(1)}_\text{PUCCH,SRI}\f$, see TS 36.213 (10.1). \vr{[0..2047]} + uint16_t sr_PUCCH_ResourceIndex; + /// Parameter: \f$I_\text{SR}\f$, see TS 36.213 (10.1). \vr{[0..155]} + uint8_t sr_ConfigIndex; + /// Parameter for SR transmission in TS 36.321 (5.4.4). \details The value n4 corresponds to 4 transmissions, n8 corresponds to 8 transmissions and so on. + DSR_TRANSMAX_t dsr_TransMax; +} SCHEDULING_REQUEST_CONFIG; + +/// CQI-ReportPeriodic +typedef struct { + /// Parameter: \f$n^{(2)}_\text{PUCCH}\f$, see TS 36.213 (7.2). \vr{[0..1185]}, -1 indicates inactivity + int16_t cqi_PUCCH_ResourceIndex; + /// Parameter: CQI/PMI Periodicity and Offset Configuration Index \f$I_\text{CQI/PMI}\f$, see TS 36.213 (tables 7.2.2-1A and 7.2.2-1C). \vr{[0..1023]} + int16_t cqi_PMI_ConfigIndex; + /// Parameter: K, see 36.213 (4.2.2). \vr{[1..4]} + uint8_t K; + /// Parameter: RI Config Index \f$I_\text{RI}\f$, see TS 36.213 (7.2.2-1B). \vr{[0..1023]}, -1 indicates inactivity + int16_t ri_ConfigIndex; + /// Parameter: Simultaneous-AN-and-CQI, see TS 36.213 (10.1). \vr{[0..1]} 1 indicates that simultaneous transmission of ACK/NACK and CQI is allowed. + uint8_t simultaneousAckNackAndCQI; + /// parameter computed from Tables 7.2.2-1A and 7.2.2-1C + uint16_t Npd; + /// parameter computed from Tables 7.2.2-1A and 7.2.2-1C + uint16_t N_OFFSET_CQI; +} CQI_REPORTPERIODIC; + +/// Enumeration for parameter reporting mode \ref CQI_REPORT_CONFIG::cqi_ReportModeAperiodic. +typedef enum { + rm12=0, + rm20=1, + rm22=2, + rm30=3, + rm31=4 +} CQI_REPORTMODEAPERIODIC; + +/// CQI-ReportConfig Information Element from 36.331 RRC spec +typedef struct { + /// Parameter: reporting mode. Value rm12 corresponds to Mode 1-2, rm20 corresponds to Mode 2-0, rm22 corresponds to Mode 2-2 etc. PUSCH reporting modes are described in TS 36.213 [23, 7.2.1]. + CQI_REPORTMODEAPERIODIC cqi_ReportModeAperiodic; + /// Parameter: \f$\Delta_\text{offset}\f$, see TS 36.213 (7.2.3). \vr{[-1..6]}\n Actual value = IE value * 2 [dB]. + int8_t nomPDSCH_RS_EPRE_Offset; + CQI_REPORTPERIODIC CQI_ReportPeriodic; +} CQI_REPORT_CONFIG; + +/// MBSFN-SubframeConfig Information Element from 36.331 RRC spec \note deviates from specification. +typedef struct { + /// MBSFN subframe occurance. \details Radio-frames that contain MBSFN subframes occur when equation SFN mod radioFrameAllocationPeriod = radioFrameAllocationOffset is satisfied. When fourFrames is used for subframeAllocation, the equation defines the first radio frame referred to in the description below. Values n1 and n2 are not applicable when fourFrames is used. \note the specification sais it is an enumerated value {n1, n2, n4, n8, n16, n32}. + int radioframeAllocationPeriod; + /// MBSFN subframe occurance. \vr{[0..7]}\n Radio-frames that contain MBSFN subframes occur when equation SFN mod radioFrameAllocationPeriod = radioFrameAllocationOffset is satisfied. When fourFrames is used for subframeAllocation, the equation defines the first radio frame referred to in the description below. Values n1 and n2 are not applicable when fourFrames is used. + int radioframeAllocationOffset; + /// oneFrame or fourFrames. \vr{[0..1]} + int fourFrames_flag; + /// Subframe configuration. \vr{[0..63]} (\ref fourFrames_flag == 0) or \vr{[0..16777215]} (\ref fourFrames_flag == 1) + /// \par fourFrames_flag == 0 + /// "1" denotes that the corresponding subframe is allocated for MBSFN. The following mapping applies:\n FDD: The first/leftmost bit defines the MBSFN allocation for subframe #1, the second bit for #2, third bit for #3 , fourth bit for #6, fifth bit for #7, sixth bit for #8.\n TDD: The first/leftmost bit defines the allocation for subframe #3, the second bit for #4, third bit for #7, fourth bit for #8, fifth bit for #9. Uplink subframes are not allocated. The last bit is not used. + /// \par fourFrames_flag == 1 + /// A bit-map indicating MBSFN subframe allocation in four consecutive radio frames, "1" denotes that the corresponding subframe is allocated for MBSFN. The bitmap is interpreted as follows:\n FDD: Starting from the first radioframe and from the first/leftmost bit in the bitmap, the allocation applies to subframes #1, #2, #3 , #6, #7, and #8 in the sequence of the four radio-frames.\n TDD: Starting from the first radioframe and from the first/leftmost bit in the bitmap, the allocation applies to subframes #3, #4, #7, #8, and #9 in the sequence of the four radio-frames. The last four bits are not used. Uplink subframes are not allocated. + int mbsfn_SubframeConfig; +} MBSFN_config_t; + +typedef struct { + /// Number of resource blocks (RB) in DL + uint8_t N_RB_DL; + /// Number of resource blocks (RB) in UL + uint8_t N_RB_UL; + /// EUTRA Band + uint8_t eutra_band; + /// DL carrier frequency + uint32_t dl_CarrierFreq; + /// UL carrier frequency + uint32_t ul_CarrierFreq; + /// TX attenuation + uint32_t att_tx; + /// RX attenuation + uint32_t att_rx; + /// total Number of Resource Block Groups: this is ceil(N_PRB/P) + uint8_t N_RBG; + /// Total Number of Resource Block Groups SubSets: this is P + uint8_t N_RBGS; + /// Cell ID + uint16_t Nid_cell; + /// MBSFN Area ID + uint16_t Nid_cell_mbsfn; + /// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP) + lte_prefix_type_t Ncp; + /// Cyclic Prefix for UL (0=Normal CP, 1=Extended CP) + lte_prefix_type_t Ncp_UL; + /// shift of pilot position in one RB + uint8_t nushift; + /// Frame type (0 FDD, 1 TDD) + lte_frame_type_t frame_type; + /// TDD subframe assignment (0-7) (default = 3) (254=RX only, 255=TX only) + uint8_t tdd_config; + /// TDD S-subframe configuration (0-9) + uint8_t tdd_config_S; + /// srs extra symbol flag for TDD + uint8_t srsX; + /// indicates if node is a UE (NODE=2) or eNB (PRIMARY_CH=0). + uint8_t node_id; + /// Indicator that 20 MHz channel uses 3/4 sampling frequency + uint8_t threequarter_fs; + /// Size of FFT + uint16_t ofdm_symbol_size; + /// Number of prefix samples in all but first symbol of slot + uint16_t nb_prefix_samples; + /// Number of prefix samples in first symbol of slot + uint16_t nb_prefix_samples0; + /// Carrier offset in FFT buffer for first RE in PRB0 + uint16_t first_carrier_offset; + /// Number of samples in a subframe + uint32_t samples_per_tti; + /// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL) + uint16_t symbols_per_tti; + /// Number of OFDM symbols in DL portion of S-subframe + uint16_t dl_symbols_in_S_subframe; + /// Number of SC-FDMA symbols in UL portion of S-subframe + uint16_t ul_symbols_in_S_subframe; + /// Number of Physical transmit antennas in node + uint8_t nb_antennas_tx; + /// Number of Receive antennas in node + uint8_t nb_antennas_rx; + /// Number of common transmit antenna ports in eNodeB (1 or 2) + uint8_t nb_antenna_ports_eNB; + /// PRACH_CONFIG + PRACH_CONFIG_COMMON prach_config_common; +#ifdef Rel14 + /// PRACH_eMTC_CONFIG + PRACH_eMTC_CONFIG_COMMON prach_emtc_config_common; +#endif + /// PUCCH Config Common (from 36-331 RRC spec) + PUCCH_CONFIG_COMMON pucch_config_common; + /// PDSCH Config Common (from 36-331 RRC spec) + PDSCH_CONFIG_COMMON pdsch_config_common; + /// PUSCH Config Common (from 36-331 RRC spec) + PUSCH_CONFIG_COMMON pusch_config_common; + /// PHICH Config (from 36-331 RRC spec) + PHICH_CONFIG_COMMON phich_config_common; + /// SRS Config (from 36-331 RRC spec) + SOUNDINGRS_UL_CONFIG_COMMON soundingrs_ul_config_common; + /// UL Power Control (from 36-331 RRC spec) + UL_POWER_CONTROL_CONFIG_COMMON ul_power_control_config_common; + /// Number of MBSFN Configurations + int num_MBSFN_config; + /// Array of MBSFN Configurations (max 8 (maxMBSFN-Allocations) elements as per 36.331) + MBSFN_config_t MBSFN_config[8]; + /// Maximum Number of Retransmissions of RRCConnectionRequest (from 36-331 RRC Spec) + uint8_t maxHARQ_Msg3Tx; + /// Size of SI windows used for repetition of one SI message (in frames) + uint8_t SIwindowsize; + /// Period of SI windows used for repetition of one SI message (in frames) + uint16_t SIPeriod; + /// REGs assigned to PCFICH + uint16_t pcfich_reg[4]; + /// Index of first REG assigned to PCFICH + uint8_t pcfich_first_reg_idx; + /// REGs assigned to PHICH + uint16_t phich_reg[MAX_NUM_PHICH_GROUPS][3]; + + struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[MAX_MBSFN_AREA]; + +} LTE_DL_FRAME_PARMS; + +typedef enum { + /// TM1 + SISO=0, + /// TM2 + ALAMOUTI=1, + /// TM3 + LARGE_CDD=2, + /// the next 6 entries are for TM5 + UNIFORM_PRECODING11=3, + UNIFORM_PRECODING1m1=4, + UNIFORM_PRECODING1j=5, + UNIFORM_PRECODING1mj=6, + PUSCH_PRECODING0=7, + PUSCH_PRECODING1=8, + /// the next 3 entries are for TM4 + DUALSTREAM_UNIFORM_PRECODING1=9, + DUALSTREAM_UNIFORM_PRECODINGj=10, + DUALSTREAM_PUSCH_PRECODING=11, + TM7=12, + TM8=13, + TM9_10=14 +} MIMO_mode_t; + + +typedef enum { + /// MRT + MRT=0, + /// ZF + ZF=1, + /// MMSE + MMSE=2 +} PRECODE_TYPE_t; + +typedef struct { + /// \brief Pointers (dynamic) to the received data in the time domain. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[ + int32_t **rxdata; + /// \brief Pointers (dynamic) to the received data in the frequency domain. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[ + int32_t **rxdataF; + /// \brief holds the transmit data in the frequency domain. + /// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. //? + /// - first index: eNB id [0..2] (hard coded) + /// - second index: tx antenna [0..14[ where 14 is the total supported antenna ports. + /// - third index: sample [0..] + int32_t **txdataF; +} LTE_eNB_COMMON; + +typedef struct { + /// \brief Holds the transmit data in the frequency domain. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[ + int32_t **txdata; + /// \brief holds the transmit data after beamforming in the frequency domain. + /// - first index: tx antenna [0..nb_antennas_tx[ + /// - second index: sample [0..] + int32_t **txdataF_BF; + /// \brief holds the transmit data before beamforming for epdcch/mpdcch + /// - first index : tx antenna [0..nb_epdcch_antenna_ports[ + /// - second index: sampl [0..] + int32_t **txdataF_epdcch; + /// \brief Holds the receive data in the frequency domain. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[ + int32_t **rxdata; + /// \brief Holds the last subframe of received data in time domain after removal of 7.5kHz frequency offset. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: sample [0..samples_per_tti[ + int32_t **rxdata_7_5kHz; + /// \brief Holds the received data in the frequency domain. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[ + int32_t **rxdataF; + /// \brief Holds output of the sync correlator. + /// - first index: sample [0..samples_per_tti*10[ + uint32_t *sync_corr; + /// \brief Holds the tdd reciprocity calibration coefficients + /// - first index: eNB id [0..2] (hard coded) + /// - second index: tx antenna [0..nb_antennas_tx[ + /// - third index: frequency [0..] + int32_t **tdd_calib_coeffs; +} RU_COMMON; + +typedef enum {format0, + format1, + format1A, + format1B, + format1C, + format1D, + format1E_2A_M10PRB, + format2, + format2A, + format2B, + format2C, + format2D, + format3, + format3A, + format4, + format5, + format6_0A, + format6_0B, + format6_1A, + format6_1B, + format6_2 + } DCI_format_t; + +typedef struct { + /// Length of DCI in bits + uint8_t dci_length; + /// Aggregation level + uint8_t L; + /// Position of first CCE of the dci + int firstCCE; + /// flag to indicate that this is a RA response + boolean_t ra_flag; + /// rnti + rnti_t rnti; + /// harq_pid + rnti_t harq_pid; + /// Format + DCI_format_t format; + /// DCI pdu + uint8_t dci_pdu[8]; +} DCI_ALLOC_t; + +#define MAX_EPDCCH_PRB 8 + +typedef struct { + /// Length of DCI in bits + uint8_t dci_length; + /// Aggregation level + uint8_t L; + /// Position of first CCE of the dci + int firstCCE; + /// flag to indicate that this is a RA response + boolean_t ra_flag; + /// rnti + rnti_t rnti; + /// Format + DCI_format_t format; + /// epdcch resource assignment (0=localized,1=distributed) + uint8_t epdcch_resource_assignment_flag; + /// epdcch index + uint16_t epdcch_id; + /// epdcch start symbol + uint8_t epdcch_start_symbol; + /// epdcch number of PRBs in set + uint8_t epdcch_num_prb; + /// vector of prb ids for set + uint8_t epdcch_prb_index[MAX_EPDCCH_PRB]; + /// LBT parameter for frame configuration + uint8_t dwpts_symbols; + /// LBT parameter for frame configuration + uint8_t initial_lbt_sf; + /// DCI pdu + uint8_t dci_pdu[8]; +} eDCI_ALLOC_t; + +typedef struct { + /// Length of DCI in bits + uint8_t dci_length; + /// Aggregation level + uint8_t L; + /// Position of first CCE of the dci + int firstCCE; + /// flag to indicate that this is a RA response + boolean_t ra_flag; + /// rnti + rnti_t rnti; + /// Format + DCI_format_t format; + /// harq process index + uint8_t harq_pid; + /// Narrowband index + uint8_t narrowband; + /// number of PRB pairs for MPDCCH + uint8_t number_of_prb_pairs; + /// mpdcch resource assignment (combinatorial index r) + uint8_t resource_block_assignment; + /// transmission type (0=localized,1=distributed) + uint8_t transmission_type; + /// mpdcch start symbol + uint8_t start_symbol; + /// CE mode (1=ModeA,2=ModeB) + uint8_t ce_mode; + /// 0-503 n_EPDCCHid_i + uint16_t dmrs_scrambling_init; + /// Absolute subframe of the initial transmission (0-10239) + uint16_t i0; + /// number of mdpcch repetitions + uint16_t reps; + /// current absolute subframe number + uint16_t absSF; + /// DCI pdu + uint8_t dci_pdu[8]; +} mDCI_ALLOC_t; + + +typedef struct { + uint8_t num_dci; + uint8_t num_pdcch_symbols; + DCI_ALLOC_t dci_alloc[32]; +} LTE_eNB_PDCCH; + +typedef struct { + uint8_t hi; + uint8_t first_rb; + uint8_t n_DMRS; +} phich_config_t; + +typedef struct { + uint8_t num_hi; + phich_config_t config[32]; +} LTE_eNB_PHICH; + +typedef struct { + uint8_t num_dci; + eDCI_ALLOC_t edci_alloc[32]; +} LTE_eNB_EPDCCH; + +typedef struct { + /// number of active MPDCCH allocations + uint8_t num_dci; + /// MPDCCH DCI allocations from MAC + mDCI_ALLOC_t mdci_alloc[32]; + // MAX SIZE of an EPDCCH set is 16EREGs * 9REs/EREG * 8 PRB pairs = 2304 bits + uint8_t e[2304]; +} LTE_eNB_MPDCCH; + + +typedef struct { + /// \brief Hold the channel estimates in frequency domain based on SRS. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..ofdm_symbol_size[ + int32_t **srs_ch_estimates; + /// \brief Hold the channel estimates in time domain based on SRS. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..2*ofdm_symbol_size[ + int32_t **srs_ch_estimates_time; + /// \brief Holds the SRS for channel estimation at the RX. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..ofdm_symbol_size[ + int32_t *srs; +} LTE_eNB_SRS; + +typedef struct { + /// \brief Holds the received data in the frequency domain for the allocated RBs in repeated format. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..2*ofdm_symbol_size[ + int32_t **rxdataF_ext; + /// \brief Holds the received data in the frequency domain for the allocated RBs in normal format. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index (definition from phy_init_lte_eNB()): ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[ + int32_t **rxdataF_ext2; + /// \brief Hold the channel estimates in time domain based on DRS. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..4*ofdm_symbol_size[ + int32_t **drs_ch_estimates_time; + /// \brief Hold the channel estimates in frequency domain based on DRS. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[ + int32_t **drs_ch_estimates; + /// \brief Holds the compensated signal. + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[ + int32_t **rxdataF_comp; + /// \brief Magnitude of the UL channel estimates. Used for 2nd-bit level thresholds in LLR computation + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[ + int32_t **ul_ch_mag; + /// \brief Magnitude of the UL channel estimates scaled for 3rd bit level thresholds in LLR computation + /// - first index: rx antenna id [0..nb_antennas_rx[ + /// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[ + int32_t **ul_ch_magb; + /// measured RX power based on DRS + int ulsch_power[2]; + /// \brief llr values. + /// - first index: ? [0..1179743] (hard coded) + int16_t *llr; +} LTE_eNB_PUSCH; + +typedef struct { + + /// \brief Holds the received data in the frequency domain. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: symbol [0..28*ofdm_symbol_size[ + int32_t **rxdataF; + + /// \brief Hold the channel estimates in frequency domain. + /// - first index: eNB id [0..6] (hard coded) + /// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - third index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[ + int32_t **dl_ch_estimates[7]; + + /// \brief Hold the channel estimates in time domain (used for tracking). + /// - first index: eNB id [0..6] (hard coded) + /// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - third index: samples? [0..2*ofdm_symbol_size[ + int32_t **dl_ch_estimates_time[7]; +}LTE_UE_COMMON_PER_THREAD; + +typedef struct { + /// \brief Holds the transmit data in time domain. + /// For IFFT_FPGA this points to the same memory as PHY_vars->tx_vars[a].TX_DMA_BUFFER. + /// - first index: tx antenna [0..nb_antennas_tx[ + /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES[ + int32_t **txdata; + /// \brief Holds the transmit data in the frequency domain. + /// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. + /// - first index: tx antenna [0..nb_antennas_tx[ + /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[ + int32_t **txdataF; + + /// \brief Holds the received data in time domain. + /// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES+2048[ + int32_t **rxdata; + + LTE_UE_COMMON_PER_THREAD common_vars_rx_data_per_thread[RX_NB_TH_MAX]; + + /// holds output of the sync correlator + int32_t *sync_corr; + /// estimated frequency offset (in radians) for all subcarriers + int32_t freq_offset; + /// eNb_id user is synched to + int32_t eNb_id; +} LTE_UE_COMMON; + +typedef struct { + /// \brief Received frequency-domain signal after extraction. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **rxdataF_ext; + /// \brief Received frequency-domain ue specific pilots. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..12*N_RB_DL[ + int32_t **rxdataF_uespec_pilots; + /// \brief Received frequency-domain signal after extraction and channel compensation. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **rxdataF_comp0; + /// \brief Received frequency-domain signal after extraction and channel compensation for the second stream. For the SIC receiver we need to store the history of this for each harq process and round + /// - first index: ? [0..7] (hard coded) accessed via \c harq_pid + /// - second index: ? [0..7] (hard coded) accessed via \c round + /// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - fourth index: ? [0..168*N_RB_DL[ + int32_t **rxdataF_comp1[8][8]; + /// \brief Downlink channel estimates extracted in PRBS. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **dl_ch_estimates_ext; + /// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. For the SIC receiver we need to store the history of this for each harq process and round + /// - first index: ? [0..7] (hard coded) accessed via \c harq_pid + /// - second index: ? [0..7] (hard coded) accessed via \c round + /// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - fourth index: ? [0..168*N_RB_DL[ + int32_t **dl_ch_rho_ext[8][8]; + /// \brief Downlink beamforming channel estimates in frequency domain. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[ + int32_t **dl_bf_ch_estimates; + /// \brief Downlink beamforming channel estimates. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **dl_bf_ch_estimates_ext; + /// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **dl_ch_rho2_ext; + /// \brief Downlink PMIs extracted in PRBS and grouped in subbands. + /// - first index: ressource block [0..N_RB_DL[ + uint8_t *pmi_ext; + /// \brief Magnitude of Downlink Channel first layer (16QAM level/First 64QAM level). + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **dl_ch_mag0; + /// \brief Magnitude of Downlink Channel second layer (16QAM level/First 64QAM level). + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **dl_ch_mag1[8][8]; + /// \brief Magnitude of Downlink Channel, first layer (2nd 64QAM level). + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **dl_ch_magb0; + /// \brief Magnitude of Downlink Channel second layer (2nd 64QAM level). + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **dl_ch_magb1[8][8]; + /// \brief Cross-correlation of two eNB signals. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: symbol [0..] + int32_t **rho; + /// never used... always send dl_ch_rho_ext instead... + int32_t **rho_i; + /// \brief Pointers to llr vectors (2 TBs). + /// - first index: ? [0..1] (hard coded) + /// - second index: ? [0..1179743] (hard coded) + int16_t *llr[2]; + /// \f$\log_2(\max|H_i|^2)\f$ + int16_t log2_maxh; + /// \f$\log_2(\max|H_i|^2)\f$ //this is for TM3-4 layer1 channel compensation + int16_t log2_maxh0; + /// \f$\log_2(\max|H_i|^2)\f$ //this is for TM3-4 layer2 channel commpensation + int16_t log2_maxh1; + /// \brief LLR shifts for subband scaling. + /// - first index: ? [0..168*N_RB_DL[ + uint8_t *llr_shifts; + /// \brief Pointer to LLR shifts. + /// - first index: ? [0..168*N_RB_DL[ + uint8_t *llr_shifts_p; + /// \brief Pointers to llr vectors (128-bit alignment). + /// - first index: ? [0..0] (hard coded) + /// - second index: ? [0..] + int16_t **llr128; + /// \brief Pointers to llr vectors (128-bit alignment). + /// - first index: ? [0..0] (hard coded) + /// - second index: ? [0..] + int16_t **llr128_2ndstream; + //uint32_t *rb_alloc; + //uint8_t Qm[2]; + //MIMO_mode_t mimo_mode; + // llr offset per ofdm symbol + uint32_t llr_offset[14]; + // llr length per ofdm symbol + uint32_t llr_length[14]; +} LTE_UE_PDSCH; + +typedef struct { + /// \brief Received frequency-domain signal after extraction. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..] + int32_t **rxdataF_ext; + /// \brief Received frequency-domain signal after extraction and channel compensation. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..] + double **rxdataF_comp; + /// \brief Downlink channel estimates extracted in PRBS. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..] + int32_t **dl_ch_estimates_ext; + /// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..] + double **dl_ch_rho_ext; + /// \brief Downlink PMIs extracted in PRBS and grouped in subbands. + /// - first index: ressource block [0..N_RB_DL[ + uint8_t *pmi_ext; + /// \brief Magnitude of Downlink Channel (16QAM level/First 64QAM level). + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..] + double **dl_ch_mag; + /// \brief Magnitude of Downlink Channel (2nd 64QAM level). + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..] + double **dl_ch_magb; + /// \brief Cross-correlation of two eNB signals. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: ? [0..] + double **rho; + /// never used... always send dl_ch_rho_ext instead... + double **rho_i; + /// \brief Pointers to llr vectors (2 TBs). + /// - first index: ? [0..1] (hard coded) + /// - second index: ? [0..1179743] (hard coded) + int16_t *llr[2]; + /// \f$\log_2(\max|H_i|^2)\f$ + uint8_t log2_maxh; + /// \brief Pointers to llr vectors (128-bit alignment). + /// - first index: ? [0..0] (hard coded) + /// - second index: ? [0..] + int16_t **llr128; + //uint32_t *rb_alloc; + //uint8_t Qm[2]; + //MIMO_mode_t mimo_mode; +} LTE_UE_PDSCH_FLP; + +typedef struct { + /// \brief Pointers to extracted PDCCH symbols in frequency-domain. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **rxdataF_ext; + /// \brief Pointers to extracted and compensated PDCCH symbols in frequency-domain. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **rxdataF_comp; + /// \brief Pointers to extracted channel estimates of PDCCH symbols. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **dl_ch_estimates_ext; + /// \brief Pointers to channel cross-correlation vectors for multi-eNB detection. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t **dl_ch_rho_ext; + /// \brief Pointers to channel cross-correlation vectors for multi-eNB detection. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: ? [0..] + int32_t **rho; + /// \brief Pointer to llrs, 4-bit resolution. + /// - first index: ? [0..48*N_RB_DL[ + uint16_t *llr; + /// \brief Pointer to llrs, 16-bit resolution. + /// - first index: ? [0..96*N_RB_DL[ + uint16_t *llr16; + /// \brief \f$\overline{w}\f$ from 36-211. + /// - first index: ? [0..48*N_RB_DL[ + uint16_t *wbar; + /// \brief PDCCH/DCI e-sequence (input to rate matching). + /// - first index: ? [0..96*N_RB_DL[ + int8_t *e_rx; + /// number of PDCCH symbols in current subframe + uint8_t num_pdcch_symbols; + /// Allocated CRNTI for UE + uint16_t crnti; + /// 1: the allocated crnti is Temporary C-RNTI / 0: otherwise + uint8_t crnti_is_temporary; + /// Total number of PDU errors (diagnostic mode) + uint32_t dci_errors; + /// Total number of PDU received + uint32_t dci_received; + /// Total number of DCI False detection (diagnostic mode) + uint32_t dci_false; + /// Total number of DCI missed (diagnostic mode) + uint32_t dci_missed; + /// nCCE for PUCCH per subframe + uint8_t nCCE[10]; + //Check for specific DCIFormat and AgregationLevel + uint8_t dciFormat; + uint8_t agregationLevel; +} LTE_UE_PDCCH; + +#define PBCH_A 24 +typedef struct { + uint8_t pbch_d[96+(3*(16+PBCH_A))]; + uint8_t pbch_w[3*3*(16+PBCH_A)]; + uint8_t pbch_e[1920]; +} LTE_eNB_PBCH; + +typedef struct { + /// \brief Pointers to extracted PBCH symbols in frequency-domain. + /// - first index: rx antenna [0..nb_antennas_rx[ + /// - second index: ? [0..287] (hard coded) + int32_t **rxdataF_ext; + /// \brief Pointers to extracted and compensated PBCH symbols in frequency-domain. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..287] (hard coded) + int32_t **rxdataF_comp; + /// \brief Pointers to downlink channel estimates in frequency-domain extracted in PRBS. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..287] (hard coded) + int32_t **dl_ch_estimates_ext; + /// \brief Pointer to PBCH llrs. + /// - first index: ? [0..1919] (hard coded) + int8_t *llr; + /// \brief Pointer to PBCH decoded output. + /// - first index: ? [0..63] (hard coded) + uint8_t *decoded_output; + /// \brief Total number of PDU errors. + uint32_t pdu_errors; + /// \brief Total number of PDU errors 128 frames ago. + uint32_t pdu_errors_last; + /// \brief Total number of consecutive PDU errors. + uint32_t pdu_errors_conseq; + /// \brief FER (in percent) . + uint32_t pdu_fer; +} LTE_UE_PBCH; + +typedef struct { + int16_t amp; + int16_t *prachF; + int16_t *prach; +} LTE_UE_PRACH; + +#define MAX_NUM_RX_PRACH_PREAMBLES 4 + +typedef struct { + /// \brief ?. + /// first index: ? [0..1023] (hard coded) + int16_t *prachF; + /// \brief ?. + /// first index: ce_level [0..3] + /// second index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx. + /// third index: frequency-domain sample [0..ofdm_symbol_size*12[ + int16_t **rxsigF[4]; + /// \brief local buffer to compute prach_ifft (necessary in case of multiple CCs) + /// first index: ce_level [0..3] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx. + /// second index: ? [0..63] (hard coded) + /// third index: ? [0..63] (hard coded) + int32_t **prach_ifft[4]; + + /// repetition number +#ifdef Rel14 + /// indicator of first frame in a group of PRACH repetitions + int first_frame[4]; + /// current repetition for each CE level + int repetition_number[4]; +#endif +} LTE_eNB_PRACH; + +typedef struct { + /// Preamble index for PRACH (0-63) + uint8_t ra_PreambleIndex; + /// RACH MaskIndex + uint8_t ra_RACH_MaskIndex; + /// Target received power at eNB (-120 ... -82 dBm) + int8_t ra_PREAMBLE_RECEIVED_TARGET_POWER; + /// PRACH index for TDD (0 ... 6) depending on TDD configuration and prachConfigIndex + uint8_t ra_TDD_map_index; + /// Corresponding RA-RNTI for UL-grant + uint16_t ra_RNTI; + /// Pointer to Msg3 payload for UL-grant + uint8_t *Msg3; +} PRACH_RESOURCES_t; + + +typedef struct { + /// Downlink Power offset field + uint8_t dl_pow_off; + ///Subband resource allocation field + uint8_t rballoc_sub[50]; + ///Total number of PRBs indicator + uint8_t pre_nb_available_rbs; +} MU_MIMO_mode; + +typedef enum { + NOT_SYNCHED=0, + PRACH=1, + RA_RESPONSE=2, + PUSCH=3, + RESYNCH=4 +} UE_MODE_t; + + + +typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t; + +typedef enum { + /// do not detect any DCIs in the current subframe + NO_DCI = 0x0, + /// detect only downlink DCIs in the current subframe + UL_DCI = 0x1, + /// detect only uplink DCIs in the current subframe + DL_DCI = 0x2, + /// detect both uplink and downlink DCIs in the current subframe + UL_DL_DCI = 0x3} dci_detect_mode_t; + +#endif diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 776277e3b8ae106b3c63a2285d16096be6e1d2a8..52b651fc25ca775111fa830ddced170dc6456ec7 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -86,7 +86,7 @@ void nr_feptx0(RU_t *ru,int slot) { void nr_feptx_ofdm_2thread(RU_t *ru) { NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms; - nfapi_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; + nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; RU_proc_t *proc = &ru->proc; struct timespec wait; int subframe = ru->proc.subframe_tx; @@ -185,7 +185,7 @@ void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx) { void nr_feptx_ofdm(RU_t *ru) { NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms; - nfapi_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; + nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; unsigned int aa,slot_offset, slot_offset_F; int dummy_tx_b[7680*4] __attribute__((aligned(32))); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 6d7651ca6c63b9bb065211449d864eebf4bd628e..69599ce180ee0b900f8d7f3f8725a3d187862dc4 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -76,7 +76,7 @@ int return_ssb_type(nfapi_config_request_t *cfg) }*/ // First SSB starting symbol candidate is used and type B is chosen for 30kHz SCS -int nr_get_ssb_start_symbol(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp) +int nr_get_ssb_start_symbol(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp) { int mu = cfg->subframe_config.numerology_index_mu.value; int symbol = 0; @@ -109,7 +109,7 @@ int nr_get_ssb_start_symbol(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp) return symbol; } -void nr_set_ssb_first_subcarrier(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp) +void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp) { int start_rb = cfg->sch_config.n_ssb_crb.value / pow(2,cfg->subframe_config.numerology_index_mu.value); fp->ssb_start_subcarrier = 12 * start_rb + cfg->sch_config.ssb_subcarrier_offset.value; @@ -119,20 +119,17 @@ void nr_set_ssb_first_subcarrier(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) { NR_DL_FRAME_PARMS *fp=&gNB->frame_parms; - nfapi_config_request_t *cfg = &gNB->gNB_config; + nfapi_nr_config_request_t *cfg = &gNB->gNB_config; int **txdataF = gNB->common_vars.txdataF; uint8_t *pbch_pdu=&gNB->pbch_pdu[0]; int ss_subframe = (cfg->sch_config.half_frame_index.value)? 5 : 0; - int sfn = 10*frame + subframe; - int frame_mod8 = frame&7; - uint8_t Lmax, nushift, ssb_index=0, n_hf=0; + uint8_t Lmax, ssb_index=0, n_hf=0; LOG_D(PHY,"common_signal_procedures: frame %d, subframe %d\n",frame,subframe); int ssb_start_symbol = nr_get_ssb_start_symbol(cfg, fp); nr_set_ssb_first_subcarrier(cfg, fp); Lmax = (fp->dl_CarrierFreq < 3e9)? 4:8; - nushift = (Lmax < 8)? ssb_index&3 : ssb_index&7; if (subframe == ss_subframe) @@ -147,8 +144,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) { if (gNB->pbch_configured != 1)return; gNB->pbch_configured = 0; }*/ - nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],txdataF, AMP_OVER_2, ssb_start_symbol, nushift, cfg, fp); - nr_generate_pbch(&gNB->pbch, pbch_pdu, txdataF, AMP_OVER_2, ssb_start_symbol, nushift, sfn, n_hf, frame_mod8, cfg, fp); + nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],txdataF, AMP_OVER_2, ssb_start_symbol, cfg, fp); + nr_generate_pbch(&gNB->pbch, pbch_pdu, txdataF, AMP_OVER_2, ssb_start_symbol, n_hf, Lmax, ssb_index, frame, cfg, fp); } } @@ -162,7 +159,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, int subframe=proc->subframe_tx; NR_DL_FRAME_PARMS *fp=&gNB->frame_parms; - nfapi_config_request_t *cfg = &gNB->gNB_config; + nfapi_nr_config_request_t *cfg = &gNB->gNB_config; int offset = gNB->CC_id; diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index b7d71cfc17d6d1cfd97b3d75216d78dd5e6bec17..bd89c169236796ea66417bab30c6188a52e70df8 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -33,8 +33,9 @@ #include "SCHED/sched_eNB.h" #include "PHY/NR_TRANSPORT/nr_dci.h" -lte_subframe_t nr_subframe_select (nfapi_config_request_t *cfg, unsigned char subframe); -void nr_set_ssb_first_subcarrier(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp); + +lte_subframe_t nr_subframe_select (nfapi_nr_config_request_t *cfg, unsigned char subframe); +void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp); void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_rxtx_proc_t *proc, int do_meas); void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx); void nr_feptx_ofdm(RU_t *ru); diff --git a/openair1/SCHED_NR_UE/fapi_l1.c b/openair1/SCHED_NR_UE/fapi_l1.c new file mode 100644 index 0000000000000000000000000000000000000000..b3ee5ca44485c8021b407fded9400a597ee49684 --- /dev/null +++ b/openair1/SCHED_NR_UE/fapi_l1.c @@ -0,0 +1,863 @@ +/* + * 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 fapi_l1.c + * \brief functions for FAPI L1 interface + * \author R. Knopp + * \date 2017 + * \version 0.1 + * \company Eurecom + * \email: knopp@eurecom.fr + * \note + * \warning + */ + +#include "PHY/defs_eNB.h" +#include "PHY/LTE_TRANSPORT/transport_proto.h" +#include "SCHED/sched_eNB.h" + +#include "nfapi_interface.h" +#include "fapi_l1.h" + +int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req); +int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req); +int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req); +int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req); + +extern uint8_t nfapi_mode; + + +void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, + int frame, int subframe, + eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu) +{ + int idx = subframe&1; + LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; + nfapi_dl_config_dci_dl_pdu *pdu = &dl_config_pdu->dci_dl_pdu; + + LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populating pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",frame,subframe, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci); + + // copy dci configuration into eNB structure + fill_dci_and_dlsch(eNB,frame,subframe,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu); + + LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populated pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",proc->frame_tx,proc->subframe_tx, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci); +} + +#ifdef Rel14 + +void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB, + eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu) +{ + int idx = proc->subframe_tx&1; + LTE_eNB_MPDCCH *mpdcch_vars = &eNB->mpdcch_vars[idx]; + nfapi_dl_config_mpdcch_pdu *pdu = &dl_config_pdu->mpdcch_pdu; + + LOG_D(PHY,"Frame %d, Subframe %d: MDCI processing\n",proc->frame_tx,proc->subframe_tx); + + // copy dci configuration into eNB structure + fill_mdci_and_dlsch(eNB,proc,&mpdcch_vars->mdci_alloc[mpdcch_vars->num_dci],pdu); +} + +#endif + +void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) +{ + int idx = subframe&1; + LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; + + //LOG_D(PHY,"%s() SFN/SF:%04d%d Before num_dci:%d\n", __FUNCTION__,frame,subframe,pdcch_vars->num_dci); + + // copy dci configuration in to eNB structure + fill_dci0(eNB,frame,subframe,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu); +} + +void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu) +{ + LTE_eNB_PHICH *phich = &eNB->phich_vars[subframe&1]; + + // copy dci configuration in to eNB structure + LOG_D(PHY,"Received HI PDU with value %d (rbstart %d,cshift %d)\n", + hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value, + hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start, + hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms); + + // DJP - TODO FIXME - transmission power ignored + phich->config[phich->num_hi].hi = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value; + phich->config[phich->num_hi].first_rb = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start; + phich->config[phich->num_hi].n_DMRS = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms; + phich->num_hi++; + AssertFatal(phich->num_hi<32,"Maximum number of phich reached in subframe\n"); +} + +void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t *sdu) +{ + nfapi_dl_config_bch_pdu_rel8_t *rel8 = &dl_config_pdu->bch_pdu.bch_pdu_rel8; + + AssertFatal(rel8->length == 3, "BCH PDU has length %d != 3\n",rel8->length); + + //LOG_D(PHY,"bch_pdu: %x,%x,%x\n",sdu[0],sdu[1],sdu[2]); + eNB->pbch_pdu[0] = sdu[2]; + eNB->pbch_pdu[1] = sdu[1]; + eNB->pbch_pdu[2] = sdu[0]; + + // adjust transmit amplitude here based on NFAPI info +} + +#ifdef Rel14 +extern uint32_t localRIV2alloc_LUT6[32]; +extern uint32_t localRIV2alloc_LUT25[512]; +extern uint32_t localRIV2alloc_LUT50_0[1600]; +extern uint32_t localRIV2alloc_LUT50_1[1600]; +extern uint32_t localRIV2alloc_LUT100_0[6000]; +extern uint32_t localRIV2alloc_LUT100_1[6000]; +extern uint32_t localRIV2alloc_LUT100_2[6000]; +extern uint32_t localRIV2alloc_LUT100_3[6000]; +#endif + +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t codeword_index, + uint8_t *sdu) +{ + nfapi_dl_config_dlsch_pdu_rel8_t *rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8; +#ifndef Rel8 + nfapi_dl_config_dlsch_pdu_rel10_t *rel10 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10; +#endif +#ifdef Rel14 + nfapi_dl_config_dlsch_pdu_rel13_t *rel13 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13; +#endif + LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; + LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL; + int UE_id; + int harq_pid; + + UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE); + AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n"); + AssertFatal(UE_id<NUMBER_OF_UE_MAX,"returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX); + + dlsch0 = eNB->dlsch[UE_id][0]; + dlsch1 = eNB->dlsch[UE_id][1]; + +#ifdef Rel14 + if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[subframe] = 0; +#endif + + harq_pid = dlsch0->harq_ids[subframe]; + AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7 frame:%d subframe:%d subframe(TX):%d rnti:%x UE_id:%d dlsch0[harq_ids:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d]\n", + harq_pid, + frame,subframe, + proc->subframe_tx,rel8->rnti,UE_id, + dlsch0->harq_ids[0], + dlsch0->harq_ids[1], + dlsch0->harq_ids[2], + dlsch0->harq_ids[3], + dlsch0->harq_ids[4], + dlsch0->harq_ids[5], + dlsch0->harq_ids[6], + dlsch0->harq_ids[7], + dlsch0->harq_ids[8], + dlsch0->harq_ids[9] + ); + dlsch0_harq = dlsch0->harq_processes[harq_pid]; + dlsch1_harq = dlsch1->harq_processes[harq_pid]; + AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n"); + + // compute DL power control parameters + eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa; + + if (dlsch0->active){ + computeRhoA_eNB(rel8->pa, dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB); + computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off); + } + if (dlsch1->active){ + computeRhoA_eNB(rel8->pa, dlsch1,dlsch1_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB); + computeRhoB_eNB(rel8->pa,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off); + } + + dlsch0_harq->pdsch_start = eNB->pdcch_vars[subframe & 1].num_pdcch_symbols; + + if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU + AssertFatal(sdu!=NULL,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d dlsch0_harq[round:%d SFN/SF:%d%d pdu:%p mcs:%d ndi:%d pdschstart:%d]\n", + frame,subframe, + proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid, + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe,dlsch0_harq->pdu,dlsch0_harq->mcs,dlsch0_harq->ndi,dlsch0_harq->pdsch_start); + if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d, subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d\n", + frame,subframe,proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); + if (codeword_index == 0) dlsch0_harq->pdu = sdu; + else dlsch1_harq->pdu = sdu; + } + else { + if (rel8->rnti != 0xFFFF) LOG_D(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d, subframe %d]: programming dlsch for round %d, rnti %x, UE_id %d, harq_pid %d\n", + frame,subframe,proc->frame_tx,proc->subframe_tx,dlsch0_harq->round, + rel8->rnti,UE_id,harq_pid); + } + +#ifdef Rel14 + dlsch0->sib1_br_flag=0; + + if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR + dlsch0->rnti = 0xFFFF; + dlsch0->Kmimo = 1; + dlsch0->Mdlharq = 4; + dlsch0->Nsoft = 25344; + + if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1; + + // configure PDSCH + switch (eNB->frame_parms.N_RB_DL) { + case 6: + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rel8->resource_block_coding]; + break; + case 15: + AssertFatal(1==0,"15 PRBs not supported for now\n"); + break; + case 25: + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rel8->resource_block_coding]; + break; + case 50: + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rel8->resource_block_coding]; + dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rel8->resource_block_coding]; + break; + case 75: + AssertFatal(1==0,"75 PRBs not supported for now\n"); + break; + case 100: + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rel8->resource_block_coding]; + dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rel8->resource_block_coding]; + dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rel8->resource_block_coding]; + dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rel8->resource_block_coding]; + } + + dlsch0->active = 1; + + dlsch0_harq->nb_rb = 6; + dlsch0_harq->vrb_type = LOCALIZED; + dlsch0_harq->rvidx = rel8->redundancy_version; + dlsch0_harq->Nl = 1; + dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; + dlsch0_harq->dl_power_off = 1; + dlsch0_harq->round = 0; + dlsch0_harq->status = ACTIVE; + dlsch0_harq->TBS = rel8->length<<3; + dlsch0_harq->Qm = rel8->modulation; + dlsch0_harq->codeword = 0; + dlsch0_harq->pdsch_start = rel10->pdsch_start; + } + dlsch0->i0 = rel13->initial_transmission_sf_io; +#endif + +#ifdef Rel14 + LOG_D(PHY,"dlsch->i0:%04x dlsch0_harq[pdsch_start:%d nb_rb:%d vrb_type:%d rvidx:%d Nl:%d mimo_mode:%d dl_power_off:%d round:%d status:%d TBS:%d Qm:%d codeword:%d rb_alloc:%d] rel8[length:%d]\n", + dlsch0->i0, + dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->round, dlsch0_harq->status, dlsch0_harq->TBS, dlsch0_harq->Qm, dlsch0_harq->codeword, dlsch0_harq->rb_alloc[0], + rel8->length + ); +#else + LOG_D(PHY,"dlsch0_harq[pdsch_start:%d nb_rb:%d vrb_type:%d rvidx:%d Nl:%d mimo_mode:%d dl_power_off:%d round:%d status:%d TBS:%d Qm:%d codeword:%d rb_alloc:%d] rel8[length:%d]\n", + dlsch0_harq->pdsch_start, dlsch0_harq->nb_rb, dlsch0_harq->vrb_type, dlsch0_harq->rvidx, dlsch0_harq->Nl, dlsch0_harq->mimo_mode, dlsch0_harq->dl_power_off, dlsch0_harq->round, dlsch0_harq->status, dlsch0_harq->TBS, dlsch0_harq->Qm, dlsch0_harq->codeword, dlsch0_harq->rb_alloc[0], + rel8->length + ); +#endif +} + +uint16_t to_beta_offset_harqack[16]={16,20,25,32,40,50,64,80,101,127,160,248,400,640,1008,8}; + +void handle_ulsch_harq_pdu( + PHY_VARS_eNB *eNB, + int UE_id, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + nfapi_ul_config_ulsch_harq_information *harq_information, + uint16_t frame, + uint8_t subframe) +{ + nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8; + + LTE_eNB_ULSCH_t *ulsch=eNB->ulsch[UE_id]; + LTE_UL_eNB_HARQ_t *ulsch_harq; + + int harq_pid = rel8->harq_process_number; + ulsch_harq = ulsch->harq_processes[harq_pid]; + ulsch_harq->frame = frame; + ulsch_harq->subframe = subframe; + ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; + ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; +} + +uint16_t to_beta_offset_ri[16]={9,13,16,20,25,32,40,50,64,80,101,127,160,0,0,0}; +uint16_t to_beta_offset_cqi[16]={0,0,9,10,11,13,14,16,18,20,23,25,28,32,40,50}; + +void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) +{ + nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; + + LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; + int harq_pid = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number; + LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; + + ulsch_harq->frame = frame; + ulsch_harq->subframe = subframe; + ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; + ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; + if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; + ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; + ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; + LOG_D(PHY,"Filling ulsch_cqi_ri information for frame %d, subframe %d : O_RI %d, Or1 %d, beta_offset_cqi_times8 %d (%d)\n", + frame,subframe,ulsch_harq->O_RI,ulsch_harq->Or1,ulsch->beta_offset_cqi_times8, + rel9->delta_offset_cqi); +} + +void handle_ulsch_cqi_harq_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) +{ + nfapi_ul_config_cqi_ri_information_rel9_t *rel9 = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information.cqi_ri_information_rel9; + + LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; + int harq_pid = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number; + LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; + nfapi_ul_config_ulsch_harq_information *harq_information = &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information; + + ulsch_harq->frame = frame; + ulsch_harq->subframe = subframe; + ulsch_harq->O_RI = rel9->aperiodic_cqi_pmi_ri_report.cc[0].ri_size; + ulsch_harq->Or1 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[0]; + ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size; + + if (ulsch_harq->O_RI>1) ulsch_harq->Or2 = rel9->aperiodic_cqi_pmi_ri_report.cc[0].dl_cqi_pmi_size[1]; + + ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq]; + ulsch->beta_offset_ri_times8 = to_beta_offset_ri[rel9->delta_offset_ri]; + ulsch->beta_offset_cqi_times8 = to_beta_offset_cqi[rel9->delta_offset_cqi]; +} + +void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information) +{ + if (eNB->frame_parms.frame_type == FDD) { + uci->num_pucch_resources = harq_information->harq_information_rel9_fdd.number_of_pucch_resources; + + LOG_D(PHY,"Programming UCI HARQ mode %d : size %d in (%d,%d)\n", + harq_information->harq_information_rel9_fdd.ack_nack_mode, + harq_information->harq_information_rel9_fdd.harq_size, + uci->frame,uci->subframe); + + if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && + (harq_information->harq_information_rel9_fdd.harq_size == 1)) { + uci->pucch_fmt = pucch_format1a; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && + (harq_information->harq_information_rel9_fdd.harq_size == 2)) { + uci->pucch_fmt = pucch_format1b; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && + (harq_information->harq_information_rel9_fdd.harq_size == 2)) { + uci->pucch_fmt = pucch_format1b_csA2; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && + (harq_information->harq_information_rel9_fdd.harq_size == 3)) { + uci->pucch_fmt = pucch_format1b_csA3; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + uci->n_pucch_1[2][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_2; + uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; + } + else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 1) && + (harq_information->harq_information_rel9_fdd.harq_size == 4)) { + uci->pucch_fmt = pucch_format1b_csA4; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + uci->n_pucch_1[2][0] = harq_information->harq_information_rel9_fdd.n_pucch_1_2; + uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; + } + else if (harq_information->harq_information_rel9_fdd.ack_nack_mode == 2) { + uci->pucch_fmt = pucch_format3; + uci->n_pucch_3[0] = harq_information->harq_information_rel9_fdd.n_pucch_1_0; + uci->n_pucch_3[1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel9_fdd.ack_nack_mode); + } + else { // TDD + uci->num_pucch_resources = harq_information->harq_information_rel10_tdd.number_of_pucch_resources; + + if (harq_information->harq_information_rel10_tdd.ack_nack_mode == 0) {//bundling + + uci->pucch_fmt = harq_information->harq_information_rel10_tdd.harq_size==1 ? pucch_format1a : pucch_format1b; + uci->tdd_bundling = 1; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing + (uci->num_pucch_resources == 1)) { + uci->pucch_fmt = harq_information->harq_information_rel10_tdd.harq_size==1 ? pucch_format1a : pucch_format1b; + uci->tdd_bundling = 0; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else if ((harq_information->harq_information_rel10_tdd.ack_nack_mode == 1) && //multiplexing M>1 + (uci->num_pucch_resources > 1)) { + uci->pucch_fmt = pucch_format1b; + uci->tdd_bundling = 0; + uci->n_pucch_1[0][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_1[0][1] = harq_information->harq_information_rel11.n_pucch_2_0; + uci->n_pucch_1[1][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_1; + uci->n_pucch_1[1][1] = harq_information->harq_information_rel11.n_pucch_2_1; + uci->n_pucch_1[2][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_2; + uci->n_pucch_1[2][1] = harq_information->harq_information_rel11.n_pucch_2_2; + uci->n_pucch_1[3][0] = harq_information->harq_information_rel10_tdd.n_pucch_1_3; + uci->n_pucch_1[3][1] = harq_information->harq_information_rel11.n_pucch_2_3; + } + else if (harq_information->harq_information_rel10_tdd.ack_nack_mode == 2) { + uci->pucch_fmt = pucch_format3; + uci->n_pucch_3[0] = harq_information->harq_information_rel10_tdd.n_pucch_1_0; + uci->n_pucch_3[1] = harq_information->harq_information_rel11.n_pucch_2_0; + } + else AssertFatal(1==0,"unsupported HARQ mode %d\n",harq_information->harq_information_rel10_tdd.ack_nack_mode); + } +} + +void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) +{ + LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + + uci->frame = frame; + uci->subframe = subframe; + uci->rnti = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti; + uci->type = SR; + uci->pucch_fmt = pucch_format1; + uci->num_antenna_ports = 1; + uci->num_pucch_resources = 1; + uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_pdu.sr_information.sr_information_rel8.pucch_index; + uci->srs_active = srs_active; + uci->active = 1; + + LOG_D(PHY,"Programming UCI SR rnti %x, pucch1_0 %d for (%d,%d)\n", + uci->rnti,uci->n_pucch_1_0_sr[0],frame,subframe); +} + +void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) +{ + LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + + uci->frame = frame; + uci->subframe = subframe; + uci->rnti = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti; + uci->type = HARQ_SR; + uci->num_antenna_ports = 1; + uci->num_pucch_resources = 1; + uci->n_pucch_1_0_sr[0] = ul_config_pdu->uci_sr_harq_pdu.sr_information.sr_information_rel8.pucch_index; + uci->srs_active = srs_active; + uci->active = 1; + + handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_sr_harq_pdu.harq_information); +} + +void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active) +{ + LTE_eNB_UCI *uci = &eNB->uci_vars[UE_id]; + + LOG_D(PHY,"Frame %d, Subframe %d: Programming UCI_HARQ process (type %d)\n",frame,subframe,HARQ); + uci->frame = frame; + uci->subframe = subframe; + uci->rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti; + uci->type = HARQ; + uci->srs_active = srs_active; + uci->num_antenna_ports = ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel11.num_ant_ports; + + handle_uci_harq_information(eNB,uci,&ul_config_pdu->uci_harq_pdu.harq_information); + + uci->active=1; +} + +void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe) +{ + int i; + + for (i=0;i<NUMBER_OF_UE_MAX;i++) { + + if (eNB->soundingrs_ul_config_dedicated[i].active==1) continue; + + eNB->soundingrs_ul_config_dedicated[i].active = 1; + eNB->soundingrs_ul_config_dedicated[i].frame = frame; + eNB->soundingrs_ul_config_dedicated[i].subframe = subframe; + eNB->soundingrs_ul_config_dedicated[i].rnti = ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti; + eNB->soundingrs_ul_config_dedicated[i].srs_Bandwidth = ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth; + eNB->soundingrs_ul_config_dedicated[i].srs_HoppingBandwidth = ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth; + eNB->soundingrs_ul_config_dedicated[i].freqDomainPosition = ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position; + eNB->soundingrs_ul_config_dedicated[i].transmissionComb = ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb; + eNB->soundingrs_ul_config_dedicated[i].srs_ConfigIndex = ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs; + eNB->soundingrs_ul_config_dedicated[i].cyclicShift = ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift; + break; + } + AssertFatal(i<NUMBER_OF_UE_MAX,"No room for SRS processing\n"); +} + +void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint16_t frame,uint8_t subframe,uint8_t srs_present) +{ + nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8; + + int8_t UE_id; + + // check if we have received a dci for this ue and ulsch descriptor is configured + + if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No existing UE ULSCH for rnti %x\n",rel8->rnti); + LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d, modulation %d, rvidx %d\n", UE_id,rel8->rnti,frame,subframe,rel8->modulation_type,rel8->redundancy_version); + + fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + + fill_ulsch(eNB,&ul_config_pdu->ulsch_harq_pdu.ulsch_pdu,frame,subframe); + handle_ulsch_harq_pdu(eNB, UE_id, ul_config_pdu, + &ul_config_pdu->ulsch_harq_pdu.harq_information, frame, subframe); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, + eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu,frame,subframe); + handle_ulsch_cqi_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE) { + AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti, + eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); + fill_ulsch(eNB,&ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu,frame,subframe); + handle_ulsch_cqi_harq_ri_pdu(eNB,UE_id,ul_config_pdu,frame,subframe); + handle_ulsch_harq_pdu(eNB, UE_id, ul_config_pdu, + &ul_config_pdu->ulsch_cqi_harq_ri_pdu.harq_information, frame, subframe); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_uci(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti, + proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti); + handle_uci_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) { + AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE not handled yet\n"); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) { + AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE not handled yet\n"); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE) { + AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE not handled yet\n"); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) { + AssertFatal((UE_id = find_uci(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti, + proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti); + handle_uci_sr_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); + + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { + AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, + "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti); + handle_uci_sr_harq_pdu(eNB,UE_id,ul_config_pdu,frame,subframe,srs_present); + } + else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_SRS_PDU_TYPE) { + handle_srs_pdu(eNB,ul_config_pdu,frame,subframe); + } +} + +void TX_request(){ + +} + +void DL_config(){ + +} + +void UL_config(){ + +} + +void CONFIG_request(){ + + +} + +void schedule_response(Sched_Rsp_t *Sched_INFO) +{ + PHY_VARS_eNB *eNB; + eNB_rxtx_proc_t *proc; + // copy data from L2 interface into L1 structures + module_id_t Mod_id = Sched_INFO->module_id; + uint8_t CC_id = Sched_INFO->CC_id; + nfapi_dl_config_request_t *DL_req = Sched_INFO->DL_req; + nfapi_hi_dci0_request_t *HI_DCI0_req = Sched_INFO->HI_DCI0_req; + nfapi_ul_config_request_t *UL_req = Sched_INFO->UL_req; + nfapi_tx_request_t *TX_req = Sched_INFO->TX_req; + frame_t frame = Sched_INFO->frame; + sub_frame_t subframe = Sched_INFO->subframe; + LTE_DL_FRAME_PARMS *fp; + uint8_t ul_subframe; + int ul_frame; + int harq_pid; + LTE_UL_eNB_HARQ_t *ulsch_harq; + + AssertFatal(RC.eNB!=NULL,"RC.eNB is null\n"); + AssertFatal(RC.eNB[Mod_id]!=NULL,"RC.eNB[%d] is null\n",Mod_id); + AssertFatal(RC.eNB[Mod_id][CC_id]!=NULL,"RC.eNB[%d][%d] is null\n",Mod_id,CC_id); + + + + eNB = RC.eNB[Mod_id][CC_id]; + fp = &eNB->frame_parms; + proc = &eNB->proc.proc_rxtx[0]; + + /* TODO: check that following line is correct - in the meantime it is disabled */ + //if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)==SF_UL)) return; + + ul_subframe = pdcch_alloc2ul_subframe(fp,subframe); + ul_frame = pdcch_alloc2ul_frame(fp,frame,subframe); + + // DJP - subframe assert will fail - not sure why yet + // DJP - AssertFatal(proc->subframe_tx == subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe); + // DJP - AssertFatal(proc->subframe_tx == subframe, "Current frame %d != NFAPI frame %d\n",proc->frame_tx,frame); + + uint8_t number_pdcch_ofdm_symbols = DL_req->dl_config_request_body.number_pdcch_ofdm_symbols; + + uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu; + uint8_t number_hi_dci0_pdu = HI_DCI0_req->hi_dci0_request_body.number_of_dci+HI_DCI0_req->hi_dci0_request_body.number_of_hi; + uint8_t number_ul_pdu = UL_req!=NULL ? UL_req->ul_config_request_body.number_of_pdus : 0; + + nfapi_dl_config_request_pdu_t *dl_config_pdu; + nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu; + nfapi_ul_config_request_pdu_t *ul_config_pdu; + + int i; + + eNB->pdcch_vars[subframe&1].num_pdcch_symbols = number_pdcch_ofdm_symbols; + eNB->pdcch_vars[subframe&1].num_dci = 0; + eNB->phich_vars[subframe&1].num_hi = 0; + + LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d hi_dci0:SFN/SF:%04d%d:pdus:%d ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n", + frame,subframe, + NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu, + NFAPI_SFNSF2SFN(TX_req->sfn_sf),NFAPI_SFNSF2SF(TX_req->sfn_sf),TX_req->tx_request_body.number_of_pdus, + NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),number_hi_dci0_pdu, + NFAPI_SFNSF2SFN(UL_req->sfn_sf),NFAPI_SFNSF2SF(UL_req->sfn_sf),number_ul_pdu, + eNB->pdcch_vars[subframe&1].num_pdcch_symbols); + + int do_oai =0; + int dont_send =0; + /* TODO: check the following test - in the meantime it is put back as it was before */ + //if ((ul_subframe<10)&& + // (subframe_select(fp,ul_subframe)==SF_UL)) { // This means that there is an ul_subframe that can be configured here + if (ul_subframe<10) { // This means that there is an ul_subframe that can be configured here + LOG_D(PHY,"NFAPI: Clearing dci allocations for potential UL subframe %d\n",ul_subframe); + + harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe); + + // clear DCI allocation maps for new subframe + + for (i=0; i<NUMBER_OF_UE_MAX; i++) { + if (eNB->ulsch[i]) { + ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid]; + ulsch_harq->dci_alloc=0; + ulsch_harq->rar_alloc=0; + } + } + } + for (i=0;i<number_dl_pdu;i++) { + dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i]; + //LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type); + switch (dl_config_pdu->pdu_type) { + case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: + handle_nfapi_dci_dl_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu); + eNB->pdcch_vars[NFAPI_SFNSF2SF(DL_req->sfn_sf)&1].num_dci++; + //LOG_E(PHY,"Incremented num_dci:%d but already set??? dl_config:num_dci:%d\n", eNB->pdcch_vars[subframe&1].num_dci, number_dci); + do_oai=1; + break; + case NFAPI_DL_CONFIG_BCH_PDU_TYPE: + AssertFatal(dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, + "bch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", + dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index, + TX_req->tx_request_body.number_of_pdus); + eNB->pbch_configured=1; + do_oai=1; + //LOG_D(PHY,"%s() NFAPI_DL_CONFIG_BCH_PDU_TYPE TX:%d/%d RX:%d/%d TXREQ:%d/%d\n", + //__FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, NFAPI_SFNSF2SFN(TX_req->sfn_sf), NFAPI_SFNSF2SF(TX_req->sfn_sf)); + + + handle_nfapi_bch_pdu(eNB,proc,dl_config_pdu, + TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index].segments[0].segment_data); + break; + case NFAPI_DL_CONFIG_MCH_PDU_TYPE: + // handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu); + break; + case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: + { + nfapi_dl_config_dlsch_pdu_rel8_t *dlsch_pdu_rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8; + uint16_t pdu_index = dlsch_pdu_rel8->pdu_index; + uint16_t tx_pdus = TX_req->tx_request_body.number_of_pdus; + uint16_t invalid_pdu = pdu_index == -1; + uint8_t *sdu = invalid_pdu ? NULL : pdu_index >= tx_pdus ? NULL : TX_req->tx_request_body.tx_pdu_list[pdu_index].segments[0].segment_data; + + LOG_D(PHY,"%s() [PDU:%d] NFAPI_DL_CONFIG_DLSCH_PDU_TYPE SFN/SF:%04d%d TX:%d/%d RX:%d/%d transport_blocks:%d pdu_index:%d sdu:%p\n", + __FUNCTION__, i, + NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf), + proc->frame_tx, proc->subframe_tx, + proc->frame_rx, proc->subframe_rx, + dlsch_pdu_rel8->transport_blocks, pdu_index, sdu); + + /* + AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, + "dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index, + TX_req->tx_request_body.number_of_pdus); + */ + AssertFatal((dlsch_pdu_rel8->transport_blocks<3) && + (dlsch_pdu_rel8->transport_blocks>0), + "dlsch_pdu_rel8->transport_blocks = %d not in [1,2]\n", + dlsch_pdu_rel8->transport_blocks); + if (1)//sdu != NULL) + { + handle_nfapi_dlsch_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu, dlsch_pdu_rel8->transport_blocks-1, sdu); + } + else + { + dont_send=1; + + LOG_E(MAC,"%s() NFAPI_DL_CONFIG_DLSCH_PDU_TYPE sdu is NULL DL_CFG:SFN/SF:%d:pdu_index:%d TX_REQ:SFN/SF:%d:pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(DL_req->sfn_sf), pdu_index, NFAPI_SFNSF2DEC(TX_req->sfn_sf), tx_pdus); + } + + // Send the data first so that the DL_CONFIG can just pluck it out of the buffer + // DJP - OAI was here - moved to bottom + do_oai=1; + + /* + if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu + + LOG_D(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n",frame,subframe); + generate_eNB_ulsch_params_from_rar(eNB, + TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, + frame, + subframe); + + } */ + } + break; + case NFAPI_DL_CONFIG_PCH_PDU_TYPE: + // handle_nfapi_pch_pdu(eNB,dl_config_pdu); + break; + case NFAPI_DL_CONFIG_PRS_PDU_TYPE: + // handle_nfapi_prs_pdu(eNB,dl_config_pdu); + break; + case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: + // handle_nfapi_csi_rs_pdu(eNB,dl_config_pdu); + break; + case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: + // handle_nfapi_epdcch_pdu(eNB,dl_config_pdu); + break; +#ifdef Rel14 + case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: +#ifdef Rel14 + handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu); + eNB->mpdcch_vars[subframe&1].num_dci++; +#endif + break; +#endif + } + } + + if (nfapi_mode && do_oai && !dont_send) { + oai_nfapi_tx_req(Sched_INFO->TX_req); + + oai_nfapi_dl_config_req(Sched_INFO->DL_req); // DJP - .dl_config_request_body.dl_config_pdu_list[0]); // DJP - FIXME TODO - yuk - only copes with 1 pdu + } + + if (nfapi_mode && number_hi_dci0_pdu!=0) { + oai_nfapi_hi_dci0_req(HI_DCI0_req); + eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_dci=0; + eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_pdcch_symbols=0; + } + + for (i=0;i<number_hi_dci0_pdu;i++) { + + hi_dci0_req_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i]; + + LOG_D(PHY,"NFAPI: hi_dci0_pdu %d : type %d\n",i,hi_dci0_req_pdu->pdu_type); + + switch (hi_dci0_req_pdu->pdu_type) { + + case NFAPI_HI_DCI0_DCI_PDU_TYPE: + + handle_nfapi_hi_dci0_dci_pdu(eNB,NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),proc,hi_dci0_req_pdu); + + eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_dci++; + break; + + case NFAPI_HI_DCI0_HI_PDU_TYPE: + handle_nfapi_hi_dci0_hi_pdu(eNB,NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),proc,hi_dci0_req_pdu); + break; + } + } + + if (nfapi_mode) { + if (number_ul_pdu>0) + { + //LOG_D(PHY, "UL_CONFIG to send to PNF\n"); + oai_nfapi_ul_config_req(UL_req); + UL_req->ul_config_request_body.number_of_pdus=0; + number_ul_pdu=0; + } + } + else { + for (i=0;i<number_ul_pdu;i++) { + ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; + LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); + AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE || + ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE + , + "Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type); + handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu,UL_req->sfn_sf>>4,UL_req->sfn_sf&0xf,UL_req->ul_config_request_body.srs_present); + } + } +} diff --git a/openair1/SCHED_NR_UE/fapi_l1.h b/openair1/SCHED_NR_UE/fapi_l1.h new file mode 100644 index 0000000000000000000000000000000000000000..efb028f46444b73cbed6df710faf6db75bcc4080 --- /dev/null +++ b/openair1/SCHED_NR_UE/fapi_l1.h @@ -0,0 +1,79 @@ +/* + * 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 fapi_l1.h + * \brief function prototypes for FAPI L1 interface + * \author R. Knopp + * \date 2017 + * \version 0.1 + * \company Eurecom + * \email: knopp@eurecom.fr + * \note + * \warning + */ + +#include "PHY/defs_eNB.h" +#include "PHY/phy_extern.h" +#include "PHY/LTE_TRANSPORT/transport_proto.h" +#include "SCHED/sched_eNB.h" +#include "SCHED/sched_common.h" +#include "nfapi_interface.h" + +void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask); +void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling); +void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti); +void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat); +void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe); +void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag); +void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); +void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); +void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); +void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, + nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu); +void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc, + nfapi_dl_config_request_pdu_t *dl_config_pdu, + uint8_t codeword_index, + uint8_t *sdu); +void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + uint16_t frame,uint8_t subframe,uint8_t srs_present); + +void handle_ulsch_harq_pdu( + PHY_VARS_eNB *eNB, + int UE_id, + nfapi_ul_config_request_pdu_t *ul_config_pdu, + nfapi_ul_config_ulsch_harq_information *harq_information, + uint16_t frame, + uint8_t subframe); + +void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe); + +void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information); + +void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active); + +void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active); +void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active); + +void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe); + +void schedule_response(Sched_Rsp_t *Sched_INFO); diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c new file mode 100755 index 0000000000000000000000000000000000000000..62b3b5da76806d64861db8fee2429912e3336fb9 --- /dev/null +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -0,0 +1,43 @@ +/* + * 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 fapi_nr_ue_l1.c + * \brief functions for NR UE FAPI-like interface + * \author R. Knopp + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: knopp@eurecom.fr + * \note + * \warning + */ + +#include "fapi_nr_ue_interface.h" +#include "fapi_nr_ue_l1.h" + +int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ + return 0; +} + + +int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config){ + return 0; +} \ No newline at end of file diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h new file mode 100755 index 0000000000000000000000000000000000000000..f60f474899d2a4a231bd67128b8a08071351b5ca --- /dev/null +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.h @@ -0,0 +1,47 @@ +/* + * 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 fapi_nr_ue_l1.c + * \brief functions for FAPI L1 interface + * \author R. Knopp + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: knopp@eurecom.fr + * \note + * \warning + */ + +#ifndef __FAPI_NR_UE_L1_H__ +#define __FAPI_NR_UE_L1_H__ + +#include "NR_IF_Module.h" + +/**\brief NR UE FAPI-like P7 messages, scheduled response from L2 indicating L1 + \param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/ +int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response); + +/**\brief NR UE FAPI-like P5 message, physical configuration from L2 to configure L1 + \param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/ +int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config); + + +#endif \ No newline at end of file diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 58aef566023e01e420991b35499e4bfed581f237..44123a2479c2ef615391580b16ade0cbda69d3dd 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -3089,6 +3089,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *pro #endif //(0) #ifdef NR_PDCCH_SCHED + int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t abstraction_flag) { @@ -3103,6 +3104,11 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * uint8_t next1_thread_id = ue->current_thread_id[nr_tti_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[nr_tti_rx]+1); uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1); + // this table contains dci_fields_sizes for each time a dci is decoded in the slot. Each element represents the size in bits for each dci field + // each time a dci is decode at dci_cnt, the values of the table dci_fields_sizes[i][j] will be copied at table dci_fields_sizes_cnt[dci_cnt-1][i][j] + // table dci_fields_sizes_cnt[dci_cnt-1][i][j] will then be used in function nr_extract_dci_info + uint8_t dci_fields_sizes_cnt[MAX_NR_DCI_DECODED_SLOT][NBR_NR_DCI_FIELDS][NBR_NR_FORMATS] = {0}; + uint16_t tc_rnti = 1; // FIXME uint16_t int_rnti = 1; // FIXME uint16_t sfi_rnti = 1; // FIXME @@ -3137,6 +3143,25 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * * For PDCCH monitoring when overlap with SS/PBCH according to 38.213 v15.1.0 Section 10 * To be implemented LATER !!! */ + int _offset,_index,_M; + int searchSpace_id = pdcch_vars2->searchSpace[nb_searchspace_active].searchSpaceId; + if (searchSpace_id == 0){ // Implementing TS 38.213 subclause 13, UE procedure for monitoring Type0-PDCCH common search space + /* + * according to TS 38.213 subclause 13 + * For the SS/PBCH block and control resource set (CORESET) multiplexing pattern 1, + * a UE monitors PDCCH in the Type0-PDCCH common search space over two consecutive slots starting from slot n0 + */ + if (frame_rx%2 == 0) { + if ((((_offset*2+((_index*_M)/20))%2) != 0) || ((((_offset*2)+(_index*_M))%20) != nr_tti_rx) || ((((_offset*2)+(_index*_M))%20) != nr_tti_rx-1)){ + do_pdcch_monitoring_current_slot = 0; + } + } + if (frame_rx%2 == 1) { + if ((((_offset*2+((_index*_M)/20))%2) != 1) || ((((_offset*2)+(_index*_M))%20) != nr_tti_rx) || ((((_offset*2)+(_index*_M))%20) != nr_tti_rx-1)){ + do_pdcch_monitoring_current_slot = 0; + } + } + } #ifdef NR_PDCCH_SCHED_DEBUG printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> nb_searchspace_active=%d do_pdcch_monitoring_current_slot=%d\n", nb_searchspace_active, @@ -3146,7 +3171,6 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * if (do_pdcch_monitoring_current_slot) { // the searchSpace indicates that we need to monitor PDCCH in current nr_tti_rx // get the parameters describing the current SEARCHSPACE - int searchSpace_id = pdcch_vars2->searchSpace[nb_searchspace_active].searchSpaceId; // the CORESET id applicable to the current SearchSpace int searchSpace_coreset_id = pdcch_vars2->searchSpace[nb_searchspace_active].controlResourceSetId; // FIXME this variable is a bit string (14 bits) identifying every OFDM symbol in a slot. @@ -3165,8 +3189,8 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * while ((searchSpace_coreset_id != pdcch_vars2->coreset[nb_coreset_active].controlResourceSetId) && (nb_coreset_active<nb_coreset_total)) { // we need to identify the CORESET associated to the active searchSpace nb_coreset_active++; - } if (nb_coreset_active >= nb_coreset_total) return 0; // the coreset_id could not be found. There is a problem + } unsigned int dci_cnt=0, i; @@ -3181,8 +3205,8 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * int tci_present = pdcch_vars2->coreset[nb_coreset_active].tciPresentInDCI; uint16_t pdcch_DMRS_scrambling_id = pdcch_vars2->coreset[nb_coreset_active].pdcchDMRSScramblingID; - // this table contains 48 (NBR_NR_DCI_FIELDS) elements for each dci field described in TS 38.212. Each element represents the size in bits for each dci field - uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS] = {0}; + // this table contains 56 (NBR_NR_DCI_FIELDS) elements for each dci field and format described in TS 38.212. Each element represents the size in bits for each dci field + uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS] = {0}; // this is the UL bandwidth part. FIXME! To be defined where this value comes from uint16_t n_RB_ULBWP = 100; // this is the DL bandwidth part. FIXME! To be defined where this value comes from @@ -3235,7 +3259,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * proc->frame_rx, nr_tti_rx, eNB_id, - //(ue->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI, // NR_DL_FRAME_PARMS struct has been modified, and 'mode1_flag' needs to be included + //(ue->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI, SISO, ue->high_speed_flag, ue->is_secondary_ue, @@ -3276,6 +3300,9 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * nr_tti_rx); } */ //removed for nr_ue_pdcch_procedures + crc_scrambled_t crc_scrambled; + format_found_t format_found=255; + if (searchSpaceType == common) { // search all possible dci's for COMMON SEARCH SPACES according to the current SEARCHSPACE configuration #ifdef NR_PDCCH_SCHED_DEBUG printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure(searchSpaceType=%d, nb_searchspace_active=%d, nb_coreset_active=%d) -> dci_cnt=%d\n", @@ -3292,9 +3319,11 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * // later when we need paging or RA during connection, update this ... eNB_id, nr_tti_rx, - dci_fields_sizes, + dci_fields_sizes,dci_fields_sizes_cnt, n_RB_ULBWP, - n_RB_DLBWP); + n_RB_DLBWP, + &crc_scrambled, + &format_found); #ifdef NR_PDCCH_SCHED_DEBUG printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%d\n",dci_cnt); #endif @@ -3315,9 +3344,11 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * // later when we need paging or RA during connection, update this ... eNB_id, nr_tti_rx, - dci_fields_sizes, + dci_fields_sizes,dci_fields_sizes_cnt, n_RB_ULBWP, - n_RB_DLBWP); + n_RB_DLBWP, + &crc_scrambled, + &format_found); #ifdef NR_PDCCH_SCHED_DEBUG printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%d\n",dci_cnt); #endif @@ -3332,7 +3363,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PHICH, VCD_FUNCTION_OUT); }*/ //removed for nr_ue_pdcch_procedures } -#if 0 + #ifdef PHY_ABSTRACTION else { for (i=0; i<NB_eNB_INST; i++) { @@ -3346,7 +3377,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * if (i==NB_eNB_INST) { LOG_E(PHY,"[UE %d] phy_procedures_lte_ue.c: FATAL : Could not find attached eNB for DCI emulation (Nid_cell %d)!!!!\n",ue->Mod_id,ue->frame_parms.Nid_cell); - //mac_xface->macphy_exit("Could not find attached eNB for DCI emulation"); + mac_xface->macphy_exit("Could not find attached eNB for DCI emulation"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_OUT); return(-1); } @@ -3359,26 +3390,28 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * dci_alloc_rx, eNB_id); // printf("DCI: dci_cnt %d\n",dci_cnt); - UE_id = (uint32_t)nr_find_ue((int16_t)ue->pdcch_vars[nr_tti_rx&1][eNB_id]->crnti,PHY_vars_eNB_g[i][CC_id]); + UE_id = (uint32_t)find_ue((int16_t)ue->pdcch_vars[nr_tti_rx&1][eNB_id]->crnti,PHY_vars_eNB_g[i][CC_id]); if (UE_id>=0) { // printf("Checking PHICH for UE %d (eNB %d)\n",UE_id,i); - //if (is_phich_subframe(&ue->frame_parms,nr_tti_rx)) { - //harq_pid = phich_subframe_to_harq_pid(&ue->frame_parms,frame_rx,nr_tti_rx); - //if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->status == ACTIVE) { - //ue->ulsch[eNB_id]->harq_processes[harq_pid]->phich_ACK=1; - //ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag =0; - //ue->ulsch[eNB_id]->harq_processes[harq_pid]->status = IDLE; - //ue->ulsch_Msg3_active[eNB_id] = 0; - //ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; - //LOG_D(PHY,"Msg3 inactive\n"); - //} // harq_pid is ACTIVE - //} // This is a PHICH nr_tti_rx + if (is_phich_subframe(&ue->frame_parms,nr_tti_rx)) { + harq_pid = phich_subframe_to_harq_pid(&ue->frame_parms,frame_rx,nr_tti_rx); + + if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->status == ACTIVE) { + // ue->ulsch[eNB_id]->harq_processes[harq_pid]->phich_ACK=1; + ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag =0; + ue->ulsch[eNB_id]->harq_processes[harq_pid]->status = IDLE; + ue->ulsch_Msg3_active[eNB_id] = 0; + ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0; + LOG_D(PHY,"Msg3 inactive\n"); + + } // harq_pid is ACTIVE + } // This is a PHICH nr_tti_rx } // UE_id exists } #endif -#endif + uint8_t *nCCE_current = &ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->nCCE[nr_tti_rx]; uint8_t *nCCE_dest = &ue->pdcch_vars[next1_thread_id][eNB_id]->nCCE[nr_tti_rx]; uint8_t *nCCE_dest1 = &ue->pdcch_vars[next2_thread_id][eNB_id]->nCCE[nr_tti_rx]; @@ -3403,135 +3436,59 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * /* * This is the NR part */ - if ((dci_alloc_rx[i].rnti == SI_RNTI) && (dci_alloc_rx[i].format == format1_0)){ - nr_generate_ue_ul_dlsch_params_from_dci(ue, - eNB_id, - frame_rx, - nr_tti_rx, - (void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti, - dci_alloc_rx[i].dci_length, - dci_alloc_rx[i].format, - ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->ulsch[eNB_id], - &ue->frame_parms, - ue->pdsch_config_dedicated, - SI_RNTI, - 0, - P_RNTI, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], - ue->pdcch_vars[0%RX_NB_TH][eNB_id]->crnti_is_temporary? ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti: 0, - &dci_fields_sizes, - n_RB_ULBWP, - n_RB_DLBWP); - ue->dlsch_SI_received[eNB_id]++; - } - - if ((dci_alloc_rx[i].rnti == P_RNTI) && (dci_alloc_rx[i].format == format1_0)){ - ue->dlsch_p_received[eNB_id]++; - } - - if ((dci_alloc_rx[i].rnti == ue->prach_resources[eNB_id]->ra_RNTI) && (dci_alloc_rx[i].format == format1_0)){ - nr_generate_ue_ul_dlsch_params_from_dci(ue, - eNB_id, - frame_rx, - nr_tti_rx, - (void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti, - dci_alloc_rx[i].dci_length, - dci_alloc_rx[i].format, - ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->ulsch[eNB_id], - &ue->frame_parms, - ue->pdsch_config_dedicated, - SI_RNTI, - ue->prach_resources[eNB_id]->ra_RNTI, - P_RNTI, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], - ue->pdcch_vars[0%RX_NB_TH][eNB_id]->crnti_is_temporary? ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti: 0, - &dci_fields_sizes, - n_RB_ULBWP, - n_RB_DLBWP); - ue->dlsch_ra_received[eNB_id]++; + uint16_t c_rnti=pdcch_vars[eNB_id]->crnti; + uint16_t cs_rnti,new_rnti,tc_rnti; + uint16_t p_rnti=P_RNTI; + uint16_t si_rnti=SI_RNTI; + uint16_t ra_rnti=99; + uint16_t sp_csi_rnti,sfi_rnti,int_rnti,tpc_pusch_rnti,tpc_pucch_rnti,tpc_srs_rnti; //FIXME + uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES] = + {c_rnti,cs_rnti,new_rnti,tc_rnti,p_rnti,si_rnti,ra_rnti,sp_csi_rnti,sfi_rnti,int_rnti,tpc_pusch_rnti,tpc_pucch_rnti,tpc_srs_rnti}; + + if ((dci_alloc_rx[i].format == format0_0)) + if ((dci_alloc_rx[i].format == format1_0) && + (dci_alloc_rx[i].rnti != crc_scrambled_values[_P_RNTI_]) && + (dci_alloc_rx[i].rnti != crc_scrambled_values[_SI_RNTI_]) && + (dci_alloc_rx[i].rnti != crc_scrambled_values[_RA_RNTI_])) ue->dlsch_received[eNB_id]++; + if ((dci_alloc_rx[i].rnti == crc_scrambled_values[_SI_RNTI_]) && (dci_alloc_rx[i].format == format1_0)) ue->dlsch_SI_received[eNB_id]++; + if ((dci_alloc_rx[i].rnti == crc_scrambled_values[_P_RNTI_]) && (dci_alloc_rx[i].format == format1_0)) ue->dlsch_p_received[eNB_id]++; + if ((dci_alloc_rx[i].rnti == crc_scrambled_values[_RA_RNTI_]) && (dci_alloc_rx[i].format == format1_0)) ue->dlsch_ra_received[eNB_id]++; + if ((dci_alloc_rx[i].format == format2_0)){ } - - if ((dci_alloc_rx[i].rnti == sfi_rnti) && (dci_alloc_rx[i].format == format2_0)){ - } - - if ((dci_alloc_rx[i].rnti == int_rnti) && (dci_alloc_rx[i].format == format2_1)){ - } - - if ((dci_alloc_rx[i].rnti == tpc_pusch_rnti) && (dci_alloc_rx[i].format == format2_2)){ + if ((dci_alloc_rx[i].format == format2_1)){ } - - if ((dci_alloc_rx[i].rnti == tpc_srs_rnti) && (dci_alloc_rx[i].format == format2_3)){ + if ((dci_alloc_rx[i].format == format2_2)){ } - - if ((dci_alloc_rx[i].rnti == ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti) && (dci_alloc_rx[i].format == format0_0)){ - nr_generate_ue_ul_dlsch_params_from_dci(ue, - eNB_id, - frame_rx, - nr_tti_rx, - (void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti, - dci_alloc_rx[i].dci_length, - dci_alloc_rx[i].format, - ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->ulsch[eNB_id], - &ue->frame_parms, - ue->pdsch_config_dedicated, - SI_RNTI, - 0, - P_RNTI, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], - ue->pdcch_vars[0%RX_NB_TH][eNB_id]->crnti_is_temporary? ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti: 0, - &dci_fields_sizes, - n_RB_ULBWP, - n_RB_DLBWP); + if ((dci_alloc_rx[i].format == format2_3)){ } - - if ((dci_alloc_rx[i].rnti == ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti) && (dci_alloc_rx[i].format == format0_1)){ // This format not implemented at a first time. FIXME + if ((dci_alloc_rx[i].format == format0_1)){ // This format not implemented at a first time. FIXME } - - if ((dci_alloc_rx[i].rnti == ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti) && (dci_alloc_rx[i].format == format1_0)){ - nr_generate_ue_ul_dlsch_params_from_dci(ue, - eNB_id, - frame_rx, - nr_tti_rx, - (void *)&dci_alloc_rx[i].dci_pdu, - ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti, - dci_alloc_rx[i].dci_length, - dci_alloc_rx[i].format, - ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id], - ue->ulsch[eNB_id], - &ue->frame_parms, - ue->pdsch_config_dedicated, - SI_RNTI, - 0, - P_RNTI, - ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], - ue->pdcch_vars[0%RX_NB_TH][eNB_id]->crnti_is_temporary? ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti: 0, - &dci_fields_sizes, - n_RB_ULBWP, - n_RB_DLBWP); - ue->dlsch_received[eNB_id]++; + if ((dci_alloc_rx[i].format == format1_1)){ // This format not implemented at a first time. FIXME } + nr_generate_ue_ul_dlsch_params_from_dci(ue, + eNB_id, + frame_rx, + nr_tti_rx, + (void *)&dci_alloc_rx[i].dci_pdu, + dci_alloc_rx[i].rnti, + dci_alloc_rx[i].dci_length, + dci_alloc_rx[i].format, + ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], + ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id], + ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id], + ue->ulsch[eNB_id], + &ue->frame_parms, + ue->pdsch_config_dedicated, + ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], + dci_fields_sizes_cnt[i], + n_RB_ULBWP, + n_RB_DLBWP, + crc_scrambled_values); - if ((dci_alloc_rx[i].rnti == ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti) && (dci_alloc_rx[i].format == format1_1)){ // This format not implemented at a first time. FIXME - } -#if 0 /* * This is the LTE part to be removed - */ + if ((ue->UE_mode[eNB_id]>PRACH) && (dci_alloc_rx[i].rnti == ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->crnti) && (dci_alloc_rx[i].format != format0)) { LOG_D(PHY,"[UE %d][DCI][PDSCH %x] AbsSubframe %d.%d: format %d, num_pdcch_symbols %d, nCCE %d, total CCEs %d\n", @@ -3732,9 +3689,9 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * 0)==0)) { #if T_TRACER NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; - uint8_t harq_pid = nr_subframe2harq_pid(frame_parms, - nr_pdcch_alloc2ul_frame(frame_parms,proc->frame_rx,proc->nr_tti_rx), - nr_pdcch_alloc2ul_subframe(frame_parms,proc->nr_tti_rx)); + uint8_t harq_pid = subframe2harq_pid(frame_parms, + pdcch_alloc2ul_frame(frame_parms,proc->frame_rx,proc->nr_tti_rx), + pdcch_alloc2ul_subframe(frame_parms,proc->nr_tti_rx)); T(T_UE_PHY_ULSCH_UE_DCI, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(proc->nr_tti_rx), T_INT(ue->Mod_id), T_INT(dci_alloc_rx[i].rnti), T_INT(harq_pid), @@ -3759,7 +3716,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * /* if (((frame_rx%100) == 0) || (frame_rx < 20)) dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); - */ + #endif ue->ulsch_no_allocation_counter[eNB_id] = 0; @@ -3795,10 +3752,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * // dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); #endif - } -#endif //(0) - - + }*/ } // end for loop dci_cnt #if UE_TIMING_TRACE @@ -3807,9 +3761,12 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t * VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_OUT); } // end if do_pdcch_monitoring_current_slot - } // end for loop nb_searchspacet_active + } // end for loop nb_searchspace_active return(0); } + + + #endif #if 0 diff --git a/openair1/SIMULATION/ETH_TRANSPORT/extern.h b/openair1/SIMULATION/ETH_TRANSPORT/extern.h index c01b5584e23f70b44f7820ef15832e94760118ed..472a4545eb6d2ef8012b3f6c755caa46cc87cbdf 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/extern.h +++ b/openair1/SIMULATION/ETH_TRANSPORT/extern.h @@ -33,6 +33,7 @@ #include <pthread.h> + extern unsigned char Emulation_status; extern unsigned char emu_tx_status; extern unsigned char emu_rx_status; diff --git a/openair2/COMMON/platform_constants.h b/openair2/COMMON/platform_constants.h index 20a7d5ecd20c52e114546305d77382bed796a3af..3621a06018f6d0889ce94f262f8f632ee272d47e 100644 --- a/openair2/COMMON/platform_constants.h +++ b/openair2/COMMON/platform_constants.h @@ -70,14 +70,19 @@ #ifdef LARGE_SCALE # define MAX_MOBILES_PER_ENB 128 # define MAX_MOBILES_PER_ENB_NB_IoT 128 +# define MAX_MOBILES_PER_GNB 128 # define MAX_eNB 2 +# define MAX_gNB 2 #else # define MAX_MOBILES_PER_ENB 16 # define MAX_MOBILES_PER_ENB_NB_IoT 16 +# define MAX_MOBILES_PER_GNB 16 # define MAX_eNB 2 +# define MAX_gNB 2 #endif #define MAX_MANAGED_ENB_PER_MOBILE 2 +#define MAX_MANAGED_GNB_PER_MOBILE 2 ///NB-IOT #define NB_RB_MAX_NB_IOT (maxDRB_NB_r13 + 3) //MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5 diff --git a/openair2/COMMON/rrc_messages_def.h b/openair2/COMMON/rrc_messages_def.h index 08ea93f427add5aa6dbd032e54180848cb3e85da..252b336c946d259beb01ef5a21e29880fe32ec76 100644 --- a/openair2/COMMON/rrc_messages_def.h +++ b/openair2/COMMON/rrc_messages_def.h @@ -55,6 +55,7 @@ MESSAGE_DEF(RRC_STATE_IND, MESSAGE_PRIORITY_MED, RrcStateInd, // eNB: ENB_APP -> RRC messages MESSAGE_DEF(RRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, RrcConfigurationReq, rrc_configuration_req) MESSAGE_DEF(NBIOTRRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, NbIoTRrcConfigurationReq, nbiotrrc_configuration_req) +MESSAGE_DEF(NRRRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, gNB_RrcConfigurationReq, nrrrc_configuration_req) // UE: NAS -> RRC messages MESSAGE_DEF(NAS_KENB_REFRESH_REQ, MESSAGE_PRIORITY_MED, NasKenbRefreshReq, nas_kenb_refresh_req) diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 93f1e4ea80ecab06c0cc3cc1fc965186c4899331..edf84fb73e57fcc504758673011207dda8111c11 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -293,9 +293,9 @@ typedef struct NRRrcConfigurationReq_s { //NR FrequencyInfoUL long UL_FreqBandIndicatorNR[MAX_NUM_CCs]; long UL_absoluteFrequencyPointA[MAX_NUM_CCs]; - lte_prefix_type_t UL_additionalSpectrumEmission[MAX_NUM_CCs]; + long UL_additionalSpectrumEmission[MAX_NUM_CCs]; long UL_p_Max[MAX_NUM_CCs]; - long ULfrequencyShift7p5khz[MAX_NUM_CCs]; + long UL_frequencyShift7p5khz[MAX_NUM_CCs]; //NR UL SCS-SpecificCarrier uint32_t UL_offsetToCarrier[MAX_NUM_CCs]; diff --git a/openair2/COMMON/tasks_def.h b/openair2/COMMON/tasks_def.h index 92d1ff4128fb5413dbd71de4e98eed9157eac15b..00bbd5dcf06dc55ecd247709c47f04a9a92a02ae 100644 --- a/openair2/COMMON/tasks_def.h +++ b/openair2/COMMON/tasks_def.h @@ -44,6 +44,8 @@ TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200) // Define here for now TASK_DEF(TASK_RRC_ENB_NB_IoT, TASK_PRIORITY_MED, 200) +TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200) + /// S1ap task /// RAL task for ENB TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200) @@ -59,6 +61,8 @@ TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200) /// eNB APP task TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200) +/// gNB APP task +TASK_DEF(TASK_GNB_APP, TASK_PRIORITY_MED, 200) /// eNB Agent task TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200) diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h new file mode 100644 index 0000000000000000000000000000000000000000..b062235ff69b6aaefb5cc40bff392419df524df3 --- /dev/null +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -0,0 +1,73 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file openair2/ENB_APP/L1_paramdef.f + * \brief definition of configuration parameters for all eNodeB modules + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + + +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + + +/* L1 configuration parameters names */ +#define CONFIG_STRING_L1_CC "num_cc" +#define CONFIG_STRING_L1_LOCAL_N_IF_NAME "local_n_if_name" +#define CONFIG_STRING_L1_LOCAL_N_ADDRESS "local_n_address" +#define CONFIG_STRING_L1_REMOTE_N_ADDRESS "remote_n_address" +#define CONFIG_STRING_L1_LOCAL_N_PORTC "local_n_portc" +#define CONFIG_STRING_L1_REMOTE_N_PORTC "remote_n_portc" +#define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" +#define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" +#define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" + +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* L1 configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define L1PARAMS_DESC { \ +{CONFIG_STRING_L1_CC, NULL, 0, uptr:NULL, defintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_REMOTE_N_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ +} +#define L1_CC_IDX 0 +#define L1_TRANSPORT_N_PREFERENCE_IDX 1 +#define L1_LOCAL_N_IF_NAME_IDX 2 +#define L1_LOCAL_N_ADDRESS_IDX 3 +#define L1_REMOTE_N_ADDRESS_IDX 4 +#define L1_LOCAL_N_PORTC_IDX 5 +#define L1_REMOTE_N_PORTC_IDX 6 +#define L1_LOCAL_N_PORTD_IDX 7 +#define L1_REMOTE_N_PORTD_IDX 8 + +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/GNB_APP/MACRLC_nr_paramdef.h b/openair2/GNB_APP/MACRLC_nr_paramdef.h new file mode 100644 index 0000000000000000000000000000000000000000..4e732fe942bee9528bf6bde32e60e4b2cd2cbba6 --- /dev/null +++ b/openair2/GNB_APP/MACRLC_nr_paramdef.h @@ -0,0 +1,98 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file openair2/ENB_APP/MACRLC_paramdef.f + * \brief definition of configuration parameters for all eNodeB modules + * \author Francois TABURET + * \date 2017 + * \version 0.1 + * \company NOKIA BellLabs France + * \email: francois.taburet@nokia-bell-labs.com + * \note + * \warning + */ + + + +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ + + +/* MACRLC configuration parameters names */ +#define CONFIG_STRING_MACRLC_CC "num_cc" +#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference" +#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name" +#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address" +#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address" +#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc" +#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc" +#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd" +#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd" +#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference" +#define CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME "local_s_if_name" +#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address" +#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address" +#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc" +#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc" +#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd" +#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd" + + +/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* MacRLC configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define MACRLCPARAMS_DESC { \ +{CONFIG_STRING_MACRLC_CC, NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"local_L1", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS, NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_PORTC, NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50010, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50011, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"local_RRC", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS, NULL, 0, uptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS, NULL, 0, uptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_PORTC, NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defintval:50020, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \ +{CONFIG_STRING_MACRLC_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \ +} +#define MACRLC_CC_IDX 0 +#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 +#define MACRLC_LOCAL_N_IF_NAME_IDX 2 +#define MACRLC_LOCAL_N_ADDRESS_IDX 3 +#define MACRLC_REMOTE_N_ADDRESS_IDX 4 +#define MACRLC_LOCAL_N_PORTC_IDX 5 +#define MACRLC_REMOTE_N_PORTC_IDX 6 +#define MACRLC_LOCAL_N_PORTD_IDX 7 +#define MACRLC_REMOTE_N_PORTD_IDX 8 +#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 9 +#define MACRLC_LOCAL_S_IF_NAME_IDX 10 +#define MACRLC_LOCAL_S_ADDRESS_IDX 11 +#define MACRLC_REMOTE_S_ADDRESS_IDX 12 +#define MACRLC_LOCAL_S_PORTC_IDX 13 +#define MACRLC_REMOTE_S_PORTC_IDX 14 +#define MACRLC_LOCAL_S_PORTD_IDX 15 +#define MACRLC_REMOTE_S_PORTD_IDX 16 +/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/ENB_APP/NRRRC_paramsvalues.h b/openair2/GNB_APP/RRC_nr_paramsvalues.h similarity index 83% rename from openair2/ENB_APP/NRRRC_paramsvalues.h rename to openair2/GNB_APP/RRC_nr_paramsvalues.h index aae1fc3300d913f8926611111572a3c351ac17a9..306095838d35230dd960eeeee73ff1148f85c58b 100644 --- a/openair2/ENB_APP/NRRRC_paramsvalues.h +++ b/openair2/GNB_APP/RRC_nr_paramsvalues.h @@ -29,23 +29,21 @@ * \note * \warning */ -#ifndef __NRRRC_PARAMSVALUES__H__ -#define __NRRRC_PARAMSVALUES__H__ +#ifndef __NR_RRC_PARAMSVALUES__H__ +#define __NR_RRC_PARAMSVALUES__H__ /* cell configuration section name */ -#define GNB_CONFIG_STRING_GNB_LIST "gNBs" -/* component carriers configuration section name */ -#define GNB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers" - -#define GNB_CONFIG_STRING_FRAME_TYPE "frame_type" -#define GNB_CONFIG_STRING_DL_PREFIX_TYPE "DL_prefix_type" -#define GNB_CONFIG_STRING_UL_PREFIX_TYPE "UL_prefix_type" -#define GNB_CONFIG_STRING_EUTRA_BAND "eutra_band" -#define GNB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency" -#define GNB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset" -#define GNB_CONFIG_STRING_NID_CELL "Nid_cell" -#define GNB_CONFIG_STRING_N_RB_DL "N_RB_DL" -#define GNB_CONFIG_STRING_CELL_MBSFN "Nid_cell_mbsfn" - +#define GNB_CONFIG_STRING_GNB_LIST "gNBs" +/* component carriers configuration section name */ +#define GNB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers" + +#define GNB_CONFIG_STRING_FRAME_TYPE "frame_type" +#define GNB_CONFIG_STRING_DL_PREFIX_TYPE "DL_prefix_type" +#define GNB_CONFIG_STRING_UL_PREFIX_TYPE "UL_prefix_type" +#define GNB_CONFIG_STRING_EUTRA_BAND "eutra_band" +#define GNB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency" +#define GNB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset" +#define GNB_CONFIG_STRING_NID_CELL "Nid_cell" +#define GNB_CONFIG_STRING_N_RB_DL "N_RB_DL" #define FRAMETYPE_OKVALUES {"FDD","TDD"} #define FRAMETYPE_MODVALUES { FDD, TDD} @@ -66,7 +64,7 @@ #define UETIMER_T300_OKVALUES {100,200,300,400,600,1000,1500,2000} #define UETT300(A) UE_TimersAndConstants__t300_ ## A -#define UETIMER_T300_MODVALUES { UETT300(ms100), UETT300(ms200),UETT300(ms300),UETT300(ms400),UETT300(ms600),UETT300(ms1000),UETT300(ms1500),UETT300(ms2000)} +#define UETIMER_T300_MODVALUES { UETT300(ms100), UETT300(ms200),UETT300(ms300),UETT300(ms400),UETT300(ms600),UETT300(ms1000),UETT300(ms1500),UETT300(ms2000)} #define UETIMER_T301_OKVALUES {100,200,300,400,600,1000,1500,2000} #define UETT301(A) UE_TimersAndConstants__t301_ ## A diff --git a/openair2/ENB_APP/gnb_app.c b/openair2/GNB_APP/gnb_app.c similarity index 68% rename from openair2/ENB_APP/gnb_app.c rename to openair2/GNB_APP/gnb_app.c index 15d5ef6fea10543d66bee49608940837c6c6b77f..d5151a6f11d2bc0cb3fe86b5d4953f66b8492fef 100644 --- a/openair2/ENB_APP/gnb_app.c +++ b/openair2/GNB_APP/gnb_app.c @@ -46,6 +46,8 @@ # include "gtpv1u_eNB_task.h" # endif +# include "PHY/INIT/phy_init.h" + extern unsigned char NB_gNB_INST; #endif @@ -58,40 +60,16 @@ extern RAN_CONTEXT_t RC; # define GNB_REGISTER_RETRY_DELAY 10 # endif -/*------------------------------------------------------------------------------*/ - -/* -static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_properties) -{ - MessageDef *msg_p; - int CC_id; - - msg_p = itti_alloc_new_message (TASK_ENB_APP, PHY_CONFIGURATION_REQ); - - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - PHY_CONFIGURATION_REQ (msg_p).frame_type[CC_id] = enb_properties->properties[enb_id]->frame_type[CC_id]; - PHY_CONFIGURATION_REQ (msg_p).prefix_type[CC_id] = enb_properties->properties[enb_id]->prefix_type[CC_id]; - PHY_CONFIGURATION_REQ (msg_p).downlink_frequency[CC_id] = enb_properties->properties[enb_id]->downlink_frequency[CC_id]; - PHY_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[CC_id] = enb_properties->properties[enb_id]->uplink_frequency_offset[CC_id]; - PHY_CONFIGURATION_REQ (msg_p).nb_antennas_tx[CC_id] = enb_properties->properties[enb_id]->nb_antennas_tx[CC_id]; - PHY_CONFIGURATION_REQ (msg_p).nb_antennas_rx[CC_id] = enb_properties->properties[enb_id]->nb_antennas_rx[CC_id]; - PHY_CONFIGURATION_REQ (msg_p).tx_gain[CC_id] = enb_properties->properties[enb_id]->tx_gain[CC_id]; - PHY_CONFIGURATION_REQ (msg_p).rx_gain[CC_id] = enb_properties->properties[enb_id]->rx_gain[CC_id]; - } - - itti_send_msg_to_task (TASK_PHY_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); -} -*/ /*------------------------------------------------------------------------------*/ -static void configure_nrrrc(uint32_t gnb_id) +static void configure_nr_rrc(uint32_t gnb_id) { MessageDef *msg_p = NULL; // int CC_id; msg_p = itti_alloc_new_message (TASK_GNB_APP, NRRRC_CONFIGURATION_REQ); - if (RC.nr_rrc[gnb_id]) { + if (RC.nrrrc[gnb_id]) { RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]); @@ -112,16 +90,16 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//, for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) { { - s1ap_register_gnb_req_t *s1ap_register_gNB; + s1ap_register_enb_req_t *s1ap_register_gNB; //Type Temporarily reuse /* note: there is an implicit relationship between the data structure and the message name */ - msg_p = itti_alloc_new_message (TASK_GNB_APP, S1AP_REGISTER_GNB_REQ); + msg_p = itti_alloc_new_message (TASK_GNB_APP, S1AP_REGISTER_ENB_REQ); //Message Temporarily reuse - RCconfig_S1(msg_p, gnb_id); + RCconfig_NR_S1(msg_p, gnb_id); - if (gnb_id == 0) RCconfig_gtpu(); + if (gnb_id == 0) RCconfig_nr_gtpu(); - s1ap_register_gNB = &S1AP_REGISTER_GNB_REQ(msg_p); + s1ap_register_gNB = &S1AP_REGISTER_ENB_REQ(msg_p); //Message Temporarily reuse LOG_I(GNB_APP,"default drx %d\n",s1ap_register_gNB->default_drx); LOG_I(GNB_APP,"[gNB %d] gNB_app_register for instance %d\n", gnb_id, GNB_MODULE_ID_TO_INSTANCE(gnb_id)); @@ -145,13 +123,13 @@ void *gNB_app_task(void *args_p) uint32_t gnb_id_start = 0; uint32_t gnb_id_end = gnb_id_start + gnb_nb; # if defined(ENABLE_USE_MME) - uint32_t register_gnb_pending; - uint32_t registered_gnb; - long gnb_register_retry_timer_id; + //uint32_t register_gnb_pending; + //uint32_t registered_gnb; + //long gnb_register_retry_timer_id; # endif uint32_t gnb_id; - MessageDef *msg_p = NULL; - const char *msg_name = NULL; + MessageDef *msg_p = NULL; + const char *msg_name = NULL; instance_t instance; int result; /* for no gcc warnings */ @@ -161,13 +139,13 @@ void *gNB_app_task(void *args_p) LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__); - //RCconfig_L1(); + RCconfig_NR_L1(); - //RCconfig_macrlc(); + RCconfig_nr_macrlc(); - LOG_I(PHY, "%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst); + LOG_I(PHY, "%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst); - if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_gNB()==0,"could not initialize L1 north interface\n"); + if (RC.nb_nr_L1_inst>0) AssertFatal(l1_north_init_gNB()==0,"could not initialize L1 north interface\n"); AssertFatal (gnb_nb <= RC.nb_nr_inst, "Number of gNB is greater than gNB defined in configuration file (%d/%d)!", @@ -175,20 +153,20 @@ void *gNB_app_task(void *args_p) LOG_I(GNB_APP,"Allocating gNB_RRC_INST for %d instances\n",RC.nb_nr_inst); - RC.rrc = (gNB_RRC_INST **)malloc(RC.nb_nr_inst*sizeof(gNB_RRC_INST *)); - LOG_I(PHY, "%s() RC.nb_nr_inst:%d RC.rrc:%p\n", __FUNCTION__, RC.nb_nr_inst, RC.rrc); + RC.nrrrc = (gNB_RRC_INST **)malloc(RC.nb_nr_inst*sizeof(gNB_RRC_INST *)); + LOG_I(PHY, "%s() RC.nb_nr_inst:%d RC.nrrrc:%p\n", __FUNCTION__, RC.nb_nr_inst, RC.nrrrc); for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) { - RC.rrc[gnb_id] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST)); - LOG_I(PHY, "%s() Creating RRC instance RC.rrc[%d]:%p (%d of %d)\n", __FUNCTION__, gnb_id, RC.rrc[gnb_id], gnb_id+1, gnb_id_end); - memset((void *)RC.rrc[gnb_id],0,sizeof(gNB_RRC_INST)); - configure_nrrrc(gnb_id); + RC.nrrrc[gnb_id] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST)); + LOG_I(PHY, "%s() Creating RRC instance RC.nrrrc[%d]:%p (%d of %d)\n", __FUNCTION__, gnb_id, RC.nrrrc[gnb_id], gnb_id+1, gnb_id_end); + memset((void *)RC.nrrrc[gnb_id],0,sizeof(gNB_RRC_INST)); + configure_nr_rrc(gnb_id); } # if defined(ENABLE_USE_MME) /* Try to register each gNB */ - registered_gnb = 0; - register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p); + //registered_gnb = 0; + //register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p); # else /* Start L2L1 task */ msg_p = itti_alloc_new_message(TASK_GNB_APP, INITIALIZE_MESSAGE); @@ -213,7 +191,7 @@ void *gNB_app_task(void *args_p) break; # if defined(ENABLE_USE_MME) - +/* case S1AP_REGISTER_ENB_CNF: LOG_I(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name, S1AP_REGISTER_ENB_CNF(msg_p).nb_mme); @@ -221,15 +199,15 @@ void *gNB_app_task(void *args_p) DevAssert(register_gnb_pending > 0); register_gnb_pending--; - /* Check if at least gNB is registered with one MME */ + // Check if at least gNB is registered with one MME if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) { registered_gnb++; } - /* Check if all register gNB requests have been processed */ + // Check if all register gNB requests have been processed if (register_gnb_pending == 0) { if (registered_gnb == gnb_nb) { - /* If all gNB are registered, start L2L1 task */ + // If all gNB are registered, start L2L1 task MessageDef *msg_init_p; msg_init_p = itti_alloc_new_message (TASK_GNB_APP, INITIALIZE_MESSAGE); @@ -241,13 +219,13 @@ void *gNB_app_task(void *args_p) LOG_W(GNB_APP, " %d gNB %s not associated with a MME, retrying registration in %d seconds ...\n", not_associated, not_associated > 1 ? "are" : "is", GNB_REGISTER_RETRY_DELAY); - /* Restart the gNB registration process in GNB_REGISTER_RETRY_DELAY seconds */ + // Restart the gNB registration process in GNB_REGISTER_RETRY_DELAY seconds if (timer_setup (GNB_REGISTER_RETRY_DELAY, 0, TASK_GNB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, NULL, &gnb_register_retry_timer_id) < 0) { LOG_E(GNB_APP, " Can not start gNB register retry timer, use \"sleep\" instead!\n"); sleep(GNB_REGISTER_RETRY_DELAY); - /* Restart the registration process */ + // Restart the registration process registered_gnb = 0; register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p); } @@ -255,7 +233,7 @@ void *gNB_app_task(void *args_p) } break; - +*/ case S1AP_DEREGISTERED_ENB_IND: LOG_W(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name, S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme); @@ -266,11 +244,11 @@ void *gNB_app_task(void *args_p) case TIMER_HAS_EXPIRED: LOG_I(GNB_APP, " Received %s: timer_id %ld\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id); - if (TIMER_HAS_EXPIRED (msg_p).timer_id == gnb_register_retry_timer_id) { + //if (TIMER_HAS_EXPIRED (msg_p).timer_id == gnb_register_retry_timer_id) { /* Restart the registration process */ - registered_gnb = 0; - register_gnb_pending = gNB_app_register(gnb_id_start, gnb_id_end);//, gnb_properties_p); - } + // registered_gnb = 0; + // register_gnb_pending = gNB_app_register(gnb_id_start, gnb_id_end);//, gnb_properties_p); + //} break; # endif diff --git a/openair2/ENB_APP/gnb_app.h b/openair2/GNB_APP/gnb_app.h similarity index 100% rename from openair2/ENB_APP/gnb_app.h rename to openair2/GNB_APP/gnb_app.h diff --git a/openair2/ENB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c similarity index 63% rename from openair2/ENB_APP/gnb_config.c rename to openair2/GNB_APP/gnb_config.c index a52809b62c7f85bfbf2c96b9adbdcf7ae322a125..8bb3f9d7f6c5b7bba5f028a8d6d8fa344abc3ef7 100644 --- a/openair2/ENB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1,3 +1,32 @@ +/* + * 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 + */ + +/* + enb_config.c + ------------------- + AUTHOR : Lionel GAUTHIER, navid nikaein, Laurent Winckel + COMPANY : EURECOM + EMAIL : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr +*/ + #include <string.h> #include <inttypes.h> @@ -18,7 +47,8 @@ // #include "SystemInformationBlockType2.h" // #include "LAYER2/MAC/extern.h" // #include "LAYER2/MAC/proto.h" -#include "PHY/extern.h" +#include "PHY/phy_extern.h" +#include "PHY/INIT/phy_init.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "nfapi_vnf.h" #include "nfapi_pnf.h" @@ -28,7 +58,345 @@ #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "gnb_paramdef.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" + +extern uint16_t sf_ahead; + +void RCconfig_nr_flexran() +{ + uint16_t i; + uint16_t num_gnbs; + char aprefix[MAX_OPTNAME_SIZE*2 + 8]; + /* this will possibly truncate the cell id (RRC assumes int32_t). + * Both Nid_cell and gnb_id are signed in RRC case, but we use unsigned for + * the bitshifting to work properly */ + int32_t Nid_cell = 0; + uint16_t Nid_cell_tr = 0; + uint32_t gnb_id = 0; + + /* + * the only reason for all these variables is, that they are "hard-encoded" + * into the CCPARAMS_DESC macro and we need it for the Nid_cell variable ... + */ + char *frame_type, *DL_prefix_type, *UL_prefix_type, *SIB1_frequencyOffsetSSB, + *DL_SCS_SubcarrierSpacing, *DL_BWP_SubcarrierSpacing, *DL_BWP_prefix_type, + *UL_frequencyShift7p5khz, *UL_SCS_SubcarrierSpacing, *UL_BWP_SubcarrierSpacing, + *UL_BWP_prefix_type, *ServingCellConfigCommon_ssb_PositionsInBurst_PR, + *NIA_SubcarrierSpacing, *referenceSubcarrierSpacing, *dl_UL_TransmissionPeriodicity, + *rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice, + *rach_groupBconfigured, *rach_messagePowerOffsetGroupB, + *prach_RootSequenceIndex_choice, *prach_msg1_SubcarrierSpacing, + *restrictedSetConfig, *msg3_transformPrecoding, *prach_msg1_FDM, + *powerRampingStep, *groupHoppingEnabledTransformPrecoding, + *PUSCH_TimeDomainResourceAllocation_mappingType, *pucch_GroupHopping, + *PDSCH_TimeDomainResourceAllocation_mappingType, *RateMatchPattern_patternType, + *symbolsInResourceBlock, *RateMatchPattern_subcarrierSpacing, *RateMatchPattern_mode, + *PDCCH_cce_REG_MappingType, *PDCCH_precoderGranularity, + *tci_PresentInDCI, *SearchSpace_monitoringSlotPeriodicityAndOffset_choice, + *SearchSpace_searchSpaceType, *ue_Specific__dci_Formats, + *RateMatchPatternLTE_CRS_subframeAllocation_choice; + + long long int downlink_frequency; + + int32_t eutra_band, uplink_frequency_offset, N_RB_DL, nb_antenna_ports, + MIB_subCarrierSpacingCommon, MIB_ssb_SubcarrierOffset, MIB_dmrs_TypeA_Position, + pdcch_ConfigSIB1, SIB1_ssb_PeriodicityServingCell, SIB1_ss_PBCH_BlockPower, + absoluteFrequencySSB, ssb_SubcarrierOffset, DL_FreqBandIndicatorNR, + DL_absoluteFrequencyPointA, DL_offsetToCarrier, DL_SCS_SpecificCarrier_k0, + DL_carrierBandwidth, DL_locationAndBandwidth, UL_FreqBandIndicatorNR, + UL_absoluteFrequencyPointA, UL_additionalSpectrumEmission, UL_p_Max, + UL_offsetToCarrier, UL_SCS_SpecificCarrier_k0, UL_carrierBandwidth, + UL_locationAndBandwidth, ServingCellConfigCommon_ssb_periodicityServingCell, + ServingCellConfigCommon_dmrs_TypeA_Position, ServingCellConfigCommon_ss_PBCH_BlockPower, + nrofDownlinkSlots, nrofDownlinkSymbols, nrofUplinkSlots, nrofUplinkSymbols, + rach_totalNumberOfRA_Preambles, rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth, + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth, + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf, + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one, + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two, + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four, + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight, + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen, + rach_ra_Msg3SizeGroupA, rach_numberOfRA_PreamblesGroupA, rach_ra_ContentionResolutionTimer, + rsrp_ThresholdSSB, rsrp_ThresholdSSB_SUL, prach_RootSequenceIndex_l839, + prach_RootSequenceIndex_l139, prach_ConfigurationIndex, prach_msg1_FrequencyStart, + zeroCorrelationZoneConfig, preambleReceivedTargetPower, preambleTransMax, + ra_ResponseWindow, msg3_DeltaPreamble, p0_NominalWithGrant, + PUSCH_TimeDomainResourceAllocation_k2, p0_nominal, PDSCH_TimeDomainResourceAllocation_k0, + rateMatchPatternId, periodicityAndPattern, RateMatchPattern_controlResourceSet, + searchSpaceSIB1, searchSpaceOtherSystemInformation, pagingSearchSpace, + ra_SearchSpace, rach_ra_ControlResourceSet, PDCCH_common_controlResourceSetId, + PDCCH_common_ControlResourceSet_duration, PDCCH_reg_BundleSize, PDCCH_interleaverSize, + PDCCH_shiftIndex, PDCCH_TCI_StateId, SearchSpaceId, commonSearchSpaces_controlResourceSetId, + SearchSpace_monitoringSlotPeriodicityAndOffset_sl1, + SearchSpace_monitoringSlotPeriodicityAndOffset_sl2, + SearchSpace_monitoringSlotPeriodicityAndOffset_sl4, + SearchSpace_monitoringSlotPeriodicityAndOffset_sl5, + SearchSpace_monitoringSlotPeriodicityAndOffset_sl8, + SearchSpace_monitoringSlotPeriodicityAndOffset_sl10, + SearchSpace_monitoringSlotPeriodicityAndOffset_sl16, + SearchSpace_monitoringSlotPeriodicityAndOffset_sl20, + SearchSpace_nrofCandidates_aggregationLevel1, + SearchSpace_nrofCandidates_aggregationLevel2, + SearchSpace_nrofCandidates_aggregationLevel4, + SearchSpace_nrofCandidates_aggregationLevel8, + SearchSpace_nrofCandidates_aggregationLevel16, + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1, + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2, + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4, + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8, + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16, + Common_dci_Format2_3_monitoringPeriodicity, + Common_dci_Format2_3_nrofPDCCH_Candidates, + RateMatchPatternLTE_CRS_carrierFreqDL, + RateMatchPatternLTE_CRS_carrierBandwidthDL, + RateMatchPatternLTE_CRS_nrofCRS_Ports, + RateMatchPatternLTE_CRS_v_Shift, + RateMatchPatternLTE_CRS_radioframeAllocationPeriod, + RateMatchPatternLTE_CRS_radioframeAllocationOffset + ; + + /* get number of gNBs */ + paramdef_t GNBSParams[] = GNBSPARAMS_DESC; + config_get(GNBSParams, sizeof(GNBSParams)/sizeof(paramdef_t), NULL); + num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; + + /* for gNB ID */ + paramdef_t GNBParams[] = GNBPARAMS_DESC; + paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST, NULL, 0}; + + /* for Nid_cell */ + checkedparam_t config_check_CCparams[] = NRCCPARAMS_CHECK; + paramdef_t CCsParams[] = NRCCPARAMS_DESC; + paramlist_def_t CCsParamList = {GNB_CONFIG_STRING_COMPONENT_CARRIERS, NULL, 0}; + /* map parameter checking array instances to parameter definition array instances */ + for (int I = 0; I < (sizeof(CCsParams) / sizeof(paramdef_t)); I++) { + CCsParams[I].chkPptr = &(config_check_CCparams[I]); + } + + paramdef_t flexranParams[] = FLEXRANPARAMS_DESC; + config_get(flexranParams, sizeof(flexranParams)/sizeof(paramdef_t), CONFIG_STRING_NETWORK_CONTROLLER_CONFIG); + + if (!RC.flexran) { + RC.flexran = calloc(num_gnbs, sizeof(flexran_agent_info_t*)); + AssertFatal(RC.flexran, + "can't ALLOCATE %zu Bytes for %d flexran agent info with size %zu\n", + num_gnbs * sizeof(flexran_agent_info_t*), + num_gnbs, sizeof(flexran_agent_info_t*)); + } + + for (i = 0; i < num_gnbs; i++) { + RC.flexran[i] = calloc(1, sizeof(flexran_agent_info_t)); + AssertFatal(RC.flexran[i], + "can't ALLOCATE %zu Bytes for flexran agent info (iteration %d/%d)\n", + sizeof(flexran_agent_info_t), i + 1, num_gnbs); + /* if config says "yes", enable Agent, in all other cases it's like "no" */ + RC.flexran[i]->enabled = strcasecmp(*(flexranParams[FLEXRAN_ENABLED].strptr), "yes") == 0; + /* if not enabled, simply skip the rest, it is not needed anyway */ + if (!RC.flexran[i]->enabled) + continue; + RC.flexran[i]->interface_name = strdup(*(flexranParams[FLEXRAN_INTERFACE_NAME_IDX].strptr)); + //inet_ntop(AF_INET, &(enb_properties->properties[mod_id]->flexran_agent_ipv4_address), in_ip, INET_ADDRSTRLEN); + RC.flexran[i]->remote_ipv4_addr = strdup(*(flexranParams[FLEXRAN_IPV4_ADDRESS_IDX].strptr)); + RC.flexran[i]->remote_port = *(flexranParams[FLEXRAN_PORT_IDX].uptr); + RC.flexran[i]->cache_name = strdup(*(flexranParams[FLEXRAN_CACHE_IDX].strptr)); + RC.flexran[i]->node_ctrl_state = strcasecmp(*(flexranParams[FLEXRAN_AWAIT_RECONF_IDX].strptr), "yes") == 0 ? ENB_WAIT : ENB_NORMAL_OPERATION; + + config_getlist(&GNBParamList, GNBParams, sizeof(GNBParams)/sizeof(paramdef_t),NULL); + /* gNB ID from configuration, as read in by RCconfig_RRC() */ + if (!GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr) { + // Calculate a default gNB ID +# if defined(ENABLE_USE_MME) + gnb_id = i + (s1ap_generate_eNB_id () & 0xFFFF8); +# else + gnb_id = i; +# endif + } else { + gnb_id = *(GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr); + } + + /* cell ID */ + sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, i); + config_getlist(&CCsParamList, NULL, 0, aprefix); + if (CCsParamList.numelt > 0) { + sprintf(aprefix, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, i, GNB_CONFIG_STRING_COMPONENT_CARRIERS, 0); + config_get(CCsParams, sizeof(CCsParams)/sizeof(paramdef_t), aprefix); + Nid_cell_tr = (uint16_t) Nid_cell; + } + + RC.flexran[i]->mod_id = i; + RC.flexran[i]->agent_id = (((uint64_t)i) << 48) | (((uint64_t)gnb_id) << 16) | ((uint64_t)Nid_cell_tr); + + /* assume for the moment the monolithic case, i.e. agent can provide + * information for all layers */ + RC.flexran[i]->capability_mask = FLEXRAN_CAP_LOPHY | FLEXRAN_CAP_HIPHY + | FLEXRAN_CAP_LOMAC | FLEXRAN_CAP_HIMAC + | FLEXRAN_CAP_RLC | FLEXRAN_CAP_PDCP + | FLEXRAN_CAP_SDAP | FLEXRAN_CAP_RRC; + } +} + +void RCconfig_NR_L1(void) { + int i,j; + paramdef_t L1_Params[] = L1PARAMS_DESC; + paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; + + + if (RC.gNB == NULL) { + RC.gNB = (PHY_VARS_gNB ***)malloc((1+NUMBER_OF_gNB_MAX)*sizeof(PHY_VARS_gNB**)); + LOG_I(NR_PHY,"RC.gNB = %p\n",RC.gNB); + memset(RC.gNB,0,(1+NUMBER_OF_gNB_MAX)*sizeof(PHY_VARS_gNB**)); + RC.nb_nr_L1_CC = malloc((1+RC.nb_nr_L1_inst)*sizeof(int)); + } + + config_getlist( &L1_ParamList,L1_Params,sizeof(L1_Params)/sizeof(paramdef_t), NULL); + + if (L1_ParamList.numelt > 0) { + + for (j = 0; j < RC.nb_nr_L1_inst; j++) { + RC.nb_nr_L1_CC[j] = *(L1_ParamList.paramarray[j][L1_CC_IDX].uptr); + + if (RC.gNB[j] == NULL) { + RC.gNB[j] = (PHY_VARS_gNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_gNB*)); + LOG_I(NR_PHY,"RC.gNB[%d] = %p\n",j,RC.gNB[j]); + memset(RC.gNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_gNB*)); + } + + for (i=0;i<RC.nb_nr_L1_CC[j];i++) { + if (RC.gNB[j][i] == NULL) { + RC.gNB[j][i] = (PHY_VARS_gNB *)malloc(sizeof(PHY_VARS_gNB)); + memset((void*)RC.gNB[j][i],0,sizeof(PHY_VARS_gNB)); + LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.gNB[j][i]); + RC.gNB[j][i]->Mod_id = j; + RC.gNB[j][i]->CC_id = i; + } + } + + if(strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) { + sf_ahead = 4; // Need 4 subframe gap between RX and TX + }else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) { + RC.gNB[j][0]->eth_params_n.local_if_name = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_IF_NAME_IDX].strptr)); + RC.gNB[j][0]->eth_params_n.my_addr = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_ADDRESS_IDX].strptr)); + RC.gNB[j][0]->eth_params_n.remote_addr = strdup(*(L1_ParamList.paramarray[j][L1_REMOTE_N_ADDRESS_IDX].strptr)); + RC.gNB[j][0]->eth_params_n.my_portc = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTC_IDX].iptr); + RC.gNB[j][0]->eth_params_n.remote_portc = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTC_IDX].iptr); + RC.gNB[j][0]->eth_params_n.my_portd = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTD_IDX].iptr); + RC.gNB[j][0]->eth_params_n.remote_portd = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr); + RC.gNB[j][0]->eth_params_n.transp_preference = ETH_UDP_MODE; + + sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2 + + RC.nb_nr_macrlc_inst = 1; // This is used by mac_top_init_gNB() + + // This is used by init_gNB_afterRU() + RC.nb_nr_CC = (int *)malloc((1+RC.nb_nr_inst)*sizeof(int)); + RC.nb_nr_CC[0]=1; + + RC.nb_nr_inst =1; // DJP - feptx_prec uses num_gNB but phy_init_RU uses nb_nr_inst + + LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_nr_inst=1 this is because phy_init_RU() uses that to index and not RC.num_gNB - why the 2 similar variables?\n", __FUNCTION__); + LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_nr_CC[0]=%d for init_gNB_afterRU()\n", __FUNCTION__, RC.nb_nr_CC[0]); + LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_nr_macrlc_inst:%d because used by mac_top_init_gNB()\n", __FUNCTION__, RC.nb_nr_macrlc_inst); + + mac_top_init_gNB(); + + configure_nfapi_pnf(RC.gNB[j][0]->eth_params_n.remote_addr, RC.gNB[j][0]->eth_params_n.remote_portc, RC.gNB[j][0]->eth_params_n.my_addr, RC.gNB[j][0]->eth_params_n.my_portd, RC.gNB[j][0]->eth_params_n .remote_portd); + }else { // other midhaul + } + }// for (j = 0; j < RC.nb_nr_L1_inst; j++) + printf("Initializing northbound interface for L1\n"); + l1_north_init_gNB(); + }else{ + LOG_I(PHY,"No " CONFIG_STRING_L1_LIST " configuration found"); + + // DJP need to create some structures for VNF + + j = 0; + + RC.nb_nr_L1_CC = malloc((1+RC.nb_nr_L1_inst)*sizeof(int)); // DJP - 1 lot then??? + + RC.nb_nr_L1_CC[j]=1; // DJP - hmmm + + if (RC.gNB[j] == NULL) { + RC.gNB[j] = (PHY_VARS_gNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_gNB**)); + LOG_I(PHY,"RC.gNB[%d] = %p\n",j,RC.gNB[j]); + memset(RC.gNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_gNB***)); + } + for (i=0;i<RC.nb_nr_L1_CC[j];i++) { + if (RC.gNB[j][i] == NULL) { + RC.gNB[j][i] = (PHY_VARS_gNB *)malloc(sizeof(PHY_VARS_gNB)); + memset((void*)RC.gNB[j][i],0,sizeof(PHY_VARS_gNB)); + LOG_I(PHY,"RC.gNB[%d][%d] = %p\n",j,i,RC.gNB[j][i]); + RC.gNB[j][i]->Mod_id = j; + RC.gNB[j][i]->CC_id = i; + } + } // END for (i=0;i<RC.nb_nr_L1_CC[j];i++) + + } +} + +void RCconfig_nr_macrlc() { + int j; + + paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC; + paramlist_def_t MacRLC_ParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; + + config_getlist( &MacRLC_ParamList,MacRLC_Params,sizeof(MacRLC_Params)/sizeof(paramdef_t), NULL); + + if ( MacRLC_ParamList.numelt > 0) { + + RC.nb_nr_macrlc_inst=MacRLC_ParamList.numelt; + mac_top_init_gNB(); + RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int)); + + for (j=0;j<RC.nb_nr_macrlc_inst;j++) { + RC.nb_nr_mac_CC[j] = *(MacRLC_ParamList.paramarray[j][MACRLC_CC_IDX].iptr); + //RC.nrmac[j]->phy_test = *(MacRLC_ParamList.paramarray[j][MACRLC_PHY_TEST_IDX].iptr); + //printf("PHY_TEST = %d,%d\n", RC.nrmac[j]->phy_test, j); + + if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) { + // check number of instances is same as RRC/PDCP + + }else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "cudu") == 0) { + RC.nrmac[j]->eth_params_n.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr)); + RC.nrmac[j]->eth_params_n.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr)); + RC.nrmac[j]->eth_params_n.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_ADDRESS_IDX].strptr)); + RC.nrmac[j]->eth_params_n.my_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTC_IDX].iptr); + RC.nrmac[j]->eth_params_n.remote_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTC_IDX].iptr); + RC.nrmac[j]->eth_params_n.my_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_PORTD_IDX].iptr); + RC.nrmac[j]->eth_params_n.remote_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_PORTD_IDX].iptr);; + RC.nrmac[j]->eth_params_n.transp_preference = ETH_UDP_MODE; + }else { // other midhaul + AssertFatal(1==0,"MACRLC %d: %s unknown northbound midhaul\n",j, *(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr)); + } + + if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_L1") == 0) { + + }else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "nfapi") == 0) { + RC.nrmac[j]->eth_params_s.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_IF_NAME_IDX].strptr)); + RC.nrmac[j]->eth_params_s.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_ADDRESS_IDX].strptr)); + RC.nrmac[j]->eth_params_s.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_ADDRESS_IDX].strptr)); + RC.nrmac[j]->eth_params_s.my_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTC_IDX].iptr); + RC.nrmac[j]->eth_params_s.remote_portc = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTC_IDX].iptr); + RC.nrmac[j]->eth_params_s.my_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_PORTD_IDX].iptr); + RC.nrmac[j]->eth_params_s.remote_portd = *(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_S_PORTD_IDX].iptr); + RC.nrmac[j]->eth_params_s.transp_preference = ETH_UDP_MODE; + + sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2 + + printf("**************** vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc); + configure_nfapi_vnf(RC.nrmac[j]->eth_params_s.my_addr, RC.nrmac[j]->eth_params_s.my_portc); + printf("**************** RETURNED FROM configure_nfapi_vnf() vnf_port:%d\n", RC.nrmac[j]->eth_params_s.my_portc); + }else { // other midhaul + AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr)); + } + }// for (j=0;j<RC.nb_nr_macrlc_inst;j++) + }else {// MacRLC_ParamList.numelt > 0 + AssertFatal (0,"No " CONFIG_STRING_MACRLC_LIST " configuration found"); + } + +} int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { @@ -52,58 +420,58 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { ///NR //MIB int32_t MIB_subCarrierSpacingCommon = 0; - uint32_t MIB_ssb_SubcarrierOffset = 0; + int32_t MIB_ssb_SubcarrierOffset = 0; int32_t MIB_dmrs_TypeA_Position = 0; - uint32_t pdcch_ConfigSIB1 = 0; + int32_t pdcch_ConfigSIB1 = 0; //SIB1 - int32_t SIB1_frequencyOffsetSSB = 0; + char* SIB1_frequencyOffsetSSB = NULL; int32_t SIB1_ssb_PeriodicityServingCell = 0; int32_t SIB1_ss_PBCH_BlockPower = 0; //NR FrequencyInfoDL int32_t absoluteFrequencySSB = 0; - uint32_t ssb_SubcarrierOffset = 0; + int32_t ssb_SubcarrierOffset = 0; int32_t DL_FreqBandIndicatorNR = 0; int32_t DL_absoluteFrequencyPointA = 0; //NR DL SCS-SpecificCarrier - uint32_t DL_offsetToCarrier = 0; - int32_t DL_SCS_SubcarrierSpacing = 0; + int32_t DL_offsetToCarrier = 0; + char* DL_SCS_SubcarrierSpacing = 0; int32_t DL_SCS_SpecificCarrier_k0 = 0; - uint32_t DL_carrierBandwidth = 0; + int32_t DL_carrierBandwidth = 0; // NR BWP-DownlinkCommon - uint32_t DL_locationAndBandwidth = 0; - long DL_BWP_SubcarrierSpacing = 0; + int32_t DL_locationAndBandwidth = 0; + char* DL_BWP_SubcarrierSpacing = 0; char* DL_BWP_prefix_type = NULL; //NR FrequencyInfoUL int32_t UL_FreqBandIndicatorNR = 0; int32_t UL_absoluteFrequencyPointA = 0; - uint32_t UL_additionalSpectrumEmission = 0; + int32_t UL_additionalSpectrumEmission = 0; int32_t UL_p_Max = 0; - int32_t UL_frequencyShift7p5khz = 0; + char* UL_frequencyShift7p5khz = 0; //NR UL SCS-SpecificCarrier - uint32_t UL_offsetToCarrier = 0; - int32_t UL_SCS_SubcarrierSpacing = 0; + int32_t UL_offsetToCarrier = 0; + char* UL_SCS_SubcarrierSpacing = 0; int32_t UL_SCS_SpecificCarrier_k0 = 0; - uint32_t UL_carrierBandwidth = 0; + int32_t UL_carrierBandwidth = 0; // NR BWP-UplinkCommon - uint32_t UL_locationAndBandwidth = 0; - long UL_BWP_SubcarrierSpacing = 0; + int32_t UL_locationAndBandwidth = 0; + char* UL_BWP_SubcarrierSpacing = 0; char* UL_BWP_prefix_type = NULL; - int32_t ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0; + char* ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0; int32_t ServingCellConfigCommon_ssb_periodicityServingCell = 0; int32_t ServingCellConfigCommon_dmrs_TypeA_Position = 0; - int32_t NIA_SubcarrierSpacing = 0; + char* NIA_SubcarrierSpacing = 0; int32_t ServingCellConfigCommon_ss_PBCH_BlockPower = 0; //NR TDD-UL-DL-ConfigCommon - int32_t referenceSubcarrierSpacing = 0; - int32_t dl_UL_TransmissionPeriodicity = 0; + char* referenceSubcarrierSpacing = 0; + char* dl_UL_TransmissionPeriodicity = 0; int32_t nrofDownlinkSlots = 0; int32_t nrofDownlinkSymbols = 0; int32_t nrofUplinkSlots = 0; @@ -111,38 +479,38 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { //NR RACH-ConfigCommon int32_t rach_totalNumberOfRA_Preambles = 0; - int32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice = 0; + char* rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice = 0; int32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth = 0; int32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth = 0; int32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf = 0; int32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one = 0; int32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two = 0; - uint32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four = 0; - uint32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight = 0; - uint32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen = 0; + int32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four = 0; + int32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight = 0; + int32_t rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen = 0; char* rach_groupBconfigured = NULL; int32_t rach_ra_Msg3SizeGroupA = 0; - int32_t rach_messagePowerOffsetGroupB = 0; + char* rach_messagePowerOffsetGroupB = NULL; int32_t rach_numberOfRA_PreamblesGroupA = 0; int32_t rach_ra_ContentionResolutionTimer = 0; int32_t rsrp_ThresholdSSB = 0; int32_t rsrp_ThresholdSSB_SUL = 0; - int32_t prach_RootSequenceIndex_choice = 0; - uint32_t prach_RootSequenceIndex_l839 = 0; - uint32_t prach_RootSequenceIndex_l139 = 0; - int32_t prach_msg1_SubcarrierSpacing = 0; - int32_t restrictedSetConfig = 0; - int32_t msg3_transformPrecoding = 0; + char* prach_RootSequenceIndex_choice = NULL; + int32_t prach_RootSequenceIndex_l839 = 0; + int32_t prach_RootSequenceIndex_l139 = 0; + char* prach_msg1_SubcarrierSpacing = NULL; + char* restrictedSetConfig = NULL; + char* msg3_transformPrecoding = NULL; //ssb-perRACH-OccasionAndCB-PreamblesPerSSB not sure //NR RACH-ConfigGeneric int32_t prach_ConfigurationIndex = 0; - int32_t prach_msg1_FDM = 0; + char* prach_msg1_FDM = NULL; int32_t prach_msg1_FrequencyStart = 0; int32_t zeroCorrelationZoneConfig = 0; int32_t preambleReceivedTargetPower = 0; int32_t preambleTransMax = 0; - int32_t powerRampingStep = 0; + char* powerRampingStep = NULL; int32_t ra_ResponseWindow = 0; //PUSCH-ConfigCommon @@ -152,25 +520,25 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { ///PUSCH-TimeDomainResourceAllocation int32_t PUSCH_TimeDomainResourceAllocation_k2 = 0; - int32_t PUSCH_TimeDomainResourceAllocation_mappingType = 0; + char* PUSCH_TimeDomainResourceAllocation_mappingType = NULL; //PUCCH-ConfigCommon - int32_t pucch_GroupHopping = 0; + char* pucch_GroupHopping = NULL; int32_t p0_nominal = 0; //PDSCH-ConfigCOmmon //PDSCH-TimeDomainResourceAllocation int32_t PDSCH_TimeDomainResourceAllocation_k0 = 0; - int32_t PDSCH_TimeDomainResourceAllocation_mappingType = 0; + char* PDSCH_TimeDomainResourceAllocation_mappingType = NULL; //RateMatchPattern is used to configure one rate matching pattern for PDSCH int32_t rateMatchPatternId = 0; - int32_t RateMatchPattern_patternType = 0; - int32_t symbolsInResourceBlock = 0; + char* RateMatchPattern_patternType = NULL; + char* symbolsInResourceBlock = NULL; int32_t periodicityAndPattern = 0; int32_t RateMatchPattern_controlResourceSet = 0; - int32_t RateMatchPattern_subcarrierSpacing = 0; - int32_t RateMatchPattern_mode = 0; + char* RateMatchPattern_subcarrierSpacing = NULL; + char* RateMatchPattern_mode = NULL; //PDCCH-ConfigCommon int32_t searchSpaceSIB1 = 0; @@ -181,17 +549,18 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { //NR PDCCH-ConfigCommon commonControlResourcesSets int32_t PDCCH_common_controlResourceSetId = 0; int32_t PDCCH_common_ControlResourceSet_duration = 0; - int32_t PDCCH_cce_REG_MappingType = 0; + char* PDCCH_cce_REG_MappingType = NULL; int32_t PDCCH_reg_BundleSize = 0; int32_t PDCCH_interleaverSize = 0; int32_t PDCCH_shiftIndex = 0; - int32_t PDCCH_precoderGranularity = 0; + char* PDCCH_precoderGranularity = NULL; + int32_t PDCCH_TCI_StateId = 0; char* tci_PresentInDCI = NULL; //NR PDCCH-ConfigCommon commonSearchSpaces int32_t SearchSpaceId = 0; int32_t commonSearchSpaces_controlResourceSetId = 0; - int32_t SearchSpace_monitoringSlotPeriodicityAndOffset_choice = 0; + char* SearchSpace_monitoringSlotPeriodicityAndOffset_choice = NULL; int32_t SearchSpace_monitoringSlotPeriodicityAndOffset_sl1 = 0; int32_t SearchSpace_monitoringSlotPeriodicityAndOffset_sl2 = 0; int32_t SearchSpace_monitoringSlotPeriodicityAndOffset_sl4 = 0; @@ -205,7 +574,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { int32_t SearchSpace_nrofCandidates_aggregationLevel4 = 0; int32_t SearchSpace_nrofCandidates_aggregationLevel8 = 0; int32_t SearchSpace_nrofCandidates_aggregationLevel16 = 0; - int32_t SearchSpace_searchSpaceType = 0; + char* SearchSpace_searchSpaceType = NULL; int32_t Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1 = 0; int32_t Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2 = 0; int32_t Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4 = 0; @@ -213,15 +582,22 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { int32_t Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16 = 0; int32_t Common_dci_Format2_3_monitoringPeriodicity = 0; int32_t Common_dci_Format2_3_nrofPDCCH_Candidates = 0; - int32_t ue_Specific__dci_Formats = 0; + char* ue_Specific__dci_Formats = NULL; //NR RateMatchPatternLTE-CRS - uint32_t RateMatchPatternLTE_CRS_carrierFreqDL = 0; + int32_t RateMatchPatternLTE_CRS_carrierFreqDL = 0; int32_t RateMatchPatternLTE_CRS_carrierBandwidthDL = 0; int32_t RateMatchPatternLTE_CRS_nrofCRS_Ports = 0; int32_t RateMatchPatternLTE_CRS_v_Shift = 0; int32_t RateMatchPatternLTE_CRS_radioframeAllocationPeriod = 0; - uint32_t RateMatchPatternLTE_CRS_radioframeAllocationOffset = 0; - int32_t RateMatchPatternLTE_CRS_subframeAllocation_choice = 0; + int32_t RateMatchPatternLTE_CRS_radioframeAllocationOffset = 0; + char* RateMatchPatternLTE_CRS_subframeAllocation_choice = NULL; + + int32_t srb1_timer_poll_retransmit = 0; + int32_t srb1_timer_reordering = 0; + int32_t srb1_timer_status_prohibit = 0; + int32_t srb1_poll_pdu = 0; + int32_t srb1_poll_byte = 0; + int32_t srb1_max_retx_threshold = 0; int32_t my_int; @@ -230,8 +606,8 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { paramdef_t GNBParams[] = GNBPARAMS_DESC; paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0}; ////////// Physical parameters - checkedparam_t config_check_CCparams[] = CCPARAMS_CHECK; - paramdef_t CCsParams[] = CCPARAMS_DESC; + checkedparam_t config_check_CCparams[] = NRCCPARAMS_CHECK; + paramdef_t CCsParams[] = NRCCPARAMS_DESC; paramlist_def_t CCsParamList = {GNB_CONFIG_STRING_COMPONENT_CARRIERS,NULL,0}; paramdef_t SRB1Params[] = SRB1PARAMS_DESC; @@ -313,7 +689,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { sprintf(gnbpath,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k), config_getlist( &CCsParamList,NULL,0,gnbpath); - LOG_I(NRRRC,"num component carriers %d \n", num_component_carriers); + LOG_I(NR_RRC,"num component carriers %d \n", num_component_carriers); if ( CCsParamList.numelt> 0) { @@ -371,11 +747,13 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } NRRRC_CONFIGURATION_REQ (msg_p).N_RB_DL[j]= N_RB_DL; - + + /* if ((N_RB_DL!=6) && (N_RB_DL!=15) && (N_RB_DL!=25) && (N_RB_DL!=50) && (N_RB_DL!=75) && (N_RB_DL!=100)) { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for N_RB_DL choice: 6,15,25,50,75,100 !\n", RC.config_file_name, i, N_RB_DL); } + */ if (strcmp(frame_type, "FDD") == 0) { NRRRC_CONFIGURATION_REQ (msg_p).frame_type[j] = FDD; @@ -386,16 +764,28 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { RC.config_file_name, i, frame_type); } - if (!prefix_type){ + if (!DL_prefix_type){ + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d define %s: NORMAL,EXTENDED!\n", + RC.config_file_name, i, GNB_CONFIG_STRING_DL_PREFIX_TYPE); + }else if (strcmp(DL_prefix_type, "NORMAL") == 0) { + NRRRC_CONFIGURATION_REQ (msg_p).DL_prefix_type[j] = NORMAL; + }else if (strcmp(DL_prefix_type, "EXTENDED") == 0) { + NRRRC_CONFIGURATION_REQ (msg_p).DL_prefix_type[j] = EXTENDED; + }else { + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for DL_prefix_type choice: NORMAL or EXTENDED !\n", + RC.config_file_name, i, DL_prefix_type); + } + + if (!UL_prefix_type){ AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d define %s: NORMAL,EXTENDED!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PREFIX_TYPE); - }else if (strcmp(prefix_type, "NORMAL") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = NORMAL; - }else if (strcmp(prefix_type, "EXTENDED") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = EXTENDED; + RC.config_file_name, i, GNB_CONFIG_STRING_UL_PREFIX_TYPE); + }else if (strcmp(UL_prefix_type, "NORMAL") == 0) { + NRRRC_CONFIGURATION_REQ (msg_p).UL_prefix_type[j] = NORMAL; + }else if (strcmp(UL_prefix_type, "EXTENDED") == 0) { + NRRRC_CONFIGURATION_REQ (msg_p).UL_prefix_type[j] = EXTENDED; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n", - RC.config_file_name, i, prefix_type); + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for UL_prefix_type choice: NORMAL or EXTENDED !\n", + RC.config_file_name, i, UL_prefix_type); } NRRRC_CONFIGURATION_REQ (msg_p).eutra_band[j] = eutra_band; @@ -452,7 +842,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }else if (strcmp(SIB1_frequencyOffsetSSB , "khz5") == 0) { NRRRC_CONFIGURATION_REQ (msg_p).SIB1_frequencyOffsetSSB[j] = 5; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SIB1_frequencyOffsetSSB !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for SIB1_frequencyOffsetSSB !\n", RC.config_file_name, i, SIB1_frequencyOffsetSSB); } @@ -462,7 +852,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { (SIB1_ssb_PeriodicityServingCell !=20) && (SIB1_ssb_PeriodicityServingCell !=40) && (SIB1_ssb_PeriodicityServingCell !=80) && - (SIB1_ssb_PeriodicityServingCell !=160)&&){ + (SIB1_ssb_PeriodicityServingCell !=160) ){ AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SIB1_ssb_PeriodicityServingCell choice: 5,10,20,40,80,160 !\n", RC.config_file_name, i, SIB1_ssb_PeriodicityServingCell); } @@ -507,15 +897,15 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(DL_SCS_SubcarrierSpacing,"kHz15")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15; + NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz15; }else if (strcmp(DL_SCS_SubcarrierSpacing,"kHz30")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30; + NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz30; }else if (strcmp(DL_SCS_SubcarrierSpacing,"kHz60")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60; + NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz60; }else if (strcmp(DL_SCS_SubcarrierSpacing,"kHz120")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120; + NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz120; }else if (strcmp(DL_SCS_SubcarrierSpacing,"kHz240")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240; + NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz240; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for DL_SCS_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n", RC.config_file_name, i, DL_SCS_SubcarrierSpacing); @@ -523,15 +913,15 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch (DL_SCS_SpecificCarrier_k0) { case -6: - NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SpecificCarrier_k0[j] = SCS_SpecificCarrier__k0_n_6; + NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SpecificCarrier_k0[j] = NR_SCS_SpecificCarrier__k0_n_6; break; case 0: - NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SpecificCarrier_k0[j] = SCS_SpecificCarrier__k0_n0; + NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SpecificCarrier_k0[j] = NR_SCS_SpecificCarrier__k0_n0; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SpecificCarrier_k0[j] = SCS_SpecificCarrier__k0_n6; + NRRRC_CONFIGURATION_REQ (msg_p).DL_SCS_SpecificCarrier_k0[j] = NR_SCS_SpecificCarrier__k0_n6; break; default: @@ -554,15 +944,15 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(DL_BWP_SubcarrierSpacing,"kHz15")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15; + NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz15; }else if (strcmp(DL_BWP_SubcarrierSpacing,"kHz30")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30; + NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz30; }else if (strcmp(DL_BWP_SubcarrierSpacing,"kHz60")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60; + NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz60; }else if (strcmp(DL_BWP_SubcarrierSpacing,"kHz120")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120; + NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz120; }else if (strcmp(DL_BWP_SubcarrierSpacing,"kHz240")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240; + NRRRC_CONFIGURATION_REQ (msg_p).DL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz240; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for DL_BWP_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n", RC.config_file_name, i, DL_BWP_SubcarrierSpacing); @@ -605,10 +995,10 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { RC.config_file_name, i, UL_p_Max); } - if (strcmp(UL_frequencyShift7p5khz, "TRUE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).UL_frequencyShift7p5khz[j] = FrequencyInfoUL__frequencyShift7p5khz_true; //enum true = 0 - }else if{ - RRC_CONFIGURATION_REQ (msg_p).UL_frequencyShift7p5khz[j] = 1;//false + if (strcmp(UL_frequencyShift7p5khz,"TRUE") == 0) { + NRRRC_CONFIGURATION_REQ (msg_p).UL_frequencyShift7p5khz[j] = NR_FrequencyInfoUL__frequencyShift7p5khz_true; //enum true = 0 + }else{ + NRRRC_CONFIGURATION_REQ (msg_p).UL_frequencyShift7p5khz[j] = 1;//false } /////////////////////////////////NR UL SCS-SpecificCarrier/////////////////////////// @@ -619,30 +1009,30 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(UL_SCS_SubcarrierSpacing,"kHz15")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15; + NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz15; }else if (strcmp(UL_SCS_SubcarrierSpacing,"kHz30")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30; + NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz30; }else if (strcmp(UL_SCS_SubcarrierSpacing,"kHz60")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60; + NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz60; }else if (strcmp(UL_SCS_SubcarrierSpacing,"kHz120")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120; + NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz120; }else if (strcmp(UL_SCS_SubcarrierSpacing,"kHz240")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240; + NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz240; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for UL_SCS_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n", RC.config_file_name, i, UL_SCS_SubcarrierSpacing); } switch (UL_SCS_SpecificCarrier_k0) { case -6: - NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SpecificCarrier_k0[j] = SCS_SpecificCarrier__k0_n_6; + NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SpecificCarrier_k0[j] = NR_SCS_SpecificCarrier__k0_n_6; break; case 0: - NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SpecificCarrier_k0[j] = SCS_SpecificCarrier__k0_n0; + NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SpecificCarrier_k0[j] = NR_SCS_SpecificCarrier__k0_n0; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SpecificCarrier_k0[j] = SCS_SpecificCarrier__k0_n6; + NRRRC_CONFIGURATION_REQ (msg_p).UL_SCS_SpecificCarrier_k0[j] = NR_SCS_SpecificCarrier__k0_n6; break; default: @@ -658,16 +1048,6 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } - - //Not Sure the value selection - NRRRC_CONFIGURATION_REQ (msg_p).absoluteFrequencyPointA[j] = absoluteFrequencyPointA; - - NRRRC_CONFIGURATION_REQ (msg_p).ControlResourceSetId[j] = ControlResourceSetId; - if ((ControlResourceSetId <0) || (ControlResourceSetId > 11)){ - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for ControlResourceSetId choice: 0..11 !\n", - RC.config_file_name, i, ControlResourceSetId); - } - /////////////////////////////////NR BWP-UplinkCommon/////////////////////////// NRRRC_CONFIGURATION_REQ (msg_p).UL_locationAndBandwidth[j] = UL_locationAndBandwidth; if ((UL_locationAndBandwidth <0) || (UL_locationAndBandwidth > 37949)){ @@ -676,15 +1056,15 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(UL_BWP_SubcarrierSpacing,"kHz15")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15; + NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz15; }else if (strcmp(UL_BWP_SubcarrierSpacing,"kHz30")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30; + NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz30; }else if (strcmp(UL_BWP_SubcarrierSpacing,"kHz60")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60; + NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz60; }else if (strcmp(UL_BWP_SubcarrierSpacing,"kHz120")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120; + NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz120; }else if (strcmp(UL_BWP_SubcarrierSpacing,"kHz240")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240; + NRRRC_CONFIGURATION_REQ (msg_p).UL_BWP_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz240; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for UL_BWP_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n", RC.config_file_name, i, UL_BWP_SubcarrierSpacing); @@ -703,13 +1083,13 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"shortBitmap")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap; }else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"mediumBitmap")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; }else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"longBitmap")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap; }else if (strcmp(ServingCellConfigCommon_ssb_PositionsInBurst_PR,"NOTHING")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = ServingCellConfigCommon__ssb_PositionsInBurst_PR_NOTHING; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_PositionsInBurst_PR[j] = NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_NOTHING; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for ServingCellConfigCommon_ssb_PositionsInBurst_PR choice !\n", RC.config_file_name, i, ServingCellConfigCommon_ssb_PositionsInBurst_PR); @@ -718,27 +1098,27 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch (ServingCellConfigCommon_ssb_periodicityServingCell) { case 5: - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = ServingCellConfigCommon__ssb_periodicityServingCell_ms5; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms5; break; case 10: - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = ServingCellConfigCommon__ssb_periodicityServingCell_ms10; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms10; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = ServingCellConfigCommon__ssb_periodicityServingCell_ms20; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20; break; case 40: - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = ServingCellConfigCommon__ssb_periodicityServingCell_ms40; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms40; break; case 80: - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = ServingCellConfigCommon__ssb_periodicityServingCell_ms80; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms80; break; case 160: - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = ServingCellConfigCommon__ssb_periodicityServingCell_ms160; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_ssb_periodicityServingCell[j] = NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms160; break; default: @@ -749,29 +1129,29 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch (ServingCellConfigCommon_dmrs_TypeA_Position) { case 2: - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_dmrs_TypeA_Position[j] = ServingCellConfigCommon__dmrs_TypeA_Position_pos2; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_dmrs_TypeA_Position[j] = NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2; break; case 3: - NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_dmrs_TypeA_Position[j] = ServingCellConfigCommon__dmrs_TypeA_Position_pos3; + NRRRC_CONFIGURATION_REQ (msg_p).ServingCellConfigCommon_dmrs_TypeA_Position[j] = NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos3; break; default: - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for ServingCellConfigCommon_dmrs_TypeA_Position choice: -6,0,6 !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for ServingCellConfigCommon_dmrs_TypeA_Position choice: 2,3 !\n", RC.config_file_name, i, ServingCellConfigCommon_dmrs_TypeA_Position); break; } if (strcmp(NIA_SubcarrierSpacing,"kHz15")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15; + NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz15; }else if (strcmp(NIA_SubcarrierSpacing,"kHz30")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30; + NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz30; }else if (strcmp(NIA_SubcarrierSpacing,"kHz60")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60; + NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz60; }else if (strcmp(NIA_SubcarrierSpacing,"kHz120")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120; + NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz120; }else if (strcmp(NIA_SubcarrierSpacing,"kHz240")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240; + NRRRC_CONFIGURATION_REQ (msg_p).NIA_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz240; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for NIA_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n", RC.config_file_name, i, NIA_SubcarrierSpacing); } @@ -784,36 +1164,36 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { /////////////////////////////////NR TDD-UL-DL-ConfigCommon/////////////////////////// if (strcmp(referenceSubcarrierSpacing,"kHz15")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz15; + NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz15; }else if (strcmp(referenceSubcarrierSpacing,"kHz30")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz30; + NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz30; }else if (strcmp(referenceSubcarrierSpacing,"kHz60")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz60; + NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz60; }else if (strcmp(referenceSubcarrierSpacing,"kHz120")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz120; + NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz120; }else if (strcmp(referenceSubcarrierSpacing,"kHz240")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = SubcarrierSpacing_kHz240; + NRRRC_CONFIGURATION_REQ (msg_p).referenceSubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz240; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for referenceSubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n", RC.config_file_name, i, referenceSubcarrierSpacing); } if (strcmp(dl_UL_TransmissionPeriodicity,"ms0p5")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms0p5; + NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = NR_TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms0p5; }else if (strcmp(dl_UL_TransmissionPeriodicity,"ms0p625")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms0p625; + NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = NR_TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms0p625; }else if (strcmp(dl_UL_TransmissionPeriodicity,"ms1")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms1; + NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = NR_TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms1; }else if (strcmp(dl_UL_TransmissionPeriodicity,"ms1p25")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms1p25; + NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = NR_TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms1p25; }else if (strcmp(dl_UL_TransmissionPeriodicity,"ms2")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms2; + NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = NR_TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms2; }else if (strcmp(dl_UL_TransmissionPeriodicity,"ms2p5")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms2p5; + NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = NR_TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms2p5; }else if (strcmp(dl_UL_TransmissionPeriodicity,"ms5")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms5; + NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = NR_TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms5; }else if (strcmp(dl_UL_TransmissionPeriodicity,"ms10")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms10; + NRRRC_CONFIGURATION_REQ (msg_p).dl_UL_TransmissionPeriodicity[j] = NR_TDD_UL_DL_ConfigCommon__dl_UL_TransmissionPeriodicity_ms10; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for dl_UL_TransmissionPeriodicity choice: minusinfinity,ms0p5,ms0p625,ms1,ms1p25,ms2,ms2p5,ms5,ms10 !\n", RC.config_file_name, i, dl_UL_TransmissionPeriodicity); @@ -853,55 +1233,55 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { if (strcmp(rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,"oneEighth")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth; switch (rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth){ case 4: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n4; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n4; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n8; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n8; break; case 12: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n12; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n12; break; case 16: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n16; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n16; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n20; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n20; break; case 24: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n24; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n24; break; case 28: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n28; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n28; break; case 32: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n32; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n32; break; case 36: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n36; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n36; break; case 40: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n40; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n40; break; case 44: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n44; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n44; break; case 48: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n48; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n48; break; case 52: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n52; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n52; break; case 56: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n56; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n56; break; case 60: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n60; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n60; break; case 64: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n64; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneEighth_n64; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth choice: 4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64!\n", @@ -911,55 +1291,55 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }else if (strcmp(rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,"oneFourth")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth; switch (rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth){ case 4: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n4; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n4; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n8; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n8; break; case 12: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n12; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n12; break; case 16: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n16; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n16; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n20; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n20; break; case 24: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n24; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n24; break; case 28: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n28; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n28; break; case 32: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n32; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n32; break; case 36: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n36; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n36; break; case 40: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n40; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n40; break; case 44: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n44; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n44; break; case 48: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n48; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n48; break; case 52: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n52; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n52; break; case 56: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n56; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n56; break; case 60: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n60; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n60; break; case 64: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n64; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneFourth_n64; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth choice: 4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64!\n", @@ -969,55 +1349,55 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }else if (strcmp(rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,"oneHalf")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf; switch (rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf){ case 4: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n4; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n4; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n8; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n8; break; case 12: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n12; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n12; break; case 16: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n16; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n16; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n20; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n20; break; case 24: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n24; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n24; break; case 28: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n28; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n28; break; case 32: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n32; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n32; break; case 36: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n36; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n36; break; case 40: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n40; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n40; break; case 44: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n44; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n44; break; case 48: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n48; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n48; break; case 52: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n52; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n52; break; case 56: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n56; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n56; break; case 60: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n60; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n60; break; case 64: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n64; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__oneHalf_n64; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf choice: 4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64!\n", @@ -1027,55 +1407,55 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }else if (strcmp(rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,"one")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; switch (rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one){ case 4: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n4; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n4; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n8; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n8; break; case 12: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n12; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n12; break; case 16: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n16; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n16; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n20; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n20; break; case 24: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n24; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n24; break; case 28: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n28; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n28; break; case 32: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n32; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n32; break; case 36: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n36; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n36; break; case 40: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n40; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n40; break; case 44: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n44; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n44; break; case 48: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n48; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n48; break; case 52: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n52; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n52; break; case 56: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n56; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n56; break; case 60: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n60; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n60; break; case 64: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one choice: 4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64!\n", @@ -1085,31 +1465,31 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }else if (strcmp(rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,"two")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two; switch (rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one){ case 4: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n4; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n4; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n8; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n8; break; case 12: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n12; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n12; break; case 16: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n16; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n16; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n20; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n20; break; case 24: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n24; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n24; break; case 28: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n28; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n28; break; case 32: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n32; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__two_n32; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two choice: 4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64!\n", @@ -1119,7 +1499,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }else if (strcmp(rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,"four")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four; NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four[j] = rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four; if ((rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four < 1) || (rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four > 16)){ AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four choice: 1..16 !\n", @@ -1128,7 +1508,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }else if (strcmp(rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,"eight")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight; NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight[j] = rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight; if ((rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight < 1) || (rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight > 8)){ AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight choice: 1..8 !\n", @@ -1137,7 +1517,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }else if (strcmp(rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,"sixteen")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen; NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen[j] = rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen; if ((rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen < 1) || (rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen > 4)){ AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen choice: 1..4 !\n", @@ -1145,7 +1525,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }//End sixteen }else if (strcmp(rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice,"NOTHING")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_NOTHING; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[j] = NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_NOTHING; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice: oneEighth,oneFourth,oneHalf,one,two,four,eight,sixteen !\n", RC.config_file_name, i, rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice); @@ -1156,31 +1536,31 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch (rach_ra_Msg3SizeGroupA) { case 56: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b56; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = NR_RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b56; break; case 144: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b144; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = NR_RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b144; break; case 208: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b208; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = NR_RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b208; break; case 256: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b256; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = NR_RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b256; break; case 282: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b282; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = NR_RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b282; break; case 480: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b480; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = NR_RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b480; break; case 640: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b640; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = NR_RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b640; break; case 800: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b800; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = NR_RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b800; break; case 1000: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b1000; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_Msg3SizeGroupA[j] = NR_RACH_ConfigCommon__groupBconfigured__ra_Msg3SizeGroupA_b1000; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ra_Msg3SizeGroupA choice: 56,144,208,256,282,480,640,800,1000!\n", @@ -1189,21 +1569,21 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }// End switch (rach_ra_Msg3SizeGroupA) if (strcmp(rach_messagePowerOffsetGroupB,"minusinfinity")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_minusinfinity; + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_minusinfinity; }else if (strcmp(rach_messagePowerOffsetGroupB,"dB0")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB0; + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB0; }else if (strcmp(rach_messagePowerOffsetGroupB,"dB5")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB5; + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB5; }else if (strcmp(rach_messagePowerOffsetGroupB,"dB8")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB8; + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB8; }else if (strcmp(rach_messagePowerOffsetGroupB,"dB10")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB10; + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB10; }else if (strcmp(rach_messagePowerOffsetGroupB,"dB12")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB12; + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB12; }else if (strcmp(rach_messagePowerOffsetGroupB,"dB15")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB15; + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB15; }else if (strcmp(rach_messagePowerOffsetGroupB,"dB18")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB18; + RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB18; }else{ AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n", RC.config_file_name, i, rach_messagePowerOffsetGroupB); @@ -1219,28 +1599,28 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch (rach_ra_ContentionResolutionTimer) { case 8: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf8; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf8; break; case 16: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf16; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf16; break; case 24: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf24; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf24; break; case 32: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf32; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf32; break; case 40: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf40; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf40; break; case 48: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf48; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf48; break; case 56: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf56; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf56; break; case 64: - NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; + NRRRC_CONFIGURATION_REQ (msg_p).rach_ra_ContentionResolutionTimer[j] = NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for rach_ra_ContentionResolutionTimer choice: 8,16,24,32,40,48,56,64!\n", @@ -1262,39 +1642,39 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(prach_RootSequenceIndex_choice , "l839") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_RootSequenceIndex_choice[j] = RACH_ConfigCommon__prach_RootSequenceIndex_PR_l839; + NRRRC_CONFIGURATION_REQ (msg_p).prach_RootSequenceIndex_choice[j] = NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l839; NRRRC_CONFIGURATION_REQ (msg_p).prach_RootSequenceIndex_l839[j] = prach_RootSequenceIndex_l839; }else if (strcmp(prach_RootSequenceIndex_choice , "l139") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).prach_RootSequenceIndex_choice[j] = RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; + NRRRC_CONFIGURATION_REQ (msg_p).prach_RootSequenceIndex_choice[j] = NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; NRRRC_CONFIGURATION_REQ (msg_p).prach_RootSequenceIndex_l139[j] = prach_RootSequenceIndex_l139; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for prach_RootSequenceIndex !\n", - RC.config_file_name, i, prach_RootSequenceIndex); + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for prach_RootSequenceIndex_choice !\n", + RC.config_file_name, i, prach_RootSequenceIndex_choice); } if (strcmp(prach_msg1_SubcarrierSpacing,"kHz15")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz15; + NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz15; }else if (strcmp(prach_msg1_SubcarrierSpacing,"kHz30")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz30; + NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz30; }else if (strcmp(prach_msg1_SubcarrierSpacing,"kHz60")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz60; + NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz60; }else if (strcmp(prach_msg1_SubcarrierSpacing,"kHz120")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz120; + NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz120; }else if (strcmp(prach_msg1_SubcarrierSpacing,"kHz240")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = SubcarrierSpacing_kHz240; + NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_SubcarrierSpacing[j] = NR_SubcarrierSpacing_kHz240; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for prach_msg1_SubcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n", RC.config_file_name, i, prach_msg1_SubcarrierSpacing); } if (strcmp(restrictedSetConfig , "unrestrictedSet") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).restrictedSetConfig[j] = RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; + NRRRC_CONFIGURATION_REQ (msg_p).restrictedSetConfig[j] = NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; }else if (strcmp(restrictedSetConfig , "restrictedSetTypeA") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).restrictedSetConfig[j] = RACH_ConfigCommon__restrictedSetConfig_restrictedSetTypeA; + NRRRC_CONFIGURATION_REQ (msg_p).restrictedSetConfig[j] = NR_RACH_ConfigCommon__restrictedSetConfig_restrictedSetTypeA; }else if (strcmp(restrictedSetConfig , "restrictedSetTypeB") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).restrictedSetConfig[j] = RACH_ConfigCommon__restrictedSetConfig_restrictedSetTypeB; + NRRRC_CONFIGURATION_REQ (msg_p).restrictedSetConfig[j] = NR_RACH_ConfigCommon__restrictedSetConfig_restrictedSetTypeB; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for restrictedSetConfig !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for restrictedSetConfig !\n", RC.config_file_name, i, restrictedSetConfig); } @@ -1310,15 +1690,15 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(prach_msg1_FDM , "one") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_FDM[j] = RACH_ConfigGeneric__msg1_FDM_one; + NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_FDM[j] = NR_RACH_ConfigGeneric__msg1_FDM_one; }else if (strcmp(prach_msg1_FDM , "two") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_FDM[j] = RACH_ConfigGeneric__msg1_FDM_two; + NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_FDM[j] = NR_RACH_ConfigGeneric__msg1_FDM_two; }else if (strcmp(prach_msg1_FDM , "four") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_FDM[j] = RACH_ConfigGeneric__msg1_FDM_four; + NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_FDM[j] = NR_RACH_ConfigGeneric__msg1_FDM_four; }else if (strcmp(prach_msg1_FDM , "eight") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_FDM[j] = RACH_ConfigGeneric__msg1_FDM_eight; + NRRRC_CONFIGURATION_REQ (msg_p).prach_msg1_FDM[j] = NR_RACH_ConfigGeneric__msg1_FDM_eight; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for prach_msg1_FDM !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for prach_msg1_FDM !\n", RC.config_file_name, i, prach_msg1_FDM); } @@ -1342,37 +1722,37 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch (preambleTransMax) { case 3: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n3; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n3; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n4; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n4; break; case 5: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n5; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n5; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n6; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n6; break; case 7: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n7; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n7; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n8; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n8; break; case 10: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n10; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n10; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n20; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n20; break; case 50: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n50; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n50; break; case 100: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n100; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n100; break; case 200: - NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = RACH_ConfigGeneric__preambleTransMax_n200; + NRRRC_CONFIGURATION_REQ (msg_p).preambleTransMax[j] = NR_RACH_ConfigGeneric__preambleTransMax_n200; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for preambleTransMax choice: 3,4,5,6,7,8,10,20,50,100,200 !\n", @@ -1381,42 +1761,42 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(powerRampingStep , "dB0") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).powerRampingStep[j] = RACH_ConfigGeneric__powerRampingStep_dB0; + NRRRC_CONFIGURATION_REQ (msg_p).powerRampingStep[j] = NR_RACH_ConfigGeneric__powerRampingStep_dB0; }else if (strcmp(powerRampingStep , "dB2") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).powerRampingStep[j] = RACH_ConfigGeneric__powerRampingStep_dB2; + NRRRC_CONFIGURATION_REQ (msg_p).powerRampingStep[j] = NR_RACH_ConfigGeneric__powerRampingStep_dB2; }else if (strcmp(powerRampingStep , "dB4") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).powerRampingStep[j] = RACH_ConfigGeneric__powerRampingStep_dB4; + NRRRC_CONFIGURATION_REQ (msg_p).powerRampingStep[j] = NR_RACH_ConfigGeneric__powerRampingStep_dB4; }else if (strcmp(powerRampingStep , "dB6") == 0) { - NRRRC_CONFIGURATION_REQ (msg_p).powerRampingStep[j] = RACH_ConfigGeneric__powerRampingStep_dB6; + NRRRC_CONFIGURATION_REQ (msg_p).powerRampingStep[j] = NR_RACH_ConfigGeneric__powerRampingStep_dB6; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for powerRampingStep !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for powerRampingStep !\n", RC.config_file_name, i, powerRampingStep); } switch (ra_ResponseWindow) { case 1: - NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = RACH_ConfigGeneric__ra_ResponseWindow_sl1; + NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = NR_RACH_ConfigGeneric__ra_ResponseWindow_sl1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = RACH_ConfigGeneric__ra_ResponseWindow_sl2; + NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = NR_RACH_ConfigGeneric__ra_ResponseWindow_sl2; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = RACH_ConfigGeneric__ra_ResponseWindow_sl4; + NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = NR_RACH_ConfigGeneric__ra_ResponseWindow_sl4; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = RACH_ConfigGeneric__ra_ResponseWindow_sl8; + NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = NR_RACH_ConfigGeneric__ra_ResponseWindow_sl8; break; case 10: - NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = RACH_ConfigGeneric__ra_ResponseWindow_sl10; + NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = NR_RACH_ConfigGeneric__ra_ResponseWindow_sl10; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = RACH_ConfigGeneric__ra_ResponseWindow_sl20; + NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20; break; case 40: - NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = RACH_ConfigGeneric__ra_ResponseWindow_sl40; + NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = NR_RACH_ConfigGeneric__ra_ResponseWindow_sl40; break; case 80: - NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = RACH_ConfigGeneric__ra_ResponseWindow_sl80; + NRRRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindow[j] = NR_RACH_ConfigGeneric__ra_ResponseWindow_sl80; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for ra_ResponseWindow choice: 1,2,4,8,10,20,40,80 !\n", @@ -1449,23 +1829,23 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(PUSCH_TimeDomainResourceAllocation_mappingType , "typeA") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).PUSCH_TimeDomainResourceAllocation_mappingType[j] = PUSCH_TimeDomainResourceAllocation__mappingType_typeA; + NRRRC_CONFIGURATION_REQ (msg_p).PUSCH_TimeDomainResourceAllocation_mappingType[j] = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeA; }else if (strcmp(PUSCH_TimeDomainResourceAllocation_mappingType , "typeB") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).PUSCH_TimeDomainResourceAllocation_mappingType[j] = PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + NRRRC_CONFIGURATION_REQ (msg_p).PUSCH_TimeDomainResourceAllocation_mappingType[j] = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for PUSCH_TimeDomainResourceAllocation_mappingType !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for PUSCH_TimeDomainResourceAllocation_mappingType !\n", RC.config_file_name, i, PUSCH_TimeDomainResourceAllocation_mappingType); } /////////////////////////////////NR PUCCH-ConfigCommon/////////////////////////// if (strcmp(pucch_GroupHopping , "neither") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).pucch_GroupHopping[j] = PUCCH_ConfigCommon__pucch_GroupHopping_neither; + NRRRC_CONFIGURATION_REQ (msg_p).pucch_GroupHopping[j] = NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; }else if (strcmp(pucch_GroupHopping , "enable") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).pucch_GroupHopping[j] = PUCCH_ConfigCommon__pucch_GroupHopping_enable; + NRRRC_CONFIGURATION_REQ (msg_p).pucch_GroupHopping[j] = NR_PUCCH_ConfigCommon__pucch_GroupHopping_enable; }else if (strcmp(pucch_GroupHopping , "disable") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).pucch_GroupHopping[j] = PUCCH_ConfigCommon__pucch_GroupHopping_disable; + NRRRC_CONFIGURATION_REQ (msg_p).pucch_GroupHopping[j] = NR_PUCCH_ConfigCommon__pucch_GroupHopping_disable; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for pucch_GroupHopping !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for pucch_GroupHopping !\n", RC.config_file_name, i, pucch_GroupHopping); } @@ -1483,11 +1863,11 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(PDSCH_TimeDomainResourceAllocation_mappingType , "typeA") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).PDSCH_TimeDomainResourceAllocation_mappingType[j] = PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + NRRRC_CONFIGURATION_REQ (msg_p).PDSCH_TimeDomainResourceAllocation_mappingType[j] = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; }else if (strcmp(PDSCH_TimeDomainResourceAllocation_mappingType , "typeB") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).PDSCH_TimeDomainResourceAllocation_mappingType[j] = PDSCH_TimeDomainResourceAllocation__mappingType_typeB; + NRRRC_CONFIGURATION_REQ (msg_p).PDSCH_TimeDomainResourceAllocation_mappingType[j] = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for PDSCH_TimeDomainResourceAllocation_mappingType !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for PDSCH_TimeDomainResourceAllocation_mappingType !\n", RC.config_file_name, i, PDSCH_TimeDomainResourceAllocation_mappingType); } @@ -1499,48 +1879,48 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(RateMatchPattern_patternType , "NOTHING") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_patternType[j] = RateMatchPattern__patternType_PR_NOTHING; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_patternType[j] = NR_RateMatchPattern__patternType_PR_NOTHING; }else if (strcmp(RateMatchPattern_patternType , "bitmaps") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_patternType[j] = RateMatchPattern__patternType_PR_bitmaps; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_patternType[j] = NR_RateMatchPattern__patternType_PR_bitmaps; }else if (strcmp(RateMatchPattern_patternType , "controlResourceSet") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_patternType[j] = RateMatchPattern__patternType_PR_controlResourceSet; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_patternType[j] = NR_RateMatchPattern__patternType_PR_controlResourceSet; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for RateMatchPattern_patternType !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for RateMatchPattern_patternType !\n", RC.config_file_name, i, RateMatchPattern_patternType); } if (strcmp(symbolsInResourceBlock , "NOTHING") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).symbolsInResourceBlock[j] = RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_NOTHING; + NRRRC_CONFIGURATION_REQ (msg_p).symbolsInResourceBlock[j] = NR_RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_NOTHING; }else if (strcmp(symbolsInResourceBlock , "oneSlot") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).symbolsInResourceBlock[j] = RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_oneSlot; + NRRRC_CONFIGURATION_REQ (msg_p).symbolsInResourceBlock[j] = NR_RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_oneSlot; }else if (strcmp(symbolsInResourceBlock , "twoSlots") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).symbolsInResourceBlock[j] = RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_twoSlots; + NRRRC_CONFIGURATION_REQ (msg_p).symbolsInResourceBlock[j] = NR_RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_twoSlots; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for symbolsInResourceBlock !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for symbolsInResourceBlock !\n", RC.config_file_name, i, symbolsInResourceBlock); } switch(periodicityAndPattern){ case 2: - NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n2; + NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n2; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n4; + NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n4; break; case 5: - NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n5; + NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n5; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n8; + NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n8; break; case 10: - NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n10; + NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n10; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n20; + NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n20; break; case 40: - NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n40; + NRRRC_CONFIGURATION_REQ (msg_p).periodicityAndPattern[j] = NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n40; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for periodicityAndPattern choice: 2,4,5,8,10,20,40 !\n", @@ -1555,26 +1935,26 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz15")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz15; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = NR_SubcarrierSpacing_kHz15; }else if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz30")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz30; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = NR_SubcarrierSpacing_kHz30; }else if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz60")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz60; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = NR_SubcarrierSpacing_kHz60; }else if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz120")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz120; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = NR_SubcarrierSpacing_kHz120; }else if (strcmp(RateMatchPattern_subcarrierSpacing,"kHz240")==0) { - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = SubcarrierSpacing_kHz240; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_subcarrierSpacing[j] = NR_SubcarrierSpacing_kHz240; }else { AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for RateMatchPattern_subcarrierSpacing choice: minusinfinity,kHz15,kHz30,kHz60,kHz120,kHz240!\n", RC.config_file_name, i, RateMatchPattern_subcarrierSpacing); } if (strcmp(RateMatchPattern_mode , "dynamic") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_mode[j] = RateMatchPattern__mode_dynamic; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_mode[j] = NR_RateMatchPattern__mode_dynamic; }else if (strcmp(RateMatchPattern_mode , "semiStatic") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_mode[j] = RateMatchPattern__mode_semiStatic; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_mode[j] = NR_RateMatchPattern__mode_semiStatic; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for RateMatchPattern_mode !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for RateMatchPattern_mode !\n", RC.config_file_name, i, RateMatchPattern_mode); } @@ -1623,25 +2003,25 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(PDCCH_cce_REG_MappingType , "NOTHING") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_cce_REG_MappingType[j] = ControlResourceSet__cce_REG_MappingType_PR_NOTHING; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_cce_REG_MappingType[j] = NR_ControlResourceSet__cce_REG_MappingType_PR_NOTHING; }else if (strcmp(PDCCH_cce_REG_MappingType , "interleaved") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_cce_REG_MappingType[j] = ControlResourceSet__cce_REG_MappingType_PR_interleaved; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_cce_REG_MappingType[j] = NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved; }else if (strcmp(PDCCH_cce_REG_MappingType , "nonInterleaved") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_cce_REG_MappingType[j] = ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_cce_REG_MappingType[j] = NR_ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for PDCCH_cce_REG_MappingType !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for PDCCH_cce_REG_MappingType !\n", RC.config_file_name, i, PDCCH_cce_REG_MappingType); } switch(PDCCH_reg_BundleSize){ case 2: - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_reg_BundleSize[j] = ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n2; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_reg_BundleSize[j] = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n2; break; case 3: - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_reg_BundleSize[j] = ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n3; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_reg_BundleSize[j] = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n3; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_reg_BundleSize[j] = ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_reg_BundleSize[j] = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for PDCCH_reg_BundleSize choice: 2,3,6 !\n", @@ -1651,13 +2031,13 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(PDCCH_interleaverSize){ case 2: - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_interleaverSize[j] = ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n2; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_interleaverSize[j] = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n2; break; case 3: - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_interleaverSize[j] = ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n3; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_interleaverSize[j] = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n3; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_interleaverSize[j] = ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_interleaverSize[j] = NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for PDCCH_interleaverSize choice: 2,3,6 !\n", @@ -1672,11 +2052,11 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(PDCCH_precoderGranularity , "sameAsREG-bundle") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_precoderGranularity[j] = ControlResourceSet__precoderGranularity_sameAsREG_bundle; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_precoderGranularity[j] = NR_ControlResourceSet__precoderGranularity_sameAsREG_bundle; }else if (strcmp(PDCCH_precoderGranularity , "allContiguousRBs") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_precoderGranularity[j] = ControlResourceSet__precoderGranularity_allContiguousRBs; + NRRRC_CONFIGURATION_REQ (msg_p).PDCCH_precoderGranularity[j] = NR_ControlResourceSet__precoderGranularity_allContiguousRBs; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for PDCCH_precoderGranularity !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for PDCCH_precoderGranularity !\n", RC.config_file_name, i, PDCCH_precoderGranularity); } @@ -1704,12 +2084,12 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "sl1") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1; - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_sl1[j] = NULL; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_sl1[j] = 0; }else if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "sl2") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2; NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_sl2[j] = SearchSpace_monitoringSlotPeriodicityAndOffset_sl2; if ((SearchSpace_monitoringSlotPeriodicityAndOffset_sl2 <0) || (SearchSpace_monitoringSlotPeriodicityAndOffset_sl2>1)){ @@ -1718,7 +2098,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } }else if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "sl4") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4; NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_sl4[j] = SearchSpace_monitoringSlotPeriodicityAndOffset_sl4; if ((SearchSpace_monitoringSlotPeriodicityAndOffset_sl4 <0) || (SearchSpace_monitoringSlotPeriodicityAndOffset_sl4>3)){ @@ -1727,7 +2107,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } }else if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "sl5") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5; NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_sl5[j] = SearchSpace_monitoringSlotPeriodicityAndOffset_sl5; if ((SearchSpace_monitoringSlotPeriodicityAndOffset_sl5 <0) || (SearchSpace_monitoringSlotPeriodicityAndOffset_sl5>4)){ @@ -1736,7 +2116,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } }else if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "sl8") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8; NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_sl8[j] = SearchSpace_monitoringSlotPeriodicityAndOffset_sl8; if ((SearchSpace_monitoringSlotPeriodicityAndOffset_sl8 <0) || (SearchSpace_monitoringSlotPeriodicityAndOffset_sl8>7)){ @@ -1745,7 +2125,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } }else if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "sl10") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10; NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_sl10[j] = SearchSpace_monitoringSlotPeriodicityAndOffset_sl10; if ((SearchSpace_monitoringSlotPeriodicityAndOffset_sl10 <0) || (SearchSpace_monitoringSlotPeriodicityAndOffset_sl10>9)){ @@ -1754,7 +2134,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } }else if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "sl16") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16; NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_sl16[j] = SearchSpace_monitoringSlotPeriodicityAndOffset_sl16; if ((SearchSpace_monitoringSlotPeriodicityAndOffset_sl16 <0) || (SearchSpace_monitoringSlotPeriodicityAndOffset_sl16>15)){ @@ -1763,7 +2143,7 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } }else if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "sl20") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20; NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_sl20[j] = SearchSpace_monitoringSlotPeriodicityAndOffset_sl20; if ((SearchSpace_monitoringSlotPeriodicityAndOffset_sl20 <0) || (SearchSpace_monitoringSlotPeriodicityAndOffset_sl20>19)){ @@ -1772,38 +2152,38 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } }else if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "UNABLE") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = SearchSpace__monitoringSlotPeriodicityAndOffset_PR_NOTHING; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_monitoringSlotPeriodicityAndOffset_choice[j] = NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_NOTHING; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SearchSpace_monitoringSlotPeriodicityAndOffset_choice !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for SearchSpace_monitoringSlotPeriodicityAndOffset_choice !\n", RC.config_file_name, i, SearchSpace_monitoringSlotPeriodicityAndOffset_choice); }// End if (strcmp(SearchSpace_monitoringSlotPeriodicityAndOffset_choice , "sl1") switch(SearchSpace_nrofCandidates_aggregationLevel1){ case 0: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = SearchSpace__nrofCandidates__aggregationLevel1_n0; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = NR_SearchSpace__nrofCandidates__aggregationLevel1_n0; break; case 1: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = SearchSpace__nrofCandidates__aggregationLevel1_n1; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = NR_SearchSpace__nrofCandidates__aggregationLevel1_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = SearchSpace__nrofCandidates__aggregationLevel1_n2; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = NR_SearchSpace__nrofCandidates__aggregationLevel1_n2; break; case 3: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = SearchSpace__nrofCandidates__aggregationLevel1_n3; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = NR_SearchSpace__nrofCandidates__aggregationLevel1_n3; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = SearchSpace__nrofCandidates__aggregationLevel1_n4; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = NR_SearchSpace__nrofCandidates__aggregationLevel1_n4; break; case 5: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = SearchSpace__nrofCandidates__aggregationLevel1_n5; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = NR_SearchSpace__nrofCandidates__aggregationLevel1_n5; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = SearchSpace__nrofCandidates__aggregationLevel1_n6; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = NR_SearchSpace__nrofCandidates__aggregationLevel1_n6; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = SearchSpace__nrofCandidates__aggregationLevel1_n8; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel1[j] = NR_SearchSpace__nrofCandidates__aggregationLevel1_n8; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SearchSpace_nrofCandidates_aggregationLevel1 choice: 0,1,2,3,4,5,6,8 !\n", @@ -1813,28 +2193,28 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(SearchSpace_nrofCandidates_aggregationLevel2){ case 0: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = SearchSpace__nrofCandidates__aggregationLevel2_n0; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = NR_SearchSpace__nrofCandidates__aggregationLevel2_n0; break; case 1: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = SearchSpace__nrofCandidates__aggregationLevel2_n1; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = NR_SearchSpace__nrofCandidates__aggregationLevel2_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = SearchSpace__nrofCandidates__aggregationLevel2_n2; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = NR_SearchSpace__nrofCandidates__aggregationLevel2_n2; break; case 3: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = SearchSpace__nrofCandidates__aggregationLevel2_n3; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = NR_SearchSpace__nrofCandidates__aggregationLevel2_n3; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = SearchSpace__nrofCandidates__aggregationLevel2_n4; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = NR_SearchSpace__nrofCandidates__aggregationLevel2_n4; break; case 5: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = SearchSpace__nrofCandidates__aggregationLevel2_n5; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = NR_SearchSpace__nrofCandidates__aggregationLevel2_n5; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = SearchSpace__nrofCandidates__aggregationLevel2_n6; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = NR_SearchSpace__nrofCandidates__aggregationLevel2_n6; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = SearchSpace__nrofCandidates__aggregationLevel2_n8; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel2[j] = NR_SearchSpace__nrofCandidates__aggregationLevel2_n8; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SearchSpace_nrofCandidates_aggregationLevel2 choice: 0,1,2,3,4,5,6,8 !\n", @@ -1844,28 +2224,28 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(SearchSpace_nrofCandidates_aggregationLevel4){ case 0: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = SearchSpace__nrofCandidates__aggregationLevel4_n0; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = NR_SearchSpace__nrofCandidates__aggregationLevel4_n0; break; case 1: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = SearchSpace__nrofCandidates__aggregationLevel4_n1; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = NR_SearchSpace__nrofCandidates__aggregationLevel4_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = SearchSpace__nrofCandidates__aggregationLevel4_n2; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = NR_SearchSpace__nrofCandidates__aggregationLevel4_n2; break; case 3: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = SearchSpace__nrofCandidates__aggregationLevel4_n3; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = NR_SearchSpace__nrofCandidates__aggregationLevel4_n3; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = SearchSpace__nrofCandidates__aggregationLevel4_n4; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = NR_SearchSpace__nrofCandidates__aggregationLevel4_n4; break; case 5: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = SearchSpace__nrofCandidates__aggregationLevel4_n5; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = NR_SearchSpace__nrofCandidates__aggregationLevel4_n5; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = SearchSpace__nrofCandidates__aggregationLevel4_n6; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = NR_SearchSpace__nrofCandidates__aggregationLevel4_n6; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = SearchSpace__nrofCandidates__aggregationLevel4_n8; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel4[j] = NR_SearchSpace__nrofCandidates__aggregationLevel4_n8; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SearchSpace_nrofCandidates_aggregationLevel4 choice: 0,1,2,3,4,5,6,8 !\n", @@ -1875,28 +2255,28 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(SearchSpace_nrofCandidates_aggregationLevel8){ case 0: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = SearchSpace__nrofCandidates__aggregationLevel8_n0; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0; break; case 1: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = SearchSpace__nrofCandidates__aggregationLevel8_n1; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = NR_SearchSpace__nrofCandidates__aggregationLevel8_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = SearchSpace__nrofCandidates__aggregationLevel8_n2; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = NR_SearchSpace__nrofCandidates__aggregationLevel8_n2; break; case 3: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = SearchSpace__nrofCandidates__aggregationLevel8_n3; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = NR_SearchSpace__nrofCandidates__aggregationLevel8_n3; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = SearchSpace__nrofCandidates__aggregationLevel8_n4; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = NR_SearchSpace__nrofCandidates__aggregationLevel8_n4; break; case 5: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = SearchSpace__nrofCandidates__aggregationLevel8_n5; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = NR_SearchSpace__nrofCandidates__aggregationLevel8_n5; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = SearchSpace__nrofCandidates__aggregationLevel8_n6; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = NR_SearchSpace__nrofCandidates__aggregationLevel8_n6; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = SearchSpace__nrofCandidates__aggregationLevel8_n8; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel8[j] = NR_SearchSpace__nrofCandidates__aggregationLevel8_n8; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SearchSpace_nrofCandidates_aggregationLevel8 choice: 0,1,2,3,4,5,6,8 !\n", @@ -1906,28 +2286,28 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(SearchSpace_nrofCandidates_aggregationLevel16){ case 0: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = SearchSpace__nrofCandidates__aggregationLevel16_n0; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0; break; case 1: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = SearchSpace__nrofCandidates__aggregationLevel16_n1; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = NR_SearchSpace__nrofCandidates__aggregationLevel16_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = SearchSpace__nrofCandidates__aggregationLevel16_n2; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = NR_SearchSpace__nrofCandidates__aggregationLevel16_n2; break; case 3: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = SearchSpace__nrofCandidates__aggregationLevel16_n3; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = NR_SearchSpace__nrofCandidates__aggregationLevel16_n3; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = SearchSpace__nrofCandidates__aggregationLevel16_n4; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = NR_SearchSpace__nrofCandidates__aggregationLevel16_n4; break; case 5: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = SearchSpace__nrofCandidates__aggregationLevel16_n5; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = NR_SearchSpace__nrofCandidates__aggregationLevel16_n5; break; case 6: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = SearchSpace__nrofCandidates__aggregationLevel16_n6; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = NR_SearchSpace__nrofCandidates__aggregationLevel16_n6; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = SearchSpace__nrofCandidates__aggregationLevel16_n8; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_nrofCandidates_aggregationLevel16[j] = NR_SearchSpace__nrofCandidates__aggregationLevel16_n8; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SearchSpace_nrofCandidates_aggregationLevel16 choice: 0,1,2,3,4,5,6,8 !\n", @@ -1936,22 +2316,22 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(SearchSpace_searchSpaceType , "NOTHING") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_searchSpaceType[j] = SearchSpace__searchSpaceType_PR_NOTHING; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_searchSpaceType[j] = NR_SearchSpace__searchSpaceType_PR_NOTHING; }else if (strcmp(SearchSpace_searchSpaceType , "common") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_searchSpaceType[j] = SearchSpace__searchSpaceType_PR_common; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_searchSpaceType[j] = NR_SearchSpace__searchSpaceType_PR_common; }else if (strcmp(SearchSpace_searchSpaceType , "ue_Specific") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_searchSpaceType[j] = SearchSpace__searchSpaceType_PR_ue_Specific; + NRRRC_CONFIGURATION_REQ (msg_p).SearchSpace_searchSpaceType[j] = NR_SearchSpace__searchSpaceType_PR_ue_Specific; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for SearchSpace_searchSpaceType !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for SearchSpace_searchSpaceType !\n", RC.config_file_name, i, SearchSpace_searchSpaceType); } switch(Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1){ case 1: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel1_n1; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel1_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel1_n2; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel1_n2; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1 choice: 1,2 !\n", @@ -1961,10 +2341,10 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2){ case 1: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel2_n1; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel2_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel2_n2; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel2_n2; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2 choice: 1,2 !\n", @@ -1974,10 +2354,10 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4){ case 1: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel4_n1; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel4_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel4_n2; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel4_n2; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4 choice: 1,2 !\n", @@ -1987,10 +2367,10 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8){ case 1: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel8_n1; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel8_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel8_n2; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel8_n2; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8 choice: 1,2 !\n", @@ -2000,10 +2380,10 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16){ case 1: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel16_n1; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel16_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[j] = SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel16_n2; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_0__nrofCandidates_SFI__aggregationLevel16_n2; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16 choice: 1,2 !\n", @@ -2013,28 +2393,28 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(Common_dci_Format2_3_monitoringPeriodicity){ case 1: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n1; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n2; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n2; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n4; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n4; break; case 5: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n5; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n5; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n8; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n8; break; case 10: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n10; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n10; break; case 16: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n16; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n16; break; case 20: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n20; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n20; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_3_monitoringPeriodicity choice: 1,2,4,5,8,10,16,20 !\n", @@ -2044,10 +2424,10 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(Common_dci_Format2_3_nrofPDCCH_Candidates){ case 1: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_nrofPDCCH_Candidates[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__nrofPDCCH_Candidates_n1; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_nrofPDCCH_Candidates[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__nrofPDCCH_Candidates_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_nrofPDCCH_Candidates[j] = SearchSpace__searchSpaceType__common__dci_Format2_3__nrofPDCCH_Candidates_n2; + NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_nrofPDCCH_Candidates[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__nrofPDCCH_Candidates_n2; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_3_nrofPDCCH_Candidates choice: 1,2 !\n", @@ -2056,34 +2436,41 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(ue_Specific__dci_Formats , "formats0-0-And-1-0") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).ue_Specific__dci_Formats[j] = SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0; + NRRRC_CONFIGURATION_REQ (msg_p).ue_Specific__dci_Formats[j] = NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0; }else if (strcmp(ue_Specific__dci_Formats , "formats0-1-And-1-1") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).ue_Specific__dci_Formats[j] = SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_1_And_1_1; + NRRRC_CONFIGURATION_REQ (msg_p).ue_Specific__dci_Formats[j] = NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_1_And_1_1; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for ue_Specific__dci_Formats !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for ue_Specific__dci_Formats !\n", RC.config_file_name, i, ue_Specific__dci_Formats); } //////////////////////////////////NR RateMatchPatternLTE-CRS/////////////////////////// + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierFreqDL[j] = RateMatchPatternLTE_CRS_carrierFreqDL; + if ((RateMatchPatternLTE_CRS_carrierFreqDL <0) || (RateMatchPatternLTE_CRS_carrierFreqDL>16383)){ + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for RateMatchPatternLTE_CRS_carrierFreqDL choice: 0..16383 !\n", + RC.config_file_name, i, RateMatchPatternLTE_CRS_carrierFreqDL); + } + + switch(RateMatchPatternLTE_CRS_carrierBandwidthDL){ case 6: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = RateMatchPatternLTE_CRS__carrierBandwidthDL_n6; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = NR_RateMatchPatternLTE_CRS__carrierBandwidthDL_n6; break; case 15: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = RateMatchPatternLTE_CRS__carrierBandwidthDL_n15; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = NR_RateMatchPatternLTE_CRS__carrierBandwidthDL_n15; break; case 25: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = RateMatchPatternLTE_CRS__carrierBandwidthDL_n25; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = NR_RateMatchPatternLTE_CRS__carrierBandwidthDL_n25; break; case 50: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = RateMatchPatternLTE_CRS__carrierBandwidthDL_n50; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = NR_RateMatchPatternLTE_CRS__carrierBandwidthDL_n50; break; case 75: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = RateMatchPatternLTE_CRS__carrierBandwidthDL_n75; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = NR_RateMatchPatternLTE_CRS__carrierBandwidthDL_n75; break; case 100: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = RateMatchPatternLTE_CRS__carrierBandwidthDL_n100; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = NR_RateMatchPatternLTE_CRS__carrierBandwidthDL_n100; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for RateMatchPatternLTE_CRS_carrierBandwidthDL choice: 6,15,25,50,75,100 !\n", @@ -2091,21 +2478,15 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { break; } - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_carrierBandwidthDL[j] = RateMatchPatternLTE_CRS_carrierBandwidthDL; - if ((RateMatchPatternLTE_CRS_carrierBandwidthDL <0) || (RateMatchPatternLTE_CRS_carrierBandwidthDL>16383)){ - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for RateMatchPatternLTE_CRS_carrierBandwidthDL choice: 0..16383 !\n", - RC.config_file_name, i, RateMatchPatternLTE_CRS_carrierBandwidthDL); - } - switch(RateMatchPatternLTE_CRS_nrofCRS_Ports){ case 1: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_nrofCRS_Ports[j] = RateMatchPatternLTE_CRS__nrofCRS_Ports_n1; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_nrofCRS_Ports[j] = NR_RateMatchPatternLTE_CRS__nrofCRS_Ports_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_nrofCRS_Ports[j] = RateMatchPatternLTE_CRS__nrofCRS_Ports_n2; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_nrofCRS_Ports[j] = NR_RateMatchPatternLTE_CRS__nrofCRS_Ports_n2; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_nrofCRS_Ports[j] = RateMatchPatternLTE_CRS__nrofCRS_Ports_n4; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_nrofCRS_Ports[j] = NR_RateMatchPatternLTE_CRS__nrofCRS_Ports_n4; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for RateMatchPatternLTE_CRS_nrofCRS_Ports choice: 1,2,4 !\n", @@ -2115,22 +2496,22 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(RateMatchPatternLTE_CRS_v_Shift){ case 0: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = RateMatchPatternLTE_CRS__v_Shift_n0; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = NR_RateMatchPatternLTE_CRS__v_Shift_n0; break; case 1: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = RateMatchPatternLTE_CRS__v_Shift_n1; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = NR_RateMatchPatternLTE_CRS__v_Shift_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = RateMatchPatternLTE_CRS__v_Shift_n2; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = NR_RateMatchPatternLTE_CRS__v_Shift_n2; break; case 3: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = RateMatchPatternLTE_CRS__v_Shift_n3; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = NR_RateMatchPatternLTE_CRS__v_Shift_n3; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = RateMatchPatternLTE_CRS__v_Shift_n4; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = NR_RateMatchPatternLTE_CRS__v_Shift_n4; break; case 5: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = RateMatchPatternLTE_CRS__v_Shift_n5; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_v_Shift[j] = NR_RateMatchPatternLTE_CRS__v_Shift_n5; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for RateMatchPatternLTE_CRS_v_Shift choice: 0,1,2,3,4,5 !\n", @@ -2140,22 +2521,22 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { switch(RateMatchPatternLTE_CRS_radioframeAllocationPeriod){ case 1: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n1; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = NR_EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n1; break; case 2: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n2; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = NR_EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n2; break; case 4: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n4; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = NR_EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n4; break; case 8: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n8; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = NR_EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n8; break; case 16: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n16; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = NR_EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n16; break; case 32: - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n32; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_radioframeAllocationPeriod[j] = NR_EUTRA_MBSFN_SubframeConfig__radioframeAllocationPeriod_n32; break; default: AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for RateMatchPatternLTE_CRS_radioframeAllocationPeriod choice: 1,2,4,8,16,32 !\n", @@ -2170,11 +2551,11 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } if (strcmp(RateMatchPatternLTE_CRS_subframeAllocation_choice , "oneFrame") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_subframeAllocation_choice[j] = EUTRA_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_subframeAllocation_choice[j] = NR_EUTRA_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame; }else if (strcmp(RateMatchPatternLTE_CRS_subframeAllocation_choice , "fourFrames") == 0){ - NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_subframeAllocation_choice[j] = EUTRA_MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames; + NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_subframeAllocation_choice[j] = NR_EUTRA_MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames; }else { - AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for RateMatchPatternLTE_CRS_subframeAllocation_choice !\n", + AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for RateMatchPatternLTE_CRS_subframeAllocation_choice !\n", RC.config_file_name, i, RateMatchPatternLTE_CRS_subframeAllocation_choice); } @@ -2193,13 +2574,244 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { }//End RCconfig_NRRRC function -void NRRCConfig(void) { +int RCconfig_nr_gtpu(void ) { + + int num_gnbs = 0; + + + + char* gnb_interface_name_for_S1U = NULL; + char* gnb_ipv4_address_for_S1U = NULL; + uint32_t gnb_port_for_S1U = 0; + char *address = NULL; + char *cidr = NULL; + char gtpupath[MAX_OPTNAME_SIZE*2 + 8]; + - // paramlist_def_t MACRLCParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; - // paramlist_def_t L1ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; - // paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; paramdef_t GNBSParams[] = GNBSPARAMS_DESC; - paramlist_def_t CCsParamList = {GNB_CONFIG_STRING_COMPONENT_CARRIERS,NULL,0}; + + paramdef_t GTPUParams[] = GTPUPARAMS_DESC; + LOG_I(GTPU,"Configuring GTPu\n"); + +/* get number of active eNodeBs */ + config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL); + num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; + AssertFatal (num_gnbs >0, + "Failed to parse config file no active gNodeBs in %s \n", GNB_CONFIG_STRING_ACTIVE_GNBS); + + + sprintf(gtpupath,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); + config_get( GTPUParams,sizeof(GTPUParams)/sizeof(paramdef_t),gtpupath); + + + + cidr = gnb_ipv4_address_for_S1U; + address = strtok(cidr, "/"); + + if (address) { + IPV4_STR_ADDR_TO_INT_NWBO ( address, RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); + + LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up); + + } + + RC.gtpv1u_data_g->enb_port_for_S1u_S12_S4_up = gnb_port_for_S1U; +return 0; +} + +int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i) { + + int j,k = 0; + int gnb_id; + int32_t my_int; + const char* active_gnb[MAX_GNB]; + char *address = NULL; + char *cidr = NULL; + + // for no gcc warnings + + (void) my_int; + + memset((char*)active_gnb,0,MAX_GNB* sizeof(char*)); + + paramdef_t GNBSParams[] = GNBSPARAMS_DESC; + paramdef_t GNBParams[] = GNBPARAMS_DESC; + paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0}; + +/* get global parameters, defined outside any section in the config file */ + + config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL); + +#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) + if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { + asn_debug = 0; + asn1_xer_print = 0; + } else if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) { + asn_debug = 1; + asn1_xer_print = 1; + } else if (strcasecmp(*(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr) , GNB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) { + asn_debug = 1; + asn1_xer_print = 2; + } else { + asn_debug = 0; + asn1_xer_print = 0; + } + +#endif + + AssertFatal (i<GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt, + "Failed to parse config file %s, %uth attribute %s \n", + RC.config_file_name, i, GNB_CONFIG_STRING_ACTIVE_GNBS); + + + if (GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt>0) { + // Output a list of all gNBs. + config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); + + + + + + if (GNBParamList.numelt > 0) { + for (k = 0; k < GNBParamList.numelt; k++) { + if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) { + // Calculate a default gNB ID + +# if defined(ENABLE_USE_MME) + uint32_t hash; + + hash = s1ap_generate_eNB_id (); + gnb_id = k + (hash & 0xFFFF8); +# else + gnb_id = k; +# endif + } else { + gnb_id = *(GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr); + } + + + // search if in active list + for (j=0; j < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; j++) { + if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[j], *(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr)) == 0) { + paramdef_t S1Params[] = S1PARAMS_DESC; + paramlist_def_t S1ParamList = {GNB_CONFIG_STRING_MME_IP_ADDRESS,NULL,0}; + + paramdef_t SCTPParams[] = SCTPPARAMS_DESC; + paramdef_t NETParams[] = NETPARAMS_DESC; + char aprefix[MAX_OPTNAME_SIZE*2 + 8]; + + S1AP_REGISTER_ENB_REQ (msg_p).eNB_id = gnb_id; + + if (strcmp(*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr), "CELL_MACRO_GNB") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_MACRO_ENB; + } else if (strcmp(*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr), "CELL_HOME_GNB") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_HOME_ENB; + } else { + AssertFatal (0, + "Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_GNB or CELL_HOME_GNB !\n", + RC.config_file_name, i, *(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr)); + } + + S1AP_REGISTER_ENB_REQ (msg_p).eNB_name = strdup(*(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).tac = (uint16_t)atoi(*(GNBParamList.paramarray[k][GNB_TRACKING_AREA_CODE_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).mcc = (uint16_t)atoi(*(GNBParamList.paramarray[k][GNB_MOBILE_COUNTRY_CODE_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).mnc = (uint16_t)atoi(*(GNBParamList.paramarray[k][GNB_MOBILE_NETWORK_CODE_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length = strlen(*(GNBParamList.paramarray[k][GNB_MOBILE_NETWORK_CODE_IDX].strptr)); + S1AP_REGISTER_ENB_REQ (msg_p).default_drx = 0; + AssertFatal((S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length == 2) || + (S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length == 3), + "BAD MNC DIGIT LENGTH %d", + S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length); + + sprintf(aprefix,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k); + config_getlist( &S1ParamList,S1Params,sizeof(S1Params)/sizeof(paramdef_t),aprefix); + + S1AP_REGISTER_ENB_REQ (msg_p).nb_mme = 0; + + for (int l = 0; l < S1ParamList.numelt; l++) { + + S1AP_REGISTER_ENB_REQ (msg_p).nb_mme += 1; + + strcpy(S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[l].ipv4_address,*(S1ParamList.paramarray[l][GNB_MME_IPV4_ADDRESS_IDX].strptr)); + strcpy(S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[l].ipv6_address,*(S1ParamList.paramarray[l][GNB_MME_IPV6_ADDRESS_IDX].strptr)); + + if (strcmp(*(S1ParamList.paramarray[l][GNB_MME_IP_ADDRESS_ACTIVE_IDX].strptr), "yes") == 0) { +#if defined(ENABLE_USE_MME) + EPC_MODE_ENABLED = 1; +#endif + } + if (strcmp(*(S1ParamList.paramarray[l][GNB_MME_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4 = 1; + } else if (strcmp(*(S1ParamList.paramarray[l][GNB_MME_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv6") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6 = 1; + } else if (strcmp(*(S1ParamList.paramarray[l][GNB_MME_IP_ADDRESS_PREFERENCE_IDX].strptr), "no") == 0) { + S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4 = 1; + S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6 = 1; + } + } + + + // SCTP SETTING + S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS; + S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS; +# if defined(ENABLE_USE_MME) + sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG); + config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix); + S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr); + S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr); +#endif + + sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); + // NETWORK_INTERFACES + config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix); + + // S1AP_REGISTER_ENB_REQ (msg_p).enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); + cidr = *(NETParams[GNB_IPV4_ADDRESS_FOR_S1_MME_IDX].strptr); + address = strtok(cidr, "/"); + + S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv6 = 0; + S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4 = 1; + + strcpy(S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4_address, address); + + /* + in_addr_t ipv4_address; + + if (address) { + IPV4_STR_ADDR_TO_INT_NWBO ( address, ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); + } + strcpy(S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4_address, inet_ntoa(ipv4_address)); + // S1AP_REGISTER_ENB_REQ (msg_p).enb_port_for_S1U = enb_port_for_S1U; + + + S1AP_REGISTER_ENB_REQ (msg_p).enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); + cidr = enb_ipv4_address_for_S1_MME; + address = strtok(cidr, "/"); + + if (address) { + IPV4_STR_ADDR_TO_INT_NWBO ( address, S1AP_REGISTER_ENB_REQ(msg_p).enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); + } +*/ + + + + + break; + } + } + } + } + } +return 0; +} + +void NRRCConfig(void) { + + paramlist_def_t MACRLCParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; + paramlist_def_t L1ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; + paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; + paramdef_t GNBSParams[] = GNBSPARAMS_DESC; + paramlist_def_t CCsParamList = {GNB_CONFIG_STRING_COMPONENT_CARRIERS,NULL,0}; char aprefix[MAX_OPTNAME_SIZE*2 + 8]; @@ -2213,26 +2825,26 @@ void NRRCConfig(void) { RC.nb_nr_inst = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; if (RC.nb_nr_inst > 0) { - RC.nb_CC = (int *)malloc((1+RC.nb_nr_inst)*sizeof(int)); + RC.nb_nr_CC = (int *)malloc((1+RC.nb_nr_inst)*sizeof(int)); for (int i=0;i<RC.nb_nr_inst;i++) { sprintf(aprefix,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,i); config_getlist( &CCsParamList,NULL,0, aprefix); - RC.nb_CC[i] = CCsParamList.numelt; + RC.nb_nr_CC[i] = CCsParamList.numelt; } } -/* + // Get num MACRLC instances config_getlist( &MACRLCParamList,NULL,0, NULL); RC.nb_macrlc_inst = MACRLCParamList.numelt; // Get num L1 instances config_getlist( &L1ParamList,NULL,0, NULL); - RC.nb_L1_inst = L1ParamList.numelt; + RC.nb_nr_L1_inst = L1ParamList.numelt; // Get num RU instances config_getlist( &RUParamList,NULL,0, NULL); RC.nb_RU = RUParamList.numelt; - */ + } diff --git a/openair2/ENB_APP/gnb_config.h b/openair2/GNB_APP/gnb_config.h similarity index 83% rename from openair2/ENB_APP/gnb_config.h rename to openair2/GNB_APP/gnb_config.h index 179f7ac03d6b390fa6a46c46a21e4968e5b3c2d8..21acf6b2d288715a24ba00be1d405d1fa333ae88 100644 --- a/openair2/ENB_APP/gnb_config.h +++ b/openair2/GNB_APP/gnb_config.h @@ -37,17 +37,15 @@ #include "commonDef.h" #include "platform_types.h" #include "platform_constants.h" -#include "PHY/impl_defs_lte.h" -#include "PHY/defs.h" +#include "PHY/defs_eNB.h" #include "s1ap_messages_types.h" -//#ifdef CMAKER -//#include "SystemInformationBlockType2.h" -//#include "rrc_messages_types.h" -//#else -//#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h" -//#endif + +#ifdef CMAKER +#include "rrc_messages_types.h" +#endif + #include "intertask_interface_types.h" -#include "RRC/NR/defs_NR.h" +#include "RRC/NR/nr_rrc_defs.h" #define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\ struct in_addr inp;\ @@ -64,7 +62,7 @@ */ // Hard to find a defined value for max enb... -#define MAX_ENB 16 +#define MAX_GNB 16 /* typedef struct mme_ip_address_s { @@ -93,18 +91,18 @@ typedef struct ru_config_s { uint8_t if_compress; } ru_config_t; */ -//extern void RCconfig_RU(void); -//extern void RCconfig_flexran(void); -//extern void RCconfig_L1(void); -//extern void RCconfig_macrlc(void); -//extern int RCconfig_gtpu(void ); +extern void RCconfig_RU(void); +extern void RCconfig_nr_flexran(void); +extern void RCconfig_NR_L1(void); +extern void RCconfig_nr_macrlc(void); +extern int RCconfig_nr_gtpu(void ); extern void NRRCConfig(void); //void enb_config_display(void); //void ru_config_display(void); -int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); -//int RCconfig_S1(MessageDef *msg_p, uint32_t i); +int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc); +int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i); #endif /* GNB_CONFIG_H_ */ /** @} */ diff --git a/openair2/ENB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h similarity index 57% rename from openair2/ENB_APP/gnb_paramdef.h rename to openair2/GNB_APP/gnb_paramdef.h index 96a18fa2ea134d14cbbe2dfa081c6578888695a4..e7a96a3c6178abf2f6d4b5ca3dd9d1eec5764d96 100644 --- a/openair2/ENB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -31,7 +31,7 @@ */ #include "common/config/config_paramdesc.h" -#include "NRRRC_paramsvalues.h" +#include "RRC_nr_paramsvalues.h" #define GNB_CONFIG_STRING_CC_NODE_FUNCTION "node_function" @@ -401,305 +401,660 @@ typedef enum { #define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET "RateMatchPatternLTE_CRS_radioframeAllocationOffset" #define GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE "RateMatchPatternLTE_CRS_subframeAllocation_choice" +/* init for checkedparam_t structure */ + +#define NRCCPARAMS_CHECK { \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ + { .s5= {NULL }} , \ +} + + /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* component carriers configuration parameters */ -/* optname helpstr paramflags XXXptr defXXXval type numelt checked_param */ +/* optname helpstr paramflags XXXptr defXXXval type numelt checked_param */ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define NRCCPARAMS_DESC { \ -{GNB_CONFIG_STRING_FRAME_TYPE, NULL, 0, strptr:&frame_type, defstrval:"FDD", TYPE_STRING, 0}, \ -{GNB_CONFIG_STRING_DL_prefix_type, NULL, 0, strptr:&DL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ -{GNB_CONFIG_STRING_UL_prefix_type, NULL, 0, strptr:&UL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ -{GNB_CONFIG_STRING_EUTRA_BAND, NULL, 0, iptr:&eutra_band, defintval:7, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DOWNLINK_FREQUENCY, NULL, 0, i64ptr:(int64_t *)&downlink_frequency, defint64val:2680000000, TYPE_UINT64, 0}, \ -{GNB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, NULL, 0, iptr:&uplink_frequency_offset, defintval:-120000000, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_NID_CELL, NULL, 0, iptr:&Nid_cell, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_N_RB_DL, NULL, 0, iptr:&N_RB_DL, defintval:25, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_NB_ANT_PORTS, NULL, 0, iptr:&nb_antenna_ports, defintval:1, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_MIB_SUBCARRIERSPACINGCOMMON, NULL, 0, iptr:&MIB_subCarrierSpacingCommon, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_MIB_SSB_SUBCARRIEROFFSET, NULL, 0, iptr:&MIB_ssb_SubcarrierOffset, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_MIB_DMRS_TYPEA_POSITION, NULL, 0, iptr:&MIB_dmrs_TypeA_Position, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDCCH_CONFIGSIB1, NULL, 0, iptr:&pdcch_ConfigSIB1, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SIB1_FREQUENCYOFFSETSSB, NULL, 0, iptr:&SIB1_frequencyOffsetSSB, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SIB1_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&SIB1_ssb_PeriodicityServingCell, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SIB1_SS_PBCH_BLOCKPOWER, NULL, 0, iptr:&SIB1_ss_PBCH_BlockPower, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_ABSOLUTEFREQUENCYSSB, NULL, 0, iptr:&absoluteFrequencySSB, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SSB_SUBCARRIEROFFSET, NULL, 0, iptr:&ssb_SubcarrierOffset, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_FREQBANDINDICATORNR, NULL, 0, iptr:&DL_FreqBandIndicatorNR, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&DL_absoluteFrequencyPointA, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_OFFSETTOCARRIER, NULL, 0, iptr:&DL_offsetToCarrier, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_SCS_SUBCARRIERSPACING, NULL, 0, iptr:&DL_SCS_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_SCS_SPECIFICCARRIER_K0, NULL, 0, iptr:&DL_SCS_SpecificCarrier_k0, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_CARRIERBANDWIDTH, NULL, 0, iptr:&DL_carrierBandwidth, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&DL_locationAndBandwidth, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_BWP_SUBCARRIERSPACING, NULL, 0, iptr:&DL_BWP_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_BWP_PREFIX_TYPE, NULL, 0, iptr:&DL_BWP_prefix_type, defintval:0, TYPE_STRING, 0}, \ -{GNB_CONFIG_STRING_UL_FREQBANDINDICATORNR, NULL, 0, iptr:&UL_FreqBandIndicatorNR, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&UL_absoluteFrequencyPointA, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_ADDITIONALSPECTRUMEMISSION, NULL, 0, iptr:&UL_additionalSpectrumEmission, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_P_MAX, NULL, 0, iptr:&UL_p_Max, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_FREQUENCYSHIFT7P5KHZ, NULL, 0, iptr:&UL_frequencyShift7p5khz, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_OFFSETTOCARRIER, NULL, 0, iptr:&UL_offsetToCarrier, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_SCS_SUBCARRIERSPACING, NULL, 0, iptr:&UL_SCS_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_SCS_SPECIFICCARRIER_K0, NULL, 0, iptr:&UL_SCS_SpecificCarrier_k0, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_CARRIERBANDWIDTH, NULL, 0, iptr:&UL_carrierBandwidth, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&UL_locationAndBandwidth, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_BWP_SUBCARRIERSPACING, NULL, 0, iptr:&UL_BWP_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE, NULL, 0, iptr:&UL_BWP_prefix_type, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR, NULL, 0, iptr:&ServingCellConfigCommon_ssb_PositionsInBurst_PR, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&ServingCellConfigCommon_ssb_periodicityServingCell, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION, NULL, 0, iptr:&ServingCellConfigCommon_dmrs_TypeA_Position, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING, NULL, 0, iptr:&NIA_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER, NULL, 0, iptr:&ServingCellConfigCommon_ss_PBCH_BlockPower, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_REFERENCESUBCARRIERSPACING, NULL, 0, iptr:&referenceSubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_DL_UL_TRANSMISSIONPERIODICITY, NULL, 0, iptr:&dl_UL_TransmissionPeriodicity, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_NROFDOWNLINKSLOTS, NULL, 0, iptr:&nrofDownlinkSlots, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS, NULL, 0, iptr:&nrofDownlinkSymbols, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_NROFUPLINKSLOTS, NULL, 0, iptr:&nrofUplinkSlots, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_NROFUPLINKSYMBOLS, NULL, 0, iptr:&nrofUplinkSymbols, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_TOTALNUMBEROFRA_PREAMBLES, NULL, 0, iptr:&rach_totalNumberOfRA_Preambles, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_GROUPBCONFIGURED, NULL, 0, iptr:&rach_groupBconfigured, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_RA_MSG3SIZEGROUPA, NULL, 0, iptr:&rach_ra_Msg3SizeGroupA, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, NULL, 0, iptr:&rach_messagePowerOffsetGroupB, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_NUMBEROFRA_PREAMBLESGROUPA, NULL, 0, iptr:&rach_numberOfRA_PreamblesGroupA, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_RA_CONTENTIONRESOLUTIONTIMER, NULL, 0, iptr:&rach_ra_ContentionResolutionTimer, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RSRP_THRESHOLDSSB, NULL, 0, iptr:&rsrp_ThresholdSSB, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RSRP_THRESHOLDSSB_SUL, NULL, 0, iptr:&rsrp_ThresholdSSB_SUL, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_CHOICE, NULL, 0, iptr:&prach_RootSequenceIndex_choice, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_L839, NULL, 0, iptr:&prach_RootSequenceIndex_l839, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_L139, NULL, 0, iptr:&prach_RootSequenceIndex_l139, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PRACH_MSG1_SUBCARRIERSPACING, NULL, 0, iptr:&prach_msg1_SubcarrierSpacing, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RESTRICTEDSETCONFIG, NULL, 0, iptr:&restrictedSetConfig, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_MSG3_TRANSFORMPRECODING, NULL, 0, iptr:&msg3_transformPrecoding, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PRACH_CONFIGURATIONINDEX, NULL, 0, iptr:&prach_ConfigurationIndex, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PRACH_MSG1_FDM, NULL, 0, iptr:&prach_msg1_FDM, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PRACH_MSG1_FREQUENCYSTART, NULL, 0, iptr:&prach_msg1_FrequencyStart, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_ZEROCORRELATIONZONECONFIG, NULL, 0, iptr:&zeroCorrelationZoneConfig, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PREAMBLERECEIVEDTARGETPOWER, NULL, 0, iptr:&preambleReceivedTargetPower, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PREAMBLETRANSMAX, NULL, 0, iptr:&preambleTransMax, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_POWERRAMPINGSTEP, NULL, 0, iptr:&powerRampingStep, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RA_RESPONSEWINDOW, NULL, 0, iptr:&ra_ResponseWindow, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_GROUPHOPPINGENABLEDTRANSFORMPRECODING, NULL, 0, iptr:&groupHoppingEnabledTransformPrecoding, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_MSG3_DELTAPREAMBLE, NULL, 0, iptr:&msg3_DeltaPreamble, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_P0_NOMINALWITHGRANT, NULL, 0, iptr:&p0_NominalWithGrant, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2, NULL, 0, iptr:&PUSCH_TimeDomainResourceAllocation_k2, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE, NULL, 0, iptr:&PUSCH_TimeDomainResourceAllocation_mappingType, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PUCCH_GROUPHOPPING, NULL, 0, iptr:&pucch_GroupHopping, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_P0_NOMINAL, NULL, 0, iptr:&p0_nominal, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0, NULL, 0, iptr:&PDSCH_TimeDomainResourceAllocation_k0, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE, NULL, 0, iptr:&PDSCH_TimeDomainResourceAllocation_mappingType, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERNID, NULL, 0, iptr:&rateMatchPatternId, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERN_PATTERNTYPE, NULL, 0, iptr:&RateMatchPattern_patternType, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SYMBOLSINRESOURCEBLOCK, NULL, 0, iptr:&symbolsInResourceBlock, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PERIODICITYANDPATTERN, NULL, 0, iptr:&periodicityAndPattern, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERN_CONTROLRESOURCESET, NULL, 0, iptr:&RateMatchPattern_controlResourceSet, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERN_SUBCARRIERSPACING, NULL, 0, iptr:&RateMatchPattern_subcarrierSpacing, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERN_MODE, NULL, 0, iptr:&RateMatchPattern_mode, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACESIB1, NULL, 0, iptr:&searchSpaceSIB1, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACEOTHERSYSTEMINFORMATION, NULL, 0, iptr:&searchSpaceOtherSystemInformation, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PAGINGSEARCHSPACE, NULL, 0, iptr:&pagingSearchSpace, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RA_SEARCHSPACE, NULL, 0, iptr:&ra_SearchSpace, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RACH_RA_CONTROLRESOURCESET, NULL, 0, iptr:&rach_ra_ControlResourceSet, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDCCH_COMMON_CONTROLRESOURCESETID, NULL, 0, iptr:&PDCCH_common_controlResourceSetId, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDCCH_COMMON_CONTROLRESOURCESET_DURATION, NULL, 0, iptr:&PDCCH_common_ControlResourceSet_duration, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDCCH_CCE_REG_MAPPINGTYPE, NULL, 0, iptr:&PDCCH_cce_REG_MappingType, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDCCH_REG_BUNDLESIZE, NULL, 0, iptr:&PDCCH_reg_BundleSize, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDCCH_INTERLEAVERSIZE, NULL, 0, iptr:&PDCCH_interleaverSize, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDCCH_SHIFTINDEX, NULL, 0, iptr:&PDCCH_shiftIndex, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDCCH_PRECODERGRANULARITY, NULL, 0, iptr:&PDCCH_precoderGranularity, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_PDCCH_TCI_STATEID, NULL, 0, iptr:&PDCCH_TCI_StateId, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_TCI_PRESENTINDCI, NULL, 0, iptr:&tci_PresentInDCI, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACEID, NULL, 0, iptr:&SearchSpaceId, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_COMMONSEARCHSPACES_CONTROLRESOURCESETID, NULL, 0, iptr:&commonSearchSpaces_controlResourceSetId, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_choice, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL1, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl1, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL2, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl2, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL4, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl4, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL5, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl5, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL8, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl8, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL10, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl10, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL16, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl16, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL20, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl20, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel1, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel2, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel4, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel8, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel16, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_SEARCHSPACE_SEARCHSPACETYPE, NULL, 0, iptr:&SearchSpace_searchSpaceType, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY, NULL, 0, iptr:&Common_dci_Format2_3_monitoringPeriodicity, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES, NULL, 0, iptr:&Common_dci_Format2_3_nrofPDCCH_Candidates, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_UE_SPECIFIC__DCI_FORMATS, NULL, 0, iptr:&ue_Specific__dci_Formats, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL, NULL, 0, iptr:&RateMatchPatternLTE_CRS_carrierFreqDL, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL, NULL, 0, iptr:&RateMatchPatternLTE_CRS_carrierBandwidthDL, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS, NULL, 0, iptr:&RateMatchPatternLTE_CRS_nrofCRS_Ports, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_V_SHIFT, NULL, 0, iptr:&RateMatchPatternLTE_CRS_v_Shift, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD, NULL, 0, iptr:&RateMatchPatternLTE_CRS_radioframeAllocationPeriod, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET, NULL, 0, iptr:&RateMatchPatternLTE_CRS_radioframeAllocationOffset, defintval:0, TYPE_UINT, 0}, \ -{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE, NULL, 0, iptr:&RateMatchPatternLTE_CRS_subframeAllocation_choice, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_FRAME_TYPE, NULL, 0, strptr:&frame_type, defstrval:"FDD", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_DL_PREFIX_TYPE, NULL, 0, strptr:&DL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_UL_PREFIX_TYPE, NULL, 0, strptr:&UL_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_EUTRA_BAND, NULL, 0, iptr:&eutra_band, defintval:7, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_DOWNLINK_FREQUENCY, NULL, 0, i64ptr:(int64_t *)&downlink_frequency, defint64val:2680000000, TYPE_UINT64, 0}, \ +{GNB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, NULL, 0, iptr:&uplink_frequency_offset, defintval:-120000000, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_NID_CELL, NULL, 0, iptr:&Nid_cell, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_N_RB_DL, NULL, 0, iptr:&N_RB_DL, defintval:25, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_NB_ANT_PORTS, NULL, 0, iptr:&nb_antenna_ports, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_MIB_SUBCARRIERSPACINGCOMMON, NULL, 0, iptr:&MIB_subCarrierSpacingCommon, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_MIB_SSB_SUBCARRIEROFFSET, NULL, 0, iptr:&MIB_ssb_SubcarrierOffset, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_MIB_DMRS_TYPEA_POSITION, NULL, 0, iptr:&MIB_dmrs_TypeA_Position, defintval:2, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PDCCH_CONFIGSIB1, NULL, 0, iptr:&pdcch_ConfigSIB1, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SIB1_FREQUENCYOFFSETSSB, NULL, 0, strptr:&SIB1_frequencyOffsetSSB, defstrval:"khz5", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_SIB1_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&SIB1_ssb_PeriodicityServingCell, defintval:5, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SIB1_SS_PBCH_BLOCKPOWER, NULL, 0, iptr:&SIB1_ss_PBCH_BlockPower, defintval:-60, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_ABSOLUTEFREQUENCYSSB, NULL, 0, iptr:&absoluteFrequencySSB, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SSB_SUBCARRIEROFFSET, NULL, 0, iptr:&ssb_SubcarrierOffset, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_DL_FREQBANDINDICATORNR, NULL, 0, iptr:&DL_FreqBandIndicatorNR, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_DL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&DL_absoluteFrequencyPointA, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_DL_OFFSETTOCARRIER, NULL, 0, iptr:&DL_offsetToCarrier, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_DL_SCS_SUBCARRIERSPACING, NULL, 0, strptr:&DL_SCS_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_DL_SCS_SPECIFICCARRIER_K0, NULL, 0, iptr:&DL_SCS_SpecificCarrier_k0, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_DL_CARRIERBANDWIDTH, NULL, 0, iptr:&DL_carrierBandwidth, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_DL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&DL_locationAndBandwidth, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_DL_BWP_SUBCARRIERSPACING, NULL, 0, strptr:&DL_BWP_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_DL_BWP_PREFIX_TYPE, NULL, 0, strptr:&DL_BWP_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_UL_FREQBANDINDICATORNR, NULL, 0, iptr:&UL_FreqBandIndicatorNR, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_UL_ABSOLUTEFREQUENCYPOINTA, NULL, 0, iptr:&UL_absoluteFrequencyPointA, defintval:13, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_UL_ADDITIONALSPECTRUMEMISSION, NULL, 0, iptr:&UL_additionalSpectrumEmission, defintval:3, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_UL_P_MAX, NULL, 0, iptr:&UL_p_Max, defintval:-1, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_UL_FREQUENCYSHIFT7P5KHZ, NULL, 0, strptr:&UL_frequencyShift7p5khz, defstrval:"TRUE", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_UL_OFFSETTOCARRIER, NULL, 0, iptr:&UL_offsetToCarrier, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_UL_SCS_SUBCARRIERSPACING, NULL, 0, strptr:&UL_SCS_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_UL_SCS_SPECIFICCARRIER_K0, NULL, 0, iptr:&UL_SCS_SpecificCarrier_k0, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_UL_CARRIERBANDWIDTH, NULL, 0, iptr:&UL_carrierBandwidth, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_UL_LOCATIONANDBANDWIDTH, NULL, 0, iptr:&UL_locationAndBandwidth, defintval:15, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_UL_BWP_SUBCARRIERSPACING, NULL, 0, strptr:&UL_BWP_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_UL_BWP_PREFIX_TYPE, NULL, 0, strptr:&UL_BWP_prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR, NULL, 0, strptr:&ServingCellConfigCommon_ssb_PositionsInBurst_PR, defstrval:"shortBitmap", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL, NULL, 0, iptr:&ServingCellConfigCommon_ssb_periodicityServingCell, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION, NULL, 0, iptr:&ServingCellConfigCommon_dmrs_TypeA_Position, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_NIA_SUBCARRIERSPACING, NULL, 0, strptr:&NIA_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER, NULL, 0, iptr:&ServingCellConfigCommon_ss_PBCH_BlockPower, defintval:-60, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_REFERENCESUBCARRIERSPACING, NULL, 0, strptr:&referenceSubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_DL_UL_TRANSMISSIONPERIODICITY, NULL, 0, strptr:&dl_UL_TransmissionPeriodicity, defstrval:"ms0p5", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_NROFDOWNLINKSLOTS, NULL, 0, iptr:&nrofDownlinkSlots, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_NROFDOWNLINKSYMBOLS, NULL, 0, iptr:&nrofDownlinkSymbols, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_NROFUPLINKSLOTS, NULL, 0, iptr:&nrofUplinkSlots, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_NROFUPLINKSYMBOLS, NULL, 0, iptr:&nrofUplinkSymbols, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_TOTALNUMBEROFRA_PREAMBLES, NULL, 0, iptr:&rach_totalNumberOfRA_Preambles, defintval:63, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE, NULL, 0, strptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice, defstrval:"oneEighth", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth, defintval:4, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth, defintval:8, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf, defintval:16, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one, defintval:24, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two, defintval:32, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four, defintval:8, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight, defintval:4, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN, NULL, 0, iptr:&rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen, defintval:2, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_GROUPBCONFIGURED, NULL, 0, strptr:&rach_groupBconfigured, defstrval:"ENABLE", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_RACH_RA_MSG3SIZEGROUPA, NULL, 0, iptr:&rach_ra_Msg3SizeGroupA, defintval:56, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, NULL, 0, strptr:&rach_messagePowerOffsetGroupB, defstrval:"dB0", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_RACH_NUMBEROFRA_PREAMBLESGROUPA, NULL, 0, iptr:&rach_numberOfRA_PreamblesGroupA, defintval:32, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_RA_CONTENTIONRESOLUTIONTIMER, NULL, 0, iptr:&rach_ra_ContentionResolutionTimer, defintval:8, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RSRP_THRESHOLDSSB, NULL, 0, iptr:&rsrp_ThresholdSSB, defintval:64, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RSRP_THRESHOLDSSB_SUL, NULL, 0, iptr:&rsrp_ThresholdSSB_SUL, defintval:64, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_CHOICE, NULL, 0, strptr:&prach_RootSequenceIndex_choice, defstrval:"l839", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_L839, NULL, 0, iptr:&prach_RootSequenceIndex_l839, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PRACH_ROOTSEQUENCEINDEX_L139, NULL, 0, iptr:&prach_RootSequenceIndex_l139, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PRACH_MSG1_SUBCARRIERSPACING, NULL, 0, strptr:&prach_msg1_SubcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_RESTRICTEDSETCONFIG, NULL, 0, strptr:&restrictedSetConfig, defstrval:"unrestrictedSet", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_MSG3_TRANSFORMPRECODING, NULL, 0, strptr:&msg3_transformPrecoding, defstrval:"ENABLE", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_PRACH_CONFIGURATIONINDEX, NULL, 0, iptr:&prach_ConfigurationIndex, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PRACH_MSG1_FDM, NULL, 0, strptr:&prach_msg1_FDM, defstrval:"one", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_PRACH_MSG1_FREQUENCYSTART, NULL, 0, iptr:&prach_msg1_FrequencyStart, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_ZEROCORRELATIONZONECONFIG, NULL, 0, iptr:&zeroCorrelationZoneConfig, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PREAMBLERECEIVEDTARGETPOWER, NULL, 0, iptr:&preambleReceivedTargetPower, defintval:-150, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_PREAMBLETRANSMAX, NULL, 0, iptr:&preambleTransMax, defintval:6, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_POWERRAMPINGSTEP, NULL, 0, strptr:&powerRampingStep, defstrval:"dB0", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_RA_RESPONSEWINDOW, NULL, 0, iptr:&ra_ResponseWindow, defintval:8, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_GROUPHOPPINGENABLEDTRANSFORMPRECODING, NULL, 0, strptr:&groupHoppingEnabledTransformPrecoding, defstrval:"ENABLE", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_MSG3_DELTAPREAMBLE, NULL, 0, iptr:&msg3_DeltaPreamble, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_P0_NOMINALWITHGRANT, NULL, 0, iptr:&p0_NominalWithGrant, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2, NULL, 0, iptr:&PUSCH_TimeDomainResourceAllocation_k2, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE, NULL, 0, strptr:&PUSCH_TimeDomainResourceAllocation_mappingType, defstrval:"typeA", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_PUCCH_GROUPHOPPING, NULL, 0, strptr:&pucch_GroupHopping, defstrval:"neither", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_P0_NOMINAL, NULL, 0, iptr:&p0_nominal, defintval:-30, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0, NULL, 0, iptr:&PDSCH_TimeDomainResourceAllocation_k0, defintval:2, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE, NULL, 0, strptr:&PDSCH_TimeDomainResourceAllocation_mappingType, defstrval:"typeA", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERNID, NULL, 0, iptr:&rateMatchPatternId, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERN_PATTERNTYPE, NULL, 0, strptr:&RateMatchPattern_patternType, defstrval:"bitmaps", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_SYMBOLSINRESOURCEBLOCK, NULL, 0, strptr:&symbolsInResourceBlock, defstrval:"oneSlot", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_PERIODICITYANDPATTERN, NULL, 0, iptr:&periodicityAndPattern, defintval:2, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERN_CONTROLRESOURCESET, NULL, 0, iptr:&RateMatchPattern_controlResourceSet, defintval:5, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERN_SUBCARRIERSPACING, NULL, 0, strptr:&RateMatchPattern_subcarrierSpacing, defstrval:"kHz15", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERN_MODE, NULL, 0, strptr:&RateMatchPattern_mode, defstrval:"dynamic", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACESIB1, NULL, 0, iptr:&searchSpaceSIB1, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACEOTHERSYSTEMINFORMATION, NULL, 0, iptr:&searchSpaceOtherSystemInformation, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PAGINGSEARCHSPACE, NULL, 0, iptr:&pagingSearchSpace, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RA_SEARCHSPACE, NULL, 0, iptr:&ra_SearchSpace, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RACH_RA_CONTROLRESOURCESET, NULL, 0, iptr:&rach_ra_ControlResourceSet, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PDCCH_COMMON_CONTROLRESOURCESETID, NULL, 0, iptr:&PDCCH_common_controlResourceSetId, defintval:5, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PDCCH_COMMON_CONTROLRESOURCESET_DURATION, NULL, 0, iptr:&PDCCH_common_ControlResourceSet_duration, defintval:2, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PDCCH_CCE_REG_MAPPINGTYPE, NULL, 0, strptr:&PDCCH_cce_REG_MappingType, defstrval:"nonInterleaved", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_PDCCH_REG_BUNDLESIZE, NULL, 0, iptr:&PDCCH_reg_BundleSize, defintval:3, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PDCCH_INTERLEAVERSIZE, NULL, 0, iptr:&PDCCH_interleaverSize, defintval:3, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PDCCH_SHIFTINDEX, NULL, 0, iptr:&PDCCH_shiftIndex, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_PDCCH_PRECODERGRANULARITY, NULL, 0, strptr:&PDCCH_precoderGranularity, defstrval:"sameAsREG-bundle", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_PDCCH_TCI_STATEID, NULL, 0, iptr:&PDCCH_TCI_StateId, defintval:32, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_TCI_PRESENTINDCI, NULL, 0, strptr:&tci_PresentInDCI, defstrval:"ENABLE", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACEID, NULL, 0, iptr:&SearchSpaceId, defintval:10, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_COMMONSEARCHSPACES_CONTROLRESOURCESETID, NULL, 0, iptr:&commonSearchSpaces_controlResourceSetId, defintval:5, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE, NULL, 0, strptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_choice, defstrval:"sl1", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL1, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl1, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL2, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl2, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL4, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl4, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL5, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl5, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL8, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl8, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL10, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl10, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL16, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl16, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL20, NULL, 0, iptr:&SearchSpace_monitoringSlotPeriodicityAndOffset_sl20, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel1, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel2, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel4, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel8, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16, NULL, 0, iptr:&SearchSpace_nrofCandidates_aggregationLevel16, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SEARCHSPACE_SEARCHSPACETYPE, NULL, 0, strptr:&SearchSpace_searchSpaceType, defstrval:"common", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1, defintval:1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2, defintval:1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4, defintval:1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8, defintval:1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16, NULL, 0, iptr:&Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16, defintval:1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY, NULL, 0, iptr:&Common_dci_Format2_3_monitoringPeriodicity, defintval:1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES, NULL, 0, iptr:&Common_dci_Format2_3_nrofPDCCH_Candidates, defintval:1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_UE_SPECIFIC__DCI_FORMATS, NULL, 0, strptr:&ue_Specific__dci_Formats, defstrval:"formats0-0-And-1-0", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL, NULL, 0, iptr:&RateMatchPatternLTE_CRS_carrierFreqDL, defintval:6, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL, NULL, 0, iptr:&RateMatchPatternLTE_CRS_carrierBandwidthDL, defintval:6, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS, NULL, 0, iptr:&RateMatchPatternLTE_CRS_nrofCRS_Ports, defintval:1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_V_SHIFT, NULL, 0, iptr:&RateMatchPatternLTE_CRS_v_Shift, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD, NULL, 0, iptr:&RateMatchPatternLTE_CRS_radioframeAllocationPeriod, defintval:1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET, NULL, 0, iptr:&RateMatchPatternLTE_CRS_radioframeAllocationOffset, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE, NULL, 0, strptr:&RateMatchPatternLTE_CRS_subframeAllocation_choice, defstrval:"oneFrame", TYPE_STRING, 0}, \ } /* component carries configuration parameters name */ -#define ENB_CONFIG_FRAME_TYPE_IDX 0 -#define ENB_CONFIG_DL_PREFIX_TYPE_IDX 1 -#define ENB_CONFIG_UL_PREFIX_TYPE_IDX 1 -#define ENB_CONFIG_EUTRA_BAND_IDX 2 -#define ENB_CONFIG_DOWNLINK_FREQUENCY_IDX 3 -#define ENB_CONFIG_UPLINK_FREQUENCY_OFFSET_IDX 4 -#define ENB_CONFIG_NID_CELL_IDX 5 -#define ENB_CONFIG_N_RB_DL_IDX 6 -#define GNB_CONFIG_NB_ANT_PORTS_IDX -#define GNB_CONFIG_NB_ANT_TX_IDX -#define GNB_CONFIG_NB_ANT_RX_IDX -#define GNB_CONFIG_TX_GAIN_IDX -#define GNB_CONFIG_RX_GAIN_IDX -#define GNB_CONFIG_MIB_SUBCARRIERSPACINGCOMMON_IDX -#define GNB_CONFIG_MIB_SSB_SUBCARRIEROFFSET_IDX -#define GNB_CONFIG_MIB_DMRS_TYPEA_POSITION_IDX -#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX -#define GNB_CONFIG_SIB1_FREQUENCYOFFSETSSB_IDX -#define GNB_CONFIG_SIB1_SSB_PERIODICITYSERVINGCELL_IDX -#define GNB_CONFIG_SIB1_SS_PBCH_BLOCKPOWER_IDX -#define GNB_CONFIG_ABSOLUTEFREQUENCYSSB_IDX -#define GNB_CONFIG_SSB_SUBCARRIEROFFSET_IDX -#define GNB_CONFIG_DL_FREQBANDINDICATORNR_IDX -#define GNB_CONFIG_DL_ABSOLUTEFREQUENCYPOINTA_IDX -#define GNB_CONFIG_DL_OFFSETTOCARRIER_IDX -#define GNB_CONFIG_DL_SUBCARRIERSPACING_IDX -#define GNB_CONFIG_DL_SCS_SPECIFICCARRIER_K0_IDX -#define GNB_CONFIG_DL_CARRIERBANDWIDTH_IDX -#define GNB_CONFIG_DL_LOCATIONANDBANDWIDTH_IDX -#define GNB_CONFIG_DL_BWP_SUBCARRIERSPACING_IDX -#define GNB_CONFIG_DL_BWP_PREFIX_TYPE_IDX -#define GNB_CONFIG_UL_FREQBANDINDICATORNR_IDX -#define GNB_CONFIG_UL_ABSOLUTEFREQUENCYPOINTA_IDX -#define GNB_CONFIG_UL_ADDITIONALSPECTRUMEMISSION_IDX; -#define GNB_CONFIG_UL_P_MAX_IDX -#define GNB_CONFIG_UL_FREQUENCYSHIFT7P5KHZ_IDX -#define GNB_CONFIG_UL_OFFSETTOCARRIER_IDX -#define GNB_CONFIG_UL_SCS_SUBCARRIERSPACING_IDX -#define GNB_CONFIG_UL_SCS_SPECIFICCARRIER_K0_IDX -#define GNB_CONFIG_UL_CARRIERBANDWIDTH_IDX -#define GNB_CONFIG_UL_LOCATIONANDBANDWIDTH_IDX -#define GNB_CONFIG_UL_BWP_SUBCARRIERSPACING_IDX -#define GNB_CONFIG_UL_BWP_PREFIX_TYPE_IDX -#define GNB_CONFIG_SUBCARRIERSPACINGCOMMON_IDX -#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX -#define GNB_CONFIG_FREQUENCYOFFSETSSB_IDX -#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR_IDX -#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL_IDX -#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION_IDX -#define GNB_CONFIG_NIA_SUBCARRIERSPACING_IDX -#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER_IDX -#define GNB_CONFIG_REFERENCESUBCARRIERSPACING_IDX -#define GNB_CONFIG_DL_UL_TRANSMISSIONPERIODICITY_IDX -#define GNB_CONFIG_NROFDOWNLINKSLOTS_IDX -#define GNB_CONFIG_NROFDOWNLINKSYMBOLS_IDX -#define GNB_CONFIG_NROFUPLINKSLOTS_IDX -#define GNB_CONFIG_NROFUPLINKSYMBOLS_IDX -#define GNB_CONFIG_RACH_TOTALNUMBEROFRA_PREAMBLES_IDX -#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE_IDX -#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH_IDX -#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH_IDX -#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF_IDX -#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE_IDX -#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO_IDX -#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR_IDX -#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT_IDX -#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN_IDX -#define GNB_CONFIG_RACH_GROUPBCONFIGURED_IDX -#define GNB_CONFIG_RACH_RA_MSG3SIZEGROUPA_IDX -#define GNB_CONFIG_RACH_MESSAGEPOWEROFFSETGROUPB_IDX -#define GNB_CONFIG_RACH_NUMBEROFRA_PREAMBLESGROUPA_IDX -#define GNB_CONFIG_RACH_RA_CONTENTIONRESOLUTIONTIMER_IDX -#define GNB_CONFIG_RSRP_THRESHOLDSSB_IDX -#define GNB_CONFIG_RSRP_THRESHOLDSSB_SUL_IDX -#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_CHOICE_IDX -#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L839_IDX -#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L139_IDX -#define GNB_CONFIG_PRACH_MSG1_SUBCARRIERSPACING_IDX -#define GNB_CONFIG_RESTRICTEDSETCONFIG_IDX -#define GNB_CONFIG_MSG3_TRANSFORMPRECODING_IDX -#define GNB_CONFIG_PRACH_CONFIGURATIONINDEX_IDX -#define GNB_CONFIG_PRACH_MSG1_FDM_IDX -#define GNB_CONFIG_PRACH_MSG1_FREQUENCYSTART_IDX -#define GNB_CONFIG_ZEROCORRELATIONZONECONFIG_IDX -#define GNB_CONFIG_PREAMBLERECEIVEDTARGETPOWER_IDX -#define GNB_CONFIG_PREAMBLETRANSMAX_IDX -#define GNB_CONFIG_POWERRAMPINGSTEP_IDX -#define GNB_CONFIG_RA_RESPONSEWINDOW_IDX -#define GNB_CONFIG_GROUPHOPPINGENABLEDTRANSFORMPRECODING_IDX -#define GNB_CONFIG_MSG3_DELTAPREAMBLE_IDX -#define GNB_CONFIG_P0_NOMINALWITHGRANT_IDX -#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2_IDX -#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX -#define GNB_CONFIG_PUCCH_GROUPHOPPING_IDX -#define GNB_CONFIG_P0_NOMINAL_IDX -#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0_IDX -#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX -#define GNB_CONFIG_RATEMATCHPATTERNID_IDX -#define GNB_CONFIG_RATEMATCHPATTERN_PATTERNTYPE_IDX -#define GNB_CONFIG_SYMBOLSINRESOURCEBLOCK_IDX -#define GNB_CONFIG_PERIODICITYANDPATTERN_IDX -#define GNB_CONFIG_RATEMATCHPATTERN_CONTROLRESOURCESET_IDX -#define GNB_CONFIG_RATEMATCHPATTERN_SUBCARRIERSPACING_IDX -#define GNB_CONFIG_RATEMATCHPATTERN_MODE_IDX -#define GNB_CONFIG_SEARCHSPACESIB1_IDX -#define GNB_CONFIG_SEARCHSPACEOTHERSYSTEMINFORMATION_IDX -#define GNB_CONFIG_PAGINGSEARCHSPACE_IDX -#define GNB_CONFIG_RA_SEARCHSPACE_IDX -#define GNB_CONFIG_RACH_RA_CONTROLRESOURCESET_IDX -#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESETID_IDX -#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESET_DURATION_IDX -#define GNB_CONFIG_PDCCH_CCE_REG_MAPPINGTYPE_IDX -#define GNB_CONFIG_PDCCH_REG_BUNDLESIZE_IDX -#define GNB_CONFIG_PDCCH_INTERLEAVERSIZE_IDX -#define GNB_CONFIG_PDCCH_SHIFTINDEX_IDX -#define GNB_CONFIG_PDCCH_PRECODERGRANULARITY_IDX -#define GNB_CONFIG_PDCCH_TCI_STATEID_IDX -#define GNB_CONFIG_TCI_PRESENTINDCI_IDX -#define GNB_CONFIG_SEARCHSPACEID_IDX -#define GNB_CONFIG_COMMONSEARCHSPACES_CONTROLRESOURCESETID_IDX -#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE_IDX -#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL1_IDX -#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL2_IDX -#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL4_IDX -#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL5_IDX -#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL8_IDX -#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL10_IDX -#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL16_IDX -#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL20_IDX -#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1_IDX -#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2_IDX -#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4_IDX -#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8_IDX -#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16_IDX -#define GNB_CONFIG_SEARCHSPACE_SEARCHSPACETYPE_IDX -#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1_IDX -#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2_IDX -#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4_IDX -#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8_IDX -#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16_IDX -#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY_IDX -#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES_IDX -#define GNB_CONFIG_UE_SPECIFIC__DCI_FORMATS_IDX -#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL_IDX -#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL_IDX -#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS_IDX -#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_V_SHIFT_IDX -#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD_IDX -#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET_IDX -#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE_IDX \ No newline at end of file +#define GNB_CONFIG_FRAME_TYPE_IDX 0 +#define GNB_CONFIG_DL_PREFIX_TYPE_IDX 1 +#define GNB_CONFIG_UL_PREFIX_TYPE_IDX 2 +#define GNB_CONFIG_EUTRA_BAND_IDX 3 +#define GNB_CONFIG_DOWNLINK_FREQUENCY_IDX 4 +#define GNB_CONFIG_UPLINK_FREQUENCY_OFFSET_IDX 5 +#define GNB_CONFIG_NID_CELL_IDX 6 +#define GNB_CONFIG_N_RB_DL_IDX 7 +#define GNB_CONFIG_NB_ANT_PORTS_IDX 8 +#define GNB_CONFIG_NB_ANT_TX_IDX 9 +#define GNB_CONFIG_NB_ANT_RX_IDX 10 +#define GNB_CONFIG_TX_GAIN_IDX 11 +#define GNB_CONFIG_RX_GAIN_IDX 12 +#define GNB_CONFIG_MIB_SUBCARRIERSPACINGCOMMON_IDX 13 +#define GNB_CONFIG_MIB_SSB_SUBCARRIEROFFSET_IDX 14 +#define GNB_CONFIG_MIB_DMRS_TYPEA_POSITION_IDX 15 +#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX 16 +#define GNB_CONFIG_SIB1_FREQUENCYOFFSETSSB_IDX 17 +#define GNB_CONFIG_SIB1_SSB_PERIODICITYSERVINGCELL_IDX 18 +#define GNB_CONFIG_SIB1_SS_PBCH_BLOCKPOWER_IDX 19 +#define GNB_CONFIG_ABSOLUTEFREQUENCYSSB_IDX 20 +#define GNB_CONFIG_SSB_SUBCARRIEROFFSET_IDX 21 +#define GNB_CONFIG_DL_FREQBANDINDICATORNR_IDX 22 +#define GNB_CONFIG_DL_ABSOLUTEFREQUENCYPOINTA_IDX 23 +#define GNB_CONFIG_DL_OFFSETTOCARRIER_IDX 24 +#define GNB_CONFIG_DL_SUBCARRIERSPACING_IDX 25 +#define GNB_CONFIG_DL_SCS_SPECIFICCARRIER_K0_IDX 26 +#define GNB_CONFIG_DL_CARRIERBANDWIDTH_IDX 27 +#define GNB_CONFIG_DL_LOCATIONANDBANDWIDTH_IDX 28 +#define GNB_CONFIG_DL_BWP_SUBCARRIERSPACING_IDX 29 +#define GNB_CONFIG_DL_BWP_PREFIX_TYPE_IDX 30 +#define GNB_CONFIG_UL_FREQBANDINDICATORNR_IDX 31 +#define GNB_CONFIG_UL_ABSOLUTEFREQUENCYPOINTA_IDX 32 +#define GNB_CONFIG_UL_ADDITIONALSPECTRUMEMISSION_IDX 33 +#define GNB_CONFIG_UL_P_MAX_IDX 34 +#define GNB_CONFIG_UL_FREQUENCYSHIFT7P5KHZ_IDX 35 +#define GNB_CONFIG_UL_OFFSETTOCARRIER_IDX 36 +#define GNB_CONFIG_UL_SCS_SUBCARRIERSPACING_IDX 37 +#define GNB_CONFIG_UL_SCS_SPECIFICCARRIER_K0_IDX 38 +#define GNB_CONFIG_UL_CARRIERBANDWIDTH_IDX 39 +#define GNB_CONFIG_UL_LOCATIONANDBANDWIDTH_IDX 41 +#define GNB_CONFIG_UL_BWP_SUBCARRIERSPACING_IDX 42 +#define GNB_CONFIG_UL_BWP_PREFIX_TYPE_IDX 43 +#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR_IDX 44 +#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL_IDX 46 +#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION_IDX 47 +#define GNB_CONFIG_NIA_SUBCARRIERSPACING_IDX 48 +#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER_IDX 49 +#define GNB_CONFIG_REFERENCESUBCARRIERSPACING_IDX 50 +#define GNB_CONFIG_DL_UL_TRANSMISSIONPERIODICITY_IDX 51 +#define GNB_CONFIG_NROFDOWNLINKSLOTS_IDX 52 +#define GNB_CONFIG_NROFDOWNLINKSYMBOLS_IDX 53 +#define GNB_CONFIG_NROFUPLINKSLOTS_IDX 54 +#define GNB_CONFIG_NROFUPLINKSYMBOLS_IDX 55 +#define GNB_CONFIG_RACH_TOTALNUMBEROFRA_PREAMBLES_IDX 56 +#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE_IDX 57 +#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH_IDX 58 +#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH_IDX 59 +#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF_IDX 60 +#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE_IDX 61 +#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO_IDX 62 +#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR_IDX 63 +#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT_IDX 64 +#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN_IDX 65 +#define GNB_CONFIG_RACH_GROUPBCONFIGURED_IDX 66 +#define GNB_CONFIG_RACH_RA_MSG3SIZEGROUPA_IDX 67 +#define GNB_CONFIG_RACH_MESSAGEPOWEROFFSETGROUPB_IDX 68 +#define GNB_CONFIG_RACH_NUMBEROFRA_PREAMBLESGROUPA_IDX 69 +#define GNB_CONFIG_RACH_RA_CONTENTIONRESOLUTIONTIMER_IDX 60 +#define GNB_CONFIG_RSRP_THRESHOLDSSB_IDX 70 +#define GNB_CONFIG_RSRP_THRESHOLDSSB_SUL_IDX 71 +#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_CHOICE_IDX 72 +#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L839_IDX 73 +#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L139_IDX 74 +#define GNB_CONFIG_PRACH_MSG1_SUBCARRIERSPACING_IDX 75 +#define GNB_CONFIG_RESTRICTEDSETCONFIG_IDX 76 +#define GNB_CONFIG_MSG3_TRANSFORMPRECODING_IDX 77 +#define GNB_CONFIG_PRACH_CONFIGURATIONINDEX_IDX 78 +#define GNB_CONFIG_PRACH_MSG1_FDM_IDX 79 +#define GNB_CONFIG_PRACH_MSG1_FREQUENCYSTART_IDX 80 +#define GNB_CONFIG_ZEROCORRELATIONZONECONFIG_IDX 81 +#define GNB_CONFIG_PREAMBLERECEIVEDTARGETPOWER_IDX 82 +#define GNB_CONFIG_PREAMBLETRANSMAX_IDX 83 +#define GNB_CONFIG_POWERRAMPINGSTEP_IDX 84 +#define GNB_CONFIG_RA_RESPONSEWINDOW_IDX 85 +#define GNB_CONFIG_GROUPHOPPINGENABLEDTRANSFORMPRECODING_IDX 86 +#define GNB_CONFIG_MSG3_DELTAPREAMBLE_IDX 87 +#define GNB_CONFIG_P0_NOMINALWITHGRANT_IDX 88 +#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2_IDX 89 +#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX 90 +#define GNB_CONFIG_PUCCH_GROUPHOPPING_IDX 91 +#define GNB_CONFIG_P0_NOMINAL_IDX 92 +#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0_IDX 93 +#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX 94 +#define GNB_CONFIG_RATEMATCHPATTERNID_IDX 95 +#define GNB_CONFIG_RATEMATCHPATTERN_PATTERNTYPE_IDX 96 +#define GNB_CONFIG_SYMBOLSINRESOURCEBLOCK_IDX 97 +#define GNB_CONFIG_PERIODICITYANDPATTERN_IDX 98 +#define GNB_CONFIG_RATEMATCHPATTERN_CONTROLRESOURCESET_IDX 99 +#define GNB_CONFIG_RATEMATCHPATTERN_SUBCARRIERSPACING_IDX 100 +#define GNB_CONFIG_RATEMATCHPATTERN_MODE_IDX 101 +#define GNB_CONFIG_SEARCHSPACESIB1_IDX 102 +#define GNB_CONFIG_SEARCHSPACEOTHERSYSTEMINFORMATION_IDX 103 +#define GNB_CONFIG_PAGINGSEARCHSPACE_IDX 104 +#define GNB_CONFIG_RA_SEARCHSPACE_IDX 105 +#define GNB_CONFIG_RACH_RA_CONTROLRESOURCESET_IDX 106 +#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESETID_IDX 107 +#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESET_DURATION_IDX 108 +#define GNB_CONFIG_PDCCH_CCE_REG_MAPPINGTYPE_IDX 109 +#define GNB_CONFIG_PDCCH_REG_BUNDLESIZE_IDX 110 +#define GNB_CONFIG_PDCCH_INTERLEAVERSIZE_IDX 111 +#define GNB_CONFIG_PDCCH_SHIFTINDEX_IDX 112 +#define GNB_CONFIG_PDCCH_PRECODERGRANULARITY_IDX 113 +#define GNB_CONFIG_PDCCH_TCI_STATEID_IDX 114 +#define GNB_CONFIG_TCI_PRESENTINDCI_IDX 115 +#define GNB_CONFIG_SEARCHSPACEID_IDX 116 +#define GNB_CONFIG_COMMONSEARCHSPACES_CONTROLRESOURCESETID_IDX 117 +#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE_IDX 118 +#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL1_IDX 119 +#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL2_IDX 120 +#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL4_IDX 121 +#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL5_IDX 122 +#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL8_IDX 123 +#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL10_IDX 124 +#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL16_IDX 125 +#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL20_IDX 126 +#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1_IDX 127 +#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2_IDX 128 +#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4_IDX 129 +#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8_IDX 130 +#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16_IDX 131 +#define GNB_CONFIG_SEARCHSPACE_SEARCHSPACETYPE_IDX 132 +#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1_IDX 133 +#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2_IDX 134 +#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4_IDX 135 +#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8_IDX 136 +#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16_IDX 137 +#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY_IDX 138 +#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES_IDX 139 +#define GNB_CONFIG_UE_SPECIFIC__DCI_FORMATS_IDX 141 +#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL_IDX 142 +#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL_IDX 143 +#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS_IDX 144 +#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_V_SHIFT_IDX 145 +#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD_IDX 146 +#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET_IDX 147 +#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE_IDX 148 + + +/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* SRB1 configuration parameters section name */ +#define GNB_CONFIG_STRING_SRB1 "srb1_parameters" + +/* SRB1 configuration parameters names */ +#define GNB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit" +#define GNB_CONFIG_STRING_SRB1_TIMER_REORDERING "timer_reordering" +#define GNB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT "timer_status_prohibit" +#define GNB_CONFIG_STRING_SRB1_POLL_PDU "poll_pdu" +#define GNB_CONFIG_STRING_SRB1_POLL_BYTE "poll_byte" +#define GNB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD "max_retx_threshold" + +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* SRB1 configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define SRB1PARAMS_DESC { \ +{GNB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, NULL, 0, iptr:&srb1_timer_poll_retransmit, defintval:80, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SRB1_TIMER_REORDERING, NULL, 0, iptr:&srb1_timer_reordering, defintval:35, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, NULL, 0, iptr:&srb1_timer_status_prohibit, defintval:0, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SRB1_POLL_PDU, NULL, 0, iptr:&srb1_poll_pdu, defintval:4, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SRB1_POLL_BYTE, NULL, 0, iptr:&srb1_poll_byte, defintval:99999, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, NULL, 0, iptr:&srb1_max_retx_threshold, defintval:4, TYPE_UINT, 0} \ +} +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ + +/* MME configuration parameters section name */ +#define GNB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address" + +/* SRB1 configuration parameters names */ + + +#define GNB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" +#define GNB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" +#define GNB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" +#define GNB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" + + +/*-------------------------------------------------------------------------------------------------------------------------------------*/ +/* MME configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-------------------------------------------------------------------------------------------------------------------------------------*/ +#define S1PARAMS_DESC { \ +{GNB_CONFIG_STRING_MME_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_MME_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +} + +#define GNB_MME_IPV4_ADDRESS_IDX 0 +#define GNB_MME_IPV6_ADDRESS_IDX 1 +#define GNB_MME_IP_ADDRESS_ACTIVE_IDX 2 +#define GNB_MME_IP_ADDRESS_PREFERENCE_IDX 3 +/*---------------------------------------------------------------------------------------------------------------------------------------*/ +/*---------------------------------------------------------------------------------------------------------------------------------------*/ +/* SCTP configuration parameters section name */ +#define GNB_CONFIG_STRING_SCTP_CONFIG "SCTP" + +/* SCTP configuration parameters names */ +#define GNB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS" +#define GNB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS" + + + +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* SRB1 configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define SCTPPARAMS_DESC { \ +{GNB_CONFIG_STRING_SCTP_INSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0}, \ +{GNB_CONFIG_STRING_SCTP_OUTSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0} \ +} + +#define GNB_SCTP_INSTREAMS_IDX 0 +#define GNB_SCTP_OUTSTREAMS_IDX 1 +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* S1 interface configuration parameters section name */ +#define GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES" + +#define GNB_INTERFACE_NAME_FOR_S1_MME_IDX 0 +#define GNB_IPV4_ADDRESS_FOR_S1_MME_IDX 1 +#define GNB_INTERFACE_NAME_FOR_S1U_IDX 2 +#define GNB_IPV4_ADDR_FOR_S1U_IDX 3 +#define GNB_PORT_FOR_S1U_IDX 4 + +/* S1 interface configuration parameters names */ +#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME "GNB_INTERFACE_NAME_FOR_S1_MME" +#define GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1_MME "GNB_IPV4_ADDRESS_FOR_S1_MME" +#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U "GNB_INTERFACE_NAME_FOR_S1U" +#define GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U "GNB_IPV4_ADDRESS_FOR_S1U" +#define GNB_CONFIG_STRING_GNB_PORT_FOR_S1U "GNB_PORT_FOR_S1U" + +/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* S1 interface configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define NETPARAMS_DESC { \ +{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0} \ +} + + + +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* GTPU configuration parameters */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define GTPUPARAMS_DESC { \ +{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:&gnb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:&gnb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:&gnb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \ +} +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ + +/* L1 configuration section names */ +#define CONFIG_STRING_L1_LIST "L1s" +#define CONFIG_STRING_L1_CONFIG "l1_config" + + + +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +#define CONFIG_STRING_NETWORK_CONTROLLER_CONFIG "NETWORK_CONTROLLER" + +#define CONFIG_STRING_FLEXRAN_ENABLED "FLEXRAN_ENABLED" +#define CONFIG_STRING_FLEXRAN_INTERFACE_NAME "FLEXRAN_INTERFACE_NAME" +#define CONFIG_STRING_FLEXRAN_IPV4_ADDRESS "FLEXRAN_IPV4_ADDRESS" +#define CONFIG_STRING_FLEXRAN_PORT "FLEXRAN_PORT" +#define CONFIG_STRING_FLEXRAN_CACHE "FLEXRAN_CACHE" +#define CONFIG_STRING_FLEXRAN_AWAIT_RECONF "FLEXRAN_AWAIT_RECONF" + +#define FLEXRAN_ENABLED 0 +#define FLEXRAN_INTERFACE_NAME_IDX 1 +#define FLEXRAN_IPV4_ADDRESS_IDX 2 +#define FLEXRAN_PORT_IDX 3 +#define FLEXRAN_CACHE_IDX 4 +#define FLEXRAN_AWAIT_RECONF_IDX 5 + +#define FLEXRANPARAMS_DESC { \ +{CONFIG_STRING_FLEXRAN_ENABLED, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \ +{CONFIG_STRING_FLEXRAN_INTERFACE_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_FLEXRAN_IPV4_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_FLEXRAN_PORT, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \ +{CONFIG_STRING_FLEXRAN_CACHE, NULL, 0, strptr:NULL, defstrval:"/mnt/oai_agent_cache", TYPE_STRING, 0}, \ +{CONFIG_STRING_FLEXRAN_AWAIT_RECONF, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0} \ +} + +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------------------------------------------------------------------------------*/ +/* MACRLC configuration section names */ +#define CONFIG_STRING_MACRLC_LIST "MACRLCs" +#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config" + + +/* MACRLC configuration parameters names */ +#define CONFIG_STRING_MACRLC_CC "num_cc" +#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference" +#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name" +#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address" +#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address" +#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc" +#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc" +#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd" +#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd" +#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference" +#define CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME "local_s_if_name" +#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address" +#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address" +#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc" +#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc" +#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd" +#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd" +#define CONFIG_STRING_MACRLC_PHY_TEST_MODE "phy_test_mode" + + +#define MACRLC_CC_IDX 0 +#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 +#define MACRLC_LOCAL_N_IF_NAME_IDX 2 +#define MACRLC_LOCAL_N_ADDRESS_IDX 3 +#define MACRLC_REMOTE_N_ADDRESS_IDX 4 +#define MACRLC_LOCAL_N_PORTC_IDX 5 +#define MACRLC_REMOTE_N_PORTC_IDX 6 +#define MACRLC_LOCAL_N_PORTD_IDX 7 +#define MACRLC_REMOTE_N_PORTD_IDX 8 +#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 9 +#define MACRLC_LOCAL_S_IF_NAME_IDX 10 +#define MACRLC_LOCAL_S_ADDRESS_IDX 11 +#define MACRLC_REMOTE_S_ADDRESS_IDX 12 +#define MACRLC_LOCAL_S_PORTC_IDX 13 +#define MACRLC_REMOTE_S_PORTC_IDX 14 +#define MACRLC_LOCAL_S_PORTD_IDX 15 +#define MACRLC_REMOTE_S_PORTD_IDX 16 +#define MACRLC_PHY_TEST_IDX 17 \ No newline at end of file diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index f2aed56146e8dcff7b282fe42433a729cacd3aba..34cb94c2abeabc8587f2cd89e824fb30cb7113ec 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -35,6 +35,7 @@ #include "LAYER2/MAC/mac_extern.h" #include "LAYER2/MAC/mac_proto.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" @@ -42,6 +43,7 @@ #include "OCG_extern.h" #include "RRC/LTE/rrc_extern.h" +#include "RRC/NR/nr_rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "LAYER2/MAC/pre_processor.c" @@ -637,8 +639,14 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, // This schedules MIB - if ((subframeP == 0) && (frameP & 3) == 0) - schedule_mib(module_idP, frameP, subframeP); + if ((subframeP == 0) && (frameP & 3) == 0){ + schedule_mib(module_idP, frameP, subframeP); + } + + if((subframeP == 0) && (frameP & 7) == 0){ + schedule_nr_mib(module_idP, frameP, subframeP); + } + if (phy_test == 0){ // This schedules SI for legacy LTE and eMTC starting in subframeP schedule_SI(module_idP, frameP, subframeP); diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index dfdb4333668493125c6c90d5b04b2fce9ea55a91..cb837cae6d36d6b0c50a35998ff5a40d435bcade 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -73,6 +73,11 @@ #include "targets/ARCH/COMMON/common_lib.h" +//solve implicit declaration +#include "PHY/LTE_ESTIMATION/lte_estimation.h" +#include "PHY/LTE_TRANSPORT/transport_proto.h" +#include "PHY/LTE_TRANSPORT/transport_common_proto.h" + /** @defgroup _mac MAC * @ingroup _oai2 * @{ diff --git a/openair2/LAYER2/MAC/mac_proto.h b/openair2/LAYER2/MAC/mac_proto.h index 3c4f830bdb323f6be973d848010e38dd2e0f0a65..81cf2075f7efeda6595631fd6580c22284422183 100644 --- a/openair2/LAYER2/MAC/mac_proto.h +++ b/openair2/LAYER2/MAC/mac_proto.h @@ -32,6 +32,7 @@ #include "LAYER2/MAC/mac.h" #include "PHY/defs_common.h" // for PRACH_RESOURCES_t and lte_subframe_t + /** \addtogroup _mac * @{ */ diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 062ead2a206d1e6db672afc02d60785e3b628abd..5c9e5241b8607117c36de165291b066839b60084 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -48,87 +48,85 @@ extern RAN_CONTEXT_t RC; void mac_top_init_eNB(void) { - - module_id_t i, j; - int list_el; - UE_list_t *UE_list; - eNB_MAC_INST *mac; - - LOG_I(MAC, "[MAIN] Init function start:nb_macrlc_inst=%d\n", - RC.nb_macrlc_inst); - - if (RC.nb_macrlc_inst > 0) { - RC.mac = - (eNB_MAC_INST **) malloc16(RC.nb_macrlc_inst * - sizeof(eNB_MAC_INST *)); - AssertFatal(RC.mac != NULL, - "can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n", - RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *), - RC.nb_macrlc_inst, sizeof(eNB_MAC_INST)); - for (i = 0; i < RC.nb_macrlc_inst; i++) { - RC.mac[i] = (eNB_MAC_INST *) malloc16(sizeof(eNB_MAC_INST)); - AssertFatal(RC.mac != NULL, - "can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n", - RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *), - RC.nb_macrlc_inst, sizeof(eNB_MAC_INST)); - LOG_D(MAC, - "[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n", - sizeof(eNB_MAC_INST), RC.nb_macrlc_inst, RC.mac); - bzero(RC.mac[i], sizeof(eNB_MAC_INST)); - RC.mac[i]->Mod_id = i; - for (j = 0; j < MAX_NUM_CCs; j++) { - RC.mac[i]->DL_req[j].dl_config_request_body. - dl_config_pdu_list = RC.mac[i]->dl_config_pdu_list[j]; - RC.mac[i]->UL_req[j].ul_config_request_body. - ul_config_pdu_list = RC.mac[i]->ul_config_pdu_list[j]; - for (int k = 0; k < 10; k++) - RC.mac[i]->UL_req_tmp[j][k]. - ul_config_request_body.ul_config_pdu_list = - RC.mac[i]->ul_config_pdu_list_tmp[j][k]; - RC.mac[i]->HI_DCI0_req[j]. - hi_dci0_request_body.hi_dci0_pdu_list = - RC.mac[i]->hi_dci0_pdu_list[j]; - RC.mac[i]->TX_req[j].tx_request_body.tx_pdu_list = - RC.mac[i]->tx_request_pdu[j]; - RC.mac[i]->ul_handle = 0; - } - } - - AssertFatal(rlc_module_init() == 0, - "Could not initialize RLC layer\n"); - - // These should be out of here later - pdcp_layer_init(); - - rrc_init_global_param(); - - } else { - RC.mac = NULL; - } - - // Initialize Linked-List for Active UEs + module_id_t i, j; + int list_el; + UE_list_t *UE_list; + eNB_MAC_INST *mac; + + LOG_I(MAC, "[MAIN] Init function start:nb_macrlc_inst=%d\n", + RC.nb_macrlc_inst); + + if (RC.nb_macrlc_inst > 0) { + + RC.mac = (eNB_MAC_INST **) malloc16(RC.nb_macrlc_inst *sizeof(eNB_MAC_INST *)); + + AssertFatal(RC.mac != NULL,"can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n", + RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *), + RC.nb_macrlc_inst, sizeof(eNB_MAC_INST)); + for (i = 0; i < RC.nb_macrlc_inst; i++) { - mac = RC.mac[i]; - - - mac->if_inst = IF_Module_init(i); - - UE_list = &mac->UE_list; - - UE_list->num_UEs = 0; - UE_list->head = -1; - UE_list->head_ul = -1; - UE_list->avail = 0; - - for (list_el = 0; list_el < MAX_MOBILES_PER_ENB - 1; list_el++) { - UE_list->next[list_el] = list_el + 1; - UE_list->next_ul[list_el] = list_el + 1; - } - - UE_list->next[list_el] = -1; - UE_list->next_ul[list_el] = -1; + RC.mac[i] = (eNB_MAC_INST *) malloc16(sizeof(eNB_MAC_INST)); + + AssertFatal(RC.mac != NULL,"can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n", + RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *), + RC.nb_macrlc_inst, sizeof(eNB_MAC_INST)); + + LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n",sizeof(eNB_MAC_INST), RC.nb_macrlc_inst, RC.mac); + + bzero(RC.mac[i], sizeof(eNB_MAC_INST)); + + RC.mac[i]->Mod_id = i; + + for (j = 0; j < MAX_NUM_CCs; j++) { + RC.mac[i]->DL_req[j].dl_config_request_body. + dl_config_pdu_list = RC.mac[i]->dl_config_pdu_list[j]; + RC.mac[i]->UL_req[j].ul_config_request_body. + ul_config_pdu_list = RC.mac[i]->ul_config_pdu_list[j]; + + for (int k = 0; k < 10; k++) + RC.mac[i]->UL_req_tmp[j][k].ul_config_request_body.ul_config_pdu_list =RC.mac[i]->ul_config_pdu_list_tmp[j][k]; + + RC.mac[i]->HI_DCI0_req[j].hi_dci0_request_body.hi_dci0_pdu_list =RC.mac[i]->hi_dci0_pdu_list[j]; + RC.mac[i]->TX_req[j].tx_request_body.tx_pdu_list = + RC.mac[i]->tx_request_pdu[j]; + RC.mac[i]->ul_handle = 0; + + } + }//END for (i = 0; i < RC.nb_macrlc_inst; i++) + + AssertFatal(rlc_module_init() == 0, + "Could not initialize RLC layer\n"); + + // These should be out of here later + pdcp_layer_init(); + + rrc_init_global_param(); + + }else { + RC.mac = NULL; + } + + // Initialize Linked-List for Active UEs + for (i = 0; i < RC.nb_macrlc_inst; i++) { + + mac = RC.mac[i]; + mac->if_inst = IF_Module_init(i); + + UE_list = &mac->UE_list; + UE_list->num_UEs = 0; + UE_list->head = -1; + UE_list->head_ul = -1; + UE_list->avail = 0; + + for (list_el = 0; list_el < MAX_MOBILES_PER_ENB - 1; list_el++) { + UE_list->next[list_el] = list_el + 1; + UE_list->next_ul[list_el] = list_el + 1; } + UE_list->next[list_el] = -1; + UE_list->next_ul[list_el] = -1; + } + } void mac_init_cell_params(int Mod_idP, int CC_idP) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c old mode 100644 new mode 100755 index a08be4dead582ea258cb4e7f8c9341ad18f4b71b..be7a9434b2eb0a299f5b470696957c75bbb472bf --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -1,4 +1,3 @@ - /* * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more * contributor license agreements. See the NOTICE file distributed with @@ -35,8 +34,8 @@ int nr_rrc_mac_config_req_ue( module_id_t module_id, - int CC_idP, - uint8_t gNB_index, + int CC_idP, + uint8_t gNB_index, NR_MIB_t *mibP, NR_MAC_CellGroupConfig_t *mac_cell_group_configP, NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, @@ -48,7 +47,7 @@ nr_rrc_mac_config_req_ue( // TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. if(mibP != NULL){ - ; + mac->mib = mibP; // update by every reception } if(mac_cell_group_configP != NULL){ @@ -126,4 +125,4 @@ nr_rrc_mac_config_req_ue( //scell config not yet return 0; -} \ No newline at end of file +} diff --git a/openair2/LAYER2/NR_MAC_UE/defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h old mode 100644 new mode 100755 similarity index 75% rename from openair2/LAYER2/NR_MAC_UE/defs.h rename to openair2/LAYER2/NR_MAC_UE/mac_defs.h index 61f83074d3ec202fb72c749eceff95f66df278b6..1a00dfbd92094f800ef47952d501fe5a9537917b --- a/openair2/LAYER2/NR_MAC_UE/defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -58,6 +58,8 @@ #include "NR_SpCellConfig.h" #include "NR_ServingCellConfig.h" +#include "fapi_nr_ue_interface.h" +#include "NR_IF_Module.h" #define NB_NR_UE_MAC_INST 1 @@ -65,14 +67,26 @@ typedef struct { //// MAC config - NR_DRX_Config_t *drx_Config; /* OPTIONAL */ + NR_DRX_Config_t *drx_Config; /* OPTIONAL */ NR_SchedulingRequestConfig_t *schedulingRequestConfig; /* OPTIONAL */ - NR_BSR_Config_t *bsr_Config; /* OPTIONAL */ - NR_TAG_Config_t *tag_Config; /* OPTIONAL */ - NR_PHR_Config_t *phr_Config; /* OPTIONAL */ + NR_BSR_Config_t *bsr_Config; /* OPTIONAL */ + NR_TAG_Config_t *tag_Config; /* OPTIONAL */ + NR_PHR_Config_t *phr_Config; /* OPTIONAL */ - NR_RNTI_Value_t *cs_RNTI; /* OPTIONAL */ + NR_RNTI_Value_t *cs_RNTI; /* OPTIONAL */ + NR_MIB_t *mib; + + //// FAPI-like interface + fapi_nr_tx_request_t tx_request; + fapi_nr_ul_config_request_t ul_config_request; + fapi_nr_dl_config_request_t dl_config_request; + fapi_nr_dci_indication_t dci_indication; + fapi_nr_rx_indication_t rx_indication; + + nr_ue_if_module_t *if_module; + nr_scheduled_response_t scheduled_response; + nr_phy_config_t phy_config; } NR_UE_MAC_INST_t; /*@}*/ diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h new file mode 100644 index 0000000000000000000000000000000000000000..b8f18bf950b3a8398a9924c46cd199f9e4c1ecf9 --- /dev/null +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -0,0 +1,57 @@ +/* + * 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 LAYER2/MAC/proto.h + * \brief MAC functions prototypes for eNB and UE + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \email navid.nikaein@eurecom.fr + * \version 1.0 + */ +#ifndef __LAYER2_MAC_PROTO_H__ +#define __LAYER2_MAC_PROTO_H__ + +#include "mac_defs.h" + +/**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param extra_bits extra bits for frame calculation + \param ssb_index SSB index for frame calculation + \param frameP pointer to frame for revising after frame calculation + \param pduP pointer to pdu + \param pdu_length length of pdu*/ +void nr_ue_decode_mib(module_id_t module_id, int CC_id, uint8_t gNB_index, uint8_t extra_bits, uint32_t ssb_index, uint32_t *frameP, void *pduP, uint16_t pdu_len); + + +/**\brief primitive from RRC layer to MAC layer for configuration L1/L2, now supported 4 rrc messages: MIB, cell_group_config for MAC/PHY, spcell_config(serving cell config) + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param mibP pointer to RRC message MIB + \param mac_cell_group_configP pointer to RRC message MAC-related in cell group config + \param phy_cell_group_configP pointer to RRC message PHY-related in cell group config + \param spcell_configP pointer to RRC message serving cell config*/ +int nr_rrc_mac_config_req_ue( module_id_t module_id, int CC_id, uint8_t gNB_index, NR_MIB_t *mibP, NR_MAC_CellGroupConfig_t *mac_cell_group_configP, NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, NR_SpCellConfig_t *spcell_configP ){ + +#endif +/** @}*/ diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c old mode 100644 new mode 100755 index 23b586e914fb89b1fb673ce0c5ff25fea3b7fb2c..6b5fb4a5f36d69009c1a621c06dad6fda9fd1991 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -31,19 +31,60 @@ #include "proto.h" #include "RRC/NR_UE/rrc_proto.h" -void -nr_ue_decode_mib( +int8_t nr_ue_decode_mib( module_id_t module_id, int CC_id, uint8_t gNB_index, - uint8_t extra_bits, - uint32_t ssb_index, - uint32_t *frameP, - void *pduP, + uint8_t extra_bits, // 8bits 38.212 c7.1.1 + uint32_t l_ssb_equal_64, + //uint32_t *ssb_index, // from decoded MIB + //uint32_t *frameP, // 10 bits = 6(in decoded MIB)+4(in extra bits from L1) + void *pduP, // encoded MIB uint16_t pdu_len){ - nr_mac_rrc_data_ind_ue( module_id, CC_id, gNB_index, frameP, + NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); + + nr_mac_rrc_data_ind_ue( module_id, CC_id, gNB_index, NR_BCCH_BCH, (uint8_t *) pduP, pdu_len ); - // frame calculation + + uint32_t frame = mac->mib->systemFrameNumber.buf[0]; + uint32_t frame_number_4lsb = (uint32_t)(extra_bits & 0xf); // extra bits[0:3] + uint32_t half_frame_bit = (uint32_t)(( extra_bits >> 4 ) & 0x1 ); // extra bits[4] + uint32_t ssb_subcarrier_offset_msb = (uint32_t)(( extra_bits >> 5 ) & 0x1 ); // extra bits[5] + + uint32_t ssb_subcarrier_offset = mac->mib->subCarrierSpacingCommon; + + uint32_t ssb_index; + + frame = frame << 4; + frame = frame | frame_number_4lsb; + + if(l_ssb_equal_64){ + ssb_index = (( extra_bits >> 5 ) & 0x7 ); // extra bits[5:7] + mac->phy_config.config_req.pbch_config.ssb_index = ssb_index; + }else{ + if(ssb_subcarrier_offset_msb){ + ssb_subcarrier_offset = ssb_subcarrier_offset | 0x10; + } + } + + + // fill in the elements in config request inside P5 message + mac->phy_config.config_req.pbch_config.system_frame_number = frame; // after calculation + mac->phy_config.config_req.pbch_config.subcarrier_spacing_common = mac->mib->subCarrierSpacingCommon; + mac->phy_config.config_req.pbch_config.ssb_subcarrier_offset = ssb_subcarrier_offset; // after calculation + mac->phy_config.config_req.pbch_config.dmrs_type_a_position = mac->mib->dmrs_TypeA_Position; + mac->phy_config.config_req.pbch_config.pdcch_config_sib1 = mac->mib->pdcch_ConfigSIB1; + mac->phy_config.config_req.pbch_config.cell_barred = mac->mib->cellBarred; + mac->phy_config.config_req.pbch_config.intra_frquency_reselection = mac->mib->intraFreqReselection; + mac->phy_config.config_req.pbch_config.half_frame_bit = half_frame_bit; + mac->phy_config.config_req.config_mask |= FAPI_NR_CONFIG_REQUEST_MASK_PBCH; + + if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL){ + mac->if_module->phy_config_request(&mac->phy_config); + } + + return 0; } + diff --git a/openair2/LAYER2/NR_MAC_UE/proto.h b/openair2/LAYER2/NR_MAC_UE/proto.h old mode 100644 new mode 100755 index 1545ca9e7ddc28b922cfe050d17384cd4a61bd74..ffab06a43f74619fb6f43f3a55d37e3057e874f1 --- a/openair2/LAYER2/NR_MAC_UE/proto.h +++ b/openair2/LAYER2/NR_MAC_UE/proto.h @@ -32,15 +32,14 @@ #include "defs.h" /**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message - \param module_id module id - \param CC_id component carrier id - \param gNB_index gNB index - \param extra_bits extra bits for frame calculation - \param ssb_index SSB index for frame calculation - \param frameP pointer to frame for revising after frame calculation - \param pduP pointer to pdu - \param pdu_length length of pdu*/ -void nr_ue_decode_mib(module_id_t module_id, int CC_id, uint8_t gNB_index, uint8_t extra_bits, uint32_t ssb_index, uint32_t *frameP, void *pduP, uint16_t pdu_len); + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param extra_bits extra bits for frame calculation + \param l_ssb_equal_64 check if ssb number of candicate is equal 64, 1=equal; 0=non equal. Reference 38.212 7.1.1 + \param pduP pointer to pdu + \param pdu_length length of pdu*/ +int8_t nr_ue_decode_mib(module_id_t module_id, int CC_id, uint8_t gNB_index, uint8_t extra_bits, uint32_t l_ssb_equal_64, void *pduP, uint16_t pdu_len); /**\brief primitive from RRC layer to MAC layer for configuration L1/L2, now supported 4 rrc messages: MIB, cell_group_config for MAC/PHY, spcell_config(serving cell config) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ea563c9b114f6fbf69d77b11751eddf5508a92d6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -0,0 +1,243 @@ +#include "COMMON/platform_types.h" +#include "COMMON/platform_constants.h" +#include "common/ran_context.h" + +#include "UTIL/LOG/log.h" +#include "UTIL/LOG/vcd_signal_dumper.h" + +#include "NR_BCCH-BCH-Message.h" +#include "NR_ServingCellConfigCommon.h" + +#include "LAYER2/NR_MAC_gNB/mac_proto.h" + +extern RAN_CONTEXT_t RC; +//extern int l2_init_gNB(void); +extern void mac_top_init_gNB(void); +extern uint8_t nfapi_mode; + +int32_t **rxdata; +int32_t **txdata; + +typedef struct eutra_bandentry_s { + int16_t band; + uint32_t ul_min; + uint32_t ul_max; + uint32_t dl_min; + uint32_t dl_max; + uint32_t N_OFFs_DL; +} eutra_bandentry_t; + +typedef struct band_info_s { + int nbands; + eutra_bandentry_t band_info[100]; +} band_info_t; + +static const eutra_bandentry_t eutra_bandtable[] = { + {1, 19200, 19800, 21100, 21700, 0}, + {2, 18500, 19100, 19300, 19900, 6000}, + {3, 17100, 17850, 18050, 18800, 12000}, + {4, 17100, 17550, 21100, 21550, 19500}, + {5, 8240, 8490, 8690, 8940, 24000}, + {6, 8300, 8400, 8750, 8850, 26500}, + {7, 25000, 25700, 26200, 26900, 27500}, + {8, 8800, 9150, 9250, 9600, 34500}, + {9, 17499, 17849, 18449, 18799, 38000}, + {10, 17100, 17700, 21100, 21700, 41500}, + {11, 14279, 14529, 14759, 15009, 47500}, + {12, 6980, 7160, 7280, 7460, 50100}, + {13, 7770, 7870, 7460, 7560, 51800}, + {14, 7880, 7980, 7580, 7680, 52800}, + {17, 7040, 7160, 7340, 7460, 57300}, + {18, 8150, 9650, 8600, 10100, 58500}, + {19, 8300, 8450, 8750, 8900, 60000}, + {20, 8320, 8620, 7910, 8210, 61500}, + {21, 14479, 14629, 14959, 15109, 64500}, + {22, 34100, 34900, 35100, 35900, 66000}, + {23, 20000, 20200, 21800, 22000, 75000}, + {24, 16126, 16605, 15250, 15590, 77000}, + {25, 18500, 19150, 19300, 19950, 80400}, + {26, 8140, 8490, 8590, 8940, 86900}, + {27, 8070, 8240, 8520, 8690, 90400}, + {28, 7030, 7580, 7580, 8130, 92100}, + {29, 0, 0, 7170, 7280, 96600}, + {30, 23050, 23250, 23500, 23600, 97700}, + {31, 45250, 34900, 46250, 35900, 98700}, + {32, 0, 0, 14520, 14960, 99200}, + {33, 19000, 19200, 19000, 19200, 36000}, + {34, 20100, 20250, 20100, 20250, 36200}, + {35, 18500, 19100, 18500, 19100, 36350}, + {36, 19300, 19900, 19300, 19900, 36950}, + {37, 19100, 19300, 19100, 19300, 37550}, + {38, 25700, 26200, 25700, 26300, 37750}, + {39, 18800, 19200, 18800, 19200, 38250}, + {40, 23000, 24000, 23000, 24000, 38650}, + {41, 24960, 26900, 24960, 26900, 39650}, + {42, 34000, 36000, 34000, 36000, 41590}, + {43, 36000, 38000, 36000, 38000, 43590}, + {44, 7030, 8030, 7030, 8030, 45590}, + {45, 14470, 14670, 14470, 14670, 46590}, + {46, 51500, 59250, 51500, 59250, 46790}, + {65, 19200, 20100, 21100, 22000, 65536}, + {66, 17100, 18000, 21100, 22000, 66436}, + {67, 0, 0, 7380, 7580, 67336}, + {68, 6980, 7280, 7530, 7830, 67536} +}; + + +uint32_t nr_to_earfcn(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw) +{ + + uint32_t dl_CarrierFreq_by_100k = dl_CarrierFreq / 100000; + int bw_by_100 = bw / 100; + + int i; + + AssertFatal(eutra_bandP < 69, "eutra_band %d > 68\n", eutra_bandP); + for (i = 0; i < 69 && eutra_bandtable[i].band != eutra_bandP; i++); + + AssertFatal(dl_CarrierFreq_by_100k >= eutra_bandtable[i].dl_min, + "Band %d, bw %u : DL carrier frequency %u Hz < %u\n", + eutra_bandP, bw, dl_CarrierFreq, + eutra_bandtable[i].dl_min); + AssertFatal(dl_CarrierFreq_by_100k <= + (eutra_bandtable[i].dl_max - bw_by_100), + "Band %d, bw %u: DL carrier frequency %u Hz > %d\n", + eutra_bandP, bw, dl_CarrierFreq, + eutra_bandtable[i].dl_max - bw_by_100); + + + return (dl_CarrierFreq_by_100k - eutra_bandtable[i].dl_min + + (eutra_bandtable[i].N_OFFs_DL / 10)); +} + + +void config_nr_mib(int Mod_idP, + int CC_idP, + int p_gNBP, + int subCarrierSpacingCommon, + uint32_t ssb_SubcarrierOffset, + int dmrs_TypeA_Position, + uint32_t pdcch_ConfigSIB1, + int cellBarred, + int intraFreqReselection + ){ + nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP]; + + cfg->num_tlv=0; + + cfg->rf_config.tx_antenna_ports.value = p_gNBP; + cfg->rf_config.tx_antenna_ports.tl.tag = NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG; + cfg->num_tlv++; + + cfg->sch_config.ssb_subcarrier_offset.value = ssb_SubcarrierOffset; + + +} + +void config_common(int Mod_idP, + int CC_idP, + int eutra_bandP, + int dl_CarrierFreqP, + int dl_BandwidthP + ){ + + nfapi_nr_config_request_t *cfg = &RC.nrmac[Mod_idP]->config[CC_idP]; + + // FDD + cfg->subframe_config.duplex_mode.value = 1; + cfg->subframe_config.duplex_mode.tl.tag = NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG; + cfg->num_tlv++; + + /// In NR DL and UL will be different band + cfg->nfapi_config.rf_bands.number_rf_bands = 1; + cfg->nfapi_config.rf_bands.rf_band[0] = eutra_bandP; + cfg->nfapi_config.rf_bands.tl.tag = NFAPI_PHY_RF_BANDS_TAG; + cfg->num_tlv++; + + cfg->nfapi_config.earfcn.value = nr_to_earfcn(eutra_bandP,dl_CarrierFreqP,dl_BandwidthP*180/100); + cfg->nfapi_config.earfcn.tl.tag = NFAPI_NFAPI_EARFCN_TAG; + cfg->num_tlv++; + + cfg->subframe_config.numerology_index_mu.value = 1; + //cfg->subframe_config.tl.tag = + //cfg->num_tlv++; + + cfg->rf_config.dl_channel_bandwidth.value = dl_BandwidthP; + cfg->rf_config.dl_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG; //temporary + cfg->num_tlv++; + LOG_I(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP); + + cfg->rf_config.ul_channel_bandwidth.value = dl_BandwidthP; + cfg->rf_config.ul_channel_bandwidth.tl.tag = NFAPI_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG; //temporary + cfg->num_tlv++; + + //cfg->sch_config.half_frame_index.value = 0; Fix in PHY + //cfg->sch_config.n_ssb_crb.value = 86; Fix in PHY + +} + +/*void config_servingcellconfigcommon(){ + +}*/ + +int rrc_mac_config_req_gNB(module_id_t Mod_idP, + int CC_idP, + int p_gNB, + int eutra_bandP, + int dl_CarrierFreqP, + int dl_BandwidthP, + NR_BCCH_BCH_Message_t *mib, + NR_ServingCellConfigCommon_t *servingcellconfigcommon + ){ + + + if( mib != NULL ){ + config_nr_mib(Mod_idP, + CC_idP, + p_gNB, + mib->message.choice.mib->subCarrierSpacingCommon, + mib->message.choice.mib->ssb_SubcarrierOffset, + mib->message.choice.mib->dmrs_TypeA_Position, + mib->message.choice.mib->pdcch_ConfigSIB1, + mib->message.choice.mib->cellBarred, + mib->message.choice.mib->intraFreqReselection + ); + }// END if( mib != NULL ) + + if( servingcellconfigcommon != NULL ){ + config_common(Mod_idP, + CC_idP, + eutra_bandP, + dl_CarrierFreqP, + dl_BandwidthP + ); + }//END if( servingcellconfigcommon != NULL ) + + + + LOG_E(MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->PHY_config_req); + + // if in nFAPI mode + if ( (nfapi_mode == 1 || nfapi_mode == 2) && (RC.nrmac[Mod_idP]->if_inst->PHY_config_req == NULL) ){ + while(RC.nrmac[Mod_idP]->if_inst->PHY_config_req == NULL) { + // DJP AssertFatal(RC.nrmac[Mod_idP]->if_inst->PHY_config_req != NULL,"if_inst->phy_config_request is null\n"); + usleep(100 * 1000); + printf("Waiting for PHY_config_req\n"); + } + } + + if (servingcellconfigcommon != NULL){ + NR_PHY_Config_t phycfg; + phycfg.Mod_id = Mod_idP; + phycfg.CC_id = CC_idP; + phycfg.cfg = &RC.nrmac[Mod_idP]->config[CC_idP]; + + if (RC.nrmac[Mod_idP]->if_inst->PHY_config_req) RC.nrmac[Mod_idP]->if_inst->PHY_config_req(&phycfg); + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT); + } + + return(0); + +}// END rrc_mac_config_req_gNB + diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c new file mode 100644 index 0000000000000000000000000000000000000000..03f6c08c6c5b440f73186122e660ec5053db613c --- /dev/null +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -0,0 +1,652 @@ +/* + * 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 gNB_scheduler.c + * \brief gNB scheduler top level function operates on per subframe basis + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \email: navid.nikaein@eurecom.fr + * \version 0.5 + * @ingroup _mac + + */ + +#include "assertions.h" + +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_extern.h" +#include "LAYER2/MAC/mac_proto.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" +#include "UTIL/LOG/log.h" +#include "UTIL/LOG/vcd_signal_dumper.h" +#include "UTIL/OPT/opt.h" +#include "OCG.h" +#include "OCG_extern.h" + +#include "RRC/NR/nr_rrc_extern.h" + +//#include "LAYER2/MAC/pre_processor.c" +#include "pdcp.h" + +#include "openair1/PHY/defs_gNB.h" + +//Agent-related headers +#include "flexran_agent_extern.h" +#include "flexran_agent_mac.h" + +#if defined(ENABLE_ITTI) +#include "intertask_interface.h" +#endif + +#include "assertions.h" + +#define ENABLE_MAC_PAYLOAD_DEBUG +#define DEBUG_eNB_SCHEDULER 1 + +extern RAN_CONTEXT_t RC; +extern int phy_test; +extern uint8_t nfapi_mode; + +uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 }; + +void clear_nr_nfapi_information(gNB_MAC_INST * gNB, + int CC_idP, + frame_t frameP, + sub_frame_t subframeP){ + + nfapi_dl_config_request_t *DL_req = &gNB->DL_req[0]; + nfapi_ul_config_request_t *UL_req = &gNB->UL_req[0]; + nfapi_hi_dci0_request_t *HI_DCI0_req = &gNB->HI_DCI0_req[0]; + nfapi_tx_request_t *TX_req = &gNB->TX_req[0]; + + gNB->pdu_index[CC_idP] = 0; + + if (nfapi_mode==0 || nfapi_mode == 1) { // monolithic or PNF + + DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1; + DL_req[CC_idP].dl_config_request_body.number_dci = 0; + DL_req[CC_idP].dl_config_request_body.number_pdu = 0; + DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0; + DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000; + + HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = subframeP + (frameP<<4); + HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0; + + + UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0; + UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now + UL_req[CC_idP].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now + + TX_req[CC_idP].tx_request_body.number_of_pdus = 0; + + } +} + +void check_nr_ul_failure(module_id_t module_idP, + int CC_id, + int UE_id, + frame_t frameP, + sub_frame_t subframeP) { + + UE_list_t *UE_list = &RC.nrmac[module_idP]->UE_list; + nfapi_dl_config_request_t *DL_req = &RC.nrmac[module_idP]->DL_req[0]; + uint16_t rnti = UE_RNTI(module_idP, UE_id); + COMMON_channels_t *cc = RC.nrmac[module_idP]->common_channels; + + // check uplink failure + if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 0) && + (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 0)) { + LOG_I(MAC, "UE %d rnti %x: UL Failure timer %d \n", UE_id, rnti, + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + if (UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent == 0) { + UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 1; + + // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) + nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req[CC_id].dl_config_request_body.dl_config_pdu_list[DL_req[CC_id].dl_config_request_body.number_pdu]; + memset((void *) dl_config_pdu, 0,sizeof(nfapi_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; + dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu)); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = get_aggregation(get_bw_index(module_idP, CC_id), + UE_list->UE_sched_ctrl[UE_id]. + dl_cqi[CC_id], format1A); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = rnti; + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 1; // CRNTI : see Table 4-10 from SCF082 - nFAPI specifications + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power + + AssertFatal((cc[CC_id].mib->message.dl_Bandwidth >= 0) && (cc[CC_id].mib->message.dl_Bandwidth < 6), + "illegal dl_Bandwidth %d\n", + (int) cc[CC_id].mib->message.dl_Bandwidth); + dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = nr_pdcch_order_table[cc[CC_id].mib->message.dl_Bandwidth]; + DL_req[CC_id].dl_config_request_body.number_dci++; + DL_req[CC_id].dl_config_request_body.number_pdu++; + DL_req[CC_id].dl_config_request_body.tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; + LOG_I(MAC, + "UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d), resource_block_coding %d \n", + UE_id, rnti, + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer, + dl_config_pdu->dci_dl_pdu. + dci_dl_pdu_rel8.resource_block_coding); + } else { // ra_pdcch_sent==1 + LOG_I(MAC, + "UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n", + UE_id, rnti, + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + if ((UE_list->UE_sched_ctrl[UE_id].ul_failure_timer % 40) == 0) UE_list->UE_sched_ctrl[UE_id].ra_pdcch_order_sent = 0; // resend every 4 frames + } + + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer++; + // check threshold + if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer > 20000) { + // inform RRC of failure and clear timer + LOG_I(MAC, + "UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n", + UE_id, rnti); + mac_eNB_rrc_ul_failure(module_idP, CC_id, frameP, subframeP,rnti); + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0; + UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync = 1; + + //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future + if (rrc_agent_registered[module_idP]) { + LOG_W(MAC, "notify flexran Agent of UE state change\n"); + agent_rrc_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP, + rnti, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED); + } + } + } // ul_failure_timer>0 + +} + +void schedule_nr_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) +{ + gNB_MAC_INST *gNB = RC.nrmac[module_idP]; + UE_list_t *UE_list = &gNB->UE_list; + nfapi_ul_config_request_body_t *ul_req; + int CC_id, UE_id; + COMMON_channels_t *cc = RC.nrmac[module_idP]->common_channels; + SoundingRS_UL_ConfigCommon_t *soundingRS_UL_ConfigCommon; + struct SoundingRS_UL_ConfigDedicated *soundingRS_UL_ConfigDedicated; + uint8_t TSFC; + uint16_t deltaTSFC; // bitmap + uint8_t srs_SubframeConfig; + + // table for TSFC (Period) and deltaSFC (offset) + const uint16_t deltaTSFCTabType1[15][2] = { {1, 1}, {1, 2}, {2, 2}, {1, 5}, {2, 5}, {4, 5}, {8, 5}, {3, 5}, {12, 5}, {1, 10}, {2, 10}, {4, 10}, {8, 10}, {351, 10}, {383, 10} }; // Table 5.5.3.3-2 3GPP 36.211 FDD + const uint16_t deltaTSFCTabType2[14][2] = { {2, 5}, {6, 5}, {10, 5}, {18, 5}, {14, 5}, {22, 5}, {26, 5}, {30, 5}, {70, 10}, {74, 10}, {194, 10}, {326, 10}, {586, 10}, {210, 10} }; // Table 5.5.3.3-2 3GPP 36.211 TDD + + uint16_t srsPeriodicity, srsOffset; + + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + soundingRS_UL_ConfigCommon = &cc[CC_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon; + // check if SRS is enabled in this frame/subframe + if (soundingRS_UL_ConfigCommon) { + srs_SubframeConfig = soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig; + if (cc[CC_id].tdd_Config == NULL) { // FDD + deltaTSFC = deltaTSFCTabType1[srs_SubframeConfig][0]; + TSFC = deltaTSFCTabType1[srs_SubframeConfig][1]; + } else { // TDD + deltaTSFC = deltaTSFCTabType2[srs_SubframeConfig][0]; + TSFC = deltaTSFCTabType2[srs_SubframeConfig][1]; + } + // Sounding reference signal subframes are the subframes satisfying ns/2 mod TSFC (- deltaTSFC + uint16_t tmp = (subframeP % TSFC); + + if ((1 << tmp) & deltaTSFC) { + // This is an SRS subframe, loop over UEs + for (UE_id = 0; UE_id < MAX_MOBILES_PER_GNB; UE_id++) { + if (!RC.nrmac[module_idP]->UE_list.active[UE_id]) continue; + ul_req = &RC.nrmac[module_idP]->UL_req[CC_id].ul_config_request_body; + // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet + if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue; + + AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, + "physicalConfigDedicated is null for UE %d\n", + UE_id); + + if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated) != NULL) { + if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) { + get_srs_pos(&cc[CC_id], + soundingRS_UL_ConfigDedicated->choice. + setup.srs_ConfigIndex, + &srsPeriodicity, &srsOffset); + if (((10 * frameP + subframeP) % srsPeriodicity) == srsOffset) { + // Program SRS + ul_req->srs_present = 1; + nfapi_ul_config_request_pdu_t * ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_SRS_PDU_TYPE; + ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_srs_pdu)); + ul_config_pdu->srs_pdu.srs_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG; + ul_config_pdu->srs_pdu.srs_pdu_rel8.size = (uint8_t)sizeof(nfapi_ul_config_srs_pdu); + ul_config_pdu->srs_pdu.srs_pdu_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth; + ul_config_pdu->srs_pdu.srs_pdu_rel8.frequency_domain_position = soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition; + ul_config_pdu->srs_pdu.srs_pdu_rel8.srs_hopping_bandwidth = soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;; + ul_config_pdu->srs_pdu.srs_pdu_rel8.transmission_comb = soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb; + ul_config_pdu->srs_pdu.srs_pdu_rel8.i_srs = soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex; + ul_config_pdu->srs_pdu.srs_pdu_rel8.sounding_reference_cyclic_shift = soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; // ul_config_pdu->srs_pdu.srs_pdu_rel10.antenna_port = ;// + // ul_config_pdu->srs_pdu.srs_pdu_rel13.number_of_combs = ;// + RC.nrmac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; + RC.nrmac[module_idP]->UL_req[CC_id].header.message_id = NFAPI_UL_CONFIG_REQUEST; + ul_req->number_of_pdus++; + } // if (((10*frameP+subframeP) % srsPeriodicity) == srsOffset) + } // if (soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) + } // if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) + } // for (UE_id ... + } // if((1<<tmp) & deltaTSFC) + + } // SRS config + } +} + +void +schedule_nr_CSI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) +{ + gNB_MAC_INST *gNB = RC.nrmac[module_idP]; + UE_list_t *UE_list = &gNB->UE_list; + COMMON_channels_t *cc; + nfapi_ul_config_request_body_t *ul_req; + int CC_id, UE_id; + struct CQI_ReportPeriodic *cqi_ReportPeriodic; + uint16_t Npd, N_OFFSET_CQI; + int H; + + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + + cc = &gNB->common_channels[CC_id]; + for (UE_id = 0; UE_id < MAX_MOBILES_PER_GNB; UE_id++) { + if (!UE_list->active[UE_id]) continue; + + ul_req = &RC.nrmac[module_idP]->UL_req[CC_id].ul_config_request_body; + + // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet + if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue; + + AssertFatal(UE_list-> + UE_template[CC_id][UE_id].physicalConfigDedicated + != NULL, + "physicalConfigDedicated is null for UE %d\n", + UE_id); + + if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) { + if ((cqi_ReportPeriodic = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) != NULL + && (cqi_ReportPeriodic->present != CQI_ReportPeriodic_PR_release)) { + //Rel8 Periodic CQI/PMI/RI reporting + + get_csi_params(cc, cqi_ReportPeriodic, &Npd, + &N_OFFSET_CQI, &H); + + if ((((frameP * 10) + subframeP) % Npd) == N_OFFSET_CQI) { // CQI opportunity + UE_list->UE_sched_ctrl[UE_id].feedback_cnt[CC_id] = (((frameP * 10) + subframeP) / Npd) % H; + // Program CQI + nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + memset((void *) ul_config_pdu, 0, + sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; + ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu)); + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = get_rel8_dl_cqi_pmi_size(&UE_list->UE_sched_ctrl[UE_id], CC_id, cc, + get_tmode(module_idP, CC_id, UE_id), + cqi_ReportPeriodic); + ul_req->number_of_pdus++; + ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; + +#if defined(Rel10) || defined(Rel14) + // PUT rel10-13 UCI options here +#endif + } else + if ((cqi_ReportPeriodic->choice.setup.ri_ConfigIndex) + && ((((frameP * 10) + subframeP) % ((H * Npd) << (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex / 161))) == N_OFFSET_CQI + (*cqi_ReportPeriodic->choice.setup.ri_ConfigIndex % 161))) { // RI opportunity + // Program RI + nfapi_ul_config_request_pdu_t *ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus]; + memset((void *) ul_config_pdu, 0, + sizeof(nfapi_ul_config_request_pdu_t)); + ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE; + ul_config_pdu->pdu_size = 2 + (uint8_t) (2 + sizeof(nfapi_ul_config_uci_cqi_pdu)); + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; + ul_config_pdu->uci_cqi_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.pucch_index = cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex; + ul_config_pdu->uci_cqi_pdu.cqi_information.cqi_information_rel8.dl_cqi_pmi_size = (cc->p_eNB == 2) ? 1 : 2; + RC.nrmac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; + ul_req->number_of_pdus++; + ul_req->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; + } + } // if ((cqi_ReportPeriodic = cqi_ReportConfig->cqi_ReportPeriodic)!=NULL) { + } // if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->cqi_ReportConfig) + } // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + } // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { +} + +void +schedule_nr_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) +{ + gNB_MAC_INST *gNB = RC.nrmac[module_idP]; + UE_list_t *UE_list = &gNB->UE_list; + nfapi_ul_config_request_t *ul_req; + nfapi_ul_config_request_body_t *ul_req_body; + int CC_id; + int UE_id; + SchedulingRequestConfig_t *SRconfig; + int skip_ue; + int is_harq; + nfapi_ul_config_sr_information sr; + int i; + + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + RC.nrmac[module_idP]->UL_req[CC_id].sfn_sf = (frameP << 4) + subframeP; + + for (UE_id = 0; UE_id < MAX_MOBILES_PER_GNB; UE_id++) { + if (!RC.nrmac[module_idP]->UE_list.active[UE_id]) continue; + + ul_req = &RC.nrmac[module_idP]->UL_req[CC_id]; + ul_req_body = &ul_req->ul_config_request_body; + + // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet + if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue; + + AssertFatal(UE_list-> + UE_template[CC_id][UE_id].physicalConfigDedicated!= NULL, + "physicalConfigDedicated is null for UE %d\n", + UE_id); + + if ((SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig) != NULL) { + if (SRconfig->present == SchedulingRequestConfig_PR_setup) { + if (SRconfig->choice.setup.sr_ConfigIndex <= 4) { // 5 ms SR period + if ((subframeP % 5) != SRconfig->choice.setup.sr_ConfigIndex) continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 14) { // 10 ms SR period + if (subframeP != (SRconfig->choice.setup.sr_ConfigIndex - 5)) continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 34) { // 20 ms SR period + if ((10 * (frameP & 1) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 15)) continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 74) { // 40 ms SR period + if ((10 * (frameP & 3) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 35)) continue; + } else if (SRconfig->choice.setup.sr_ConfigIndex <= 154) { // 80 ms SR period + if ((10 * (frameP & 7) + subframeP) != (SRconfig->choice.setup.sr_ConfigIndex - 75)) continue; + } + } // SRconfig->present == SchedulingRequestConfig_PR_setup) + } // SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig)!=NULL) + + // if we get here there is some PUCCH1 reception to schedule for SR + + skip_ue = 0; + is_harq = 0; + // check that there is no existing UL grant for ULSCH which overrides the SR + for (i = 0; i < ul_req_body->number_of_pdus; i++) { + if (((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) || + (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) || + (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) || + (ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE)) && + (ul_req_body->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { + skip_ue = 1; + break; + } + /* if there is already an HARQ pdu, convert to SR_HARQ */ + else if ((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) && + (ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) { + is_harq = 1; + break; + } + } + + // drop the allocation because ULSCH with handle it with BSR + if (skip_ue == 1) continue; + + LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x is_harq:%d\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti, is_harq); + + // check Rel10 or Rel8 SR +#if defined(Rel10) || defined(Rel14) + if ((UE_list-> UE_template[CC_id][UE_id].physicalConfigDedicated->ext2) + && (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020) + && (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) { + sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG; + sr.sr_information_rel10.number_of_pucch_resources = 1; + sr.sr_information_rel10.pucch_index_p1 = *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10; + LOG_D(MAC,"REL10 PUCCH INDEX P1:%d\n", sr.sr_information_rel10.pucch_index_p1); + } else +#endif + { + sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG; + sr.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex; + LOG_D(MAC,"REL8 PUCCH INDEX:%d\n", sr.sr_information_rel8.pucch_index); + } + + /* if there is already an HARQ pdu, convert to SR_HARQ */ + if (is_harq) { + nfapi_ul_config_harq_information h = ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.harq_information; + ul_req_body->ul_config_pdu_list[i].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE; + ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.sr_information = sr; + ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.harq_information = h; + } else { + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel11.tl.tag = 0; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel13.tl.tag = 0; + ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.sr_information = sr; + ul_req_body->number_of_pdus++; + } /* if (is_harq) */ + ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG; + } // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) + } // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) +} + +void copy_nr_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) +{ + int CC_id; + gNB_MAC_INST *mac = RC.nrmac[module_idP]; + + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + + nfapi_ul_config_request_t *ul_req_tmp = &mac->UL_req_tmp[CC_id][subframeP]; + nfapi_ul_config_request_t *ul_req = &mac->UL_req[CC_id]; + nfapi_ul_config_request_pdu_t *ul_req_pdu = ul_req->ul_config_request_body.ul_config_pdu_list; + + *ul_req = *ul_req_tmp; + + // Restore the pointer + ul_req->ul_config_request_body.ul_config_pdu_list = ul_req_pdu; + ul_req->sfn_sf = (frameP<<4) + subframeP; + ul_req_tmp->ul_config_request_body.number_of_pdus = 0; + + if (ul_req->ul_config_request_body.number_of_pdus>0) + { + LOG_D(PHY, "%s() active NOW (frameP:%d subframeP:%d) pdus:%d\n", __FUNCTION__, frameP, subframeP, ul_req->ul_config_request_body.number_of_pdus); + } + + memcpy((void*)ul_req->ul_config_request_body.ul_config_pdu_list, + (void*)ul_req_tmp->ul_config_request_body.ul_config_pdu_list, + ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t)); + } +} + +void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, + frame_t frameP, + sub_frame_t subframeP){ + + int mbsfn_status[MAX_NUM_CCs]; + protocol_ctxt_t ctxt; + + int CC_id, i = -1; + UE_list_t *UE_list = &RC.nrmac[module_idP]->UE_list; + rnti_t rnti; + + NR_COMMON_channels_t *cc = RC.nrmac[module_idP]->common_channels; + + start_meas(&RC.nrmac[module_idP]->eNB_scheduler); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN); + + RC.nrmac[module_idP]->frame = frameP; + RC.nrmac[module_idP]->subframe = subframeP; + + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + mbsfn_status[CC_id] = 0; + + // clear vrb_maps + memset(cc[CC_id].vrb_map, 0, 100); + memset(cc[CC_id].vrb_map_UL, 0, 100); + + clear_nr_nfapi_information(RC.nrmac[module_idP], CC_id, frameP, subframeP); + } + + // refresh UE list based on UEs dropped by PHY in previous subframe + for (i = 0; i < MAX_MOBILES_PER_GNB; i++) { + if (UE_list->active[i]) { + + rnti = UE_RNTI(module_idP, i); + CC_id = UE_PCCID(module_idP, i); + + if (((frameP&127) == 0) && (subframeP == 0)) { + LOG_I(MAC, + "UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d\n", + rnti, + UE_list->UE_sched_ctrl[i].ul_out_of_sync == + 0 ? "in synch" : "out of sync", + UE_list->UE_template[CC_id][i].phr_info, + UE_list->UE_sched_ctrl[i].dl_cqi[CC_id], + (UE_list->UE_sched_ctrl[i].pusch_snr[CC_id] - 128) / 2, + (UE_list->UE_sched_ctrl[i].pucch1_snr[CC_id] - 128) / 2); + } + + RC.gNB[module_idP][CC_id]->pusch_stats_bsr[i][(frameP * 10) + subframeP] = -63; + + if (i == UE_list->head) + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,RC.gNB[module_idP][CC_id]-> + pusch_stats_bsr[i][(frameP * 10) + subframeP]); + + // increment this, it is cleared when we receive an sdu + RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; + RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer++; + + LOG_D(MAC, "UE %d/%x : ul_inactivity %d, cqi_req %d\n", + i, + rnti, + RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].ul_inactivity_timer, + RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].cqi_req_timer); + + check_nr_ul_failure(module_idP, CC_id, i, frameP, subframeP); + + if (RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer > 0) { + RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer++; + + if(RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer >= + RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer_thres) { + RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer = 0; + + for (int ue_id_l = 0; ue_id_l < MAX_MOBILES_PER_GNB; ue_id_l++) { + if (reestablish_rnti_map[ue_id_l][0] == rnti) { + // clear currentC-RNTI from map + reestablish_rnti_map[ue_id_l][0] = 0; + reestablish_rnti_map[ue_id_l][1] = 0; + break; + } + } + + // Note: This should not be done in the MAC! + for (int ii=0; ii<MAX_MOBILES_PER_GNB; ii++) { + LTE_eNB_ULSCH_t *ulsch = RC.gNB[module_idP][CC_id]->ulsch[ii]; + if((ulsch != NULL) && (ulsch->rnti == rnti)){ + LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti); + clean_eNb_ulsch(ulsch); + } + } + + for (int ii=0; ii<MAX_MOBILES_PER_GNB; ii++) { + LTE_eNB_DLSCH_t *dlsch = RC.gNB[module_idP][CC_id]->dlsch[ii][0]; + if((dlsch != NULL) && (dlsch->rnti == rnti)){ + LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti); + clean_eNb_dlsch(dlsch); + } + } + + for(int j = 0; j < 10; j++){ + nfapi_ul_config_request_body_t *ul_req_tmp = NULL; + ul_req_tmp = &RC.nrmac[module_idP]->UL_req_tmp[CC_id][j].ul_config_request_body; + if(ul_req_tmp){ + int pdu_number = ul_req_tmp->number_of_pdus; + for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--){ + if(ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti){ + LOG_I(MAC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number); + if(pdu_index < pdu_number -1){ + memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t)); + } + ul_req_tmp->number_of_pdus--; + } + } + } + } + rrc_mac_remove_ue(module_idP,rnti); + } + } //END if (RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[i].ue_reestablishment_reject_timer > 0) + } //END if (UE_list->active[i]) + } //END for (i = 0; i < MAX_MOBILES_PER_GNB; i++) + + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES,NOT_A_RNTI, frameP, subframeP,module_idP); + + pdcp_run(&ctxt); + + rrc_rx_tx(&ctxt, CC_id); + + // This schedules MIB + if((subframeP == 0) && (frameP & 7) == 0){ + schedule_nr_mib(module_idP, frameP, subframeP); + } + + if (phy_test == 0){ + // This schedules SI for legacy LTE and eMTC starting in subframeP + schedule_SI(module_idP, frameP, subframeP); + // This schedules Paging in subframeP + schedule_PCH(module_idP,frameP,subframeP); + // This schedules Random-Access for legacy LTE and eMTC starting in subframeP + schedule_RA(module_idP, frameP, subframeP); + // copy previously scheduled UL resources (ULSCH + HARQ) + copy_nr_ulreq(module_idP, frameP, subframeP); + // This schedules SRS in subframeP + schedule_nr_SRS(module_idP, frameP, subframeP); + // This schedules ULSCH in subframeP (dci0) + schedule_ulsch(module_idP, frameP, subframeP); + // This schedules UCI_SR in subframeP + schedule_nr_SR(module_idP, frameP, subframeP); + // This schedules UCI_CSI in subframeP + schedule_nr_CSI(module_idP, frameP, subframeP); + // This schedules DLSCH in subframeP + schedule_dlsch(module_idP, frameP, subframeP, mbsfn_status); + } + else{ + schedule_ulsch_phy_test(module_idP,frameP,subframeP); + schedule_ue_spec_phy_test(module_idP,frameP,subframeP,mbsfn_status); + } + + + if (RC.flexran[module_idP]->enabled) + flexran_agent_send_update_stats(module_idP); + + // Allocate CCEs for good after scheduling is done + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) + allocate_CCEs(module_idP, CC_id, subframeP, 0); + + stop_meas(&RC.nrmac[module_idP]->eNB_scheduler); + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); +} \ No newline at end of file diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c new file mode 100644 index 0000000000000000000000000000000000000000..0382e6392575dad27a3e3103f16f26f8fea79578 --- /dev/null +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -0,0 +1,125 @@ +/* + * 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 eNB_scheduler_bch.c + * \brief procedures related to eNB for the BCH transport channel + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \email: navid.nikaein@eurecom.fr + * \version 1.0 + * @ingroup _mac + + */ + +#include "assertions.h" +#include "LAYER2/NR_MAC_gNB/mac.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" +#include "LAYER2/MAC/mac_extern.h" +#include "UTIL/LOG/log.h" +#include "UTIL/LOG/vcd_signal_dumper.h" +#include "UTIL/OPT/opt.h" +#include "OCG.h" +#include "OCG_extern.h" + +#include "RRC/NR/nr_rrc_extern.h" + + +//#include "LAYER2/MAC/pre_processor.c" +#include "pdcp.h" + +#if defined(ENABLE_ITTI) +#include "intertask_interface.h" +#endif + +#define ENABLE_MAC_PAYLOAD_DEBUG +#define DEBUG_eNB_SCHEDULER 1 + +#include "common/ran_context.h" + +extern RAN_CONTEXT_t RC; + +void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP){ + + gNB_MAC_INST *gNB = RC.nrmac[module_idP]; + NR_COMMON_channels_t *cc; + + nfapi_nr_dl_config_request_t *dl_config_request; + nfapi_nr_dl_config_request_body_t *dl_req; + nfapi_nr_dl_config_request_pdu_t *dl_config_pdu; + nfapi_tx_request_pdu_t *TX_req; + + int mib_sdu_length; + int CC_id; + + uint16_t sfn_sf = frameP << 4 | subframeP; + + AssertFatal(subframeP == 0, "Subframe must be 0\n"); + AssertFatal((frameP & 7) == 0, "Frame must be a multiple of 8\n"); + + for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + + dl_config_request = &gNB->DL_req[CC_id]; + dl_req = &dl_config_request->dl_config_request_body; + cc = &gNB->common_channels[CC_id]; + + mib_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, MIBCH, 1, &cc->MIB_pdu.payload[0]); // not used in this case + + LOG_D(MAC, "Frame %d, subframe %d: BCH PDU length %d\n", frameP, subframeP, mib_sdu_length); + + if (mib_sdu_length > 0) { + + LOG_D(MAC, "Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n", frameP, subframeP, dl_req->number_pdu, mib_sdu_length); + + if ((frameP & 1023) < 80){ + LOG_D(MAC,"[gNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes\n",module_idP, frameP, CC_id, mib_sdu_length); + } + + dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; + memset((void *) dl_config_pdu, 0,sizeof(nfapi_nr_dl_config_request_pdu_t)); + dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_BCH_PDU_TYPE; + dl_config_pdu->pdu_size =2 + sizeof(nfapi_nr_dl_config_bch_pdu_rel15_t); + dl_config_pdu->bch_pdu.tl.tag = NFAPI_NR_DL_CONFIG_REQUEST_BCH_PDU_REL15_TAG; + dl_config_pdu->bch_pdu.length = mib_sdu_length; + dl_config_pdu->bch_pdu.pdu_index = gNB->pdu_index[CC_id]; + dl_config_pdu->bch_pdu.transmission_power = 6000; + dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; + dl_req->number_pdu++; + dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST; + dl_config_request->sfn_sf = sfn_sf; + + LOG_D(MAC, "gNB->DL_req[0].number_pdu %d (%p)\n", dl_req->number_pdu, &dl_req->number_pdu); + // DL request + + TX_req = &gNB->TX_req[CC_id].tx_request_body.tx_pdu_list[gNB->TX_req[CC_id].tx_request_body.number_of_pdus]; + TX_req->pdu_length = 3; + TX_req->pdu_index = gNB->pdu_index[CC_id]++; + TX_req->num_segments = 1; + TX_req->segments[0].segment_length = 3; + TX_req->segments[0].segment_data = cc[CC_id].MIB_pdu.payload; + gNB->TX_req[CC_id].tx_request_body.number_of_pdus++; + gNB->TX_req[CC_id].sfn_sf = sfn_sf; + gNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG; + gNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST; + } + } +} + + diff --git a/openair2/LAYER2/NR_MAC_gNB/mac.h b/openair2/LAYER2/NR_MAC_gNB/mac.h new file mode 100644 index 0000000000000000000000000000000000000000..637a75a4b9ff9309f6b974cb2e416ae03ccbaa32 --- /dev/null +++ b/openair2/LAYER2/NR_MAC_gNB/mac.h @@ -0,0 +1,166 @@ +/* + * 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 LAYER2/MAC/defs.h +* \brief MAC data structures, constant, and function prototype +* \author Navid Nikaein and Raymond Knopp +* \date 2011 +* \version 0.5 +* \email navid.nikaein@eurecom.fr + +*/ +/** @defgroup _oai2 openair2 Reference Implementation + * @ingroup _ref_implementation_ + * @{ + */ + +/*@}*/ + +#ifndef __LAYER2_NR_MAC_DEFS_H__ +#define __LAYER2_NR_MAC_DEFS_H__ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "COMMON/platform_constants.h" + +#include "NR_BCCH-BCH-Message.h" +#include "NR_ServingCellConfigCommon.h" + +#include "nfapi_nr_interface.h" + +#include "NR_PHY_INTERFACE/NR_IF_Module.h" + +#include "PHY/TOOLS/time_meas.h" + +#include "PHY/defs_common.h" // for PRACH_RESOURCES_t + +#include "targets/ARCH/COMMON/common_lib.h" + +#include "LAYER2/MAC/mac.h" // temporary + +/*! \brief eNB common channels */ +typedef struct { + int physCellId; + int p_gNB; + int Ncp; + int eutra_band; + uint32_t dl_CarrierFreq; + NR_BCCH_BCH_Message_t *mib; + TDD_Config_t *tdd_Config; + ARFCN_ValueEUTRA_t ul_CarrierFreq; + long ul_Bandwidth; + /// Outgoing MIB PDU for PHY + MIB_PDU MIB_pdu; + /// Outgoing BCCH pdu for PHY + BCCH_PDU BCCH_pdu; + /// Outgoing BCCH DCI allocation + uint32_t BCCH_alloc_pdu; + /// Outgoing CCCH pdu for PHY + CCCH_PDU CCCH_pdu; + /// Outgoing PCCH DCI allocation + uint32_t PCCH_alloc_pdu; + /// Outgoing PCCH pdu for PHY + PCCH_PDU PCCH_pdu; + /// Outgoing RAR pdu for PHY + RAR_PDU RAR_pdu; + /// Template for RA computations + RA_t ra[NB_RA_PROC_MAX]; + /// VRB map for common channels + uint8_t vrb_map[100]; + /// VRB map for common channels and retransmissions by PHICH + uint8_t vrb_map_UL[100]; + /// number of subframe allocation pattern available for MBSFN sync area + uint8_t num_sf_allocation_pattern; +} NR_COMMON_channels_t; + +/*! \brief top level eNB MAC structure */ +typedef struct gNB_MAC_INST_s { + /// Ethernet parameters for northbound midhaul interface + eth_params_t eth_params_n; + /// Ethernet parameters for fronthaul interface + eth_params_t eth_params_s; + /// Module + module_id_t Mod_id; + /// frame counter + frame_t frame; + /// subframe counter + sub_frame_t subframe; + /// Pointer to IF module instance for PHY + NR_IF_Module_t *if_inst; + /// Common cell resources + NR_COMMON_channels_t common_channels[NFAPI_CC_MAX]; + /// current PDU index (BCH,DLSCH) + uint16_t pdu_index[NFAPI_CC_MAX]; + + /// NFAPI Config Request Structure + nfapi_nr_config_request_t config[NFAPI_CC_MAX]; + /// NFAPI DL Config Request Structure + nfapi_nr_dl_config_request_t DL_req[NFAPI_CC_MAX]; + /// NFAPI UL Config Request Structure, send to L1 4 subframes before processing takes place + nfapi_ul_config_request_t UL_req[NFAPI_CC_MAX]; + /// Preallocated DL pdu list + nfapi_dl_config_request_pdu_t dl_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_DL_PDU]; + /// Preallocated UL pdu list + nfapi_ul_config_request_pdu_t ul_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_UL_PDU]; + /// Preallocated UL pdu list for ULSCH (n+k delay) + nfapi_ul_config_request_pdu_t ul_config_pdu_list_tmp[NFAPI_CC_MAX][10][MAX_NUM_UL_PDU]; + /// NFAPI "Temporary" UL Config Request Structure, holds future UL_config requests + nfapi_ul_config_request_t UL_req_tmp[NFAPI_CC_MAX][10]; + /// Preallocated HI_DCI0 pdu list + nfapi_hi_dci0_request_pdu_t hi_dci0_pdu_list[NFAPI_CC_MAX][MAX_NUM_HI_DCI0_PDU]; + /// NFAPI HI/DCI0 Config Request Structure + nfapi_hi_dci0_request_t HI_DCI0_req[NFAPI_CC_MAX]; + /// Prealocated TX pdu list + nfapi_tx_request_pdu_t tx_request_pdu[NFAPI_CC_MAX][MAX_NUM_TX_REQUEST_PDU]; + /// NFAPI DL PDU structure + nfapi_tx_request_t TX_req[NFAPI_CC_MAX]; + + UE_list_t UE_list; + + /// UL handle + uint32_t ul_handle; + + // MAC function execution peformance profiler + /// processing time of eNB scheduler + time_stats_t eNB_scheduler; + /// processing time of eNB scheduler for SI + time_stats_t schedule_si; + /// processing time of eNB scheduler for Random access + time_stats_t schedule_ra; + /// processing time of eNB ULSCH scheduler + time_stats_t schedule_ulsch; + /// processing time of eNB DCI generation + time_stats_t fill_DLSCH_dci; + /// processing time of eNB MAC preprocessor + time_stats_t schedule_dlsch_preprocessor; + /// processing time of eNB DLSCH scheduler + time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor + /// processing time of eNB MCH scheduler + time_stats_t schedule_mch; + /// processing time of eNB ULSCH reception + time_stats_t rx_ulsch_sdu; // include rlc_data_ind + /// processing time of eNB PCH scheduler + time_stats_t schedule_pch; +} gNB_MAC_INST; + +#endif /*__LAYER2_NR_MAC_DEFS_H__ */ diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h new file mode 100644 index 0000000000000000000000000000000000000000..8472eead62ce865c6249ddd28d14930b81c6e41e --- /dev/null +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -0,0 +1,26 @@ + +#ifndef __LAYER2_NR_MAC_PROTO_H__ +#define __LAYER2_NR_MAC_PROTO_H__ + +#include "mac.h" +#include "PHY/defs_nr_common.h" + +void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP); + +void mac_top_init_gNB(void); + +int rrc_mac_config_req_gNB(module_id_t Mod_idP, + int CC_id, + int p_gNB, + int eutra_bandP, + int dl_CarrierFreqP, + int dl_BandwidthP, + NR_BCCH_BCH_Message_t *mib, + NR_ServingCellConfigCommon_t *servingcellconfigcommon + ); + +void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, + frame_t frameP, + sub_frame_t subframeP); + +#endif /*__LAYER2_NR_MAC_PROTO_H__*/ \ No newline at end of file diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c new file mode 100644 index 0000000000000000000000000000000000000000..08a729036bbe64da00c1f52996fad7f490fea175 --- /dev/null +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -0,0 +1,124 @@ +/* + * 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 main.c + * \brief top init of Layer 2 + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \version 1.0 + * \email: navid.nikaein@eurecom.fr + * @ingroup _mac + + */ + +#include "mac_proto.h" +#include "LAYER2/MAC/mac_extern.h" //temporary +#include "assertions.h" + +#include "LAYER2/PDCP_v10.1.0/pdcp.h" +#include "RRC/NR/nr_rrc_defs.h" +#include "UTIL/LOG/log.h" +//#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" + +#include "common/ran_context.h" + +extern RAN_CONTEXT_t RC; + + +void mac_top_init_gNB(void) +{ + module_id_t i; + int list_el; + UE_list_t *UE_list; + gNB_MAC_INST *nrmac; + + LOG_I(MAC, "[MAIN] Init function start:nb_nr_macrlc_inst=%d\n",RC.nb_nr_macrlc_inst); + + if (RC.nb_nr_macrlc_inst > 0) { + + RC.nrmac = (gNB_MAC_INST **) malloc16(RC.nb_nr_macrlc_inst *sizeof(gNB_MAC_INST *)); + + AssertFatal(RC.nrmac != NULL,"can't ALLOCATE %zu Bytes for %d gNB_MAC_INST with size %zu \n", + RC.nb_nr_macrlc_inst * sizeof(gNB_MAC_INST *), + RC.nb_nr_macrlc_inst, sizeof(gNB_MAC_INST)); + + for (i = 0; i < RC.nb_nr_macrlc_inst; i++) { + RC.nrmac[i] = (gNB_MAC_INST *) malloc16(sizeof(gNB_MAC_INST)); + + AssertFatal(RC.nrmac != NULL,"can't ALLOCATE %zu Bytes for %d gNB_MAC_INST with size %zu \n", + RC.nb_nr_macrlc_inst * sizeof(gNB_MAC_INST *), + RC.nb_nr_macrlc_inst, sizeof(gNB_MAC_INST)); + + LOG_D(MAC,"[MAIN] ALLOCATE %zu Bytes for %d gNB_MAC_INST @ %p\n",sizeof(gNB_MAC_INST), RC.nb_nr_macrlc_inst, RC.mac); + + bzero(RC.nrmac[i], sizeof(gNB_MAC_INST)); + + RC.nrmac[i]->Mod_id = i; + + /* + for (j = 0; j < MAX_NUM_CCs; j++) { + RC.nrmac[i]->DL_req[j].dl_config_request_body.dl_config_pdu_list = RC.nrmac[i]->dl_config_pdu_list[j]; + RC.nrmac[i]->UL_req[j].ul_config_request_body.ul_config_pdu_list = RC.nrmac[i]->ul_config_pdu_list[j]; + + for (int k = 0; k < 10; k++) + RC.nrmac[i]->UL_req_tmp[j][k].ul_config_request_body.ul_config_pdu_list =RC.nrmac[i]->ul_config_pdu_list_tmp[j][k]; + + RC.nrmac[i]->HI_DCI0_req[j].hi_dci0_request_body.hi_dci0_pdu_list = RC.nrmac[i]->hi_dci0_pdu_list[j]; + RC.nrmac[i]->TX_req[j].tx_request_body.tx_pdu_list = RC.nrmac[i]->tx_request_pdu[j]; + RC.nrmac[i]->ul_handle = 0; + } + */ + + }//END for (i = 0; i < RC.nb_nr_macrlc_inst; i++) + + AssertFatal(rlc_module_init() == 0,"Could not initialize RLC layer\n"); + + // These should be out of here later + pdcp_layer_init(); + + rrc_init_nr_global_param(); + + }else { + RC.nrmac = NULL; + } + + // Initialize Linked-List for Active UEs + for (i = 0; i < RC.nb_nr_macrlc_inst; i++) { + + nrmac = RC.nrmac[i]; + nrmac->if_inst = NR_IF_Module_init(i); + + UE_list = &nrmac->UE_list; + UE_list->num_UEs = 0; + UE_list->head = -1; + UE_list->head_ul = -1; + UE_list->avail = 0; + + for (list_el = 0; list_el < MAX_MOBILES_PER_ENB - 1; list_el++) { + UE_list->next[list_el] = list_el + 1; + UE_list->next_ul[list_el] = list_el + 1; + } + + UE_list->next[list_el] = -1; + UE_list->next_ul[list_el] = -1; + } + +} \ No newline at end of file diff --git a/openair2/NR_PHY_INTERFACE/IF_Module.h b/openair2/NR_PHY_INTERFACE/IF_Module.h deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c new file mode 100644 index 0000000000000000000000000000000000000000..5c00291214a91d9681f2b2e7d3ef69c58137f39f --- /dev/null +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -0,0 +1,345 @@ +#include "openair1/PHY/defs_eNB.h" +#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" +#include "openair1/PHY/phy_extern.h" +#include "LAYER2/MAC/mac_extern.h" +#include "LAYER2/MAC/mac_proto.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" +#include "common/ran_context.h" + +#define MAX_IF_MODULES 100 + +NR_IF_Module_t *if_inst[MAX_IF_MODULES]; +NR_Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs]; + +extern int oai_nfapi_harq_indication(nfapi_harq_indication_t *harq_ind); +extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind); +extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind); +extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind); +extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); +extern uint8_t nfapi_mode; +extern uint16_t sf_ahead; + +void handle_nr_rach(NR_UL_IND_t *UL_info) { + int i; + + if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) { + + AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n"); + UL_info->rach_ind.rach_indication_body.number_of_preambles=0; + LOG_D(MAC,"UL_info[Frame %d, Subframe %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->subframe, NFAPI_SFNSF2DEC(UL_info->rach_ind.sfn_sf)); + initiate_ra_proc(UL_info->module_id, + UL_info->CC_id, + NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf), + NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf), + UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble, + UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance, + UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti +#ifdef Rel14 + ,0 +#endif + ); + } + +#ifdef Rel14 + if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) { + + AssertFatal(UL_info->rach_ind_br.rach_indication_body.number_of_preambles<5,"More than 4 preambles not supported\n"); + for (i=0;i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles;i++) { + AssertFatal(UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type>0, + "Got regular PRACH preamble, not BL/CE\n"); + LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->subframe, + UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type-1); + initiate_ra_proc(UL_info->module_id, + UL_info->CC_id, + UL_info->frame, + UL_info->subframe, + UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.preamble, + UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.timing_advance, + UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.rnti, + UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type); + } + UL_info->rach_ind_br.rach_indication_body.number_of_preambles=0; + } +#endif +} + +void handle_nr_sr(NR_UL_IND_t *UL_info) { + + int i; + + if (nfapi_mode == 1) // PNF + { + if (UL_info->sr_ind.sr_indication_body.number_of_srs>0) + { + oai_nfapi_sr_indication(&UL_info->sr_ind); + } + } + else + { + for (i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++) + SR_indication(UL_info->module_id, + UL_info->CC_id, + UL_info->frame, + UL_info->subframe, + UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti, + UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi); + } + + UL_info->sr_ind.sr_indication_body.number_of_srs=0; +} + +void handle_nr_cqi(NR_UL_IND_t *UL_info) { + + int i; + + if (nfapi_mode == 1) + { + if (UL_info->cqi_ind.number_of_cqis>0) + { + LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.number_of_cqis); + nfapi_cqi_indication_t ind; + + ind.header.message_id = NFAPI_RX_CQI_INDICATION; + ind.sfn_sf = UL_info->frame<<4 | UL_info->subframe; + ind.cqi_indication_body = UL_info->cqi_ind; + + oai_nfapi_cqi_indication(&ind); + + UL_info->cqi_ind.number_of_cqis=0; + } + } + else + { + for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++) + cqi_indication(UL_info->module_id, + UL_info->CC_id, + UL_info->frame, + UL_info->subframe, + UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti, + &UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9, + UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu, + &UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information); + + UL_info->cqi_ind.number_of_cqis=0; + } +} + +void handle_nr_harq(NR_UL_IND_t *UL_info) { + + int i; + + if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) // PNF + { + //LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs); + + int retval = oai_nfapi_harq_indication(&UL_info->harq_ind); + + if (retval!=0) + { + LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval); + } + + UL_info->harq_ind.harq_indication_body.number_of_harqs = 0; + } + else + { + for (i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++) + harq_indication(UL_info->module_id, + UL_info->CC_id, + NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf), + NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf), + &UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]); + + UL_info->harq_ind.harq_indication_body.number_of_harqs=0; + } +} + +void handle_nr_ulsch(NR_UL_IND_t *UL_info) { + + int i,j; + + if(nfapi_mode == 1) + { + if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0) + { + //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf)); + + oai_nfapi_crc_indication(&UL_info->crc_ind); + + UL_info->crc_ind.crc_indication_body.number_of_crcs = 0; + } + + if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0) + { + //LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf)); + oai_nfapi_rx_ind(&UL_info->rx_ind); + UL_info->rx_ind.rx_indication_body.number_of_pdus = 0; + } + } + else + { + if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) { + for (i=0;i<UL_info->rx_ind.rx_indication_body.number_of_pdus;i++) { + for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) { + // find crc_indication j corresponding rx_indication i + LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti); + if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti == + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti) { + LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag); + if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication + LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe); + rx_sdu(UL_info->module_id, + UL_info->CC_id, + NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame, + NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe, + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti, + (uint8_t *)NULL, + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length, + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance, + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi); + } + else { + LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe); + rx_sdu(UL_info->module_id, + UL_info->CC_id, + NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame, + NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe, + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti, + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data, + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length, + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance, + UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi); + } + break; + } //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti == + // UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) + } // for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) + } // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) + UL_info->crc_ind.crc_indication_body.number_of_crcs=0; + UL_info->rx_ind.rx_indication_body.number_of_pdus = 0; + } // UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->subframe && UL_info->crc_ind.crc_indication_body.number_of_crcs>0 + else if (UL_info->rx_ind.rx_indication_body.number_of_pdus!=0 || UL_info->crc_ind.crc_indication_body.number_of_crcs!=0) { + LOG_E(PHY,"hoping not to have mis-match between CRC ind and RX ind - hopefully the missing message is coming shortly rx_ind:%d(SFN/SF:%05d) crc_ind:%d(SFN/SF:%05d) UL_info(SFN/SF):%04d%d\n", + UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf), + UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf), + UL_info->frame, UL_info->subframe); + } + } +} + +void NR_UL_indication(NR_UL_IND_t *UL_info) +{ + + AssertFatal(UL_info!=NULL,"UL_INFO is null\n"); + +#ifdef DUMP_FAPI + dump_ul(UL_info); +#endif + + module_id_t module_id = UL_info->module_id; + int CC_id = UL_info->CC_id; + NR_Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id]; + NR_IF_Module_t *ifi = if_inst[module_id]; + gNB_MAC_INST *mac = RC.nrmac[module_id]; + + LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n", + UL_info->frame,UL_info->subframe, + module_id,CC_id, + UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs); + + if (nfapi_mode != 1) + { + if (ifi->CC_mask==0) { + ifi->current_frame = UL_info->frame; + ifi->current_subframe = UL_info->subframe; + } + else { + AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask); + AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask); + } + ifi->CC_mask |= (1<<CC_id); + } + + + // clear DL/UL info for new scheduling round + clear_nfapi_information(RC.mac[module_id],CC_id, + UL_info->frame,UL_info->subframe); + + handle_nr_rach(UL_info); + + handle_nr_sr(UL_info); + + handle_nr_cqi(UL_info); + + handle_nr_harq(UL_info); + + // clear HI prior to handling ULSCH + mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0; + + handle_nr_ulsch(UL_info); + + if (nfapi_mode != 1) + { + if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) { + /* + eNB_dlsch_ulsch_scheduler(module_id, + (UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024, + (UL_info->subframe+sf_ahead)%10); + */ + + gNB_dlsch_ulsch_scheduler(module_id, + (UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024, + (UL_info->subframe+sf_ahead)%10); + + ifi->CC_mask = 0; + + sched_info->module_id = module_id; + sched_info->CC_id = CC_id; + sched_info->frame = (UL_info->frame + ((UL_info->subframe>(9-sf_ahead)) ? 1 : 0)) % 1024; + sched_info->subframe = (UL_info->subframe+sf_ahead)%10; + sched_info->DL_req = &mac->DL_req[CC_id]; + sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id]; + if ((mac->common_channels[CC_id].tdd_Config==NULL) || + (is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+sf_ahead)%10)>0)) + sched_info->UL_req = &mac->UL_req[CC_id]; + else + sched_info->UL_req = NULL; + + sched_info->TX_req = &mac->TX_req[CC_id]; + +#ifdef DUMP_FAPI + dump_dl(sched_info); +#endif + + if (ifi->schedule_response) + { + AssertFatal(ifi->schedule_response!=NULL, + "schedule_response is null (mod %d, cc %d)\n", + module_id, + CC_id); + ifi->schedule_response(sched_info); + } + + LOG_D(PHY,"Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu); + } + } +} + +NR_IF_Module_t *NR_IF_Module_init(int Mod_id){ + + AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES); + + LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n"); + + if (if_inst[Mod_id]==NULL) { + if_inst[Mod_id] = (NR_IF_Module_t*)malloc(sizeof(NR_IF_Module_t)); + memset((void*)if_inst[Mod_id],0,sizeof(NR_IF_Module_t)); + + if_inst[Mod_id]->CC_mask=0; + if_inst[Mod_id]->UL_indication = NR_UL_indication; + + AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0, + "allocation of if_inst[%d]->if_mutex fails\n",Mod_id); + } + return if_inst[Mod_id]; +} \ No newline at end of file diff --git a/openair2/NR_UE_PHY_INTERFACE/IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h similarity index 81% rename from openair2/NR_UE_PHY_INTERFACE/IF_Module.h rename to openair2/NR_PHY_INTERFACE/NR_IF_Module.h index 3b1c88dda03b5857f99c40a3a724b1a072a469e5..664ef8930d04ba7a818c50bfb82eead48fc56896 100644 --- a/openair2/NR_UE_PHY_INTERFACE/IF_Module.h +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h @@ -29,14 +29,13 @@ * \note * \warning */ -#ifndef __IF_MODULE__H__ -#define __IF_MODULE__H__ - +#ifndef __NR_IF_MODULE__H__ +#define __NR_IF_MODULE__H__ #include <stdint.h> -#include "openair1/PHY/LTE_TRANSPORT/defs.h" -#include "nfapi_interface.h" - +#include "nfapi_nr_interface.h" +#include "platform_constants.h" +#include "platform_types.h" #define MAX_NUM_DL_PDU 100 #define MAX_NUM_UL_PDU 100 @@ -86,7 +85,7 @@ typedef struct{ /// RX indication nfapi_rx_indication_t rx_ind; -} UL_IND_t; +} NR_UL_IND_t; // Downlink subframe P7 @@ -108,35 +107,33 @@ typedef struct{ nfapi_hi_dci0_request_t *HI_DCI0_req; /// Pointers to DL SDUs nfapi_tx_request_t *TX_req; -}Sched_Rsp_t; +} NR_Sched_Rsp_t; typedef struct { uint8_t Mod_id; int CC_id; - nfapi_config_request_t *cfg; -}PHY_Config_t; + nfapi_nr_config_request_t *cfg; +} NR_PHY_Config_t; -typedef struct IF_Module_s{ +typedef struct NR_IF_Module_s{ //define the function pointer - void (*UL_indication)(UL_IND_t *UL_INFO); - void (*schedule_response)(Sched_Rsp_t *Sched_INFO); - void (*PHY_config_req)(PHY_Config_t* config_INFO); + void (*UL_indication)(NR_UL_IND_t *UL_INFO); + void (*schedule_response)(NR_Sched_Rsp_t *Sched_INFO); + void (*PHY_config_req)(NR_PHY_Config_t* config_INFO); uint32_t CC_mask; uint16_t current_frame; uint8_t current_subframe; pthread_mutex_t if_mutex; -}IF_Module_t; +} NR_IF_Module_t; /*Initial */ -IF_Module_t *IF_Module_init(int Mod_id); -void IF_Module_kill(int Mod_id); +NR_IF_Module_t *NR_IF_Module_init(int Mod_id); -/*Interface for uplink, transmitting the Preamble(list), ULSCH SDU, NAK, Tick (trigger scheduler) - */ -void UL_indication(UL_IND_t *UL_INFO); +void NR_IF_Module_kill(int Mod_id); -/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/ -void Schedule_Response(Sched_Rsp_t *Sched_INFO); +void NR_UL_indication(NR_UL_IND_t *UL_INFO); -#endif +/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/ +void NR_Schedule_Response(NR_Sched_Rsp_t *Sched_INFO); +#endif /*_NFAPI_INTERFACE_NR_H_*/ \ No newline at end of file diff --git a/openair2/NR_UE_PHY_INTERFACE/IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/IF_Module.c deleted file mode 100644 index d0b8e5755858bbaf3ac64711016a8debce09b04c..0000000000000000000000000000000000000000 --- a/openair2/NR_UE_PHY_INTERFACE/IF_Module.c +++ /dev/null @@ -1,647 +0,0 @@ -#include "openair1/PHY/defs.h" -#include "openair2/PHY_INTERFACE/IF_Module.h" -#include "openair1/PHY/extern.h" -#include "LAYER2/MAC/extern.h" -#include "LAYER2/MAC/proto.h" -#include "common/ran_context.h" - -#define MAX_IF_MODULES 100 - -IF_Module_t *if_inst[MAX_IF_MODULES]; -Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs]; - -extern int oai_nfapi_harq_indication(nfapi_harq_indication_t *harq_ind); -extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind); -extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind); -extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind); -extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); -extern uint8_t nfapi_mode; -extern uint16_t sf_ahead; - -void handle_rach(UL_IND_t *UL_info) { - int i; - - if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) { - - AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n"); - UL_info->rach_ind.rach_indication_body.number_of_preambles=0; - LOG_D(MAC,"UL_info[Frame %d, Subframe %d] Calling initiate_ra_proc RACH:SFN/SF:%d\n",UL_info->frame,UL_info->subframe, NFAPI_SFNSF2DEC(UL_info->rach_ind.sfn_sf)); - initiate_ra_proc(UL_info->module_id, - UL_info->CC_id, - NFAPI_SFNSF2SFN(UL_info->rach_ind.sfn_sf), - NFAPI_SFNSF2SF(UL_info->rach_ind.sfn_sf), - UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble, - UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance, - UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti -#ifdef Rel14 - ,0 -#endif - ); - } - -#ifdef Rel14 - if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) { - - AssertFatal(UL_info->rach_ind_br.rach_indication_body.number_of_preambles<5,"More than 4 preambles not supported\n"); - for (i=0;i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles;i++) { - AssertFatal(UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type>0, - "Got regular PRACH preamble, not BL/CE\n"); - LOG_D(MAC,"Frame %d, Subframe %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->subframe, - UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type-1); - initiate_ra_proc(UL_info->module_id, - UL_info->CC_id, - UL_info->frame, - UL_info->subframe, - UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.preamble, - UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.timing_advance, - UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel8.rnti, - UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type); - } - UL_info->rach_ind_br.rach_indication_body.number_of_preambles=0; - } -#endif -} - -void handle_sr(UL_IND_t *UL_info) { - - int i; - - if (nfapi_mode == 1) // PNF - { - if (UL_info->sr_ind.sr_indication_body.number_of_srs>0) - { - oai_nfapi_sr_indication(&UL_info->sr_ind); - } - } - else - { - for (i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++) - SR_indication(UL_info->module_id, - UL_info->CC_id, - UL_info->frame, - UL_info->subframe, - UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti, - UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi); - } - - UL_info->sr_ind.sr_indication_body.number_of_srs=0; -} - -void handle_cqi(UL_IND_t *UL_info) { - - int i; - - if (nfapi_mode == 1) - { - if (UL_info->cqi_ind.number_of_cqis>0) - { - LOG_D(PHY,"UL_info->cqi_ind.number_of_cqis:%d\n", UL_info->cqi_ind.number_of_cqis); - nfapi_cqi_indication_t ind; - - ind.header.message_id = NFAPI_RX_CQI_INDICATION; - ind.sfn_sf = UL_info->frame<<4 | UL_info->subframe; - ind.cqi_indication_body = UL_info->cqi_ind; - - oai_nfapi_cqi_indication(&ind); - - UL_info->cqi_ind.number_of_cqis=0; - } - } - else - { - for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++) - cqi_indication(UL_info->module_id, - UL_info->CC_id, - UL_info->frame, - UL_info->subframe, - UL_info->cqi_ind.cqi_pdu_list[i].rx_ue_information.rnti, - &UL_info->cqi_ind.cqi_pdu_list[i].cqi_indication_rel9, - UL_info->cqi_ind.cqi_raw_pdu_list[i].pdu, - &UL_info->cqi_ind.cqi_pdu_list[i].ul_cqi_information); - - UL_info->cqi_ind.number_of_cqis=0; - } -} - -void handle_harq(UL_IND_t *UL_info) { - - int i; - - if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) // PNF - { - //LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs); - - int retval = oai_nfapi_harq_indication(&UL_info->harq_ind); - - if (retval!=0) - { - LOG_E(PHY, "Failed to encode NFAPI HARQ_IND retval:%d\n", retval); - } - - UL_info->harq_ind.harq_indication_body.number_of_harqs = 0; - } - else - { - for (i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++) - harq_indication(UL_info->module_id, - UL_info->CC_id, - NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf), - NFAPI_SFNSF2SF(UL_info->harq_ind.sfn_sf), - &UL_info->harq_ind.harq_indication_body.harq_pdu_list[i]); - - UL_info->harq_ind.harq_indication_body.number_of_harqs=0; - } -} - -void handle_ulsch(UL_IND_t *UL_info) { - - int i,j; - - if(nfapi_mode == 1) - { - if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0) - { - //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf)); - - oai_nfapi_crc_indication(&UL_info->crc_ind); - - UL_info->crc_ind.crc_indication_body.number_of_crcs = 0; - } - - if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0) - { - //LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf)); - oai_nfapi_rx_ind(&UL_info->rx_ind); - UL_info->rx_ind.rx_indication_body.number_of_pdus = 0; - } - } - else - { - if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) { - for (i=0;i<UL_info->rx_ind.rx_indication_body.number_of_pdus;i++) { - for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) { - // find crc_indication j corresponding rx_indication i - LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti); - if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti == - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti) { - LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag); - if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication - LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->subframe); - rx_sdu(UL_info->module_id, - UL_info->CC_id, - NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame, - NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe, - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti, - (uint8_t *)NULL, - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length, - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance, - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi); - } - else { - LOG_D(MAC,"Frame %d, Subframe %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->subframe); - rx_sdu(UL_info->module_id, - UL_info->CC_id, - NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame, - NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->subframe, - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti, - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data, - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length, - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance, - UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi); - } - break; - } //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti == - // UL_info->rx_ind.rx_pdu_list[i].rx_ue_information.rnti) - } // for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) - } // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++) - UL_info->crc_ind.crc_indication_body.number_of_crcs=0; - UL_info->rx_ind.rx_indication_body.number_of_pdus = 0; - } // UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->subframe && UL_info->crc_ind.crc_indication_body.number_of_crcs>0 - else if (UL_info->rx_ind.rx_indication_body.number_of_pdus!=0 || UL_info->crc_ind.crc_indication_body.number_of_crcs!=0) { - LOG_E(PHY,"hoping not to have mis-match between CRC ind and RX ind - hopefully the missing message is coming shortly rx_ind:%d(SFN/SF:%05d) crc_ind:%d(SFN/SF:%05d) UL_info(SFN/SF):%04d%d\n", - UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf), - UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf), - UL_info->frame, UL_info->subframe); - } - } -} - -/****************************************************************************/ -/* debug utility functions begin */ -/****************************************************************************/ - -//#define DUMP_FAPI - -#ifdef DUMP_FAPI - -#define C do { size = 0; put(0); } while (0) -#define A(...) do { char t[4096]; sprintf(t, __VA_ARGS__); append_string(t); } while (0) - -#if 0 - -/* eats lots of ms at startup, disrupts realtime */ -static char *s; -static int size; -static int maxsize; - -static void put(char x) -{ - if (size == maxsize) { - maxsize += 32768; - s = realloc(s, maxsize); if (s == NULL) abort(); - } - s[size++] = x; -} - -#else - -/* eats nothing at startup, but fixed size */ -#define SMAX 65536 -static char s[SMAX]; -static int size; -static int maxsize = SMAX; - -static void put(char x) -{ - if (size == maxsize) { printf("incrase SMAX\n"); exit(1); } - s[size++] = x; -} - -#endif - -static void append_string(char *t) -{ - size--; - while (*t) put(*t++); - put(0); -} - -static void dump_ul(UL_IND_t *u) -{ - int i; - - C; - A("XXXX UL mod %d CC %d f.sf %d.%d\n", - u->module_id, u->CC_id, u->frame, u->subframe); - - A("XXXX harq_ind %d\n", u->harq_ind.harq_indication_body.number_of_harqs); - for (i = 0; i < u->harq_ind.harq_indication_body.number_of_harqs; i++) { - nfapi_harq_indication_pdu_t *v = &u->harq_ind.harq_indication_body.harq_pdu_list[i]; - A("XXXX harq ind %d\n", i); - A("XXXX rnti %d\n", v->rx_ue_information.rnti); - A("XXXX tb1 %d tb2 %d\n", v->harq_indication_fdd_rel8.harq_tb1, - v->harq_indication_fdd_rel8.harq_tb2); - A("XXXX number_of_ack_nack %d\n", - v->harq_indication_fdd_rel9.number_of_ack_nack); - A("XXXX harq[0] = %d\n", - v->harq_indication_fdd_rel9.harq_tb_n[0]); - A("XXXX harq ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi, - v->ul_cqi_information.channel); - } - - A("XXXX crc_ind %d\n", u->crc_ind.crc_indication_body.number_of_crcs); - - A("XXXX sr_ind %d\n", u->sr_ind.sr_indication_body.number_of_srs); - - A("XXXX cqi_ind %d\n", u->cqi_ind.number_of_cqis); - for (i = 0; i < u->cqi_ind.number_of_cqis; i++) { - nfapi_cqi_indication_pdu_t *v = &u->cqi_ind.cqi_pdu_list[i]; - A("XXXX cqi ind %d\n", i); - A("XXXX cqi ul_cqi %d channel %d\n", v->ul_cqi_information.ul_cqi, - v->ul_cqi_information.channel); - } - - A("XXXX rach_ind %d\n", u->rach_ind.rach_indication_body.number_of_preambles); - - A("XXXX rx_ind %d\n", u->rx_ind.rx_indication_body.number_of_pdus); - for (i = 0; i < u->rx_ind.rx_indication_body.number_of_pdus; i++) { - nfapi_rx_indication_pdu_t *v = &u->rx_ind.rx_indication_body.rx_pdu_list[i]; - A("XXXX rx ind %d\n", i); - A("XXXX timing_advance %d\n", - v->rx_indication_rel8.timing_advance); - A("XXXX rx ul_cqi %d\n", v->rx_indication_rel8.ul_cqi); - } - - LOG_I(PHY, "XXXX UL\nXXXX UL\n%s", s); -} - -static char *DL_PDU_TYPE(int x) -{ - switch (x) { - case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: return "NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE"; - case NFAPI_DL_CONFIG_BCH_PDU_TYPE: return "NFAPI_DL_CONFIG_BCH_PDU_TYPE"; - case NFAPI_DL_CONFIG_MCH_PDU_TYPE: return "NFAPI_DL_CONFIG_MCH_PDU_TYPE"; - case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: return "NFAPI_DL_CONFIG_DLSCH_PDU_TYPE"; - case NFAPI_DL_CONFIG_PCH_PDU_TYPE: return "NFAPI_DL_CONFIG_PCH_PDU_TYPE"; - case NFAPI_DL_CONFIG_PRS_PDU_TYPE: return "NFAPI_DL_CONFIG_PRS_PDU_TYPE"; - case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: return "NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE"; - case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: return "NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE"; - case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: return "NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE"; - case NFAPI_DL_CONFIG_NBCH_PDU_TYPE: return "NFAPI_DL_CONFIG_NBCH_PDU_TYPE"; - case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE: return "NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE"; - case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE: return "NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE"; - } - return "UNKNOWN"; -} - -static char *UL_PDU_TYPE(int x) -{ - switch (x) { - case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_PDU_TYPE"; - case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE"; - case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE"; - case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE"; - case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE"; - case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE"; - case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE"; - case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE"; - case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE"; - case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE"; - case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE"; - case NFAPI_UL_CONFIG_SRS_PDU_TYPE: return "NFAPI_UL_CONFIG_SRS_PDU_TYPE"; - case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE: return "NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE"; - case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE"; - case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE"; - case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: return "NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE"; - case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE: return "NFAPI_UL_CONFIG_NULSCH_PDU_TYPE"; - case NFAPI_UL_CONFIG_NRACH_PDU_TYPE: return "NFAPI_UL_CONFIG_NRACH_PDU_TYPE"; - } - return "UNKNOWN"; -} - -static char *HI_DCI0_PDU_TYPE(int x) -{ - switch (x) { - case NFAPI_HI_DCI0_HI_PDU_TYPE: return "NFAPI_HI_DCI0_HI_PDU_TYPE"; - case NFAPI_HI_DCI0_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_DCI_PDU_TYPE"; - case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE"; - case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE"; - case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE: return "NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE"; - } - return "UNKNOWN"; -} - -static void dump_dl(Sched_Rsp_t *d) -{ - int i; - - C; - A("XXXX DL mod %d CC %d f.sf %d.%d\n", - d->module_id, d->CC_id, d->frame, d->subframe); - - if (d->DL_req != NULL) { - nfapi_dl_config_request_body_t *v=&d->DL_req->dl_config_request_body; - nfapi_dl_config_request_pdu_t *p = v->dl_config_pdu_list; - A("XXXX DL_req sfnsf %d\n", d->DL_req->sfn_sf); - A("XXXX PDCCH size %d\n", v->number_pdcch_ofdm_symbols); - A("XXXX DCIs %d\n", v->number_dci); - A("XXXX PDUs %d\n", v->number_pdu); - A("XXXX rntis %d\n", v->number_pdsch_rnti); - A("XXXX pcfich power %d\n", v->transmission_power_pcfich); - for (i = 0; i < v->number_pdu; i++) { - A("XXXX pdu %d\n", i); - A("XXXX type %d %s\n", p[i].pdu_type, DL_PDU_TYPE(p[i].pdu_type)); - switch (p[i].pdu_type) { - case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: { - nfapi_dl_config_dci_dl_pdu_rel8_t *q = - &p[i].dci_dl_pdu.dci_dl_pdu_rel8; - A("XXXX dci format %d\n", q->dci_format); - A("XXXX cce idx %d\n", q->cce_idx); - A("XXXX agg lvl %d\n", q->aggregation_level); - A("XXXX rnti %d\n", q->rnti); - A("XXXX rb coding %8.8x\n", q->resource_block_coding); - A("XXXX mcs_1 %d\n", q->mcs_1); - A("XXXX rv_1 %d\n", q->redundancy_version_1); - A("XXXX ndi_1 %d\n", q->new_data_indicator_1); - A("XXXX harq pid %d\n", q->harq_process); - A("XXXX tpc %d\n", q->tpc); - A("XXXX tbs idx %d\n", q->transport_block_size_index); - A("XXXX dl pow off %d\n", q->downlink_power_offset); - A("XXXX rnti type %d\n", q->rnti_type); - A("XXXX xmit pow %d\n", q->transmission_power); - break; - } - case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: { - nfapi_dl_config_dlsch_pdu_rel8_t *q = - &p[i].dlsch_pdu.dlsch_pdu_rel8; - A("XXXX pdu_index %d\n", q->pdu_index); - A("XXXX rnti %d\n", q->rnti); - A("XXXX rv %d\n", q->redundancy_version); - A("XXXX mcs %d\n", q->modulation); - A("XXXX pa %d\n", q->pa); - break; - }} - } - } - - if (d->HI_DCI0_req != NULL) { - nfapi_hi_dci0_request_body_t *v=&d->HI_DCI0_req->hi_dci0_request_body; - A("XXXX up HI_DCI0_req sfnsf %d (%d.%d)\n", d->HI_DCI0_req->sfn_sf, - d->HI_DCI0_req->sfn_sf/16, d->HI_DCI0_req->sfn_sf%16); - A("XXXX up sfnsf %d\n", v->sfnsf); - A("XXXX up DCIs %d\n", v->number_of_dci); - A("XXXX up HIs %d\n", v->number_of_hi); - for (i = 0; i < v->number_of_dci + v->number_of_hi; i++) { - nfapi_hi_dci0_request_pdu_t *p = &v->hi_dci0_pdu_list[i]; - A("XXXX up pdu %d\n", i); - A("XXXX up type %d %s\n",p->pdu_type,HI_DCI0_PDU_TYPE(p->pdu_type)); - if (p->pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) { - nfapi_hi_dci0_dci_pdu_rel8_t *q = &p->dci_pdu.dci_pdu_rel8; - A("XXXX up dci_format %d\n", q->dci_format); - A("XXXX up cce_index %d\n", q->cce_index); - A("XXXX up aggregation_level %d\n", q->aggregation_level); - A("XXXX up rnti %d\n", q->rnti); - A("XXXX up rb start %d\n", q->resource_block_start); - A("XXXX up # rb %d\n", q->number_of_resource_block); - A("XXXX up mcs_1 %d\n", q->mcs_1); - A("XXXX up cshift_2_for_drms %d\n", q->cyclic_shift_2_for_drms); - A("XXXX up freq hop enabled %d\n", q->frequency_hopping_enabled_flag); - A("XXXX up fre hop bits %d\n", q->frequency_hopping_bits); - A("XXXX up NDI_1 %d\n", q->new_data_indication_1); - A("XXXX up tx_antenna_seleciton %d\n", q->ue_tx_antenna_seleciton); - A("XXXX up tpc %d\n", q->tpc); - A("XXXX up cqi_csi_request %d\n", q->cqi_csi_request); - A("XXXX up ul_index %d\n", q->ul_index); - A("XXXX up dl_assignment_index %d\n", q->dl_assignment_index); - A("XXXX up tpc_bitmap %d\n", q->tpc_bitmap); - A("XXXX up transmission_power %d\n", q->transmission_power); - } - if (p->pdu_type == NFAPI_HI_DCI0_HI_PDU_TYPE) { - nfapi_hi_dci0_hi_pdu_rel8_t *q = &p->hi_pdu.hi_pdu_rel8; - A("XXXX up rb start %d\n", q->resource_block_start); - A("XXXX up cs2_drms %d\n", q->cyclic_shift_2_for_drms); - A("XXXX up ack %d\n", q->hi_value); - A("XXXX up i_phich %d\n", q->i_phich); - A("XXXX up power %d\n", q->transmission_power); - } - } - } - - if (d->UL_req != NULL) { - nfapi_ul_config_request_body_t *v=&d->UL_req->ul_config_request_body; - A("XXXX UL_req sfnsf %d (%d.%d)\n", d->UL_req->sfn_sf, - d->UL_req->sfn_sf/16, d->UL_req->sfn_sf%16); - A("XXXX PDUs %d\n", v->number_of_pdus); - A("XXXX ra freq %d\n", v->rach_prach_frequency_resources); - A("XXXX srs? %d\n", v->srs_present); - for (i = 0; i < v->number_of_pdus; i++) { - nfapi_ul_config_request_pdu_t *p = &v->ul_config_pdu_list[i]; - A("XXXX pdu %d\n", i); - A("XXXX type %d %s\n", p->pdu_type, UL_PDU_TYPE(p->pdu_type)); - switch(p->pdu_type) { - case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: { - nfapi_ul_config_uci_harq_pdu *q = &p->uci_harq_pdu; - nfapi_ul_config_harq_information_rel9_fdd_t *h = - &q->harq_information.harq_information_rel9_fdd; - A("XXXX rnti %d\n", - q->ue_information.ue_information_rel8.rnti); - A("XXXX harq size %d\n", h->harq_size); - A("XXXX ack_nack_mode %d\n", h->ack_nack_mode); - A("XXXX # pucch res %d\n", h->number_of_pucch_resources); - A("XXXX n_pucch_1_0 %d\n", h->n_pucch_1_0); - A("XXXX n_pucch_1_1 %d\n", h->n_pucch_1_1); - A("XXXX n_pucch_1_2 %d\n", h->n_pucch_1_2); - A("XXXX n_pucch_1_3 %d\n", h->n_pucch_1_3); - break; - } - case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: { - nfapi_ul_config_uci_sr_pdu *q = &p->uci_sr_pdu; - nfapi_ul_config_sr_information_rel8_t *h = - &q->sr_information.sr_information_rel8; - A("XXXX rnti %d\n", - q->ue_information.ue_information_rel8.rnti); - A("XXXX pucch_index %d\n", h->pucch_index); - }} - } - } - - LOG_I(PHY, "XXXX DL\nXXXX DL\n%s", s); -} - -#undef C -#undef A - -#endif /* DUMP_FAPI */ - -/****************************************************************************/ -/* debug utility functions end */ -/****************************************************************************/ - -void UL_indication(UL_IND_t *UL_info) -{ - - AssertFatal(UL_info!=NULL,"UL_INFO is null\n"); - -#ifdef DUMP_FAPI - dump_ul(UL_info); -#endif - - module_id_t module_id = UL_info->module_id; - int CC_id = UL_info->CC_id; - Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id]; - IF_Module_t *ifi = if_inst[module_id]; - eNB_MAC_INST *mac = RC.mac[module_id]; - - LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n", - UL_info->frame,UL_info->subframe, - module_id,CC_id, - UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles, UL_info->sr_ind.sr_indication_body.number_of_srs); - - if (nfapi_mode != 1) - { - if (ifi->CC_mask==0) { - ifi->current_frame = UL_info->frame; - ifi->current_subframe = UL_info->subframe; - } - else { - AssertFatal(UL_info->frame != ifi->current_frame,"CC_mask %x is not full and frame has changed\n",ifi->CC_mask); - AssertFatal(UL_info->subframe != ifi->current_subframe,"CC_mask %x is not full and subframe has changed\n",ifi->CC_mask); - } - ifi->CC_mask |= (1<<CC_id); - } - - - // clear DL/UL info for new scheduling round - clear_nfapi_information(RC.mac[module_id],CC_id, - UL_info->frame,UL_info->subframe); - - handle_rach(UL_info); - - handle_sr(UL_info); - - handle_cqi(UL_info); - - handle_harq(UL_info); - - // clear HI prior to handling ULSCH - mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0; - - handle_ulsch(UL_info); - - if (nfapi_mode != 1) - { - if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) { - - eNB_dlsch_ulsch_scheduler(module_id, - (UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024, - (UL_info->subframe+sf_ahead)%10); - - ifi->CC_mask = 0; - - sched_info->module_id = module_id; - sched_info->CC_id = CC_id; - sched_info->frame = (UL_info->frame + ((UL_info->subframe>(9-sf_ahead)) ? 1 : 0)) % 1024; - sched_info->subframe = (UL_info->subframe+sf_ahead)%10; - sched_info->DL_req = &mac->DL_req[CC_id]; - sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id]; - if ((mac->common_channels[CC_id].tdd_Config==NULL) || - (is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+sf_ahead)%10)>0)) - sched_info->UL_req = &mac->UL_req[CC_id]; - else - sched_info->UL_req = NULL; - - sched_info->TX_req = &mac->TX_req[CC_id]; - -#ifdef DUMP_FAPI - dump_dl(sched_info); -#endif - - if (ifi->schedule_response) - { - AssertFatal(ifi->schedule_response!=NULL, - "schedule_response is null (mod %d, cc %d)\n", - module_id, - CC_id); - ifi->schedule_response(sched_info); - } - - LOG_D(PHY,"Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu); - } - } -} - -IF_Module_t *IF_Module_init(int Mod_id){ - - AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES); - - LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n"); - - if (if_inst[Mod_id]==NULL) { - if_inst[Mod_id] = (IF_Module_t*)malloc(sizeof(IF_Module_t)); - memset((void*)if_inst[Mod_id],0,sizeof(IF_Module_t)); - - if_inst[Mod_id]->CC_mask=0; - if_inst[Mod_id]->UL_indication = UL_indication; - - AssertFatal(pthread_mutex_init(&if_inst[Mod_id]->if_mutex,NULL)==0, - "allocation of if_inst[%d]->if_mutex fails\n",Mod_id); - } - return if_inst[Mod_id]; -} - -void IF_Module_kill(int Mod_id) { - - AssertFatal(Mod_id>MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES); - if (if_inst[Mod_id]!=NULL) free(if_inst[Mod_id]); - -} diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c new file mode 100755 index 0000000000000000000000000000000000000000..d77759e3dfd7f5a81481898abfe2ef915524b9ef --- /dev/null +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -0,0 +1,117 @@ +/* + * 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 NR_IF_Module.c + * \brief functions for NR UE FAPI-like interface + * \author R. Knopp + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: knopp@eurecom.fr + * \note + * \warning + */ + +#include "NR_IF_Module.h" +#include "LAYER2/NR_MAC_UE/proto.h" + + + +#define MAX_IF_MODULES 100 + +static nr_ue_if_module_t *nr_ue_if_module_inst[MAX_IF_MODULES]; + + +int8_t handle_bcch_bch(uint32_t pdu_len, uint8_t *pduP){ + + // pdu_len = 4, 32bits + uint8_t extra_bits = pduP[3]; + nr_ue_decode_mib( (module_id_t)0, + 0, + 0, + extra_bits, + 0, // Lssb = 64 is not support + pduP, + 3 ); + + + + return 0; +} + +int8_t handle_bcch_dlsch(uint32_t pdu_len, uint8_t *pduP){ + + return 0; +} + +int8_t nr_ue_dl_indication(nr_downlink_indication_t *dl_info){ + + module_id_t module_id = dl_info->module_id; + NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); + + // clean up scheduled_response structure + + if(dl_info->rx_ind != NULL){ + switch(dl_info->rx_ind->rx_request_body.pdu_index){ + case FAPI_NR_RX_PDU_BCCH_BCH_TYPE: + handle_bcch_bch(dl_info->rx_ind->rx_request_body.pdu_length, dl_info->rx_ind->rx_request_body.pdu); + break; + case FAPI_NR_RX_PDU_BCCH_DLSCH_TYPE: + handle_bcch_dlsch(dl_info->rx_ind->rx_request_body.pdu_length, dl_info->rx_ind->rx_request_body.pdu); + break; + default: + break; + + } + } + + if(dl_info->dci_ind != NULL){ + + } + + if(nr_ue_if_module_inst[module_id] != NULL){ + nr_ue_if_module_inst[module_id]->scheduled_response(&mac->scheduled_response); + } + + + return 0; +} + +nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id){ + + if (nr_ue_if_module_inst[module_id] == NULL) { + nr_ue_if_module_inst[module_id] = (nr_ue_if_module_t*)malloc(sizeof(nr_ue_if_module_t)); + memset((void*)nr_ue_if_module_inst[module_id],0,sizeof(nr_ue_if_module_t)); + + nr_ue_if_module_inst[module_id]->CC_mask=0; + nr_ue_if_module_register_dl_indication(module_id, nr_ue_dl_indication); + } + + return nr_ue_if_module_inst[module_id]; +} + +int8_t nr_ue_if_module_kill(uint32_t module_id) { + + if (nr_ue_if_module_inst[module_id] != NULL){ + free(nr_ue_if_module_inst[module_id]); + } + return 0; +} diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h new file mode 100755 index 0000000000000000000000000000000000000000..f407428ee6a7ff50351e54e178158e9e317c0055 --- /dev/null +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -0,0 +1,170 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file openair2/PHY_INTERFACE/IF_Module.h +* \brief data structures for PHY/MAC interface modules +* \author EURECOM/NTUST +* \date 2018 +* \version 0.1 +* \company Eurecom +* \email: raymond.knopp@eurecom.fr +* \note +* \warning +*/ +#ifndef __NR_IF_MODULE_H__ +#define __NR_IF_MODULE_H__ + +#include "platform_types.h" +#include "fapi_nr_ue_interface.h" + +typedef struct { + /// module id + module_id_t module_id; + /// component carrier id + int CC_id; + /// frame + frame_t frame; + /// subframe + sub_frame_t subframe; + /// slot + uint8_t slot; + + /// NR UE FAPI-like P7 message, direction: L1 to L2 + /// data reception indication structure + fapi_nr_rx_indication_t *rx_ind; + + /// dci reception indication structure + fapi_nr_dci_indication_t *dci_ind; + +} nr_downlink_indication_t; + +// Downlink subframe P7 + + +typedef struct { + /// module id + module_id_t module_id; + /// component carrier id + uint8_t CC_id; + /// frame + frame_t frame; + /// subframe + sub_frame_t subframe; + /// slot + uint8_t slot; + + /// NR UE FAPI-like P7 message, direction: L2 to L1 + /// downlink transmission configuration request structure + fapi_nr_dl_config_request_t *dl_config; + + /// uplink transmission configuration request structure + fapi_nr_ul_config_request_t *ul_config; + + /// data transmission request structure + fapi_nr_tx_request_t *tx_request; + +} nr_scheduled_response_t; + +typedef struct { + /// module id + uint8_t Mod_id; + /// component carrier id + uint8_t CC_id; + + /// NR UE FAPI-like P5 message + /// physical layer configuration request structure + fapi_nr_config_request_t config_req; + +} nr_phy_config_t; + + +/* + * Generic type of an application-defined callback to return various + * types of data to the application. + * EXPECTED RETURN VALUES: + * -1: Failed to consume bytes. Abort the mission. + * Non-negative return values indicate success, and ignored. + */ +typedef int8_t(nr_ue_scheduled_response_f)(nr_scheduled_response_t *scheduled_response); + + +/* + * Generic type of an application-defined callback to return various + * types of data to the application. + * EXPECTED RETURN VALUES: + * -1: Failed to consume bytes. Abort the mission. + * Non-negative return values indicate success, and ignored. + */ +typedef int8_t(nr_ue_phy_config_request_f)(nr_phy_config_t *phy_config); + + +/* + * Generic type of an application-defined callback to return various + * types of data to the application. + * EXPECTED RETURN VALUES: + * -1: Failed to consume bytes. Abort the mission. + * Non-negative return values indicate success, and ignored. + */ +typedef int8_t(nr_ue_dl_indication_f)(nr_downlink_indication_t *dl_info); + + +// TODO check this stuff can be reuse of need modification +typedef struct nr_ue_if_module_s { + nr_ue_scheduled_response_f *scheduled_response; + nr_ue_phy_config_request_f *phy_config_request; + nr_ue_dl_indication_f *dl_indication; + + uint32_t CC_mask; + uint16_t current_frame; + uint8_t current_subframe; + //pthread_mutex_t nr_if_mutex; +} nr_ue_if_module_t; + + +/**\brief reserved one of the interface(if) module instantce from pointer pool and done memory allocation by module_id. + \param module_id module id*/ +nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id); + + +/**\brief done free of memory allocation by module_id and release to pointer pool. + \param module_id module id*/ +int8_t nr_ue_if_module_kill(uint32_t module_id); + + +/**\brief interface between L1/L2, indicating the downlink related information, like dci_ind and rx_req + \param dl_info including dci_ind and rx_request messages*/ +int8_t nr_ue_dl_indication(nr_downlink_indication_t *dl_info); + + +/**\brief handle BCCH-BCH message from dl_indication + \param pdu_len length(bytes) of pdu + \param pduP pointer to pdu*/ +int8_t handle_bcch_bch(uint32_t pdu_len, uint8_t *pduP); + + +/**\brief handle BCCH-DL-SCH message from dl_indication + \param pdu_len length(bytes) of pdu + \param pduP pointer to pdu*/ +int8_t handle_bcch_dlsch(uint32_t pdu_len, uint8_t *pduP); + + +#endif + diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 30efe3c8e8e9b698278da5dc47d51b67bdaf9d63..0cdbe96e86ab3ebf9eff91629d00eb332eaf5e32 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -94,6 +94,8 @@ #include "SIMULATION/TOOLS/sim.h" // for taus +#include "PHY/LTE_TRANSPORT/transport_proto.h" + //#define XER_PRINT extern RAN_CONTEXT_t RC; @@ -5282,6 +5284,7 @@ openair_rrc_eNB_init( RC.rrc[ctxt.module_id]->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL); RC.rrc[ctxt.module_id]->s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL); + memcpy(&RC.rrc[ctxt.module_id]->configuration,configuration,sizeof(RrcConfigurationReq)); /// System Information INIT LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" Checking release \n", @@ -5334,6 +5337,7 @@ openair_rrc_eNB_init( for (int ue_id = 0; ue_id < NUMBER_OF_UE_MAX; ue_id++) { RC.rrc[ctxt.module_id]->carrier[CC_id].sizeof_paging[ue_id] = 0; RC.rrc[ctxt.module_id]->carrier[CC_id].paging[ue_id] = (uint8_t *) malloc16(256); + } } rrc_init_global_param(); diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index 5215d6fcd5d8419fd089cca6be183caffda38f2f..2063a6d38e535d9c5c6dcfc09e3f200243fd2265 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -1900,6 +1900,7 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance } break; + } } diff --git a/openair2/RRC/NR/L2_interface_NR.c b/openair2/RRC/NR/L2_interface_NR.c deleted file mode 100644 index 91834d9c9d64f4742cec1cd2b9d538a8ca9b8065..0000000000000000000000000000000000000000 --- a/openair2/RRC/NR/L2_interface_NR.c +++ /dev/null @@ -1,519 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file l2_interface.c - * \brief layer 2 interface, used to support different RRC sublayer - * \author Raymond Knopp and Navid Nikaein - * \date 2010-2014 - * \version 1.0 - * \company Eurecom - * \email: raymond.knopp@eurecom.fr - */ - -#include "platform_types.h" -//#include "openair_defs.h" -//#include "openair_proto.h" -#include "defs.h" -#include "extern.h" -//#include "mac_lchan_interface.h" -//#include "openair_rrc_utils.h" -//#include "openair_rrc_main.h" -#include "UTIL/LOG/log.h" -#include "rrc_eNB_UE_context.h" -#include "pdcp.h" -#include "msc.h" -#include "common/ran_context.h" - -#ifdef PHY_EMUL -#include "SIMULATION/simulation_defs.h" -extern EMULATION_VARS *Emul_vars; -extern eNB_MAC_INST *eNB_mac_inst; -extern UE_MAC_INST *UE_mac_inst; -#endif - -#if defined(ENABLE_ITTI) -# include "intertask_interface.h" -#endif - -#include "flexran_agent_extern.h" - -//#define RRC_DATA_REQ_DEBUG -//#define DEBUG_RRC 1 - - -extern RAN_CONTEXT_t RC; - -//------------------------------------------------------------------------------ -int8_t -mac_rrc_data_req( - const module_id_t Mod_idP, - const int CC_id, - const frame_t frameP, - const rb_id_t Srb_id, - const uint8_t Nb_tb, - uint8_t* const buffer_pP, - const uint8_t mbsfn_sync_area -) -//-------------------------------------------------------------------------- -{ - asn_enc_rval_t enc_rval; - SRB_INFO *Srb_info; - uint8_t Sdu_size = 0; - uint8_t sfn = (uint8_t)((frameP>>2)&0xff); - - -#ifdef DEBUG_RRC - int i; - LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id); -#endif - - eNB_RRC_INST *rrc; - rrc_eNB_carrier_data_t *carrier; - BCCH_BCH_Message_t *mib; - - - rrc = RC.rrc[Mod_idP]; - carrier = &rrc->carrier[0]; - mib = &carrier->mib; - - if((Srb_id & RAB_OFFSET) == BCCH) { - if(RC.rrc[Mod_idP]->carrier[CC_id].SI.Active==0) { - return 0; - } - - // All even frames transmit SIB in SF 5 - AssertFatal(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1 != 255, - "[eNB %d] MAC Request for SIB1 and SIB1 not initialized\n",Mod_idP); - - if ((frameP%2) == 0) { - memcpy(&buffer_pP[0], - RC.rrc[Mod_idP]->carrier[CC_id].SIB1, - RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1); - -#if 0 //defined(ENABLE_ITTI) - { - MessageDef *message_p; - int sib1_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1; - int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu); - - if (sib1_size > sdu_size) { - LOG_E(RRC, "SIB1 SDU larger than BCCH SDU buffer size (%d, %d)", sib1_size, sdu_size); - sib1_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_BCCH_DATA_REQ); - RRC_MAC_BCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib1_size; - memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE); - memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, - RC.rrc[Mod_idP]->carrier[CC_id].SIB1, - sib1_size); - RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - -#ifdef DEBUG_RRC - LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 1\n",Mod_idP,frameP); - - for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1; i++) { - LOG_T(RRC,"%x.",buffer_pP[i]); - } - - LOG_T(RRC,"\n"); -#endif - - return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1); - } // All RFN mod 8 transmit SIB2-3 in SF 5 - else if ((frameP%8) == 1) { - memcpy(&buffer_pP[0], - RC.rrc[Mod_idP]->carrier[CC_id].SIB23, - RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23); - -#if 0 //defined(ENABLE_ITTI) - { - MessageDef *message_p; - int sib23_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23; - int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu); - - if (sib23_size > sdu_size) { - LOG_E(RRC, "SIB23 SDU larger than BCCH SDU buffer size (%d, %d)", sib23_size, sdu_size); - sib23_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_BCCH_DATA_REQ); - RRC_MAC_BCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib23_size; - memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE); - memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, - RC.rrc[Mod_idP]->carrier[CC_id].SIB23, - sib23_size); - RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - -#ifdef DEBUG_RRC - LOG_T(RRC,"[eNB %d] Frame %d BCCH request => SIB 2-3\n",Mod_idP,frameP); - - for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23; i++) { - LOG_T(RRC,"%x.",buffer_pP[i]); - } - - LOG_T(RRC,"\n"); -#endif - return(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23); - } else { - return(0); - } - } - if( (Srb_id & RAB_OFFSET ) == MIBCH) { - - mib->message.systemFrameNumber.buf = &sfn; - enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message, - (void*)mib, - carrier->MIB, - 24); - LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded); - buffer_pP[0]=carrier->MIB[0]; - buffer_pP[1]=carrier->MIB[1]; - buffer_pP[2]=carrier->MIB[2]; - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - return(3); - } - - if( (Srb_id & RAB_OFFSET ) == CCCH) { - LOG_T(RRC,"[eNB %d] Frame %d CCCH request (Srb_id %d)\n",Mod_idP,frameP, Srb_id); - - if(RC.rrc[Mod_idP]->carrier[CC_id].Srb0.Active==0) { - LOG_E(RRC,"[eNB %d] CCCH Not active\n",Mod_idP); - return -1; - } - - Srb_info=&RC.rrc[Mod_idP]->carrier[CC_id].Srb0; - - // check if data is there for MAC - if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer - LOG_D(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload); - -#if 0 // defined(ENABLE_ITTI) - { - MessageDef *message_p; - int ccch_size = Srb_info->Tx_buffer.payload_size; - int sdu_size = sizeof(RRC_MAC_CCCH_DATA_REQ (message_p).sdu); - - if (ccch_size > sdu_size) { - LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", ccch_size, sdu_size); - ccch_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_CCCH_DATA_REQ); - RRC_MAC_CCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_CCCH_DATA_REQ (message_p).sdu_size = ccch_size; - memset (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, 0, CCCH_SDU_SIZE); - memcpy (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, Srb_info->Tx_buffer.Payload, ccch_size); - RRC_MAC_CCCH_DATA_REQ (message_p).enb_index = eNB_index; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - - memcpy(buffer_pP,Srb_info->Tx_buffer.Payload,Srb_info->Tx_buffer.payload_size); - Sdu_size = Srb_info->Tx_buffer.payload_size; - Srb_info->Tx_buffer.payload_size=0; - } - - return (Sdu_size); - } - - if( (Srb_id & RAB_OFFSET ) == PCCH) { - LOG_T(RRC,"[eNB %d] Frame %d PCCH request (Srb_id %d)\n",Mod_idP,frameP, Srb_id); - - // check if data is there for MAC - if(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] > 0) { //Fill buffer - LOG_D(RRC,"[eNB %d] PCCH (%p) has %d bytes\n",Mod_idP,&RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], - RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]); - -#if 0 //defined(ENABLE_ITTI) - { - MessageDef *message_p; - int pcch_size = RC.rrc[Mod_idP]->arrier[CC_id].sizeof_paging[mbsfn_sync_area]; - int sdu_size = sizeof(RRC_MAC_PCCH_DATA_REQ (message_p).sdu); - - if (pcch_size > sdu_size) { - LOG_E(RRC, "SDU larger than PCCH SDU buffer size (%d, %d)", pcch_size, sdu_size); - pcch_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_PCCH_DATA_REQ); - RRC_MAC_PCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_PCCH_DATA_REQ (message_p).sdu_size = pcch_size; - memset (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, 0, PCCH_SDU_SIZE); - memcpy (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], pcch_size); - RRC_MAC_PCCH_DATA_REQ (message_p).enb_index = eNB_index; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - - memcpy(buffer_pP, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]); - Sdu_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]; - RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] = 0; - } - - return (Sdu_size); - } - -#if defined(Rel10) || defined(Rel14) - - if((Srb_id & RAB_OFFSET) == MCCH) { - if(RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESS[mbsfn_sync_area].Active==0) { - return 0; // this parameter is set in function init_mcch in rrc_eNB.c - } - - -#if 0 // defined(ENABLE_ITTI) - { - MessageDef *message_p; - int mcch_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; - int sdu_size = sizeof(RRC_MAC_MCCH_DATA_REQ (message_p).sdu); - - if (mcch_size > sdu_size) { - LOG_E(RRC, "SDU larger than MCCH SDU buffer size (%d, %d)", mcch_size, sdu_size); - mcch_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_MCCH_DATA_REQ); - RRC_MAC_MCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_MCCH_DATA_REQ (message_p).sdu_size = mcch_size; - memset (RRC_MAC_MCCH_DATA_REQ (message_p).sdu, 0, MCCH_SDU_SIZE); - memcpy (RRC_MAC_MCCH_DATA_REQ (message_p).sdu, - RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area], - mcch_size); - RRC_MAC_MCCH_DATA_REQ (message_p).enb_index = eNB_index; - RRC_MAC_MCCH_DATA_REQ (message_p).mbsfn_sync_area = mbsfn_sync_area; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - - memcpy(&buffer_pP[0], - RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area], - RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]); - -#ifdef DEBUG_RRC - LOG_D(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_idP,frameP); - - for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; i++) { - LOG_T(RRC,"%x.",buffer_pP[i]); - } - - LOG_T(RRC,"\n"); -#endif - - return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]); - // } - //else - //return(0); - } - -#endif //Rel10 || Rel14 - -#ifdef Rel14 - if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR){ - memcpy(&buffer_pP[0], - RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR, - RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR); - return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR); - } - - if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR){ // First SI message with SIB2/3 - memcpy(&buffer_pP[0], - RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR, - RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR); - return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR); - } - -#endif - - - return(0); -} - -//------------------------------------------------------------------------------ -int8_t -mac_rrc_data_ind( - const module_id_t module_idP, - const int CC_id, - const frame_t frameP, - const sub_frame_t sub_frameP, - const rnti_t rntiP, - const rb_id_t srb_idP, - const uint8_t* sduP, - const sdu_size_t sdu_lenP, - const uint8_t mbsfn_sync_areaP -) -//-------------------------------------------------------------------------- -{ - SRB_INFO *Srb_info; - protocol_ctxt_t ctxt; - sdu_size_t sdu_size = 0; - - /* for no gcc warnings */ - (void)sdu_size; - - /* - int si_window; - */ - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, rntiP, frameP, sub_frameP,0); - - Srb_info = &RC.rrc[module_idP]->carrier[CC_id].Srb0; - LOG_D(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id); - -#if 0 //defined(ENABLE_ITTI) - { - MessageDef *message_p; - int msg_sdu_size = sizeof(RRC_MAC_CCCH_DATA_IND (message_p).sdu); - - if (sdu_lenP > msg_sdu_size) { - LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", sdu_lenP, msg_sdu_size); - sdu_size = msg_sdu_size; - } else { - sdu_size = sdu_lenP; - } - - message_p = itti_alloc_new_message (TASK_MAC_ENB, RRC_MAC_CCCH_DATA_IND); - RRC_MAC_CCCH_DATA_IND (message_p).frame = frameP; - RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = sub_frameP; - RRC_MAC_CCCH_DATA_IND (message_p).rnti = rntiP; - RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = sdu_size; - RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id; - memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE); - memcpy (RRC_MAC_CCCH_DATA_IND (message_p).sdu, sduP, sdu_size); - LOG_D(RRC,"[eNB %d] Sending message to RRC task\n",module_idP); - itti_send_msg_to_task (TASK_RRC_ENB, ctxt.instance, message_p); - } -#else - - // msg("\n******INST %d Srb_info %p, Srb_id=%d****\n\n",Mod_id,Srb_info,Srb_info->Srb_id); - if (sdu_lenP > 0) { - memcpy(Srb_info->Rx_buffer.Payload,sduP,sdu_lenP); - Srb_info->Rx_buffer.payload_size = sdu_lenP; - rrc_eNB_decode_ccch(&ctxt, Srb_info, CC_id); - } - -#endif - - return(0); - -} - -//------------------------------------------------------------------------------ -int -mac_eNB_get_rrc_status( - const module_id_t Mod_idP, - const rnti_t rntiP -) -//------------------------------------------------------------------------------ -{ - struct rrc_eNB_ue_context_s* ue_context_p = NULL; - ue_context_p = rrc_eNB_get_ue_context( - RC.rrc[Mod_idP], - rntiP); - - if (ue_context_p != NULL) { - return(ue_context_p->ue_context.Status); - } else { - return RRC_INACTIVE; - } -} - -void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, - const int CC_idP, - const frame_t frameP, - const sub_frame_t subframeP, - const rnti_t rntiP) -{ - struct rrc_eNB_ue_context_s* ue_context_p = NULL; - ue_context_p = rrc_eNB_get_ue_context( - RC.rrc[Mod_instP], - rntiP); - - if (ue_context_p != NULL) { - LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP); - if(ue_context_p->ue_context.ul_failure_timer == 0) - ue_context_p->ue_context.ul_failure_timer=1; - } - else { - LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP); - } - if (rrc_agent_registered[Mod_instP]) { - agent_rrc_xface[Mod_instP]->flexran_agent_notify_ue_state_change(Mod_instP, - rntiP, - PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED); - } -// rrc_mac_remove_ue(Mod_instP,rntiP); -} - -void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP, - const int CC_idP, - const frame_t frameP, - const sub_frame_t subframeP, - const rnti_t rntiP) -{ - struct rrc_eNB_ue_context_s* ue_context_p = NULL; - ue_context_p = rrc_eNB_get_ue_context( - RC.rrc[Mod_instP], - rntiP); - if (ue_context_p != NULL) { - LOG_I(RRC,"Frame %d, Subframe %d: UE %x U-Plane failure, activating timer\n",frameP,subframeP,rntiP); - - if(ue_context_p->ue_context.ul_failure_timer == 0) - ue_context_p->ue_context.ul_failure_timer=19999; - } - else { - LOG_W(RRC,"Frame %d, Subframe %d: U-Plane failure: UE %x unknown \n",frameP,subframeP,rntiP); - } -} - -void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, - const int CC_idP, - const frame_t frameP, - const sub_frame_t subframeP, - const rnti_t rntiP) -{ - struct rrc_eNB_ue_context_s* ue_context_p = NULL; - ue_context_p = rrc_eNB_get_ue_context( - RC.rrc[Mod_instP], - rntiP); - - if (ue_context_p != NULL) { - LOG_I(RRC,"Frame %d, Subframe %d: UE %x to UL in synch\n", - frameP, subframeP, rntiP); - ue_context_p->ue_context.ul_failure_timer = 0; - } else { - LOG_E(RRC,"Frame %d, Subframe %d: UE %x unknown \n", - frameP, subframeP, rntiP); - } -} diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c new file mode 100644 index 0000000000000000000000000000000000000000..f87b016d847c391a6af8a263f72f34b8f09070e6 --- /dev/null +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -0,0 +1,62 @@ +#include "platform_types.h" +#include "rrc_defs.h" +#include "rrc_extern.h" +#include "UTIL/LOG/log.h" +#include "pdcp.h" +#include "msc.h" +#include "common/ran_context.h" + +#if defined(ENABLE_ITTI) +# include "intertask_interface.h" +#endif + +extern RAN_CONTEXT_t RC; + +int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP, + const int CC_id, + const frame_t frameP, + const rb_id_t Srb_id, + const uint8_t Nb_tb, + uint8_t *const buffer_pP ){ + + asn_enc_rval_t enc_rval; + SRB_INFO *Srb_info; + uint8_t Sdu_size = 0; + uint8_t sfn = (uint8_t)((frameP>>2)&0xff); + +#ifdef DEBUG_RRC + int i; + LOG_I(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id); +#endif + + gNB_RRC_INST *rrc; + rrc_gNB_carrier_data_t *carrier; + NR_BCCH_BCH_Message_t *mib; + + rrc = RC.nrrrc[Mod_idP]; + carrier = &rrc->carrier[0]; + mib = &carrier->mib; + + if( (Srb_id & RAB_OFFSET ) == MIBCH) { + mib->message.choice.mib->systemFrameNumber.buf = &sfn; + enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_BCH_Message, + NULL, + (void *)mib, + carrier->MIB, + 24); + LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded); + buffer_pP[0]=carrier->MIB[0]; + buffer_pP[1]=carrier->MIB[1]; + buffer_pP[2]=carrier->MIB[2]; + AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", + enc_rval.failed_type->name, enc_rval.encoded); + return(3); + } + +//BCCH SIB1 SIBs + +//CCCH + + return(0); + +} \ No newline at end of file diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 58440134628ab9faf1159c60977f1f913e039184..2e795a72dbc9c6783bfe401044779f901e9e894e 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -28,7 +28,6 @@ * \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr */ -#ifdef USER_MODE #include <stdio.h> #include <sys/types.h> #include <stdlib.h> /* for atoi(3) */ @@ -36,52 +35,46 @@ #include <string.h> /* for strerror(3) */ #include <sysexits.h> /* for EX_* exit codes */ #include <errno.h> /* for errno */ -#else -#include <linux/module.h> /* Needed by all modules */ -#endif -#ifdef USER_MODE -//#include "RRC/LITE/defs.h" -//#include "COMMON/mac_rrc_primitives.h" #include "UTIL/LOG/log.h" -#endif #include <asn_application.h> #include <asn_internal.h> /* for _ASN_DEFAULT_STACK_MAX */ #include <per_encoder.h> -#include "RRC/NR/defs_NR.h" -//#include "RRC/LITE/extern.h" +#include "asn1_msg.h" +#include "RRC/NR/nr_rrc_defs.h" +#include "RRC/NR/nr_rrc_extern.h" -#if defined(Rel15) +#if defined(NR_Rel15) #include "assertions.h" //#include "RRCConnectionRequest.h" //#include "UL-CCCH-Message.h" -#include "UL-DCCH-Message.h" +#include "NR_UL-DCCH-Message.h" //#include "DL-CCCH-Message.h" -#include "DL-DCCH-Message.h" +#include "NR_DL-DCCH-Message.h" //#include "EstablishmentCause.h" //#include "RRCConnectionSetup.h" -#include "SRB-ToAddModList.h" -#include "DRB-ToAddModList.h" +#include "NR_SRB-ToAddModList.h" +#include "NR_DRB-ToAddModList.h" //#include "MCCH-Message.h" //#define MRB1 1 //#include "RRCConnectionSetupComplete.h" //#include "RRCConnectionReconfigurationComplete.h" //#include "RRCConnectionReconfiguration.h" -#include "MIB.h" +#include "NR_MIB.h" //#include "SystemInformation.h" -#include "SIB1.h" -#include "ServingCellConfigCommon.h" +#include "NR_SIB1.h" +#include "NR_ServingCellConfigCommon.h" //#include "SIB-Type.h" //#include "BCCH-DL-SCH-Message.h" //#include "PHY/defs.h" -#include "MeasObjectToAddModList.h" -#include "ReportConfigToAddModList.h" -#include "MeasIdToAddModList.h" +#include "NR_MeasObjectToAddModList.h" +#include "NR_ReportConfigToAddModList.h" +#include "NR_MeasIdToAddModList.h" #include "gnb_config.h" #endif @@ -92,7 +85,7 @@ #include "common/ran_context.h" //#include "PHY/defs.h" -#ifndef USER_MODE +/*#ifndef USER_MODE #define msg printk #ifndef errno int errno; @@ -101,7 +94,7 @@ int errno; # if !defined (msg) # define msg printf # endif -#endif +#endif*/ //#define XER_PRINT @@ -118,8 +111,8 @@ extern uint8_t usim_test; extern RAN_CONTEXT_t RC; -uint16_t two_tier_hexagonal_cellIds[7] = {0,1,2,4,5,7,8}; -uint16_t two_tier_hexagonal_adjacent_cellIds[7][6] = {{1,2,4,5,7,8}, // CellId 0 +uint16_t two_tier_hexagonal_nr_cellIds[7] = {0,1,2,4,5,7,8}; +uint16_t two_tier_hexagonal_adjacent_nr_cellIds[7][6] = {{1,2,4,5,7,8}, // CellId 0 {11,18,2,0,8,15}, // CellId 1 {18,13,3,4,0,1}, // CellId 2 {2,3,14,6,5,0}, // CellId 4 @@ -132,7 +125,7 @@ uint16_t two_tier_hexagonal_adjacent_cellIds[7][6] = {{1,2,4,5,7,8}, // CellI * This is a helper function for xer_sprint, which directs all incoming data * into the provided string. */ -static int xer__print2s_NR (const void *buffer, size_t size, void *app_key) +static int xer__nr_print2s (const void *buffer, size_t size, void *app_key) { xer_sprint_string_t *string_buffer = (xer_sprint_string_t *) app_key; size_t string_remaining = string_buffer->string_size - string_buffer->string_index; @@ -149,7 +142,7 @@ static int xer__print2s_NR (const void *buffer, size_t size, void *app_key) return 0; } -int xer_sprint_NR (char *string, size_t string_size, asn_TYPE_descriptor_t *td, void *sptr) +int xer_nr_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td, void *sptr) { asn_enc_rval_t er; xer_sprint_string_t string_buffer; @@ -158,7 +151,7 @@ int xer_sprint_NR (char *string, size_t string_size, asn_TYPE_descriptor_t *td, string_buffer.string_size = string_size; string_buffer.string_index = 0; - er = xer_encode(td, sptr, XER_F_BASIC, xer__print2s, &string_buffer); + er = xer_encode(td, sptr, XER_F_BASIC, xer__nr_print2s, &string_buffer); if (er.encoded < 0) { LOG_E(RRC, "xer_sprint encoding error (%zd)!", er.encoded); @@ -175,7 +168,7 @@ int xer_sprint_NR (char *string, size_t string_size, asn_TYPE_descriptor_t *td, uint16_t get_adjacent_cell_id_NR(uint8_t Mod_id,uint8_t index) { - return(two_tier_hexagonal_adjacent_cellIds[Mod_id][index]); + return(two_tier_hexagonal_adjacent_nr_cellIds[Mod_id][index]); } /* This only works for the hexagonal topology...need a more general function for other topologies */ @@ -184,7 +177,7 @@ uint8_t get_adjacent_cell_mod_id_NR(uint16_t phyCellId) uint8_t i; for(i=0; i<7; i++) { - if(two_tier_hexagonal_cellIds[i] == phyCellId) { + if(two_tier_hexagonal_nr_cellIds[i] == phyCellId) { return i; } } @@ -205,41 +198,43 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier, asn_enc_rval_t enc_rval; - BCCH_BCH_Message_t *mib=&carrier->mib - memset(mib,0,sizeof(BCCH_BCH_Message_t)); - mib->message.present = BCCH_BCH_MessageType_PR_mib; + NR_BCCH_BCH_Message_t *mib = &carrier->mib; + memset(mib,0,sizeof(NR_BCCH_BCH_Message_t)); + mib->message.present = NR_BCCH_BCH_MessageType_PR_mib; + mib->message.choice.mib = CALLOC(1,sizeof(struct NR_MIB)); + memset(mib->message.choice.mib,0,sizeof(struct NR_MIB)); //36.331 SFN BIT STRING (SIZE (8) , 38.331 SFN BIT STRING (SIZE (6)) - uint8_t sfn = (uint8_t)((frame>>4)&0x3f); - mib->message.choice.mib.systemFrameNumber.buf = &sfn; - mib->message.choice.mib.systemFrameNumber.size = 1; - mib->message.choice.mib.systemFrameNumber.bits_unused=0; + uint8_t sfn = (uint8_t)((frame>>2)&0x3f); + mib->message.choice.mib->systemFrameNumber.buf = &sfn; + mib->message.choice.mib->systemFrameNumber.size = 1; + mib->message.choice.mib->systemFrameNumber.bits_unused=0; //38.331 spare BIT STRING (SIZE (1)) - uint8_t *spare= calloc(1, sizeof(uint8_t)); + uint16_t *spare= calloc(1, sizeof(uint16_t)); if (spare == NULL) abort(); - mib->message.choice.mib.spare.buf = (uint8_t *)spare; - mib->message.choice.mib.spare.size = 1; - mib->message.choice.mib.spare.bits_unused = 7; // This makes a spare of 1 bits + mib->message.choice.mib->spare.buf = (uint8_t *)spare; + mib->message.choice.mib->spare.size = 1; + mib->message.choice.mib->spare.bits_unused = 7; // This makes a spare of 1 bits - mib->message.choice.mib.ssb_SubcarrierOffset = ssb_SubcarrierOffset; - mib->message.choice.mib.pdcch_ConfigSIB1 = pdcch_ConfigSIB1; + mib->message.choice.mib->ssb_SubcarrierOffset = ssb_SubcarrierOffset; + mib->message.choice.mib->pdcch_ConfigSIB1 = pdcch_ConfigSIB1; switch (subCarrierSpacingCommon) { case 15: - mib->message.choice.mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs15or60; + mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60; break; case 30: - mib->message.choice.mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs30or120; + mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs30or120; break; case 60: - mib->message.choice.mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs15or60; + mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60; break; case 120: - mib->message.choice.mib.subCarrierSpacingCommon = MIB__subCarrierSpacingCommon_scs30or120; + mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs30or120; break; default: @@ -248,11 +243,11 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier, switch (dmrs_TypeA_Position) { case 2: - mib->message.choice.mib.dmrs_TypeA_Position = MIB__dmrs_TypeA_Position_pos2; + mib->message.choice.mib->dmrs_TypeA_Position = NR_MIB__dmrs_TypeA_Position_pos2; break; case 3: - mib->message.choice.mib.dmrs_TypeA_Position = MIB__dmrs_TypeA_Position_pos3; + mib->message.choice.mib->dmrs_TypeA_Position = NR_MIB__dmrs_TypeA_Position_pos3; break; default: @@ -261,14 +256,15 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier, } // assign_enum - mib->message.choice.mib.cellBarred = MIB__cellBarred_notBarred; + mib->message.choice.mib->cellBarred = NR_MIB__cellBarred_notBarred; // assign_enum - mib->message.choice.mib.intraFreqReselection = MIB__intraFreqReselection_notAllowed; + mib->message.choice.mib->intraFreqReselection = NR_MIB__intraFreqReselection_notAllowed; //encode MIB to data - enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_BCH_Message, + NULL, (void*)mib, carrier->MIB, 24); @@ -283,218 +279,6 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier, return((enc_rval.encoded+7)/8); } -//------------------------------------------------------------------------------ - -uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, - int Mod_id, - int CC_id - #if defined(ENABLE_ITTI) - , gNB_RrcConfigurationReq *configuration - #endif - ) -{ - - // SystemInformation_t systemInformation; - PLMN_IdentityInfo_t PLMN_identity_info; - MCC_MNC_Digit_t dummy_mcc[3],dummy_mnc[3]; - asn_enc_rval_t enc_rval; - SchedulingInfo_t schedulingInfo; - SIB_Type_t sib_type; - - uint8_t *buffer = carrier->SIB1; - BCCH_DL_SCH_Message_t *bcch_message = &carrier->siblock1; - SIB1_t **sib1 = &carrier->sib1; - - - memset(bcch_message,0,sizeof(BCCH_DL_SCH_Message_t)); - bcch_message->message.present = BCCH_DL_SCH_MessageType_PR_c1; - bcch_message->message.choice.c1.present = BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1; - // memcpy(&bcch_message.message.choice.c1.choice.systemInformationBlockType1,sib1,sizeof(SystemInformationBlockType1_t)); - - *sib1 = &bcch_message->message.choice.c1.choice.systemInformationBlockType1; - - memset(&PLMN_identity_info,0,sizeof(PLMN_IdentityInfo_t)); - memset(&schedulingInfo,0,sizeof(SchedulingInfo_t)); - memset(&sib_type,0,sizeof(SIB_Type_t)); - - - - PLMN_identity_info.plmn_Identity.mcc = CALLOC(1,sizeof(*PLMN_identity_info.plmn_Identity.mcc)); - memset(PLMN_identity_info.plmn_Identity.mcc,0,sizeof(*PLMN_identity_info.plmn_Identity.mcc)); - - asn_set_empty(&PLMN_identity_info.plmn_Identity.mcc->list);//.size=0; - -#if defined(ENABLE_ITTI) - dummy_mcc[0] = (configuration->mcc / 100) % 10; - dummy_mcc[1] = (configuration->mcc / 10) % 10; - dummy_mcc[2] = (configuration->mcc / 1) % 10; -#else - dummy_mcc[0] = 0; - dummy_mcc[1] = 0; - dummy_mcc[2] = 1; -#endif - ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mcc->list,&dummy_mcc[0]); - ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mcc->list,&dummy_mcc[1]); - ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mcc->list,&dummy_mcc[2]); - - PLMN_identity_info.plmn_Identity.mnc.list.size=0; - PLMN_identity_info.plmn_Identity.mnc.list.count=0; -#if defined(ENABLE_ITTI) - - if (configuration->mnc >= 100) { - dummy_mnc[0] = (configuration->mnc / 100) % 10; - dummy_mnc[1] = (configuration->mnc / 10) % 10; - dummy_mnc[2] = (configuration->mnc / 1) % 10; - } else { - if (configuration->mnc_digit_length == 2) { - dummy_mnc[0] = (configuration->mnc / 10) % 10; - dummy_mnc[1] = (configuration->mnc / 1) % 10; - dummy_mnc[2] = 0xf; - } else { - dummy_mnc[0] = (configuration->mnc / 100) % 100; - dummy_mnc[1] = (configuration->mnc / 10) % 10; - dummy_mnc[2] = (configuration->mnc / 1) % 10; - } - } - -#else - dummy_mnc[0] = 0; - dummy_mnc[1] = 1; - dummy_mnc[2] = 0xf; -#endif - ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mnc.list,&dummy_mnc[0]); - ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mnc.list,&dummy_mnc[1]); - - if (dummy_mnc[2] != 0xf) { - ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mnc.list,&dummy_mnc[2]); - } - - //assign_enum(&PLMN_identity_info.cellReservedForOperatorUse,PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved); - PLMN_identity_info.cellReservedForOperatorUse=PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved; - - ASN_SEQUENCE_ADD(&(*sib1)->cellAccessRelatedInfo.plmn_IdentityList.list,&PLMN_identity_info); - - - // 16 bits - (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf = MALLOC(2); -#if defined(ENABLE_ITTI) - (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf[0] = (configuration->tac >> 8) & 0xff; - (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf[1] = (configuration->tac >> 0) & 0xff; -#else - (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf[0] = 0x00; - (*sib1)->cellAccessRelatedInfo.trackingAreaCode.buf[1] = 0x01; -#endif - (*sib1)->cellAccessRelatedInfo.trackingAreaCode.size=2; - (*sib1)->cellAccessRelatedInfo.trackingAreaCode.bits_unused=0; - - // 28 bits - (*sib1)->cellAccessRelatedInfo.cellIdentity.buf = MALLOC(8); -#if defined(ENABLE_ITTI) - (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[0] = (configuration->cell_identity >> 20) & 0xff; - (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[1] = (configuration->cell_identity >> 12) & 0xff; - (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[2] = (configuration->cell_identity >> 4) & 0xff; - (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[3] = (configuration->cell_identity << 4) & 0xf0; -#else - (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[0] = 0x00; - (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[1] = 0x00; - (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[2] = 0x00; - (*sib1)->cellAccessRelatedInfo.cellIdentity.buf[3] = 0x10; -#endif - (*sib1)->cellAccessRelatedInfo.cellIdentity.size=4; - (*sib1)->cellAccessRelatedInfo.cellIdentity.bits_unused=4; - - // assign_enum(&(*sib1)->cellAccessRelatedInfo.cellBarred,SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred); - (*sib1)->cellAccessRelatedInfo.cellBarred=SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred; - - // assign_enum(&(*sib1)->cellAccessRelatedInfo.intraFreqReselection,SystemInformationBlockType1__cellAccessRelatedInfo__intraFreqReselection_allowed); - (*sib1)->cellAccessRelatedInfo.intraFreqReselection=SystemInformationBlockType1__cellAccessRelatedInfo__intraFreqReselection_notAllowed; - (*sib1)->cellAccessRelatedInfo.csg_Indication=0; - - (*sib1)->cellSelectionInfo.q_RxLevMin=-65; - (*sib1)->cellSelectionInfo.q_RxLevMinOffset=NULL; - //(*sib1)->p_Max = CALLOC(1, sizeof(P_Max_t)); - //*((*sib1)->p_Max) = 23; - (*sib1)->freqBandIndicator = -#if defined(ENABLE_ITTI) - configuration->eutra_band[CC_id]; -#else - 7; -#endif - - schedulingInfo.si_Periodicity=SchedulingInfo__si_Periodicity_rf8; - - // This is for SIB2/3 - sib_type=SIB_Type_sibType3; - ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type); - ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo); - - // ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,NULL); - -#if defined(ENABLE_ITTI) - - if (configuration->frame_type[CC_id] == TDD) -#endif - { - (*sib1)->tdd_Config = CALLOC(1,sizeof(struct TDD_Config)); - - (*sib1)->tdd_Config->subframeAssignment = -#if defined(ENABLE_ITTI) - configuration->tdd_config[CC_id]; -#else - 3; -#endif - - (*sib1)->tdd_Config->specialSubframePatterns = -#if defined(ENABLE_ITTI) - configuration->tdd_config_s[CC_id]; -#else - 0; -#endif - } - - (*sib1)->si_WindowLength=SystemInformationBlockType1__si_WindowLength_ms20; - (*sib1)->systemInfoValueTag=0; - // (*sib1).nonCriticalExtension = calloc(1,sizeof(*(*sib1).nonCriticalExtension)); - -#ifdef XER_PRINT - xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message, (void*)bcch_message); -#endif - enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message, - (void*)bcch_message, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[10000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_BCCH_DL_SCH_Message, (void *)bcch_message)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_BCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_dl_bcch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_bcch.text, message_string, message_string_size); - itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"[eNB] SystemInformationBlockType1 Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); -#endif - - if (enc_rval.encoded==-1) { - return(-1); - } - - return((enc_rval.encoded+7)/8); -} - void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, int CC_id #if defined(ENABLE_ITTI) @@ -502,284 +286,145 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, #endif ) { - // ServingCellConfigCommon // - struct FrequencyInfoDL **frequencyinfordl = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->frequencyInfoDL; - BWP_DownlinkCommon_t **bwp_downlinkcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->initialDownlinkBWP; - UplinkConfigCommon_t **uplinkconfigcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->uplinkConfigCommon; - UplinkConfigCommon_t **supplementaryuplinkconfig = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->supplementaryUplinkConfig; - - /////RateMatchPatternLTE_CRS_t **lte_crs_tomatcharound = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->lte_CRS_ToMatchAround; - - struct ServingCellConfigCommon__rateMatchPatternToAddModList **ratematchpatterntoaddmodlist = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->rateMatchPatternToAddModList; - struct RateMatchPattern *ratematchpattern; - struct ServingCellConfigCommon__rateMatchPatternToReleaseList **ratematchpatterntoreleaselist = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->rateMatchPatternToReleaseList; - RateMatchPatternId_t *ratematchpatternid; - - struct TDD_UL_DL_ConfigCommon **tdd_ul_dl_configurationcommon; - struct TDD_UL_DL_ConfigCommon **tdd_ul_dl_configurationcommon2; - - // FrequencyInfoDL // - FreqBandIndicatorNR_t *dl_frequencyBandList; - struct SCS_SpecificCarrier *dl_scs_SpecificCarrierList; - // BWP_DownlinkCommon // - ControlResourceSet_t *bwp_dl_controlresourceset; - TCI_StateId_t *TCI_StateId; - SearchSpace_t *bwp_dl_searchspace; - struct PDSCH_TimeDomainResourceAllocation *bwp_dl_timedomainresourceallocation; - // UplinkConfigCommon // - FreqBandIndicatorNR_t *ul_frequencyBandList; - struct SCS_SpecificCarrier *ul_scs_SpecificCarrierList; - // PUSCH_ConfigCommon // - struct PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation; - + NR_ServingCellConfigCommon_t **servingcellconfigcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon; + + (*servingcellconfigcommon) = CALLOC(1,sizeof(NR_ServingCellConfigCommon_t)); + (*servingcellconfigcommon)->physCellId = CALLOC(1,sizeof(NR_PhysCellId_t)); + (*servingcellconfigcommon)->frequencyInfoDL = CALLOC(1,sizeof(struct NR_FrequencyInfoDL)); + (*servingcellconfigcommon)->initialDownlinkBWP = CALLOC(1,sizeof(struct NR_BWP_DownlinkCommon)); + (*servingcellconfigcommon)->uplinkConfigCommon = CALLOC(1,sizeof(struct NR_UplinkConfigCommon)); + //(*servingcellconfigcommon)->supplementaryUplinkConfig = CALLOC(1,sizeof(struct NR_UplinkConfigCommon)); + (*servingcellconfigcommon)->ssb_PositionsInBurst = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__ssb_PositionsInBurst)); + (*servingcellconfigcommon)->ssb_periodicityServingCell = CALLOC(1,sizeof(long)); + //(*servingcellconfigcommon)->lte_CRS_ToMatchAround = CALLOC(1,sizeof(struct NR_SetupRelease_RateMatchPatternLTE_CRS)); + (*servingcellconfigcommon)->rateMatchPatternToAddModList = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__rateMatchPatternToAddModList)); + (*servingcellconfigcommon)->rateMatchPatternToReleaseList = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__rateMatchPatternToReleaseList)); + (*servingcellconfigcommon)->subcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t)); + (*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon)); + //(*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon2 = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon); + //------------------------------------Start Fill ServingCellConfigCommon------------------------------------// - RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->physCellId = configuration->Nid_cell[CC_id]; - - (*ssb_positionsinburst)->present = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id]; - if((*ssb_positionsinburst)->present == ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap){ - (*ssb_positionsinburst)->choice.shortBitmap.buf = MALLOC(1); - (*ssb_positionsinburst)->choice.shortBitmap.size = 1; - (*ssb_positionsinburst)->choice.shortBitmap.bits_unused = 4; - (*ssb_positionsinburst)->choice.shortBitmap.buf[0] = 0x0f; - }else if((*ssb_positionsinburst)->present == ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap){ - (*ssb_positionsinburst)->choice.mediumBitmap.buf = MALLOC(1); - (*ssb_positionsinburst)->choice.mediumBitmap.size = 1; - (*ssb_positionsinburst)->choice.mediumBitmap.bits_unused = 0; - (*ssb_positionsinburst)->choice.mediumBitmap.buf[0] = 0xff; - }else if((*ssb_positionsinburst)->present == ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap){ - (*ssb_positionsinburst)->choice.longBitmap.buf = MALLOC(8); - (*ssb_positionsinburst)->choice.longBitmap.size = 8; - (*ssb_positionsinburst)->choice.longBitmap.bits_unused = 0; - (*ssb_positionsinburst)->choice.longBitmap.buf[0] = 0xff; - (*ssb_positionsinburst)->choice.longBitmap.buf[1] = 0xff; - (*ssb_positionsinburst)->choice.longBitmap.buf[2] = 0xff; - (*ssb_positionsinburst)->choice.longBitmap.buf[3] = 0xff; - (*ssb_positionsinburst)->choice.longBitmap.buf[4] = 0xff; - (*ssb_positionsinburst)->choice.longBitmap.buf[5] = 0xff; - (*ssb_positionsinburst)->choice.longBitmap.buf[6] = 0xff; - (*ssb_positionsinburst)->choice.longBitmap.buf[7] = 0xff; - } + //physCellId + *((*servingcellconfigcommon)->physCellId) = configuration->Nid_cell[CC_id]; - RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->ssb_periodicityServingCell = configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id]; - RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->dmrs_TypeA_Position = configuration->ServingCellConfigCommon_dmrs_TypeA_Position[CC_id]; + //frequencyInfoDL + (*servingcellconfigcommon)->frequencyInfoDL->absoluteFrequencySSB = configuration->absoluteFrequencySSB[CC_id]; + (*servingcellconfigcommon)->frequencyInfoDL->ssb_SubcarrierOffset = CALLOC(1,sizeof(long)); + *((*servingcellconfigcommon)->frequencyInfoDL->ssb_SubcarrierOffset) = configuration->ssb_SubcarrierOffset[CC_id]; - ratematchpattern = CALLOC(1,sizeof(struct RateMatchPattern)); - memset(&ratematchpattern,0,sizeof(struct RateMatchPattern)); - ratematchpattern->rateMatchPatternId = configuration->rateMatchPatternId[CC_id]; - ratematchpattern->patternType.present = configuration->RateMatchPattern_patternType[CC_id]; - if(ratematchpattern->patternType.present == RateMatchPattern__patternType_PR_bitmaps){ - - ratematchpattern->patternType.choice.bitmaps.resourceBlocks.buf = MALLOC(35); - ratematchpattern->patternType.choice.bitmaps.resourceBlocks.size = 35; - ratematchpattern->patternType.choice.bitmaps.resourceBlocks.bits_unused = 5; - ratematchpattern->patternType.choice.bitmaps.resourceBlocks.buf[0] = 0x07; - for (int i =1;i<=34;i++ ){ - ratematchpattern->patternType.choice.bitmaps.resourceBlocks.buf[i] =0xff; - } - - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.present = configuration->symbolsInResourceBlock[CC_id]; - if(ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.present == RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_oneSlot){ - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.buf=MALLOC(2); - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.size=2; - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.bits_unused=2; - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.buf[0]=0x3f; - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.oneSlot.buf[1]=0xff; - }else if(ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.present == RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_twoSlots){ - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf=MALLOC(4); - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.size=4; - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.bits_unused=4; - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf[0]=0x0f; - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf[1]=0xff; - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf[2]=0xff; - ratematchpattern->patternType.choice.bitmaps.symbolsInResourceBlock.choice.twoSlots.buf[3]=0xff; - } - - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern = CALLOC(1,sizeof(struct RateMatchPattern__patternType__bitmaps__periodicityAndPattern)); - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present = configuration->periodicityAndPattern[CC_id]; - if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n2){ - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n2.buf = MALLOC(1); - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n2.size = 1; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n2.bits_unused = 6; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n2.buf[0] =0x03; - }else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n4){ - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n4.buf = MALLOC(1); - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n4.size = 1; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n4.bits_unused = 4; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n4.buf[0] = 0x0f; - }else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n5){ - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n5.buf = MALLOC(1); - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n5.size = 1; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n5.bits_unused = 3; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n5.buf[0] = 0x1f; - }else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n8){ - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n8.buf = MALLOC(1); - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n8.size = 1; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n8.bits_unused = 0; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n8.buf[0] = 0xff; - }else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n10){ - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.buf = MALLOC(2); - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.size = 2; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.bits_unused = 6; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.buf[0] = 0x03; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n10.buf[1] = 0xff; - }else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n20){ - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.buf = MALLOC(3); - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.size = 3; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.bits_unused = 4; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.buf[0] = 0x0f; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.buf[1] = 0xff; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n20.buf[2] = 0xff; - }else if(ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->present == RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n40){ - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf = MALLOC(5) - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.size = 5; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.bits_unused = 0; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[0] = 0xff; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[1] = 0xff; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[2] = 0xff; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[3] = 0xff; - ratematchpattern->patternType.choice.bitmaps.periodicityAndPattern->choice.n40.buf[4] = 0xff; - } - - }else if(ratematchpattern->patternType.present == RateMatchPattern__patternType_PR_controlResourceSet){ - ratematchpattern->patternType.choice.controlResourceSet = RateMatchPattern_controlResourceSet[CC_id]; - } - - ratematchpattern->subcarrierSpacing = CALLOC(1,sizeof(SubcarrierSpacing_t)); - ratematchpattern->subcarrierSpacing = configuration->RateMatchPattern_subcarrierSpacing[CC_id]; - ratematchpattern->mode = configuration->RateMatchPattern_mode[CC_id]; - - ASN_SEQUENCE_ADD(&(*ratematchpatterntoaddmodlist)->list,&ratematchpattern); + NR_FreqBandIndicatorNR_t *dl_frequencyBandList; + dl_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); + *(dl_frequencyBandList) = configuration->DL_FreqBandIndicatorNR[CC_id]; + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->frequencyInfoDL->frequencyBandList.list,&dl_frequencyBandList); - ratematchpatternid = CALLOC(1,sizeof(RateMatchPatternId_t)); - memset(&ratematchpatternid,0,sizeof(RateMatchPatternId_t)); - ratematchpatternid = configuration->rateMatchPatternId[CC_id]; - ASN_SEQUENCE_ADD(&(*ratematchpatterntoreleaselist)->list,&ratematchpatternid); - - RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->subcarrierSpacing = configuration->NIA_SubcarrierSpacing[CC_id]; - RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->ss_PBCH_BlockPower = configuration->ServingCellConfigCommon_ss_PBCH_BlockPower[CC_id]; - - //Fill FrequencyInfoDL // - (*frequencyinfordl)->absoluteFrequencySSB = configuration->absoluteFrequencySSB[CC_id]; - (*frequencyinfordl)->ssb_SubcarrierOffset = CALLOC(1,sizeof(long)); - (*frequencyinfordl)->ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset[CC_id]; - - dl_frequencyBandList = CALLOC(1,sizeof(FreqBandIndicatorNR_t)); - memset(&dl_frequencyBandList,0,sizeof(FreqBandIndicatorNR_t)); - dl_frequencyBandList = configuration->DL_FreqBandIndicatorNR[CC_id]; - ASN_SEQUENCE_ADD(&(*frequencyinfordl)->frequencyBandList.list,&dl_frequencyBandList); - - (*frequencyinfordl)->absoluteFrequencyPointA = configuration->DL_absoluteFrequencyPointA[CC_id]; + (*servingcellconfigcommon)->frequencyInfoDL->absoluteFrequencyPointA = configuration->DL_absoluteFrequencyPointA[CC_id]; - dl_scs_SpecificCarrierList = CALLOC(1,sizeof(struct SCS_SpecificCarrier)); - memset(&dl_scs_SpecificCarrierList,0,sizeof(struct SCS_SpecificCarrier)); + struct NR_SCS_SpecificCarrier *dl_scs_SpecificCarrierList; + dl_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); dl_scs_SpecificCarrierList->offsetToCarrier = configuration->DL_offsetToCarrier[CC_id]; dl_scs_SpecificCarrierList->subcarrierSpacing = configuration->DL_SCS_SubcarrierSpacing[CC_id]; dl_scs_SpecificCarrierList->k0 = configuration->DL_SCS_SpecificCarrier_k0[CC_id]; dl_scs_SpecificCarrierList->carrierBandwidth = configuration->DL_carrierBandwidth[CC_id]; - ASN_SEQUENCE_ADD(&(*frequencyinfordl)->scs_SpecificCarrierList.list,&dl_scs_SpecificCarrierList); + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->frequencyInfoDL->scs_SpecificCarrierList.list,&dl_scs_SpecificCarrierList); - //Fill BWP_DownlinkCommon -> genericParameters // - (*bwp_downlinkcommon)->genericParameters.locationAndBandwidth = configuration->DL_locationAndBandwidth[CC_id]; - (*bwp_downlinkcommon)->genericParameters.subcarrierSpacing = configuration->DL_BWP_SubcarrierSpacing[CC_id]; + //initialDownlinkBWP + //initialDownlinkBWP ----- genericParameters + (*servingcellconfigcommon)->initialDownlinkBWP->genericParameters.locationAndBandwidth = configuration->DL_locationAndBandwidth[CC_id]; + (*servingcellconfigcommon)->initialDownlinkBWP->genericParameters.subcarrierSpacing = configuration->DL_BWP_SubcarrierSpacing[CC_id]; if(configuration->DL_BWP_prefix_type[CC_id]){ - (*bwp_downlinkcommon)->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long)); - (*bwp_downlinkcommon)->genericParameters.cyclicPrefix = BWP__cyclicPrefix_extended; + (*servingcellconfigcommon)->initialDownlinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long)); + (*servingcellconfigcommon)->initialDownlinkBWP->genericParameters.cyclicPrefix = NR_BWP__cyclicPrefix_extended; } - //Fill BWP_DownlinkCommon -> pdcch_ConfigCommon // - (*bwp_downlinkcommon)->pdcch_ConfigCommon = CALLOC(1,sizeof(struct PDCCH_ConfigCommon)); - (*bwp_downlinkcommon)->pdcch_ConfigCommon->searchSpaceSIB1 = CALLOC(1,sizeof(SearchSpaceId_t)); - (*bwp_downlinkcommon)->pdcch_ConfigCommon->searchSpaceOtherSystemInformation = CALLOC(1,sizeof(SearchSpaceId_t)); - (*bwp_downlinkcommon)->pdcch_ConfigCommon->pagingSearchSpace = CALLOC(1,sizeof(SearchSpaceId_t)); - (*bwp_downlinkcommon)->pdcch_ConfigCommon->ra_SearchSpace = CALLOC(1,sizeof(SearchSpaceId_t)); - (*bwp_downlinkcommon)->pdcch_ConfigCommon->ra_ControlResourceSet = CALLOC(1,sizeof(ControlResourceSetId_t)); - - (*bwp_downlinkcommon)->pdcch_ConfigCommon->searchSpaceSIB1 = configuration->searchSpaceSIB1[CC_id]; - (*bwp_downlinkcommon)->pdcch_ConfigCommon->searchSpaceOtherSystemInformation = configuration->searchSpaceOtherSystemInformation[CC_id]; - (*bwp_downlinkcommon)->pdcch_ConfigCommon->pagingSearchSpace = configuration->pagingSearchSpace[CC_id]; - (*bwp_downlinkcommon)->pdcch_ConfigCommon->ra_SearchSpace = configuration->ra_SearchSpace[CC_id]; - (*bwp_downlinkcommon)->pdcch_ConfigCommon->ra_ControlResourceSet = configuration->rach_ra_ControlResourceSet[CC_id]; - - //Fill BWP_DownlinkCommon -> pdcch_ConfigCommon -> ControlResourceSet list // - (*bwp_downlinkcommon)->pdcch_ConfigCommon->commonControlResourcesSets = CALLOC(1,sizeof(struct PDCCH_ConfigCommon__commonControlResourcesSets)); - bwp_dl_controlresourceset = CALLOC(1,sizeof(ControlResourceSet_t)); - memset(&bwp_dl_controlresourceset,0,sizeof(ControlResourceSet_t)); + + //initialDownlinkBWP ----- pdcch_ConfigCommon + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PDCCH_ConfigCommon)); + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->present = NR_SetupRelease_PDCCH_ConfigCommon_PR_setup; + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon)); + + //Fill initialDownlinkBWP -> pdcch_ConfigCommon -> ControlResourceSet list // + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourcesSets = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonControlResourcesSets)); + + struct NR_ControlResourceSet *bwp_dl_controlresourceset; + bwp_dl_controlresourceset = CALLOC(1,sizeof(struct NR_ControlResourceSet)); bwp_dl_controlresourceset->controlResourceSetId = configuration->PDCCH_common_controlResourceSetId[CC_id]; //BIT STRING (SIZE (45)) - bwp_dl_controlresourceset->frequencyDomainResources.buf =MALLOC(6); - bwp_dl_controlresourceset->frequencyDomainResources.size = 6; + bwp_dl_controlresourceset->frequencyDomainResources.buf = MALLOC(6); + bwp_dl_controlresourceset->frequencyDomainResources.size = 6; bwp_dl_controlresourceset->frequencyDomainResources.bits_unused = 3; - bwp_dl_controlresourceset->frequencyDomainResources.buf[0] = 0x1f; - bwp_dl_controlresourceset->frequencyDomainResources.buf[1] = 0xff; - bwp_dl_controlresourceset->frequencyDomainResources.buf[2] = 0xff; - bwp_dl_controlresourceset->frequencyDomainResources.buf[3] = 0xff; - bwp_dl_controlresourceset->frequencyDomainResources.buf[4] = 0xff; - bwp_dl_controlresourceset->frequencyDomainResources.buf[5] = 0xff; - bwp_dl_controlresourceset->frequencyDomainResources.buf[6] = 0xff; + bwp_dl_controlresourceset->frequencyDomainResources.buf[0] = 0x1f; + bwp_dl_controlresourceset->frequencyDomainResources.buf[1] = 0xff; + bwp_dl_controlresourceset->frequencyDomainResources.buf[2] = 0xff; + bwp_dl_controlresourceset->frequencyDomainResources.buf[3] = 0xff; + bwp_dl_controlresourceset->frequencyDomainResources.buf[4] = 0xff; + bwp_dl_controlresourceset->frequencyDomainResources.buf[5] = 0xff; + bwp_dl_controlresourceset->frequencyDomainResources.buf[6] = 0xff; bwp_dl_controlresourceset->duration = configuration->PDCCH_common_ControlResourceSet_duration[CC_id]; bwp_dl_controlresourceset->cce_REG_MappingType.present = configuration->PDCCH_cce_REG_MappingType[CC_id]; - if(bwp_dl_controlresourceset->cce_REG_MappingType == ControlResourceSet__cce_REG_MappingType_PR_interleaved ){ - bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved.reg_BundleSize = configuration->PDCCH_reg_BundleSize[CC_id]; - bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved.interleaverSize = configuration->PDCCH_interleaverSize[CC_id]; - bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved.shiftIndex = configuration->PDCCH_shiftIndex[CC_id]; - }else if(bwp_dl_controlresourceset->cce_REG_MappingType == ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved){ - bwp_dl_controlresourceset->cce_REG_MappingType.choice.nonInterleaved = NULL; + if(bwp_dl_controlresourceset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved ){ + bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved = CALLOC(1,sizeof(struct NR_ControlResourceSet__cce_REG_MappingType__interleaved)); + bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved->reg_BundleSize = configuration->PDCCH_reg_BundleSize[CC_id]; + bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved->interleaverSize = configuration->PDCCH_interleaverSize[CC_id]; + bwp_dl_controlresourceset->cce_REG_MappingType.choice.interleaved->shiftIndex = configuration->PDCCH_shiftIndex[CC_id]; + }else if(bwp_dl_controlresourceset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_nonInterleaved){ + bwp_dl_controlresourceset->cce_REG_MappingType.choice.nonInterleaved = 0; } bwp_dl_controlresourceset->precoderGranularity = configuration->PDCCH_precoderGranularity[CC_id]; - bwp_dl_controlresourceset->tci_StatesPDCCH = CALLOC(1,sizeof(struct ControlResourceSet__tci_StatesPDCCH)); - TCI_StateId = CALLOC(1,sizeof(TCI_StateId_t)); - memset(&TCI_StateId,0,sizeof(TCI_StateId_t)); - TCI_StateId = configuration->PDCCH_TCI_StateId[CC_id]; + bwp_dl_controlresourceset->tci_StatesPDCCH = CALLOC(1,sizeof(struct NR_ControlResourceSet__tci_StatesPDCCH)); + NR_TCI_StateId_t *TCI_StateId; + TCI_StateId = CALLOC(1,sizeof(NR_TCI_StateId_t)); + *(TCI_StateId) = configuration->PDCCH_TCI_StateId[CC_id]; ASN_SEQUENCE_ADD(&bwp_dl_controlresourceset->tci_StatesPDCCH->list,&TCI_StateId); if(configuration->tci_PresentInDCI[CC_id]){ bwp_dl_controlresourceset->tci_PresentInDCI = CALLOC(1,sizeof(long)); - bwp_dl_controlresourceset->tci_PresentInDCI = ControlResourceSet__tci_PresentInDCI_enabled; + bwp_dl_controlresourceset->tci_PresentInDCI = NR_ControlResourceSet__tci_PresentInDCI_enabled; } - bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID = CALLOC(1,sizeof(pdcch_DMRS_ScramblingID)); + bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID = CALLOC(1,sizeof(BIT_STRING_t)); bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->buf = MALLOC(2); bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->size = 2; bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->bits_unused = 0; bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->buf[0] = 0xff; bwp_dl_controlresourceset->pdcch_DMRS_ScramblingID->buf[1] = 0xff; - ASN_SEQUENCE_ADD(&(*bwp_downlinkcommon)->pdcch_ConfigCommon->commonControlResourcesSets->list,&bwp_dl_controlresourceset); + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourcesSets->list,&bwp_dl_controlresourceset); - //Fill BWP_DownlinkCommon -> pdcch_ConfigCommon -> SearchSpace list // - (*bwp_downlinkcommon)->pdcch_ConfigCommon->commonSearchSpaces = CALLOC(1,sizeof(struct PDCCH_ConfigCommon__commonSearchSpaces)); - - bwp_dl_searchspace = CALLOC(1,sizeof(SearchSpace_t)); - memset(&bwp_dl_searchspace,0,sizeof(SearchSpace_t)); + //Fill initialDownlinkBWP -> pdcch_ConfigCommon -> SearchSpace list // + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaces = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpaces)); + + NR_SearchSpace_t *bwp_dl_searchspace; + bwp_dl_searchspace = CALLOC(1,sizeof(NR_SearchSpace_t)); bwp_dl_searchspace->searchSpaceId = configuration->SearchSpaceId[CC_id]; - bwp_dl_searchspace->controlResourceSetId = CALLOC(1,sizeof(ControlResourceSetId_t)); - bwp_dl_searchspace->controlResourceSetId = configuration->commonSearchSpaces_controlResourceSetId[CC_id]; + bwp_dl_searchspace->controlResourceSetId = CALLOC(1,sizeof(NR_ControlResourceSetId_t)); + *(bwp_dl_searchspace->controlResourceSetId) = configuration->commonSearchSpaces_controlResourceSetId[CC_id]; - bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset = CALLOC(1,sizeof(struct SearchSpace__monitoringSlotPeriodicityAndOffset)); + bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset = CALLOC(1,sizeof(struct NR_SearchSpace__monitoringSlotPeriodicityAndOffset)); bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_choice[CC_id]; - if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1){ + if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl1){ bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl1 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl1[CC_id]; - }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2){ + }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl2){ bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl2 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl2[CC_id]; - }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4){ + }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl4){ bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl4 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl4[CC_id]; - }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5){ + }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl5){ bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl5 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl5[CC_id]; - }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8){ + }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl8){ bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl8 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl8[CC_id]; - }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10){ + }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl10){ bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl10 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl10[CC_id]; - }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16){ + }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl16){ bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl16 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl16[CC_id]; - }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20){ + }else if(bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->present == NR_SearchSpace__monitoringSlotPeriodicityAndOffset_PR_sl20){ bwp_dl_searchspace->monitoringSlotPeriodicityAndOffset->choice.sl20 = configuration->SearchSpace_monitoringSlotPeriodicityAndOffset_sl20[CC_id]; } + bwp_dl_searchspace->monitoringSymbolsWithinSlot = CALLOC(1,sizeof(BIT_STRING_t)); bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf=MALLOC(2); bwp_dl_searchspace->monitoringSymbolsWithinSlot->size=2; @@ -787,2452 +432,386 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[0]=0x3f; bwp_dl_searchspace->monitoringSymbolsWithinSlot->buf[1]=0xff; - bwp_dl_searchspace->nrofCandidates = CALLOC(1,sizeof(struct SearchSpace__nrofCandidates)); + bwp_dl_searchspace->nrofCandidates = CALLOC(1,sizeof(struct NR_SearchSpace__nrofCandidates)); bwp_dl_searchspace->nrofCandidates->aggregationLevel1 = configuration->SearchSpace_nrofCandidates_aggregationLevel1[CC_id]; bwp_dl_searchspace->nrofCandidates->aggregationLevel2 = configuration->SearchSpace_nrofCandidates_aggregationLevel2[CC_id]; bwp_dl_searchspace->nrofCandidates->aggregationLevel4 = configuration->SearchSpace_nrofCandidates_aggregationLevel4[CC_id]; bwp_dl_searchspace->nrofCandidates->aggregationLevel8 = configuration->SearchSpace_nrofCandidates_aggregationLevel8[CC_id]; bwp_dl_searchspace->nrofCandidates->aggregationLevel16 = configuration->SearchSpace_nrofCandidates_aggregationLevel16[CC_id]; - bwp_dl_searchspace->searchSpaceType = CALLOC(1,sizeof(struct SearchSpace__searchSpaceType)); + bwp_dl_searchspace->searchSpaceType = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType)); bwp_dl_searchspace->searchSpaceType->present = configuration->SearchSpace_searchSpaceType[CC_id]; - if(bwp_dl_searchspace->searchSpaceType->present == SearchSpace__searchSpaceType_PR_common){ - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0 = CALLOC(1,sizeof(struct SearchSpace__searchSpaceType__common__dci_Format2_0)); - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel1 = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel2 = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel4 = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel8 = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel16 = CALLOC(1,sizeof(long)); - - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel1 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[CC_id]; - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel2 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[CC_id]; - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel4 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[CC_id]; - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel8 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[CC_id]; - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_0->nrofCandidates_SFI.aggregationLevel16 = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[CC_id]; + + if(bwp_dl_searchspace->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_common){ + bwp_dl_searchspace->searchSpaceType->choice.common = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0 = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common__dci_Format2_0)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel1 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel2 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel4 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel8 = CALLOC(1,sizeof(long)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel16 = CALLOC(1,sizeof(long)); + + *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel1) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[CC_id]; + *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel2) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[CC_id]; + *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel4) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[CC_id]; + *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel8) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[CC_id]; + *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel16) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[CC_id]; - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_3 = CALLOC(1,sizeof(struct struct SearchSpace__searchSpaceType__common__dci_Format2_3)); - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_3->monitoringPeriodicity = CALLOC(1,sizeof(long)); - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_3->monitoringPeriodicity = configuration->Common_dci_Format2_3_monitoringPeriodicity[CC_id]; - bwp_dl_searchspace->searchSpaceType->choice.common.dci_Format2_3->nrofPDCCH_Candidates = configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id]; + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3 = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common__dci_Format2_3)); + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->monitoringPeriodicity = CALLOC(1,sizeof(long)); + *(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->monitoringPeriodicity) = configuration->Common_dci_Format2_3_monitoringPeriodicity[CC_id]; + bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->nrofPDCCH_Candidates = configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id]; - }else if (bwp_dl_searchspace->searchSpaceType->present == SearchSpace__searchSpaceType_PR_ue_Specific){ - bwp_dl_searchspace->searchSpaceType->choice.ue_Specific.dci_Formats = configuration->dci_Formats[CC_id]; + }else if (bwp_dl_searchspace->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific){ + bwp_dl_searchspace->searchSpaceType->choice.ue_Specific = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__ue_Specific)); + bwp_dl_searchspace->searchSpaceType->choice.ue_Specific->dci_Formats = configuration->ue_Specific__dci_Formats[CC_id]; } - ASN_SEQUENCE_ADD(&(*bwp_downlinkcommon)->pdcch_ConfigCommon->commonSearchSpaces->list,&bwp_dl_searchspace); + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaces->list,&bwp_dl_searchspace); + + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = CALLOC(1,sizeof(NR_SearchSpaceId_t)); + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation = CALLOC(1,sizeof(NR_SearchSpaceId_t)); + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->pagingSearchSpace = CALLOC(1,sizeof(NR_SearchSpaceId_t)); + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->ra_SearchSpace = CALLOC(1,sizeof(NR_SearchSpaceId_t)); + (*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->ra_ControlResourceSet = CALLOC(1,sizeof(NR_ControlResourceSetId_t)); + + *((*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1) = configuration->searchSpaceSIB1[CC_id]; + *((*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation) = configuration->searchSpaceOtherSystemInformation[CC_id]; + *((*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->pagingSearchSpace) = configuration->pagingSearchSpace[CC_id]; + *((*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->ra_SearchSpace) = configuration->ra_SearchSpace[CC_id]; + *((*servingcellconfigcommon)->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->ra_ControlResourceSet) = configuration->rach_ra_ControlResourceSet[CC_id]; + + //initialDownlinkBWP ----- pdsch_ConfigCommon + + (*servingcellconfigcommon)->initialDownlinkBWP->pdsch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PDSCH_ConfigCommon)); + (*servingcellconfigcommon)->initialDownlinkBWP->pdsch_ConfigCommon->present = NR_SetupRelease_PDSCH_ConfigCommon_PR_setup; + (*servingcellconfigcommon)->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon)); + + (*servingcellconfigcommon)->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_AllocationList = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon__pdsch_AllocationList)); + + struct NR_PDSCH_TimeDomainResourceAllocation *bwp_dl_timedomainresourceallocation; + bwp_dl_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PDSCH_TimeDomainResourceAllocation)); + bwp_dl_timedomainresourceallocation->k0 = CALLOC(1,sizeof(long)); + *(bwp_dl_timedomainresourceallocation->k0) = configuration->PDSCH_TimeDomainResourceAllocation_k0[CC_id]; + bwp_dl_timedomainresourceallocation->mappingType = configuration->PDSCH_TimeDomainResourceAllocation_mappingType[CC_id]; + bwp_dl_timedomainresourceallocation->startSymbolAndLength.buf =MALLOC(1); + bwp_dl_timedomainresourceallocation->startSymbolAndLength.size =1; + bwp_dl_timedomainresourceallocation->startSymbolAndLength.bits_unused =1; + bwp_dl_timedomainresourceallocation->startSymbolAndLength.buf[0] =0x7f; + + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_AllocationList->list,&bwp_dl_timedomainresourceallocation); + + //uplinkConfigCommon + //uplinkConfigCommon frequencyInfoUL // + (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL = CALLOC(1,sizeof(struct NR_FrequencyInfoUL)); + (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct NR_MultiFrequencyBandListNR)); + + NR_FreqBandIndicatorNR_t *ul_frequencyBandList; + ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); + *(ul_frequencyBandList) = configuration->UL_FreqBandIndicatorNR[CC_id]; + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list,&ul_frequencyBandList); - //Fill BWP_DownlinkCommon -> pdsch_ConfigCommon // - (*bwp_downlinkcommon)->pdsch_ConfigCommon = CALLOC(1,sizeof(struct PDSCH_ConfigCommon)); - (*bwp_downlinkcommon)->pdsch_ConfigCommon->pdsch_AllocationList = CALLOC(1,sizeof(struct PDSCH_ConfigCommon__pdsch_AllocationList)); - bwp_dl_timedomainresourceallocation->k0 = CALLOC(1,sizeof(long)); + (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA = CALLOC(1,sizeof(NR_ARFCN_ValueNR_t)); + *((*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA) = configuration->UL_absoluteFrequencyPointA[CC_id]; - bwp_dl_timedomainresourceallocation->k0 = configuration->PDSCH_TimeDomainResourceAllocation_k0[CC_id]; - bwp_dl_timedomainresourceallocation->mappingType = configuration->PDSCH_TimeDomainResourceAllocation_mappingType[CC_id]; - bwp_dl_timedomainresourceallocation->startSymbolAndLength.buf=MALLOC(1); - bwp_dl_timedomainresourceallocation->startSymbolAndLength.size=1; - bwp_dl_timedomainresourceallocation->startSymbolAndLength.bits_unused=1; - bwp_dl_timedomainresourceallocation->startSymbolAndLength.buf[0]=0x7f; - - ASN_SEQUENCE_ADD(&(*bwp_downlinkcommon)->pdsch_ConfigCommon->pdsch_AllocationList->list,&bwp_dl_timedomainresourceallocation); - - //Fill UplinkConfigCommon // - //Fill UplinkConfigCommon -> FrequencyInfoUL // - (*uplinkconfigcommon)->frequencyInfoUL = CALLOC(1,sizeof(struct FrequencyInfoUL)); - (*uplinkconfigcommon)->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct MultiFrequencyBandListNR)); - - ul_frequencyBandList = CALLOC(1,sizeof(FreqBandIndicatorNR_t)); - memset(&ul_frequencyBandList,0,sizeof(FreqBandIndicatorNR_t)); - ul_frequencyBandList = configuration->UL_FreqBandIndicatorNR[CC_id]; - ASN_SEQUENCE_ADD(&(*uplinkconfigcommon)->frequencyInfoUL->frequencyBandList->list,&ul_frequencyBandList); - - (*uplinkconfigcommon)->frequencyInfoUL->absoluteFrequencyPointA = CALLOC(1,sizeof(ARFCN_ValueNR_t)); - (*uplinkconfigcommon)->frequencyInfoUL->absoluteFrequencyPointA = configuration->UL_absoluteFrequencyPointA[CC_id]; - - ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct SCS_SpecificCarrier)); - memset(&dl_scs_SpecificCarrierList,0,sizeof(struct SCS_SpecificCarrier)); + struct NR_SCS_SpecificCarrier *ul_scs_SpecificCarrierList; + ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); ul_scs_SpecificCarrierList->offsetToCarrier = configuration->UL_offsetToCarrier[CC_id]; ul_scs_SpecificCarrierList->subcarrierSpacing = configuration->UL_SCS_SubcarrierSpacing[CC_id]; ul_scs_SpecificCarrierList->k0 = configuration->UL_SCS_SpecificCarrier_k0[CC_id]; ul_scs_SpecificCarrierList->carrierBandwidth = configuration->UL_carrierBandwidth[CC_id]; - ASN_SEQUENCE_ADD(&(*uplinkconfigcommon)->frequencyInfoUL->scs_SpecificCarriers.list,&ul_scs_SpecificCarrierList); - - (*uplinkconfigcommon)->frequencyInfoUL->additionalSpectrumEmission = CALLOC(1,sizeof(AdditionalSpectrumEmission_t)); - (*uplinkconfigcommon)->frequencyInfoUL->p_Max = CALLOC(1,sizeof(P_Max_t)); - (*uplinkconfigcommon)->frequencyInfoUL->frequencyShift7p5khz = CALLOC(1,sizeof(long)); + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarriers.list,&ul_scs_SpecificCarrierList); - (*uplinkconfigcommon)->frequencyInfoUL->additionalSpectrumEmission = configuration->UL_additionalSpectrumEmission[CC_id]; - (*uplinkconfigcommon)->frequencyInfoUL->p_Max = configuration->UL_p_Max[CC_id]; - (*uplinkconfigcommon)->frequencyInfoUL->frequencyShift7p5khz = configuration->UL_frequencyShift7p5khz[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->additionalSpectrumEmission = CALLOC(1,sizeof(NR_AdditionalSpectrumEmission_t)); + (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->p_Max = CALLOC(1,sizeof(NR_P_Max_t)); + (*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyShift7p5khz = CALLOC(1,sizeof(long)); - //Fill UplinkConfigCommon -> BWP-UplinkCommon // - //Fill UplinkConfigCommon -> BWP-UplinkCommon -> genericParameters// - (*uplinkconfigcommon)->initialUplinkBWP->genericParameters.locationAndBandwidth = configuration->UL_locationAndBandwidth[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->genericParameters.subcarrierSpacing = configuration->UL_BWP_SubcarrierSpacing[CC_id]; + *((*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->additionalSpectrumEmission) = configuration->UL_additionalSpectrumEmission[CC_id]; + *((*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->p_Max) = configuration->UL_p_Max[CC_id]; + *((*servingcellconfigcommon)->uplinkConfigCommon->frequencyInfoUL->frequencyShift7p5khz) = configuration->UL_frequencyShift7p5khz[CC_id]; + + //uplinkConfigCommon initialUplinkBWP // + //Fill initialUplinkBWP -> BWP-UplinkCommon -> genericParameters// + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP = CALLOC(1,sizeof(struct NR_BWP_UplinkCommon)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth = configuration->UL_locationAndBandwidth[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing = configuration->UL_BWP_SubcarrierSpacing[CC_id]; if(configuration->UL_BWP_prefix_type[CC_id]){ - (*uplinkconfigcommon)->initialUplinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long)); - (*uplinkconfigcommon)->initialUplinkBWP->genericParameters.cyclicPrefix = BWP__cyclicPrefix_extended; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->genericParameters.cyclicPrefix = NR_BWP__cyclicPrefix_extended; } - //Fill UplinkConfigCommon -> BWP-UplinkCommon -> RACH_ConfigCommon// - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon = CALLOC(1,sizeof(RACH_ConfigCommon_t)); + //Fill initialUplinkBWP -> BWP-UplinkCommon -> rach_ConfigCommon// + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_RACH_ConfigCommon_t)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->present = NR_SetupRelease_RACH_ConfigCommon_PR_setup; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_RACH_ConfigCommon)); - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->totalNumberOfRA_Preambles = CALLOC(1,sizeof(long)); - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->totalNumberOfRA_Preambles = configuration->rach_totalNumberOfRA_Preambles[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles = CALLOC(1,sizeof(long)); + *((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles) = configuration->rach_totalNumberOfRA_Preambles[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB = CALLOC(1,sizeof(struct RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB)); - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB = CALLOC(1,sizeof(struct NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice[CC_id]; - if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[CC_id]; - }else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[CC_id]; - }else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[CC_id]; - }else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[CC_id]; - }else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[CC_id]; - }else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four[CC_id]; - }else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight[CC_id]; - }else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.sixteen = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen[CC_id]; + if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[CC_id]; + }else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[CC_id]; + }else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[CC_id]; + }else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[CC_id]; + }else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[CC_id]; + }else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four[CC_id]; + }else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight[CC_id]; + }else if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.sixteen = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen[CC_id]; } if(configuration->rach_groupBconfigured[CC_id]){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->groupBconfigured = CALLOC(1,sizeof(struct RACH_ConfigCommon__groupBconfigured)); - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA = configuration->numberOfRA_PreamblesGroupA[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->groupBconfigured->messagePowerOffsetGroupB = configuration->rach_messagePowerOffsetGroupB[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->groupBconfigured->numberOfRA_PreamblesGroupA = configuration->rach_numberOfRA_PreamblesGroupA[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured = CALLOC(1,sizeof(struct NR_RACH_ConfigCommon__groupBconfigured)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured->ra_Msg3SizeGroupA = configuration->rach_ra_Msg3SizeGroupA[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured->messagePowerOffsetGroupB = configuration->rach_messagePowerOffsetGroupB[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured->numberOfRA_PreamblesGroupA = configuration->rach_numberOfRA_PreamblesGroupA[CC_id]; } - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->ra_ContentionResolutionTimer = configuration->rach_ra_ContentionResolutionTimer[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer = configuration->rach_ra_ContentionResolutionTimer[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rsrp_ThresholdSSB = CALLOC(1,sizeof(RSRP_Range_t)); - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rsrp_ThresholdSSB_SUL = CALLOC(1,sizeof(RSRP_Range_t)); - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rsrp_ThresholdSSB = configuration->rsrp_ThresholdSSB[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rsrp_ThresholdSSB_SUL = configuration->rsrp_ThresholdSSB_SUL[CC_id]; - - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.present = configuration->prach_RootSequenceIndex_choice[CC_id]; - if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.present == RACH_ConfigCommon__prach_RootSequenceIndex_PR_l839){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.choice.l839 = configuration->prach_RootSequenceIndex_l839[CC_id]; - }else if ((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.present == RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->prach_RootSequenceIndex.choice.l139 = configuration->prach_RootSequenceIndex_l139[CC_id]; - } - - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->msg1_SubcarrierSpacing = configuration->prach_msg1_SubcarrierSpacing[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->restrictedSetConfig = configuration->restrictedSetConfig[CC_id]; - - if(configuration->msg3_transformPrecoding[CC_id]){ - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->msg3_transformPrecoding = CALLOC(1,sizeof(long)); - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->msg3_transformPrecoding = RACH_ConfigCommon__msg3_transformPrecoding_enabled; - } + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB = CALLOC(1,sizeof(NR_RSRP_Range_t)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB_SUL = CALLOC(1,sizeof(NR_RSRP_Range_t)); + *((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB) = configuration->rsrp_ThresholdSSB[CC_id]; + *((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB_SUL) = configuration->rsrp_ThresholdSSB_SUL[CC_id]; - //Fill UplinkConfigCommon -> BWP-UplinkCommon -> RACH_ConfigCommon -> RACH_ConfigGeneric_t// - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.prach_ConfigurationIndex = configuration->prach_ConfigurationIndex[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.msg1_FDM = configuration->prach_msg1_FDM[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.msg1_FrequencyStart = configuration->prach_msg1_FrequencyStart[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.zeroCorrelationZoneConfig = configuration->zeroCorrelationZoneConfig[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.preambleReceivedTargetPower = configuration->preambleReceivedTargetPower[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.preambleTransMax = configuration->preambleTransMax[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.powerRampingStep = configuration->powerRampingStep[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->rach_ConfigGeneric.ra_ResponseWindow = configuration->ra_ResponseWindow[CC_id]; - - //Fill UplinkConfigCommon -> BWP-UplinkCommon -> PUSCH_ConfigCommon// - (*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon = CALLOC(1,sizeof(PUSCH_ConfigCommon_t)); - - if(configuration->groupHoppingEnabledTransformPrecoding[CC_id]){ - (*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->groupHoppingEnabledTransformPrecoding = CALLOC(1,sizeof(long)); - (*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->groupHoppingEnabledTransformPrecoding = PUSCH_ConfigCommon__groupHoppingEnabledTransformPrecoding_enabled; - } - - (*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->pusch_AllocationList = CALLOC(1,sizeof(struct PUSCH_ConfigCommon__pusch_AllocationList)); - pusch_configcommontimedomainresourceallocation = CALLOC(1,sizeof(struct PUSCH_TimeDomainResourceAllocation)); - memset(&pusch_configcommontimedomainresourceallocation,0,sizeof(struct PUSCH_TimeDomainResourceAllocation)); - pusch_configcommontimedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); - - pusch_configcommontimedomainresourceallocation->k2 = configuration->PUSCH_TimeDomainResourceAllocation_k2[CC_id]; - pusch_configcommontimedomainresourceallocation->mappingType = configuration->PUSCH_TimeDomainResourceAllocation_mappingType[CC_id]; - pusch_configcommontimedomainresourceallocation->startSymbolAndLength.buf = MALLOC(1); - pusch_configcommontimedomainresourceallocation->startSymbolAndLength.size = 1; - pusch_configcommontimedomainresourceallocation->startSymbolAndLength.bits_unused = 1; - pusch_configcommontimedomainresourceallocation->startSymbolAndLength.buf[0] = 0x7f; - ASN_SEQUENCE_ADD(&(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->pusch_AllocationList->list,&pusch_configcommontimedomainresourceallocation); - - (*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->msg3_DeltaPreamble = CALLOC(1,sizeof(long)); - (*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->msg3_DeltaPreamble = configuration->msg3_DeltaPreamble[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->p0_NominalWithGrant = CALLOC(1,sizeof(long)); - (*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->p0_NominalWithGrant = configuration->p0_NominalWithGrant[CC_id]; - - //Fill UplinkConfigCommon -> BWP-UplinkCommon -> PUCCH_ConfigCommon// - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon = CALLOC(1,sizeof(PUCCH_ConfigCommon_t)); - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon = CALLOC(1,sizeof(BIT_STRING_t)); - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId = CALLOC(1,sizeof(BIT_STRING_t)); - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->p0_nominal = CALLOC(1,sizeof(long)); - - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_GroupHopping = configuration->pucch_GroupHopping[CC_id]; - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->p0_nominal = configuration->p0_nominal[CC_id]; - - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon->buf = MALLOC(1); - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon->size = 1; - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon->bits_unused = 4; - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->pucch_ResourceCommon->buf[0] = 0x0f; - - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->buf = MALLOC(2); - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->size = 2 - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->bits_unused = 6; - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->buf[0] = 0x03; - (*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->hoppingId->buf[1] = 0xff; - - - //Fill supplementaryUplinkConfig // - memcpy(&(*uplinkconfigcommon), &(*supplementaryuplinkconfig), sizeof(UplinkConfigCommon_t));//The Same structre - - //Fill TDD_UL_DL_ConfigCommon // - (*tdd_ul_dl_configurationcommon)->referenceSubcarrierSpacing = CALLOC(1,sizeof(SubcarrierSpacing_t)); - (*tdd_ul_dl_configurationcommon)->dl_UL_TransmissionPeriodicity = CALLOC(1,sizeof(long)); - (*tdd_ul_dl_configurationcommon)->nrofDownlinkSlots = CALLOC(1,sizeof(long)); - (*tdd_ul_dl_configurationcommon)->nrofDownlinkSymbols = CALLOC(1,sizeof(long)); - (*tdd_ul_dl_configurationcommon)->nrofUplinkSlots = CALLOC(1,sizeof(long)); - (*tdd_ul_dl_configurationcommon)->nrofUplinkSymbols = CALLOC(1,sizeof(long)); - - (*tdd_ul_dl_configurationcommon)->referenceSubcarrierSpacing = configuration->referenceSubcarrierSpacing[CC_id]; - (*tdd_ul_dl_configurationcommon)->dl_UL_TransmissionPeriodicity = configuration->dl_UL_TransmissionPeriodicity[CC_id]; - (*tdd_ul_dl_configurationcommon)->nrofDownlinkSlots = configuration->nrofDownlinkSlots[CC_id]; - (*tdd_ul_dl_configurationcommon)->nrofDownlinkSymbols = configuration->nrofDownlinkSymbols[CC_id]; - (*tdd_ul_dl_configurationcommon)->nrofUplinkSlots = configuration->nrofUplinkSlots[CC_id]; - (*tdd_ul_dl_configurationcommon)->nrofUplinkSymbols = configuration->nrofUplinkSymbols[CC_id]; - - memcpy(&(*tdd_ul_dl_configurationcommon), &(*tdd_ul_dl_configurationcommon2), sizeof(struct TDD_UL_DL_ConfigCommon));//The Same structre - - -} - - - -//------------------------------------------------------------------------------ -/* -uint8_t do_SIB23(uint8_t Mod_id, - - int CC_id -#if defined(ENABLE_ITTI) - , RrcConfigurationReq *configuration -#endif - ) -{ - struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib2_part,*sib3_part; -#if defined(Rel10) || defined(Rel14) - struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib13_part; - MBSFN_SubframeConfigList_t *MBSFNSubframeConfigList; - MBSFN_AreaInfoList_r9_t *MBSFNArea_list; - struct MBSFN_AreaInfo_r9 *MBSFN_Area1, *MBSFN_Area2; -#endif - asn_enc_rval_t enc_rval; - - uint8_t *buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23; - BCCH_DL_SCH_Message_t *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation; - SystemInformationBlockType2_t **sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2; - SystemInformationBlockType3_t **sib3 = &RC.rrc[Mod_id]->carrier[CC_id].sib3; -#if defined(Rel10) || defined(Rel14) - SystemInformationBlockType13_r9_t **sib13 = &RC.rrc[Mod_id]->carrier[CC_id].sib13; - uint8_t MBMS_flag = RC.rrc[Mod_id]->carrier[CC_id].MBMS_flag; -#endif - - if (bcch_message) { - memset(bcch_message,0,sizeof(BCCH_DL_SCH_Message_t)); - } else { - LOG_E(RRC,"[eNB %d] BCCH_MESSAGE is null, exiting\n", Mod_id); - exit(-1); - } - - if (!sib2) { - LOG_E(RRC,"[eNB %d] sib2 is null, exiting\n", Mod_id); - exit(-1); - } - - if (!sib3) { - LOG_E(RRC,"[eNB %d] sib3 is null, exiting\n", Mod_id); - exit(-1); - } - -#if defined(Rel10) || defined(Rel14) - LOG_I(RRC,"[eNB %d] Configuration SIB2/3, MBMS = %d\n", Mod_id, MBMS_flag); -#else - LOG_I(RRC,"[eNB %d] Configuration SIB2/3\n", Mod_id); -#endif - sib2_part = CALLOC(1,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member)); - sib3_part = CALLOC(1,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member)); - memset(sib2_part,0,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member)); - memset(sib3_part,0,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member)); - - sib2_part->present = SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2; - sib3_part->present = SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3; - - *sib2 = &sib2_part->choice.sib2; - *sib3 = &sib3_part->choice.sib3; - -#if defined(Rel10) || defined(Rel14) - - if (MBMS_flag > 0) { - sib13_part = CALLOC(1,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member)); - memset(sib13_part,0,sizeof(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member)); - sib13_part->present = SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920; - *sib13 = &sib13_part->choice.sib13_v920; - } - -#endif - - // sib2 - - (*sib2)->ac_BarringInfo = NULL; -#if defined(Rel10) || defined(Rel14) -#if 0 - (*sib2)->ssac_BarringForMMTEL_Voice_r9 = NULL; - (*sib2)->ssac_BarringForMMTEL_Video_r9 = NULL; - (*sib2)->ac_BarringForCSFB_r10 = NULL; -#endif - (*sib2)->ext1 = NULL; - (*sib2)->ext2 = NULL; -#endif - -#if defined(ENABLE_ITTI) - - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.numberOfRA_Preambles = configuration->rach_numberOfRA_Preambles[CC_id]; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig = NULL; - - if (configuration->rach_preamblesGroupAConfig[CC_id]) { - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig - = CALLOC(1,sizeof(struct RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig)); - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA - = configuration->rach_sizeOfRA_PreamblesGroupA[CC_id]; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig->messageSizeGroupA - = configuration->rach_messageSizeGroupA[CC_id]; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig->messagePowerOffsetGroupB - = configuration->rach_messagePowerOffsetGroupB[CC_id]; - } - - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.powerRampingParameters.powerRampingStep = configuration->rach_powerRampingStep[CC_id]; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.powerRampingParameters.preambleInitialReceivedTargetPower = - configuration->rach_preambleInitialReceivedTargetPower[CC_id]; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ra_SupervisionInfo.preambleTransMax = configuration->rach_preambleTransMax[CC_id]; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ra_SupervisionInfo.ra_ResponseWindowSize = configuration->rach_raResponseWindowSize[CC_id]; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ra_SupervisionInfo.mac_ContentionResolutionTimer = - configuration->rach_macContentionResolutionTimer[CC_id]; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.maxHARQ_Msg3Tx = configuration->rach_maxHARQ_Msg3Tx[CC_id]; - - // BCCH-Config - (*sib2)->radioResourceConfigCommon.bcch_Config.modificationPeriodCoeff - = configuration->bcch_modificationPeriodCoeff[CC_id]; - - // PCCH-Config - (*sib2)->radioResourceConfigCommon.pcch_Config.defaultPagingCycle - = configuration->pcch_defaultPagingCycle[CC_id]; - (*sib2)->radioResourceConfigCommon.pcch_Config.nB - = configuration->pcch_nB[CC_id]; - - // PRACH-Config - (*sib2)->radioResourceConfigCommon.prach_Config.rootSequenceIndex - = configuration->prach_root[CC_id]; - (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.prach_ConfigIndex - = configuration->prach_config_index[CC_id]; - (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.highSpeedFlag - = configuration->prach_high_speed[CC_id]; - (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig - = configuration->prach_zero_correlation[CC_id]; - (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.prach_FreqOffset - = configuration->prach_freq_offset[CC_id]; - - // PDSCH-Config - (*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.referenceSignalPower - = configuration->pdsch_referenceSignalPower[CC_id]; - (*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.p_b - = configuration->pdsch_p_b[CC_id]; - - // PUSCH-Config - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.n_SB - = configuration->pusch_n_SB[CC_id]; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode - = configuration->pusch_hoppingMode[CC_id]; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset - = configuration->pusch_hoppingOffset[CC_id]; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM - = configuration->pusch_enable64QAM[CC_id]; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled - = configuration->pusch_groupHoppingEnabled[CC_id]; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH - = configuration->pusch_groupAssignment[CC_id]; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled - = configuration->pusch_sequenceHoppingEnabled[CC_id]; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift - = configuration->pusch_nDMRS1[CC_id]; - - // PUCCH-Config - - (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.deltaPUCCH_Shift - = configuration->pucch_delta_shift[CC_id]; - (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.nRB_CQI - = configuration->pucch_nRB_CQI[CC_id]; - (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.nCS_AN - = configuration->pucch_nCS_AN[CC_id]; -#if !defined(Rel10) && !defined(Rel14) - (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.n1PUCCH_AN - = configuration->pucch_n1_AN[CC_id]; -#endif - - // SRS Config - if (configuration->srs_enable[CC_id]==1) { - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.present - = SoundingRS_UL_ConfigCommon_PR_setup; - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig - = configuration->srs_BandwidthConfig[CC_id]; - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig - = configuration->srs_SubframeConfig[CC_id]; - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission - = configuration->srs_ackNackST[CC_id]; - - if (configuration->srs_MaxUpPts[CC_id]) { - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts - = CALLOC(1,sizeof(long)); - *(*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts=1; - } else { - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts = NULL; - } - RC.rrc[Mod_id]->srs_enable[CC_id] = 1; - } else { - RC.rrc[Mod_id]->srs_enable[CC_id] = 0; - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.present=SoundingRS_UL_ConfigCommon_PR_release; - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.release=0; - } - - // uplinkPowerControlCommon - - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.p0_NominalPUSCH - = configuration->pusch_p0_Nominal[CC_id]; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.p0_NominalPUCCH - = configuration->pucch_p0_Nominal[CC_id]; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.alpha - = configuration->pusch_alpha[CC_id]; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1 - = configuration->pucch_deltaF_Format1[CC_id]; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b - = configuration->pucch_deltaF_Format1b[CC_id]; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2 - = configuration->pucch_deltaF_Format2[CC_id]; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a - = configuration->pucch_deltaF_Format2a[CC_id]; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b - = configuration->pucch_deltaF_Format2b[CC_id]; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaPreambleMsg3 - = configuration->msg3_delta_Preamble[CC_id]; - (*sib2)->radioResourceConfigCommon.ul_CyclicPrefixLength - = configuration->ul_CyclicPrefixLength[CC_id]; - - // UE Timers and Constants - - (*sib2)->ue_TimersAndConstants.t300 - = configuration->ue_TimersAndConstants_t300[CC_id]; - (*sib2)->ue_TimersAndConstants.t301 - = configuration->ue_TimersAndConstants_t301[CC_id]; - (*sib2)->ue_TimersAndConstants.t310 - = configuration->ue_TimersAndConstants_t310[CC_id]; - (*sib2)->ue_TimersAndConstants.n310 - = configuration->ue_TimersAndConstants_n310[CC_id]; - (*sib2)->ue_TimersAndConstants.t311 - = configuration->ue_TimersAndConstants_t311[CC_id]; - (*sib2)->ue_TimersAndConstants.n311 - = configuration->ue_TimersAndConstants_n311[CC_id]; - -#else - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.numberOfRA_Preambles=RACH_ConfigCommon__preambleInfo__numberOfRA_Preambles_n64; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.preambleInfo.preamblesGroupAConfig = NULL; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.powerRampingParameters.powerRampingStep=RACH_ConfigCommon__powerRampingParameters__powerRampingStep_dB2; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.powerRampingParameters.preambleInitialReceivedTargetPower= - RACH_ConfigCommon__powerRampingParameters__preambleInitialReceivedTargetPower_dBm_100; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ra_SupervisionInfo.preambleTransMax=RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n10; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ra_SupervisionInfo.ra_ResponseWindowSize=RACH_ConfigCommon__ra_SupervisionInfo__ra_ResponseWindowSize_sf10; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ra_SupervisionInfo.mac_ContentionResolutionTimer= - RACH_ConfigCommon__ra_SupervisionInfo__mac_ContentionResolutionTimer_sf48; - (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.maxHARQ_Msg3Tx = 4; - - // BCCH-Config - (*sib2)->radioResourceConfigCommon.bcch_Config.modificationPeriodCoeff=BCCH_Config__modificationPeriodCoeff_n2; - - // PCCH-Config - (*sib2)->radioResourceConfigCommon.pcch_Config.defaultPagingCycle = PCCH_Config__defaultPagingCycle_rf128; - (*sib2)->radioResourceConfigCommon.pcch_Config.nB=PCCH_Config__nB_oneT; - - // PRACH-Config - (*sib2)->radioResourceConfigCommon.prach_Config.rootSequenceIndex=Mod_id;//0;//384; - (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.prach_ConfigIndex = 0;//3; - (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.highSpeedFlag = 0; - (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig = 1;//12; - (*sib2)->radioResourceConfigCommon.prach_Config.prach_ConfigInfo.prach_FreqOffset = 2; - - // PDSCH-Config - (*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.referenceSignalPower=0; // corresponds to 24.7 dBm 5 MHz/ 27.7 10 MHz/ 30.7 20 MHz - - - (*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.p_b=0; - - // PUSCH-Config - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.n_SB=1; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode=PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset=0; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM=0; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled=1; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH=0; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled=0; - (*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift=0; - - // PUCCH-Config - - (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.deltaPUCCH_Shift=PUCCH_ConfigCommon__deltaPUCCH_Shift_ds1; - (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.nRB_CQI = 1; - (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.nCS_AN = 0; - (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.n1PUCCH_AN = 32; - - - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.present=SoundingRS_UL_ConfigCommon_PR_release; - (*sib2)->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.release=0; - - // uplinkPowerControlCommon - - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.p0_NominalPUSCH = -108; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.p0_NominalPUCCH = -108; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.alpha=UplinkPowerControlCommon__alpha_al1; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1=DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2; - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b=DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3; - - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2=DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0; - - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a=DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0; - - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b=DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0; - - (*sib2)->radioResourceConfigCommon.uplinkPowerControlCommon.deltaPreambleMsg3 = 6; - - (*sib2)->radioResourceConfigCommon.ul_CyclicPrefixLength=UL_CyclicPrefixLength_len1; - - (*sib2)->ue_TimersAndConstants.t300=UE_TimersAndConstants__t300_ms1000; - - (*sib2)->ue_TimersAndConstants.t301=UE_TimersAndConstants__t301_ms1000; - - (*sib2)->ue_TimersAndConstants.t310=UE_TimersAndConstants__t310_ms1000; - - (*sib2)->ue_TimersAndConstants.n310=UE_TimersAndConstants__n310_n20; - - (*sib2)->ue_TimersAndConstants.t311=UE_TimersAndConstants__t311_ms10000; - - (*sib2)->ue_TimersAndConstants.n311=UE_TimersAndConstants__n311_n1; - -#endif - - (*sib2)->freqInfo.additionalSpectrumEmission = 1; - (*sib2)->freqInfo.ul_CarrierFreq = NULL; - (*sib2)->freqInfo.ul_Bandwidth = NULL; - // (*sib2)->mbsfn_SubframeConfigList = NULL; - -#if defined(Rel10) || defined(Rel14) - - if (MBMS_flag > 0) { - LOG_I(RRC,"Adding MBSFN subframe Configuration 1 to SIB2\n"); - MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig1; - (*sib2)->mbsfn_SubframeConfigList = CALLOC(1,sizeof(struct MBSFN_SubframeConfigList)); - MBSFNSubframeConfigList = (*sib2)->mbsfn_SubframeConfigList; - - sib2_mbsfn_SubframeConfig1= CALLOC(1,sizeof(*sib2_mbsfn_SubframeConfig1)); - memset((void*)sib2_mbsfn_SubframeConfig1,0,sizeof(*sib2_mbsfn_SubframeConfig1)); - - sib2_mbsfn_SubframeConfig1->radioframeAllocationPeriod= MBSFN_SubframeConfig__radioframeAllocationPeriod_n4; - sib2_mbsfn_SubframeConfig1->radioframeAllocationOffset= 1; - sib2_mbsfn_SubframeConfig1->subframeAllocation.present= MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame; - sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1); - sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1; - sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2; - - sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2; - - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); - - if (MBMS_flag == 4 ) { - LOG_I(RRC,"Adding MBSFN subframe Configuration 2 to SIB2\n"); - MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig2; - sib2_mbsfn_SubframeConfig2= CALLOC(1,sizeof(*sib2_mbsfn_SubframeConfig2)); - memset((void*)sib2_mbsfn_SubframeConfig2,0,sizeof(*sib2_mbsfn_SubframeConfig2)); - - sib2_mbsfn_SubframeConfig2->radioframeAllocationPeriod= MBSFN_SubframeConfig__radioframeAllocationPeriod_n4; - sib2_mbsfn_SubframeConfig2->radioframeAllocationOffset= 1; - sib2_mbsfn_SubframeConfig2->subframeAllocation.present= MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame; - sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf= MALLOC(1); - sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.size= 1; - sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.bits_unused= 2; - - sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2; - - - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig2); - } + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present = configuration->prach_RootSequenceIndex_choice[CC_id]; + if((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present == NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l839){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839 = configuration->prach_RootSequenceIndex_l839[CC_id]; + }else if ((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present == NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139 = configuration->prach_RootSequenceIndex_l139[CC_id]; } -#else // no MBMS transmission - (*sib2)->mbsfn_SubframeConfigList = NULL; -#endif - - (*sib2)->timeAlignmentTimerCommon=TimeAlignmentTimer_infinity;//TimeAlignmentTimer_sf5120; - - /// (*SIB3) -#if defined(Rel10) || defined(Rel14) - (*sib3)->ext1 = NULL; -#if 0 - (*sib3)->s_IntraSearch_v920=NULL; - (*sib3)->s_NonIntraSearch_v920=NULL; - (*sib3)->q_QualMin_r9=NULL; - (*sib3)->threshServingLowQ_r9=NULL; -#endif -#endif - (*sib3)->cellReselectionInfoCommon.q_Hyst=SystemInformationBlockType3__cellReselectionInfoCommon__q_Hyst_dB4; - - (*sib3)->cellReselectionInfoCommon.speedStateReselectionPars=NULL; - - (*sib3)->cellReselectionServingFreqInfo.s_NonIntraSearch=NULL; - (*sib3)->cellReselectionServingFreqInfo.threshServingLow=31; - (*sib3)->cellReselectionServingFreqInfo.cellReselectionPriority=7; - - (*sib3)->intraFreqCellReselectionInfo.q_RxLevMin = -70; - (*sib3)->intraFreqCellReselectionInfo.p_Max = NULL; - (*sib3)->intraFreqCellReselectionInfo.s_IntraSearch = CALLOC(1,sizeof(*(*sib3)->intraFreqCellReselectionInfo.s_IntraSearch)); - *(*sib3)->intraFreqCellReselectionInfo.s_IntraSearch = 31; - (*sib3)->intraFreqCellReselectionInfo.allowedMeasBandwidth=CALLOC(1,sizeof(*(*sib3)->intraFreqCellReselectionInfo.allowedMeasBandwidth)); - - *(*sib3)->intraFreqCellReselectionInfo.allowedMeasBandwidth = AllowedMeasBandwidth_mbw6; - - (*sib3)->intraFreqCellReselectionInfo.presenceAntennaPort1 = 0; - (*sib3)->intraFreqCellReselectionInfo.neighCellConfig.buf = CALLOC(8,1); - (*sib3)->intraFreqCellReselectionInfo.neighCellConfig.size = 1; - (*sib3)->intraFreqCellReselectionInfo.neighCellConfig.buf[0] = 1; - (*sib3)->intraFreqCellReselectionInfo.neighCellConfig.bits_unused = 6; - (*sib3)->intraFreqCellReselectionInfo.t_ReselectionEUTRA = 1; - (*sib3)->intraFreqCellReselectionInfo.t_ReselectionEUTRA_SF = (struct SpeedStateScaleFactors *)NULL; - - // SIB13 - // fill in all elements of SIB13 if present -#if defined(Rel10) || defined(Rel14) - - if (MBMS_flag > 0 ) { - // Notification for mcch change - (*sib13)->notificationConfig_r9.notificationRepetitionCoeff_r9= MBMS_NotificationConfig_r9__notificationRepetitionCoeff_r9_n2; - (*sib13)->notificationConfig_r9.notificationOffset_r9= 0; - (*sib13)->notificationConfig_r9.notificationSF_Index_r9= 1; - - // MBSFN-AreaInfoList - MBSFNArea_list= &(*sib13)->mbsfn_AreaInfoList_r9;//CALLOC(1,sizeof(*MBSFNArea_list)); - memset(MBSFNArea_list,0,sizeof(*MBSFNArea_list)); - // MBSFN Area 1 - MBSFN_Area1= CALLOC(1, sizeof(*MBSFN_Area1)); - MBSFN_Area1->mbsfn_AreaId_r9= 1; - MBSFN_Area1->non_MBSFNregionLength= MBSFN_AreaInfo_r9__non_MBSFNregionLength_s2; - MBSFN_Area1->notificationIndicator_r9= 0; - MBSFN_Area1->mcch_Config_r9.mcch_RepetitionPeriod_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__mcch_RepetitionPeriod_r9_rf32; - MBSFN_Area1->mcch_Config_r9.mcch_Offset_r9= 1; // in accordance with mbsfn subframe configuration in sib2 - MBSFN_Area1->mcch_Config_r9.mcch_ModificationPeriod_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__mcch_ModificationPeriod_r9_rf512; - // Subframe Allocation Info - MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf= MALLOC(1); - MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.size= 1; - - MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x20<<2; // FDD: SF1 - - - MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2; - - MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n7; - - ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1); - - //MBSFN Area 2: currently only activated for eMBMS relaying - if (MBMS_flag == 4 ) { - MBSFN_Area2= CALLOC(1, sizeof(*MBSFN_Area2)); - MBSFN_Area2->mbsfn_AreaId_r9= 2; - MBSFN_Area2->non_MBSFNregionLength= MBSFN_AreaInfo_r9__non_MBSFNregionLength_s2; - MBSFN_Area2->notificationIndicator_r9= 1; - MBSFN_Area2->mcch_Config_r9.mcch_RepetitionPeriod_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__mcch_RepetitionPeriod_r9_rf32; - MBSFN_Area2->mcch_Config_r9.mcch_Offset_r9= 1; - MBSFN_Area2->mcch_Config_r9.mcch_ModificationPeriod_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__mcch_ModificationPeriod_r9_rf512; - // Subframe Allocation Info - MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf= MALLOC(1); - MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.size= 1; - MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2; - - MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x04<<2; // FDD: SF6 - + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing = configuration->prach_msg1_SubcarrierSpacing[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig = configuration->restrictedSetConfig[CC_id]; - MBSFN_Area2->mcch_Config_r9.signallingMCS_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n7; - - ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area2); - } - - // end of adding for MBMS SIB13 + if(configuration->msg3_transformPrecoding[CC_id]){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoding = CALLOC(1,sizeof(long)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoding = NR_RACH_ConfigCommon__msg3_transformPrecoding_enabled; } -#endif - - bcch_message->message.present = BCCH_DL_SCH_MessageType_PR_c1; - bcch_message->message.choice.c1.present = BCCH_DL_SCH_MessageType__c1_PR_systemInformation; - - //memcpy((void*)&bcch_message.message.choice.c1.choice.systemInformation,(void*)systemInformation,sizeof(SystemInformation_t)); - - bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.present = SystemInformation__criticalExtensions_PR_systemInformation_r8; + //Fill initialUplinkBWP -> BWP-UplinkCommon -> rach_ConfigCommon -> rach_ConfigGeneric// + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex = configuration->prach_ConfigurationIndex[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM = configuration->prach_msg1_FDM[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart = configuration->prach_msg1_FrequencyStart[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig = configuration->zeroCorrelationZoneConfig[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower = configuration->preambleReceivedTargetPower[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax = configuration->preambleTransMax[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep = configuration->powerRampingStep[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow = configuration->ra_ResponseWindow[CC_id]; - bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count=0; + //Fill initialUplinkBWP -> BWP-UplinkCommon -> pusch_ConfigCommon// + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_PUSCH_ConfigCommon_t)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->present = NR_SetupRelease_PUSCH_ConfigCommon_PR_setup; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUSCH_ConfigCommon)); - // asn_set_empty(&systemInformation->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list);//.size=0; - // systemInformation->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count=0; - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, - sib2_part); - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, - sib3_part); -#if defined(Rel10) || defined(Rel14) - if (MBMS_flag > 0) { - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list,sib13_part); + if(configuration->groupHoppingEnabledTransformPrecoding[CC_id]){ + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = CALLOC(1,sizeof(long)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = NR_PUSCH_ConfigCommon__groupHoppingEnabledTransformPrecoding_enabled; } -#endif - - -#ifdef XER_PRINT - xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message, (void*)bcch_message); -#endif - enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message, - (void*)bcch_message, - buffer, - 900); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[15000]; - size_t message_string_size; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_AllocationList = CALLOC(1,sizeof(struct NR_PUSCH_ConfigCommon__pusch_AllocationList)); + + struct NR_PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation; + pusch_configcommontimedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_BCCH_DL_SCH_Message, (void *)bcch_message)) > 0) { - MessageDef *msg_p; + pusch_configcommontimedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); + *(pusch_configcommontimedomainresourceallocation->k2) = configuration->PUSCH_TimeDomainResourceAllocation_k2[CC_id]; + + pusch_configcommontimedomainresourceallocation->mappingType = configuration->PUSCH_TimeDomainResourceAllocation_mappingType[CC_id]; + pusch_configcommontimedomainresourceallocation->startSymbolAndLength.buf = MALLOC(1); + pusch_configcommontimedomainresourceallocation->startSymbolAndLength.size = 1; + pusch_configcommontimedomainresourceallocation->startSymbolAndLength.bits_unused = 1; + pusch_configcommontimedomainresourceallocation->startSymbolAndLength.buf[0] = 0x7f; + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_AllocationList->list,&pusch_configcommontimedomainresourceallocation); + + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble = CALLOC(1,sizeof(long)); + *((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble) = configuration->msg3_DeltaPreamble[CC_id]; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant = CALLOC(1,sizeof(long)); + *((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant) = configuration->p0_NominalWithGrant[CC_id]; + + //Fill initialUplinkBWP -> BWP-UplinkCommon -> pucch_ConfigCommon// + + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PUCCH_ConfigCommon)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->present = NR_SetupRelease_PUCCH_ConfigCommon_PR_setup; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUCCH_ConfigCommon)); + + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon = CALLOC(1,sizeof(BIT_STRING_t)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId = CALLOC(1,sizeof(BIT_STRING_t)); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal = CALLOC(1,sizeof(long)); + + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping = configuration->pucch_GroupHopping[CC_id]; + *((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal) = configuration->p0_nominal[CC_id]; + + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon->buf = MALLOC(1); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon->size = 1; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon->bits_unused = 4; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon->buf[0] = 0x0f; + + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->buf = MALLOC(2); + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->size = 2; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->bits_unused = 6; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->buf[0] = 0x03; + (*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->buf[1] = 0xff; + + //ssb_PositionsInBurst + (*servingcellconfigcommon)->ssb_PositionsInBurst->present = configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id]; + + if((*servingcellconfigcommon)->ssb_PositionsInBurst->present == NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap){ + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.buf = MALLOC(1); + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.size = 1; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.bits_unused = 4; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.shortBitmap.buf[0] = 0x0f; + }else if((*servingcellconfigcommon)->ssb_PositionsInBurst->present == NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap){ + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.buf = MALLOC(1); + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.size = 1; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.bits_unused = 0; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.mediumBitmap.buf[0] = 0xff; + }else if((*servingcellconfigcommon)->ssb_PositionsInBurst->present == NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap){ + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf = MALLOC(8); + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.size = 8; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.bits_unused = 0; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[0] = 0xff; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[1] = 0xff; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[2] = 0xff; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[3] = 0xff; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[4] = 0xff; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[5] = 0xff; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[6] = 0xff; + (*servingcellconfigcommon)->ssb_PositionsInBurst->choice.longBitmap.buf[7] = 0xff; + } + + //ssb_periodicityServingCell + *(*servingcellconfigcommon)->ssb_periodicityServingCell = configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id]; + //dmrs_TypeA_Position + (*servingcellconfigcommon)->dmrs_TypeA_Position = configuration->ServingCellConfigCommon_dmrs_TypeA_Position[CC_id]; + + //lte_CRS_ToMatchAround + + //rateMatchPatternToAddModList + struct NR_RateMatchPattern *ratematchpattern; + ratematchpattern = CALLOC(1,sizeof(struct NR_RateMatchPattern)); + ratematchpattern->rateMatchPatternId = configuration->rateMatchPatternId[CC_id]; + ratematchpattern->patternType.present = configuration->RateMatchPattern_patternType[CC_id]; + + if(ratematchpattern->patternType.present == NR_RateMatchPattern__patternType_PR_bitmaps){ + ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps)); + ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf = MALLOC(35); + ratematchpattern->patternType.choice.bitmaps->resourceBlocks.size = 35; + ratematchpattern->patternType.choice.bitmaps->resourceBlocks.bits_unused = 5; + ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf[0] = 0x07; + for (int i =1;i<=34;i++ ){ + ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf[i] =0xff; + } + + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.present = configuration->symbolsInResourceBlock[CC_id]; + if(ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.present == NR_RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_oneSlot){ + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.buf=MALLOC(2); + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.size=2; + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.bits_unused=2; + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.buf[0]=0x3f; + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.oneSlot.buf[1]=0xff; + }else if(ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.present == NR_RateMatchPattern__patternType__bitmaps__symbolsInResourceBlock_PR_twoSlots){ + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf=MALLOC(4); + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.size=4; + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.bits_unused=4; + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf[0]=0x0f; + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf[1]=0xff; + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf[2]=0xff; + ratematchpattern->patternType.choice.bitmaps->symbolsInResourceBlock.choice.twoSlots.buf[3]=0xff; + } + + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern)); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present = configuration->periodicityAndPattern[CC_id]; + if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n2){ + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.buf = MALLOC(1); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.size = 1; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.bits_unused = 6; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n2.buf[0] =0x03; + }else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n4){ + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.buf = MALLOC(1); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.size = 1; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.bits_unused = 4; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n4.buf[0] = 0x0f; + }else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n5){ + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.buf = MALLOC(1); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.size = 1; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.bits_unused = 3; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n5.buf[0] = 0x1f; + }else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n8){ + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.buf = MALLOC(1); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.size = 1; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.bits_unused = 0; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n8.buf[0] = 0xff; + }else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n10){ + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.buf = MALLOC(2); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.size = 2; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.bits_unused = 6; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.buf[0] = 0x03; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n10.buf[1] = 0xff; + }else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n20){ + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf = MALLOC(3); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.size = 3; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.bits_unused = 4; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf[0] = 0x0f; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf[1] = 0xff; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n20.buf[2] = 0xff; + }else if(ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->present == NR_RateMatchPattern__patternType__bitmaps__periodicityAndPattern_PR_n40){ + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf = MALLOC(5); + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.size = 5; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.bits_unused = 0; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[0] = 0xff; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[1] = 0xff; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[2] = 0xff; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[3] = 0xff; + ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf[4] = 0xff; + } + + }else if(ratematchpattern->patternType.present == NR_RateMatchPattern__patternType_PR_controlResourceSet){ + ratematchpattern->patternType.choice.controlResourceSet = configuration->RateMatchPattern_controlResourceSet[CC_id]; + } + + ratematchpattern->subcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t)); + *(ratematchpattern->subcarrierSpacing) = configuration->RateMatchPattern_subcarrierSpacing[CC_id]; + ratematchpattern->mode = configuration->RateMatchPattern_mode[CC_id]; - msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_BCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_dl_bcch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_bcch.text, message_string, message_string_size); + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->rateMatchPatternToAddModList->list,&ratematchpattern); + + //rateMatchPatternToReleaseList + NR_RateMatchPatternId_t *ratematchpatternid; + ratematchpatternid = CALLOC(1,sizeof(NR_RateMatchPatternId_t)); + *(ratematchpatternid) = configuration->rateMatchPatternId[CC_id]; + ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->rateMatchPatternToReleaseList->list,&ratematchpatternid); + + //subcarrierSpacing + *(*servingcellconfigcommon)->subcarrierSpacing = configuration->NIA_SubcarrierSpacing[CC_id]; + + //tdd_UL_DL_ConfigurationCommon + (*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t)); + (*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->dl_UL_TransmissionPeriodicity = CALLOC(1,sizeof(long)); + (*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->nrofDownlinkSlots = CALLOC(1,sizeof(long)); + (*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->nrofDownlinkSymbols = CALLOC(1,sizeof(long)); + (*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->nrofUplinkSlots = CALLOC(1,sizeof(long)); + (*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->nrofUplinkSymbols = CALLOC(1,sizeof(long)); + + *((*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing) = configuration->referenceSubcarrierSpacing[CC_id]; + *((*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->dl_UL_TransmissionPeriodicity) = configuration->dl_UL_TransmissionPeriodicity[CC_id]; + *((*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->nrofDownlinkSlots) = configuration->nrofDownlinkSlots[CC_id]; + *((*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->nrofDownlinkSymbols) = configuration->nrofDownlinkSymbols[CC_id]; + *((*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->nrofUplinkSlots) = configuration->nrofUplinkSlots[CC_id]; + *((*servingcellconfigcommon)->tdd_UL_DL_ConfigurationCommon->nrofUplinkSymbols) = configuration->nrofUplinkSymbols[CC_id]; + + //ss_PBCH_BlockPower + (*servingcellconfigcommon)->ss_PBCH_BlockPower = configuration->ServingCellConfigCommon_ss_PBCH_BlockPower[CC_id]; - itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"[eNB] SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); -#endif - - if (enc_rval.encoded==-1) { - msg("[RRC] ASN1 : SI encoding failed for SIB23\n"); - return(-1); - } - - return((enc_rval.encoded+7)/8); -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) -{ - - asn_enc_rval_t enc_rval; - uint8_t buf[5],buf2=0; - uint8_t ecause=0; - - UL_CCCH_Message_t ul_ccch_msg; - - RRCConnectionRequest_t *rrcConnectionRequest; - - memset((void *)&ul_ccch_msg,0,sizeof(UL_CCCH_Message_t)); - - ul_ccch_msg.message.present = UL_CCCH_MessageType_PR_c1; - ul_ccch_msg.message.choice.c1.present = UL_CCCH_MessageType__c1_PR_rrcConnectionRequest; - rrcConnectionRequest = &ul_ccch_msg.message.choice.c1.choice.rrcConnectionRequest; - - rrcConnectionRequest->criticalExtensions.present = RRCConnectionRequest__criticalExtensions_PR_rrcConnectionRequest_r8; - - if (1) { - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.present = InitialUE_Identity_PR_randomValue; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.randomValue.size = 5; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.randomValue.bits_unused = 0; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.randomValue.buf = buf; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.randomValue.buf[0] = rv[0]; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.randomValue.buf[1] = rv[1]; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.randomValue.buf[2] = rv[2]; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.randomValue.buf[3] = rv[3]; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.randomValue.buf[4] = rv[4]; - } else { - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.present = InitialUE_Identity_PR_s_TMSI; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.mmec.size = 1; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.mmec.bits_unused = 0; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.mmec.buf = buf; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.mmec.buf[0] = 0x12; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.m_TMSI.size = 4; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.m_TMSI.bits_unused = 0; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.m_TMSI.buf = &buf[1]; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.m_TMSI.buf[0] = 0x34; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.m_TMSI.buf[1] = 0x56; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.m_TMSI.buf[2] = 0x78; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.ue_Identity.choice.s_TMSI.m_TMSI.buf[3] = 0x9a; - } - - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.establishmentCause = EstablishmentCause_mo_Signalling; //EstablishmentCause_mo_Data; - - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.spare.buf = &buf2; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.spare.size=1; - rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.spare.bits_unused = 7; - - - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_CCCH_Message, - (void*)&ul_ccch_msg, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_CCCH_Message, (void *) &ul_ccch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_UL_CCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_ul_ccch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_ul_ccch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, NB_eNB_INST + Mod_id, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"[UE] RRCConnectionRequest Encoded %zd bits (%zd bytes), ecause %d\n",enc_rval.encoded,(enc_rval.encoded+7)/8,ecause); -#endif - - return((enc_rval.encoded+7)/8); - -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength, const char *dedicatedInfoNAS) -{ - - - asn_enc_rval_t enc_rval; - - UL_DCCH_Message_t ul_dcch_msg; - - RRCConnectionSetupComplete_t *rrcConnectionSetupComplete; - - memset((void *)&ul_dcch_msg,0,sizeof(UL_DCCH_Message_t)); - - ul_dcch_msg.message.present = UL_DCCH_MessageType_PR_c1; - ul_dcch_msg.message.choice.c1.present = UL_DCCH_MessageType__c1_PR_rrcConnectionSetupComplete; - rrcConnectionSetupComplete = &ul_dcch_msg.message.choice.c1.choice.rrcConnectionSetupComplete; - - rrcConnectionSetupComplete->rrc_TransactionIdentifier = Transaction_id; - rrcConnectionSetupComplete->criticalExtensions.present = RRCConnectionSetupComplete__criticalExtensions_PR_c1; - rrcConnectionSetupComplete->criticalExtensions.choice.c1.present = RRCConnectionSetupComplete__criticalExtensions__c1_PR_rrcConnectionSetupComplete_r8; - - rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.nonCriticalExtension=CALLOC(1, - sizeof(*rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.nonCriticalExtension)); - - if(usim_test == 0) - rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.selectedPLMN_Identity= 2; - else - rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.selectedPLMN_Identity= 1; - - rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME = - NULL;//calloc(1,sizeof(*rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME)); - - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->plmn_Identity=NULL; - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmegi.buf = calloc(2,1); - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmegi.buf[0] = 0x0; - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmegi.buf[1] = 0x1; - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmegi.size=2; - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmegi.bits_unused=0; - - memset(&rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.dedicatedInfoNAS,0,sizeof(OCTET_STRING_t)); - OCTET_STRING_fromBuf(&rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.dedicatedInfoNAS, - dedicatedInfoNAS, dedicatedInfoNASLength); - - - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmec.buf = calloc(1,1); - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmec.buf[0] = 0x98; - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmec.size=1; - //rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmec.bits_unused=0; - - - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, - (void*)&ul_dcch_msg, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_DCCH_Message, (void *) &ul_dcch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_UL_DCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_ul_dcch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_ul_dcch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, NB_eNB_INST + Mod_id, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"RRCConnectionSetupComplete Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); -#endif - - return((enc_rval.encoded+7)/8); - -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t -do_RRCConnectionReconfigurationComplete( - const protocol_ctxt_t* const ctxt_pP, - uint8_t* buffer, - const uint8_t Transaction_id -) -//------------------------------------------------------------------------------ -{ - - - asn_enc_rval_t enc_rval; - - UL_DCCH_Message_t ul_dcch_msg; - - RRCConnectionReconfigurationComplete_t *rrcConnectionReconfigurationComplete; - - memset((void *)&ul_dcch_msg,0,sizeof(UL_DCCH_Message_t)); - - ul_dcch_msg.message.present = UL_DCCH_MessageType_PR_c1; - ul_dcch_msg.message.choice.c1.present = UL_DCCH_MessageType__c1_PR_rrcConnectionReconfigurationComplete; - rrcConnectionReconfigurationComplete = &ul_dcch_msg.message.choice.c1.choice.rrcConnectionReconfigurationComplete; - - rrcConnectionReconfigurationComplete->rrc_TransactionIdentifier = Transaction_id; - rrcConnectionReconfigurationComplete->criticalExtensions.present = - RRCConnectionReconfigurationComplete__criticalExtensions_PR_rrcConnectionReconfigurationComplete_r8; - rrcConnectionReconfigurationComplete->criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8.nonCriticalExtension=NULL; - - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, - (void*)&ul_dcch_msg, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_DCCH_Message, (void *) &ul_dcch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_UL_DCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_ul_dcch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_ul_dcch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"RRCConnectionReconfigurationComplete Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); -#endif - - return((enc_rval.encoded+7)/8); -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t -do_RRCConnectionSetup( - const protocol_ctxt_t* const ctxt_pP, - rrc_eNB_ue_context_t* const ue_context_pP, - int CC_id, - uint8_t* const buffer, - const uint8_t transmission_mode, - const uint8_t Transaction_id, - SRB_ToAddModList_t **SRB_configList, - struct PhysicalConfigDedicated **physicalConfigDedicated) -{ - - asn_enc_rval_t enc_rval; - uint8_t ecause=0; - eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id]; - rrc_eNB_carrier_data_t *carrier = &rrc->carrier[CC_id]; - - long* logicalchannelgroup = NULL; - struct SRB_ToAddMod* SRB1_config = NULL; - struct SRB_ToAddMod__rlc_Config* SRB1_rlc_config = NULL; - struct SRB_ToAddMod__logicalChannelConfig* SRB1_lchan_config = NULL; - struct LogicalChannelConfig__ul_SpecificParameters* SRB1_ul_SpecificParameters = NULL; - -#ifdef CBA - struct PUSCH_CBAConfigDedicated_vlola* pusch_CBAConfigDedicated_vlola = NULL; - long* betaOffset_CBA_Index = NULL; - long* cShift_CBA = NULL; -#endif - PhysicalConfigDedicated_t* physicalConfigDedicated2 = NULL; - - DL_CCCH_Message_t dl_ccch_msg; - - RRCConnectionSetup_t* rrcConnectionSetup = NULL; - - memset((void *)&dl_ccch_msg,0,sizeof(DL_CCCH_Message_t)); - dl_ccch_msg.message.present = DL_CCCH_MessageType_PR_c1; - dl_ccch_msg.message.choice.c1.present = DL_CCCH_MessageType__c1_PR_rrcConnectionSetup; - rrcConnectionSetup = &dl_ccch_msg.message.choice.c1.choice.rrcConnectionSetup; - - // RRCConnectionSetup - // Configure SRB1 - - // *SRB_configList = CALLOC(1,sizeof(*SRB_configList)); - if (*SRB_configList) { - free(*SRB_configList); - } - - *SRB_configList = CALLOC(1,sizeof(SRB_ToAddModList_t)); - - /// SRB1 - SRB1_config = CALLOC(1,sizeof(*SRB1_config)); - - SRB1_config->srb_Identity = 1; - SRB1_rlc_config = CALLOC(1,sizeof(*SRB1_rlc_config)); - SRB1_config->rlc_Config = SRB1_rlc_config; - - SRB1_rlc_config->present = SRB_ToAddMod__rlc_Config_PR_explicitValue; - SRB1_rlc_config->choice.explicitValue.present=RLC_Config_PR_am; -#if defined(ENABLE_ITTI) - SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = rrc->srb1_timer_poll_retransmit; - SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = rrc->srb1_poll_pdu; - SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = rrc->srb1_poll_byte; - SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = rrc->srb1_max_retx_threshold; - SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = rrc->srb1_timer_reordering; - SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = rrc->srb1_timer_status_prohibit; -#else - SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = T_PollRetransmit_ms20;; - SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = PollPDU_p4;; - SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = PollByte_kBinfinity; - SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = UL_AM_RLC__maxRetxThreshold_t8; - SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = T_Reordering_ms35; - SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = T_StatusProhibit_ms0; -#endif - - SRB1_lchan_config = CALLOC(1,sizeof(*SRB1_lchan_config)); - SRB1_config->logicalChannelConfig = SRB1_lchan_config; - - SRB1_lchan_config->present = SRB_ToAddMod__logicalChannelConfig_PR_explicitValue; - SRB1_ul_SpecificParameters = CALLOC(1,sizeof(*SRB1_ul_SpecificParameters)); - - SRB1_lchan_config->choice.explicitValue.ul_SpecificParameters = SRB1_ul_SpecificParameters; - - - SRB1_ul_SpecificParameters->priority = 1; - - //assign_enum(&SRB1_ul_SpecificParameters->prioritisedBitRate,LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity); - SRB1_ul_SpecificParameters->prioritisedBitRate=LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity; - - //assign_enum(&SRB1_ul_SpecificParameters->bucketSizeDuration,LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50); - SRB1_ul_SpecificParameters->bucketSizeDuration=LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50; - - logicalchannelgroup = CALLOC(1,sizeof(long)); - *logicalchannelgroup=0; - SRB1_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup; - - - ASN_SEQUENCE_ADD(&(*SRB_configList)->list,SRB1_config); - - // PhysicalConfigDedicated - - physicalConfigDedicated2 = CALLOC(1,sizeof(*physicalConfigDedicated2)); - *physicalConfigDedicated = physicalConfigDedicated2; - - physicalConfigDedicated2->pdsch_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->pdsch_ConfigDedicated)); - physicalConfigDedicated2->pucch_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->pucch_ConfigDedicated)); - physicalConfigDedicated2->pusch_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->pusch_ConfigDedicated)); - physicalConfigDedicated2->uplinkPowerControlDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->uplinkPowerControlDedicated)); - physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH = CALLOC(1,sizeof(*physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH)); - physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH = CALLOC(1,sizeof(*physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH)); - physicalConfigDedicated2->cqi_ReportConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig)); - if (rrc->srs_enable[CC_id]==1) - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated)); - else - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = NULL; - physicalConfigDedicated2->antennaInfo = CALLOC(1,sizeof(*physicalConfigDedicated2->antennaInfo)); - physicalConfigDedicated2->schedulingRequestConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->schedulingRequestConfig)); - - // PDSCH - //assign_enum(&physicalConfigDedicated2->pdsch_ConfigDedicated->p_a, - // PDSCH_ConfigDedicated__p_a_dB0); - if (carrier->p_eNB==2) - physicalConfigDedicated2->pdsch_ConfigDedicated->p_a= PDSCH_ConfigDedicated__p_a_dB_3; - else - physicalConfigDedicated2->pdsch_ConfigDedicated->p_a= PDSCH_ConfigDedicated__p_a_dB0; - - // PUCCH - physicalConfigDedicated2->pucch_ConfigDedicated->ackNackRepetition.present=PUCCH_ConfigDedicated__ackNackRepetition_PR_release; - physicalConfigDedicated2->pucch_ConfigDedicated->ackNackRepetition.choice.release=0; - - if (carrier->sib1->tdd_Config == NULL) { - physicalConfigDedicated2->pucch_ConfigDedicated->tdd_AckNackFeedbackMode=NULL;//PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing; - } else { //TDD - physicalConfigDedicated2->pucch_ConfigDedicated->tdd_AckNackFeedbackMode= CALLOC(1,sizeof(long)); - *(physicalConfigDedicated2->pucch_ConfigDedicated->tdd_AckNackFeedbackMode) = - PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_bundling;//PUCCH_ConfigDedicated__tdd_AckNackFeedbackMode_multiplexing; - } - - // Pusch_config_dedicated - physicalConfigDedicated2->pusch_ConfigDedicated->betaOffset_ACK_Index = 0; // 2.00 - physicalConfigDedicated2->pusch_ConfigDedicated->betaOffset_RI_Index = 0; // 1.25 - physicalConfigDedicated2->pusch_ConfigDedicated->betaOffset_CQI_Index = 8; // 2.25 - - // UplinkPowerControlDedicated - physicalConfigDedicated2->uplinkPowerControlDedicated->p0_UE_PUSCH = 0; // 0 dB - //assign_enum(&physicalConfigDedicated2->uplinkPowerControlDedicated->deltaMCS_Enabled, - // UplinkPowerControlDedicated__deltaMCS_Enabled_en1); - physicalConfigDedicated2->uplinkPowerControlDedicated->deltaMCS_Enabled= UplinkPowerControlDedicated__deltaMCS_Enabled_en1; - physicalConfigDedicated2->uplinkPowerControlDedicated->accumulationEnabled = 1; // TRUE - physicalConfigDedicated2->uplinkPowerControlDedicated->p0_UE_PUCCH = 0; // 0 dB - physicalConfigDedicated2->uplinkPowerControlDedicated->pSRS_Offset = 0; // 0 dB - physicalConfigDedicated2->uplinkPowerControlDedicated->filterCoefficient = CALLOC(1, - sizeof(*physicalConfigDedicated2->uplinkPowerControlDedicated->filterCoefficient)); - // assign_enum(physicalConfigDedicated2->uplinkPowerControlDedicated->filterCoefficient,FilterCoefficient_fc4); // fc4 dB - *physicalConfigDedicated2->uplinkPowerControlDedicated->filterCoefficient=FilterCoefficient_fc4; // fc4 dB - - // TPC-PDCCH-Config - - physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH->present=TPC_PDCCH_Config_PR_setup; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH->choice.setup.tpc_Index.present = TPC_Index_PR_indexOfFormat3; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH->choice.setup.tpc_Index.choice.indexOfFormat3 = 1; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH->choice.setup.tpc_RNTI.buf=CALLOC(1,2); - physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH->choice.setup.tpc_RNTI.size=2; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH->choice.setup.tpc_RNTI.buf[0]=0x12; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH->choice.setup.tpc_RNTI.buf[1]=0x34+ue_context_pP->local_uid; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH->choice.setup.tpc_RNTI.bits_unused=0; - - physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->present=TPC_PDCCH_Config_PR_setup; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_Index.present = TPC_Index_PR_indexOfFormat3; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_Index.choice.indexOfFormat3 = 1; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.buf=CALLOC(1,2); - physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.size=2; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.buf[0]=0x22; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.buf[1]=0x34+ue_context_pP->local_uid; - physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.bits_unused=0; - - // CQI ReportConfig - - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic=CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic)); -#if defined(Rel10) || defined(Rel14) - *physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic= CQI_ReportModeAperiodic_rm30; -#else - *physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic=CQI_ReportConfig__cqi_ReportModeAperiodic_rm30; // HLC CQI, no PMI -#endif - physicalConfigDedicated2->cqi_ReportConfig->nomPDSCH_RS_EPRE_Offset = 0; // 0 dB - //physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic=NULL; - - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic=CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic)); - physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = CQI_ReportPeriodic_PR_release; - - //physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = CQI_ReportPeriodic_PR_setup; - //physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex = 0; // n2_pucch - //physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex = 0; // Icqi/pmi - //physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present = CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI; // subband CQI - //physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.choice.subbandCQI.k=4; - - //physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex=NULL; - //physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.simultaneousAckNackAndCQI=0; - - - //soundingRS-UL-ConfigDedicated - if (rrc->srs_enable[CC_id]==1) { - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->present = SoundingRS_UL_ConfigDedicated_PR_setup; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth = - SoundingRS_UL_ConfigDedicated__setup__srs_Bandwidth_bw0; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth = - SoundingRS_UL_ConfigDedicated__setup__srs_HoppingBandwidth_hbw0; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1; - if (carrier->sib1->tdd_Config==NULL) { // FDD - if (carrier->sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.present - == SoundingRS_UL_ConfigCommon_PR_setup) - if (carrier->sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig!=0) - LOG_W(RRC,"This code has been optimized for SRS Subframe Config 0, but current config is %zd. Expect undefined behaviour!\n", - carrier->sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig); - if (ue_context_pP->local_uid >=20) - LOG_W(RRC,"This code has been optimized for up to 10 UEs, but current UE_id is %d. Expect undefined behaviour!\n", - ue_context_pP->local_uid); - //the current code will allow for 20 UEs - to be revised for more - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=7+ue_context_pP->local_uid/2; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb= ue_context_pP->local_uid%2; - } - else { - if (carrier->sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.present - == SoundingRS_UL_ConfigCommon_PR_setup) - if (carrier->sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig!=7) { - LOG_W(RRC,"This code has been optimized for SRS Subframe Config 7 and TDD config 3, but current configs are %zd and %zd. Expect undefined behaviour!\n", - carrier->sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig, - carrier->sib1->tdd_Config->subframeAssignment); - } - if (ue_context_pP->local_uid >=6) - LOG_W(RRC,"This code has been optimized for up to 6 UEs, but current UE_id is %d. Expect undefined behaviour!\n", - ue_context_pP->local_uid); - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=17+ue_context_pP->local_uid/2; - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb= ue_context_pP->local_uid%2; - } - LOG_W(RRC,"local UID %d, srs ConfigIndex %zd, TransmissionComb %zd\n",ue_context_pP->local_uid, - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex, - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb); - - physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift= - SoundingRS_UL_ConfigDedicated__setup__cyclicShift_cs0; - } - - - //AntennaInfoDedicated - physicalConfigDedicated2->antennaInfo = CALLOC(1,sizeof(*physicalConfigDedicated2->antennaInfo)); - physicalConfigDedicated2->antennaInfo->present = PhysicalConfigDedicated__antennaInfo_PR_explicitValue; - //assign_enum(&physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode, - // AntennaInfoDedicated__transmissionMode_tm2); - - switch (transmission_mode) { - default: - LOG_W(RRC,"At RRCConnectionSetup Transmission mode can only take values 1 or 2! Defaulting to 1!\n"); - case 1: - physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm1; - break; - - case 2: - physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm2; - break; - - //case 3: - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm3; - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.codebookSubsetRestriction= CALLOC(1, - // sizeof(*physicalConfigDedicated2->antennaInfo->choice.explicitValue.codebookSubsetRestriction)); - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present = - // AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm3; - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf= MALLOC(1); - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf[0] = 0xc0; - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.size=1; - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.bits_unused=6; - - // break; - - //case 4: - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm4; - // break; - - //case 5: - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm5; - // break; - - //case 6: - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm6; - // break; - - //case 7: - // physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm7; - // break; - - } - - - physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.present = AntennaInfoDedicated__ue_TransmitAntennaSelection_PR_release; - physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.release = 0; - - // SchedulingRequestConfig - - physicalConfigDedicated2->schedulingRequestConfig->present = SchedulingRequestConfig_PR_setup; - physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 71 - ue_context_pP->local_uid/10;//ue_context_pP->local_uid; - - if (carrier->sib1->tdd_Config == NULL) { // FDD - physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 5+(ue_context_pP->local_uid%10); // Isr = 5 (every 10 subframes, offset=2+UE_id mod3) - } else { - switch (carrier->sib1->tdd_Config->subframeAssignment) { - case 1: - physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 7+(ue_context_pP->local_uid&1)+(( - ue_context_pP->local_uid&3)>>1)*5; // Isr = 5 (every 10 subframes, offset=2 for UE0, 3 for UE1, 7 for UE2, 8 for UE3 , 2 for UE4 etc..) - break; - - case 3: - physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 7+ - (ue_context_pP->local_uid%3); // Isr = 5 (every 10 subframes, offset=2 for UE0, 3 for UE1, 3 for UE2, 2 for UE3 , etc..) - break; - - case 4: - physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 7+ - (ue_context_pP->local_uid&1); // Isr = 5 (every 10 subframes, offset=2 for UE0, 3 for UE1, 3 for UE2, 2 for UE3 , etc..) - break; - - default: - physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 7; // Isr = 5 (every 10 subframes, offset=2 for all UE0 etc..) - break; - } - } - - // assign_enum(&physicalConfigDedicated2->schedulingRequestConfig->choice.setup.dsr_TransMax, - //SchedulingRequestConfig__setup__dsr_TransMax_n4); - // assign_enum(&physicalConfigDedicated2->schedulingRequestConfig->choice.setup.dsr_TransMax = SchedulingRequestConfig__setup__dsr_TransMax_n4; - physicalConfigDedicated2->schedulingRequestConfig->choice.setup.dsr_TransMax = SchedulingRequestConfig__setup__dsr_TransMax_n4; - - rrcConnectionSetup->rrc_TransactionIdentifier = Transaction_id; - rrcConnectionSetup->criticalExtensions.present = RRCConnectionSetup__criticalExtensions_PR_c1; - rrcConnectionSetup->criticalExtensions.choice.c1.present =RRCConnectionSetup__criticalExtensions__c1_PR_rrcConnectionSetup_r8 ; - rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.srb_ToAddModList = *SRB_configList; - rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.drb_ToAddModList = NULL; - rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.drb_ToReleaseList = NULL; - rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.sps_Config = NULL; - rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.physicalConfigDedicated = physicalConfigDedicated2; - rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig = NULL; -#ifdef CBA - betaOffset_CBA_Index = CALLOC(1,sizeof(long)); - cShift_CBA = CALLOC(1,sizeof(long)); - *betaOffset_CBA_Index=10; // need to be changed by Kaijie - *cShift_CBA=4; - physicalConfigDedicated2->pusch_CBAConfigDedicated_vlola->betaOffset_CBA_Index=betaOffset_CBA_Index; - physicalConfigDedicated2->pusch_CBAConfigDedicated_vlola->cShift_CBA=cShift_CBA; - rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.sps_CBA_ConfigList_vlola = NULL; -#endif - - -#ifdef XER_PRINT - xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg); -#endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, - (void*)&dl_ccch_msg, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_CCCH_Message, (void *) &dl_ccch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_CCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_dl_ccch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_ccch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"RRCConnectionSetup Encoded %zd bits (%zd bytes), ecause %d\n", - enc_rval.encoded,(enc_rval.encoded+7)/8,ecause); -#endif - - // FREEMEM(SRB_list); - // free(SRB1_config); - // free(SRB1_rlc_config); - // free(SRB1_lchan_config); - // free(SRB1_ul_SpecificParameters); - - return((enc_rval.encoded+7)/8); -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t -do_SecurityModeCommand( - const protocol_ctxt_t* const ctxt_pP, - uint8_t* const buffer, - const uint8_t Transaction_id, - const uint8_t cipheringAlgorithm, - const uint8_t integrityProtAlgorithm -) -//------------------------------------------------------------------------------ -{ - DL_DCCH_Message_t dl_dcch_msg; - asn_enc_rval_t enc_rval; - - memset(&dl_dcch_msg,0,sizeof(DL_DCCH_Message_t)); - - dl_dcch_msg.message.present = DL_DCCH_MessageType_PR_c1; - dl_dcch_msg.message.choice.c1.present = DL_DCCH_MessageType__c1_PR_securityModeCommand; - - dl_dcch_msg.message.choice.c1.choice.securityModeCommand.rrc_TransactionIdentifier = Transaction_id; - dl_dcch_msg.message.choice.c1.choice.securityModeCommand.criticalExtensions.present = SecurityModeCommand__criticalExtensions_PR_c1; - - dl_dcch_msg.message.choice.c1.choice.securityModeCommand.criticalExtensions.choice.c1.present = - SecurityModeCommand__criticalExtensions__c1_PR_securityModeCommand_r8; - // the two following information could be based on the mod_id - dl_dcch_msg.message.choice.c1.choice.securityModeCommand.criticalExtensions.choice.c1.choice.securityModeCommand_r8.securityConfigSMC.securityAlgorithmConfig.cipheringAlgorithm - = (CipheringAlgorithm_r12_t)cipheringAlgorithm; - dl_dcch_msg.message.choice.c1.choice.securityModeCommand.criticalExtensions.choice.c1.choice.securityModeCommand_r8.securityConfigSMC.securityAlgorithmConfig.integrityProtAlgorithm - = (e_SecurityAlgorithmConfig__integrityProtAlgorithm)integrityProtAlgorithm; - -#ifdef XER_PRINT - xer_fprint(stdout, &asn_DEF_DL_DCCH_Message, (void*)&dl_dcch_msg); -#endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, - (void*)&dl_dcch_msg, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_DCCH_Message, (void *) &dl_dcch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_DCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_dl_dcch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_dcch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"[eNB %d] securityModeCommand for UE %x Encoded %zd bits (%zd bytes)\n", - ctxt_pP->module_id, - ctxt_pP->rnti, - enc_rval.encoded, - (enc_rval.encoded+7)/8); -#endif - - if (enc_rval.encoded==-1) { - LOG_E(RRC,"[eNB %d] ASN1 : securityModeCommand encoding failed for UE %x\n", - ctxt_pP->module_id, - ctxt_pP->rnti); - return(-1); - } - - // rrc_ue_process_ueCapabilityEnquiry(0,1000,&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry,0); - // exit(-1); - return((enc_rval.encoded+7)/8); -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t -do_UECapabilityEnquiry( - const protocol_ctxt_t* const ctxt_pP, - uint8_t* const buffer, - const uint8_t Transaction_id -) -//------------------------------------------------------------------------------ -{ - - DL_DCCH_Message_t dl_dcch_msg; - - RAT_Type_t rat=RAT_Type_eutra; - asn_enc_rval_t enc_rval; - - memset(&dl_dcch_msg,0,sizeof(DL_DCCH_Message_t)); - - dl_dcch_msg.message.present = DL_DCCH_MessageType_PR_c1; - dl_dcch_msg.message.choice.c1.present = DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry; - - dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.rrc_TransactionIdentifier = Transaction_id; - - dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.present = UECapabilityEnquiry__criticalExtensions_PR_c1; - dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.present = - UECapabilityEnquiry__criticalExtensions__c1_PR_ueCapabilityEnquiry_r8; - dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.count=0; - ASN_SEQUENCE_ADD(&dl_dcch_msg.message.choice.c1.choice.ueCapabilityEnquiry.criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list, - &rat); - -#ifdef XER_PRINT - xer_fprint(stdout, &asn_DEF_DL_DCCH_Message, (void*)&dl_dcch_msg); -#endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, - (void*)&dl_dcch_msg, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_DCCH_Message, (void *) &dl_dcch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_CCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_dl_ccch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_ccch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"[eNB %d] UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)\n", - ctxt_pP->module_id, - ctxt_pP->rnti, - enc_rval.encoded, - (enc_rval.encoded+7)/8); -#endif - - if (enc_rval.encoded==-1) { - LOG_E(RRC,"[eNB %d] ASN1 : UECapabilityRequest encoding failed for UE %x\n", - ctxt_pP->module_id, - ctxt_pP->rnti); - return(-1); - } - - return((enc_rval.encoded+7)/8); -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint16_t -do_RRCConnectionReconfiguration( - const protocol_ctxt_t* const ctxt_pP, - uint8_t *buffer, - uint8_t Transaction_id, - SRB_ToAddModList_t *SRB_list, - DRB_ToAddModList_t *DRB_list, - DRB_ToReleaseList_t *DRB_list2, - struct SPS_Config *sps_Config, - struct PhysicalConfigDedicated *physicalConfigDedicated, - MeasObjectToAddModList_t *MeasObj_list, - ReportConfigToAddModList_t *ReportConfig_list, - QuantityConfig_t *quantityConfig, - MeasIdToAddModList_t *MeasId_list, - MAC_MainConfig_t *mac_MainConfig, - MeasGapConfig_t *measGapConfig, - MobilityControlInfo_t *mobilityInfo, - struct MeasConfig__speedStatePars *speedStatePars, - RSRP_Range_t *rsrp, - C_RNTI_t *cba_rnti, - struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList - *dedicatedInfoNASList - -#if defined(Rel10) || defined(Rel14) - , SCellToAddMod_r10_t *SCell_config -#endif -) -//------------------------------------------------------------------------------ -{ - - asn_enc_rval_t enc_rval; - - DL_DCCH_Message_t dl_dcch_msg; - RRCConnectionReconfiguration_t *rrcConnectionReconfiguration; - - - memset(&dl_dcch_msg,0,sizeof(DL_DCCH_Message_t)); - - dl_dcch_msg.message.present = DL_DCCH_MessageType_PR_c1; - dl_dcch_msg.message.choice.c1.present = DL_DCCH_MessageType__c1_PR_rrcConnectionReconfiguration; - rrcConnectionReconfiguration = &dl_dcch_msg.message.choice.c1.choice.rrcConnectionReconfiguration; - - // RRCConnectionReconfiguration - rrcConnectionReconfiguration->rrc_TransactionIdentifier = Transaction_id; - rrcConnectionReconfiguration->criticalExtensions.present = RRCConnectionReconfiguration__criticalExtensions_PR_c1; - rrcConnectionReconfiguration->criticalExtensions.choice.c1.present =RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8 ; - - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated = CALLOC(1, - sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated)); - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->srb_ToAddModList = SRB_list; - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList = DRB_list; - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToReleaseList = DRB_list2; - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->sps_Config = sps_Config; - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->physicalConfigDedicated = physicalConfigDedicated; -#ifdef CBA - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->cba_RNTI_vlola= cba_rnti; -#endif - - if (mac_MainConfig!=NULL) { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->mac_MainConfig = CALLOC(1, - sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->mac_MainConfig)); - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->mac_MainConfig->present - =RadioResourceConfigDedicated__mac_MainConfig_PR_explicitValue; - memcpy(&rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue, - mac_MainConfig, - sizeof(*mac_MainConfig)); - } else { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->mac_MainConfig=NULL; - } - - if (MeasId_list != NULL) { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig = CALLOC(1, - sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig)); - memset((void*)rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig, - 0, sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig)); - - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->reportConfigToAddModList = ReportConfig_list; - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measIdToAddModList = MeasId_list; - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measObjectToAddModList = MeasObj_list; - - if (quantityConfig!=NULL) { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->quantityConfig = CALLOC(1, - sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->quantityConfig)); - memcpy((void *)rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->quantityConfig, - (void *)quantityConfig, - sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->quantityConfig)); - } else { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->quantityConfig = NULL; - } - - if(speedStatePars != NULL) { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->speedStatePars = CALLOC(1, - sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->speedStatePars)); - memcpy((void *)rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->speedStatePars, - (void *)speedStatePars,sizeof(*speedStatePars)); - } else { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->speedStatePars = NULL; - } - - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->s_Measure= rsrp; - } else { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig = NULL; - } - - if (mobilityInfo !=NULL) { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo = CALLOC(1, - sizeof(*rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo)); - memcpy((void*)rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo, (void*)mobilityInfo, - sizeof(MobilityControlInfo_t)); - - } else { - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo = NULL; - } - - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.dedicatedInfoNASList = dedicatedInfoNASList; - rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.securityConfigHO = NULL; - - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, - (void*)&dl_dcch_msg, - buffer, - RRC_BUF_SIZE); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %zd)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#ifdef XER_PRINT - xer_fprint(stdout,&asn_DEF_DL_DCCH_Message,(void*)&dl_dcch_msg); -#endif - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[30000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_DCCH_Message, (void *) &dl_dcch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_DCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_dl_dcch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_dcch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p); - } - } -# endif -#endif - - //#ifdef USER_MODE - LOG_I(RRC,"RRCConnectionReconfiguration Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); - // for (i=0;i<30;i++) - // msg("%x.",buffer[i]); - // msg("\n"); - - //#endif - - return((enc_rval.encoded+7)/8); -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t -do_RRCConnectionReestablishmentReject( - uint8_t Mod_id, - uint8_t* const buffer) -//------------------------------------------------------------------------------ -{ - - asn_enc_rval_t enc_rval; - - DL_CCCH_Message_t dl_ccch_msg; - RRCConnectionReestablishmentReject_t *rrcConnectionReestablishmentReject; - - memset((void *)&dl_ccch_msg,0,sizeof(DL_CCCH_Message_t)); - dl_ccch_msg.message.present = DL_CCCH_MessageType_PR_c1; - dl_ccch_msg.message.choice.c1.present = DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishmentReject; - rrcConnectionReestablishmentReject = &dl_ccch_msg.message.choice.c1.choice.rrcConnectionReestablishmentReject; - - // RRCConnectionReestablishmentReject - rrcConnectionReestablishmentReject->criticalExtensions.present = RRCConnectionReestablishmentReject__criticalExtensions_PR_rrcConnectionReestablishmentReject_r8; - -#ifdef XER_PRINT - xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg); -#endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, - (void*)&dl_ccch_msg, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_CCCH_Message, (void *) &dl_ccch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_CCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_dl_ccch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_ccch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"RRCConnectionReestablishmentReject Encoded %zd bits (%zd bytes)\n", - enc_rval.encoded,(enc_rval.encoded+7)/8); -#endif - - return((enc_rval.encoded+7)/8); -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t -do_RRCConnectionReject( - uint8_t Mod_id, - uint8_t* const buffer) -//------------------------------------------------------------------------------ -{ - - asn_enc_rval_t enc_rval; - - DL_CCCH_Message_t dl_ccch_msg; - RRCConnectionReject_t *rrcConnectionReject; - - memset((void *)&dl_ccch_msg,0,sizeof(DL_CCCH_Message_t)); - dl_ccch_msg.message.present = DL_CCCH_MessageType_PR_c1; - dl_ccch_msg.message.choice.c1.present = DL_CCCH_MessageType__c1_PR_rrcConnectionReject; - rrcConnectionReject = &dl_ccch_msg.message.choice.c1.choice.rrcConnectionReject; - - // RRCConnectionReject - rrcConnectionReject->criticalExtensions.present = RRCConnectionReject__criticalExtensions_PR_c1; - rrcConnectionReject->criticalExtensions.choice.c1.present = RRCConnectionReject__criticalExtensions__c1_PR_rrcConnectionReject_r8; - /// let's put a wait time of 1s for the moment - rrcConnectionReject->criticalExtensions.choice.c1.choice.rrcConnectionReject_r8.waitTime = 1; - -#ifdef XER_PRINT - xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg); -#endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, - (void*)&dl_ccch_msg, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %ld)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_CCCH_Message, (void *) &dl_ccch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_CCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_dl_ccch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_ccch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"RRCConnectionReject Encoded %zd bits (%zd bytes)\n", - enc_rval.encoded,(enc_rval.encoded+7)/8); -#endif - - return((enc_rval.encoded+7)/8); -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t do_RRCConnectionRelease( - uint8_t Mod_id, - uint8_t *buffer, - uint8_t Transaction_id) -{ - - asn_enc_rval_t enc_rval; - - DL_DCCH_Message_t dl_dcch_msg; - RRCConnectionRelease_t *rrcConnectionRelease; - - - memset(&dl_dcch_msg,0,sizeof(DL_DCCH_Message_t)); - - dl_dcch_msg.message.present = DL_DCCH_MessageType_PR_c1; - dl_dcch_msg.message.choice.c1.present = DL_DCCH_MessageType__c1_PR_rrcConnectionRelease; - rrcConnectionRelease = &dl_dcch_msg.message.choice.c1.choice.rrcConnectionRelease; - - // RRCConnectionRelease - rrcConnectionRelease->rrc_TransactionIdentifier = Transaction_id; - rrcConnectionRelease->criticalExtensions.present = RRCConnectionRelease__criticalExtensions_PR_c1; - rrcConnectionRelease->criticalExtensions.choice.c1.present =RRCConnectionRelease__criticalExtensions__c1_PR_rrcConnectionRelease_r8 ; - - rrcConnectionRelease->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r8.releaseCause = ReleaseCause_other; - rrcConnectionRelease->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r8.redirectedCarrierInfo = NULL; - rrcConnectionRelease->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r8.idleModeMobilityControlInfo = NULL; - - rrcConnectionRelease->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r8.nonCriticalExtension=CALLOC(1, - sizeof(*rrcConnectionRelease->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r8.nonCriticalExtension)); - - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, - (void*)&dl_dcch_msg, - buffer, - RRC_BUF_SIZE); - - return((enc_rval.encoded+7)/8); -} -*/ - -/* -uint8_t TMGI[5] = {4,3,2,1,0};//TMGI is a string of octet, ref. TS 24.008 fig. 10.5.4a -*/ - -//------------------------------------------------------------------------------ - -/* -#if defined(Rel10) || defined(Rel14) -uint8_t do_MBSFNAreaConfig(uint8_t Mod_id, - uint8_t sync_area, - uint8_t *buffer, - MCCH_Message_t *mcch_message, - MBSFNAreaConfiguration_r9_t **mbsfnAreaConfiguration) -{ - - asn_enc_rval_t enc_rval; - MBSFN_SubframeConfig_t *mbsfn_SubframeConfig1; - PMCH_Info_r9_t *pmch_Info_1; - MBMS_SessionInfo_r9_t *mbms_Session_1; - // MBMS_SessionInfo_r9_t *mbms_Session_2; - eNB_RRC_INST *rrc = RC.rrc[Mod_id]; - rrc_eNB_carrier_data_t *carrier = &rrc->carrier[0]; - - - memset(mcch_message,0,sizeof(MCCH_Message_t)); - mcch_message->message.present = MCCH_MessageType_PR_c1; - mcch_message->message.choice.c1.present = MCCH_MessageType__c1_PR_mbsfnAreaConfiguration_r9; - *mbsfnAreaConfiguration = &mcch_message->message.choice.c1.choice.mbsfnAreaConfiguration_r9; - - // Common Subframe Allocation (CommonSF-Alloc-r9) - - mbsfn_SubframeConfig1= CALLOC(1,sizeof(*mbsfn_SubframeConfig1)); - memset((void*)mbsfn_SubframeConfig1,0,sizeof(*mbsfn_SubframeConfig1)); - // - mbsfn_SubframeConfig1->radioframeAllocationPeriod= MBSFN_SubframeConfig__radioframeAllocationPeriod_n4; - mbsfn_SubframeConfig1->radioframeAllocationOffset= 1; - mbsfn_SubframeConfig1->subframeAllocation.present= MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame; - mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1); - mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1; - mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2; - - // CURRENTLY WE ARE SUPPORITNG ONLY ONE sf ALLOCATION - switch (sync_area) { - case 0: - if (carrier->sib1->tdd_Config != NULL) {// pattern 001110 for TDD - mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2bits cuz 2last bits are unused. - } else { //111000 - mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2; - } - - break; - - case 1: - if (carrier->sib1->tdd_Config != NULL) { - mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2bits cuz 2last bits are unused. - } else { // 000111 - mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2; - } - - default : - break; - } - - ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->commonSF_Alloc_r9.list,mbsfn_SubframeConfig1); - - // commonSF-AllocPeriod-r9 - (*mbsfnAreaConfiguration)->commonSF_AllocPeriod_r9= MBSFNAreaConfiguration_r9__commonSF_AllocPeriod_r9_rf16; - - // PMCHs Information List (PMCH-InfoList-r9) - // PMCH_1 Config - pmch_Info_1 = CALLOC(1,sizeof(PMCH_Info_r9_t)); - memset((void*)pmch_Info_1,0,sizeof(PMCH_Info_r9_t)); - - - ///take the value of last mbsfn subframe in this CSA period because there is only one PMCH in this mbsfn area - ///Note: this has to be set based on the subframeAllocation and CSA - - pmch_Info_1->pmch_Config_r9.sf_AllocEnd_r9= 3; - pmch_Info_1->pmch_Config_r9.dataMCS_r9= 7; - pmch_Info_1->pmch_Config_r9.mch_SchedulingPeriod_r9= PMCH_Config_r9__mch_SchedulingPeriod_r9_rf16; - - // MBMSs-SessionInfoList-r9 - // pmch_Info_1->mbms_SessionInfoList_r9 = CALLOC(1,sizeof(struct MBMS_SessionInfoList_r9)); - // Session 1 - mbms_Session_1 = CALLOC(1,sizeof(MBMS_SessionInfo_r9_t)); - memset(mbms_Session_1,0,sizeof(MBMS_SessionInfo_r9_t)); - // TMGI value - mbms_Session_1->tmgi_r9.plmn_Id_r9.present= TMGI_r9__plmn_Id_r9_PR_plmn_Index_r9; - mbms_Session_1->tmgi_r9.plmn_Id_r9.choice.plmn_Index_r9= 1; - // Service ID - memset(&mbms_Session_1->tmgi_r9.serviceId_r9,0,sizeof(OCTET_STRING_t));// need to check - OCTET_STRING_fromBuf(&mbms_Session_1->tmgi_r9.serviceId_r9,(const char*)&TMGI[2],3); - // Session ID is still missing here, it can be used as an rab id or mrb id - mbms_Session_1->sessionId_r9 = CALLOC(1,sizeof(OCTET_STRING_t)); - mbms_Session_1->sessionId_r9->buf= MALLOC(1); - mbms_Session_1->sessionId_r9->size= 1; - mbms_Session_1->sessionId_r9->buf[0]= MTCH; - // Logical Channel ID - mbms_Session_1->logicalChannelIdentity_r9= MTCH; - ASN_SEQUENCE_ADD(&pmch_Info_1->mbms_SessionInfoList_r9.list,mbms_Session_1); - - /// Session 2 - //mbms_Session_2 = CALLOC(1,sizeof(MBMS_SessionInfo_r9_t)); - //memset(mbms_Session_2,0,sizeof(MBMS_SessionInfo_r9_t)); - /// TMGI value - //mbms_Session_2->tmgi_r9.plmn_Id_r9.present= TMGI_r9__plmn_Id_r9_PR_plmn_Index_r9; - //mbms_Session_2->tmgi_r9.plmn_Id_r9.choice.plmn_Index_r9= 1; - /// Service ID - //memset(&mbms_Session_2->tmgi_r9.serviceId_r9,0,sizeof(OCTET_STRING_t));// need to check - //OCTET_STRING_fromBuf(&mbms_Session_2->tmgi_r9.serviceId_r9,(const char*)&TMGI[3],3); - /// Session ID is still missing here - //mbms_Session_2->sessionID_r9->buf= MALLOC(1); - //mbms_Session_2->sessionID_r9->size= 1; - //mbms_Session_2->sessionID_r9->buf[0]= 0x11; - /// Logical Channel ID - //mbms_Session_2->logicalChannelIdentity_r9= 2; - //ASN_SEQUENCE_ADD(&pmch_Info_1->mbms_SessionInfoList_r9.list,mbms_Session_2); - - ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->pmch_InfoList_r9.list,pmch_Info_1); - -#ifdef XER_PRINT - xer_fprint(stdout,&asn_DEF_MCCH_Message,(void*)mcch_message); -#endif - enc_rval = uper_encode_to_buffer(&asn_DEF_MCCH_Message, - (void*)mcch_message, - buffer, - 100); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_MCCH_Message, (void *) &mcch_message)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_MCCH, message_string_size); - msg_p->ittiMsg.rrc_dl_mcch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_mcch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - LOG_D(RRC,"[eNB] MCCH Message Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); -#endif - - if (enc_rval.encoded==-1) { - msg("[RRC] ASN1 : MCCH encoding failed for MBSFNAreaConfiguration\n"); - return(-1); - } - - return((enc_rval.encoded+7)/8); -} -#endif -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_id,long rsrp_s,long rsrq_s,long rsrp_t,long rsrq_t) -{ - - asn_enc_rval_t enc_rval; - - UL_DCCH_Message_t ul_dcch_msg; - - MeasurementReport_t *measurementReport; - - ul_dcch_msg.message.present = UL_DCCH_MessageType_PR_c1; - ul_dcch_msg.message.choice.c1.present = UL_DCCH_MessageType__c1_PR_measurementReport; - measurementReport = &ul_dcch_msg.message.choice.c1.choice.measurementReport; - - measurementReport->criticalExtensions.present=MeasurementReport__criticalExtensions_PR_c1; - measurementReport->criticalExtensions.choice.c1.present=MeasurementReport__criticalExtensions__c1_PR_measurementReport_r8; - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.nonCriticalExtension=CALLOC(1, - sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.nonCriticalExtension)); - - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measId=measid; -#if defined(Rel10) || defined(Rel14) - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultPCell.rsrpResult=rsrp_s; - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultPCell.rsrqResult=rsrq_s; -#else - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultServCell.rsrpResult=rsrp_s; - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultServCell.rsrqResult=rsrq_s; -#endif - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells=CALLOC(1, - sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells)); - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->present=MeasResults__measResultNeighCells_PR_measResultListEUTRA; - - MeasResultListEUTRA_t *measResultListEUTRA2; - measResultListEUTRA2 = CALLOC(1,sizeof(*measResultListEUTRA2)); - - struct MeasResultEUTRA *measresulteutra2; - measresulteutra2 = CALLOC(1,sizeof(*measresulteutra2)); - measresulteutra2->physCellId=phy_id;//1; - - struct MeasResultEUTRA__cgi_Info *measresult_cgi2; - measresult_cgi2 = CALLOC(1,sizeof(*measresult_cgi2)); - - memset(&measresult_cgi2->cellGlobalId.plmn_Identity,0,sizeof(measresult_cgi2->cellGlobalId.plmn_Identity)); - - // measresult_cgi2->cellGlobalId.plmn_Identity.mcc=CALLOC(1,sizeof(measresult_cgi2->cellGlobalId.plmn_Identity.mcc)); - measresult_cgi2->cellGlobalId.plmn_Identity.mcc = CALLOC(1, sizeof(*measresult_cgi2->cellGlobalId.plmn_Identity.mcc)); - - asn_set_empty(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list);//.size=0; - - MCC_MNC_Digit_t dummy; - dummy=2; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list,&dummy); - dummy=6; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list,&dummy); - dummy=2; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mcc->list,&dummy); - - measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list.size=0; - measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list.count=0; - dummy=8; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list,&dummy); - dummy=0; - ASN_SEQUENCE_ADD(&measresult_cgi2->cellGlobalId.plmn_Identity.mnc.list,&dummy); - - measresult_cgi2->cellGlobalId.cellIdentity.buf=MALLOC(8); - measresult_cgi2->cellGlobalId.cellIdentity.buf[0]=0x01; - measresult_cgi2->cellGlobalId.cellIdentity.buf[1]=0x48; - measresult_cgi2->cellGlobalId.cellIdentity.buf[2]=0x0f; - measresult_cgi2->cellGlobalId.cellIdentity.buf[3]=0x03; - measresult_cgi2->cellGlobalId.cellIdentity.size=4; - measresult_cgi2->cellGlobalId.cellIdentity.bits_unused=4; - - measresult_cgi2->trackingAreaCode.buf = MALLOC(2); - measresult_cgi2->trackingAreaCode.buf[0]=0x00; - measresult_cgi2->trackingAreaCode.buf[1]=0x10; - measresult_cgi2->trackingAreaCode.size=2; - measresult_cgi2->trackingAreaCode.bits_unused=0; - - - measresulteutra2->cgi_Info=measresult_cgi2; - - struct MeasResultEUTRA__measResult meas2; - // int rsrp_va=10; - - meas2.rsrpResult=&(rsrp_t); - //&rsrp_va; - meas2.rsrqResult=&(rsrq_t); - - measresulteutra2->measResult=meas2; - - ASN_SEQUENCE_ADD(&measResultListEUTRA2->list,measresulteutra2); - - measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2); - - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, - (void*)&ul_dcch_msg, - buffer, - 100); - - - - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if !defined(DISABLE_XER_SPRINT) - { - char message_string[20000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_DCCH_Message, (void *) &ul_dcch_msg)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_DL_DCCH, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_dl_dcch.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_dl_dcch.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, NB_eNB_INST + Mod_id, msg_p); - } - } -# endif -#endif - -#ifdef USER_MODE - printf("Measurement Report Encoded %zu bits (%zu bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); -#endif - - return((enc_rval.encoded+7)/8); -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t transaction_id, uint32_t pdu_length, uint8_t *pdu_buffer) -{ - ssize_t encoded; - - DL_DCCH_Message_t dl_dcch_msg; - - memset(&dl_dcch_msg, 0, sizeof(DL_DCCH_Message_t)); - - dl_dcch_msg.message.present = DL_DCCH_MessageType_PR_c1; - dl_dcch_msg.message.choice.c1.present = DL_DCCH_MessageType__c1_PR_dlInformationTransfer; - dl_dcch_msg.message.choice.c1.choice.dlInformationTransfer.rrc_TransactionIdentifier = transaction_id; - dl_dcch_msg.message.choice.c1.choice.dlInformationTransfer.criticalExtensions.present = DLInformationTransfer__criticalExtensions_PR_c1; - dl_dcch_msg.message.choice.c1.choice.dlInformationTransfer.criticalExtensions.choice.c1.present = DLInformationTransfer__criticalExtensions__c1_PR_dlInformationTransfer_r8; - dl_dcch_msg.message.choice.c1.choice.dlInformationTransfer.criticalExtensions.choice.c1.choice.dlInformationTransfer_r8.dedicatedInfoType.present = - DLInformationTransfer_r8_IEs__dedicatedInfoType_PR_dedicatedInfoNAS; - dl_dcch_msg.message.choice.c1.choice.dlInformationTransfer.criticalExtensions.choice.c1.choice.dlInformationTransfer_r8.dedicatedInfoType.choice.dedicatedInfoNAS.size = pdu_length; - dl_dcch_msg.message.choice.c1.choice.dlInformationTransfer.criticalExtensions.choice.c1.choice.dlInformationTransfer_r8.dedicatedInfoType.choice.dedicatedInfoNAS.buf = pdu_buffer; - - encoded = uper_encode_to_new_buffer (&asn_DEF_DL_DCCH_Message, NULL, (void*) &dl_dcch_msg, (void **) buffer); - - -// #if defined(ENABLE_ITTI) -// # if !defined(DISABLE_XER_SPRINT) -// { -// char message_string[10000]; -// size_t message_string_size; - -// if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_DCCH_Message, (void *)&dl_dcch_msg)) > 0) { -// MessageDef *msg_p; - -// msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_DCCH, message_string_size + sizeof (IttiMsgText)); -// msg_p->ittiMsg.rrc_dl_dcch.size = message_string_size; -// memcpy(&msg_p->ittiMsg.rrc_dl_dcch.text, message_string, message_string_size); - -// itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p); -// } -// } -// # endif -// #endif - - - return encoded; -} -*/ - -//------------------------------------------------------------------------------ - -/* -uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer) -{ - ssize_t encoded; - - UL_DCCH_Message_t ul_dcch_msg; - - memset(&ul_dcch_msg, 0, sizeof(UL_DCCH_Message_t)); - - ul_dcch_msg.message.present = UL_DCCH_MessageType_PR_c1; - ul_dcch_msg.message.choice.c1.present = UL_DCCH_MessageType__c1_PR_ulInformationTransfer; - ul_dcch_msg.message.choice.c1.choice.ulInformationTransfer.criticalExtensions.present = ULInformationTransfer__criticalExtensions_PR_c1; - ul_dcch_msg.message.choice.c1.choice.ulInformationTransfer.criticalExtensions.choice.c1.present = DLInformationTransfer__criticalExtensions__c1_PR_dlInformationTransfer_r8; - ul_dcch_msg.message.choice.c1.choice.ulInformationTransfer.criticalExtensions.choice.c1.choice.ulInformationTransfer_r8.dedicatedInfoType.present = - ULInformationTransfer_r8_IEs__dedicatedInfoType_PR_dedicatedInfoNAS; - ul_dcch_msg.message.choice.c1.choice.ulInformationTransfer.criticalExtensions.choice.c1.choice.ulInformationTransfer_r8.dedicatedInfoType.choice.dedicatedInfoNAS.size = pdu_length; - ul_dcch_msg.message.choice.c1.choice.ulInformationTransfer.criticalExtensions.choice.c1.choice.ulInformationTransfer_r8.dedicatedInfoType.choice.dedicatedInfoNAS.buf = pdu_buffer; - - encoded = uper_encode_to_new_buffer (&asn_DEF_UL_DCCH_Message, NULL, (void*) &ul_dcch_msg, (void **) buffer); - - return encoded; -} -*/ - -//------------------------------------------------------------------------------ - -/* -OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname) -{ - static OAI_UECapability_t UECapability; /// TODO declared static to allow returning this has an address should be allocated in a cleaner way. - static SupportedBandEUTRA_t Bandlist[4]; // the macro ASN_SEQUENCE_ADD() does not copy the source, but only stores a reference to it - static InterFreqBandInfo_t InterFreqBandInfo[4][4]; // the macro ASN_SEQUENCE_ADD() does not copy the source, but only stores a reference to it - static BandInfoEUTRA_t BandInfoEUTRA[4]; // the macro ASN_SEQUENCE_ADD() does not copy the source, but only stores a reference to it - - asn_enc_rval_t enc_rval; - asn_dec_rval_t dec_rval; - - long maxNumberROHC_ContextSessions = PDCP_Parameters__maxNumberROHC_ContextSessions_cs16; - int i; - - UE_EUTRA_Capability_t *UE_EUTRA_Capability; - char UE_EUTRA_Capability_xer[8192]; - size_t size; - - LOG_I(RRC,"Allocating %zu bytes for UE_EUTRA_Capability\n",sizeof(*UE_EUTRA_Capability)); - - UE_EUTRA_Capability = CALLOC(1, sizeof(*UE_EUTRA_Capability)); - - assert(UE_EUTRA_Capability); - - if (!UE_EUTRA_Capability_xer_fname) { - Bandlist[0].bandEUTRA = 3; // UL 1710-1785, DL 1805-1880 FDD - Bandlist[0].halfDuplex = 0; - Bandlist[1].bandEUTRA = 20; // UL 824-849 , DL 869-894 FDD - Bandlist[1].halfDuplex = 0; - Bandlist[2].bandEUTRA = 7; // UL 2500-2570, DL 2620-2690 FDD - Bandlist[2].halfDuplex = 0; - Bandlist[3].bandEUTRA = 38; // UL/DL 2570-2620, TDD - Bandlist[3].halfDuplex = 0; - - memset((void*)InterFreqBandInfo, 0, sizeof(InterFreqBandInfo)); - memset((void*)BandInfoEUTRA, 0, sizeof(BandInfoEUTRA)); - - InterFreqBandInfo[0][0].interFreqNeedForGaps = 0; - InterFreqBandInfo[0][1].interFreqNeedForGaps = 1; - InterFreqBandInfo[0][2].interFreqNeedForGaps = 1; - InterFreqBandInfo[0][3].interFreqNeedForGaps = 1; - InterFreqBandInfo[1][0].interFreqNeedForGaps = 1; - InterFreqBandInfo[1][1].interFreqNeedForGaps = 0; - InterFreqBandInfo[1][2].interFreqNeedForGaps = 1; - InterFreqBandInfo[1][3].interFreqNeedForGaps = 1; - InterFreqBandInfo[2][0].interFreqNeedForGaps = 1; - InterFreqBandInfo[2][1].interFreqNeedForGaps = 1; - InterFreqBandInfo[2][2].interFreqNeedForGaps = 0; - InterFreqBandInfo[2][3].interFreqNeedForGaps = 1; - InterFreqBandInfo[3][0].interFreqNeedForGaps = 1; - InterFreqBandInfo[3][1].interFreqNeedForGaps = 1; - InterFreqBandInfo[3][2].interFreqNeedForGaps = 1; - InterFreqBandInfo[3][3].interFreqNeedForGaps = 0; - - - UE_EUTRA_Capability->accessStratumRelease = 0;//AccessStratumRelease_rel8; - UE_EUTRA_Capability->ue_Category = 4; - UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0001=0; - UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0002=0; - UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0003=0; - UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0004=0; - UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0006=0; - UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0101=0; - UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0102=0; - UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0103=0; - UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0104=0; - - UE_EUTRA_Capability->pdcp_Parameters.maxNumberROHC_ContextSessions = &maxNumberROHC_ContextSessions; - - UE_EUTRA_Capability->phyLayerParameters.ue_TxAntennaSelectionSupported = 0; - UE_EUTRA_Capability->phyLayerParameters.ue_SpecificRefSigsSupported = 0; - UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list.count = 0; - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[3]); - - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[3]); - - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][3]); - - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][3]); - - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][3]); - - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][0]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][1]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][2]); - ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][3]); - - // UE_EUTRA_Capability->measParameters.bandListEUTRA.list.count = 0; // no measurements on other bands - // UE_EUTRA_Capability->featureGroupIndicators // null - - if(usim_test == 1) - { - // featureGroup is mandatory for CMW tests - // featureGroup is filled only for usim-test mode - BIT_STRING_t *bit_string = CALLOC(1, sizeof(*bit_string)); - char featrG[4] = { 0x00, 0x08, 0x00, 0x04 }; - bit_string->buf = CALLOC(1, 4); - memcpy(bit_string->buf, featrG, 4); - bit_string->size = 4; - bit_string->bits_unused = 0; - UE_EUTRA_Capability->featureGroupIndicators = bit_string; - } - - // UE_EUTRA_Capability->interRAT_Parameters // null - } else { - - FILE* f = fopen(UE_EUTRA_Capability_xer_fname, "r"); - assert(f); - size = fread(UE_EUTRA_Capability_xer, 1, sizeof UE_EUTRA_Capability_xer, f); - fclose(f); - - if (size == 0 || size == sizeof UE_EUTRA_Capability_xer) { - LOG_E(RRC,"UE Capabilities XER file %s is too large\n", UE_EUTRA_Capability_xer_fname); - free( UE_EUTRA_Capability); - return(NULL); - } - - dec_rval = xer_decode(0, &asn_DEF_UE_EUTRA_Capability, (void*)UE_EUTRA_Capability, UE_EUTRA_Capability_xer, size); - assert(dec_rval.code == RC_OK); - } - - UECapability.UE_EUTRA_Capability = UE_EUTRA_Capability; -#ifdef XER_PRINT - xer_fprint(stdout,&asn_DEF_UE_EUTRA_Capability,(void *)UE_EUTRA_Capability); -#endif - enc_rval = uper_encode_to_buffer(&asn_DEF_UE_EUTRA_Capability, - (void*)UE_EUTRA_Capability, - &UECapability.sdu[0], - MAX_UE_CAPABILITY_SIZE); - AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - -#if defined(ENABLE_ITTI) -# if defined(DISABLE_XER_SPRINT) - { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message (TASK_RRC_UE, RRC_UE_EUTRA_CAPABILITY); - memcpy (&msg_p->ittiMsg, (void *) UE_EUTRA_Capability, sizeof(RrcUeEutraCapability)); - - itti_send_msg_to_task (TASK_UNKNOWN, NB_eNB_INST, msg_p); - } -# else - { - char message_string[10000]; - size_t message_string_size; - - if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UE_EUTRA_Capability, (void *)UE_EUTRA_Capability)) > 0) { - MessageDef *msg_p; - - msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_UE_EUTRA_CAPABILITY, message_string_size + sizeof (IttiMsgText)); - msg_p->ittiMsg.rrc_ue_eutra_capability.size = message_string_size; - memcpy(&msg_p->ittiMsg.rrc_ue_eutra_capability.text, message_string, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, msg_p); - } - } -# endif -#endif - - UECapability.sdu_size = (enc_rval.encoded + 7) / 8; - LOG_I(PHY, "[RRC]UE Capability encoded, %d bytes (%zd bits)\n", - UECapability.sdu_size, enc_rval.encoded + 7); - { - char *sdu; - //sdu = malloc (3 * UECapability.sdu_size + 1 ); ///* For '\0' - - for (i = 0; i < UECapability.sdu_size; i++) { - sprintf (&sdu[3 * i], "%02x.", UECapability.sdu[i]); - } - - LOG_D(PHY, "[RRC]UE Capability encoded, %s\n", sdu); - free(sdu); - } - - return(&UECapability); } - diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 640c86dade3cbb788ae3f1fc3e09abd3b78d0c56..67cb7e58877b176226a2151f224b6826070ccc78 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -28,7 +28,6 @@ * \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr */ -#ifdef USER_MODE #include <stdio.h> #include <sys/types.h> #include <stdlib.h> /* for atoi(3) */ @@ -36,14 +35,11 @@ #include <string.h> /* for strerror(3) */ #include <sysexits.h> /* for EX_* exit codes */ #include <errno.h> /* for errno */ -#else -#include <linux/module.h> /* Needed by all modules */ -#endif #include <asn_application.h> #include <asn_internal.h> /* for _ASN_DEFAULT_STACK_MAX */ -#include "RRC/NR/defs_NR.h" +#include "RRC/NR/nr_rrc_defs.h" /* * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) @@ -81,194 +77,18 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier, @param configuration Pointer Configuration Request structure @return size of encoded bit stream in bytes*/ -uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,int Mod_id,int CC_id, gNB_RrcConfigurationReq *configuration - ); +uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,int Mod_id,int CC_id, gNB_RrcConfigurationReq *configuration); -/** -\brief Generate a default configuration for SIB2/SIB3 in one System Information PDU (eNB). -@param Mod_id Index of eNB (used to derive some parameters) -@param buffer Pointer to PER-encoded ASN.1 description of SI PDU -@param systemInformation Pointer to asn1c C representation of SI PDU -@param sib2 Pointer (returned) to sib2 component withing SI PDU -@param sib3 Pointer (returned) to sib3 component withing SI PDU -@param sib13 Pointer (returned) to sib13 component withing SI PDU -@param MBMS_flag Indicates presence of MBMS system information (when 1) -@return size of encoded bit stream in bytes*/ - -/*uint8_t do_SIB23(uint8_t Mod_id, - int CC_id -#if defined(ENABLE_ITTI) - , RrcConfigurationReq *configuration -#endif - ); - -/** -\brief Generate an RRCConnectionRequest UL-CCCH-Message (UE) based on random string or S-TMSI. This -routine only generates an mo-data establishment cause. -@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU -@param rv 5 byte random string or S-TMSI -@returns Size of encoded bit stream in bytes*/ - -/*uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv); - -/** \brief Generate an RRCConnectionSetupComplete UL-DCCH-Message (UE) -@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU -@returns Size of encoded bit stream in bytes*/ - -/*uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t* buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength, - const char* dedicatedInfoNAS); - -/** \brief Generate an RRCConnectionReconfigurationComplete UL-DCCH-Message (UE) -@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU -@returns Size of encoded bit stream in bytes*/ - -/*uint8_t -do_RRCConnectionReconfigurationComplete( - const protocol_ctxt_t* const ctxt_pP, - uint8_t* buffer, - const uint8_t Transaction_id -); - -/** -\brief Generate an RRCConnectionSetup DL-CCCH-Message (eNB). This routine configures SRB_ToAddMod (SRB1/SRB2) and -PhysicalConfigDedicated IEs. The latter does not enable periodic CQI reporting (PUCCH format 2/2a/2b) or SRS. -@param ctxt_pP Running context -@param ue_context_pP UE context -@param CC_id Component Carrier ID -@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU -@param transmission_mode Transmission mode for UE (1-9) -@param UE_id UE index for this message -@param Transaction_id Transaction_ID for this message -@param SRB_configList Pointer (returned) to SRB1_config/SRB2_config(later) IEs for this UE -@param physicalConfigDedicated Pointer (returned) to PhysicalConfigDedicated IE for this UE -@returns Size of encoded bit stream in bytes*/ -/*uint8_t -do_RRCConnectionSetup( - const protocol_ctxt_t* const ctxt_pP, - rrc_eNB_ue_context_t* const ue_context_pP, - int CC_id, - uint8_t* const buffer, - const uint8_t transmission_mode, - const uint8_t Transaction_id, - SRB_ToAddModList_t** SRB_configList, - struct PhysicalConfigDedicated** physicalConfigDedicated -); +void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id, + int CC_id + #if defined(ENABLE_ITTI) + ,gNB_RrcConfigurationReq *configuration + #endif + ); -/** -\brief Generate an RRCConnectionReconfiguration DL-DCCH-Message (eNB). This routine configures SRBToAddMod (SRB2) and one DRBToAddMod -(DRB3). PhysicalConfigDedicated is not updated. -@param ctxt_pP Running context -@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU -@param Transaction_id Transaction_ID for this message -@param SRB_list Pointer to SRB List to be added/modified (NULL if no additions/modifications) -@param DRB_list Pointer to DRB List to be added/modified (NULL if no additions/modifications) -@param DRB_list2 Pointer to DRB List to be released (NULL if none to be released) -@param sps_Config Pointer to sps_Config to be modified (NULL if no modifications, or default if initial configuration) -@param physicalConfigDedicated Pointer to PhysicalConfigDedicated to be modified (NULL if no modifications) -@param MeasObj_list Pointer to MeasObj List to be added/modified (NULL if no additions/modifications) -@param ReportConfig_list Pointer to ReportConfig List (NULL if no additions/modifications) -@param QuantityConfig Pointer to QuantityConfig to be modified (NULL if no modifications) -@param MeasId_list Pointer to MeasID List (NULL if no additions/modifications) -@param mobilityInfo mobility control information for handover -@param speedStatePars speed state parameteres for handover -@param mac_MainConfig Pointer to Mac_MainConfig(NULL if no modifications) -@param measGapConfig Pointer to MeasGapConfig (NULL if no modifications) -@param cba_rnti RNTI for the cba transmission -@returns Size of encoded bit stream in bytes*/ - -/*uint16_t -do_RRCConnectionReconfiguration( - const protocol_ctxt_t* const ctxt_pP, - uint8_t *buffer, - uint8_t Transaction_id, - SRB_ToAddModList_t *SRB_list, - DRB_ToAddModList_t *DRB_list, - DRB_ToReleaseList_t *DRB_list2, - struct SPS_Config *sps_Config, - struct PhysicalConfigDedicated *physicalConfigDedicated, - MeasObjectToAddModList_t *MeasObj_list, - ReportConfigToAddModList_t *ReportConfig_list, - QuantityConfig_t *quantityConfig, - MeasIdToAddModList_t *MeasId_list, - MAC_MainConfig_t *mac_MainConfig, - MeasGapConfig_t *measGapConfig, - MobilityControlInfo_t *mobilityInfo, - struct MeasConfig__speedStatePars *speedStatePars, - RSRP_Range_t *rsrp, - C_RNTI_t *cba_rnti, - struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList* dedicatedInfoNASList -#if defined(Rel10) || defined(Rel14) - , SCellToAddMod_r10_t *SCell_config -#endif - ); - -/** -\brief Generate an RRCConnectionReestablishmentReject DL-CCCH-Message (eNB). -@param Mod_id Module ID of eNB -@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU -@returns Size of encoded bit stream in bytes*/ -/*uint8_t -do_RRCConnectionReestablishmentReject( - uint8_t Mod_id, - uint8_t* const buffer); - -/** -\brief Generate an RRCConnectionReject DL-CCCH-Message (eNB). -@param Mod_id Module ID of eNB -@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU -@returns Size of encoded bit stream in bytes*/ -/*uint8_t -do_RRCConnectionReject( - uint8_t Mod_id, - uint8_t* const buffer); - -/** -\brief Generate an RRCConnectionRequest UL-CCCH-Message (UE) based on random string or S-TMSI. This -routine only generates an mo-data establishment cause. -@param Mod_id Module ID of eNB -@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU -@param transaction_id Transaction index -@returns Size of encoded bit stream in bytes*/ - -/*uint8_t do_RRCConnectionRelease(uint8_t Mod_id, uint8_t *buffer,int Transaction_id); - -/*** - * \brief Generate an MCCH-Message (eNB). This routine configures MBSFNAreaConfiguration (PMCH-InfoList and Subframe Allocation for MBMS data) - * @param buffer Pointer to PER-encoded ASN.1 description of MCCH-Message PDU - * @returns Size of encoded bit stream in bytes -*/ -/*uint8_t do_MCCHMessage(uint8_t *buffer); -#if defined(Rel10) || defined(Rel14) -/*** - * \brief Generate an MCCH-Message (eNB). This routine configures MBSFNAreaConfiguration (PMCH-InfoList and Subframe Allocation for MBMS data) - * @param buffer Pointer to PER-encoded ASN.1 description of MCCH-Message PDU - * @returns Size of encoded bit stream in bytes -*/ -/*uint8_t do_MBSFNAreaConfig(uint8_t Mod_id, - uint8_t sync_area, - uint8_t *buffer, - MCCH_Message_t *mcch_message, - MBSFNAreaConfiguration_r9_t **mbsfnAreaConfiguration); -#endif -uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_id,long rsrp_s,long rsrq_s,long rsrp_t,long rsrq_t); -uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t transaction_id, uint32_t pdu_length, uint8_t *pdu_buffer); -uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer); -OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer); -uint8_t -do_UECapabilityEnquiry( - const protocol_ctxt_t* const ctxt_pP, - uint8_t* const buffer, - const uint8_t Transaction_id -); -uint8_t do_SecurityModeCommand( - const protocol_ctxt_t* const ctxt_pP, - uint8_t* const buffer, - const uint8_t Transaction_id, - const uint8_t cipheringAlgorithm, - const uint8_t integrityProtAlgorithm); diff --git a/openair2/RRC/NR/MESSAGES/asn1c/ASN1_files/NR-RRC-38331-f10.asn b/openair2/RRC/NR/MESSAGES/asn1c/ASN1_files/NR-RRC-38331-f10.asn new file mode 100644 index 0000000000000000000000000000000000000000..7697ea7d0752d472972ad7707f6c4faf5398eb95 --- /dev/null +++ b/openair2/RRC/NR/MESSAGES/asn1c/ASN1_files/NR-RRC-38331-f10.asn @@ -0,0 +1,5853 @@ +-- TAG-NR-RRC-DEFINITIONS-START + +NR-RRC-Definitions DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- TAG-NR-RRC-DEFINITIONS-STOP +-- TAG-BCCH-BCH-MESSAGE-START + +BCCH-BCH-Message ::= SEQUENCE { + message BCCH-BCH-MessageType +} + +BCCH-BCH-MessageType ::= CHOICE { + mib MIB, + messageClassExtension SEQUENCE {} +} + +-- TAG-BCCH-BCH-MESSAGE-STOP +-- TAG-DL-DCCH-MESSAGE-START + +DL-DCCH-Message ::= SEQUENCE { + message DL-DCCH-MessageType +} + +DL-DCCH-MessageType ::= CHOICE { + c1 CHOICE { + rrcReconfiguration RRCReconfiguration, + spare15 NULL, spare14 NULL, spare13 NULL, + spare12 NULL, spare11 NULL, spare10 NULL, + spare9 NULL, spare8 NULL, spare7 NULL, + spare6 NULL, spare5 NULL, spare4 NULL, + spare3 NULL, spare2 NULL, spare1 NULL + }, + messageClassExtension SEQUENCE {} +} + +-- TAG-DL-DCCH-MESSAGE-STOP +-- TAG-UL-DCCH-MESSAGE-START + +UL-DCCH-Message ::= SEQUENCE { + message UL-DCCH-MessageType +} + +UL-DCCH-MessageType ::= CHOICE { + c1 CHOICE { + measurementReport MeasurementReport, + rrcReconfigurationComplete RRCReconfigurationComplete, + spare14 NULL, spare13 NULL, spare12 NULL, + spare11 NULL, spare10 NULL, spare9 NULL, + spare8 NULL, spare7 NULL, spare6 NULL, + spare5 NULL, spare4 NULL, spare3 NULL, + spare2 NULL, spare1 NULL + }, + messageClassExtension SEQUENCE {} +} + +-- TAG-UL-DCCH-MESSAGE-STOP +-- TAG-MIB-START + +MIB ::= SEQUENCE { + -- The 6 most significant bit (MSB) of the 10 bit System Frame Number. The 4 LSB of the SFN are conveyed in the PBCH transport block + -- as well but outside the MIB. + systemFrameNumber BIT STRING (SIZE (6)), + + -- Subcarrier spacing for SIB1, Msg.2/4 for initial access and broadcast SI-messages. + -- If the UE acquires this MIB on a carrier frequency <6GHz, the values 15 and 30 kHz are applicable. + -- If the UE acquires this MIB on a carrier frequency >6GHz, the values 60 and 120 kHz are applicable. + subCarrierSpacingCommon ENUMERATED {scs15or60, scs30or120}, + + -- The frequency domain offset between SSB and the overall resource block grid in number of subcarriers. (See 38.211, section 7.4.3.1) + -- Note: For frequencies <6 GHz a fith, this field may comprise only the 4 least significant bits of the ssb-SubcarrierOffset. + -- The codepoint "FFS_RAN1" indicates that this cell does not provide SIB1 and that there is hence no common CORESET. + ssb-SubcarrierOffset INTEGER (0..15), + + -- Position of (first) DL DM-RS. Corresponds to L1 parameter 'DL-DMRS-typeA-pos' (see 38.211, section 7.4.1.1.1) + dmrs-TypeA-Position ENUMERATED {pos2, pos3}, + + -- Determines a bandwidth for PDCCH/SIB, a common ControlResourceSet (CORESET) a common search space and necessary PDCCH parameters. + -- Corresponds to L1 parameter 'RMSI-PDCCH-Config' (see FFS_Specification, section FFS_Section) + pdcch-ConfigSIB1 INTEGER (0..255), + + -- Indicates that UE shall not camp on this cell + cellBarred ENUMERATED {barred, notBarred}, + + -- Controls cell reselection to intra-frequency cells when the highest ranked cell is barred, or treated as barred by the UE, + -- as specified in TS 38.304. + intraFreqReselection ENUMERATED {allowed, notAllowed}, + spare BIT STRING (SIZE (1)) +} + +-- TAG-MIB-STOP +-- TAG-MEASUREMENTREPORT-START + +MeasurementReport ::= SEQUENCE { + criticalExtensions CHOICE { + measurementReport MeasurementReport-IEs, + criticalExtensionsFuture SEQUENCE {} + } +} + +MeasurementReport-IEs ::= SEQUENCE { + measResults MeasResults, + + lateNonCriticalExtension OCTET STRING OPTIONAL, + nonCriticalExtension SEQUENCE{} OPTIONAL +} + +-- TAG-MEASUREMENTREPORT-STOP +-- TAG-RRCRECONFIGURATION-START + +RRCReconfiguration ::= SEQUENCE { + rrc-TransactionIdentifier RRC-TransactionIdentifier, + criticalExtensions CHOICE { + rrcReconfiguration RRCReconfiguration-IEs, + criticalExtensionsFuture SEQUENCE {} + } +} + +RRCReconfiguration-IEs ::= SEQUENCE { + -- Configuration of Radio Bearers (DRBs, SRBs) including SDAP/PDCP. + -- In EN-DC this field may only be present if the RRCReconfiguration + -- is transmitted over SRB3. + radioBearerConfig RadioBearerConfig OPTIONAL, -- Need M + + -- Configuration of secondary cell group (EN-DC): + secondaryCellGroup OCTET STRING (CONTAINING CellGroupConfig) OPTIONAL, -- Need M + + measConfig MeasConfig OPTIONAL, -- Need M + + lateNonCriticalExtension OCTET STRING OPTIONAL, + nonCriticalExtension SEQUENCE {} OPTIONAL +} + +-- TAG-RRCRECONFIGURATION-STOP +-- TAG-RRCRECONFIGURATIONCOMPLETE-START + +RRCReconfigurationComplete ::= SEQUENCE { + rrc-TransactionIdentifier RRC-TransactionIdentifier, + criticalExtensions CHOICE { + rrcReconfigurationComplete RRCReconfigurationComplete-IEs, + criticalExtensionsFuture SEQUENCE {} + } +} + +RRCReconfigurationComplete-IEs ::= SEQUENCE { + lateNonCriticalExtension OCTET STRING OPTIONAL, + nonCriticalExtension SEQUENCE {} OPTIONAL +} + +-- TAG-RRCRECONFIGURATIONCOMPLETE-STOP +-- TAG-SIB1-START + +SIB1 ::= SEQUENCE { + + -- FFS / TODO: Add other parameters. + + -- Frequency offset for the SSB of -5kHz (M=-1) or +5kHz (M=1). When the field is absent, the UE applies no offset (M=0). + -- The offset is only applicable for the frequency range 0-2.65GHz. Corresponds to parameter 'M' (see 38.101, section FFS_Section) + frequencyOffsetSSB ENUMERATED {khz-5, khz5} OPTIONAL, -- Need R + + -- Time domain positions of the transmitted SS-blocks in an SS-Burst-Set (see 38.213, section 4.1) + ssb-PositionsInBurst SEQUENCE { + -- Indicates the presence of the up to 8 SSBs in one group + inOneGroup BIT STRING (SIZE (8)), + -- For above 6 GHz: indicates which groups of SSBs is present + groupPresence BIT STRING (SIZE (8)) OPTIONAL -- Cond above6GHzOnly + }, + + -- The SSB periodicity in msec for the rate matching purpose (see 38.211, section [7.4.3.1]) + ssb-PeriodicityServingCell ENUMERATED {ms5, ms10, ms20, ms40, ms80, ms160, spare1, spare2}, + + -- TX power that the NW used for SSB transmission. The UE uses it to estimate the RA preamble TX power. + -- (see 38.213, section 7.4) + ss-PBCH-BlockPower INTEGER (-60..50), + + uplinkConfigCommon UplinkConfigCommon OPTIONAL, + -- FFS: How to indicate the FrequencyInfoUL for the SUL + supplementaryUplink SEQUENCE { + uplinkConfigCommon UplinkConfigCommon OPTIONAL + -- FFS: Add additional (selection) criteria determining when/whether the UE shall use the SUL frequency + } OPTIONAL, -- Cond SUL + + tdd-UL-DL-Configuration TDD-UL-DL-ConfigCommon OPTIONAL, -- Cond TDD + tdd-UL-DL-configurationCommon2 TDD-UL-DL-ConfigCommon OPTIONAL, -- Cond TDD + + pdcch-ConfigCommon PDCCH-ConfigCommon OPTIONAL, + pucch-ConfigCommon PUCCH-ConfigCommon OPTIONAL, + + lateNonCriticalExtension OCTET STRING OPTIONAL, + nonCriticalExtension SEQUENCE{} OPTIONAL +} + +-- TAG-SIB1-STOP +-- TAG-SETUP-RELEASE-START + +SetupRelease { ElementTypeParam } ::= CHOICE { + release NULL, + setup ElementTypeParam +} + +-- TAG-SETUP-RELEASE-STOP +-- TAG-ADDITIONALSPECTRUMEMISSION-START + +AdditionalSpectrumEmission ::= INTEGER (0..7) + +-- TAG-ADDITIONALSPECTRUMEMISSION-STOP +-- TAG-ALPHA-START + +Alpha ::= ENUMERATED {alpha0, alpha04, alpha05, alpha06, alpha07, alpha08, alpha09, alpha1} + +-- TAG-ALPHA-STOP +-- TAG-ARFCN-VALUE-NR-START + +ARFCN-ValueNR ::= INTEGER (0..3279165) + +-- TAG-ARFCN-VALUE-NR-STOP +-- TAG-BANDWIDTH-PART-START + + +-- Generic parameters used in Uplink- and Downlink bandwidth parts +BWP ::= SEQUENCE { + -- Frequency domain location and bandwidth of this bandwidth part defined commonly in a table (FFS_Section). The location is given as + -- distance (in number of PRBs) to point A (absoluteFrequencyPointA in FrequencyInfoDL). + -- Corresponds to L1 parameter 'DL-BWP-loc'. (see 38.211, section FFS_Section). + -- In case of TDD, a BWP-pair (UL BWP and DL BWP with the same bwp-Id) must have the same location (see 38.211, section REF) + locationAndBandwidth INTEGER (0..37949), + -- Subcarrier spacing to be used in this BWP for all channels and + -- reference signals unless explicitly configured elsewhere. + -- Corresponds to subcarrier spacing according to 38.211, Table 4.2-1. + -- The value kHz15 corresponds to µ=0, kHz30 to µ=1, and so on. Only the values 15 or 30 kHz (<6GHz), 60 or 120 kHz (>6GHz) are + -- applicable. + subcarrierSpacing SubcarrierSpacing, + -- Indicates whether to use the extended cyclic prefix for this bandwidth part. If not set, the UE uses the normal cyclic prefix. + -- Normal CP is supported for all numerologies and slot formats. Extended CP is supported only for 60 kHz subcarrier spacing. + -- (see 38.211, section 4.2.2) + cyclicPrefix ENUMERATED { extended } OPTIONAL -- Need R +} + +BWP-Uplink ::= SEQUENCE { + -- An identifier for this bandwidth part. Other parts of the RRC configuration use the BWP-Id to associate themselves with a particular + -- bandwidth part. The BWP ID=0 is always associated with the initial BWP and may hence not be used here (in other bandwidth parts). + -- The NW may trigger the UE to swtich UL or DL BWP using a DCI field. The four code points in that DCI field map to the RRC-configured + -- BWP-ID as follows: For up to 3 configured BWPs (in addition to the initial BWP) the DCI code point is equivalent to the BWP ID + -- (initial = 0, first dedicated = 1, ...). If the NW configures 4 dedicated bandwidth parts, they are identified by DCI code + -- points 0 to 3. In this case it is not possible to switch to the initial BWP using the DCI field. + -- Corresponds to L1 parameter 'UL-BWP-index'. (see 38.211, 38.213, section 12) + bwp-Id BWP-Id, + bwp-Common BWP-UplinkCommon OPTIONAL, -- Need M + bwp-Dedicated BWP-UplinkDedicated OPTIONAL, -- Need M + ... +} + +BWP-UplinkCommon ::= SEQUENCE { + genericParameters BWP, + -- Configuration of cell specific random access parameters which the UE uses for contention based and contention free random access + -- as well as for contention based beam failure recovery. + rach-ConfigCommon SetupRelease { RACH-ConfigCommon } OPTIONAL, -- Need M + -- Cell specific parameters for the PUSCH + pusch-ConfigCommon SetupRelease { PUSCH-ConfigCommon } OPTIONAL, -- Need M + + -- Cell specific parameters for the PUCCH + pucch-ConfigCommon SetupRelease { PUCCH-ConfigCommon } OPTIONAL, -- Need M + ... +} + +BWP-UplinkDedicated ::= SEQUENCE { + -- PUCCH configuration for one BWP of the regular UL or SUL of a serving cell. If the UE is configured with SUL, the network + -- configures PUCCH only on the BWPs of one of the uplinks (UL or SUL). + pucch-Config SetupRelease { PUCCH-Config } OPTIONAL, -- Need M + -- PUSCH configuration for one BWP of the regular UL or SUL of a serving cell. If the UE is configured with SUL and + -- if it has a PUSCH-Config for both UL and SUL, a carrier indicator field in DCI indicates for which of the two to use an UL grant. + -- See also L1 parameter 'dynamicPUSCHSUL' (see 38.213, section FFS_Section) + pusch-Config SetupRelease { PUSCH-Config } OPTIONAL, -- Need M + -- A Configured-Grant of typ1 or type2. It may be configured for Ul or SUL but in case of type1 [FFS also type2] not for both at a time. + configuredGrantConfig SetupRelease { ConfiguredGrantConfig } OPTIONAL, -- Need M + -- Uplink sounding reference signal configuration + srs-Config SetupRelease { SRS-Config } OPTIONAL, -- Need M + -- Determines how the UE performs Beam Failure Recovery upon detection of a Beam Failure (see RadioLinkMonitoringConfig) + beamFailureRecoveryConfig SetupRelease { BeamFailureRecoveryConfig } OPTIONAL, -- Need M + ... +} + + +BWP-Downlink ::= SEQUENCE { + -- An identifier for this bandwidth part. Other parts of the RRC configuration use the BWP-Id to associate themselves with a particular + -- bandwidth part. The BWP ID=0 is always associated with the initial BWP and may hence not be used here. (in other bandwidth parts). + -- The NW may trigger the UE to swtich UL or DL BWP using a DCI field. The four code points in that DCI field map to the RRC-configured + -- BWP-ID as follows: For up to 3 configured BWPs (in addition to the initial BWP) the DCI code point is equivalent to the BWP ID + -- (initial = 0, first dedicated = 1, ...). If the NW configures 4 dedicated bandwidth parts, they are identified by DCI code + -- points 0 to 3. In this case it is not possible to switch to the initial BWP using the DCI field. + -- Corresponds to L1 parameter 'DL-BWP-index'. (see 38.211, 38.213, section 12) + bwp-Id BWP-Id, + bwp-Common BWP-DownlinkCommon OPTIONAL, -- Need M + bwp-Dedicated BWP-DownlinkDedicated OPTIONAL, -- Need M + ... +} + + +BWP-DownlinkCommon ::= SEQUENCE { + genericParameters BWP, + pdcch-ConfigCommon SetupRelease { PDCCH-ConfigCommon } OPTIONAL, -- Need M + pdsch-ConfigCommon SetupRelease { PDSCH-ConfigCommon } OPTIONAL, -- Need M + ... +} + +BWP-DownlinkDedicated ::= SEQUENCE { + pdcch-Config SetupRelease { PDCCH-Config } OPTIONAL, -- Need M + pdsch-Config SetupRelease { PDSCH-Config } OPTIONAL, -- Need M + sps-Config SetupRelease { SPS-Config } OPTIONAL, -- Need M + radioLinkMonitoringConfig SetupRelease { RadioLinkMonitoringConfig } OPTIONAL, -- Need M + ... +} + + +-- TAG-BANDWIDTH-PART-STOP +-- TAG-BWP-ID-START + +BWP-Id ::= INTEGER (0..maxNrofBWPs) + +-- TAG-BWP-ID-STOP +-- TAG-BEAM-FAILURE-RECOVERY-CONFIG-START + +BeamFailureRecoveryConfig ::= SEQUENCE { + rootSequenceIndex-BFR INTEGER (0..137) OPTIONAL, -- Need M + -- Configuration of contention free random access occasions for BFR + rach-ConfigBFR RACH-ConfigGeneric OPTIONAL, -- Need M + -- L1-RSRP threshold used for determining whether a candidate beam may be used by the UE to attempt contention free + -- Random Access to recover from beam failure. The signalled threshold is applied directly for SSB, a threshold for + -- CSI-RS is determined by linearly scaling singalled value based on Pc_ss corresponding to the CSI-RS resource. + -- (see FFS_Specification, FFS_Section) + candidateBeamThreshold RSRP-Range OPTIONAL, -- Need M + -- A list of reference signals (CSI-RS and/or SSB) identifying the candidate beams for recover and the associated RA parameters + candidateBeamRSList SEQUENCE (SIZE(1..maxNrofCandidateBeams)) OF PRACH-ResourceDedicatedBFR OPTIONAL, -- Need M + -- Explicitly signalled PRACH Mask Index for RA Resource selection in TS 36.321. The mask is valid for all SSB resources + ra-ssb-OccasionMaskIndex INTEGER (0..15) OPTIONAL, -- Need M + -- Control Resource Set that the UE uses to receive the random access response for beam failure recovery. + -- If the field is absent the UE uses the initial CORESET (ControlResourceSetId = 0) + recoveryControlResourceSetId ControlResourceSetId OPTIONAL , -- Need S + -- Search space to use for BFR RAR. If the field is absent, the UE uses the initial Serach Space (SearchSpaceId = 0). + recoverySearchSpaceId SearchSpaceId OPTIONAL, -- Need S + ... +} + +PRACH-ResourceDedicatedBFR ::= CHOICE { + ssb BFR-SSB-Resource, + csi-RS BFR-CSIRS-Resource +} + +BFR-SSB-Resource ::= SEQUENCE { + -- The ID of an SSB transmitted by this serving cell. It determines a candidate beam for beam failure recovery (BFR) + ssb SSB-Index, + -- The preamble index that the UE shall use when performing BFR upon selecting the candidate beams identified by this SSB. + ra-PreambleIndex INTEGER (0..63), + ... +} + +BFR-CSIRS-Resource ::= SEQUENCE { + -- The ID of a NZP-CSI-RS-Resource configured in the CSI-MeasConfig of this serving cell. This reference signal determines a candidate beam + -- for beam failure recovery (BFR). + csi-RS NZP-CSI-RS-ResourceId, + -- RA occasions that the UE shall use when performing BFR upon selecting the candidate beam identified by this CSI-RS. If the field is absent + -- the UE uses the RA occasion associated with the SSB that is QCLed with this CSI-RS. + -- The RA preamble index to use in the RA occasions associated with this CSI-RS. If the field is absent, the UE uses the preamble index + -- associated with the SSB that is QCLed with this CSI-RS. + ra-PreambleIndex INTEGER (0..63) OPTIONAL, -- Need R + ... +} + +-- TAG-BEAM-FAILURE-RECOVERY-CONFIG-STOP +-- TAG-CELL-GROUP-CONFIG-START + +-- Configuration of one Cell-Group: +CellGroupConfig ::= SEQUENCE { + cellGroupId CellGroupId, + + -- Logical Channel configuration and association with radio bearers: + rlc-BearerToAddModList SEQUENCE (SIZE(1..maxLC-ID)) OF RLC-Bearer-Config OPTIONAL, -- Need N + rlc-BearerToReleaseList SEQUENCE (SIZE(1..maxLC-ID)) OF LogicalChannelIdentity OPTIONAL, -- Need N + + -- Parameters applicable for the entire cell group: + mac-CellGroupConfig MAC-CellGroupConfig OPTIONAL, -- Need M + physicalCellGroupConfig PhysicalCellGroupConfig OPTIONAL, -- Need M + + -- Serving Cell specific parameters (SpCell and SCells) + spCellConfig SpCellConfig OPTIONAL, -- Need M + sCellToAddModList SEQUENCE (SIZE (1..maxNrofSCells)) OF SCellConfig OPTIONAL, -- Need N + -- List of seconary serving cells to be released (not applicable for SpCells) + sCellToReleaseList SEQUENCE (SIZE (1..maxNrofSCells)) OF SCellIndex OPTIONAL, -- Need N + ... +} + +-- The ID of a cell group. 0 identifies the master cell group. Other values identify secondary cell groups. +-- In this version of the specification only values 0 and 1 are supported. +-- FFS: This should be moved to be own IE section +CellGroupId ::= INTEGER (0.. maxSecondaryCellGroups) + + +RLC-Bearer-Config ::= SEQUENCE { + -- ID used commonly for the MAC logical channel and for the RLC bearer. + logicalChannelIdentity LogicalChannelIdentity, + + -- Associates the RLC Bearer with an SRB or a DRB. The UE shall deliver DL RLC SDUs received via the RLC entity of this + -- RLC bearer to the PDCP entity of the servedRadioBearer. Furthermore, the UE shall advertise and deliver uplink PDCP PDUs of the + -- uplink PDCP entity of the servedRadioBearer to the uplink RLC entity of this RLC bearer unless the uplink scheduling + -- restrictions ('moreThanOneRLC' in PDCP-Config and the restrictions in LogicalChannelConfig) forbid it to do so. + servedRadioBearer CHOICE { + srb-Identity SRB-Identity, + drb-Identity DRB-Identity + } OPTIONAL, -- Cond LCH-SetupOnly + + reestablishRLC ENUMERATED {true} OPTIONAL, -- Need N + rlc-Config RLC-Config OPTIONAL, -- Cond LCH-Setup + + mac-LogicalChannelConfig LogicalChannelConfig OPTIONAL, -- Cond LCH-Setup + ... +} + +LogicalChannelIdentity ::= INTEGER (1..maxLC-ID) + +-- Cell-Group specific L1 parameters +PhysicalCellGroupConfig ::= SEQUENCE { + -- Enables spatial bundling of HARQ ACKs. It is configured per cell group (i.e. for all the cells within the cell group) for PUCCH + -- reporting of HARQ-ACK. It is only applicable when more than 4 layers are possible to schedule. + -- Corresponds to L1 parameter 'HARQ-ACK-spatial-bundling' (see 38.213, section FFS_Section) + -- Absence indicates that spatial bundling is disabled. + harq-ACK-SpatialBundlingPUCCH ENUMERATED {true} OPTIONAL, -- Need R + + -- Enables spatial bundling of HARQ ACKs. It is configured per cell group (i.e. for all the cells within the cell group) for PUSCH + -- reporting of HARQ-ACK. It is only applicable when more than 4 layers are possible to schedule. + -- Corresponds to L1 parameter 'HARQ-ACK-spatial-bundling' (see 38.213, section FFS_Section) + -- Absence indicates that spatial bundling is disabled. + harq-ACK-SpatialBundlingPUSCH ENUMERATED {true} OPTIONAL, -- Need R + -- The maximum transmit power to be used by the UE in this NR cell group. + p-NR P-Max OPTIONAL, -- Need R + -- The PDSCH HARQ-ACK codebook is either semi-static of dynamic. This is applicable to both CA and none CA operation. + -- Corresponds to L1 parameter 'HARQ-ACK-codebook' (see 38.213, section FFS_Section) + pdsch-HARQ-ACK-Codebook ENUMERATED {semiStatic, dynamic}, + -- RNTI used for SRS TPC commands on DCI. Corresponds to L1 parameter 'TPC-SRS-RNTI' (see 38.213, section 10) + tpc-SRS-RNTI RNTI-Value OPTIONAL, -- Need R + -- RNTI used for PUCCH TPC commands on DCI. Corresponds to L1 parameter 'TPC-PUCCH-RNTI' (see 38.213, section 10). + tpc-PUCCH-RNTI RNTI-Value OPTIONAL, -- Need R + -- RNTI used for PUSCH TPC commands on DCI. Corresponds to L1 parameter 'TPC-PUSCH-RNTI' (see 38.213, section 10) + tpc-PUSCH-RNTI RNTI-Value OPTIONAL,-- Need R + ... +} + + +-- Serving cell specific MAC and PHY parameters for a SpCell: +SpCellConfig ::= SEQUENCE { + -- Serving cell ID of a PSCell (the PCell of the Master Cell Group uses ID = 0) + servCellIndex ServCellIndex OPTIONAL, -- Cond SCG + -- Parameters for the synchronous reconfiguration to the target SpCell: + reconfigurationWithSync ReconfigurationWithSync OPTIONAL, -- Cond ReconfWithSync + rlf-TimersAndConstants SetupRelease { RLF-TimersAndConstants } OPTIONAL, -- Need M + rlmInSyncOutOfSyncThreshold INTEGER (0..1) OPTIONAL, -- Need M + spCellConfigDedicated ServingCellConfig OPTIONAL, -- Need M + ... +} + +ReconfigurationWithSync ::= SEQUENCE { + spCellConfigCommon ServingCellConfigCommon OPTIONAL, -- Need M + newUE-Identity RNTI-Value, + t304 ENUMERATED {ms50, ms100, ms150, ms200, ms500, ms1000, ms2000, ms10000}, + rach-ConfigDedicated CHOICE { + uplink RACH-ConfigDedicated, + supplementaryUplink RACH-ConfigDedicated + } OPTIONAL, -- Need N + ... +} + +SCellConfig ::= SEQUENCE { + sCellIndex SCellIndex, + sCellConfigCommon ServingCellConfigCommon OPTIONAL, -- Cond SCellAdd + sCellConfigDedicated ServingCellConfig OPTIONAL, -- Cond SCellAddMod + ... +} + +-- TAG-CELL-GROUP-CONFIG-STOP +-- TAG-CODEBOOKCONFIG-START +CodebookConfig ::= SEQUENCE { + -- CodebookType including possibly sub-types and the corresponding parameters for each. Corresponds to L1 parameter 'CodebookType' + -- (see 38.214, section 5.2.2.2) + codebookType CHOICE { + type1 SEQUENCE { + subType CHOICE { + typeI-SinglePanel SEQUENCE { + nrOfAntennaPorts CHOICE { + two SEQUENCE { + -- Codebook subset restriction for 2TX codebook + -- Corresponds to L1 parameter ' TypeI-SinglePanel-2Tx-CodebookSubsetRestriction' (see 38.214 section 5.2.2.2.1) + twoTX-CodebookSubsetRestriction BIT STRING (SIZE (6)) + }, + moreThanTwo SEQUENCE { + -- Number of antenna ports in first (n1) and second (n2) dimension and codebook subset restriction + -- Corresponds to L1 parameters 'CodebookConfig-N1', 'CodebookConfig-N2' + -- 'TypeI-SinglePanel-CodebookSubsetRestriction ' (see 38.214 section 5.2.2.2.1) + n1-n2 CHOICE { + two-one-TypeI-SinglePanel-Restriction BIT STRING (SIZE (8)), + two-two-TypeI-SinglePanel-Restriction BIT STRING (SIZE (64)), + four-one-TypeI-SinglePanel-Restriction BIT STRING (SIZE (16)), + three-two-TypeI-SinglePanel-Restriction BIT STRING (SIZE (96)), + six-one-TypeI-SinglePanel-Restriction BIT STRING (SIZE (24)), + four-two-TypeI-SinglePanel-Restriction BIT STRING (SIZE (128)), + eight-one-TypeI-SinglePanel-Restriction BIT STRING (SIZE (32)), + four-three-TypeI-SinglePanel-Restriction BIT STRING (SIZE (192)), + six-two-TypeI-SinglePanel-Restriction BIT STRING (SIZE (192)), + twelve-one-TypeI-SinglePanel-Restriction BIT STRING (SIZE (48)), + four-four-TypeI-SinglePanel-Restriction BIT STRING (SIZE (256)), + eight-two-TypeI-SinglePanel-Restriction BIT STRING (SIZE (256)), + sixteen-one-TypeI-SinglePanel-Restriction BIT STRING (SIZE (64)) + }, + -- i2 codebook subset restriction for Type I Single-panel codebook used when reportQuantity is CRI/Ri/i1/CQI + -- Corresponds to L1 parameter 'TypeI-SinglePanel-CodebookSubsetRestriction-i2' (see 38.214 section 5.2.2.2.1) + typeI-SinglePanel-codebookSubsetRestriction-i2 BIT STRING (SIZE (16)) OPTIONAL + } + }, + -- Restriction for RI for TypeI-SinglePanel-RI-Restriction + -- Corresponds to L1 parameter 'TypeI-SinglePanel-RI-Restriction' (see 38.214, section 5.2.2.2.1) + typeI-SinglePanel-ri-Restriction BIT STRING (SIZE (8)) + }, + typeI-MultiPanel SEQUENCE { + -- Codebook subset restriction for Type I Multi-panel codebook + -- Corresponds to L1 parameter 'TypeI-MultiPanel-CodebookSubsetRestriction' (see 38.214, section 5.2.2.2.2) + ng-n1-n2 CHOICE { + two-two-one-TypeI-MultiPanel-Restriction BIT STRING (SIZE (8)), + two-four-one-TypeI-MultiPanel-Restriction BIT STRING (SIZE (32)), + four-two-one-TypeI-MultiPanel-Restriction BIT STRING (SIZE (32)), + two-two-two-TypeI-MultiPanel-Restriction BIT STRING (SIZE (128)), + two-eight-one-TypeI-MultiPanel-Restriction BIT STRING (SIZE (64)), + four-four-one-TypeI-MultiPanel-Restriction BIT STRING (SIZE (64)), + two-four-two-TypeI-MultiPanel-Restriction BIT STRING (SIZE (256)), + four-two-two-TypeI-MultiPanel-Restriction BIT STRING (SIZE (256)) + }, + -- Restriction for RI for TypeI-MultiPanel-RI-Restriction + -- Corresponds to L1 parameter 'TypeI-MultiPanel-RI-Restriction' (see 38.214, section 5.2.2.2.2) + ri-Restriction BIT STRING (SIZE (4)) + } + }, + -- CodebookMode as specified in 38.214 section 5.2.2.2.2 + codebookMode INTEGER (1..2) + + }, + type2 SEQUENCE { + subType CHOICE { + typeII SEQUENCE { + -- Number of antenna ports in first (n1) and second (n2) dimension and codebook subset restriction + -- Corresponds to L1 parameters 'CodebookConfig-N1', 'CodebookConfig-N2' + -- The CHOICE name indicates the value of n1 and n2, the CHOICE contents is the codebook subset restriction bitmap + -- Corresponds to L1 parameter ' TypeII-CodebookSubsetRestriction' (see 38.214 section 5.2.2.2.3) + -- Number of bits for codebook subset restriction is ceil(log2(nchoosek(O1*O2,4)))+8*n1*n2 where nchoosek(a,b) = a!/(b!(a-b)!) + n1-n2-codebookSubsetRestriction CHOICE { + two-one BIT STRING (SIZE (16)), + two-two BIT STRING (SIZE (139)), + four-one BIT STRING (SIZE (32)), + three-two BIT STRING (SIZE (59)), + six-one BIT STRING (SIZE (49)), + four-two BIT STRING (SIZE (75)), + eight-one BIT STRING (SIZE (65)), + four-three BIT STRING (SIZE (107)), + six-two BIT STRING (SIZE (107)), + twelve-one BIT STRING (SIZE (129)), + four-four BIT STRING (SIZE (139)), + eight-two BIT STRING (SIZE (139)), + sixteen-one BIT STRING (SIZE (129)) + }, + -- Restriction for RI for TypeII-RI-Restriction + -- Corresponds to L1 parameter 'TypeII-RI-Restriction' (see 38.214, section 5.2.2.2.3) + typeII-RI-Restriction BIT STRING (SIZE (2)) + }, + typeII-PortSelection SEQUENCE { + -- The size of the port selection codebook (parameter d) + portSelectionSamplingSize ENUMERATED {n1, n2, n3, n4} OPTIONAL, -- Cond TypeII-PortSelection + -- Restriction for RI for TypeII-PortSelection-RI-Restriction + -- Corresponds to L1 parameter 'TypeII-PortSelection-RI-Restriction' (see 38.214, section 5.2.2.4) + typeII-PortSelectionRI-Restriction BIT STRING (SIZE (2)) + } + }, + -- The size of the PSK alphabet, QPSK or 8-PSK + phaseAlphabetSize ENUMERATED {n4, n8}, + -- If subband amplitude reporting is activated (true) + subbandAmplitude BOOLEAN, + -- Number of beams, L, used for linear combination + numberOfBeams ENUMERATED {two, three, four} + } + } +} + +-- TAG-CODEBOOKCONFIG-STOP +-- TAG-CONFIGUREDGRANTCONFIG-START + +ConfiguredGrantConfig ::= SEQUENCE { + + -- Frequency hopping as agreed in RAN1-AH18776 + frequencyHopping ENUMERATED {mode1, mode2}, + -- DMRS configuration, as agreed in RAN1-AH18776 + cg-DMRS-Configuration DMRS-UplinkConfig, + + -- Indicates the MCS table the UE shall use for PUSCH without transform precoding, as agreed in RAN1-AH18776 + mcs-Table ENUMERATED {qam64, qam256}, + -- Indicates the MCS table the UE shall use for PUSCH with transform precoding, as agreed in RAN1-AH18776 + -- When the field is absent the UE applies the value 64QAM + mcs-TableTransformPrecoder ENUMERATED {qam256} OPTIONAL, -- Need S + -- Selection between and configuration of dynamic and semi-static beta-offset, as agreed in RAN1-AH18776 + -- Note: For Type 1 UL data transmission without grant, "uci-on-PUSCH" should be set to semiStatic + uci-OnPUSCH SetupRelease { CG-UCI-OnPUSCH }, + -- Configuration of resource allocation type 0 and resource allocation type 1, as agreed in RAN1-AH18776 + -- Note: For Type 1 UL data transmission without grant, "resourceAllocation" should be resourceAllocationType0 or resourceAllocationType1 + resourceAllocation ENUMERATED { resourceAllocationType0, resourceAllocationType1, dynamicSwitch }, + -- Selection between config 1 and config 2 for RBG size for PUSCH. When the field is absent the UE applies the value config1. + -- Note: rbg-Size is used when the transformPrecoder parameter is disabled. + rbg-Size ENUMERATED {config2} OPTIONAL, -- Need S + + -- Closed control loop to apply. Corresponds to L1 parameter 'PUSCH-closed-loop-index' (see 38.213, section FFS_Section) + powerControlLoopToUse ENUMERATED {n0, n1}, + -- Index of the P0-PUSCH-AlphaSet to be used for this configuration + p0-PUSCH-Alpha P0-PUSCH-AlphaSetId, + -- Enable transformer precoder for type1 and type2. Absence indicates that it is disabled. + -- Corresponds to L1 parameter 'UL-TWG-tp' (see 38.214, section 6.1.3) + transformPrecoder ENUMERATED {enabled} OPTIONAL, -- Need R + -- The number of HARQ processes configured. It applies for both Type 1 and Type 2 + -- Corresponds to L1 parameter 'UL-TWG-numbHARQproc' (see 38.321, section 5.8.2) + nrofHARQ-Processes INTEGER(1..16), + -- The number or repetitions of K: + repK ENUMERATED {n1, n2, n4, n8}, + -- If repetitions is used, this field indicates the redundancy version (RV) sequence to use. + -- Corresponds to L1 parameter 'UL-TWG-RV-rep' (see 38.321, section 5.8.2) + repK-RV ENUMERATED {s1-0231, s2-0303, s3-0000} OPTIONAL, -- Cond RepK + -- Periodicity for UL transmission without UL grant for type 1 and type 2 + -- Corresponds to L1 parameter 'UL-TWG-periodicity' (see 38.321, section 5.8.2) + + -- The following periodicities are supported depending on the configured subcarrier spacing [symbols]: + -- 15kHz: 2, 7, n*14, where n={1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 128, 160, 320, 640} + -- 30kHz: 2, 7, n*14, where n={1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 128, 160, 256, 320, 640, 1280} + -- 60kHz with normal CP: 2, 7, n*14, where n={1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 128, 160, 256, 320, 512, 640, 1280, 2560} + -- 60kHz with ECP: 2, 6, n*12, where n={1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 128, 160, 256, 320, 512, 640, 1280, 2560} + -- 120kHz: 2, 7, n*14, where n={1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 128, 160, 256, 320, 512, 640, 1024, 1280, 2560, 5120} + -- (see 38.214, Table 6.1.2.3-1) + periodicity ENUMERATED { + sym2, sym7, sym1x14, sym2x14, sym4x14, sym5x14, sym8x14, sym10x14, sym16x14, sym20x14, + sym32x14, sym40x14, sym64x14, sym80x14, sym128x14, sym160x14, sym256x14, sym320x14, sym512x14, + sym640x14, sym1024x14, sym1280x14, sym2560x14, sym5120x14, + + sym6, sym1x12, sym2x12, sym4x12, sym5x12, sym8x12, sym10x12, sym16x12, sym20x12, sym32x12, + sym40x12, sym64x12, sym80x12, sym128x12, sym160x12, sym256x12, sym320x12, sym512x12, sym640x12, + sym1280x12, sym2560x12 + }, + + -- If configured, the UE uses the configured grant timer (see 38.321, section 5.8.2) with this initial timer value. + -- Supported values are as follows in units of symbols: + -- For normal CP: 2, 7, {1, 2, 4, 5, 8, 10, 20, 32, 40, 64, 80, 128, 160, 256, 512, 640 } x 14 + -- For extended CP: 2, 6, {1, 2, 4, 8, 20, 40, 80, 128, 160, 256, 320, 512, 640 } x 12 + configuredGrantTimer ENUMERATED { + sym2, sym7, sym1x14, sym2x14, sym4x14, sym5x14, sym8x14, sym10x14, sym16x14, sym20x14, sym32x14, + sym40x14, sym64x14, sym80x14, sym128x14, sym160x14, sym256x14, sym512x14, sym640x14, + + sym6, sym1x12, sym2x12, sym4x12, sym5x12, sym8x12, sym10x12, sym16x12, sym20x12, sym32x12, + sym40x12, sym64x12, sym80x12, sym128x12, sym256x12, sym320x12, sym512x12, sym640x12 + } OPTIONAL, -- Need R + -- Selection between "configured grant" transmission with fully RRC-configured UL grant (Type1) + -- or with UL grant configured by DCI addressed to CS-RNTI (Type2). + rrc-ConfiguredUplinkGrant SEQUENCE { + -- Offset related to SFN=0 + timeDomainOffset INTEGER (0..5119), + -- Corresponding to the DCI field of time domain resource assignment, and the maximum bit width is 4. + --(see 38.214, section 6.1.2 and 38.212, section 7.3.1) + timeDomainAllocation INTEGER (0..15), -- RAN1 indicated just "Mapping-type,Index-start-len" + -- Corresponding to the DCI field of freq domain resource assignment. + -- (see 38.214, section 6.1.2, and 38.212, section 7.3.1) + frequencyDomainAllocation BIT STRING (SIZE(18)), + -- UE-specific DMRS configuration: corresponding to the DCI field of antenna ports, and the maximum bitwidth is 5. + -- (see 38.214, section 6.1.2, and 38.212, section 7.3.1) + antennaPort INTEGER (0..31), + dmrs-SeqInitialization INTEGER (0..1) OPTIONAL, -- Cond NoTransformPrecoder + precodingAndNumberOfLayers INTEGER (0..63), + srs-ResourceIndicator INTEGER (0..15), + -- The modulation order, target code rate and TB size (see 38.214, section 6.1.2) + mcsAndTBS INTEGER (0..31), + -- Enables intra-slot frequency hopping with the given frequency hopping offset + -- Corresponds to L1 parameter 'UL-TWG-hopping' (see 38.214, section FFS_Section) + + frequencyHoppingOffset INTEGER (1.. maxNrofPhysicalResourceBlocks-1), + pathlossReferenceIndex INTEGER (0..maxNrofPUSCH-PathlossReferenceRSs-1), + ... + } OPTIONAL -- Cond Type1 +} + +CG-UCI-OnPUSCH ::= CHOICE { + dynamic SEQUENCE (SIZE (1..4)) OF BetaOffsets, + semiStatic BetaOffsets +} + +-- TAG-CONFIGUREDGRANTCONFIG-STOP +-- TAG-CONTROLRESOURCESET-START + +ControlResourceSet ::= SEQUENCE { + -- Corresponds to L1 parameter 'CORESET-ID' + -- Value 0 identifies the common CORESET configured in MIB and in ServingCellConfigCommon + -- Values 1..maxNrofControlResourceSets-1 identify CORESETs configured by dedicated signalling + -- The controlResourceSetId is unique among the BWPs of a ServingCell. + controlResourceSetId ControlResourceSetId, + + + -- Frequency domain resources for the CORESET. Each bit corresponds a group of 6 RBs, with grouping starting from PRB 0, which is fully + -- contained in the bandwidth part within which the CORESET is configured. + -- The most significant bit corresponds to the group of lowest frequency which is fully contained in the bandwidth part within which the + -- CORESET is configured, each next subsequent lower significance bit corresponds to the next lowest frequency group fully contained within + -- the bandwidth part within which the CORESET is configured, if any. + -- Bits corresponding to a group not fully contained within the bandwidth part within which the CORESET is configured are set to zero. + -- Corresponds to L1 parameter 'CORESET-freq-dom'(see 38.211, section 7.3.2.2) + frequencyDomainResources BIT STRING (SIZE (45)), + -- Contiguous time duration of the CORESET in number of symbols + -- Corresponds to L1 parameter 'CORESET-time-duration' (see 38.211, section 7.3.2.2FFS_Section) + duration INTEGER (1..maxCoReSetDuration), + -- Mapping of Control Channel Elements (CCE) to Resource Element Groups (REG). + -- Corresponds to L1 parameter 'CORESET-CCE-REG-mapping-type' (see 38.211Section sections 7.3.2.2 and 7.4.1.3.2) + cce-REG-MappingType CHOICE { + interleaved SEQUENCE { + -- Resource Element Groups (REGs) can be bundled to create REG bundles. This parameter defines the size of such bundles. + -- Corresponds to L1 parameter 'CORESET-REG-bundle-size' (see 38.211, section FFS_Section) + reg-BundleSize ENUMERATED {n2, n3, n6}, + -- Corresponds to L1 parameter 'CORESET-interleaver-size' (see 38.211, 38.213, section FFS_Section) + interleaverSize ENUMERATED {n2, n3, n6}, + -- Corresponds to L1 parameter 'CORESET-shift-index' (see 38.211, section 7.3.2.2) + shiftIndex INTEGER(0..maxNrofPhysicalResourceBlocks-1) + }, + nonInterleaved NULL + }, + -- Precoder granularity in frequency domain. + -- Corresponds to L1 parameter 'CORESET-precoder-granuality' (see 38.211, sections 7.3.2.2 and 7.4.1.3.2) + precoderGranularity ENUMERATED {sameAsREG-bundle, allContiguousRBs}, + + -- A subset of the TCI states defined in TCI-States used for providing QCL relationships between the DL RS(s) in one RS Set + -- (TCI-State) and the PDCCH DMRS ports. Corresponds to L1 parameter 'TCI-StatesPDCCH' (see 38.214, section FFS_Section) + tci-StatesPDCCH SEQUENCE(SIZE (1..maxNrofTCI-StatesPDCCH)) OF TCI-StateId OPTIONAL, -- Need R + + -- If at least spatial QCL is configured/indicated, this field indicates if TCI field is present or not present in DL-related DCI. + -- When the field is absent the UE considers the TCI to be absent/disabled. + -- Corresponds to L1 parameter 'TCI-PresentInDCI' (see 38,213, section 5.1.5) + tci-PresentInDCI ENUMERATED {enabled} OPTIONAL, -- Need S + + -- PDCCH DMRS scrambling initalization. Corresponds to L1 parameter 'PDCCH-DMRS-Scrambling-ID' (see 38.214, section 5.1) + -- When the field is absent the UE applies the value '0'. + pdcch-DMRS-ScramblingID BIT STRING (SIZE (16)) OPTIONAL -- Need S +} + +-- TAG-CONTROLRESOURCESET-STOP +-- TAG-CONTROL-RESOURCE-SET-ID-START + +ControlResourceSetId ::= INTEGER (0..maxNrofControlResourceSets-1) + +-- TAG-CONTROL-RESOURCE-SET-ID-STOP + +CrossCarrierSchedulingConfig ::= SEQUENCE { + schedulingCellInfo CHOICE { + own SEQUENCE { -- No cross carrier scheduling + cif-Presence BOOLEAN + }, + other SEQUENCE { -- Cross carrier scheduling + schedulingCellId ServCellIndex, + cif-InSchedulingCell INTEGER (1..7) + } -- Cond SCellOnly + }, + ... +} + +-- TAG-CSI-APERIODICTRIGGERSTATELIST-START + +CSI-AperiodicTriggerStateList ::= SEQUENCE (SIZE (1..maxNrOfCSI-AperiodicTriggers)) OF CSI-AperiodicTriggerState + +CSI-AperiodicTriggerState ::= SEQUENCE { + associatedReportConfigInfoList SEQUENCE (SIZE(1..maxNrofReportConfigPerAperiodicTrigger)) OF CSI-AssociatedReportConfigInfo, + ... +} + +CSI-AssociatedReportConfigInfo ::= SEQUENCE { + -- The reportConfigId of one of the CSI-ReportConfigToAddMod configured in CSI-MeasConfig + reportConfigId CSI-ReportConfigId, + + resourcesForChannel CHOICE { + nzp-CSI-RS SEQUENCE { + -- NZP-CSI-RS-ResourceSet for channel measurements. Entry number in nzp-CSI-RS-ResourceSetList in the CSI-ResourceConfig + -- indicated by resourcesForChannelMeasurement in the CSI-ReportConfig indicated by reportConfigId above + -- (1 corresponds to the first entry, 2 to thesecond entry, and so on). + resourceSet INTEGER (1..maxNrofNZP-CSI-RS-ResourceSetsPerConfig), + + -- List of references to TCI-States for providing the QCL source and QCL type for for each NZP-CSI-RS-Resource + -- listed in nzp-CSI-RS-Resources of the NZP-CSI-RS-ResourceSet indicated by nzp-CSI-RS-ResourcesforChannel. + -- First entry in qcl-info-forChannel corresponds to first entry in nzp-CSI-RS-Resources of that NZP-CSI-RS-ResourceSet, + -- second entry in qcl-info-forChannel corresponds to second entry in nzp-CSI-RS-Resources, + -- and so on. Corresponds to L1 parameter 'QCL-Info-aPeriodicReportingTrigger' (see 38.214, section 5.2.1.5.1) + qcl-info SEQUENCE (SIZE(1..maxNrofAP-CSI-RS-ResourcesPerSet)) OF TCI-StateId + }, + -- CSI-SSB-ResourceSet for channel measurements. Entry number in csi-SSB-ResourceSetList in the CSI-ResourceConfig indicated by + -- resourcesForChannelMeasurement in the CSI-ReportConfig indicated by reportConfigId above (1 corresponds to the first entry, 2 to + -- the second entry, and so on). + csi-SSB-ResourceSet INTEGER (1..maxNrofCSI-SSB-ResourceSetsPerConfig) + }, + + -- CSI-IM-ResourceSet for interference measurement. Entry number in csi-IM-ResourceSetList in the CSI-ResourceConfig indicated by + -- csi-IM-ResourcesForInterference in the CSI-ReportConfig indicated by reportConfigId above (1 corresponds to the first entry, 2 to the second + -- entry, and so on). + -- The indicated CSI-IM-ResourceSet should have exactly the same number of resources like the NZP-CSI-RS-ResourceSet indicated in + -- nzp-CSI-RS-ResourcesforChannel. + -- This field can only be present if the CSI-ReportConfig identified by reportConfigId includes csi-IM-ResourcesForInterference. + csi-IM-ResourcesforInteference INTEGER(1..maxNrofCSI-IM-ResourceSetsPerConfig) OPTIONAL, --Cond CSI-IM-forInterference + + + -- NZP-CSI-RS-ResourceSet for interference measurement. Entry number in nzp-CSI-RS-ResourceSetList in the CSI-ResourceConfig indicated by + -- nzp-CSI-RS-ResourcesForInterference in the CSI-ReportConfig indicated by reportConfigId above (1 corresponds to the first entry, + -- 2 to the second entry, and so on). + -- The indicated NZP-CSI-RS-ResourceSet should have exactly the same number of resources like the NZP-CSI-RS-ResourceSet indicated in + -- nzp-CSI-RS-ResourcesforChannel. + -- This field can only be present if the CSI-ReportConfig identified by reportConfigId includes nzp-CSI-RS-ResourcesForInterference. + nzp-CSI-RS-ResourcesforInterference INTEGER (1..maxNrofNZP-CSI-RS-ResourceSetsPerConfig) OPTIONAL, --Cond LinkedNZP-CSI-RS-forInterference + ... +} + +-- TAG-CSI-APERIODICTRIGGERSTATELIST-STOP +-- TAG-CSI-FREQUENCYOCCUPATION-START + +CSI-FrequencyOccupation ::= SEQUENCE { + -- PRB where this CSI resource starts in relation to PRB 0 of the associated BWP. + -- Only multiples of 4 are allowed (0, 4, ...) + startingRB INTEGER (0..maxNrofPhysicalResourceBlocks-1), + -- Number of PRBs across which this CSI resource spans. Only multiples of 4 are allowed. The smallest configurable + -- number is the minimum of 24 and the width of the associated BWP. + nrofRBs INTEGER (24..maxNrofPhysicalResourceBlocks), + ... +} + +-- TAG-CSI-FREQUENCYOCCUPATION-STOP +-- TAG-CSI-IM-RESOURCE-START +CSI-IM-Resource ::= SEQUENCE { + csi-IM-ResourceId CSI-IM-ResourceId, + + -- The resource element pattern (Pattern0 (2,2) or Pattern1 (4,1)) with corresponding parameters. + -- Corresponds to L1 parameter 'CSI-IM-RE-pattern' (see 38.214, section 5.2.2.3.4) + csi-IM-ResourceElementPattern CHOICE { + pattern0 SEQUENCE { + -- OFDM subcarrier occupancy of the CSI-IM resource for Pattern0 + -- Corresponds to L1 parameter 'CSI-IM-ResourceMapping' (see 38.214, section 5.2.2.3.4) + subcarrierLocation-p0 ENUMERATED { s0, s2, s4, s6, s8, s10 }, + -- OFDM symbol location of the CSI-IM resource for Pattern0 + -- Corresponds to L1 parameter 'CSI-IM-ResourceMapping' (see 38.214, section 5.2.2.3.4) + symbolLocation-p0 INTEGER (0..12) + }, + pattern1 SEQUENCE { + -- OFDM subcarrier occupancy of the CSI-IM resource for Pattern1 + -- Corresponds to L1 parameter 'CSI-IM-ResourceMapping' (see 38.214, section 5.2.2.3.4) + subcarrierLocation-p1 ENUMERATED { s0, s4, s8 }, + -- OFDM symbol location of the CSI-IM resource for Pattern1 + -- Corresponds to L1 parameter 'CSI-IM-ResourceMapping' (see 38.214, section 5.2.2.3.4) + symbolLocation-p1 INTEGER (0..13) + } + } OPTIONAL, --Need M + + -- Frequency-occupancy of CSI-IM. Corresponds to L1 parameter 'CSI-IM-FreqBand' (see 38.214, section 5.2.2.3.2) + freqBand CSI-FrequencyOccupation OPTIONAL, -- Need M + + -- Periodicity and slot offset for periodic/semi-persistent CSI-IM. Corresponds to L1 parameter 'CSI-IM-timeConfig' + periodicityAndOffset CSI-ResourcePeriodicityAndOffset OPTIONAL, --Cond PeriodicOrSemiPersistent + ... +} + +-- TAG-CSI-IM-RESOURCE-STOP +-- TAG-CSI-IM-RESOURCEID-START +CSI-IM-ResourceId ::= INTEGER (0..maxNrofCSI-IM-Resources-1) + +-- TAG-CSI-IM-RESOURCEID-STOP +-- TAG-CSI-IM-RESOURCESET-START +CSI-IM-ResourceSet ::= SEQUENCE { + + csi-IM-ResourceSetId CSI-IM-ResourceSetId, + -- CSI-IM-Resources associated with this CSI-IM-ResourceSet + -- Corresponds to L1 parameter 'CSI-IM-ResourceConfigList' (see 38.214, section 5.2) + csi-IM-Resources SEQUENCE (SIZE(1..maxNrofCSI-IM-ResourcesPerSet)) OF CSI-IM-ResourceId, + ... +} +-- TAG-CSI-IM-RESOURCESET-STOP +-- TAG-CSI-IM-RESOURCESETID-START + +CSI-IM-ResourceSetId ::= INTEGER (0..maxNrofCSI-IM-ResourceSets-1) + +-- TAG-CSI-IM-RESOURCESETID-STOP +-- TAG-CSI-MEAS-CONFIG-START + +CSI-MeasConfig ::= SEQUENCE { + -- Pool of NZP-CSI-RS-Resource which can be referred to from NZP-CSI-RS-ResourceSet + nzp-CSI-RS-ResourceToAddModList SEQUENCE (SIZE (1..maxNrofNZP-CSI-RS-Resources)) OF NZP-CSI-RS-Resource OPTIONAL, -- Need N + nzp-CSI-RS-ResourceToReleaseList SEQUENCE (SIZE (1..maxNrofNZP-CSI-RS-Resources)) OF NZP-CSI-RS-ResourceId OPTIONAL, -- Need N + + -- Pool of NZP-CSI-RS-ResourceSet which can be referred to from CSI-ResourceConfig or from MAC CEs + nzp-CSI-RS-ResourceSetToAddModList SEQUENCE (SIZE (1..maxNrofNZP-CSI-RS-ResourceSets)) OF NZP-CSI-RS-ResourceSet OPTIONAL, -- Need N + nzp-CSI-RS-ResourceSetToReleaseList SEQUENCE (SIZE (1..maxNrofNZP-CSI-RS-ResourceSets)) OF NZP-CSI-RS-ResourceSetId OPTIONAL, -- Need N + + -- Pool of CSI-IM-Resource which can be referred to from CSI-IM-ResourceSet + csi-IM-ResourceToAddModList SEQUENCE (SIZE (1..maxNrofCSI-IM-Resources)) OF CSI-IM-Resource OPTIONAL, -- Need N + csi-IM-ResourceToReleaseList SEQUENCE (SIZE (1..maxNrofCSI-IM-Resources)) OF CSI-IM-ResourceId OPTIONAL, -- Need N + + -- Pool of CSI-IM-ResourceSet which can be referred to from CSI-ResourceConfig or from MAC CEs + csi-IM-ResourceSetToAddModList SEQUENCE (SIZE (1..maxNrofCSI-IM-ResourceSets)) OF CSI-IM-ResourceSet OPTIONAL, -- Need N + csi-IM-ResourceSetToReleaseList SEQUENCE (SIZE (1..maxNrofCSI-IM-ResourceSets)) OF CSI-IM-ResourceSetId OPTIONAL, -- Need N + + -- Pool of CSI-SSB-ResourceSet which can be referred to from CSI-ResourceConfig + csi-SSB-ResourceSetToAddModList SEQUENCE (SIZE (1..maxNrofCSI-SSB-ResourceSets)) OF CSI-SSB-ResourceSet OPTIONAL, -- Need N + csi-SSB-ResourceSetToAddReleaseList SEQUENCE (SIZE (1..maxNrofCSI-SSB-ResourceSets)) OF CSI-SSB-ResourceSetId OPTIONAL, -- Need N + + -- Configured CSI resource settings as specified in TS 38.214 section 5.2.1.2 + csi-ResourceConfigToAddModList SEQUENCE (SIZE (1..maxNrofCSI-ResourceConfigurations)) OF CSI-ResourceConfig OPTIONAL, -- Need N + csi-ResourceConfigToReleaseList SEQUENCE (SIZE (1..maxNrofCSI-ResourceConfigurations)) OF CSI-ResourceConfigId OPTIONAL, -- Need N + + -- Configured CSI report settings as specified in TS 38.214 section 5.2.1.1 + csi-ReportConfigToAddModList SEQUENCE (SIZE (1..maxNrofCSI-ReportConfigurations)) OF CSI-ReportConfig OPTIONAL, -- Need N + csi-ReportConfigToReleaseList SEQUENCE (SIZE (1..maxNrofCSI-ReportConfigurations)) OF CSI-ReportConfigId OPTIONAL, -- Need N + + + -- Size of CSI request field in DCI (bits). Corresponds to L1 parameter 'ReportTriggerSize' (see 38.214, section 5.2) + reportTriggerSize INTEGER (0..6) OPTIONAL, + + -- Contains trigger states for dynamically selecting one or more aperiodic and semi-persistent reporting configurations + -- and/or triggering one or more aperiodic CSI-RS resource sets for channel and/or interference measurement. + -- FFS: How to address the MAC-CE configuration + aperiodicTriggerStateList SetupRelease { CSI-AperiodicTriggerStateList } OPTIONAL, -- Need M + semiPersistentOnPUSCH-TriggerStateList SetupRelease { CSI-SemiPersistentOnPUSCH-TriggerStateList } OPTIONAL, -- Need M + ... +} + +maxNrofNZP-CSI-RS-ResourceSets INTEGER ::= 64 +maxNrofNZP-CSI-RS-ResourceSets-1 INTEGER ::= 63 + +maxNrofCSI-SSB-ResourceSets INTEGER ::= 64 +maxNrofCSI-SSB-ResourceSets-1 INTEGER ::= 63 + +maxNrofCSI-IM-ResourceSets INTEGER ::= 64 +maxNrofCSI-IM-ResourceSets-1 INTEGER ::= 63 + +-- TAG-CSI-MEAS-CONFIG-STOP +-- TAG-CSI-REPORTCONFIG-START +-- Configuration of a CSI-Report sent on L1 (e.g. PUCCH) (see 38.214, section 5.2.1) +CSI-ReportConfig ::= SEQUENCE { + reportConfigId CSI-ReportConfigId, + + -- Indicates in which serving cell the CSI-ResourceConfigToAddMod(s) below are to be found. + -- If the field is absent, the resources are on the same serving cell as this report configuration. + carrier ServCellIndex OPTIONAL, -- Need S + + -- Resources for channel measurement. csi-ResourceConfigId of a CSI-ResourceConfig included in the configuration of the serving cell + -- indicated with the field "carrier" above. This CSI-ReportConfig is associated with the DL BWP indicated by bwp-Id in that CSI-ResourceConfig. + resourcesForChannelMeasurement CSI-ResourceConfigId, + + -- CSI IM resources for interference measurement. csi-ResourceConfigId of a CSI-ResourceConfig included in the configuration of the serving cell + -- indicated with the field "carrier" above. The bwp-Id in that CSI-ResourceConfigToAddMod is the same value like the bwp-Id in the + -- CSI-ResourceConfig indicated by resourcesForChannelMeasurement. + csi-IM-ResourcesForInterference CSI-ResourceConfigId OPTIONAL, -- Need R + + -- NZP CSI RS resources for interference measurement. csi-ResourceConfigId of a CSI-ResourceConfigToAddMod included in the configuration of the + -- serving cell indicated with the field "carrier" above. The bwp-Id in that CSI-ResourceConfigToAddMod is the same value like the bwp-Id in the + -- CSI-ResourceConfigToAddMod indicated by resourcesForChannelMeasurement. + nzp-CSI-RS-ResourcesForInterference CSI-ResourceConfigId OPTIONAL, -- Need R + + -- Time domain behavior of reporting configuration + reportConfigType CHOICE { + periodic SEQUENCE { + -- Periodicity and slot offset. Corresponds to L1 parameter 'ReportPeriodicity'and 'ReportSlotOffset' + -- (see 38.214, section section 5.2.1.4). + reportSlotConfig CSI-ReportPeriodicityAndOffset, + -- Indicates which PUCCH resource to use for reporting on PUCCH. + pucch-CSI-ResourceList SEQUENCE (SIZE (1..maxNrofBWPs)) OF PUCCH-CSI-Resource + }, + semiPersistentOnPUCCH SEQUENCE { + -- Periodicity and slot offset. Corresponds to L1 parameter 'ReportPeriodicity' and 'ReportSlotOffset' + -- (see 38.214, section section 5.2.1.4). + reportSlotConfig CSI-ReportPeriodicityAndOffset, + -- Indicates which PUCCH resource to use for reporting on PUCCH. + pucch-CSI-ResourceList SEQUENCE (SIZE (1..maxNrofBWPs)) OF PUCCH-CSI-Resource + }, + semiPersistentOnPUSCH SEQUENCE { + -- Periodicity. Corresponds to L1 parameter 'Reportperiodicity-spCSI'. (see 38.214, section 5.2.1.1?FFS_Section) + reportSlotConfig ENUMERATED {sl5, sl10, sl20, sl40, sl80, sl160, sl320}, + -- Timing offset Y for aperiodic reporting using PUSCH. This field lists the allowed offset values. + -- A particular value is indicated in DCI. The first report is transmitted in slot n+Y, second report in n+Y+P, + -- where P is the configured periodicity. + reportSlotOffsetList SEQUENCE (SIZE (1..4)) OF INTEGER (0..7), + -- RNTI for SP CSI-RNTI, Corresponds to L1 parameter 'SPCSI-RNTI' (see 38.214, section 5.2.1.5.2) + -- FFS: RAN1 models different RNTIs as different Search Spaces with independent configurations. Align the configuration + -- of this one (e.g. group with monitoring periodicity, PDCCH candidate configuration, DCI-Payload size...)? + csi-RNTI RNTI-Value, + -- Index of the p0-alpha set determining the power control for this CSI report transmission. + -- Corresponds to L1 parameter 'SPCSI-p0alpha' (see 38.214, section FFS_Section) + p0alpha P0-PUSCH-AlphaSetId + }, + aperiodic SEQUENCE { + -- Timing offset Y for aperiodic reporting using PUSCH. This field lists the allowed offset values. A particular value is indicated in DCI. + -- (see 38.214, section 5.2.3) + -- FFS_Value: Range wasn’t final in RAN1 table. + -- FFS_FIXME: How are the DCI codepoints mapped to the allowed offsets? + reportSlotOffsetList SEQUENCE (SIZE (1..16)) OF INTEGER (0..7) + } + }, + -- The CSI related quanities to report. Corresponds to L1 parameter 'ReportQuantity' (see 38.214, section REF) + reportQuantity CHOICE { + none NULL, + cri-RI-PMI-CQI NULL, + cri-RI-i1 NULL, + cri-RI-i1-CQI SEQUENCE { + -- PRB bundling size to assume for CQI calcuation when reportQuantity is CRI/RI/i1/CQI + -- Corresponds to L1 parameter 'PDSCH-bundle-size-for-CSI' (see 38.214, section 5.2.1.4) + pdsch-BundleSizeForCSI ENUMERATED {n2, n4} OPTIONAL + }, + cri-RI-CQI NULL, + cri-RSRP NULL, + ssb-Index-RSRP NULL, + cri-RI-LI-PMI-CQI NULL + }, + -- Reporting configuration in the frequency domain. (see 38.214, section 5.2.1.4) + reportFreqConfiguration SEQUENCE { + -- Indicates whether the UE shall report a single (wideband) or multiple (subband) CQI. (see 38.214, section 5.2.1.4) + cqi-FormatIndicator ENUMERATED { widebandCQI, subbandCQI }, + -- Indicates whether the UE shall report a single (wideband) or multiple (subband) PMI. (see 38.214, section 5.2.1.4) + pmi-FormatIndicator ENUMERATED { widebandPMI, subbandPMI }, + -- Indicates a contiguous or non-contigous subset of subbands in the bandwidth part which CSI shall be reported + -- for. Each bit in the bit-string represents one subband. The right-most bit in the bit string represents the + -- lowest subband in the BWP. (see 38.214, section 5.2.1.4) + -- The number of subbands is determined according to 38.214 section 5.2.1.4. It is absent if there are less than 24 PRBs (no sub band) + -- and present otherwise, the number of sub bands can be from 3 (24 PRBs, sub band size 8) to 18 (72 PRBs, sub band size 4). + csi-ReportingBand CHOICE { + subbands3 BIT STRING(SIZE(3)), + subbands4 BIT STRING(SIZE(4)), + subbands5 BIT STRING(SIZE(5)), + subbands6 BIT STRING(SIZE(6)), + subbands7 BIT STRING(SIZE(7)), + subbands8 BIT STRING(SIZE(8)), + subbands9 BIT STRING(SIZE(9)), + subbands10 BIT STRING(SIZE(10)), + subbands11 BIT STRING(SIZE(11)), + subbands12 BIT STRING(SIZE(12)), + subbands13 BIT STRING(SIZE(13)), + subbands14 BIT STRING(SIZE(14)), + subbands15 BIT STRING(SIZE(15)), + subbands16 BIT STRING(SIZE(16)), + subbands17 BIT STRING(SIZE(17)), + subbands18 BIT STRING(SIZE(18)), + ... + } OPTIONAL -- Need S + + }, + -- Time domain measurement restriction for the channel (signal) measurements. + -- Corresponds to L1 parameter 'MeasRestrictionConfig-time-channel' (see 38.214, section 5.2.1.1) + timeRestrictionForChannelMeasurements ENUMERATED {configured, notConfigured}, + -- Time domain measurement restriction for interference measurements. + -- Corresponds to L1 parameter 'MeasRestrictionConfig-time-interference' (see 38.214, section 5.2.1.1) + timeRestrictionForInterferenceMeasurements ENUMERATED {configured, notConfigured}, + -- Codebook configuration for Type-1 or Type-II including codebook subset restriction + codebookConfig CodebookConfig, + -- Maximum number of CQIs per CSI report (cf. 1 for 1-CW, 2 for 2-CW) + nrofCQIsPerReport ENUMERATED {n1, n2}, + -- Turning on/off group beam based reporting (see 38.214, section 5.2.1.4) + groupBasedBeamReporting CHOICE { + enabled NULL, + disabled SEQUENCE { + -- The number (N) of measured RS resources to be reported per report setting in a non-group-based report. + -- N <= N_max, where N_max is either 2 or 4 depending on UE capability. + -- FFS: The signaling mechanism for the gNB to select a subset of N beams for the UE to measure and report. + -- FFS: Note: this parameter may not be needed for certain resource and/or report settings + -- FFS_ASN1: Change groupBasedBeamReporting into a CHOICE and include this field into the "no" option? + -- (see 38.214, section FFS_Section) + -- When the field is absent the UE applies the value 1 + nrofReportedRS ENUMERATED {n1, n2, n3, n4} OPTIONAL -- Need S + } + }, + + -- Which CQI table to use for CQI calculation. Corresponds to L1 parameter 'CQI-table' (see 38.214, section 5.2.2.1) + cqi-Table ENUMERATED {table1, table2, spare2, spare1} OPTIONAL, + -- Indicates one out of two possible BWP-dependent values for the subband size as indicated in 38.214 table 5.2.1.4-2 + -- Corresponds to L1 parameter 'SubbandSize' (see 38.214, section 5.2.1.4) + subbandSize ENUMERATED {value1, value2}, + -- BLER target that the UE shall be assume in its CQI calculation. + -- Corresponds to L1 parameter 'BLER-Target' (see 38.214, section 5.2.2.1) + -- FFS_Values (now filled with spares) + bler-Target ENUMERATED {zerodot1, spare3, space2, spare1} OPTIONAL, + -- Port indication for RI/CQI calculation. For each CSI-RS resource in the linked ResourceConfig for channel measurement, + -- a port indication for each rank R, indicating which R ports to use. Applicable only for non-PMI feedback. + -- Corresponds to L1 parameter 'Non-PMI-PortIndication' (see 38.214, section FFS_Section) + -- The first entry in non-PMI-PortIndication corresponds to the NZP-CSI-RS-Resource indicated by the first entry in + -- nzp-CSI-RS-Resources in the NZP-CSI-RS-ResourceSet indicated in the first entry of nzp-CSI-RS-ResourceSetList of the + -- CSI-ResourceConfig whose CSI-ResourceConfigId is indicated in a CSI-MeasId together with the above CSI-ReportConfigId, + -- the second entry in non-PMI-PortIndication corresponds to the NZP-CSI-RS-Resource indicated by the second entry in + -- nzp-CSI-RS-Resources in the NZP-CSI-RS-ResourceSet indicated in the first entry of nzp-CSI-RS-ResourceSetList of the + -- same CSI-ResourceConfig, and so on until the NZP-CSI-RS-Resource indicated by the last entry in nzp-CSI-RS-Resources + -- in the in the NZP-CSI-RS-ResourceSet indicated in the first entry of nzp-CSI-RS-ResourceSetList of the + -- same CSI-ResourceConfig, then the next entry corresponds to the NZP-CSI-RS-Resource indicated by the first entry + -- in nzp-CSI-RS-Resources in the NZP-CSI-RS-ResourceSet indicated in the second entry of nzp-CSI-RS-ResourceSetList of the + -- same CSI-ResourceConfig and so on. + non-PMI-PortIndication SEQUENCE (SIZE (1..maxNrofNZP-CSI-RS-ResourcesPerConfig)) OF PortIndexFor8Ranks OPTIONAL, ... +} + +CSI-ReportPeriodicityAndOffset ::= CHOICE { + slots4 INTEGER(0..3), + slots5 INTEGER(0..4), + slots8 INTEGER(0..7), + slots10 INTEGER(0..9), + slots16 INTEGER(0..15), + slots20 INTEGER(0..19), + slots40 INTEGER(0..39), + slots80 INTEGER(0..79), + slots160 INTEGER(0..159), + slots320 INTEGER(0..319) +} + +PUCCH-CSI-Resource ::= CHOICE { + uplinkBandwidthPartId BWP-Id, + -- PUCCH resource for the associated uplink BWP. Only PUCCH-Resource of format 2, 3 and 4 is supported. + pucch-Resource PUCCH-Resource +} + +-- The PortIndexFor8Ranks allows to indicate port indexes for 1 to 8 ranks using a port index ranges from 0 to 31, or from 0 to 15, or from 0 +-- to 7, or from 0 to 3, or from 0 to 1, or with 0 only. + +PortIndexFor8Ranks ::= CHOICE { + portIndex8 SEQUENCE{ + rank1-8 PortIndex8, + rank2-8 SEQUENCE(SIZE(1..2)) OF PortIndex8, + rank3-8 SEQUENCE(SIZE(1..3)) OF PortIndex8, + rank4-8 SEQUENCE(SIZE(1..4)) OF PortIndex8, + rank5-8 SEQUENCE(SIZE(1..5)) OF PortIndex8, + rank6-8 SEQUENCE(SIZE(1..6)) OF PortIndex8, + rank7-8 SEQUENCE(SIZE(1..7)) OF PortIndex8, + rank8-8 SEQUENCE(SIZE(1..8)) OF PortIndex8 + }, + portIndex4 SEQUENCE{ + rank1-4 PortIndex4, + rank2-4 SEQUENCE(SIZE(1..2)) OF PortIndex4, + rank3-4 SEQUENCE(SIZE(1..3)) OF PortIndex4, + rank4-4 SEQUENCE(SIZE(1..4)) OF PortIndex4 + }, + portIndex2 SEQUENCE{ + rank1-2 PortIndex2, + rank2-2 SEQUENCE(SIZE(1..2)) OF PortIndex2 + }, + portIndex1 NULL +} + +PortIndex8::= INTEGER (0..7) +PortIndex4::= INTEGER (0..3) +PortIndex2::= INTEGER (0..1) + +maxNrofNZP-CSI-RS-ResourcesPerConfig INTEGER ::= 128 +-- TAG-CSI-REPORTCONFIG-STOP +-- TAG-CSI-REPORTCONFIGID-START +CSI-ReportConfigId ::= INTEGER (0..maxNrofCSI-ReportConfigurations-1) + +-- TAG-CSI-REPORTCONFIGID-STOP +-- TAG-CSI-RESOURCECONFIG-START + +-- One CSI resource configuration comprising of one or more resource sets +CSI-ResourceConfig ::= SEQUENCE { + + -- Used in CSI-ReportConfig to refer to an instance of CSI-ResourceConfig + csi-ResourceConfigId CSI-ResourceConfigId, + + -- Contains up to maxNrofNZP-CSI-RS-ResourceSetsPerConfig resource sets if ResourceConfigType is 'aperiodic' and 1 otherwise. + -- Corresponds to L1 parameter 'ResourceSetConfigList' (see 38.214, section 5.2.1.3.1) + csi-RS-ResourceSetList CHOICE { + nzp-CSI-RS-SSB SEQUENCE { + nzp-CSI-RS-ResourceSetList SEQUENCE (SIZE (1..maxNrofNZP-CSI-RS-ResourceSetsPerConfig)) OF NZP-CSI-RS-ResourceSetId OPTIONAL, + -- List of SSB resources used for beam measurement and reporting in a resource set + -- Corresponds to L1 parameter 'resource-config-SS-list' (see 38,214, section FFS_Section) + csi-SSB-ResourceSetList SEQUENCE (SIZE (1..maxNrofCSI-SSB-ResourceSetsPerConfig)) OF CSI-SSB-ResourceSetId OPTIONAL + }, + csi-IM-ResourceSetList SEQUENCE (SIZE (1..maxNrofCSI-IM-ResourceSetsPerConfig)) OF CSI-IM-ResourceSetId + }, + + + -- The DL BWP which the CSI-RS associated with this CSI-ResourceConfig are located in. + -- Corresponds to L1 parameter 'BWP-Info' (see 38.214, section 5.2.1.2 + bwp-Id BWP-Id, + + -- Time domain behavior of resource configuration. Corresponds to L1 parameter 'ResourceConfigType' (see 38.214, section 5.2.2.3.5) + resourceType ENUMERATED { aperiodic, semiPersistent, periodic }, + ... +} + +-- TAG-CSI-RESOURCECONFIGTOADDMOD-STOP +-- TAG-CSI-RESOURCECONFIGID-START +CSI-ResourceConfigId ::= INTEGER (0..maxNrofCSI-ResourceConfigurations-1) + +-- TAG-CSI-RESOURCECONFIGID-STOP +-- TAG-CSI-RESOURCEPERIODICITYANDOFFSET-START + +CSI-ResourcePeriodicityAndOffset ::= CHOICE { + slots4 INTEGER (0..3), + slots5 INTEGER (0..4), + slots8 INTEGER (0..7), + slots10 INTEGER (0..9), + slots16 INTEGER (0..15), + slots20 INTEGER (0..19), + slots32 INTEGER (0..31), + slots40 INTEGER (0..39), + slots64 INTEGER (0..63), + slots80 INTEGER (0..79), + slots160 INTEGER (0..159), + slots320 INTEGER (0..319), + slots640 INTEGER (0..639) +} + +-- TAG-CSI-RESIYRCEPERIODICITYANDOFFSET-STOP +-- TAG-CSI-RS-RESOURCEMAPPING-START + +CSI-RS-ResourceMapping ::= SEQUENCE { + -- Frequency domain allocation within a physical resource block in accordance with 38.211, section 7.4.1.5.3 including table 7.4.1.5.2-1. + -- The number of bits that may be set to one depend on the chosen row in that table. For the choice "other", the row can be determined from + -- the parmeters below and from the number of bits set to 1 in frequencyDomainAllocation. + frequencyDomainAllocation CHOICE { + row1 BIT STRING (SIZE (4)), + row2 BIT STRING (SIZE (12)), + row4 BIT STRING (SIZE (3)), + other BIT STRING (SIZE (6)) + }, + -- Number of ports (see 38.214, section 5.2.2.3.1) + nrofPorts ENUMERATED {p1,p2,p4,p8,p12,p16,p24,p32}, + -- Time domain allocation within a physical resource block. The field indicates the first OFDM symbol in the PRB used for CSI-RS. + -- Parameter l0 in 38.211, section 7.4.1.5.3. Value 2 is supported only when DL-DMRS-typeA-pos equals 3. + firstOFDMSymbolInTimeDomain INTEGER (0..13), + -- Time domain allocation within a physical resource block. Parameter l1 in 38.211, section 7.4.1.5.3. + firstOFDMSymbolInTimeDomain2 INTEGER (0..13) OPTIONAL, -- Need R + -- CDM type (see 38.214, section 5.2.2.3.1) + cdm-Type ENUMERATED {noCDM, fd-CDM2, cdm4-FD2-TD2, cdm8-FD2-TD4}, + -- Density of CSI-RS resource measured in RE/port/PRB. Corresponds to L1 parameter 'CSI-RS-Density' (see 38.211, section 7.4.1.5.3) + -- Values 0.5 (dot5), 1 (one) and 3 (three) are allowed for X=1, + -- values 0.5 (dot5) and 1 (one) are allowed for X=2, 16, 24 and 32, + -- value 1 (one) is allowed for X=4, 8, 12. + -- For density = 1/2, includes 1 bit indication for RB level comb offset indicating whether odd or even RBs are occupied by CSI-RS + density CHOICE { + dot5 ENUMERATED {evenPRBs, oddPRBs}, + one NULL, + three NULL, + spare NULL + }, + -- Wideband or partial band CSI-RS. Corresponds to L1 parameter 'CSI-RS-FreqBand' (see 38.214, section 5.2.2.3.1) + freqBand CSI-FrequencyOccupation, + ... +} + +-- TAG-CSI-RS-RESOURCEMAPPING-STOP +-- TAG-CSI-SEMIPERSISTENTONPUSCHTRIGGERSTATELIST-START + +CSI-SemiPersistentOnPUSCH-TriggerStateList ::= SEQUENCE(SIZE (1..maxNrOfSemiPersistentPUSCH-Triggers)) OF CSI-SemiPersistentOnPUSCH-TriggerState +CSI-SemiPersistentOnPUSCH-TriggerState ::= SEQUENCE { + associatedReportConfigInfo CSI-ReportConfigId, + ... +} + +maxNrOfSemiPersistentPUSCH-Triggers INTEGER ::= 64 -- Maximum number of triggers for semi persistent reporting on PUSCH + +-- TAG-CSI-SEMIPERSISTENTONPUSCHTRIGGERSTATELIST-STOP +-- TAG-CSI-SSB-RESOURCESETID-START + +CSI-SSB-ResourceSetId ::= INTEGER (0..maxNrofCSI-SSB-ResourceSets-1) + +-- TAG-CSI-SSB-RESOURCESETID-STOP +-- TAG-CSI-SSB-RESOURCESET-START + +CSI-SSB-ResourceSet ::= SEQUENCE { + csi-SSB-ResourceSetId CSI-SSB-ResourceSetId, + csi-SSB-ResourceList SEQUENCE (SIZE(1..maxNrofCSI-SSB-ResourcePerSet)) OF SSB-Index, + ... +} + +-- TAG-CSI-SSB-RESOURCESET-STOP +-- TAG-DMRS-DOWNLINKCONFIG-START + +DMRS-DownlinkConfig ::= SEQUENCE { + -- Selection of the DMRS type to be used for DL (see 38.211, section 7.4.1.1.1). + -- If the field is absent, the UE uses DMRS type 1. + dmrs-Type ENUMERATED {type2} OPTIONAL, -- Need R + -- Position for additional DM-RS in DL, see Table 7.4.1.1.2-4 in 38.211. + -- The four values represent the cases of 1+0, 1+1, 1+1+1. 1+1+1+1 non-adjacent OFDM symbols for DL. + -- If the field is absent, the UE applies the value pos2. + dmrs-AdditionalPosition ENUMERATED {pos0, pos1, pos3} OPTIONAL, -- Need R + -- DM-RS groups that are QCL:ed, i.e. group 1 (see 38.214, section 5.1) + dmrs-group1 BIT STRING (SIZE (12)) OPTIONAL, -- Need R + -- DM-RS groups that are QCL:ed, i.e. group 2 (see 38.214, section 5.1) + dmrs-group2 BIT STRING (SIZE (12)) OPTIONAL, -- Need R + -- The maximum number of OFDM symbols for DL front loaded DMRS. 'len1' corresponds to value 1. 'len2 corresponds to value 2. + -- If the field is absent, the UE applies value len1. + -- Corresponds to L1 parameter 'DL-DMRS-max-len' (see 38.214, section 5.1) + maxLength ENUMERATED {len2} OPTIONAL, -- Need R + -- DL DMRS scrambling initalization + -- Corresponds to L1 parameter 'n_SCID 0' (see 38.211, section 7.4.1) + -- When the field is absent the UE applies the value Physical cell ID (physCellId) configured for this serving cell." + scramblingID0 INTEGER (0..65535) OPTIONAL, -- Need S + -- DL DMRS scrambling initalization. Corresponds to L1 parameter 'n_SCID 1' (see 38.211, section 7.4.1) + -- When the field is absent the UE applies the value (physCellId) configured for this serving cell. + scramblingID1 INTEGER (0..65535) OPTIONAL, -- Need S + + -- Configures downlink PTRS. If absent of released, the UE assumes that downlink PTRS are not present. See 38.214 section 5.1.6.3 + phaseTrackingRS SetupRelease { PTRS-DownlinkConfig } OPTIONAL, -- Need M + + ... +} + +-- TAG-DMRS-DOWNLINKCONFIG-STOP +-- TAG-DMRS-UPLINKCONFIG-START + +DMRS-UplinkConfig ::= SEQUENCE { + -- Selection of the DMRS type to be used for UL (see section 38.211, section 6.4.1.1.3) + -- If the field is absent, the UE uses DMRS type 1. + dmrs-Type ENUMERATED {type2} OPTIONAL, -- Need R + -- Position for additional DM-RS in UL. Corresponds to L1 parameter 'UL-DMRS-add-pos' (see Table 7.4.1.1.2-4 in 38.211) + -- The four values represent the cases of 1+0, 1+1, 1+1+1. 1+1+1+1 non-adjacent OFDM symbols for UL. + -- If the field is absent, the UE applies the value pos2. + dmrs-AdditionalPosition ENUMERATED {pos0, pos1, pos3} OPTIONAL, -- Need R + -- Configures uplink PTRS (see 38.211, section x.x.x.x) FFS_Ref + phaseTrackingRS SetupRelease { PTRS-UplinkConfig } OPTIONAL, -- Need M + -- The maximum number of OFDM symbols for UL front loaded DMRS. 'len1' corresponds to value 1. 'len2 corresponds to value 2. + -- If the field is absent, the UE applies value len1. + -- Corresponds to L1 parameter 'UL-DMRS-max-len' (see 38.214, section 6.4.1.1.2) + maxLength ENUMERATED {len2} OPTIONAL, -- Need R + + transformPrecoding CHOICE { + -- DMRS related parameters for Cyclic Prefix OFDM + disabled SEQUENCE { + -- UL DMRS scrambling initalization for CP-OFDM + -- Corresponds to L1 parameter 'n_SCID 0' (see 38.214, section 6.4.1.1.2) + -- When the field is absent the UE applies the value Physical cell ID (physCellId) + scramblingID0 INTEGER (0..65535) OPTIONAL, -- Need S + -- UL DMRS scrambling initalization for CP-OFDM. + -- Corresponds to L1 parameter 'n_SCID 1' (see 38.214, section 6.4.1.1.2) + -- When the field is absent the UE applies the value Physical cell ID (physCellId) + scramblingID1 INTEGER (0..65535) OPTIONAL -- Need S + + }, + -- DMRS related parameters for DFT-s-OFDM (Transform Precoding) + enabled SEQUENCE { + -- Parameter: N_ID^(PUSCH) for DFT-s-OFDM DMRS. If the value is absent or released, the UE uses the Physical cell ID. + -- Corresponds to L1 parameter 'nPUSCH-Identity-Transform precoding' (see 38.211, section FFS_Section) + nPUSCH-Identity INTEGER(0..1007) OPTIONAL, -- Need S + -- Sequence-group hopping for PUSCH can be disabled for a certain UE despite being enabled on a cell basis. For DFT-s-OFDM DMRS + -- If the field is released, the UE considers group hopping to be enabled. + -- Corresponds to L1 parameter 'Disable-sequence-group-hopping-Transform-precoding' (see 38.211, section FFS_Section) + disableSequenceGroupHopping ENUMERATED {disabled} OPTIONAL, -- Need S + -- Determines if sequence hopping is enabled or not. For DFT-s-OFDM DMRS. + -- If the field is released, the UE considers sequence hopping to be disabled. + -- Corresponds to L1 parameter 'Sequence-hopping-enabled-Transform-precoding' (see 38.211, section FFS_Section) + sequenceHoppingEnabled ENUMERATED {enabled} OPTIONAL -- Need S + } + }, + ... +} + +-- TAG-DMRS-UPLINKCONFIG-STOP +-- TAG-DOWNLINKPREEMPTION-START + +-- Configuration of downlink preemption indication on PDCCH. +DownlinkPreemption ::= SEQUENCE { + -- RNTI used for indication pre-emption in DL. + -- Corresponds to L1 parameter 'INT-RNTI', where â€INT†stands for â€interruption†(see 38.213, section 10) + int-RNTI RNTI-Value, + + -- Set selection for DL-preemption indication. Corresponds to L1 parameter 'int-TF-unit' (see 38.213, section 10.1) + -- The set determines how the UE interprets the DL preemption DCI payload. + timeFrequencySet ENUMERATED {set0, set1}, + + -- Total length of the DCI payload scrambled with INT-RNTI. The value must be an integer multiple of 14 bit. + -- Corresponds to L1 parameter 'INT-DCI-payload-length' (see 38.213, section 11.2) + dci-PayloadSize INTEGER (0..maxINT-DCI-PayloadSize), + + -- Indicates (per serving cell) the position of the 14 bit INT values inside the DCI payload. + -- Corresponds to L1 parameter 'INT-cell-to-INT' and 'cell-to-INT' (see 38.213, section 11.2) + int-ConfigurationPerServingCell SEQUENCE (SIZE (1..maxNrofServingCells)) OF INT-ConfigurationPerServingCell, + ... +} + +INT-ConfigurationPerServingCell ::= SEQUENCE { + servingCellId ServCellIndex, + -- Starting position (in number of bit) of the 14 bit INT value applicable for this serving cell (servingCellId) within the DCI + -- payload. Must be multiples of 14 (bit). Corresponds to L1 parameter 'INT-values' (see 38.213, section 11.2) + positionInDCI INTEGER (0..maxINT-DCI-PayloadSize-1) +} + +-- TAG-DOWNLINKPREEMPTION-STOP +-- TAG-DRB-IDENTITY-START + +DRB-Identity ::= INTEGER (1..32) + +-- TAG-DRB-IDENTITY-STOP +-- TAG-EUTRA-MBSFN-SUBFRAMECONFIGLIST-START + +EUTRA-MBSFN-SubframeConfigList ::= SEQUENCE (SIZE (1..maxMBSFN-Allocations)) OF EUTRA-MBSFN-SubframeConfig + +EUTRA-MBSFN-SubframeConfig ::= SEQUENCE { + -- Field as defined in MBSFN-SubframeConfig in 36.331 + radioframeAllocationPeriod ENUMERATED {n1, n2, n4, n8, n16, n32}, + -- Field as defined in MBSFN-SubframeConfig in 36.331 + radioframeAllocationOffset INTEGER (0..7), + -- Field as defined in MBSFN-SubframeConfig in 36.331 + subframeAllocation CHOICE { + -- Field as defined in MBSFN-SubframeConfig in 36.331 + oneFrame BIT STRING (SIZE(6)), + -- Field as defined in MBSFN-SubframeConfig in 36.331 + fourFrames BIT STRING (SIZE(24)) + }, + subframeAllocation-v1430 CHOICE { + -- Field as defined in MBSFN-SubframeConfig in 36.331 + oneFrame-v1430 BIT STRING (SIZE(2)), + -- Field as defined in MBSFN-SubframeConfig in 36.331 + fourFrames-v1430 BIT STRING (SIZE(8)) + } OPTIONAL, -- Need R + ... +} + +-- TAG-EUTRA-MBSFN-SUBFRAMECONFIGLIST-STOP + +FilterCoefficient ::= ENUMERATED { + fc0, fc1, fc2, fc3, fc4, fc5, + fc6, fc7, fc8, fc9, fc11, fc13, + fc15, fc17, fc19, spare1, ...} + +-- TAG-FREQBANDINDICATORNR-START + +FreqBandIndicatorNR ::= INTEGER (1..1024) + +-- TAG-FREQBANDINDICATORNR-STOP +-- TAG-FREQUENCY-INFO-DL-START + +FrequencyInfoDL ::= SEQUENCE { + -- Frequency of the SSB to be used for this serving cell. The frequency provided in this field identifies the position of + -- resource element RE=#0 (subcarrier #0) of resource block RB#10 of the SS block. The cell-defining SSB of an SpCell is always on + -- the sync raster. Frequencies are considered to be on the sync raster if they are also identifiable with a GSCN value (see 38.101). + absoluteFrequencySSB ARFCN-ValueNR, + -- The frequency domain offset between SSB and the overall resource block grid in number of subcarriers. + -- Absence of the field indicates that no offset is applied (offset = 0). For FR2 only values up to 11 are applicable. + -- Corresponds to L1 parameter kssb (See 38.211, section 7.4.3.1) + ssb-SubcarrierOffset INTEGER (1..23) OPTIONAL, -- Need S + -- List of one or multiple frequency bands to which this carrier(s) belongs. Multiple values are only supported in + -- system information but not when the FrequencyInfoDL is provided in dedicated signalling (HO or S(p)Cell addition). + frequencyBandList MultiFrequencyBandListNR, + -- Absolute frequency position of the reference resource block (Common RB 0). Its lowest subcarrier is also known as Point A. + -- Note that the lower edge of the actual carrier is not defined by this field but rather in the scs-SpecificCarrierList. + -- Corresponds to L1 parameter 'offset-ref-low-scs-ref-PRB' (see 38.211, section FFS_Section) + absoluteFrequencyPointA ARFCN-ValueNR, + + -- A set of carriers for different subcarrier spacings (numerologies). Defined in relation to Point A. + -- Corresponds to L1 parameter 'offset-pointA-set' (see 38.211, section FFS_Section) + scs-SpecificCarrierList SEQUENCE (SIZE (1..maxSCSs)) OF SCS-SpecificCarrier, + ... +} + +-- TAG-FREQUENCY-INFO-UL-STOP +-- TAG-FREQUENCY-INFO-UL-START + +FrequencyInfoUL ::= SEQUENCE { + -- List of one or multiple frequency bands to which this carrier(s) belongs. Multiple values are only supported in + -- system information but not when the FrequencyInfoDL is provided in dedicated signalling (HO or S(p)Cell addition). + frequencyBandList MultiFrequencyBandListNR OPTIONAL, -- Cond FDD-OrSUL + -- Absolute frequency of the reference resource block (Common RB 0). Its lowest subcarrier is also known as Point A. + -- Corresponds to L1 parameter 'offset-ref-low-scs-ref-PRB' (see 38.211, section FFS_Section) + absoluteFrequencyPointA ARFCN-ValueNR OPTIONAL, -- Cond FDD-OrSUL + -- A set of virtual carriers for different subcarrier spacings (numerologies). Defined in relation to Point A. + -- Note that the lower edge of the actual carrier is not defined by this field but rather in the scs-SpecificCarrierList. + -- Corresponds to L1 parameter 'offset-pointA-set' (see 38.211, section FFS_Section) + scs-SpecificCarriers SEQUENCE (SIZE (1..maxSCSs)) OF SCS-SpecificCarrier, + + -- The additional spectrum emission requirements to be applied by the UE on this uplink. + -- If the field is absent, the UE applies the value FFS_RAN4. (see FFS_section, section FFS_Section) + additionalSpectrumEmission AdditionalSpectrumEmission OPTIONAL, -- Need S + -- FFS_Definition. Corresponds to parameter FFS_RAN4. (see FFS_Spec, section FFS_Section) + -- If the field is absent, the UE applies the value FFS_RAN4. + p-Max P-Max OPTIONAL, -- Need S + -- Enable the NR UL transmission with a 7.5KHz shift to the LTE raster. If the field is absent, the frequency shift is disabled. + frequencyShift7p5khz ENUMERATED {true} OPTIONAL, -- Cond FDD-OrSUL-Optional + ... +} + +-- TAG-FREQUENCY-INFO-UL-STOP +-- TAG-GSCN-VALUE-NR-START + +GSCN-ValueNR ::= INTEGER (1..28557) + + +-- TAG-GSCN-VALUE-NR-STOP + +Hysteresis ::= INTEGER (0..30) + +-- TAG-LOGICAL-CHANNEL-CONFIG-START + +LogicalChannelConfig ::= SEQUENCE { + ul-SpecificParameters SEQUENCE { + priority INTEGER (1..16), + prioritisedBitRate ENUMERATED {kBps0, kBps8, kBps16, kBps32, kBps64, kBps128, kBps256, kBps512, + kBps1024, kBps2048, kBps4096, kBps8192, kBps16384, kBps32768, kBps65536, infinity}, + bucketSizeDuration ENUMERATED {ms50, ms100, ms150, ms300, ms500, ms1000, spare2, spare1}, + + allowedServingCells SEQUENCE (SIZE (1..maxNrofServingCells-1)) OF ServCellIndex OPTIONAL, -- Need R + allowedSCS-List SEQUENCE (SIZE (1..maxSCSs)) OF SubcarrierSpacing OPTIONAL, -- Need R + maxPUSCH-Duration ENUMERATED { ms0p02, ms0p04, ms0p0625, ms0p125, ms0p25, ms0p5, spare2, spare1 } OPTIONAL, -- Need R + configuredGrantType1Allowed ENUMERATED {true} OPTIONAL, -- Need R + + logicalChannelGroup INTEGER (0..maxLCG-ID) OPTIONAL, -- Need R + schedulingRequestID SchedulingRequestId OPTIONAL, -- Need R + logicalChannelSR-Mask BOOLEAN, + logicalChannelSR-DelayTimerApplied BOOLEAN + } OPTIONAL, -- Cond UL + + -- other parameters + ... +} + +-- TAG-LOGICAL-CHANNEL-CONFIG-STOP +-- TAG-MAC-CELL-GROUP-CONFIG-START + +MAC-CellGroupConfig ::= SEQUENCE { + drx-Config SetupRelease { DRX-Config } OPTIONAL, -- Need M + + schedulingRequestConfig SchedulingRequestConfig OPTIONAL, -- Need M + bsr-Config BSR-Config OPTIONAL, -- Need M + tag-Config TAG-Config OPTIONAL, -- Need M + phr-Config SetupRelease { PHR-Config } OPTIONAL, -- Need M + -- FFS : configurable per SCell? + skipUplinkTxDynamic BOOLEAN, + -- RNTI value for downlink SPS (see SPS-config) and uplink configured scheduling (see ConfiguredSchedulingConfig). + cs-RNTI SetupRelease { RNTI-Value } OPTIONAL -- Need M +} + +DRX-Config ::= SEQUENCE { + drx-onDurationTimer CHOICE { + subMilliSeconds INTEGER (1..31), + milliSeconds ENUMERATED { + ms1, ms2, ms3, ms4, ms5, ms6, ms8, ms10, ms20, ms30, ms40, ms50, ms60, + ms80, ms100, ms200, ms300, ms400, ms500, ms600, ms800, ms1000, ms1200, + ms1600, spare9, spare8, spare7, spare6, spare5, spare4, spare3, spare2, spare1 } + }, + drx-InactivityTimer ENUMERATED { + ms0, ms1, ms2, ms3, ms4, ms5, ms6, ms8, ms10, ms20, ms30, ms40, ms50, ms60, ms80, + ms100, ms200, ms300, ms500, ms750, ms1280, ms1920, ms2560, spare9, spare8, + spare7, spare6, spare5, spare4, spare3, spare2, spare1}, + drx-HARQ-RTT-TimerDL INTEGER (0..56), + drx-HARQ-RTT-TimerUL INTEGER (0..56), + drx-RetransmissionTimerDL ENUMERATED { + sl0, sl1, sl2, sl4, sl6, sl8, sl16, sl24, sl33, sl40, sl64, sl80, sl96, sl112, sl128, + sl160, sl320, spare15, spare14, spare13, spare12, spare11, spare10, spare9, + spare8, spare7, spare6, spare5, spare4, spare3, spare2, spare1}, + drx-RetransmissionTimerUL ENUMERATED { + sl0, sl1, sl2, sl4, sl6, sl8, sl16, sl24, sl33, sl40, sl64, sl80, sl96, sl112, sl128, + sl160, sl320, spare15, spare14, spare13, spare12, spare11, spare10, spare9, + spare8, spare7, spare6, spare5, spare4, spare3, spare2, spare1 }, + drx-LongCycleStartOffset CHOICE { + ms10 INTEGER(0..9), + ms20 INTEGER(0..19), + ms32 INTEGER(0..31), + ms40 INTEGER(0..39), + ms60 INTEGER(0..59), + ms64 INTEGER(0..63), + ms70 INTEGER(0..69), + ms80 INTEGER(0..79), + ms128 INTEGER(0..127), + ms160 INTEGER(0..159), + ms256 INTEGER(0..255), + ms320 INTEGER(0..319), + ms512 INTEGER(0..511), + ms640 INTEGER(0..639), + ms1024 INTEGER(0..1023), + ms1280 INTEGER(0..1279), + ms2048 INTEGER(0..2047), + ms2560 INTEGER(0..2559), + ms5120 INTEGER(0..5119), + ms10240 INTEGER(0..10239) + }, + -- FFS need for finer offset granulary + -- FFS need for shorter values for long and short cycles + shortDRX SEQUENCE { + drx-ShortCycle ENUMERATED { + ms2, ms3, ms4, ms5, ms6, ms7, ms8, ms10, ms14, ms16, ms20, ms30, ms32, + ms35, ms40, ms64, ms80, ms128, ms160, ms256, ms320, ms512, ms640, spare9, + spare8, spare7, spare6, spare5, spare4, spare3, spare2, spare1 }, + drx-ShortCycleTimer INTEGER (1..16) + } OPTIONAL, -- Need R + drx-SlotOffset INTEGER (0..31) + +} + +PHR-Config ::= SEQUENCE { + phr-PeriodicTimer ENUMERATED {sf10, sf20, sf50, sf100, sf200,sf500, sf1000, infinity}, + phr-ProhibitTimer ENUMERATED {sf0, sf10, sf20, sf50, sf100,sf200, sf500, sf1000}, + phr-Tx-PowerFactorChange ENUMERATED {dB1, dB3, dB6, infinity}, + multiplePHR BOOLEAN, + phr-Type2PCell BOOLEAN, + phr-Type2OtherCell BOOLEAN, + phr-ModeOtherCG ENUMERATED {real, virtual} + +} + + +TAG-Config ::= SEQUENCE { + tag-ToReleaseList SEQUENCE (SIZE (1..maxNrofTAGs)) OF TAG-Id OPTIONAL, -- Need N + tag-ToAddModList SEQUENCE (SIZE (1..maxNrofTAGs)) OF TAG-ToAddMod OPTIONAL -- Need N +} + +TAG-ToAddMod ::= SEQUENCE { + tag-Id TAG-Id, + timeAlignmentTimer TimeAlignmentTimer, + ... +} + +TAG-Id ::= INTEGER (0..maxNrofTAGs-1) + +TimeAlignmentTimer ::= ENUMERATED {ms500, ms750, ms1280, ms1920, ms2560, ms5120, ms10240, infinity} + +BSR-Config ::= SEQUENCE { + periodicBSR-Timer ENUMERATED { + sf1, sf5, sf10, sf16, sf20, sf32, sf40, sf64, sf80, sf128, sf160, sf320, sf640, sf1280, sf2560, infinity}, + retxBSR-Timer ENUMERATED { sf10, sf20, sf40, sf80, sf160, sf320, sf640, sf1280, sf2560, sf5120, sf10240, spare5, spare4, + spare3, spare2, spare1}, + logicalChannelSR-DelayTimer ENUMERATED { sf20, sf40, sf64, sf128, sf512, sf1024, sf2560, spare1} OPTIONAL -- Need R +} + + + +-- TAG-MAC-CELL-GROUP-CONFIG-STOP +-- TAG-MEAS-CONFIG-START + +MeasConfig ::= SEQUENCE { + -- Measurement objects + measObjectToRemoveList MeasObjectToRemoveList OPTIONAL, -- Need N + measObjectToAddModList MeasObjectToAddModList OPTIONAL, -- Need N + + -- Reporting configurations + reportConfigToRemoveList ReportConfigToRemoveList OPTIONAL, -- Need N + reportConfigToAddModList ReportConfigToAddModList OPTIONAL, -- Need N + + -- Measurement identities + measIdToRemoveList MeasIdToRemoveList OPTIONAL, -- Need N + measIdToAddModList MeasIdToAddModList OPTIONAL, -- Need N + + -- Other parameters + --s-Measure config + s-MeasureConfig CHOICE { + ssb-RSRP RSRP-Range, + csi-RSRP RSRP-Range + } OPTIONAL, -- Need M + + quantityConfig QuantityConfig OPTIONAL, -- Need M + + --Placehold for measGapConfig + measGapConfig MeasGapConfig OPTIONAL, -- Need M + ... +} + +MeasObjectToRemoveList ::= SEQUENCE (SIZE (1..maxNrofObjectId)) OF MeasObjectId + +MeasIdToRemoveList ::= SEQUENCE (SIZE (1..maxNrofMeasId)) OF MeasId + +ReportConfigToRemoveList ::= SEQUENCE (SIZE (1..maxReportConfigId)) OF ReportConfigId + +-- TAG-MEAS-CONFIG-STOP +--TAG-MEAS-GAP-CONFIG-START + +MeasGapConfig ::= SEQUENCE { + gapFR2 SetupRelease { GapConfig } OPTIONAL, + ... +} + +GapConfig ::= SEQUENCE { + gapOffset INTEGER (0..159), + mgl ENUMERATED {ms1dot5, ms3, ms3dot5, ms4, ms5dot5, ms6}, + mgrp ENUMERATED {ms20, ms40, ms80, ms160}, + mgta ENUMERATED {ms0, ms0dot25, ms0dot5}, + ... +} + +-- TAG-MEAS-GAP-CONFIG-STOP +-- TAG-MEAS-ID-START + +MeasId ::= INTEGER (1..maxNrofMeasId) + +-- TAG-MEAS-ID-STOP +-- TAG-MEAS-ID-TO-ADD-MOD-LIST-START + +MeasIdToAddModList ::= SEQUENCE (SIZE (1..maxNrofMeasId)) OF MeasIdToAddMod + +MeasIdToAddMod ::= SEQUENCE { + measId MeasId, + measObjectId MeasObjectId, + reportConfigId ReportConfigId +} + +-- TAG-MEAS-ID-TO-ADD-MOD-LIST-STOP +-- TAG-MEAS-OBJECT-ID-START + +MeasObjectId ::= INTEGER (1..maxNrofObjectId) + +-- TAG-MEAS-OBJECT-ID-STOP +-- TAG-MEAS-OBJECT-NR-START + +MeasObjectNR ::= SEQUENCE { + ssbFrequency ARFCN-ValueNR OPTIONAL, + refFreqCSI-RS ARFCN-ValueNR OPTIONAL, + + --RS configuration (e.g. SMTC window, CSI-RS resource, etc.) + referenceSignalConfig ReferenceSignalConfig, + + --Consolidation of L1 measurements per RS index + absThreshSS-BlocksConsolidation ThresholdNR OPTIONAL, -- Need R + absThreshCSI-RS-Consolidation ThresholdNR OPTIONAL, -- Need R + + --Config for cell measurement derivation + nrofSS-BlocksToAverage INTEGER (2..maxNrofSS-BlocksToAverage) OPTIONAL, -- Need R + nrofCSI-RS-ResourcesToAverage INTEGER (2..maxNrofCSI-RS-ResourcesToAverage) OPTIONAL, -- Need R + + -- Filter coefficients applicable to this measurement object + quantityConfigIndex INTEGER (1..maxNrofQuantityConfig), + + --Frequency-specific offsets + offsetFreq Q-OffsetRangeList, + + -- Cell list + cellsToRemoveList PCI-List OPTIONAL, -- Need N + cellsToAddModList CellsToAddModList OPTIONAL, -- Need N + + -- Black list + blackCellsToRemoveList PCI-RangeIndexList OPTIONAL, -- Need N + blackCellsToAddModList BlackCellsToAddModList OPTIONAL, -- Need N + + -- White list + whiteCellsToRemoveList PCI-RangeIndexList OPTIONAL, -- Need N + whiteCellsToAddModList WhiteCellsToAddModList OPTIONAL, -- Need N + ... +} + +ReferenceSignalConfig::= SEQUENCE { + + + -- SSB configuration for mobility (nominal SSBs, timing configuration) + ssb-ConfigMobility SSB-ConfigMobility OPTIONAL, -- Need M + -- CSI-RS resources to be used for CSI-RS based RRM measurements + csi-rs-ResourceConfigMobility SetupRelease { CSI-RS-ResourceConfigMobility } OPTIONAL-- Need M + +} + +-- A measurement timing configuration +SSB-ConfigMobility::= SEQUENCE { + --Only the values 15, 30 or 60 kHz (<6GHz), 60 or 120 kHz (>6GHz) are applicable + subcarrierSpacing SubcarrierSpacing, + -- The set of SS blocks to be measured within the SMTC measurement duration. + -- Corresponds to L1 parameter 'SSB-measured' (see FFS_Spec, section FFS_Section) + -- When the field is absent the UE measures on all SS-blocks + -- FFS_CHECK: Is this IE placed correctly. + ssb-ToMeasure SetupRelease { SSB-ToMeasure } OPTIONAL, -- Need M + + -- Indicates whether the UE can utilize serving cell timing to derive the index of SS block transmitted by neighbour cell: + useServingCellTimingForSync BOOLEAN, + + -- Primary measurement timing configuration. Applicable for intra- and inter-frequency measurements. + smtc1 SEQUENCE { + -- Periodicity and offset of the measurement window in which to receive SS/PBCH blocks. + -- Periodicity and offset are given in number of subframes. + -- FFS_FIXME: This does not match the L1 parameter table! They seem to intend an index to a hidden table in L1 specs. + -- (see 38.213, section REF): + periodicityAndOffset CHOICE { + sf5 INTEGER (0..4), + sf10 INTEGER (0..9), + sf20 INTEGER (0..19), + sf40 INTEGER (0..39), + sf80 INTEGER (0..79), + sf160 INTEGER (0..159) + }, + -- Duration of the measurement window in which to receive SS/PBCH blocks. It is given in number of subframes + -- (see 38.213, section 4.1) + duration ENUMERATED { sf1, sf2, sf3, sf4, sf5 } + }, + + -- Secondary measurement timing confguration for explicitly signalled PCIs. It uses the offset and duration from smtc1. + -- It is supported only for intra-frequency measurements in RRC CONNECTED. + smtc2 SEQUENCE { + -- PCIs that are known to follow this SMTC. + pci-List SEQUENCE (SIZE (1..maxNrofPCIsPerSMTC)) OF PhysCellId OPTIONAL, -- Need M + -- Periodicity for the given PCIs. Timing offset and Duration as provided in smtc1. + periodicity ENUMERATED {sf5, sf10, sf20, sf40, sf80, sf160, spare2, spare1} + } OPTIONAL,-- Cond IntraFreqConnected + ss-RSSI-Measurement SEQUENCE { + measurementSlots CHOICE { + kHz15 BIT STRING (SIZE(1)), + kHz30 BIT STRING (SIZE(2)), + kHz60 BIT STRING (SIZE(4)), + kHz120 BIT STRING (SIZE(8)) + }, + endSymbol INTEGER(0..13) + } OPTIONAL +} + +CSI-RS-ResourceConfigMobility ::= SEQUENCE { + -- MO specific values + isServingCellMO BOOLEAN, + -- Subcarrier spacing of CSI-RS. + -- Only the values 15, 30 or 60 kHz (<6GHz), 60 or 120 kHz (>6GHz) are applicable. + -- Corresponds to L1 parameter 'Numerology' (see 38.211, section FFS_Section) + subcarrierSpacing SubcarrierSpacing, + -- List of cells + csi-RS-CellList-Mobility SEQUENCE (SIZE (1..maxNrofCSI-RS-CellsRRM)) OF CSI-RS-CellMobility + +} + +CSI-RS-CellMobility ::= SEQUENCE { + cellId PhysCellId, + + csi-rs-MeasurementBW SEQUENCE { + -- Allowed size of the measurement BW in PRBs + -- Corresponds to L1 parameter 'CSI-RS-measurementBW-size' (see FFS_Spec, section FFS_Section) + nrofPRBs ENUMERATED { size24, size48, size96, size192, size264}, + -- Starting PRB index of the measurement bandwidth + -- Corresponds to L1 parameter 'CSI-RS-measurement-BW-start' (see FFS_Spec, section FFS_Section) + -- FFS_Value: Upper edge of value range unclear in RAN1 + startPRB INTEGER(0..2169) + }, + + -- Frequency domain density for the 1-port CSI-RS for L3 mobility + -- Corresponds to L1 parameter 'Density' (see FFS_Spec, section FFS_Section) + density ENUMERATED {d1,d3} OPTIONAL, + + +-- List of resources + csi-rs-ResourceList-Mobility SEQUENCE (SIZE (1..maxNrofCSI-RS-ResourcesRRM)) OF CSI-RS-Resource-Mobility +} + + +CSI-RS-Resource-Mobility ::= SEQUENCE { + csi-RS-Index CSI-RS-Index, + -- Contains periodicity and slot offset for periodic/semi-persistent CSI-RS (see 38.211, section x.x.x.x)FFS_Ref + slotConfig CHOICE { + ms4 INTEGER (0..31), + ms5 INTEGER (0..39), + ms10 INTEGER (0..79), + ms20 INTEGER (0..159), + ms40 INTEGER (0..319) + }, + -- Each CSI-RS resource may be associated with one SSB. If such SSB is indicated, the NW also indicates whether the UE may assume + -- quasi-colocation of this SSB with this CSI-RS reosurce. + -- Corresponds to L1 parameter 'Associated-SSB' (see FFS_Spec, section FFS_Section) + + associatedSSB SEQUENCE { + ssb-Index SSB-Index, + -- The CSI-RS resource is either QCL’ed not QCL’ed with the associated SSB in spatial parameters + -- Corresponds to L1 parameter 'QCLed-SSB' (see FFS_Spec, section FFS_Section) + isQuasiColocated BOOLEAN + } OPTIONAL, -- Cond AssociatedSSB + + + -- Frequency domain allocation within a physical resource block in accordance with 38.211, section 7.4.1.5.3 including table 7.4.1.5.2-1. + -- The number of bits that may be set to one depend on the chosen row in that table. For the choice "other", the row can be determined from + -- the parmeters below and from the number of bits set to 1 in frequencyDomainAllocation. + frequencyDomainAllocation CHOICE { + row1 BIT STRING (SIZE (4)), + row2 BIT STRING (SIZE (12)) + }, + + + -- Time domain allocation within a physical resource block. The field indicates the first OFDM symbol in the PRB used for CSI-RS. + -- Parameter l0 in 38.211, section 7.4.1.5.3. Value 2 is supported only when DL-DMRS-typeA-pos equals 3. + firstOFDMSymbolInTimeDomain INTEGER (0..13), + -- Scrambling ID for CSI-RS(see 38.211, section 7.4.1.5.2) + sequenceGenerationConfig INTEGER (0..1023), + ... +} + +CSI-RS-Index ::= INTEGER (0..maxNrofCSI-RS-ResourcesRRM-1) + +Q-OffsetRangeList ::= SEQUENCE { + rsrpOffsetSSB Q-OffsetRange DEFAULT dB0, + rsrqOffsetSSB Q-OffsetRange DEFAULT dB0, + sinrOffsetSSB Q-OffsetRange DEFAULT dB0, + rsrpOffsetCSI-RS Q-OffsetRange DEFAULT dB0, + rsrqOffsetCSI-RS Q-OffsetRange DEFAULT dB0, + sinrOffsetCSI-RS Q-OffsetRange DEFAULT dB0 +} + +SSB-ToMeasure ::= CHOICE { + -- bitmap for sub 3 GHz + shortBitmap BIT STRING (SIZE (4)), + -- bitmap for 3-6 GHz + mediumBitmap BIT STRING (SIZE (8)), + -- bitmap for above 6 GHz + longBitmap BIT STRING (SIZE (64)) +} + + +ThresholdNR ::= SEQUENCE{ + thresholdRSRP RSRP-Range OPTIONAL, + thresholdRSRQ RSRQ-Range OPTIONAL, + thresholdSINR SINR-Range OPTIONAL +} + +CellsToAddModList ::= SEQUENCE (SIZE (1..maxNrofCellMeas)) OF CellsToAddMod + +CellsToAddMod ::= SEQUENCE { + physCellId PhysCellId, + cellIndividualOffset Q-OffsetRangeList +} + +BlackCellsToAddModList ::= SEQUENCE (SIZE (1..maxNrofPCI-Ranges)) OF BlackCellsToAddMod + +BlackCellsToAddMod ::= SEQUENCE { + pci-RangeIndex PCI-RangeIndex, + pci-Range PCI-Range +} + + +WhiteCellsToAddModList ::= SEQUENCE (SIZE (1..maxNrofPCI-Ranges)) OF WhiteCellsToAddMod + +WhiteCellsToAddMod ::= SEQUENCE { + pci-RangeIndex PCI-RangeIndex, + pci-Range PCI-Range +} + +-- TAG-MEAS-OBJECT-NR-STOP +-- TAG-MEAS-OBJECT-TO-ADD-MOD-LIST-START + +MeasObjectToAddModList ::= SEQUENCE (SIZE (1..maxNrofObjectId)) OF MeasObjectToAddMod + +MeasObjectToAddMod ::= SEQUENCE { + measObjectId MeasObjectId, + measObject CHOICE { + measObjectNR MeasObjectNR, + ... + } +} + +-- TAG-MEAS-OBJECT-TO-ADD-MOD-LIST-STOP +-- TAG-MEAS-RESULTS-START + +MeasResults ::= SEQUENCE { + measId MeasId, + measResultServingFreqList MeasResultServFreqList, + measResultNeighCells CHOICE { + measResultListNR MeasResultListNR, + ... + } OPTIONAL, + ... +} + +MeasResultServFreqList ::= SEQUENCE (SIZE (1..maxNrofServingCells)) OF MeasResultServFreq + +MeasResultServFreq ::= SEQUENCE { + servFreqId ServCellIndex, + measResultServingCell MeasResultNR, + measResultBestNeighCell MeasResultNR, + ... +} + +MeasResultListNR ::= SEQUENCE (SIZE (1..maxCellReport)) OF MeasResultNR + +MeasResultNR ::= SEQUENCE { + physCellId PhysCellId OPTIONAL, + --FFS: Details of cgi info + cgi-Info ENUMERATED {ffsTypeAndValue} OPTIONAL, + measResult SEQUENCE { + cellResults SEQUENCE{ + resultsSSB-Cell MeasQuantityResults OPTIONAL, + resultsCSI-RS-Cell MeasQuantityResults OPTIONAL + }, + rsIndexResults SEQUENCE{ + resultsSSB-Indexes ResultsPerSSB-IndexList OPTIONAL, + resultsCSI-RS-Indexes ResultsPerCSI-RS-IndexList OPTIONAL + } OPTIONAL + }, + ... +} + + +MeasQuantityResults ::= SEQUENCE { + rsrp RSRP-Range OPTIONAL, + rsrq RSRQ-Range OPTIONAL, + sinr SINR-Range OPTIONAL +} + +ResultsPerSSB-IndexList::= SEQUENCE (SIZE (1..maxNrofSSBs)) OF ResultsPerSSB-Index + +ResultsPerSSB-Index ::= SEQUENCE { + ssb-Index SSB-Index, + ssb-Results MeasQuantityResults OPTIONAL +} + +ResultsPerCSI-RS-IndexList::= SEQUENCE (SIZE (1..maxNrofCSI-RS)) OF ResultsPerCSI-RS-Index + +ResultsPerCSI-RS-Index ::= SEQUENCE { + csi-RS-Index CSI-RS-Index, + csi-RS-Results MeasQuantityResults OPTIONAL +} + +-- TAG-MEAS-RESULTS-STOP +-- TAG-MEAS-RESULT-SCG-FAILURE-START + +MeasResultSCG-Failure ::= SEQUENCE { + measResultServFreqList MeasResultServFreqList2NR, + measResultNeighCells MeasResultList2NR, + ... +} + +MeasResultServFreqList2NR ::= SEQUENCE (SIZE (1..maxNrofServingCells)) OF MeasResultServFreq2NR + +MeasResultServFreq2NR ::= SEQUENCE { + ssbFrequency ARFCN-ValueNR OPTIONAL, + refFreqCSI-RS ARFCN-ValueNR OPTIONAL, + measResultServingCell MeasResultNR, + measResultBestNeighCell MeasResultNR OPTIONAL +} + +MeasResultList2NR ::= SEQUENCE (SIZE (1..maxFreq)) OF MeasResult2NR + +MeasResult2NR ::= SEQUENCE { + ssbFrequency ARFCN-ValueNR OPTIONAL, + refFreqCSI-RS ARFCN-ValueNR OPTIONAL, + measResultListNR MeasResultListNR +} + +-- TAG-MEAS-RESULT-SCG-FAILURE-STOP +-- TAG-MEASRESULT-CELL-LIST-SFTD-START + +MeasResultCellListSFTD ::= SEQUENCE (SIZE (1..maxCellSFTD)) OF MeasResultCellSFTD + +MeasResultCellSFTD ::= SEQUENCE { + physCellId PhysCellId, + sfn-OffsetResult INTEGER (0..1023), + frameBoundaryOffsetResult INTEGER (-30720..30719), + rsrp-Result RSRP-Range OPTIONAL +} + +-- TAG-MEASRESULT-CELL-LIST-SFTD-STOP +-- TAG-MULTIFREQUENCYBANDLISTNR-START + +MultiFrequencyBandListNR ::= SEQUENCE (SIZE (1..maxNrofMultiBands)) OF FreqBandIndicatorNR + +-- TAG-MULTIFREQUENCYBANDLISTNR-STOP +-- TAG-NZP-CSI-RS-RESOURCESET-START +NZP-CSI-RS-ResourceSet ::= SEQUENCE { + nzp-CSI-ResourceSetId NZP-CSI-RS-ResourceSetId, + + -- NZP-CSI-RS-Resources assocaited with this NZP-CSI-RS resource set. + -- Corresponds to L1 parameter 'CSI-RS-ResourceConfigList' (see 38.214, section 5.2) + -- For CSI, there are at most 8 NZP CSI RS resources per resource set + nzp-CSI-RS-Resources SEQUENCE (SIZE (1..maxNrofNZP-CSI-RS-ResourcesPerSet)) OF NZP-CSI-RS-ResourceId, + + -- Indicates whether repetition is on/off. If set to set to 'OFF', the UE may not assume that the + -- NZP-CSI-RS resources within the resource set are transmitted with the same downlink spatial domain transmission filter + -- and with same NrofPorts in every symbol. + -- Corresponds to L1 parameter 'CSI-RS-ResourceRep' (see 38.214, sections 5.2.2.3.1 and 5.1.6.1.2) + -- Can only be configured for CSI-RS resource sets which are associated with CSI-ReportConfig with report of L1 RSRP or “no report†+ repetition ENUMERATED { on, off } OPTIONAL, + + -- Offset X between the slot containing the DCI that triggers a set of aperiodic NZP CSI-RS resources and the slot in which the + -- CSI-RS resource set is transmitted. When the field is absent the UE applies the value 0. + -- Corresponds to L1 parameter 'Aperiodic-NZP-CSI-RS-TriggeringOffset' (see 38,214, section FFS_Section) + aperiodicTriggeringOffset INTEGER(0..4) OPTIONAL, -- Need S + + -- Indicates that the antenna port for all NZP-CSI-RS resources in the CSI-RS resource set is same. + -- Corresponds to L1 parameter 'TRS-Info' (see 38.214, section 5.2.2.3.1) + trs-Info ENUMERATED {true} OPTIONAL, + ... +} + +-- TAG-NZP-CSI-RS-RESOURCESET-STOP +-- TAG-NZP-CSI-RS-RESOURCESETID-START +NZP-CSI-RS-ResourceSetId ::= INTEGER (0..maxNrofNZP-CSI-RS-ResourceSets-1) + +-- TAG-NZP-CSI-RS-RESOURCESETID-STOP +-- TAG-NZP-CSI-RS-RESOURCE-START +NZP-CSI-RS-Resource ::= SEQUENCE { + nzp-CSI-RS-ResourceId NZP-CSI-RS-ResourceId, + + -- OFDM symbol location(s) in a slot and subcarrier occupancy in a PRB of the CSI-RS resource + resourceMapping CSI-RS-ResourceMapping, + -- Power offset of NZP CSI-RS RE to PDSCH RE. Value in dB. Corresponds to L1 parameter Pc (see 38.214, sections 5.2.2.3.1 and 4.1) + powerControlOffset INTEGER(-8..15), + -- Power offset of NZP CSI-RS RE to SS RE. Value in dB. Corresponds to L1 parameter 'Pc_SS' (see 38.214, section 5.2.2.3.1) + powerControlOffsetSS ENUMERATED{db-3, db0, db3, db6} OPTIONAL, + -- Scrambling ID (see 38.214, section 5.2.2.3.1) + scramblingID ScramblingId, + + -- Periodicity and slot offset sl1 corresponds to a periodicity of 1 slot, sl2 to a periodicity of two slots, and so on. + -- The corresponding offset is also given in number of slots. Corresponds to L1 parameter 'CSI-RS-timeConfig' (see 38.214, section 5.2.2.3.1) + periodicityAndOffset CSI-ResourcePeriodicityAndOffset OPTIONAL, --Cond PeriodicOrSemiPersistent + + -- For a target periodic CSI-RS, contains a reference to one TCI-State in TCI-States for providing the QCL source and + -- QCL type. For periodic CSI-RS, the source can be SSB or another periodic-CSI-RS. + -- Corresponds to L1 parameter 'QCL-Info-PeriodicCSI-RS' (see 38.214, section 5.2.2.3.1) + qcl-InfoPeriodicCSI-RS TCI-StateId OPTIONAL, --Cond Periodic + ... +} + +-- TAG-NZP-CSI-RS-RESOURCE-STOP +-- TAG-NZP-CSI-RS-RESOURCEID-START +NZP-CSI-RS-ResourceId ::= INTEGER (0..maxNrofNZP-CSI-RS-Resources-1) + +-- TAG-NZP-CSI-RS-RESOURCEID-STOP +-- TAG-P-MAX-START + +P-Max ::= INTEGER (-30..33) + +-- TAG-P-MAX-STOP +-- TAG-PCI-LIST-START + +PCI-List ::= SEQUENCE (SIZE (1..maxNrofCellMeas)) OF PhysCellId + +-- TAG-PCI-LIST-STOP +-- TAG-PCI-RANGE-START + +PCI-Range ::= SEQUENCE { + start PhysCellId, + range ENUMERATED { + n4, n8, n12, n16, n24, n32, n48, n64, n84, + n96, n128, n168, n252, n504, n1008, + spare1} OPTIONAL -- Need Nss +} + +-- TAG-PCI-RANGE-STOP +-- TAG-PCI-RANGE-INDEX-START + +PCI-RangeIndex ::= INTEGER (1..maxNrofPCI-Ranges) + + +-- TAG-PCI-RANGE-INDEX-STOP +-- TAG-PCI-RANGE-INDEX-LIST-START + +PCI-RangeIndexList ::= SEQUENCE (SIZE (1..maxNrofPCI-Ranges)) OF PCI-RangeIndex + +-- TAG-PCI-Range-INDEX-LIST-STOP +-- TAG-PDCCH-CONFIG-START + +PDCCH-Config ::= SEQUENCE { + -- List of UE specifically configured Control Resource Sets (CORESETs) to be used by the UE. + -- The network configures at most 3 CORESETs per BWP per cell (including the initial CORESET). + controlResourceSetToAddModList SEQUENCE(SIZE (1..3)) OF ControlResourceSet OPTIONAL, + controlResourceSetToReleaseList SEQUENCE(SIZE (1..3)) OF ControlResourceSetId OPTIONAL, + + -- List of UE specifically configured Control Resource Sets (CORESETs). + -- The network configures at most 10 Search Spaces per BWP per cell (including the initial Search Space). + searchSpacesToAddModList SEQUENCE(SIZE (1..10)) OF SearchSpace OPTIONAL, + searchSpacesToReleaseList SEQUENCE(SIZE (1..10)) OF SearchSpaceId OPTIONAL, + + -- Configuration of downlink preemtption indications to be monitored in this cell. + -- Corresponds to L1 parameter 'Preemp-DL' (see 38.214, section 11.2) + -- FFS_RAN1: LS R1-1801281 indicates this is "Per Cell (but association with each configured BWP is needed)" => Unclear, keep on BWP for now. + downlinkPreemption SetupRelease { DownlinkPreemption } OPTIONAL, -- Need M + + -- Configuration of Slot-Format-Indicators to be monitored in this cell + + -- FFS_RAN1 discusses still whether this SFI payload configuration is BWP- or Cell-Specific. + slotFormatIndicator SetupRelease { SlotFormatIndicator } OPTIONAL, -- Need M + -- Enable and configure reception of group TPC commands for PUSCH + tpc-PUSCH SetupRelease { PUSCH-TPC-CommandConfig } OPTIONAL, -- Need M + + -- Enable and configure reception of group TPC commands fpr PUCCH + tpc-PUCCH SetupRelease { PUCCH-TPC-CommandConfig } OPTIONAL, -- Cond PUCCH-CellOnly + + ... +} + +-- TAG-PDCCH-CONFIG-STOP +-- TAG-PDCCH-CONFIGCOMMON-START + +PDCCH-ConfigCommon ::= SEQUENCE { + + -- A list of common control resource sets. Only CORESETs with ControlResourceSetId = 0 or 1 are allowed. The CORESET#0 + -- corresponds to the CORESET configured in MIB (see pdcch-ConfigSIB1) and is used to provide that information to the UE + -- by dedicated signalling during handover and (P)SCell addition. The CORESET#1 may be configured an used for RAR + -- (see ra-ControlResourceSet). + commonControlResourcesSets SEQUENCE (SIZE(1..2)) OF ControlResourceSet OPTIONAL, -- Need R + + -- A list of additional common search spaces. + commonSearchSpaces SEQUENCE (SIZE(1..4)) OF SearchSpace OPTIONAL, -- Need R + + -- ID of the search space for SIB1 message. + + -- Corresponds to L1 parameter 'rmsi-SearchSpace' (see 38.213, section 10) + searchSpaceSIB1 SearchSpaceId OPTIONAL, -- Need R + -- ID of the Search space for other system information, i.e., SIB2 and beyond. + -- Corresponds to L1 parameter 'osi-SearchSpace' (see 38.213, section 10) + -- If the field is absent, the monitoring occasions are derived as described in 38.213, section 10.1 and section 13. + searchSpaceOtherSystemInformation SearchSpaceId OPTIONAL, -- Need R + + -- ID of the Search space for paging. Corresponds to L1 parameter 'paging-SearchSpace' (see 38.213, section 10) + -- If the field is absent, the monitoring occasions are derived as described in 38.213, section 10.1 and section 13. + pagingSearchSpace SearchSpaceId OPTIONAL, -- Need R + + -- CORESET configured for random access. When the field is absent the UE uses the CORESET according to pdcch-ConfigSIB1 + -- which is associated with ControlResourceSetId = 0. + -- Corresponds to L1 parameter 'rach-coreset-configuration' (see 38.211?, section FFS_Section) + ra-ControlResourceSet ControlResourceSetId OPTIONAL, -- Need S + -- ID of the Search space for random access procedure. Corresponds to L1 parameter 'ra-SearchSpace' (see 38.214?, section FFS_Section) + -- If the field is absent, the monitoring occasions are derived as described in 38.213, section 10.1 and section 13. + ra-SearchSpace SearchSpaceId OPTIONAL, -- Need R + ... + +} + +-- TAG-PDCCH-CONFIGCOMMON-STOP +-- TAG-PDCP-CONFIG-START + +PDCP-Config ::= SEQUENCE { + drb SEQUENCE { + discardTimer ENUMERATED {ms10, ms20, ms30, ms40, ms50, ms60, ms75, ms100, ms150, ms200, ms250, ms300, ms500, ms750, ms1500, infinity} OPTIONAL, -- Cond Setup + pdcp-SN-SizeUL ENUMERATED {len12bits, len18bits} OPTIONAL, -- Cond Setup2 + pdcp-SN-SizeDL ENUMERATED {len12bits, len18bits} OPTIONAL, -- Cond Setup2 + headerCompression CHOICE { + notUsed NULL, + rohc SEQUENCE { + maxCID INTEGER (1..16383) DEFAULT 15, + profiles SEQUENCE { + profile0x0001 BOOLEAN, + profile0x0002 BOOLEAN, + profile0x0003 BOOLEAN, + profile0x0004 BOOLEAN, + profile0x0006 BOOLEAN, + profile0x0101 BOOLEAN, + profile0x0102 BOOLEAN, + profile0x0103 BOOLEAN, + profile0x0104 BOOLEAN + }, + drb-ContinueROHC BOOLEAN + }, + uplinkOnlyROHC SEQUENCE { + maxCID INTEGER (1..16383) DEFAULT 15, + profiles SEQUENCE { + profile0x0006 BOOLEAN + }, + drb-ContinueROHC BOOLEAN + }, + ... + }, + integrityProtection ENUMERATED { enabled } OPTIONAL, -- Cond ConnectedTo5GC + statusReportRequired ENUMERATED { true } OPTIONAL, -- Cond Rlc-AM + outOfOrderDelivery BOOLEAN + } OPTIONAL, -- Cond DRB + -- FFS / TODO: Handle more than two secondary cell groups + moreThanOneRLC SEQUENCE { + primaryPath SEQUENCE { + cellGroup CellGroupId OPTIONAL, -- Need R + logicalChannel LogicalChannelIdentity OPTIONAL -- Need R + }, + ul-DataSplitThreshold UL-DataSplitThreshold OPTIONAL, -- Cond SplitBearer + pdcp-Duplication ENUMERATED { true } OPTIONAL -- Need R + } OPTIONAL, -- Cond MoreThanOneRLC + + t-Reordering ENUMERATED { + ms0, ms1, ms2, ms4, ms5, ms8, ms10, ms15, ms20, ms30, ms40, ms50, ms60, ms80, ms100, ms120, ms140, ms160, ms180, ms200, ms220, + ms240, ms260, ms280, ms300, ms500, ms750, ms1000, ms1250, ms1500, ms1750, ms2000, ms2250, ms2500, ms2750, + ms3000, spare28, spare27, spare26, spare25, spare24, spare23, spare22, spare21, spare20, + spare19, spare18, spare17, spare16, spare15, spare14, spare13, spare12, spare11, spare10, spare09, + spare08, spare07, spare06, spare05, spare04, spare03, spare02, spare01 } OPTIONAL, -- Need S + + + ... +} + +UL-DataSplitThreshold ::= ENUMERATED { + b0, b100, b200, b400, b800, b1600, b3200, b6400, b12800, b25600, b51200, b102400, b204800, + b409600, b819200, b1228800, b1638400, b2457600, b3276800, b4096000, b4915200, b5734400, + b6553600, infinity, spare8, spare7, spare6, spare5, spare4, spare3, spare2, spare1} + +-- TAG-PDCP-CONFIG-STOP +-- TAG-PDSCH-CONFIG-START + +PDSCH-Config ::= SEQUENCE { + -- Identifer used to initalite data scrambling (c_init) for both PDSCH. + -- Corresponds to L1 parameter 'Data-scrambling-Identity' (see 38,214, section FFS_Section) + -- FFS:_Replace by tye ScramblingId used in other places? + dataScramblingIdentityPDSCH INTEGER (0..1007) OPTIONAL, + + -- DMRS configuration for PDSCH transmissions using PDSCH mapping type A (chosen dynamically via PDSCH-TimeDomainResourceAllocation). + dmrs-DownlinkForPDSCH-MappingTypeA SetupRelease { DMRS-DownlinkConfig } OPTIONAL, -- Need M + -- DMRS configuration for PDSCH transmissions using PDSCH mapping type B (chosen dynamically via PDSCH-TimeDomainResourceAllocation). + dmrs-DownlinkForPDSCH-MappingTypeB SetupRelease { DMRS-DownlinkConfig } OPTIONAL, -- Need M + + + -- A list of Transmission Configuration Indicator (TCI) states for dynamically indicating (over DCI) a transmission configuration + -- which includes QCL-relationships between the DL RSs in one RS set and the PDSCH DMRS ports + -- (see 38.214, section 5.1.4) + tci-StatesToAddModList SEQUENCE (SIZE(1..maxNrofTCI-States)) OF TCI-State OPTIONAL, -- Need N + tci-StatesToReleaseList SEQUENCE (SIZE(1..maxNrofTCI-States)) OF TCI-StateId OPTIONAL, -- Need N + + -- Interleaving unit configurable between 2 and 4 PRBs + -- Corresponds to L1 parameter 'VRB-to-PRB-interleaver' (see 38.211, section 6.3.1.6) + vrb-ToPRB-Interleaver ENUMERATED {n2, n4}, + + -- Configuration of resource allocation type 0 and resource allocation type 1 for non-fallback DCI + -- Corresponds to L1 parameter 'Resouce-allocation-config' (see 38.214, section 5.1.2) + resourceAllocation ENUMERATED { resourceAllocationType0, +resourceAllocationType1, +dynamicSwitch}, + + -- List of time-domain configurations for timing of DL assignment to DL data. If configured, the values provided herein + -- override the values received in corresponding PDSCH-ConfigCommon. + pdsch-AllocationList SEQUENCE (SIZE(1..maxNrofDL-Allocations)) OF PDSCH-TimeDomainResourceAllocation OPTIONAL, -- Need R + -- Number of repetitions for data. Corresponds to L1 parameter 'aggregation-factor-DL' (see 38.214, section FFS_Section) + -- When the field is absent the UE applies the value 1 + pdsch-AggregationFactor ENUMERATED { n2, n4, n8 } OPTIONAL, -- Need S + + -- Resources patterns which the UE should rate match PDSCH around. The UE rate matches around the union of all resources + -- indicated in the nexted bitmaps. Corresponds to L1 parameter 'Resource-set-BWP' (see 38.214, section 5.1.2.2.3) + -- FFS: RAN1 indicates that there should be a set of patterns per cell and one per BWP => Having both seems unnecessary. + + rateMatchPatternToAddModList SEQUENCE (SIZE (1..maxNrofRateMatchPatterns)) OF RateMatchPattern OPTIONAL, -- Need N + rateMatchPatternToReleaseList SEQUENCE (SIZE (1..maxNrofRateMatchPatterns)) OF RateMatchPatternId OPTIONAL, -- Need N + + -- The IDs of a first group of RateMatchPatterns defined in the rateMatchPatternToAddModList. + -- Corresponds to L1 parameter 'Resource-set-group-1'. (see 38.214, section FFS_Section) + rateMatchPatternGroup1 SEQUENCE (SIZE (1..maxNrofRateMatchPatterns)) OF RateMatchPatternId OPTIONAL, -- Need R + -- The IDs of a second group of RateMatchPatterns defined in the rateMatchPatternToAddModList + -- Corresponds to L1 parameter 'Resource-set-group-2'. (see 38.214, section FFS_Section) + rateMatchPatternGroup2 SEQUENCE (SIZE (1..maxNrofRateMatchPatterns)) OF RateMatchPatternId OPTIONAL, -- Need R + + + -- Selection between config 1 and config 2 for RBG size for PDSCH. Corresponds to L1 parameter 'RBG-size-PDSCH' (see 38.214, section 5.1.2.2.1) + rbg-Size ENUMERATED {config1, config2}, + + -- Indicates which MCS table the UE shall use for PDSCH. Corresponds to L1 parameter 'MCS-Table-PDSCH' (see 38.214, section 5.1.3.1). + mcs-Table ENUMERATED {qam64, qam256}, + + -- Maximum number of code words that a single DCI may schedule. This changes the number of MCS/RV/NDI bits in the DCI message from 1 to 2. + maxNrofCodeWordsScheduledByDCI ENUMERATED {n1, n2} OPTIONAL, -- Need R + + + -- Indicates the PRB bundle type and bundle size(s). If "dynamic" is chosen, the actual BundleSizeSet to use is indicated via DCI. + -- If a bundleSize(Set) value is absent, the UE applies the value n2. Corresponds to L1 parameter 'PRB_bundling' + -- (see 38.214, section 5.1.2.3) + prb-BundlingType CHOICE { + static SEQUENCE { + bundleSize ENUMERATED { n4, wideband } OPTIONAL -- Need S + }, + dynamic SEQUENCE { + bundleSizeSet1 ENUMERATED { n4, wideband, n2-wideband, n4-wideband } OPTIONAL, -- Need S + bundleSizeSet2 ENUMERATED { n4, wideband } OPTIONAL -- Need S + } + }, + + -- A list of Zero-Power (ZP) CSI-RS resources used for PDSCH rate-matching. + -- Corresponds to L1 parameter 'ZP-CSI-RS-ResourceConfigList' (see 38.214, section FFS_Section) + zp-CSI-RS-ResourceToAddModList SEQUENCE (SIZE (1..maxNrofZP-CSI-RS-Resources)) OF ZP-CSI-RS-Resource OPTIONAL, -- Need N + zp-CSI-RS-ResourceToReleaseList SEQUENCE (SIZE (1..maxNrofZP-CSI-RS-Resources)) OF ZP-CSI-RS-ResourceId OPTIONAL, -- Need M + + -- A list of sets. Each set contains a set-ID and the IDs of one or more ZP-CSI-RS-Resources (the actual resources are defined in the + -- zp-CSI-RS-ResourceToAddModList). The network triggers a set by indicating its set-ID (ZP-CSI-RS-ResourceSetId) in the DCI payload. + -- The resources referenced in these sets are confgiured with resourceType 'aperiodic'. + -- Corresponds to L1 parameter ' ZP-CSI-RS-ResourceSetConfigList' (see 38.214, section FFS_Section) + aperiodic-ZP-CSI-RS-ResourceSetsToAddModList SEQUENCE (SIZE (1..maxNrofZP-CSI-RS-Sets)) OF ZP-CSI-RS-ResourceSet OPTIONAL, -- Need N + aperiodic-ZP-CSI-RS-ResourceSetsToReleaseList SEQUENCE (SIZE (1..maxNrofZP-CSI-RS-Sets)) OF ZP-CSI-RS-ResourceSetId OPTIONAL, -- Need N + + -- A list of sets. Each set contains a set-ID and the IDs of one or more ZP-CSI-RS-Resources (the actual resources are defined in the + -- zp-CSI-RS-ResourceToAddModList). The network triggers a set by indicating its set-ID (ZP-CSI-RS-ResourceSetId) in the MAC CE. + -- The resources referenced in these sets are confgiured with resourceType 'semi-persistent'. + -- Corresponds to L1 parameter 'SP-ZP-CSI-RS-Resource-List' (see 38.214, section 5.1.4_Section) + sp-ZP-CSI-RS-ResourceSetsToAddModList SEQUENCE (SIZE (1..maxNrofZP-CSI-RS-Sets)) OF ZP-CSI-RS-ResourceSet OPTIONAL, -- Need N + sp-ZP-CSI-RS-ResourceSetsToReleaseList SEQUENCE (SIZE (1..maxNrofZP-CSI-RS-Sets)) OF ZP-CSI-RS-ResourceSetId OPTIONAL, -- Need N + + ... +} + + + + +-- TAG-PDSCH-CONFIG-STOP +-- TAG-PDSCH-CONFIGCOMMON-START + +PDSCH-ConfigCommon ::= SEQUENCE { + + -- List of time-domain configurations for timing of DL assignment to DL data + pdsch-AllocationList SEQUENCE (SIZE(1..maxNrofDL-Allocations)) OF PDSCH-TimeDomainResourceAllocation OPTIONAL, -- Need R + + ... +} + +-- TAG-PDSCH-CONFIGCOMMON-STOP +-- TAG-PDSCH-SERVINGCELLCONFIG-START + +PDSCH-ServingCellConfig ::= SEQUENCE { + -- Enables and configures code-block-group (CBG) based transmission (see 38.213, section 9.1.1) + codeBlockGroupTransmission SetupRelease { PDSCH-CodeBlockGroupTransmission } OPTIONAL, -- Need M + -- Accounts for overhead from CSI-RS, CORESET, etc. If the field is absent, the UE applies value xOh0. + -- Corresponds to L1 parameter 'Xoh-PDSCH' (see 38.214, section 5.1.3.2) + xOverhead ENUMERATED { xOh6, xOh12, xOh18 } OPTIONAL, -- Need S + -- The number of HARQ processes to be used on the PDSCH of a serving cell. n2 corresponds to 2 HARQ processes, n4 to 4 HARQ processes + -- and so on. If the field is absent, the UE uses 8 HARQ processes. + -- Corresponds to L1 parameter 'number-HARQ-process-PDSCH' (see 38.214, section REF) + nrofHARQ-ProcessesForPDSCH ENUMERATED {n2, n4, n6, n10, n12, n16} OPTIONAL, -- Need S + -- The ID of the serving cell (of the same cell group) to use for PUCCH. + -- If the field is absent, the UE sends the HARQ feedback on the PUCCH of the SpCell of this cell group. + pucch-Cell ServCellIndex OPTIONAL , -- Cond SCellAddOnly + ... +} + +PDSCH-CodeBlockGroupTransmission ::= SEQUENCE { + -- Maximum number of code-block-groups (CBGs) per TB. In case of multiple CW the maximum CBG is 4 (see 38.213, section 9.1.1) + maxCodeBlockGroupsPerTransportBlock ENUMERATED {n2, n4, n6, n8}, + -- Indicates whether CBGFI for CBG based (re)transmission in DL is enabled (true). (see 38.212, section 7.3.1.2.2) + codeBlockGroupFlushIndicator BOOLEAN, + ... +} + +-- TAG-PDSCH-SERVINGCELLCONFIG-STOP +-- TAG-PDSCH-TIMEDOMAINRESOURCEALLOCATION-START + +PDSCH-TimeDomainResourceAllocation ::= SEQUENCE { + -- Corresponds to L1 parameter 'K0' (see 38.214, section FFS_Section) + -- When the field is absent the UE applies the value 0 + k0 INTEGER (1..3) OPTIONAL, -- Need S + -- PDSCH mapping type. Corresponds to L1 parameter 'Mapping-type' (see 38.214, section FFS_Section) + mappingType ENUMERATED {typeA, typeB}, + -- An index into a table/equation in RAN1 specs capturing valid combinations of start symbol and length (jointly encoded) + -- Corresponds to L1 parameter 'Index-start-len' (see 38.214, section FFS_Section) + startSymbolAndLength BIT STRING (SIZE (7)) +} + +-- TAG-PDSCH-TIMEDOMAINRESOURCEALLOCATION-STOP +-- TAG-PHYS-CELL-ID-START + +PhysCellId ::= INTEGER (0..1007) + +-- TAG-PHYS-CELL-ID-STOP +-- TAG-PRB-ID-START + +PRB-Id ::= INTEGER (0..maxNrofPhysicalResourceBlocks-1) + +-- TAG-PRB-ID-STOP +-- TAG-PTRS-DOWNLINKCONFIG-START + +PTRS-DownlinkConfig ::= SEQUENCE { + -- Presence and frequency density of DL PT-RS as a function of Scheduled BW + -- If the field is absent, the UE uses K_PT-RS = 2. + -- Corresponds to L1 parameter 'DL-PTRS-frequency-density-table' (see 38.214, section 5.1) + frequencyDensity SEQUENCE (SIZE (2)) OF INTEGER (1..276) OPTIONAL, -- Need S + -- Presence and time density of DL PT-RS as a function of MCS. The value 29 is only applicable for MCS Table 5.1.3.1-1 (38.214) + -- If the field is absent, the UE uses L_PT-RS = 1. + -- Corresponds to L1 parameter 'DL-PTRS-time-density-table' (see 38.214, section 5.1) + timeDensity SEQUENCE (SIZE (3)) OF INTEGER (0..29) OPTIONAL, -- Need S + -- EPRE ratio between PTRS and PDSCH. Value 0 correspond to the codepoint â€00†in table 4.1-2. Value 1 corresponds to codepoint â€01†+ -- If the field is not provided, the UE applies value 0. Corresponds to L1 parameter 'DL-PTRS-EPRE-ratio' (see 38.214, section 4.1) + epre-RatioPort1 INTEGER (0..3) OPTIONAL, -- Need S + -- EPRE ratio between PTRS and PDSCH. Value 0 correspond to the codepoint â€00†in table 4.1-2. Value 1 corresponds to codepoint â€01â€. + -- If the field is not provided, the UE applies value 0. Corresponds to L1 parameter 'DL-PTRS-EPRE-ratio' (see 38.214, section 4.1) + epre-RatioPort2 SEQUENCE (SIZE (1..2)) OF INTEGER (0..3) OPTIONAL, -- Cond TwoPorts + -- Indicates the subcarrier offset for DL PTRS. If the field is absent, the UE applies the value offset00. + -- Corresponds to L1 parameter 'DL-PTRS-RE-offset' (see 38.214, section 5.1.6.3) + resourceElementOffset ENUMERATED { offset01, offset10, offset11 } OPTIONAL, -- Need S + ... +} + +-- TAG-PTRS-DOWNLINKCONFIG-STOP +-- TAG-PTRS-UPLINKCONFIG-START + +PTRS-UplinkConfig ::= SEQUENCE { + + modeSpecificParameters CHOICE { + -- Configuration of UL PTRS for CP-OFDM + cp-OFDM SEQUENCE { + -- Presence and frequency density of UL PT-RS for CP-OFDM waveform as a function of scheduled BW + -- If the field is absent, the UE uses K_PT-RS = 2. + -- Corresponds to L1 parameter 'UL-PTRS-frequency-density-table' (see 38.214, section 6.1) + frequencyDensity SEQUENCE (SIZE (2)) OF INTEGER (1..276) OPTIONAL, -- Need S + -- Presence and time density of UL PT-RS for CP-OFDM waveform as a function of MCS + -- If the field is absent, the UE uses L_PT-RS = 1. + -- Corresponds to L1 parameter 'UL-PTRS-time-density-table' (see 38.214, section 6.1) + timeDensity SEQUENCE (SIZE (3)) OF INTEGER (0..29) OPTIONAL, -- Need S + -- The maximum number of UL PTRS ports for CP-OFDM. + -- Corresponds to L1 parameter 'UL-PTRS-ports' (see 38.214, section 6.2.3.1) + maxNrofPorts ENUMERATED {n1, n2}, + -- Indicates the subcarrier offset for UL PTRS for CP-OFDM. + -- Corresponds to L1 parameter 'UL-PTRS-RE-offset' (see 38.214, section 6.1) + resourceElementOffset ENUMERATED {offset01, offset10, offset11 } OPTIONAL, -- Need S + -- UL PTRS power boosting factor per PTRS port. Corresponds to L1 parameter 'UL-PTRS-power' (see 38.214, section 6.1, table 6.2.3-5) + ptrs-Power ENUMERATED {p00, p01, p10, p11} + }, + -- Configuration of UL PTRS for DFT-S-OFDM. + dft-S-OFDM SEQUENCE { + -- Sample density of PT-RS for DFT-s-OFDM, pre-DFT, indicating a set of thresholds T={NRBn,n=0,1,2,3,4}, + -- that indicates dependency between presence of PT-RS and scheduled BW and the values of X and K the UE should + -- use depending on the scheduled BW according to the table in 38.214 FFS_Section. + -- Corresponds to L1 parameter 'UL-PTRS-pre-DFT-density' (see 38.214, section 6.1, 6.2.3-3) + sampleDensity SEQUENCE (SIZE (5)) OF INTEGER (1..276), + -- Time density (OFDM symbol level) of PT-RS for DFT-s-OFDM. If the value is absent, the UE applies value d1. + -- Corresponds to L1 parameter 'UL-PTRS-time-density-transform-precoding' (see 38.214, section 6.1) + timeDensity ENUMERATED {d2} OPTIONAL -- Need S + } + } OPTIONAL, -- Cond M + ... +} + +-- TAG-PTRS-UPLINKCONFIG-STOP +-- TAG-PUCCH-CONFIG-START + +PUCCH-Config ::= SEQUENCE { + -- Lists for adding and releasing PUCCH resource sets (see 38.213, section 9.2) + resourceSetToAddModList SEQUENCE (SIZE (1..maxNrofPUCCH-ResourceSets)) OF PUCCH-ResourceSet OPTIONAL, -- Need N + resourceSetToReleaseList SEQUENCE (SIZE (1..maxNrofPUCCH-ResourceSets)) OF PUCCH-ResourceSetId OPTIONAL, -- Need N + + -- Lists for adding and releasing PUCCH resources applicable for the UL BWP and serving cell in which the PUCCH-Config + -- is defined. The resources defined herein are referred to from other parts of the configuration to determine which + -- resource the UE shall use for which report. + resourceToAddModList SEQUENCE (SIZE (1..maxNrofPUCCH-Resources)) OF PUCCH-Resource OPTIONAL, -- Need N + resourceToReleaseList SEQUENCE (SIZE (1..maxNrofPUCCH-Resources)) OF PUCCH-ResourceId OPTIONAL, -- Need N + + -- Parameters that are common for all PUCCH resources of format 1 + format1 SetupRelease { PUCCH-FormatConfig } OPTIONAL, -- Need M + -- Parameters that are common for all PUCCH resources of format 2 + format2 SetupRelease { PUCCH-FormatConfig } OPTIONAL, -- Need M + -- Parameters that are common for all PUCCH resources of format 3 + format3 SetupRelease { PUCCH-FormatConfig } OPTIONAL, -- Need M + -- Parameters that are common for all PUCCH resources of format 4 + format4 SetupRelease { PUCCH-FormatConfig } OPTIONAL, -- Need M + + schedulingRequestResourceToAddModList SEQUENCE (SIZE (1..maxNrofSR-Resources)) OF SchedulingRequestResourceConfig OPTIONAL, -- Need M + schedulingRequestResourceToReleaseList SEQUENCE (SIZE (1..maxNrofSR-Resources)) OF SchedulingRequestResourceId OPTIONAL, -- Need M + + multi-CSI-PUCCH-ResourceList SEQUENCE (SIZE (1..2)) OF PUCCH-ResourceId OPTIONAL,-- Need M + + -- List of timiing for given PDSCH to the DL ACK. In this version of the specification only the values [0..8] are applicable. + -- Corresponds to L1 parameter 'Slot-timing-value-K1' (see 38.213, section FFS_Section) + dl-DataToUL-ACK SEQUENCE (SIZE (8)) OF INTEGER (0..15) OPTIONAL, -- Need M + + -- Configuration of the spatial relation between a reference RS and PUCCH. Reference RS can be SSB/CSI-RS/SRS. + -- If the list has more than one element, MAC-CE selects a single element (see 38.321, section FFS_Section). + -- Corresponds to L1 parameter 'PUCCH-SpatialRelationInfo' (see 38.213, section FFS_Section) + spatialRelationInfoToAddModList SEQUENCE (SIZE (1..maxNrofSpatialRelationInfos)) OF PUCCH-SpatialRelationInfo OPTIONAL, -- Need N + spatialRelationInfoToReleaseList SEQUENCE (SIZE (1..maxNrofSpatialRelationInfos)) OF PUCCH-SpatialRelationInfoId OPTIONAL, -- Need N + + pucch-PowerControl PUCCH-PowerControl OPTIONAL, -- Need M + ... +} + +PUCCH-FormatConfig ::= SEQUENCE { + -- Enabling inter-slot frequency hopping when PUCCH Format 1, 3 or 4 is repetead over multiple slots. + -- The field is not applicable for format 2. + interslotFrequencyHopping ENUMERATED {enabled} OPTIONAL, -- Need R + -- Enabling 2 DMRS symbols per hop of a PUCCH Format 3 or 4 if both hops are more than X symbols when FH is enabled (X=4). + -- Enabling 4 DMRS sybmols for a PUCCH Format 3 or 4 with more than 2X+1 symbols when FH is disabled (X=4). + -- Corresponds to L1 parameter 'PUCCH-F3-F4-additional-DMRS' (see 38.213, section 9.2.1) + -- The field is not applicable for format 1 and 2. + additionalDMRS ENUMERATED {true} OPTIONAL, -- Need R + -- Max coding rate to determine how to feedback UCI on PUCCH for format 2, 3 or 4 + -- Corresponds to L1 parameter 'PUCCH-F2-maximum-coderate', 'PUCCH-F3-maximum-coderate' and 'PUCCH-F4-maximum-coderate' + -- (see 38.213, section 9.2.5) + -- The field is not applicable for format 1. + maxCodeRate PUCCH-MaxCodeRate OPTIONAL, -- Need R + -- Number of slots with the same PUCCH F1, F3 or F4. When the field is absent the UE applies the value n1. + -- Corresponds to L1 parameter 'PUCCH-F1-number-of-slots', 'PUCCH-F3-number-of-slots' and 'PUCCH-F4-number-of-slots' + -- (see 38.213, section 9.2.6) + -- The field is not applicable for format 2. + nrofSlots ENUMERATED {n2,n4,n8} OPTIONAL, -- Need S + -- Enabling pi/2 BPSK for UCI symbols instead of QPSK for PUCCH. + -- Corresponds to L1 parameter 'PUCCH-PF3-PF4-pi/2PBSK' (see 38.213, section 9.2.5) + -- The field is not applicable for format 1 and 2. + pi2PBSK ENUMERATED {enabled} OPTIONAL, -- Need R + -- Enabling simultaneous transmission of CSI and HARQ-ACK feedback with or without SR with PUCCH Format 2, 3 or 4 + -- Corresponds to L1 parameter 'PUCCH-F2-Simultaneous-HARQ-ACK-CSI', 'PUCCH-F3-Simultaneous-HARQ-ACK-CSI' and + -- 'PUCCH-F4-Simultaneous-HARQ-ACK-CSI' (see 38.213, section 9.2.5) + -- When the field is absent the UE applies the value OFF + -- The field is not applicable for format 1. + simultaneousHARQ-ACK-CSI ENUMERATED {true} OPTIONAL -- Need R +} + +PUCCH-MaxCodeRate ::= ENUMERATED {zeroDot08, zeroDot15, zeroDot25, zeroDot35, zeroDot45, zeroDot60, zeroDot80} + +PUCCH-SpatialRelationInfo ::= SEQUENCE { + pucch-SpatialRelationInfoId PUCCH-SpatialRelationInfoId, + referenceSignal CHOICE { + ssb-Index SSB-Index, + csi-RS-Index NZP-CSI-RS-ResourceId, + srs SRS-ResourceId + }, + pucch-PathlossReferenceRS-Id PUCCH-PathlossReferenceRS-Id, + p0-PUCCH-Id P0-PUCCH-Id, + closedLoopIndex ENUMERATED { i0, i1 } +} + +PUCCH-SpatialRelationInfoId ::= INTEGER (1..maxNrofSpatialRelationInfos) + +-- A set with one or more PUCCH resources +PUCCH-ResourceSet ::= SEQUENCE { + pucch-ResourceSetId PUCCH-ResourceSetId, + + -- PUCCH resources of format0 and format1 are only allowed in the first PUCCH reosurce set, + -- i.e., in a PUCCH-ResourceSet with pucch-ResourceSetId = 0. This set may contain between 8 and 32 resources. + -- PUCCH resources of format2, format3 and format4 are only allowed in a PUCCH-ReosurceSet with pucch-ResourceSetId > 0. If present, these sets must contain 8 resources each. + -- The UE chooses a PUCCH-Resource from this list based on the 3-bit PUCCH resource indicator field in DCI as + -- speciied in 38.213, FFS_section. + -- Note that this list contains only a list of resource IDs. The actual resources are configured in PUCCH-Config. + resources SEQUENCE (SIZE (8..maxNrofPUCCH-ResourcesPerSet)) OF PUCCH-ResourceId, + + -- Maximum number of payload bits minus 1 that the UE may transmit using this PUCCH resource set. In a PUCCH occurrence, the UE + -- chooses the first of its PUCCH-ResourceSet which supports the number of bits that the UE wants to transmit. + -- The field is not present in the first set (Set0) since the maximum Size of Set0 is specified to be 3 bit. + -- The field is not present in the last configured set since the UE derives its maximum payload size as specified in 38.213. + -- This field can take integer values that are multiples of 4. Corresponds to L1 parameter 'N_2' or 'N_3' (see 38.213, section 9.2) + maxPayloadMinus1 INTEGER (4..256) OPTIONAL -- Need R +} + +PUCCH-ResourceSetId ::= INTEGER (0..maxNrofPUCCH-ResourceSets-1) + +PUCCH-Resource ::= SEQUENCE { + pucch-ResourceId PUCCH-ResourceId, + + startingPRB PRB-Id, + -- Corresponds to the L1 parameter 'PUCCH-frequency-hopping' (see 38.213, section 9.2) + intraSlotFrequencyHopping ENUMERATED { enabled } OPTIONAL, -- Need R + -- Index of starting PRB for second hop of PUCCH in case of FH. This value is appliable for intra-slot frequency hopping. + -- Corresponds to L1 parameter 'PUCCH-2nd-hop-PRB' (see 38.213, section 9.2) + secondHopPRB PRB-Id OPTIONAL, -- Need R + + -- Selection of the PUCCH format and format-specific parameters + format CHOICE { + format0 PUCCH-format0, -- Cond InFirstSetOnly + format1 PUCCH-format1, -- Cond InFirstSetOnly + format2 PUCCH-format2, -- Cond NotInFirstSet + format3 PUCCH-format3, -- Cond NotInFirstSet + format4 PUCCH-format4 -- Cond NotInFirstSet + } +} + +PUCCH-ResourceId ::= INTEGER (0..maxNrofPUCCH-Resources-1) + + +-- A PUCCH Format 0 resource configuration (see 38.213, section 9.2) +-- Corresponds to L1 parameter 'PUCCH-format0' (see 38.213, section 9.2.1) +PUCCH-format0 ::= SEQUENCE { + initialCyclicShift INTEGER(0..11), + nrofSymbols INTEGER (1..2), + startingSymbolIndex INTEGER(0..13) +} + +-- A PUCCH Format 1 resource configuration (see 38.213, section 9.2) +-- Corresponds to L1 parameter 'PUCCH-format1' (see 38.213, section 9.2.1) +PUCCH-format1 ::= SEQUENCE { + initialCyclicShift INTEGER(0..11), + nrofSymbols INTEGER (4..14), + startingSymbolIndex INTEGER(0..10), + timeDomainOCC INTEGER(0..6) +} + +-- A PUCCH Format 2 resource configuration (see 38.213, section 9.2) +-- Corresponds to L1 parameter 'PUCCH-format2onfig' (see 38.213, section 9.2.1) +PUCCH-format2 ::= SEQUENCE { + nrofPRBs INTEGER (1..16), + nrofSymbols INTEGER (1..2), + startingSymbolIndex INTEGER(0..13) +} + +-- A PUCCH Format 3 resource configuration(see 38.213, section 9.2) +-- Corresponds to L1 parameter 'PUCCH-format3' (see 38.213, section 9.2.1) +PUCCH-format3 ::= SEQUENCE { + -- The supported values are 1,2,3,4,5,6,8,9,10,12,15 and 16 + nrofPRBs INTEGER (1..16), + nrofSymbols INTEGER (4..14), + startingSymbolIndex INTEGER(0..10) +} + +-- A PUCCH Format 4 resource configuration (see 38.213, section 9.2) +-- Corresponds to L1 parameter 'PUCCH-format4' (see 38.213, section 9.2.1) +PUCCH-format4 ::= SEQUENCE { + nrofSymbols INTEGER (4..14), + occ-Length ENUMERATED {n2,n4}, + occ-Index ENUMERATED {n0,n1,n2,n3}, + startingSymbolIndex INTEGER(0..10) +} + +-- TAG-PUCCH-CONFIG-STOP +-- TAG-PUCCH-CONFIGCOMMON-START + +PUCCH-ConfigCommon ::= SEQUENCE { + -- An entry into a 16-row table where each row configures a set of cell-specific PUCCH resources/parameters. The UE uses + -- those PUCCH resources during initial access on the initial uplink BWP. Once the network provides a dedicated PUCCH-Config + -- for that bandwidth part the UE applies that one instead of the one provided in this field. + -- Corresponds to L1 parameter 'PUCCH-resource-common' (see 38.213, section 9.2) + pucch-ResourceCommon BIT STRING (SIZE (4)) OPTIONAL, -- Need R + + -- Configuration of group- and sequence hopping for all the PUCCH formats 0, 1, 3 and 4. "neither" implies neither group + -- or sequence hopping is enabled. "enable" enables group hopping and disables sequence hopping. "disable"†disables group + -- hopping and enables sequence hopping. Corresponds to L1 parameter 'PUCCH-GroupHopping' (see 38.211, section 6.4.1.3) + pucch-GroupHopping ENUMERATED { neither, enable, disable }, + -- Cell-Specific scrambling ID for group hoppping and sequence hopping if enabled. + -- Corresponds to L1 parameter 'HoppingID' (see 38.211, section 6.3.2.2) + hoppingId BIT STRING (SIZE (10)) OPTIONAL, -- Need R + + -- Power control parameter P0 for PUCCH transmissions. Value in dBm. Only even values (step size 2) allowed. + -- Corresponds to L1 parameter 'p0-nominal-pucch' (see 38.213, section 7.2) + p0-nominal INTEGER (-202..24) OPTIONAL, -- Need R + + ... +} + +-- TAG-PUCCH-CONFIGCOMMON-STOP +-- TAG-PUCCH-POWERCONTROL-START +PUCCH-PowerControl ::= SEQUENCE { + + -- deltaF for PUCCH format 0 with 1dB step size (see 38.213, section 7.2) + deltaF-PUCCH-f0 INTEGER (-16..15) OPTIONAL, -- Need R + -- deltaF for PUCCH format 1 with 1dB step size (see 38.213, section 7.2) + deltaF-PUCCH-f1 INTEGER (-16..15) OPTIONAL, -- Need R + -- deltaF for PUCCH format 2 with 1dB step size (see 38.213, section 7.2) + deltaF-PUCCH-f2 INTEGER (-16..15) OPTIONAL, -- Need R + -- deltaF for PUCCH format 3 with 1dB step size (see 38.213, section 7.2) + deltaF-PUCCH-f3 INTEGER (-16..15) OPTIONAL, -- Need R + -- deltaF for PUCCH format 4 with 1dB step size (see 38.213, section 7.2) + deltaF-PUCCH-f4 INTEGER (-16..15) OPTIONAL, -- Need R + + -- A set with dedicated P0 values for PUCCH, i.e., {P01, P02,... }. Corresponds to L1 parameter 'p0-pucch-set' (see 38.213, section 7.2) + p0-Set SEQUENCE (SIZE (1..maxNrofPUCCH-P0-PerSet)) OF P0-PUCCH OPTIONAL, -- Need M + + -- A set of Reference Signals (e.g. a CSI-RS config or a SSblock) to be used for PUCCH pathloss estimation. + -- Up to maxNrofPUCCH-PathlossReference-RSs may be configured + -- FFS_CHECK: Is it possible not to configure it at all? What does the UE use then? Any SSB? + -- Corresponds to L1 parameter 'pucch-pathlossReference-rs-config' (see 38.213, section 7.2) + pathlossReferenceRSs SEQUENCE (SIZE (1..maxNrofPUCCH-PathlossReferenceRSs)) OF PUCCH-PathlossReferenceRS OPTIONAL, -- Need M + -- Number of PUCCH power control adjustment states maintained by the UE (i.e., g(i)). If the field is present (n2) the UE maintains + -- two power control states (i.e., g(i,0) and g(i,1)). Otherwise, it applies one (i.e., g(i,0)). + -- Corresponds to L1 parameter 'num-pucch-pcadjustment-states' (see 38.213, section 7.2) + twoPUCCH-PC-AdjustmentStates ENUMERATED {twoStates} OPTIONAL, -- Need R + ... +} + +-- P0 value for PUCCH. Corresponds to L1 parameter 'p0-pucch' (see 3,213, section 7.2) +P0-PUCCH ::= SEQUENCE { + p0-PUCCH-Id P0-PUCCH-Id, + -- P0 value for PUCCH with 1dB step size. + p0-PUCCH-Value INTEGER (-16..15) +} + +P0-PUCCH-Id ::= INTEGER (1..8) + +-- A reference signal (RS) configured as pathloss reference signal for PUCCH power control +-- Corresponds to L1 parameter 'pucch-pathlossReference-rs' (see 38.213, section 7.2) +PUCCH-PathlossReferenceRS ::= SEQUENCE { + pucch-PathlossReferenceRS-Id PUCCH-PathlossReferenceRS-Id, + referenceSignal CHOICE { + ssb-Index SSB-Index, + csi-RS-Index NZP-CSI-RS-ResourceId + } +} + +-- ID for a referemce signal (RS) configured as PUCCH pathloss reference +-- Corresponds to L1 parameter 'pucch-pathlossreference-index' (see 38.213, section 7.2) +-- FFS_CHECK: Is this ID used anywhere except inside the PUCCH-PathlossReference-RS itself? If not, remove. +PUCCH-PathlossReferenceRS-Id ::= INTEGER (0..maxNrofPUCCH-PathlossReferenceRSs-1) + +-- TAG-PUCCH-POWERCONTROL-STOP +-- TAG-PUCCH-TPC-COMMANDCONFIG-START + +PUCCH-TPC-CommandConfig ::= SEQUENCE { + -- An index determining the position of the first bit of TPC command (applicable to the SpCell) inside the DCI format 2-2 payload. + tpc-IndexPCell INTEGER (1..15) OPTIONAL, -- Cond PUCCH-SCell + -- An index determining the position of the first bit of TPC command (applicable to the PUCCH-SCell) inside the DCI format 2-2 payload. + tpc-IndexPUCCH-SCell INTEGER (1..15) OPTIONAL, -- Cond PUCCH-SCellOnly + ... +} + +-- TAG-PUCCH-TPC-COMMANDCONFIG-STOP +-- TAG-PUSCH-CONFIG-START + +PUSCH-Config ::= SEQUENCE { + -- Identifer used to initalite data scrambling (c_init) for both PUSCH. + -- Corresponds to L1 parameter 'Data-scrambling-Identity' (see 38,214, section FFS_Section) + dataScramblingIdentityPUSCH INTEGER (0..1007) OPTIONAL, -- Need M + -- Whether UE uses codebook based or non-codebook based transmission. Corresponds to L1 parameter 'ulTxConfig' (see 38.214, section 6.1.1) + txConfig ENUMERATED {codebook, nonCodebook}, + + -- DMRS configuration for PUSCH transmissions using PUSCH mapping type A (chosen dynamically via PUSCH-TimeDomainResourceAllocation). + dmrs-UplinkForPUSCH-MappingTypeA SetupRelease { DMRS-UplinkConfig } OPTIONAL, -- Need M + -- DMRS configuration for PUSCH transmissions using PUSCH mapping type B (chosen dynamically via PUSCH-TimeDomainResourceAllocation) + dmrs-UplinkForPUSCH-MappingTypeB SetupRelease { DMRS-UplinkConfig } OPTIONAL, -- Need M + + pusch-PowerControl PUSCH-PowerControl OPTIONAL, -- Need M + -- Configured one of two supported frequency hopping mode. If not configured frequency hopping is not configured + -- Corresponds to L1 parameter 'Frequency-hopping-PUSCH' (see 38.214, section 6) + -- When the field is absent the UE applies the value Not configured + frequencyHopping ENUMERATED {mode1, mode2} OPTIONAL, -- Need S + -- Set of frequency hopping offsets used when frequency hopping is enabled for granted transmission (not msg3) and type 2 + -- Corresponds to L1 parameter 'Frequency-hopping-offsets-set' (see 38.214, section 6.3) + frequencyHoppingOffsetLists SEQUENCE (SIZE (1..4)) OF INTEGER (1.. maxNrofPhysicalResourceBlocks-1) OPTIONAL, -- Need M + -- Configuration of resource allocation type 0 and resource allocation type 1 for non-fallback DCI + -- Corresponds to L1 parameter 'Resouce-allocation-config' (see 38.214, section 6.1.2) + resourceAllocation ENUMERATED { resourceAllocationType0, resourceAllocationType1, dynamicSwitch}, + + -- List of time domain allocations for timing of UL assignment to UL data. If configured, the values provided herein + -- override the values received in corresponding PUSCH-ConfigCommon. + pusch-AllocationList SEQUENCE (SIZE(1..maxNrofUL-Allocations)) OF PUSCH-TimeDomainResourceAllocation OPTIONAL, -- Need R, + -- Number of repetitions for data. Corresponds to L1 parameter 'aggregation-factor-UL' (see 38.214, section FFS_Section) + -- When the field is absent the UE applies the value 1. + pusch-AggregationFactor ENUMERATED { n2, n4, n8 } OPTIONAL, -- Need S + + -- Indicates which MCS table the UE shall use for PUSCH without transform precoder + -- Corresponds to L1 parameter 'MCS-Table-PUSCH' (see 38.214, section 6.1.4) + -- When the field is absent the UE applies the value 64QAM + mcs-Table ENUMERATED {qam256} OPTIONAL, -- Need S + -- Indicates which MCS table the UE shall use for PUSCH with transform precoding + -- Corresponds to L1 parameter 'MCS-Table-PUSCH-transform-precoding' (see 38.214, section 6.1.4) + -- When the field is absent the UE applies the value 64QAM + mcs-TableTransformPrecoder ENUMERATED { qam256} OPTIONAL, -- Need S + -- The UE specific selection of transformer precoder for PUSCH. When the field is absent the UE applies the value msg3-tp. + -- Corresponds to L1 parameter 'PUSCH-tp' (see 38.211, section 6.3.1.4) + transformPrecoder ENUMERATED {enabled, disabled} OPTIONAL, -- Need S + -- Subset of PMIs addressed by TPMI, where PMIs are those supported by UEs with maximum coherence capabilities + -- Corresponds to L1 parameter 'ULCodebookSubset' (see 38.211, section 6.3.1.5) + codebookSubset ENUMERATED {fullyAndPartialAndNonCoherent, partialAndNonCoherent, nonCoherent}, + -- Subset of PMIs addressed by TRIs from 1 to ULmaxRank. Corresponds to L1 parameter 'ULmaxRank' (see 38.211, section 6.3.1.5) + maxRank INTEGER (1..4), + + -- Selection between config 1 and config 2 for RBG size for PUSCH. When the field is absent the UE applies the value config1. + -- Corresponds to L1 parameter 'RBG-size-PUSCH' (see 38.214, section 6.1.2.2.1) + rbg-Size ENUMERATED { config2} OPTIONAL, -- Need S + + -- Selection between and configuration of dynamic and semi-static beta-offset. + -- If the field is absent or released, the UE applies the value 'semiStatic' and the BetaOffsets according to + -- FFS [BetaOffsets and/or section 9.x.x). + -- Corresponds to L1 parameter 'UCI-on-PUSCH' (see 38.213, section 9.3) + uci-OnPUSCH SetupRelease { UCI-OnPUSCH} OPTIONAL, -- Need M + -- Interleaving unit configurable between 2 and 4 PRBs + -- Corresponds to L1 parameter 'VRB-to-PRB-interleaver' (see 38.211, section 6.3.1.6) + vrb-ToPRB-Interleaver ENUMERATED {n2, n4}, + ... +} + +UCI-OnPUSCH ::= SEQUENCE { + betaOffsets CHOICE { + dynamic SEQUENCE (SIZE (4)) OF BetaOffsets, + semiStatic BetaOffsets + } OPTIONAL, -- Need M + -- Indicates a scaling factor to limit the number of resource elements assigned to UCI on PUSCH. + -- Value f0p5 corresponds to 0.5, value f0p65 corresponds to 0.65, and so on. + -- Corresponds to L1 parameter 'uci-on-pusch-scaling' (see 38.212, section 6.3) + scaling ENUMERATED { f0p5, f0p65, f0p8, f1 } +} + +-- TAG-PUSCH-CONFIG-STOP +-- TAG-PUSCH-CONFIGCOMMON-START + +PUSCH-ConfigCommon ::= SEQUENCE { + -- Sequence-group hopping can be enabled or disabled by means of this cell-specific parameter. + -- Corresponds to L1 parameter 'Group-hopping-enabled-Transform-precoding' (see 38.211, section FFS_Section) + -- This field is Cell specific + groupHoppingEnabledTransformPrecoding ENUMERATED {enabled} OPTIONAL, -- Need R + + -- List of time domain allocations for timing of UL assignment to UL data + pusch-AllocationList SEQUENCE (SIZE(1..maxNrofUL-Allocations)) OF PUSCH-TimeDomainResourceAllocation OPTIONAL, -- Need R + + -- ------------------------ + -- Power control parameters + + -- Power offset between msg3 and RACH preamble transmission in steps of 1dB. + -- Corresponds to L1 parameter 'Delta-preamble-msg3' (see 38.213, section 7.1) + msg3-DeltaPreamble INTEGER (-1..6) OPTIONAL, -- Need R + + -- P0 value for PUSCH with grant (except msg3). Value in dBm. Only even values (step size 2) allowed. + -- Corresponds to L1 parameter 'p0-nominal-pusch-withgrant' (see 38.213, section 7.1) + -- This field is cell specific + p0-NominalWithGrant INTEGER (-202..24) OPTIONAL, -- Need R + ... +} + +-- TAG-PUSCH-CONFIGCOMMON-STOP +-- TAG-PUSCH-POWERCONTROL-START + +PUSCH-PowerControl ::= SEQUENCE { + + -- If enabled, UE applies TPC commands via accumulation. If not enabled, UE applies the TPC command without accumulation. + -- If absent, TPC accumulation is enabled. Corresponds to L1 parameter 'Accumulation-enabled' (see 38.213, section 7.1) + tpc-Accumulation ENUMERATED { disabled } OPTIONAL, -- Need R + + -- Dedicated alpha value for msg3 PUSCH. Corresponds to L1 parameter 'alpha-ue-pusch-msg3' (see 38.213, section 7.1) + -- When the field is absent the UE applies the value 1. + msg3-Alpha Alpha OPTIONAL, -- Need S + + -- P0 value for UL grant-free/SPS based PUSCH. Value in dBm. Only even values (step size 2) allowed. + -- Corresponds to L1 parameter 'p0-nominal-pusch-withoutgrant' (see 38.213, section 7.1) + p0-NominalWithoutGrant INTEGER (-202..24) OPTIONAL, -- Need M, + -- configuration {p0-pusch,alpha} sets for PUSCH (except msg3), i.e., { {p0,alpha,index1}, {p0,alpha,index2},...}. + -- Corresponds to L1 parameter 'p0-push-alpha-setconfig' (see 38,213, section 7.1) + p0-AlphaSets SEQUENCE (SIZE (1..maxNrofP0-PUSCH-AlphaSets)) OF P0-PUSCH-AlphaSet OPTIONAL, -- Need M, + + -- A set of Reference Signals (e.g. a CSI-RS config or a SSblock) to be used for PUSCH path loss estimation. + -- Up to maxNrofPUSCH-PathlossReferenceRSs may be configured when 'PUSCH beam indication' is present (FFS: in DCI???). + -- Otherwise, there may be only one entry. + -- Corresponds to L1 parameter 'pusch-pathlossReference-rs-config' (see 38.213, section 7.1) + pathlossReferenceRSToAddModList SEQUENCE (SIZE (1..maxNrofPUSCH-PathlossReferenceRSs)) OF PUSCH-PathlossReferenceRS + OPTIONAL, -- Need N + pathlossReferenceRSToReleaseList SEQUENCE (SIZE (1..maxNrofPUSCH-PathlossReferenceRSs)) OF PUSCH-PathlossReferenceRS-Id + OPTIONAL, -- Need N + + -- Number of PUSCH power control adjustment states maintained by the UE (i.e., fc(i)). If the field is present (n2) the UE maintains + -- two power control states (i.e., fc(i,1) and fc(i,2)). Otherwise, it applies one (i.e., fc(i,1)). + -- Corresponds to L1 parameter 'num-pusch-pcadjustment-states' (see 38.213, section 7.1) + twoPUSCH-PC-AdjustmentStates ENUMERATED {twoStates} OPTIONAL, -- Need S + + -- Indicates whether to apply dela MCS. When the field is absent, the UE applies Ks = 0 in delta_TFC formula for PUSCH. + -- Corresponds to L1 parameter 'deltaMCS-Enabled' (see 38.213, section 7.1) + deltaMCS ENUMERATED {enabled} OPTIONAL, -- Need S + + -- A list of SRI-PUSCH-PowerControl elements among which one is selected by the SRI field in DCI. + -- Corresponds to L1 parameter 'SRI-PUSCHPowerControl-mapping' (see 38.213, section 7.1) + sri-PUSCH-MappingToAddModList SEQUENCE (SIZE (1..maxNrofSRI-PUSCH-Mappings)) OF SRI-PUSCH-PowerControl OPTIONAL, -- Need M + sri-PUSCH-MappingToReleaseList SEQUENCE (SIZE (1..maxNrofSRI-PUSCH-Mappings)) OF SRI-PUSCH-PowerControlId OPTIONAL -- Need M +} + +-- A set of p0-pusch and alpha used for PUSCH with grant. 'PUSCH beam indication' (if present) gives the index of the set to +-- be used for a particular PUSCH transmission. +-- FFS_CHECK: Is the â€PUSCH beam indication†in DCI which schedules the PUSCH? If so, clarify in field description +-- Corresponds to L1 parameter 'p0-pusch-alpha-set' (see 38.213, section 7.1) +P0-PUSCH-AlphaSet ::= SEQUENCE { + p0-PUSCH-AlphaSetId P0-PUSCH-AlphaSetId, + -- P0 value for PUSCH with grant (except msg3) in steps of 1dB. Corresponds to L1 parameter 'p0-pusch' (see 38,213, section 7.1) + p0 INTEGER (-16..15) OPTIONAL, + -- alpha value for PUSCH with grant (except msg3) (see 38.213, section 7.1) + -- When the field is absent the UE applies the value 1 + alpha Alpha OPTIONAL -- Need S +} + +-- ID for a P0-PUSCH-AlphaSet. Corresponds to L1 parameter 'p0alphasetindex' (see 38.213, section 7.1) +P0-PUSCH-AlphaSetId ::= INTEGER (0..maxNrofP0-PUSCH-AlphaSets-1) + +-- A reference signal (RS) configured as pathloss reference signal for PUSCH power control +-- Corresponds to L1 parameter 'pusch-pathlossReference-rs' (see 38.213, section 7.1) +PUSCH-PathlossReferenceRS ::= SEQUENCE { + pusch-PathlossReferenceRS-Id PUSCH-PathlossReferenceRS-Id, + referenceSignal CHOICE { + ssb-Index SSB-Index, + csi-RS-Index NZP-CSI-RS-ResourceId + } +} + +-- ID for a referemce signal (RS) configured as PUSCH pathloss reference +-- Corresponds to L1 parameter 'pathlossreference-index' (see 38.213, section 7.1) +-- FFS_CHECK: Is this ID used anywhere except inside the PUSCH-PathlossReference-RS itself? +PUSCH-PathlossReferenceRS-Id ::= INTEGER (0..maxNrofPUSCH-PathlossReferenceRSs-1) + + +-- A set of PUSCH power control parameters associated with one SRS-ResourceIndex (SRI) +SRI-PUSCH-PowerControl ::= SEQUENCE { + -- The ID of this SRI-PUSCH-PowerControl configuration. It is used as the codepoint (payload) in the SRI DCI field. + sri-PUSCH-PowerControlId SRI-PUSCH-PowerControlId, + -- The ID of PUSCH-PathlossReferenceRS as configured in the pathlossReferenceRSToAddModList in PUSCH-PowerControl. + sri-PUSCH-PathlossReferenceRS-Id PUSCH-PathlossReferenceRS-Id, + -- The ID of a P0-PUSCH-AlphaSet as configured in p0-AlphaSets in PUSCH-PowerControl. + sri-P0-PUSCH-AlphaSetId P0-PUSCH-AlphaSetId, + -- The index of the closed power control loop associated with this SRI-PUSCH-PowerControl + sri-PUSCH-ClosedLoopIndex ENUMERATED { i0, i1 } +} + +SRI-PUSCH-PowerControlId ::= INTEGER (0..maxNrofSRI-PUSCH-Mappings-1) + +-- A set of beta-offset values +BetaOffsets ::= SEQUENCE { + -- Up to 2 bits HARQ-ACK. Corresponds to L1 parameter 'betaOffset-ACK-Index-1' (see 38.213, section 9.3) + -- When the field is absent the UE applies the value 11 + betaOffsetACK-Index1 INTEGER(0..31) OPTIONAL, -- Need S + -- Up to 11 bits HARQ-ACK. Corresponds to L1 parameter 'betaOffset-ACK-Index-2' (see 38.213, section 9.3) + -- When the field is absent the UE applies the value 11 + betaOffsetACK-Index2 INTEGER(0..31) OPTIONAL, -- Need S + -- Above 11 bits HARQ-ACK. Corresponds to L1 parameter 'betaOffset-ACK-Index-3' (see 38.213, section 9.3) + -- When the field is absent the UE applies the value 11 + betaOffsetACK-Index3 INTEGER(0..31) OPTIONAL, -- Need S + -- Up to 11 bits of CSI part 1 bits. Corresponds to L1 parameter 'betaOffset-CSI-part-1-Index-1' (see 38.213, section 9.3) + -- When the field is absent the UE applies the value 13 + betaOffsetCSI-Part1-Index1 INTEGER(0..31) OPTIONAL, -- Need S + -- Above 11 bits of CSI part 1 bits. Corresponds to L1 parameter 'betaOffset-CSI-part-1-Index-2' (see 38.213, section 9.3) + -- When the field is absent the UE applies the value 13 + betaOffsetCSI-Part1-Index2 INTEGER(0..31) OPTIONAL, -- Need S + -- Up to 11 bits of CSI part 2 bits. Corresponds to L1 parameter 'betaOffset-CSI-part-2-Index-1' (see 38.213, section 9.3) + -- When the field is absent the UE applies the value 13 + betaOffsetCSI-Part2-Index1 INTEGER(0..31) OPTIONAL, -- Need S + -- Above 11 bits of CSI part 2 bits. Corresponds to L1 parameter 'betaOffset-CSI-part-2-Index-2' (see 38.213, section 9.3) + -- When the field is absent the UE applies the value 13 + betaOffsetCSI-Part2-Index2 INTEGER(0..31) OPTIONAL -- Need S +} + +-- TAG-PUSCH-POWERCONTROL-STOP +-- TAG-PUSCH-SERVINGCELLCONFIG-START + +PUSCH-ServingCellConfig ::= SEQUENCE { + -- Enables and configures code-block-group (CBG) based transmission (see 38.214, section FFS_Section) + codeBlockGroupTransmission SetupRelease { PUSCH-CodeBlockGroupGransmission } OPTIONAL, -- Need M + -- Enables LBRM (Limited buffer rate-matching). When the field is absent the UE applies FBRM (Full buffer rate-matchingLBRM). + -- Corresponds to L1 parameter 'LBRM-FBRM-selection' (see 38.212, section 5.4.2) + rateMatching ENUMERATED {limitedBufferRM} OPTIONAL, -- Need S + -- Accounts for overhead from CSI-RS, CORESET, etc. If the field is absent, the UE applies the value 'xoh0'. + -- Corresponds to L1 parameter 'Xoh-PUSCH' (see 38.214, section 5.1.3.2) + xOverhead ENUMERATED {xoh6, xoh12, xoh18} OPTIONAL, -- Need S + ... +} + +PUSCH-CodeBlockGroupGransmission ::= SEQUENCE { + -- Maximum number of code-block-groups (CBGs) per TB (see 38.xxx, section x.x.x, FFS_Ref) + -- For 2 codewords, only the values { n2, n4 } are valid. + maxCodeBlockGroupsPerTransportBlock ENUMERATED {n2, n4, n6, n8}, + ... +} + +-- TAG-PUSCH-SERVINGCELLCONFIG-STOP +-- TAG-PUSCH-TIMEDOMAINRESOURCEALLOCATION-START + +PUSCH-TimeDomainResourceAllocation ::= SEQUENCE { + -- Corresponds to L1 parameter 'K2' (see 38.214, section FFS_Section) + -- When the field is absent the UE applies the value 01 when PUSCH SCS is 15/30KHz; 2 when PUSCH SCS is 60KHz and 3 when PUSCH SCS is 120KHz. + k2 INTEGER (0..7) OPTIONAL, -- Need S + -- Mapping type. Corresponds to L1 parameter 'Mapping-type' (see 38.214, section FFS_Section) + mappingType ENUMERATED {typeA, typeB}, + -- An index into a table/equation in RAN1 specs capturing valid combinations of start symbol and length (jointly encoded) + -- Corresponds to L1 parameter 'Index-start-len' (see 38.214, section FFS_Section) + startSymbolAndLength BIT STRING (SIZE (7)) +} + +-- TAG-PUSCH-TIMEDOMAINRESOURCEALLOCATION-STOP +-- TAG-PUSCH-TPC-COMMANDCONFIG-START + +PUSCH-TPC-CommandConfig ::= SEQUENCE { + -- An index determining the position of the first bit of TPC command inside the DCI format 2-2 payload. + tpc-Index INTEGER (1..15) OPTIONAL, -- Cond SUL + -- An index determining the position of the first bit of TPC command inside the DCI format 2-2 payload. + tpc-IndexSUL INTEGER (1..15) OPTIONAL, -- Cond SUL-Only + -- The serving cell to which the acquired power control commands are applicable. If the value is absent, the UE applies the + -- TPC commands to the serving cell on which the command has been received. + targetCell ServCellIndex OPTIONAL, -- Need S + ... +} + +-- TAG-PUSCH-TPC-COMMANDCONFIG-STOP + +Q-OffsetRange ::= ENUMERATED { + dB-24, dB-22, dB-20, dB-18, dB-16, dB-14, + dB-12, dB-10, dB-8, dB-6, dB-5, dB-4, dB-3, + dB-2, dB-1, dB0, dB1, dB2, dB3, dB4, dB5, + dB6, dB8, dB10, dB12, dB14, dB16, dB18, + dB20, dB22, dB24} + +-- TAG-QUANTITY-CONFIG-START + + +QuantityConfig ::= SEQUENCE { + quantityConfigNR-List QuantityConfigNR-List OPTIONAL, -- Need M + ... +} + +QuantityConfigNR-List::= SEQUENCE (SIZE (1..maxNrofQuantityConfig)) OF QuantityConfigNR + +QuantityConfigNR::= SEQUENCE { + quantityConfigCell QuantityConfigRS, + quantityConfigRS-Index QuantityConfigRS OPTIONAL -- Need M +} + +QuantityConfigRS ::= SEQUENCE { + -- SS Block based L3 filter configurations: + ssb-FilterConfig FilterConfig, + + -- CSI-RS basedL3 filter configurations: + cs-RS-FilterConfig FilterConfig +} + +FilterConfig ::= SEQUENCE { + filterCoefficientRSRP FilterCoefficient DEFAULT fc4, + filterCoefficientRSRQ FilterCoefficient DEFAULT fc4, + filterCoefficientRS-SINR FilterCoefficient DEFAULT fc4 +} + +-- TAG-QUANTITY-CONFIG-STOP +-- TAG-RACH-CONFIG-COMMON-START + +RACH-ConfigCommon ::= SEQUENCE { + -- Generic RACH parameters + rach-ConfigGeneric RACH-ConfigGeneric, + + -- Total number of preambles used for contention based and contention free random access, excluding + -- preambles used for other purposes (e.g. for SI request). If the field is absent, the UE may use all 64 preambles for RA. + totalNumberOfRA-Preambles INTEGER (1..63) OPTIONAL, -- Need S + + -- Number of SSBs per RACH occasion (L1 parameter 'SSB-per-rach-occasion') and the number of Contention Based preambles per SSB + -- (L1 parameter 'CB-preambles-per-SSB'). By multiplying the two values, the UE determines the total number of CB preambles. + ssb-perRACH-OccasionAndCB-PreamblesPerSSB CHOICE { + oneEighth ENUMERATED {n4,n8,n12,n16,n20,n24,n28,n32,n36,n40,n44,n48,n52,n56,n60,n64}, + oneFourth ENUMERATED {n4,n8,n12,n16,n20,n24,n28,n32,n36,n40,n44,n48,n52,n56,n60,n64}, + oneHalf ENUMERATED {n4,n8,n12,n16,n20,n24,n28,n32,n36,n40,n44,n48,n52,n56,n60,n64}, + one ENUMERATED {n4,n8,n12,n16,n20,n24,n28,n32,n36,n40,n44,n48,n52,n56,n60,n64}, + two ENUMERATED {n4,n8,n12,n16,n20,n24,n28,n32}, + four INTEGER (1..16), + eight INTEGER (1..8), + sixteen INTEGER (1..4) + } OPTIONAL, -- Need M + + groupBconfigured SEQUENCE { + -- Transport Blocks size threshold in bit below which the UE shall use a contention based RA premable + -- of group A. (see 38.321, section 5.1.2) + ra-Msg3SizeGroupA ENUMERATED {b56, b144, b208, b256, b282, b480, b640, b800, b1000, spare7, spare6, spare5, + spare4, spare3, spare2, spare1}, + -- Threshold for preamble selection. Value in dB. Value minusinfinity corresponds to –infinity. + -- Value dB0 corresponds to 0 dB, dB5 corresponds to 5 dB and so on. (see FFS_Spec, section FFS_Section) + messagePowerOffsetGroupB ENUMERATED { minusinfinity, dB0, dB5, dB8, dB10, dB12, dB15, dB18}, + -- The number of CB preambles per SSB in group A. This determines implicitly the number of CB preambles per SSB available in group B. + -- (see 38.321, section 5.1.1) + numberOfRA-PreamblesGroupA INTEGER (1..64) + } OPTIONAL, -- Need R + + -- The initial value for the contention resolution timer (see 38.321, section 5.1.5) + ra-ContentionResolutionTimer ENUMERATED { sf8, sf16, sf24, sf32, sf40, sf48, sf56, sf64}, + + -- UE may select the SS block and corresponding PRACH resource for path-loss estimation and (re)transmission + -- based on SS blocks that satisfy the threshold (see 38.213, section REF) + rsrp-ThresholdSSB RSRP-Range OPTIONAL, -- Need R + -- UE may select the SS block and corresponding PRACH resource for path-loss estimation and (re)transmission on the SUL carrier + -- based on SS blocks that satisfy the threshold + -- Corresponds to L1 parameter 'SUL-RSRP-Threshold' (see FFS_Spec, section FFS_Section) + rsrp-ThresholdSSB-SUL RSRP-Range OPTIONAL, -- Need R + + -- PRACH root sequence index. Corresponds to L1 parameter 'PRACHRootSequenceIndex' (see 38.211, section 6.3.3.1). + -- The value range depends on whether L=839 or L=139 + prach-RootSequenceIndex CHOICE { + l839 INTEGER (0..837), + l139 INTEGER (0..137) + }, + + -- Subcarrier spacing of PRACH. Only the values 15 or 30 kHz (<6GHz), 60 or 120 kHz (>6GHz) are applicable. + -- Corresponds to L1 parameter 'prach-Msg1SubcarrierSpacing' (see 38.211, section FFS_Section) + msg1-SubcarrierSpacing SubcarrierSpacing, + + -- Configuration of an unrestricted set or one of two types of restricted sets, see 38.211 6.3.3.1 + restrictedSetConfig ENUMERATED {unrestrictedSet, restrictedSetTypeA, restrictedSetTypeB}, + -- Indicates to a UE whether transform precoding is enabled for Msg3 transmission. + -- Corresponds to L1 parameter 'msg3-tp' (see 38.213, section 8.1) + msg3-transformPrecoding ENUMERATED {enabled} OPTIONAL, -- Need R + ... +} + +-- TAG-RACH-CONFIG-COMMON-STOP +-- TAG-RACH-CONFIG-GENERIC-START + +RACH-ConfigGeneric ::= SEQUENCE { + -- PRACH configuration index. Corresponds to L1 parameter 'PRACHConfigurationIndex' (see 38.211, section 6.3.3.2) + prach-ConfigurationIndex INTEGER (0..255), + -- The number of PRACH transmission occasions FDMed in one time instance. + -- Corresponds to L1 parameter 'prach-FDM' (see 38.211, section FFS_Section) + msg1-FDM ENUMERATED {one, two, four, eight}, + -- Offset of lowest PRACH transmission occasion in frequency domain with respective to PRB 0. + -- The value is configured so that the corresponding RACH resource is entirely within the bandwidth of the UL BWP. + -- Corresponds to L1 parameter 'prach-frequency-start' (see 38,211, section FFS_Section) + msg1-FrequencyStart INTEGER (0..maxNrofPhysicalResourceBlocks-1), + -- N-CS configuration, see Table 6.3.3.1-3 in 38.211 + zeroCorrelationZoneConfig INTEGER(0..15), + -- The target power level at the network receiver side (see 38.213, section 7.4, 38.321, section 5.1.2, 5.1.3) + -- Only multiples of 2 dBm may be chosen (e.g. -200, -198, ...). + -- FFS-Value: Actual values to be updated based on input from RAN4 (see LS in R2-1800004 and R4-1803466). + preambleReceivedTargetPower INTEGER (-200..-74), + -- Max number of RA preamble transmission perfomed before declaring a failure (see 38.321, section 5.1.4, 5.1.5) + preambleTransMax ENUMERATED {n3, n4, n5, n6, n7, n8, n10, n20, n50, n100, n200}, + -- Power ramping steps for PRACH (see 38.321,5.1.3) + powerRampingStep ENUMERATED {dB0, dB2, dB4, dB6}, + -- Msg2 (RAR) window length in number of slots. The network configures a value lower than or euqal to 10 ms (see 38.321, section 5.1.4) + ra-ResponseWindow ENUMERATED {sl1, sl2, sl4, sl8, sl10, sl20, sl40, sl80} +} + +-- TAG-RACH-CONFIG-GENERIC-STOP +-- TAG-RACH-CONFIG-DEDICATED-START + +-- FFS_Standlone: resources for msg1-based on-demand SI request + +RACH-ConfigDedicated ::= SEQUENCE { + -- Resources for contention free random access to a given target cell + cfra-Resources CFRA-Resources, + ... +} + +CFRA-Resources ::= CHOICE { + ssb SEQUENCE { + ssb-ResourceList SEQUENCE (SIZE(1..maxRA-SSB-Resources)) OF CFRA-SSB-Resource, + -- Explicitly signalled PRACH Mask Index for RA Resource selection in TS 36.321. The mask is valid for all SSB + -- resources signalled in ssb-ResourceList + ra-ssb-OccasionMaskIndex INTEGER (0..15) + }, + csirs SEQUENCE { + csirs-ResourceList SEQUENCE (SIZE(1..maxRA-CSIRS-Resources)) OF CFRA-CSIRS-Resource, + cfra-csirs-DedicatedRACH-Threshold RSRP-Range + } +} + +CFRA-SSB-Resource ::= SEQUENCE { + -- The ID of an SSB transmitted by this serving cell. + ssb SSB-Index, + -- The preamble index that the UE shall use when performing CF-RA upon selecting the candidate beams identified by this SSB. + ra-PreambleIndex INTEGER (0..63), + ... +} + +CFRA-CSIRS-Resource ::= SEQUENCE { + -- The ID of a CSI-RS resource defined in the measurement object associated with this serving cell. + csi-RS CSI-RS-Index, + -- RA occasions that the UE shall use when performing CF-RA upon selecting the candidate beam identified by this CSI-RS. + ra-OccasionList SEQUENCE (SIZE(1..maxRA-OccasionsPerCSIRS)) OF INTEGER (0..maxRA-Occasions-1), + -- The RA preamble index to use in the RA occasions assoicated with this CSI-RS. + ra-PreambleIndex INTEGER (0..63), + ... +} + +-- TAG-RACH-CONFIG-DEDICATED-STOP +-- TAG-RADIO-BEARER-CONFIG-START + +RadioBearerConfig ::= SEQUENCE { + srb-ToAddModList SRB-ToAddModList OPTIONAL, -- Need N + srb3-ToRelease ENUMERATED{true} OPTIONAL, -- Need N + drb-ToAddModList DRB-ToAddModList OPTIONAL, -- Need N + drb-ToReleaseList DRB-ToReleaseList OPTIONAL, -- Need N + securityConfig SecurityConfig OPTIONAL, -- Cond M + ... +} + +SRB-ToAddModList ::= SEQUENCE (SIZE (1..2)) OF SRB-ToAddMod +SRB-ToAddMod ::= SEQUENCE { + srb-Identity SRB-Identity, + -- may only be set if the cell groups of all linked logical channels are reset or released + reestablishPDCP ENUMERATED{true} OPTIONAL, -- Need N + discardOnPDCP ENUMERATED{true} OPTIONAL, -- Need N + pdcp-Config PDCP-Config OPTIONAL, -- Cond PDCP + ... +} + + +DRB-ToAddModList ::= SEQUENCE (SIZE (1..maxDRB)) OF DRB-ToAddMod +DRB-ToAddMod ::= SEQUENCE { + cnAssociation CHOICE { + -- The EPS bearer ID determines the EPS bearer when NR connects to EPC using EN-DC + eps-BearerIdentity INTEGER (0..15), -- EPS-DRB-Setup + -- The SDAP configuration determines how to map QoS flows to DRBs when NR connects to the 5GC + sdap-Config SDAP-Config -- 5GC + } OPTIONAL, -- Cond DRBSetup + drb-Identity DRB-Identity, + + -- may only be set if the cell groups of all linked logical channels are reset or released + reestablishPDCP ENUMERATED{true} OPTIONAL, -- Need N + recoverPDCP ENUMERATED{true} OPTIONAL, -- Need N + pdcp-Config PDCP-Config OPTIONAL, -- Cond PDCP + ... +} + +DRB-ToReleaseList ::= SEQUENCE (SIZE (1..maxDRB)) OF DRB-Identity + + +SecurityConfig ::= SEQUENCE { + securityAlgorithmConfig SecurityAlgorithmConfig OPTIONAL, -- Cond RBTermChange + keyToUse ENUMERATED{keNB, s-KgNB} OPTIONAL, -- Cond RBTermChange + ... +} + +-- TAG-RADIO-BEARER-CONFIG-STOP +-- TAG-RADIOLINKMONITORINGCONFIG-START + +RadioLinkMonitoringConfig ::= SEQUENCE { + -- A list of reference signals for detecting beam failure and/or cell level radio link failure (RLF). + -- The network configures at most two detectionResources per BWP for the purpose "beamFailure" or "both". + -- If no RSs are provided for the purpose of beam failure detection, the UE performs beam monitoring based on the activated TCI-State + -- for PDCCH. However, if the activated TCI state refers to an aperiodic or semi-persistent CSI-RS, the gNB configures the failure + -- detection resources explicitly (FFS_RAN1: TBC by RAN1). + -- If no RSs are provided in this list at all (neither for Cell- nor for Beam-RLM), the UE performs also Cell-RLM based + -- on the activated TCI-State of PDCCH (FFS_RAN1: TBC by RAN1). + -- When the network reconfigures this field, the UE resets on-going RLF timers and counters. + failureDetectionResources SEQUENCE (SIZE(1..maxNrofFailureDetectionResources)) OF RadioLinkMonitoringRS OPTIONAL, -- Need M + -- This field determines after how many beam failure events the UE triggers beam failure recovery (see 38.321, section 5.17). + -- Value n1 corresponds to 1 beam failure instance, n2 corresponds to 2 beam failure instances and so on. + -- When the network reconfigures this field, the UE resets on-going RLF timers and counters. + -- If the field is absent, the UE does not trigger beam failure recovery. + beamFailureInstanceMaxCount ENUMERATED {n1, n2, n3, n4, n5, n6, n8, n10} OPTIONAL, -- Need S + -- Timer for beam failure detection (see 38.321, section FFS_Section). See also the BeamFailureRecoveryConfig IE. + -- Value in number of "periods of Beam Failure Detection" Reference Signal. Value pbfd1 corresponds to 1 period of Beam Failure + -- Detection Reference Signal, value pbfd2 corresponds to 2 periods of Beam Failure Detection Reference Signal and so on. + -- When the network reconfigures this field, the UE resets on-going RLF timers and counters. + beamFailureDetectionTimer ENUMERATED {pbfd1, pbfd2, pbfd3, pbfd4, pbfd5, pbfd6, pbfd8, pbfd10} OPTIONAL, -- Need R + ... +} + +RadioLinkMonitoringRS ::= SEQUENCE { + -- Determines whether the UE shall monitor the associated reference signal for the purpose of cell- and/or beam failure detection. + purpose ENUMERATED {beamFailure, rlf, both}, + -- A reference signal that the UE shall use for radio link monitoring. The network provides an ssb-Index only if + -- the purpose is set to rlf. + detectionResource CHOICE { + ssb-Index SSB-Index, + csi-RS-Index NZP-CSI-RS-ResourceId + }, + ... +} + +-- TAG-RADIOLINKMONITORINGCONFIG-STOP +-- TAG-RATEMATCHPATTERN-START +RateMatchPattern ::= SEQUENCE { + rateMatchPatternId RateMatchPatternId, + + patternType CHOICE { + bitmaps SEQUENCE { + -- A resource block level bitmap in the frequency domain. It indicates the PRBs to which the symbolsInResourceBlock bitmap applies. + -- Corresponds to L1 parameter 'rate-match-PDSCH-bitmap1' (see 38.214, section FFS_Section) + -- FFS_ASN1: Consider multiple options with different number of bits (for narrower carriers) + resourceBlocks BIT STRING (SIZE (275)), + + -- A symbol level bitmap in time domain. It indicates (FFS: with a bit set to true) the symbols which the UE shall rate match around. + -- This pattern recurs (in time domain) with the configured periodicityAndOffset. + -- Corresponds to L1 parameter 'rate-match-PDSCH-bitmap2' (see 38.214, section FFS_Section) + -- FFS: Why not split it into two BIT STRINGs of 14 bit each? + symbolsInResourceBlock CHOICE { + oneSlot BIT STRING (SIZE (14)), + twoSlots BIT STRING (SIZE (28)) + }, + + -- A time domain repetition pattern. at which the symbolsInResourceBlock + -- pattern recurs. This slot pattern repeats itself continuously. Absence of this field indicates the value n1, i.e., the + -- symbolsInResourceBlock recurs every 14 symbols. + -- Corresponds to L1 parameter 'rate-match-PDSCH-bitmap3' (see 38.214, section FFS_Section) + periodicityAndPattern CHOICE { + n2 BIT STRING (SIZE (2)), + n4 BIT STRING (SIZE (4)), + n5 BIT STRING (SIZE (5)), + n8 BIT STRING (SIZE (8)), + n10 BIT STRING (SIZE (10)), + n20 BIT STRING (SIZE (20)), + n40 BIT STRING (SIZE (40)) + } OPTIONAL, -- Need S + ... + }, + -- This ControlResourceSet us used as a PDSCH rate matching pattern, i.e., PDSCH reception rate matches around it. + controlResourceSet ControlResourceSetId + }, + -- The SubcarrierSpacing for this resource pattern. If the field is absent, the UE applies the SCS of the associcated BWP. + -- The value kHz15 corresponds to µ=0, kHz30 to µ=1, and so on. Only the values 15 or 30 kHz (<6GHz), 60 or 120 kHz (>6GHz) are + -- applicable. Corresponds to L1 parameter 'resource-pattern-scs' (see 38.214, section FFS_Section) + subcarrierSpacing SubcarrierSpacing OPTIONAL, -- Cond CellLevel + -- FFS_Description, FFS_Section + mode ENUMERATED { dynamic, semiStatic }, + ... +} + +-- TAG-RATEMATCHPATTERN-STOP +-- TAG-RATEMATCHPATTERNID-START + +RateMatchPatternId ::= INTEGER (0..maxNrofRateMatchPatterns-1) + +-- TAG-RATEMATCHPATTERNID-STOP +-- TAG-RATEMATCHPATTERNLTE-CRS-START + +RateMatchPatternLTE-CRS ::= SEQUENCE { + -- Center of the LTE carrier. Corresponds to L1 parameter 'center-subcarrier-location' (see 38.214, section 5.1.4) + carrierFreqDL INTEGER (0..16383), + -- BW of the LTE carrier in numbewr of PRBs. Corresponds to L1 parameter 'BW' (see 38.214, section 5.1.4) + carrierBandwidthDL ENUMERATED {n6, n15, n25, n50, n75, n100, spare2, spare1}, + -- LTE MBSFN subframe configuration. Corresponds to L1 parameter 'MBSFN-subframconfig' (see 38.214, section 5.1.4) + -- FFS_ASN1: Import the LTE MBSFN-SubframeConfigList + mbsfn-SubframeConfigList EUTRA-MBSFN-SubframeConfigList OPTIONAL, -- Need M + -- Number of LTE CRS antenna port to rate-match around. + -- Corresponds to L1 parameter 'rate-match-resources-numb-LTE-CRS-antenna-port' (see 38.214, section 5.1.4) + nrofCRS-Ports ENUMERATED {n1, n2, n4}, + -- Shifting value v-shift in LTE to rate match around LTE CRS + -- Corresponds to L1 parameter 'rate-match-resources-LTE-CRS-v-shift' (see 38.214, section 5.1.4) + v-Shift ENUMERATED {n0, n1, n2, n3, n4, n5} +} + +-- TAG-RATEMATCHPATTERNLTE-CRS-STOP +-- TAG-REPORT-CONFIG-ID-START + +ReportConfigId ::= INTEGER (1..maxReportConfigId) + +-- TAG-REPORT-CONFIG-ID-STOP +-- TAG-REPORT-CONFIG-START + +ReportConfigNR ::= SEQUENCE { + reportType CHOICE { + periodical PeriodicalReportConfig, + eventTriggered EventTriggerConfig, +-- reportCGI is to be completed before the end of Rel-15. + reportCGI ENUMERATED {ffsTypeAndValue}, + ... + } +} + +-- FFS / TODO: Consider separating trgger configuration (trigger, periodic, ...) from report configuration. +-- Current structure allows easier definiton of new events and new report types e.g. CGI, etc. +EventTriggerConfig::= SEQUENCE { + eventId CHOICE { + eventA1 SEQUENCE { + a1-Threshold MeasTriggerQuantity, + reportOnLeave BOOLEAN, + hysteresis Hysteresis, + timeToTrigger TimeToTrigger + }, + eventA2 SEQUENCE { + a2-Threshold MeasTriggerQuantity, + reportOnLeave BOOLEAN, + hysteresis Hysteresis, + timeToTrigger TimeToTrigger + }, + eventA3 SEQUENCE { + a3-Offset MeasTriggerQuantityOffset, + reportOnLeave BOOLEAN, + hysteresis Hysteresis, + timeToTrigger TimeToTrigger, + useWhiteCellList BOOLEAN + }, + eventA4 SEQUENCE { + a4-Threshold MeasTriggerQuantity, + reportOnLeave BOOLEAN, + hysteresis Hysteresis, + timeToTrigger TimeToTrigger, + useWhiteCellList BOOLEAN + }, + eventA5 SEQUENCE { + a5-Threshold1 MeasTriggerQuantity, + a5-Threshold2 MeasTriggerQuantity, + reportOnLeave BOOLEAN, + hysteresis Hysteresis, + timeToTrigger TimeToTrigger, + useWhiteCellList BOOLEAN + }, + eventA6 SEQUENCE { + a6-Offset MeasTriggerQuantityOffset, + reportOnLeave BOOLEAN, + hysteresis Hysteresis, + timeToTrigger TimeToTrigger, + useWhiteCellList BOOLEAN + }, + ... + }, + + rsType NR-RS-Type, + + -- Common reporting config (at least to periodical and eventTriggered) + reportInterval ReportInterval, + reportAmount ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity}, + + -- Cell reporting configuration + reportQuantityCell MeasReportQuantity, + maxReportCells INTEGER (1..maxCellReport), + + -- RS index reporting configuration + reportQuantityRsIndexes MeasReportQuantity OPTIONAL, -- Need M + maxNrofRSIndexesToReport INTEGER (1..maxNrofIndexesToReport) OPTIONAL, -- Need M + includeBeamMeasurements BOOLEAN, + -- If configured the UE includes the best neighbour cells per serving frequency + reportAddNeighMeas ENUMERATED {setup} OPTIONAL, -- Need R + ... + +} + +PeriodicalReportConfig ::= SEQUENCE { + rsType NR-RS-Type, + + -- Common reporting config (at least to periodical and eventTriggered) + reportInterval ReportInterval, + reportAmount ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity}, + + -- Cell reporting configuration + reportQuantityCell MeasReportQuantity, + maxReportCells INTEGER (1..maxCellReport), + + -- RS index reporting configuration + reportQuantityRsIndexes MeasReportQuantity OPTIONAL, -- Need R + maxNrofRsIndexesToReport INTEGER (1..maxNrofIndexesToReport) OPTIONAL, -- Need R + includeBeamMeasurements BOOLEAN, + useWhiteCellList BOOLEAN, + ... + +} + +NR-RS-Type ::= ENUMERATED {ssb, csi-rs} + +MeasTriggerQuantity ::= CHOICE { + rsrp RSRP-Range, + rsrq RSRQ-Range, + sinr SINR-Range +} + +MeasTriggerQuantityOffset ::= CHOICE { + rsrp INTEGER (-30..30), + rsrq INTEGER (-30..30), + sinr INTEGER (-30..30) +} + + +MeasReportQuantity ::= SEQUENCE { + rsrp BOOLEAN, + rsrq BOOLEAN, + sinr BOOLEAN +} + + +-- TAG-REPORT-CONFIG-START +-- TAG-REPORT-CONFIG-TO-ADD-MOD-LIST-START + +ReportConfigToAddModList ::= SEQUENCE (SIZE (1..maxReportConfigId)) OF ReportConfigToAddMod + +ReportConfigToAddMod ::= SEQUENCE { + reportConfigId ReportConfigId, + reportConfig CHOICE { + reportConfigNR ReportConfigNR, + ... + } +} + +-- TAG- REPORT-CONFIG-TO-ADD-MOD-LIST-STOP + +ReportInterval ::= ENUMERATED {ms120, ms240, ms480, ms640, ms1024, ms2048, ms5120, ms10240, ms20480, ms40960, min1, + min6, min12, min30 } + +-- TAG-RLC-CONFIG-START + +RLC-Config ::= CHOICE { + am SEQUENCE { + ul-AM-RLC UL-AM-RLC, + dl-AM-RLC DL-AM-RLC + }, + um-Bi-Directional SEQUENCE { + ul-UM-RLC UL-UM-RLC, + dl-UM-RLC DL-UM-RLC + }, + um-Uni-Directional-UL SEQUENCE { + ul-UM-RLC UL-UM-RLC + }, + um-Uni-Directional-DL SEQUENCE { + dl-UM-RLC DL-UM-RLC + }, + ... +} + +UL-AM-RLC ::= SEQUENCE { + sn-FieldLength SN-FieldLengthAM, + t-PollRetransmit T-PollRetransmit, + pollPDU PollPDU, + pollByte PollByte, + maxRetxThreshold ENUMERATED { t1, t2, t3, t4, t6, t8, t16, t32 } +} + +DL-AM-RLC ::= SEQUENCE { + sn-FieldLength SN-FieldLengthAM, + t-Reassembly T-Reassembly, + t-StatusProhibit T-StatusProhibit +} + +UL-UM-RLC ::= SEQUENCE { + sn-FieldLength SN-FieldLengthUM +} + +DL-UM-RLC ::= SEQUENCE { + sn-FieldLength SN-FieldLengthUM, + t-Reassembly T-Reassembly +} + +T-PollRetransmit ::= ENUMERATED { + ms5, ms10, ms15, ms20, ms25, ms30, ms35, + ms40, ms45, ms50, ms55, ms60, ms65, ms70, + ms75, ms80, ms85, ms90, ms95, ms100, ms105, + ms110, ms115, ms120, ms125, ms130, ms135, + ms140, ms145, ms150, ms155, ms160, ms165, + ms170, ms175, ms180, ms185, ms190, ms195, + ms200, ms205, ms210, ms215, ms220, ms225, + ms230, ms235, ms240, ms245, ms250, ms300, + ms350, ms400, ms450, ms500, ms800, ms1000, + ms2000, ms4000, spare5, spare4, spare3, + spare2, spare1} + + +PollPDU ::= ENUMERATED { + p4, p8, p16, p32, p64, p128, p256, p512, p1024, p2048, p4096, p6144, p8192, p12288, p16384, p20480, + p24576, p28672, p32768, p40960, p49152, p57344, p65536, infinity, spare8, spare7, spare6, spare5, spare4, + spare3, spare2, spare1} + +PollByte ::= ENUMERATED { + kB1, kB2, kB5, kB8, kB10, kB15, kB25, kB50, kB75, + kB100, kB125, kB250, kB375, kB500, kB750, kB1000, + kB1250, kB1500, kB2000, kB3000, kB4000, kB4500, + kB5000, kB5500, kB6000, kB6500, kB7000, kB7500, + mB8, mB9, mB10, mB11, mB12, mB13, mB14, mB15, + mB16, mB17, mB18, mB20, mB25, mB30, mB40, infinity, + spare20, spare19, spare18, spare17, spare16, + spare15, spare14, spare13, spare12, spare11, + spare10, spare9, spare8, spare7, spare6, spare5, + spare4, spare3, spare2, spare1} + +T-Reassembly ::= ENUMERATED { + ms0, ms5, ms10, ms15, ms20, ms25, ms30, ms35, + ms40, ms45, ms50, ms55, ms60, ms65, ms70, + ms75, ms80, ms85, ms90, ms95, ms100, ms110, + ms120, ms130, ms140, ms150, ms160, ms170, + ms180, ms190, ms200, spare1} + +T-StatusProhibit ::= ENUMERATED { + ms0, ms5, ms10, ms15, ms20, ms25, ms30, ms35, + ms40, ms45, ms50, ms55, ms60, ms65, ms70, + ms75, ms80, ms85, ms90, ms95, ms100, ms105, + ms110, ms115, ms120, ms125, ms130, ms135, + ms140, ms145, ms150, ms155, ms160, ms165, + ms170, ms175, ms180, ms185, ms190, ms195, + ms200, ms205, ms210, ms215, ms220, ms225, + ms230, ms235, ms240, ms245, ms250, ms300, + ms350, ms400, ms450, ms500, ms800, ms1000, + ms1200, ms1600, ms2000, ms2400, spare2, spare1} + +SN-FieldLengthUM ::= ENUMERATED {size6, size12} +SN-FieldLengthAM ::= ENUMERATED {size12, size18} + +-- TAG-RLC-CONFIG-STOP +-- TAG-RLF-TIMERS-AND-CONSTANTS-START + +RLF-TimersAndConstants ::= SEQUENCE { + t310 ENUMERATED {ms0, ms50, ms100, ms200, ms500, ms1000, ms2000, ms4000, ms6000}, + n310 ENUMERATED {n1, n2, n3, n4, n6, n8, n10, n20}, + n311 ENUMERATED {n1, n2, n3, n4, n5, n6, n8, n10}, + ... +} + +-- TAG-RLF-TIMERS-AND-CONSTANTS-STOP +-- TAG-RNTI-VALUE-START + +RNTI-Value ::= INTEGER (0..65535) + +-- TAG-RNTI-VALUE-STOP +-- TAG-RSRP-RANGE-START + +RSRP-Range ::= INTEGER(0..124) + +-- TAG-RSRP-RANGE-STOP +-- TAG-RSRQ-RANGE-START + +RSRQ-Range ::= INTEGER(0..127) + +-- TAG-RSRQ-RANGE-STOP +-- TAG-SCELL-INDEX-START + +-- The value range is shared across the Cell Groups +SCellIndex ::= INTEGER (1..31) + +-- TAG-SCELL-INDEX-STOP +-- TAG-SCHEDULING-REQUEST-CONFIG-START + +SchedulingRequestConfig ::= SEQUENCE { + schedulingRequestToAddModList SEQUENCE (SIZE (1..maxNrofSR-ConfigPerCellGroup)) OF SchedulingRequestToAddMod OPTIONAL, -- Need N + schedulingRequestToReleaseList SEQUENCE (SIZE (1..maxNrofSR-ConfigPerCellGroup)) OF SchedulingRequestId OPTIONAL -- Need N +} + +SchedulingRequestToAddMod ::= SEQUENCE { + sr-ConfigIndex SchedulingRequestId, + + sr-ProhibitTimer ENUMERATED {ms1, ms2, ms4, ms8, ms16, ms32, ms64, ms128} OPTIONAL, -- Need S + sr-TransMax ENUMERATED { n4, n8, n16, n32, n64, spare3, spare2, spare1} +} + +SchedulingRequestId ::= INTEGER (0..7) + +-- FFS_TODO: provide resources for each SchedulingRequestID in ServingCellConfig (TBD whether directly, in PUCCH-Config, in each BWP) + +-- TAG-SCHEDULING-REQUEST-CONFIG-STOP +-- TAG-SCHEDULING-REQUEST-RESOURCE-CONFIG-START + +SchedulingRequestResourceConfig ::= SEQUENCE { + schedulingRequestResourceId SchedulingRequestResourceId, + -- The ID of the SchedulingRequestConfig that uses this scheduling request resource. + schedulingRequestID SchedulingRequestId, + -- SR periodicity and offset in number of slots. Corresponds to L1 parameter 'SR-periodicity' and 'SR-offset' (see 38.213, section 9.2.2) + -- The following periodicities may be configured depending on the chosen subcarrier spacing: + -- SCS = 15 kHz: 2sym, 7sym, 1sl, 2sl, 4sl, 5sl, 8sl, 10sl, 16sl, 20sl, 40sl, 80sl + -- SCS = 30 kHz: 2sym, 7sym, 1sl, 2sl, 4sl, 8sl, 10sl, 16sl, 20sl, 40sl, 80sl, 160sl + -- SCS = 60 kHz: 2sym, 7sym/6sym, 1sl, 2sl, 4sl, 8sl, 16sl, 20sl, 40sl, 80sl, 160sl, 320sl + -- SCS = 120 kHz: 2sym, 7sym, 1sl, 2sl, 4sl, 8sl, 16sl, 40sl, 80sl, 160sl, 320sl, sl640 + -- sym6or7 corresponds to 6 symbols if extended cyclic prefix and a SCS of 60 kHz are configured, otherwise it corresponds to 7 symbols. + -- For periodicities sym2, sym7 and sl1 the UE assumes an offset of 0 slots. + periodicityAndOffset CHOICE { + sym2 NULL, + sym6or7 NULL, + sl1 NULL, -- Recurs in every slot + sl2 INTEGER (0..1), + sl4 INTEGER (0..3), + sl5 INTEGER (0..4), + sl8 INTEGER (0..7), + sl10 INTEGER (0..9), + sl16 INTEGER (0..15), + sl20 INTEGER (0..19), + sl40 INTEGER (0..39), + sl80 INTEGER (0..79), + sl160 INTEGER (0..159), + sl320 INTEGER (0..319), + sl640 INTEGER (0..639) + } OPTIONAL, -- Need M + -- ID of the PUCCH resource in which the UE shall send the scheduling request. The + -- actual PUCCH-Resource is configured in PUCCH-Config of the same UL BWP and serving cell as this SchedulingRequestResourceConfig. + -- The network configures a PUCCH-Resource of PUCCH-format0 or PUCCH-format1 + -- (other formats not supported). Corresponds to L1 parameter 'SR-resource' (see 38.213, section 9.2.2) + resource PUCCH-ResourceId OPTIONAL -- Need M +} + +-- TAG-SCHEDULING-REQUEST-RESOURCE-CONFIG-STOP +-- TAG-SCHEDULINGREQUESTRESOURCEID-START + +SchedulingRequestResourceId ::= INTEGER (1..maxNrofSR-Resources) + +-- TAG-SCHEDULINGREQUESTRESOURCEID-STOP +-- TAG-SCRAMBLING-ID-START + +ScramblingId ::= INTEGER (0..1023) + +-- TAG-SCRAMBLING-ID-STOP +-- TAG-SCS-SPECIFIC-CARRIER-START + +SCS-SpecificCarrier ::= SEQUENCE { + -- Offset in frequency domain between Point A (lowest subcarrier of common RB 0) and the lowest usable subcarrier on this carrier + -- in number of PRBs (using the subcarrierSpacing defined for this carrier). The maximum value corresponds to 275*8-1. + -- Corresponds to L1 parameter 'offset-pointA-low-scs' (see 38.211, section FFS_Section) + offsetToCarrier INTEGER (0..2199), + -- Subcarrier spacing of this carrier. It is used to convert the offsetToCarrier into an actual frequency. + -- Only the values 15 or 30 kHz (<6GHz), 60 or 120 kHz (>6GHz) are applicable. + -- Corresponds to L1 parameter 'ref-scs' (see 38.211, section FFS_Section) + subcarrierSpacing SubcarrierSpacing, + -- Corresponds to L1 parameter k0 (see 38.211, section 5.3.1). n-6 corresponds to value -6, n0 corresponds to value 0 and n6 corresponds + -- to value +6. + k0 ENUMERATED {n-6, n0, n6}, + -- Width of this carrier in number of PRBs (using the subcarrierSpacing defined for this carrier) + -- Corresponds to L1 parameter 'BW' (see 38.211, section FFS_Section) + carrierBandwidth INTEGER (1..maxNrofPhysicalResourceBlocks), + ... +} + +-- TAG-SCS-SPECIFIC-CARRIER-STOP +-- TAG-SDAP-CONFIG-START + +SDAP-Config ::= SEQUENCE { + pdu-Session PDU-SessionID, + + -- FFS: separate configuration for UL and DL + sdap-HeaderDL ENUMERATED {present, absent}, + sdap-HeaderUL ENUMERATED {present, absent}, + defaultDRB BOOLEAN, + + -- A list of QoS-Flow-IDs that the UE shall map to the DRB of this SDAP-Config. + mappedQoS-FlowsToAdd SEQUENCE (SIZE (1..maxNrofQFIs)) OF QFI OPTIONAL, -- Need N + -- A list of QoS-Flow-IDs that the UE shall no longer map to the DRB of this SDAP-Config. + mappedQoS-FlowsToRelease SEQUENCE (SIZE (1..maxNrofQFIs)) OF QFI OPTIONAL, -- Need N + ... +} + +QFI ::= INTEGER (0..maxQFI) + +PDU-SessionID ::= INTEGER (0..255) + +-- TAG-SDAP-CONFIG-STOP +-- TAG-SEARCHSPACE-START + +SearchSpace ::= SEQUENCE { + -- Identity of the search space. SearchSpaceId = 0 identifies the SearchSpace configured via PBCH (MIB) or ServingCellConfigCommon. + -- The searchSpaceId is unique among the BWPs of a Serving Cell. + searchSpaceId SearchSpaceId, + + -- The CORESET applicable for this SearchSpace. + -- Value 0 identifies the common CORESET configured in MIB and in ServingCellConfigCommon + -- Values 1..maxNrofControlResourceSets-1 identify CORESETs configured by dedicated signalling + controlResourceSetId ControlResourceSetId OPTIONAL, -- Cond SetupOnly + + -- Slots for PDCCH Monitoring configured as periodicity and offset. Corresponds to L1 parameters 'Montoring-periodicity-PDCCH-slot' and + -- 'Montoring-offset-PDCCH-slot' (see 38.213, section 10) + monitoringSlotPeriodicityAndOffset CHOICE { + sl1 NULL, + sl2 INTEGER (0..1), + sl4 INTEGER (0..3), + sl5 INTEGER (0..4), + sl8 INTEGER (0..7), + sl10 INTEGER (0..9), + sl16 INTEGER (0..15), + sl20 INTEGER (0..19) + } OPTIONAL, -- Cond Setup + + -- Symbols for PDCCH monitoring in the slots configured for PDCCH monitoring (see monitoringSlotPeriodicityAndOffset). + -- The most significant (left) bit represents the first OFDM in a slot. The least significant (right) bit represents the last symbol. + -- Corresponds to L1 parameter 'Montoring-symbols-PDCCH-within-slot' (see 38.213, section 10) + monitoringSymbolsWithinSlot BIT STRING (SIZE (14)) OPTIONAL, -- Cond Setup + + -- Number of PDCCH candidates per aggregation level. Corresponds to L1 parameter 'Aggregation-level-1' to 'Aggregation-level-8'. + -- The number of candidates and aggregation levels configured here applies to all formats unless a particular value is specified or + -- a format-specific value is provided (see inside searchSpaceType). + -- (see 38.213, section 10) + nrofCandidates SEQUENCE { + aggregationLevel1 ENUMERATED {n0, n1, n2, n3, n4, n5, n6, n8}, + aggregationLevel2 ENUMERATED {n0, n1, n2, n3, n4, n5, n6, n8}, + aggregationLevel4 ENUMERATED {n0, n1, n2, n3, n4, n5, n6, n8}, + aggregationLevel8 ENUMERATED {n0, n1, n2, n3, n4, n5, n6, n8}, + aggregationLevel16 ENUMERATED {n0, n1, n2, n3, n4, n5, n6, n8} + } OPTIONAL, -- Cond Setup + + -- Indicates whether this is a common search space (present) or a UE specific search space as well as DCI formats to monitor for. + searchSpaceType CHOICE { + -- Configures this search space as common search space (CSS) and DCI formats to monitor. + common SEQUENCE { + -- If configured, the UE monitors the DCI formats 0_0 and 1_0 with CRC scrambled by C-RNTI, CS-RNTI (if configured), + -- SP-CSI-RNTI (if configured), RA-RNTI, TC-RNTI, P-RNTI, SI-RNTI + dci-Format0-0-AndFormat1-0 SEQUENCE { + ... + } OPTIONAL, -- Need R + -- If configured, UE monitors the DCI format format 2_0 with CRC scrambled by SFI-RNTI + dci-Format2-0 SEQUENCE { + -- The number of PDCCH candidates specifically for format 2-0 for the configured aggregation level. + -- If an aggregation level is absent, the UE does not search for any candidates with that aggregation level. + -- Corresponds to L1 parameters 'SFI-Num-PDCCH-cand' and 'SFI-Aggregation-Level' (see 38.213, section 11.1.1). + nrofCandidates-SFI SEQUENCE { + aggregationLevel1 ENUMERATED {n1, n2} OPTIONAL, -- Need R + aggregationLevel2 ENUMERATED {n1, n2} OPTIONAL, -- Need R + aggregationLevel4 ENUMERATED {n1, n2} OPTIONAL, -- Need R + aggregationLevel8 ENUMERATED {n1, n2} OPTIONAL, -- Need R + aggregationLevel16 ENUMERATED {n1, n2} OPTIONAL -- Need R + }, + ... + } OPTIONAL, -- Need R + -- If configured, UE monitors the DCI format format 2_1 with CRC scrambled by INT-RNTI + dci-Format2-1 SEQUENCE { + ... + } OPTIONAL, -- Need R + -- If configured, UE monitors the DCI format 2_2 with CRC scrambled by TPC-PUSCH-RNTI or TPC-PUCCH-RNTI + dci-Format2-2 SEQUENCE { + ... + } OPTIONAL, -- Need R + -- If configured, UE monitors the DCI format 2_3 with CRC scrambled by TPC-SRS-RNTI + dci-Format2-3 SEQUENCE { + -- Monitoring periodicity of SRS PDCCH in number of slots for DCI format 2-3. + -- Corresponds to L1 parameter 'SRS-monitoring-periodicity' (see 38.212, 38.213, section 7.3.1, 11.3) + monitoringPeriodicity ENUMERATED {n1, n2, n4, n5, n8, n10, n16, n20 } OPTIONAL, -- Cond Setup + + -- The number of PDCCH candidates for DCI format 2-3 for the configured aggregation level. + -- Corresponds to L1 parameter 'SRS-Num-PDCCH-cand' (see 38.212, 38.213, section 7.3.1, 11.3) + nrofPDCCH-Candidates ENUMERATED {n1, n2}, + ... + } OPTIONAL -- Need R + }, + -- Configures this search space as UE specific search space (USS). The UE monitors the DCI format with CRC scrambled + -- by C-RNTI, CS-RNTI (if configured), TC-RNTI (if a certain condition is met), and SP-CSI-RNTI (if configured) + ue-Specific SEQUENCE { + -- Indicates whether the UE monitors in this USS for DCI formats 0-0 and 1-0 or for formats 0-1 and 1-1. + dci-Formats ENUMERATED {formats0-0-And-1-0, formats0-1-And-1-1}, + ... + } + } OPTIONAL -- Cond Setup +} +-- TAG-SEARCHSPACE-STOP +-- TAG-SEARCHSPACEID-START + +SearchSpaceId ::= INTEGER (0..maxNrofSearchSpaces-1) + +-- TAG-SEARCHSPACEID-STOP +-- TAG-SECURITY-ALGORITHM-CONFIG-START + +SecurityAlgorithmConfig ::= SEQUENCE { + cipheringAlgorithm CipheringAlgorithm, + integrityProtAlgorithm IntegrityProtAlgorithm OPTIONAL, -- Need R + ... +} + +IntegrityProtAlgorithm ::= ENUMERATED { + nia0, nia1, nia2, nia3, spare4, spare3, + spare2, spare1, ...} + +CipheringAlgorithm ::= ENUMERATED { + nea0, nea1, nea2, nea3, spare4, spare3, + spare2, spare1, ...} + +-- TAG-SECURITY-ALGORITHM-CONFIG-STOP +-- TAG-SERV-CELL-INDEX-START + +ServCellIndex ::= INTEGER (0..maxNrofServingCells-1) + +-- TAG-SERV-CELL-INDEX-STOP +-- TAG-SERVING-CELL-CONFIG-START + +ServingCellConfig ::= SEQUENCE { + -- L1 parameters: + + tdd-UL-DL-ConfigurationDedicated TDD-UL-DL-ConfigDedicated OPTIONAL, -- Cond TDD + + -- The dedicated (UE-specific) configuration for the initial downlink bandwidth-part. + initialDownlinkBWP BWP-DownlinkDedicated OPTIONAL, -- Cond ServCellAdd + + -- List of additional downlink bandwidth parts to be released. (see 38.211, 38.213, section 12). + downlinkBWP-ToReleaseList SEQUENCE (SIZE (1..maxNrofBWPs)) OF BWP-Id OPTIONAL, -- Need N + -- List of additional downlink bandwidth parts to be added or modified. (see 38.211, 38.213, section 12). + downlinkBWP-ToAddModList SEQUENCE (SIZE (1..maxNrofBWPs)) OF BWP-Downlink OPTIONAL, -- Need N + + -- If configured for an SpCell, this field contains the ID of the DL BWP to be activated upon performing the reconfiguration + -- in which it is received. If the field is absent, the RRC reconfiguration does not impose a BWP switch (corresponds to L1 + -- parameter 'active-BWP-DL-Pcell'). + -- If configured for an SCell, this field contains the ID of the downlink bandwidth part to be used upon MAC-activation of an SCell. + -- If not provided, the UE uses the default BWP. + -- The initial bandwidth part is referred to by BWP-Id = 0. + firstActiveDownlinkBWP-Id BWP-Id OPTIONAL, -- Need R + + -- The duration in ms after which the UE falls back to the default Bandwidth Part. (see 38.321, section 5.15) + -- The value 0.5 ms is only applicable for carriers >6 GHz. + -- When the network releases the timer configuration, the UE stops the timer without swithching to the default BWP. + bwp-InactivityTimer ENUMERATED {ms2, ms3, ms4, ms5, ms6, ms8, ms10, ms20, ms30, ms40,ms50, ms60, ms80, + ms100, ms200, ms300, ms500, ms750, ms1280, ms1920, ms2560, spare10, spare9, + spare8, spare7, spare6, spare5, spare4, spare3, spare2, spare1 } OPTIONAL, -- Need R + + -- Corresponds to L1 parameter 'default-DL-BWP'. The initial bandwidth part is referred to by BWP-Id = 0. + -- ID of the downlink bandwidth part to be used upon expiry of txxx. + -- This field is UE specific. When the field is absent the UE uses the the initial BWP as default BWP. + -- (see 38.211, 38.213, section 12 and 38.321, section 5.15) + defaultDownlinkBWP-Id BWP-Id OPTIONAL, -- Need M + + uplinkConfig UplinkConfig OPTIONAL, -- Cond ServCellAdd-UL + supplementaryUplink UplinkConfig OPTIONAL, -- Cond ServCellAdd-SUL + + + -- PDSCH releated parameters that are not BWP-specific. + pdsch-ServingCellConfig SetupRelease { PDSCH-ServingCellConfig } OPTIONAL, -- Need M + csi-MeasConfig SetupRelease { CSI-MeasConfig } OPTIONAL, -- Need M + + -- Includes parameters for configuration of carrier based SRS switching + -- Corresponds to L1 parameter 'SRS-CarrierSwitching' (see 38,214, section FFS_Section) + carrierSwitching SetupRelease { SRS-CarrierSwitching } OPTIONAL, -- Need M + -- MAC parameters: + sCellDeactivationTimer ENUMERATED {ms20, ms40, ms80, ms160, ms200, ms240, ms320, ms400, ms480, ms520, ms640, + ms720, ms840, ms1280, spare2,spare1} OPTIONAL, -- Cond ServingCellWithoutPUCCH + + -- Indicates whether this SCell is cross-carrier scheduled by another serving cell. + crossCarrierSchedulingConfig CrossCarrierSchedulingConfig OPTIONAL, -- Need M + + -- Timing Advance Group ID, as specified in TS 38.321 [3], which this cell belongs to. + tag-Id TAG-Id, + -- Enables the "UE beam lock function (UBF)", which disable changes to the UE beamforming configuration when in NR_RRC_CONNECTED. + -- FFS: Parameter added preliminary based on RAN4 LS in R4-1711823. Decide where to place it (maybe ServingCellConfigCommon or + -- in a BeamManagement IE??) + ue-BeamLockFunction ENUMERATED {enabled} OPTIONAL, -- Need R + + -- Indicates whether UE shall apply as pathloss reference either the downlink of PCell or of SCell that corresponds with this uplink + -- (see 38.213, section 7) + pathlossReferenceLinking ENUMERATED {pCell, sCell} OPTIONAL -- Cond SCellOnly +} + +UplinkConfig ::= SEQUENCE { + -- Configuration of UL BWPs (including BWP-specific parameters: + + -- The dedicated (UE-specific) configuration for the initial uplink bandwidth-part. + initialUplinkBWP BWP-UplinkDedicated OPTIONAL, -- Cond ServCellAdd + + -- The additional bandwidth parts for uplink. In case of TDD uplink- and downlink BWP with the same bandwidthPartId are considered + -- as a BWP pair and must have the same center frequency. + uplinkBWP-ToReleaseList SEQUENCE (SIZE (1..maxNrofBWPs)) OF BWP-Id OPTIONAL, -- Need N + uplinkBWP-ToAddModList SEQUENCE (SIZE (1..maxNrofBWPs)) OF BWP-Uplink OPTIONAL, -- Need N + + -- If configured for an SpCell, this field contains the ID of the DL BWP to be activated upon performing the reconfiguration + -- in which it is received. If the field is absent, the RRC reconfiguration does not impose a BWP switch (corresponds to + -- L1 parameter 'active-BWP-UL-Pcell'). + -- If configured for an SCell, this field contains the ID of the uplink bandwidth part to be used upon MAC-activation of an SCell. + -- If not provided, the UE uses the FFS: default BWP. + -- The initial bandwidth part is referred to by BandiwdthPartId = 0. + firstActiveUplinkBWP-Id BWP-Id OPTIONAL, -- Need R + + -- Configuration that is common across the UL BWPs: + + -- PUSCH related parameters that are not BWP-specific. + pusch-ServingCellConfig SetupRelease { PUSCH-ServingCellConfig } OPTIONAL, -- Need M + ... +} + +-- TAG-SERVING-CELL-CONFIG-STOP +-- TAG-SERVING-CELL-CONFIG-COMMON-START + +ServingCellConfigCommon ::= SEQUENCE { + physCellId PhysCellId OPTIONAL, -- Cond HOAndServCellAdd, + frequencyInfoDL FrequencyInfoDL OPTIONAL, -- Cond InterFreqHOAndServCellAdd + -- The initial downlink BWP configuration for a SpCell (PCell of MCG or SCG). + initialDownlinkBWP BWP-DownlinkCommon OPTIONAL, -- Cond ServCellAdd + + uplinkConfigCommon UplinkConfigCommon OPTIONAL, -- Cond ServCellAdd-UL + supplementaryUplinkConfig UplinkConfigCommon OPTIONAL, -- Cond ServCellAdd-SUL + + + -- Indicates the time domain positions of the transmitted SS-blocks in an SS-burst. The first/ leftmost bit corresponds to SS/PBCH + -- block index 0, the second bit corresponds to SS/PBCH block index 1, and so on. Value 0 in the bitmap indicates that the + -- corresponding SS/PBCH block is not transmitted while value 1 indicates that the corresponding SS/PBCH block is transmitted. + -- Corresponds to L1 parameter 'SSB-Transmitted' (see 38.213, section 4.1) + ssb-PositionsInBurst CHOICE { + -- bitmap for sub 3 GHz + shortBitmap BIT STRING (SIZE (4)), + -- bitmap for 3-6 GHz + mediumBitmap BIT STRING (SIZE (8)), + -- bitmap for above 6 GHz + longBitmap BIT STRING (SIZE (64)) + } OPTIONAL, -- Need R, + -- The SSB periodicity in msec for the rate matching purpose. If the field is absent, the UE applies the value ms5. + -- (see 38.211, section [7.4.3.1]) + ssb-periodicityServingCell ENUMERATED { ms5, ms10, ms20, ms40, ms80, ms160, spare2, spare1 } OPTIONAL, -- Need S + -- Position of (first) DL DM-RS (see 38.211, section 7.4.1.1.1) + dmrs-TypeA-Position ENUMERATED {pos2, pos3}, + + -- Parameters to determine an LTE CRS pattern that the UE shall rate match around. + lte-CRS-ToMatchAround SetupRelease { RateMatchPatternLTE-CRS } OPTIONAL, -- Need M + + -- Resources patterns which the UE should rate match PDSCH around. The UE rate matches around the union of all resources + -- indicated in the nested bitmaps. Rate match patterns defined here on cell level apply only to PDSCH of the same numerology. + -- Corresponds to L1 parameter 'Resource-set-cekk' (see 38.214, section 5.1.2.2.3) + rateMatchPatternToAddModList SEQUENCE (SIZE (1..maxNrofRateMatchPatterns)) OF RateMatchPattern OPTIONAL, -- Need N + rateMatchPatternToReleaseList SEQUENCE (SIZE (1..maxNrofRateMatchPatterns)) OF RateMatchPatternId OPTIONAL, -- Need N + + -- Subcarrier spacing of SSB. Used only for non-initial access (e.g. SCells, PCell of SCG). + -- If the field is absent the UE shall assume the default value of the band. + -- Only the values 15 or 30 kHz (<6GHz), 120 or 240 kHz (>6GHz) are applicable. + subcarrierSpacing SubcarrierSpacing OPTIONAL, -- Need S + -- A cell-specific TDD UL/DL configuration. Corresponds to L1 parameter 'UL-DL-configuration-common' (see 38.213, section 11.1) + tdd-UL-DL-ConfigurationCommon TDD-UL-DL-ConfigCommon OPTIONAL, -- Cond TDD + -- A second cell-specific TDD UL/DL configuration. When tdd-UL-DL-ConfigurationCommon2 is configured, the cell specific DL/UL + -- pattern is a concatenation of the pattern specified in tdd-UL-DL-ConfigurationCommon and the pattern specified in + -- tdd-UL-DL-ConfigurationCommon2. Corresponds to L1 parameter 'UL-DL-configuration-common-Set2' (see 38.211, section 11.1) + tdd-UL-DL-ConfigurationCommon2 TDD-UL-DL-ConfigCommon OPTIONAL, -- Cond TDD + -- TX power that the NW used for SSB transmission. The UE uses it to estimate the RA preamble TX power. + -- (see 38.213, section 7.4) + ss-PBCH-BlockPower INTEGER (-60..50), + ... +} + +UplinkConfigCommon ::= SEQUENCE { + -- Absolute uplink frequency configuration and subcarrier specific virtual carriers. + frequencyInfoUL FrequencyInfoUL OPTIONAL, -- Cond InterFreqHOAndServCellAdd + -- The initial uplink BWP configuration for a SpCell (PCell of MCG or SCG). Corresponds to L1 parameter 'initial-UL-BWP'. + -- (see 38.331, section FFS_Section). + initialUplinkBWP BWP-UplinkCommon OPTIONAL -- Cond ServCellAdd +} + +-- TAG-SERVING-CELL-CONFIG-COMMON-STOP +-- TAG-SINR-RANGE-START + +SINR-Range ::= INTEGER(0..127) + +-- TAG-SINR-RANGE-STOP +-- TAG-SLOTFORMATCOMBINATIONSPERCELL-START + +-- The SlotFormatCombinations applicable for one serving cell. Corresponds to L1 parameter 'cell-to-SFI' (see 38.213, section 11.1.1) +SlotFormatCombinationsPerCell ::= SEQUENCE { + -- The ID of the serving cell for which the slotFormatCombinations are applicable + servingCellId ServCellIndex, + + -- Reference subcarrier spacing for this Slot Format Combination. Corresponds to L1 parameter 'SFI-scs' (see 38.213, section FFS_Section) + subcarrierSpacing SubcarrierSpacing, + -- Reference subcarrier spacing for a Slot Format Combination on an FDD or SUL cell. + -- Corresponds to L1 parameter 'SFI-scs2' (see 38.213, section FFS_Section). + -- For FDD, subcarrierSpacing (SFI-scs) is the reference SCS for DL BWP and subcarrierSpacing2 (SFI-scs2) is the reference SCS for UL BWP. + -- For SUL, subcarrierSpacing (SFI-scs) is the reference SCS for non-SUL carrier and subcarrierSpacing2 (SFI-scs2) is the reference + -- SCS for SUL carrier. + subcarrierSpacing2 SubcarrierSpacing OPTIONAL, -- Need R + + -- A list with SlotFormatCombinations. Each SlotFormatCombination comprises of one or more SlotFormats (see 38.211, section 4.3.2) + -- FFS_CHECK: RAN1 indicates that the combinations could be of two different types... but they don't specify the second + slotFormatCombinations SEQUENCE (SIZE (1..maxNrofSlotFormatCombinationsPerSet)) OF SlotFormatCombination OPTIONAL, + + -- The (starting) position (bit) of the slotFormatCombinationId (SFI-Index) for this serving cell (servingCellId) within the DCI payload. + -- Corresponds to L1 parameter 'SFI-values' (see 38.213, section FFS_Section) + positionInDCI INTEGER(0..maxSFI-DCI-PayloadSize-1) OPTIONAL, + ... +} + +SlotFormatCombination ::= SEQUENCE { + -- This ID is used in the DCI payload to dynamically select this SlotFormatCombination. + -- Corresponds to L1 parameter 'SFI-index' (see 38.213, section FFS_Section) + slotFormatCombinationId SlotFormatCombinationId, + -- Slot formats that occur in consecutive slots in time domain order as listed here. The the slot formats are + -- defined in 38.211, table 4.3.2-3 and numbered with 0..255. + slotFormats SEQUENCE (SIZE (1..maxNrofSlotFormatsPerCombination)) OF INTEGER (0..255) +} + +-- SFI index that is assoicated with a certian slot-format-combination +-- Corresponds to L1 parameter 'SFI-index' (see 38.213, section FFS_Section) +SlotFormatCombinationId ::= INTEGER (0..maxNrofSlotFormatCombinationsPerSet-1) + +-- TAG-SLOTFORMATCOMBINATIONSPERCELL-STOP +-- TAG-SLOTFORMATINDICATOR-START + +SlotFormatIndicator ::= SEQUENCE { + -- RNTI used for SFI on the given cell + -- Corresponds to L1 parameter 'SFI-RNTI' (see 38.213, section 11.1.1) + sfi-RNTI RNTI-Value, + + -- Total length of the DCI payload scrambled with SFI-RNTI. + -- Corresponds to L1 parameter 'SFI-DCI-payload-length' (see 38.213, section 11.1.1) + dci-PayloadSize INTEGER (1..maxSFI-DCI-PayloadSize), + + -- A list of SlotFormatCombinations for the UE's serving cells. + -- Corresponds to L1 parameter 'SFI-cell-to-SFI' (see 38.213, section 11.1.1) + slotFormatCombToAddModList SEQUENCE (SIZE(1..maxNrofAggregatedCellsPerCellGroup)) OF SlotFormatCombinationsPerCell OPTIONAL, -- Need N + slotFormatCombToReleaseList SEQUENCE (SIZE(1..maxNrofAggregatedCellsPerCellGroup)) OF ServCellIndex OPTIONAL, -- Need N + ... +} + +-- TAG-SLOTFORMATINDICATOR-STOP +-- TAG-SPS-CONFIG-START + +-- Downlink SPS may be configured on the PCell as well as on SCells. But it shall not be configured for more than +-- one serving cell of a cell group at once. +SPS-Config ::= SEQUENCE { + -- Periodicity for DL SPS + -- Corresponds to L1 parameter 'semiPersistSchedIntervalDL' (see 38.214 and 38.321, section FFS_Section) + -- FFS-Value: Support also shorter periodicities for DL? + periodicity ENUMERATED {ms10, ms20, ms32, ms40, ms64, ms80, ms128, ms160, ms320, ms640, + spare6, spare5, spare4, spare3, spare2, spare1}, + -- Number of configured HARQ processes for SPS DL. Corresponds to L1 parameter 'numberOfConfSPS-Processes' (see 38.214, section FFS_Section) + nrofHARQ-Processes INTEGER (1..8), + -- HARQ resource for PUCCH for DL SPS. The network configures the resource either as format0 or format1. (see 38.214, section FFS_Section) + n1PUCCH-AN PUCCH-Resource OPTIONAL -- Need M +} + +-- TAG-SPS-CONFIG-STOP +-- TAG-SRB-IDENTITY-START + +SRB-Identity ::= INTEGER (1..3) + +-- TAG-SRB-IDENTITY-STOP +-- TAG-SRS-CONFIG-START + +SRS-Config ::= SEQUENCE { + srs-ResourceSetToReleaseList SEQUENCE (SIZE(0..maxNrofSRS-ResourceSets)) OF SRS-ResourceSetId OPTIONAL, -- Need N + srs-ResourceSetToAddModList SEQUENCE (SIZE(0..maxNrofSRS-ResourceSets)) OF SRS-ResourceSet OPTIONAL, -- Need N + + srs-ResourceToReleaseList SEQUENCE (SIZE(1..maxNrofSRS-Resources)) OF SRS-ResourceId OPTIONAL, -- Need N + srs-ResourceToAddModList SEQUENCE (SIZE(1..maxNrofSRS-Resources)) OF SRS-Resource OPTIONAL, -- Need N + + + -- If absent, UE applies TPC commands via accumulation. If disabled, UE applies the TPC command without accumulation + -- (this applies to SRS when a separate closed loop is configured for SRS) + -- Corresponds to L1 parameter 'Accumulation-enabled-srs' (see 38,213, section 7.3) + tpc-Accumulation ENUMERATED {disabled} OPTIONAL, -- Need S + ... +} + +SRS-ResourceSet ::= SEQUENCE { + -- The ID of this resource set. It is unique in the context of the BWP in which the parent SRS-Config is defined. + srs-ResourceSetId SRS-ResourceSetId, + -- The IDs of the SRS-Reosurces used in this SRS-ResourceSet + srs-ResourceIdList SEQUENCE (SIZE(1..maxNrofSRS-ResourcesPerSet)) OF SRS-ResourceId OPTIONAL, -- Cond Setup + + resourceType CHOICE { + aperiodic SEQUENCE { + -- The DCI "code point" upon which the UE shall transmit SRS according to this SRS resource set configuration. + -- Corresponds to L1 parameter 'AperiodicSRS-ResourceTrigger' (see 38.214, section 6.1.1.2) + aperiodicSRS-ResourceTrigger INTEGER (0..maxNrofSRS-TriggerStates-1), + -- ID of CSI-RS resource associated with this SRS resource set. (see 38.214, section 6.1.1.2) + csi-RS NZP-CSI-RS-ResourceId, + -- An offset in number of slots between the triggering DCI and the actual transmission of this SRS-ResourceSet. + -- If the field is absent the UE applies no offset (value 0) + slotOffset INTEGER (1..8) OPTIONAL, -- Need S + ... + }, + semi-persistent SEQUENCE { + -- ID of CSI-RS resource associated with this SRS resource set in non-codebook based operation. + -- Corresponds to L1 parameter 'SRS-AssocCSIRS' (see 38.214, section 6.2.1) + associatedCSI-RS NZP-CSI-RS-ResourceId OPTIONAL, -- Cond nonCodebook + ... + }, + periodic SEQUENCE { + -- ID of CSI-RS resource associated with this SRS resource set in non-codebook based operation. + -- Corresponds to L1 parameter 'SRS-AssocCSIRS' (see 38.214, section 6.2.1) + associatedCSI-RS NZP-CSI-RS-ResourceId OPTIONAL, -- Cond nonCodebook + ... + } + }, + -- Indicates if the SRS resource set is used for beam management vs. used for either codebook based or non-codebook based transmission. + -- Corresponds to L1 parameter 'SRS-SetUse' (see 38.214, section 6.2.1) + -- FFS_CHECK: Isn't codebook/noncodebook already known from the ulTxConfig in the SRS-Config? If so, isn't the only distinction + -- in the set between BeamManagement, AtennaSwitching and "Otherâ€? Or what happens if SRS-Config=Codebook but a Set=NonCodebook? + usage ENUMERATED {beamManagement, codebook, nonCodebook, antennaSwitching}, + + -- alpha value for SRS power control. Corresponds to L1 parameter 'alpha-srs' (see 38.213, section 7.3) + -- When the field is absent the UE applies the value 1 + alpha Alpha OPTIONAL, -- Need S + -- P0 value for SRS power control. The value is in dBm. Only even values (step size 2) are allowed. + -- Corresponds to L1 parameter 'p0-srs' (see 38.213, section 7.3) + p0 INTEGER (-202..24) OPTIONAL, -- Cond Setup + -- A reference signal (e.g. a CSI-RS config or a SSblock) to be used for SRS path loss estimation. + -- Corresponds to L1 parameter 'srs-pathlossReference-rs-config' (see 38.213, section 7.3) + pathlossReferenceRS CHOICE { + ssb-Index SSB-Index, + csi-RS-Index NZP-CSI-RS-ResourceId + } OPTIONAL, -- Need M + -- Indicates whether hsrs,c(i) = fc(i,1) or hsrs,c(i) = fc(i,2) (if twoPUSCH-PC-AdjustmentStates are configured) + -- or serarate close loop is configured for SRS. This parameter is applicable only for Uls on which UE also transmits PUSCH. + -- If absent or release, the UE applies the value sameAs-Fci1 + -- Corresponds to L1 parameter 'srs-pcadjustment-state-config' (see 38.213, section 7.3) + srs-PowerControlAdjustmentStates ENUMERATED { sameAsFci2, separateClosedLoop} OPTIONAL, -- Need S + ... +} + +SRS-ResourceSetId ::= INTEGER (0..maxNrofSRS-ResourceSets-1) + +SRS-Resource ::= SEQUENCE { + srs-ResourceId SRS-ResourceId, + nrofSRS-Ports ENUMERATED {port1, ports2, ports4}, + -- The PTRS port index for this SRS resource for non-codebook based UL MIMO. This is only applicable when the corresponding + -- PTRS-UplinkConfig is set to CP-OFDM. The ptrs-PortIndex configured here must be smaller than or equal to the maxNnrofPorts + -- configured in the PTRS-UplinkConfig. + -- Corresponds to L1 parameter 'UL-PTRS-SRS-mapping-non-CB' (see 38.214, section 6.1) + ptrs-PortIndex ENUMERATED {n0, n1 } OPTIONAL, -- Need R + -- Comb value (2 or 4) and comb offset (0..combValue-1). Corresponds to L1 parameter 'SRS-TransmissionComb' (see 38.214, section 6.2.1) + transmissionComb CHOICE { + n2 SEQUENCE { + combOffset-n2 INTEGER (0..1), + -- Cyclic shift configuration. Corresponds to L1 parameter 'SRS-CyclicShiftConfig' (see 38.214, section 6.2.1) + cyclicShift-n2 INTEGER (0..7) + }, + n4 SEQUENCE { + combOffset-n4 INTEGER (0..3), + -- Cyclic shift configuration. Corresponds to L1 parameter 'SRS-CyclicShiftConfig' (see 38.214, section 6.2.1) + cyclicShift-n4 INTEGER (0..11) + } + }, + -- OFDM symbol location of the SRS resource within a slot including number of OFDM symbols (N = 1, 2 or 4 per SRS resource), + -- startPosition (SRSSymbolStartPosition = 0..5; "0" refers to the last symbol, "1" refers to the second last symbol) and + -- RepetitionFactor (r = 1, 2 or 4). + -- Corresponds to L1 parameter 'SRS-ResourceMapping' (see 38.214, section 6.2.1 and 38.211, section 6.4.1.4). + -- FFS: Apparently, RAN1 considers replacing these three fields by a table in RAN1 specs and a corresponding index in ASN.1?! + resourceMapping SEQUENCE { + startPosition INTEGER (0..5), + nrofSymbols ENUMERATED {n1, n2, n4}, + repetitionFactor ENUMERATED {n1, n2, n4} + }, + -- Parameter(s) defining frequency domain position and configurable shift to align SRS allocation to 4 PRB grid. + -- Corresponds to L1 parameter 'SRS-FreqDomainPosition' (see 38.214, section 6.2.1) + freqDomainPosition INTEGER (0..67), + freqDomainShift INTEGER (0..268), + -- Includes parameters capturing SRS frequency hopping + -- Corresponds to L1 parameter 'SRS-FreqHopping' (see 38.214, section 6.2.1) + freqHopping SEQUENCE { + c-SRS INTEGER (0..63), + b-SRS INTEGER (0..3), + b-hop INTEGER (0..3) + }, + -- Parameter(s) for configuring group or sequence hopping + -- Corresponds to L1 parameter 'SRS-GroupSequenceHopping' (see 38.211, section FFS_Section) + groupOrSequenceHopping ENUMERATED { neither, groupHopping, sequenceHopping }, + -- Time domain behavior of SRS resource configuration. + -- Corresponds to L1 parameter 'SRS-ResourceConfigType' (see 38.214, section 6.2.1). + -- For codebook based uplink transmission, the network configures SRS resources in the same resource set with the same + -- time domain behavior on periodic, aperiodic and semi-persistent SRS. + -- FFS: Add configuration parameters for the different SRS resource types? + resourceType CHOICE { + aperiodic SEQUENCE { + ... + }, + semi-persistent SEQUENCE { + -- Periodicity and slot offset for for this SRS resource. All values in "number of slots". + -- sl1 corresponds to a periodicity of 1 slot, value sl2 corresponds to a periodicity of 2 slots, and so on. + -- For each periodicity the corresponding offset is given in number of slots. For periodicity sl1 the offset is 0 slots. + -- Corresponds to L1 parameter 'SRS-SlotConfig' (see 38.214, section 6.2.1) + periodicityAndOffset-sp SRS-PeriodicityAndOffset, + ... + }, + periodic SEQUENCE { + -- Periodicity and slot offset for for this SRS resource. All values in "number of slots" + -- sl1 corresponds to a periodicity of 1 slot, value sl2 corresponds to a periodicity of 2 slots, and so on. + -- For each periodicity the corresponding offset is given in number of slots. For periodicity sl1 the offset is 0 slots. + -- Corresponds to L1 parameter 'SRS-SlotConfig' (see 38.214, section 6.2.1) + periodicityAndOffset-p SRS-PeriodicityAndOffset, + ... + } + }, + -- Sequence ID used to initialize psedo random group and sequence hopping. + -- Corresponds to L1 parameter 'SRS-SequenceId' (see 38.214, section 6.2.1) + sequenceId BIT STRING (SIZE (10)), + + -- Configuration of the spatial relation between a reference RS and the target SRS. Reference RS can be SSB/CSI-RS/SRS + -- Corresponds to L1 parameter 'SRS-SpatialRelationInfo' (see 38.214, section 6.2.1) + spatialRelationInfo CHOICE { + ssb-Index SSB-Index, + csi-RS-Index NZP-CSI-RS-ResourceId, + srs SRS-ResourceId + } OPTIONAL, -- Need R + ... +} + +SRS-ResourceId ::= INTEGER (0..maxNrofSRS-Resources-1) + +SRS-PeriodicityAndOffset ::= CHOICE { + sl1 NULL, + sl2 INTEGER(0..1), + sl4 INTEGER(0..3), + sl5 INTEGER(0..4), + sl8 INTEGER(0..7), + sl10 INTEGER(0..9), + sl16 INTEGER(0..15), + sl20 INTEGER(0..19), + sl32 INTEGER(0..31), + sl40 INTEGER(0..39), + sl64 INTEGER(0..63), + sl80 INTEGER(0..79), + sl160 INTEGER(0..159), + sl320 INTEGER(0..319), + sl640 INTEGER(0..639), + sl1280 INTEGER(0..1279), + sl2560 INTEGER(0..2559) +} + +-- TAG-SRS-CONFIG-STOP +-- TAG-SRS-CARRIERSWITCHING-START +SRS-CarrierSwitching ::= SEQUENCE { + + -- Indicates the serving cell whose UL transmission may be interrupted during SRS transmission on a PUSCH-less cell. + -- During SRS transmission on a PUSCH-less cell, the UE may temporarily suspend the UL transmission on a serving cell with PUSCH + -- in the same CG to allow the PUSCH-less cell to transmit SRS. (see 38.214, section 6.2.1.3) + srs-SwitchFromServCellIndex INTEGER (0..31) OPTIONAL, -- Cond Setup + + -- Network configures the UE with either typeA-SRS-TPC-PDCCH-Group or typeB-SRS-TPC-PDCCH-Group, if any. + srs-TPC-PDCCH-Group CHOICE { + -- Type A trigger configuration for SRS transmission on a PUSCH-less SCell. + -- Corresponds to L1 parameter 'typeA-SRS-TPC-PDCCH-Group' (see 38.212, 38.213, section 7.3.1, 11.3) + typeA SEQUENCE (SIZE (1..32)) OF SRS-TPC-PDCCH-Config, + -- Type B trigger configuration for SRS transmission on a PUSCH-less SCell. + -- Corresponds to L1 parameter 'typeB-SRS-TPC-PDCCH-Config' (see 38.212, 38.213, section 7.3.1, 11.3) + typeB SRS-TPC-PDCCH-Config + } OPTIONAL, -- Cond Setup + + -- Maps a specific cell to a given SFI value within the DCI message + -- Corresponds to L1 parameter 'SRS-cell-to-SFI' (see 38.212, 38.213, section 7.3.1, 11.3) + srs-CellToSFI SEQUENCE (SIZE (1..maxNrofServingCells)) OF SlotFormatCombinationsPerCell OPTIONAL, -- Cond Setup + + -- A set of serving cells for monitoring PDCCH conveying SRS DCI format with CRC scrambled by TPC-SRS-RNTI + -- Corresponds to L1 parameter 'SRS-monitoring-cells' (see 38.212, 38.213, section 7.3.1, 11.3) + monitoringCells SEQUENCE (SIZE (1..maxNrofServingCells)) OF ServCellIndex OPTIONAL, -- Cond Setup + ... +} + +-- One trigger configuration for SRS-Carrier Switching. (see 38.212, 38.213, section 7.3.1, 11.3) +SRS-TPC-PDCCH-Config ::= SEQUENCE { + -- The starting bit position of a block within the group DCI with SRS request fields (optional) and TPC commands + -- for a PUSCH-less SCell. (see 38.212, 38.213, section 7.3.1, 11.3) + startingBitOfFormat2-3 INTEGER (1..31) OPTIONAL, -- Cond Setup + -- The type of a field within the group DCI with SRS request fields (optional) for a PUSCH-less SCell, + -- which indicates how many bits in the field are for SRS request (0 or 1/2). + -- Note that for Type A, there is a common SRS request field for all SCells in the set, but each SCell has its + -- own TPC command bits. See TS 38.212. Network configures this field with the same value for all PUSCH-less SCells. + -- (see 38.212, 38.213, section 7.3.1, 11.3) + fieldTypeFormat2-3 INTEGER (0..1) OPTIONAL, -- Cond Setup + -- A list of paris of [cc-SetIndex; cc-IndexInOneCC-Set] (see 38.212, 38.213, section 7.3.1, 11.3) + -- FFS: Improve description. What is a "CC"? Where is a CC-Set defined? ... + srs-CC-SetIndexlist SEQUENCE (SIZE(1..4)) OF SRS-CC-SetIndex OPTIONAL -- Cond Setup +} + +SRS-CC-SetIndex ::= SEQUENCE { + -- Indicates the CC set index for Type A associated (see 38.212, 38.213, section 7.3.1, 11.3) + cc-SetIndex INTEGER (0..3) OPTIONAL, -- Cond Setup + -- Indicates the CC index in one CC set for Type A (see 38.212, 38.213, section 7.3.1, 11.3) + cc-IndexInOneCC-Set INTEGER (0..7) OPTIONAL -- Cond Setup +} + +-- TAG-SRS-CARRIERSWITCHING-STOP +-- TAG-SSB-INDEX-START + +SSB-Index ::= INTEGER (0..63) + +-- TAG-SSB-INDEX-STOP +-- TAG-SUBCARRIER-SPACING-START + +-- The subcarrier spacing supported in NR. Restrictions applicable for certain frequencies, channels or signals are clarified +-- in the fields that use this IE. +SubcarrierSpacing ::= ENUMERATED {kHz15, kHz30, kHz60, kHz120, kHz240, spare3, spare2, spare1} + + +-- TAG-SUBCARRIER-SPACING-STOP +-- TAG-TCI-STATE-START + +TCI-State ::= SEQUENCE { + tci-StateId TCI-StateId, + qcl-Type1 QCL-Info, + qcl-Type2 QCL-Info OPTIONAL, -- Need R + nrofPTRS-Ports ENUMERATED {n1, n2} OPTIONAL, -- Need R + ... +} + +QCL-Info ::= SEQUENCE { + + -- The carrier which the RS is located in. If the field is absent, it applies to the serving cell in which the TCI-State is configured + cell ServCellIndex OPTIONAL, -- Need R + + -- The DL BWP which the RS is located in. + bwp-Id BWP-Id OPTIONAL, -- Cond CSI-RS-Indicated + -- Cond NZP-CSI-RS-Indicated: mandatory if csi-rs or csi-RS-for-tracking is included, absent otherwise + referenceSignal CHOICE { + csi-rs NZP-CSI-RS-ResourceId, + ssb SSB-Index, + -- A set of CSI-RS resources for tracking + csi-RS-for-tracking NZP-CSI-RS-ResourceSetId + }, + qcl-Type ENUMERATED {typeA, typeB, typeC, typeD}, + ... +} + +-- TAG-TCI-STATE-STOP +-- TAG-TCI-STATEID-START + +TCI-StateId ::= INTEGER (0..maxNrofTCI-States-1) + +-- TAG-TCI-STATEID-STOP +-- TAG-TDD-UL-DL-CONFIG-START + +TDD-UL-DL-ConfigCommon ::= SEQUENCE { + -- Reference SCS used to determine the time domain boundaries in the UL-DL pattern which must be common across all subcarrier specific + -- virtual carriers, i.e., independent of the actual subcarrier spacing using for data transmission. + -- Only the values 15 or 30 kHz (<6GHz), 60 or 120 kHz (>6GHz) are applicable. + -- Corresponds to L1 parameter 'reference-SCS' (see 38.211, section FFS_Section) + referenceSubcarrierSpacing SubcarrierSpacing OPTIONAL, + -- Periodicity of the DL-UL pattern. Corresponds to L1 parameter 'DL-UL-transmission-periodicity' (see 38.211, section FFS_Section) + dl-UL-TransmissionPeriodicity ENUMERATED {ms0p5, ms0p625, ms1, ms1p25, ms2, ms2p5, ms5, ms10} OPTIONAL, + + -- Number of consecutive full DL slots at the beginning of each DL-UL pattern. + -- Corresponds to L1 parameter 'number-of-DL-slots' (see 38.211, Table 4.3.2-1) + nrofDownlinkSlots INTEGER (0..maxNrofSlots) OPTIONAL, + + -- Number of consecutive DL symbols in the beginning of the slot following the last full DL slot (as derived from nrofDownlinkSlots). + -- If the field is absent or released, there is no partial-downlink slot. + -- Corresponds to L1 parameter 'number-of-DL-symbols-common' (see 38.211, section FFS_Section). + nrofDownlinkSymbols INTEGER (0..maxNrofSymbols-1) OPTIONAL, -- Need R + + -- Number of consecutive full UL slots at the end of each DL-UL pattern. + -- Corresponds to L1 parameter 'number-of-UL-slots' (see 38.211, Table 4.3.2-1) + nrofUplinkSlots INTEGER (0..maxNrofSlots) OPTIONAL, + + -- Number of consecutive UL symbols in the end of the slot preceding the first full UL slot (as derived from nrofUplinkSlots). + -- If the field is absent or released, there is no partial-uplink slot. + -- Corresponds to L1 parameter 'number-of-UL-symbols-common' (see 38.211, section FFS_Section) + nrofUplinkSymbols INTEGER (0..maxNrofSymbols-1) OPTIONAL -- Need R +} + +TDD-UL-DL-ConfigDedicated ::= SEQUENCE { + -- The slotSpecificConfiguration allows overriding UL/DL allocations provided in tdd-UL-DL-configurationCommon. + -- FFS_ASN1: Consider making this an AddMod/Release list + -- FFS_ASN1: Replace absolute numbers by variables... once RAN1 confirms. + -- FFS_CHECK: This list will grow very large if used for many slots. + slotSpecificConfigurationsToAddModList SEQUENCE (SIZE (1..maxNrofSlots)) OF TDD-UL-DL-SlotConfig OPTIONAL, -- Need N + slotSpecificConfigurationsToreleaseList SEQUENCE (SIZE (1..maxNrofSlots)) OF TDD-UL-DL-SlotIndex OPTIONAL -- Need N +} + +TDD-UL-DL-SlotConfig ::= SEQUENCE { + -- Identifies a slot within a dl-UL-TransmissionPeriodicity (given in tdd-UL-DL-configurationCommon) + slotIndex TDD-UL-DL-SlotIndex, + + -- The direction (downlink or uplink) for the symbols in this slot. "allDownlink" indicates that all symbols in this slot are used + -- for downlink; "allUplink" indicates that all symbols in this slot are used for uplink; "explicit" indicates explicitly how many symbols + -- in the beginning and end of this slot are allocated to downlink and uplink, respectively. + symbols CHOICE { + allDownlink NULL, + allUplink NULL, + explicit SEQUENCE { + -- Number of consecutive DL symbols in the beginning of the slot identified by slotIndex. + -- If the field is absent the UE assumes that there are no leading DL symbols. + -- Corresponds to L1 parameter 'number-of-DL-symbols-dedicated' (see 38.211, section FFS_Section) + nrofDownlinkSymbols INTEGER (1..maxNrofSymbols-1) OPTIONAL, -- Need S + + -- Number of consecutive UL symbols in the end of the slot identified by slotIndex. + -- If the field is absent the UE assumes that there are no trailing UL symbols. + -- Corresponds to L1 parameter 'number-of-UL-symbols-dedicated' (see 38.211, section FFS_Section) + nrofUplinkSymbols INTEGER (1..maxNrofSymbols-1) OPTIONAL -- Need S + } + } +} + +TDD-UL-DL-SlotIndex ::= INTEGER (0..maxNrofSlots-1) + +-- TAG-TDD-UL-DL-CONFIG-STOP + +TimeToTrigger ::= ENUMERATED { + ms0, ms40, ms64, ms80, ms100, ms128, ms160, ms256, + ms320, ms480, ms512, ms640, ms1024, ms1280, ms2560, + ms5120} + +-- TAG-ZP-CSI-RS-RESOURCE-START + +ZP-CSI-RS-Resource ::= SEQUENCE { + -- ZP CSI-RS resource configuration ID + -- Corresponds to L1 parameter 'ZP-CSI-RS-ResourceConfigId' (see 38.214, section 5.1.4.2) + zp-CSI-RS-ResourceId ZP-CSI-RS-ResourceId, + -- OFDM symbol and subcarrier occupancy of the ZP-CSI-RS resource within a slot + resourceMapping CSI-RS-ResourceMapping, + -- Periodicity and slot offset for periodic/semi-persistent ZP-CSI-RS + -- Corresponds to L1 parameter 'ZP-CSI-RS-timeConfig' (see 38.214, section 5.1.4.2) + periodicityAndOffset CSI-ResourcePeriodicityAndOffset OPTIONAL, --Cond PeriodicOrSemiPersistent + + ... +} + +ZP-CSI-RS-ResourceId ::= INTEGER (0..maxNrofZP-CSI-RS-Resources-1) + +-- TAG-ZP-CSI-RS-RESOURCE-STOP +-- TAG-ZP-CSI-RS-RESOURCESET-START + +ZP-CSI-RS-ResourceSet ::= SEQUENCE { + zp-CSI-RS-ResourceSetId ZP-CSI-RS-ResourceSetId, + -- The list of ZP-CSI-RS-ResourceId identifying the ZP-CSI-RS-Resource elements belonging to this set. + zp-CSI-RS-ResourceIdList SEQUENCE (SIZE(1..maxNrofZP-CSI-RS-ResourcesPerSet)) OF ZP-CSI-RS-ResourceId, + -- Time domain behavior of ZP-CSI-RS resource configuration. + -- Corresponds to L1 parameter 'ZP-CSI-RS-ResourceConfigType' (see 38.214, section 5.1.4.2) + resourceType ENUMERATED {aperiodic, semiPersistent, periodic}, + ... +} + +-- TAG-ZP-CSI-RS-RESOURCESET-STOP +-- TAG-ZP-CSI-RS-RESOURCESETID-START + +ZP-CSI-RS-ResourceSetId ::= INTEGER (0..maxNrofZP-CSI-RS-ResourceSets-1) + +-- TAG-ZP-CSI-RS-RESOURCESETID-STOP +-- TAG-BANDCOMBINATIONLIST-START + +BandCombinationList ::= SEQUENCE (SIZE (1..maxBandComb)) OF BandCombination + +BandCombination ::= SEQUENCE { + bandAndDL-ParametersList BandAndDL-ParametersList, + bandCombinationsUL BIT STRING (SIZE (1.. maxBandComb)), + bandCombinationParametersList SEQUENCE (SIZE (1..maxBandComb)) OF BandCombinationParameters OPTIONAL +} + +BandAndDL-ParametersList ::= SEQUENCE (SIZE (1..maxSimultaneousBands)) OF BandAndDL-Parameters + +BandAndDL-Parameters ::= CHOICE { + bandAndDL-ParametersEUTRA BandAndDL-ParametersEUTRA, + bandAndDL-ParametersNR BandAndDL-ParametersNR +} +BandCombinationParameters ::= SEQUENCE { + ca-ParametersNR CA-ParametersNR OPTIONAL, + mrdc-Parameters MRDC-Parameters OPTIONAL +} + +CA-ParametersNR ::= SEQUENCE { + multipleTimingAdvances ENUMERATED {supported} OPTIONAL, +-- R4 2-5: Simultaneous reception and transmission for inter band CA (TDD-TDD or TDD-FDD) + simultaneousRxTxInterBandCA ENUMERATED {supported} OPTIONAL, +-- BCS related to R4 2-1 and Updated CA BW class in R4-1803374 + supportedBandwidthCombinationSet BIT STRING (SIZE (1..32)) OPTIONAL +} + +MRDC-Parameters ::= SEQUENCE { + singleUL-Transmission ENUMERATED {supported} OPTIONAL, +-- R4 1-10: Support of EN-DC with LTE-NR coexistence in UL sharing from UE perspective + ul-SharingEUTRA-NR ENUMERATED {supported} OPTIONAL, +-- R4 1-11: Switching time between LTE UL and NR UL for EN-DC with LTE-NR coexistence in UL sharing from UE perspective + ul-SwitchingTimeEUTRA-NR ENUMERATED {type1, type2} OPTIONAL, +-- R4 2-4: Simultaneous reception and transmission for inter-band EN-DC (TDD-TDD or TDD-FDD) + simultaneousRxTxInterBandENDC ENUMERATED {supported} OPTIONAL, +-- R4 2-6: Asynchronous FDD-FDD intra-band EN-DC + asyncIntraBandENDC ENUMERATED {supported} OPTIONAL, + basebandProcesingCombinationMRDC BasebandProcessingCombinationMRDC +} + +BandAndDL-ParametersEUTRA ::= SEQUENCE { + bandEUTRA FreqBandIndicatorEUTRA, + ca-BandwidthClassDL-EUTRA CA-BandwidthClassEUTRA OPTIONAL, + intraBandContiguousCC-InfoDL-EUTRA-List SEQUENCE (SIZE (1.. maxNrofServingCellsEUTRA)) OF IntraBandContiguousCC-InfoDL-EUTRA OPTIONAL +} + +BandAndDL-ParametersNR ::= SEQUENCE { + bandNR FreqBandIndicatorNR, + ca-BandwidthClassDL CA-BandwidthClassNR OPTIONAL, +-- R4 2-3: Non-contiguous intra-band CA frequency separation class for FR2 as in the RAN4 LS R4-1803363 + intraBandFreqSeparationDL FreqSeparationClass OPTIONAL, + intraBandContiguousCC-InfoDL-List SEQUENCE (SIZE (1.. maxNrofServingCells)) OF IntraBandContiguousCC-InfoDL OPTIONAL +} + +IntraBandContiguousCC-InfoDL ::= SEQUENCE { +-- Related to RAN4 LS R2-1804078 + maxNumberMIMO-LayersPDSCH MIMO-LayersDL OPTIONAL +} + +IntraBandContiguousCC-InfoDL-EUTRA ::= SEQUENCE { +-- Related to RAN4 LS R2-1804078 + mimo-CapabilityDL ENUMERATED {twoLayers, fourLayers, eightLayers} OPTIONAL +} + +-- TAG-BANDCOMBINATIONLIST-STOP +-- TAG-BANDCOMBINATIONPARAMETERSULLIST-START + +BandCombinationParametersUL-List ::= SEQUENCE (SIZE (1..maxBandComb)) OF BandCombinationParametersUL + +BandCombinationParametersUL ::= SEQUENCE (SIZE (1.. maxSimultaneousBands)) OF BandParametersUL + +BandParametersUL ::= CHOICE { + bandParametersUL-EUTRA BandParametersUL-EUTRA, + bandParametersUL-NR BandParametersUL-NR +} + +BandParametersUL-EUTRA ::= SEQUENCE { + ca-BandwidthClassUL-EUTRA CA-BandwidthClassEUTRA OPTIONAL, + intraBandContiguousCC-InfoUL-EUTRA-List SEQUENCE (SIZE (1.. maxNrofServingCellsEUTRA)) OF IntraBandContiguousCC-InfoUL-EUTRA OPTIONAL +} + +BandParametersUL-NR ::= SEQUENCE { + ca-BandwidthClassUL CA-BandwidthClassNR OPTIONAL, +-- R4 2-3: Non-contiguous intra-band CA frequency separation class for FR2 as in the RAN4 LS R4-1803363 + intraBandFreqSeparationUL FreqSeparationClass OPTIONAL, + intraBandContiguousCC-InfoUL-List SEQUENCE (SIZE (1.. maxNrofServingCells)) OF IntraBandContiguousCC-InfoUL OPTIONAL +} + +IntraBandContiguousCC-InfoUL ::= SEQUENCE { +-- Related to RAN4 LS R2-1804078 + maxNumberMIMO-LayersCB-PUSCH MIMO-LayersUL OPTIONAL, + maxNumberMIMO-LayersNonCB-PUSCH MIMO-LayersUL OPTIONAL +} + +IntraBandContiguousCC-InfoUL-EUTRA ::= SEQUENCE { +-- Related to RAN4 LS R2-1804078 + mimo-CapabilityUL ENUMERATED {twoLayers, fourLayers} OPTIONAL +} + +-- TAG-BANDCOMBINATIONPARAMETERSULLIST-STOP +-- TAG-BASEBANDCOMBINATIONPARAMETERSULLIST-START + +BasebandCombinationParametersUL-List ::= SEQUENCE (SIZE (1..maxBasebandProcComb)) OF BasebandCombinationParametersUL + +BasebandCombinationParametersUL ::= SEQUENCE (SIZE (1..maxSimultaneousBands)) OF BasebandParametersPerBandUL + +BasebandParametersPerBandUL ::= SEQUENCE { + ca-BandwidthClassUL CA-BandwidthClassNR, + freqRange ENUMERATED {fr1, fr2}, + basebandParametersPerCC-UL SEQUENCE (SIZE (1.. maxNrofServingCells)) OF BasebandParametersPerCC-UL +} + +BasebandParametersPerCC-UL ::= SEQUENCE { +-- R4 2-2: Simultaneous reception or transmission with same or different numerologies in CA +-- It is expressed by the combination of SCS whether simultaneous RxTx is supported or not. + supportedSubcarrierSpacingUL SubcarrierSpacing, +-- Accoding to the RAN4 LS R4-1803563, maximum Bandwidth supported per CC is added in BPC +-- FFS how to work together with BCS and max BW for each CC to be defined for each CA band combination in the RAN4 spec. + supportedBandwidthUL CHOICE { + fr1 ENUMERATED {mhz5, mhz10, mhz15, mhz20, mhz25, mhz30, mhz40, mhz50, mhz60, mhz80, mhz100}, + fr2 ENUMERATED {mhz50, mhz100, mhz200, mhz400} + }, + -- R2-1800012. To be confirmed by RAN1 + scalingFactor0dot75 ENUMERATED {supported} OPTIONAL, +-- R1 2-14: Codebook based PUSCH MIMO transmission. Absence of this field implies that CB-based PUSCH is not supported. + maxNumberMIMO-LayersCB-PUSCH MIMO-LayersUL OPTIONAL, +-- R1 2-15: Non-codebook based PUSCH MIMO transmission. Absence of this field implies that Non-CB-based PUSCH is not supported. + maxNumberMIMO-LayersNonCB-PUSCH MIMO-LayersUL OPTIONAL, +-- Accoding to the RAN4 LS R4-1803563, modulation order is added per CC granularity in BPC +-- FFS whether all of modulation order specified in the spec need to be signalled. +-- FFS how to address the requirements agreed by RAN4, e.g. mandaotry w/o capabiltiy for 64QAM. mandaotry with capabiltiy for DL 256QAM in FR1. + supportedModulationOrderUL ModulationOrder OPTIONAL, +-- R1 2-53: SRS resources + supportedSRS-Resources SRS-Resources OPTIONAL, +-- R1 2-55: SRS Tx switch + srs-TxSwitch SRS-TxSwitch OPTIONAL, +-- R1 2-57: Support low latency CSI feedback + lowLatencyCSI-Feedback ENUMERATED {supported} OPTIONAL, +-- R1 5-12 & 5-12a: Up to 2/7 PUSCHs per slot for different TBs + pusch-DifferentTB-PerSlot SEQUENCE { + scs-15kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-30kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-60kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-120kHz ENUMERATED {upto2, upto7} OPTIONAL + } OPTIONAL, +-- R1 6-7: Two PUCCH group + twoPUCCH-Group ENUMERATED {supported} OPTIONAL, +-- R1 6-8: Different numerology across PUCCH groups + diffNumerologyAcrossPUCCH-Group ENUMERATED {supported} OPTIONAL, +-- R1 6-9: Different numerologies across carriers within the same PUCCH group + diffNumerologyWithinPUCCH-Group ENUMERATED {supported} OPTIONAL, +-- R1 6-10: Cross carrier scheduling + crossCarrierScheduling ENUMERATED {supported} OPTIONAL, +-- R1 6-11: Number of supported TAGs + supportedNumberTAG ENUMERATED {n2, n3, n4} OPTIONAL, +-- R1 6-18: Supplemental uplink with dynamic switch + dynamicSwitchSUL ENUMERATED {supported} OPTIONAL, +-- R1 6-19: Simultaneous transmission of SRS on an SUL/non-SUL carrier and PUSCH/PUCCH/SRS/PRACH on the other UL carrier in the same cell +-- Details on the channel/signal combination are to be described in TS 38.306 + simultaneousTxSUL-NonSUL ENUMERATED {supported} OPTIONAL, +-- R1 6-22: UL search space sharing for CA + searchSpaceSharingCA-UL ENUMERATED {supported} OPTIONAL +} + +-- TAG-BASEBANDCOMBINATIONPARAMETERSULLIST-STOP +-- TAG-BASEBANDPROCESSINGCOMBINATIONMRDC-START + +BasebandProcessingCombinationMRDC ::= SEQUENCE (SIZE (1..maxBasebandProcComb)) OF BasebandProcessingCombinationLink + +BasebandProcessingCombinationLink ::= SEQUENCE { + basebandProcessingCombinationIndexMN BasebandProcessingCombinationIndex, + basebandProcessingCombinationLinkedIndexSN SEQUENCE (SIZE (1..maxBasebandProcComb)) OF BasebandProcessingCombinationIndex +} + +BasebandProcessingCombinationIndex ::= INTEGER (1..maxBasebandProcComb) + +-- TAG-BASEBANDPROCESSINGCOMBINATIONMRDC-STOP +-- TAG-CA-BANDWIDTHCLASSNR-START + +-- Updated based on R4-1803374 +CA-BandwidthClassNR ::= ENUMERATED {a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, ...} + +-- TAG-CA-BANDWIDTHCLASSNR-STOP +-- TAG-CA-BANDWIDTHCLASSEUTRA-START + +CA-BandwidthClassEUTRA ::= ENUMERATED {a, b, c, d, e, f, ...} + +-- TAG-CA-BANDWIDTHCLASSEUTRA-STOP +-- TAG-FREQ-BAND-INDICATOR-EUTRA-START + +FreqBandIndicatorEUTRA ::= INTEGER (1..maxBandsEUTRA) + +-- TAG-FREQ-BAND-INDICATOR-EUTRA-STOP +-- TAG-FREQBANDLIST-START + +FreqBandList ::= SEQUENCE (SIZE (1..maxBandsMRDC)) OF FreqBandInformation + +FreqBandInformation ::= CHOICE { + bandEUTRA FreqBandIndicatorEUTRA, + bandNR FreqBandIndicatorNR +} + +-- TAG-FREQBANDLIST-STOP +-- TAG-FREQSEPARATIONCLASS-START + +FreqSeparationClass ::= ENUMERATED {c1, c2, c3, ...} + +-- TAG-FREQSEPARATIONCLASS-STOP +-- TAG-MIMO-LAYERS-START + +MIMO-LayersDL ::= ENUMERATED {twoLayers, fourLayers, eightLayers} + +MIMO-LayersUL ::= ENUMERATED {oneLayer, twoLayers, fourLayers} + +-- TAG-MIMO-LAYERS-STOP +-- TAG-MODULATION-ORDER-START + +ModulationOrder ::= ENUMERATED {bpsk-halfpi, bpsk, qpsk, qam16, qam64, qam256} + +-- TAG-MODULATION-ORDER-STOP +-- TAG-RAT-TYPE-START + +RAT-Type ::= ENUMERATED {nr, eutra-nr, spare2, spare1, ...} + +-- TAG-RAT-TYPE-STOP +-- TAG-SUPPORTEDBASEBANDPROCESSINGCOMBINATION-START + +SupportedBasebandProcessingCombination ::= SEQUENCE (SIZE (1..maxBasebandProcComb)) OF BasebandProcessingCombination + +BasebandProcessingCombination ::= SEQUENCE { + basebandParametersDL SEQUENCE (SIZE (1..maxSimultaneousBands)) OF BasebandParametersPerBandDL, + basebandParametersUL BIT STRING (SIZE (1..maxBasebandProcComb))} + +BasebandParametersPerBandDL ::= SEQUENCE { + ca-BandwidthClassDL CA-BandwidthClassNR, + freqRange ENUMERATED {fr1, fr2}, + basebandParametersPerCC-DL SEQUENCE (SIZE (1.. maxNrofServingCells)) OF BasebandParametersPerCC-DL +} + +BasebandParametersPerCC-DL ::= SEQUENCE { +-- R4 2-2: Simultaneous reception or transmission with same or different numerologies in CA +-- It is expressed by the combination of SCS whether simultaneous RxTx is supported or not. + supportedSubcarrierSpacingDL SubcarrierSpacing, +-- Accoding to the RAN4 LS R4-1803563, maximum Bandwidth supported per CC is added in BPC +-- FFS how to work together with BCS and max BW for each CC to be defined for each CA band combination in the RAN4 spec. + supportedBandwidthDL CHOICE { + fr1 ENUMERATED {mhz5, mhz10, mhz15, mhz20, mhz25, mhz30, mhz40, mhz50, mhz60, mhz80, mhz100}, + fr2 ENUMERATED {mhz50, mhz100, mhz200, mhz400} + }, +-- R2-1800012. To be confirmed by RAN1 + scalingFactor0dot75 ENUMERATED {supported} OPTIONAL, +-- R1 2-2: PDSCH beam switching + timeDurationForQCL SEQUENCE { + scs-60kHz ENUMERATED {s7, s14, s28} OPTIONAL, + sch-120kHz ENUMERATED {s14, s28} OPTIONAL + } OPTIONAL, +-- R1 1-10: Support of SCell without SS/PBCH block + scellWithoutSSB ENUMERATED {supported} OPTIONAL, +-- R1 1-11: Support of CSI-RS RRM measurement for SCell without SS/PBCH block + csi-RS-MeasSCellWithoutSSB ENUMERATED {supported} OPTIONAL, +-- R1 2-3: PDSCH MIMO layers. Absence of this field implies support of one layer. + maxNumberMIMO-LayersPDSCH MIMO-LayersDL OPTIONAL, +-- Accoding to the RAN4 LS R4-1803563, modulation order is added per CC granularity in BPC +-- FFS whether all of modulation order specified in the spec need to be signalled. +-- FFS how to address the requirements agreed by RAN4, e.g. mandaotry w/o capabiltiy for 64QAM. mandaotry with capabiltiy for DL 256QAM in FR1. + supportedModulationOrderDL ModulationOrder OPTIONAL, +-- R1 2-15a: Association between CSI-RS and SRS + srs-AssocCSI-RS ENUMERATED {supported} OPTIONAL, +-- R1 3-1a: For type 1 CSS with dedicated RRC configuration and for type 3 CSS, UE specific SS, CORESET resource allocation of 6RB bit-map and duration 3 OFDM symbols for FR2 + type1-3-CSS ENUMERATED {supported} OPTIONAL, +-- R1 3-5 & 3-5a: For type 1 with dedicated RRC configuration, type 3, and UE-SS,, monitoring occasion can be any OFDM symbol(s) of a slot for Case 2 (with a DCI gap) + pdcchMonitoringAnyOccasions ENUMERATED {withoutDCI-gap, withDCI-gap} OPTIONAL, +-- R1 5-1a: UE specific RRC configure UL/DL assignment + ue-SpecificUL-DL-Assignment ENUMERATED {supported} OPTIONAL, +-- R1 5-11 & 5-11a: Up to 2/7 unicast PDSCHs per slot for different TBs + pdsch-DifferentTB-PerSlot SEQUENCE { + scs-15kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-30kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-60kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-120kHz ENUMERATED {upto2, upto7} OPTIONAL + } OPTIONAL, +-- R1 6-10: Cross carrier scheduling + crossCarrierScheduling ENUMERATED {supported} OPTIONAL, +-- R1 6-21: DL search space sharing for CA + searchSpaceSharingCA-DL ENUMERATED {supported} OPTIONAL +} + +-- TAG-SUPPORTEDBASEBANDPROCESSINGCOMBINATION-STOP +-- TAG-UE-CAPABILITY-RAT-CONTAINER-LIST-START + +UE-CapabilityRAT-ContainerList ::=SEQUENCE (SIZE (0.. maxRAT-CapabilityContainers)) OF UE-CapabilityRAT-Container + +UE-CapabilityRAT-Container ::= SEQUENCE { + rat-Type RAT-Type, + ue-CapabilityRAT-Container OCTET STRING +} + +-- TAG-UE-CAPABILITY-RAT-CONTAINER-LIST-STOP +-- TAG-UE-MRDC-CAPABILITY-START + +UE-MRDC-Capability ::= SEQUENCE { + measParametersMRDC MeasParametersMRDC OPTIONAL, + rf-ParametersMRDC RF-ParametersMRDC, + phy-ParametersMRDC Phy-ParametersMRDC OPTIONAL, + generalParametersMRDC GeneralParametersMRDC-XDD-Diff OPTIONAL, + fdd-Add-UE-MRDC-Capabilities UE-MRDC-CapabilityAddXDD-Mode OPTIONAL, + tdd-Add-UE-MRDC-Capabilities UE-MRDC-CapabilityAddXDD-Mode OPTIONAL, + fr1-Add-UE-MRDC-Capabilities UE-MRDC-CapabilityAddFRX-Mode OPTIONAL, + fr2-Add-UE-MRDC-Capabilities UE-MRDC-CapabilityAddFRX-Mode OPTIONAL, + lateNonCriticalExtension OCTET STRING OPTIONAL, + nonCriticalExtension SEQUENCE {} OPTIONAL +} + +UE-MRDC-CapabilityAddXDD-Mode ::= SEQUENCE { + phy-ParametersMRDC-XDD-Diff Phy-ParametersMRDC-XDD-Diff OPTIONAL, + measParametersMRDC-XDD-Diff MeasParametersMRDC-XDD-Diff OPTIONAL, + generalParametersMRDC-XDD-Diff GeneralParametersMRDC-XDD-Diff OPTIONAL +} + +UE-MRDC-CapabilityAddFRX-Mode ::= SEQUENCE { + phy-ParametersMRDC-FRX-Diff Phy-ParametersMRDC-FRX-Diff OPTIONAL, + measParametersMRDC-FRX-Diff MeasParametersMRDC-FRX-Diff +} + +RF-ParametersMRDC ::= SEQUENCE { + supportedBandCombination BandCombinationList, + bandCombinationParametersUL-List BandCombinationParametersUL-List +} + +Phy-ParametersMRDC ::= SEQUENCE { + phy-ParametersMRDC-XDD-Diff Phy-ParametersMRDC-XDD-Diff OPTIONAL, + phy-ParametersMRDC-FRX-Diff Phy-ParametersMRDC-FRX-Diff OPTIONAL +} + +Phy-ParametersMRDC-XDD-Diff ::= SEQUENCE { +-- R1 8-1: Dynamic power sharing for LTE-NR DC + dynamicPowerSharing ENUMERATED {supported} OPTIONAL, +-- R1 6-13 & 8-2: Case 1 Single Tx UL LTE-NR DC + tdm-Pattern ENUMERATED {supported} OPTIONAL +} +Phy-ParametersMRDC-FRX-Diff ::= SEQUENCE { +-- R1 8-1: Dynamic power sharing for LTE-NR DC + dynamicPowerSharing ENUMERATED {supported} OPTIONAL, +-- R1 6-13 & 8-2: Case 1 Single Tx UL LTE-NR DC + tdm-Pattern ENUMERATED {supported} OPTIONAL +} + +MeasParametersMRDC ::= SEQUENCE { + measParametersMRDC-Common MeasParametersMRDC-Common, + measParametersMRDC-XDD-Diff MeasParametersMRDC-XDD-Diff OPTIONAL, + measParametersMRDC-FRX-Diff MeasParametersMRDC-FRX-Diff +} + +MeasParametersMRDC-Common ::= SEQUENCE { +-- R4 3-1: Independent measurement gap configurations for FR1 and FR2 + independentGapConfig ENUMERATED {supported} OPTIONAL +} + +MeasParametersMRDC-XDD-Diff ::= SEQUENCE { + sftd-MeasPSCell ENUMERATED {supported} OPTIONAL, + sftd-MeasNR-Cell ENUMERATED {supported} OPTIONAL +} + +MeasParametersMRDC-FRX-Diff ::= SEQUENCE { +-- R4 3-2: Simultaneous reception of data and SS block with different numerologies when UE conducts the serving cell measurement or intra-frequency measurement + simultaneousRxDataSSB-DiffNumerology ENUMERATED {supported} OPTIONAL +} + +GeneralParametersMRDC-XDD-Diff ::= SEQUENCE { + splitSRB-WithOneUL-Path ENUMERATED {supported} OPTIONAL, + splitDRB-withUL-Both-MCG-SCG ENUMERATED {supported} OPTIONAL, + srb3 ENUMERATED {supported} OPTIONAL +} + +-- TAG-UE-MRDC-CAPABILITY-STOP +-- TAG-UE-NR-CAPABILITY-START + +UE-NR-Capability ::= SEQUENCE { + pdcp-Parameters PDCP-Parameters, + rlc-Parameters RLC-Parameters OPTIONAL, + mac-Parameters MAC-Parameters OPTIONAL, + phy-Parameters Phy-Parameters, + rf-Parameters RF-Parameters, + measParameters MeasParameters OPTIONAL, + fdd-Add-UE-NR-Capabilities UE-NR-CapabilityAddXDD-Mode OPTIONAL, + tdd-Add-UE-NR-Capabilities UE-NR-CapabilityAddXDD-Mode OPTIONAL, + fr1-Add-UE-NR-Capabilities UE-NR-CapabilityAddFRX-Mode OPTIONAL, + fr2-Add-UE-NR-Capabilities UE-NR-CapabilityAddFRX-Mode OPTIONAL, + lateNonCriticalExtension OCTET STRING OPTIONAL, + nonCriticalExtension SEQUENCE {} OPTIONAL +} + +UE-NR-CapabilityAddXDD-Mode ::= SEQUENCE { + phy-ParametersXDD-Diff Phy-ParametersXDD-Diff OPTIONAL, + mac-ParametersXDD-Diff MAC-ParametersXDD-Diff OPTIONAL, + measParametersXDD-Diff MeasParametersXDD-Diff OPTIONAL +} + +UE-NR-CapabilityAddFRX-Mode ::= SEQUENCE { + phy-ParametersFRX-Diff Phy-ParametersFRX-Diff OPTIONAL, + measParametersFRX-Diff MeasParametersFRX-Diff OPTIONAL +} + +Phy-Parameters ::= SEQUENCE { + phy-ParametersCommon Phy-ParametersCommon OPTIONAL, + phy-ParametersXDD-Diff Phy-ParametersXDD-Diff OPTIONAL, + phy-ParametersFRX-Diff Phy-ParametersFRX-Diff OPTIONAL, + phy-ParametersFR1 Phy-ParametersFR1 OPTIONAL, + phy-ParametersFR2 Phy-ParametersFR2 OPTIONAL, + supportedBasebandProcessingCombination SupportedBasebandProcessingCombination, + basebandCombinationParametersUL-List BasebandCombinationParametersUL-List +} + +Phy-ParametersCommon ::= SEQUENCE { +-- R1 1-9: CSI-RS based CFRA for HO + csi-RS-CFRA-ForHO ENUMERATED {supported} OPTIONAL, +-- R1 2-11: Downlink dynamic PRB bundling (DL) + dynamicPRB-BundlingDL ENUMERATED {supported} OPTIONAL, +-- R1 2-32a: Semi-persistent CSI report on PUCCH + sp-CSI-ReportPUCCH ENUMERATED {supported} OPTIONAL, +-- R1 2-32b: Semi-persistent CSI report on PUSCH + sp-CSI-ReportPUSCH ENUMERATED {supported} OPTIONAL, +-- R1 2-34: NZP-CSI-RS based interference measurement + nzp-CSI-RS-IntefMgmt ENUMERATED {supported} OPTIONAL, +-- R1 2-42: Support Type II SP-CSI feedback on long PUCCH + type2-SP-CSI-Feedback-LongPUCCH ENUMERATED {supported} OPTIONAL, +-- R1 3-3: More than one CORESET per BWP (in addition to CORESET #0) + multipleCORESET ENUMERATED {supported} OPTIONAL, +-- R1 3-6: Dynamic SFI monitoring and dynamic UL/DL determination + dynamicSFI ENUMERATED {supported} OPTIONAL, +-- R1 3-7: Precoder-granularity of CORESET size + precoderGranularityCORESET ENUMERATED {supported} OPTIONAL, +-- R1 4-10: Dynamic HARQ-ACK codebook + dynamicHARQ-ACK-Codebook ENUMERATED {supported} OPTIONAL, +-- R1 4-11: Semi-static HARQ-ACK codebook + semiStaticHARQ-ACK-Codebook ENUMERATED {supported} OPTIONAL, +-- R1 4-12: HARQ-ACK spatial bundling for PUCCH or PUSCH per PUCCH group + spatialBundlingHARQ-ACK ENUMERATED {supported} OPTIONAL, +-- R1 4-21: Dynamic beta-offset configuration and indication for HARQ-ACK and/or CSI + dynamicBetaOffsetInd-HARQ-ACK-CSI ENUMERATED {supported} OPTIONAL, +-- R1 4-23: Repetitions for PUCCH format 1, 3,and 4 over multiple slots with K = 1, 2, 4, 8 + pucch-Repetition-F1-3-4 ENUMERATED {supported} OPTIONAL, +-- R1 5-2: RA type 0 for PUSCH + ra-Type0-PUSCH ENUMERATED {supported} OPTIONAL, +-- R1 5-3: Dynamic switching between RA type 0 and RA type 1 for PDSCH + dynamicSwitchRA-Type0-1-PDSCH ENUMERATED {supported} OPTIONAL, +-- R1 5-4: Dynamic switching between RA type 0 andRA type 1 for PUSCH + dynamicSwitchRA-Type0-1-PUSCH ENUMERATED {supported} OPTIONAL, +-- R1 5-6: PDSCH mapping type A with less than 7 OFDM symbols + pdsch-MappingTypeA ENUMERATED {supported} OPTIONAL, +-- R1 5-6a: PDSCH mapping type B + pdsch-MappingTypeB ENUMERATED {supported} OPTIONAL, +-- R1 5-7: Interleaving for VRB-to-PRB mapping for PDSCH + interleavingVRB-ToPRB-PDSCH ENUMERATED {supported} OPTIONAL, +-- R1 5-8: Interleaving for VRB-to-PRB mapping for PUSCH + interleavingVRB-ToPRB-PUSCH ENUMERATED {supported} OPTIONAL, +-- R1 5-10: Inter-slot frequency hopping for PUSCH + interSlotFreqHopping-PUSCH ENUMERATED {supported} OPTIONAL, +-- R1 5-13: Type 1 configured PUSCH repetitions within a slot + type1-PUSCH-RepetitionOneSlot ENUMERATED {supported} OPTIONAL, +-- R1 5-14: Type 1 configured PUSCH repetitions over multiple slots + type1-PUSCH-RepetitionMultiSlots ENUMERATED {supported} OPTIONAL, +-- R1 5-15: Type 2 configured PUSCH repetitions within a slot + type2-PUSCH-RepetitionOneSlot ENUMERATED {supported} OPTIONAL, +-- R1 5-16: Type 2 configured PUSCH repetitions over multiple slots + type2-PUSCH-RepetitionMultiSlots ENUMERATED {supported} OPTIONAL, +-- R1 5-17: PUSCH repetitions over multiple slots + pusch-RepetitionMultiSlots ENUMERATED {supported} OPTIONAL, +-- R1 5-17a: PDSCH repetitions over multiple slots + pdsch-RepetitionMultiSlots ENUMERATED {supported} OPTIONAL, +-- R1 5-18: DL SPS + downlinkSPS ENUMERATED {supported} OPTIONAL, +-- R1 5-19: Type 1 Configured UL grant + configuredUL-GrantType1 ENUMERATED {supported} OPTIONAL, +-- R1 5-20: Type 2 Configured UL grant + configuredUL-GrantType2 ENUMERATED {supported} OPTIONAL, +-- R1 5-21: Pre-emption indication for DL + pre-EmptIndication-DL ENUMERATED {supported} OPTIONAL, +-- R1 5-22 & 5-25: CBG-based re-transmission for DL/UL using CBGTI + cbg-TransIndication BIT STRING (SIZE (2)) OPTIONAL, +-- R1 5-23: CBGFI for CBG-based re-transmission for DL + cbg-FlushIndication-DL ENUMERATED {supported} OPTIONAL, +-- R1 5-24: Dynamic HARQ-ACK codebook using sub-codebooks for CBG-based re-transmission for DL + dynamicHARQ-ACK-CodeB-CBG-Retx-DL ENUMERATED {supported} OPTIONAL, +-- R1 5-26: Semi-static rate-matching resource set configuration for DL + rateMatchingResrcSetSemi-Static ENUMERATED {supported} OPTIONAL, +-- R1 5-27: Dynamic rate-matching resource set configuration for DL + rateMatchingResrcSetDynamic ENUMERATED {supported} OPTIONAL, +-- R1 5-28: Rate-matching around LTE CRS + rateMatchingLTE-CRS ENUMERATED {supported} OPTIONAL, +-- R4 1-8: BWP switching delay + bwp-SwitchingDelay ENUMERATED {type1, type2} OPTIONAL +} + +Phy-ParametersXDD-Diff ::= SEQUENCE { +-- R1 4-2: 2 PUCCH of format 0 or 2 in consecutive symbols + twoPUCCH-F0-2-ConsecSymbols ENUMERATED {supported} OPTIONAL, +-- R1 8-7: UL power control with 2 PUSCH closed loops + twoDifferentTPC-Loop-PUSCH ENUMERATED {supported} OPTIONAL, +-- R1 8-8: UL power control with 2 PUCCH closed loops + twoDifferentTPC-Loop-PUCCH ENUMERATED {supported} OPTIONAL +} + +Phy-ParametersFRX-Diff ::= SEQUENCE { +-- R1 2-6 & 2-16b: Support 1+2 DMRS (DL/UL) + oneFL-DMRS-TwoAdditionalDMRS BIT STRING (SIZE (2)) OPTIONAL, +-- R1 2-7 & 2-18: Supported 2 symbols front-loaded DMRS(DL/UL) + twoFL-DMRS BIT STRING (SIZE (2)) OPTIONAL, +-- R1 2-8 & 2-18a: Supported 2 symbols front-loaded +2 symbols additional DMRS(DL/UL) + twoFL-DMRS-TwoAdditionalDMRS BIT STRING (SIZE (2)) OPTIONAL, +-- R1 2-9 & 2-19: Support 1+3 DMRS (DL/UL) + oneFL-DMRS-ThreeAdditionalDMRS BIT STRING (SIZE (2)) OPTIONAL, +-- R1 2-10: Support DMRS type (DL) + supportedDMRS-TypeDL ENUMERATED {type1, type2} OPTIONAL, +-- R1 2-17: Support DMRS type (UL) + supportedDMRS-TypeUL ENUMERATED {type1, type2} OPTIONAL, +-- R1 2-37: Support Semi-open loop CSI + semiOpenLoopCSI ENUMERATED {supported} OPTIONAL, +-- R1 2-38: CSI report without PMI + csi-ReportWithoutPMI ENUMERATED {supported} OPTIONAL, +-- R1 2-39: CSI report with CRI + csi-ReportWithCRI ENUMERATED {supported} OPTIONAL, +-- R1 2-39a: CSI report without CQI + csi-ReportWithoutCQI ENUMERATED {supported} OPTIONAL, +-- R1 2-44 & 2-47: 1 port of DL/UL PTRS + onePortsPTRS BIT STRING (SIZE (2)) OPTIONAL, +-- R1 4-2: 2 PUCCH of format 0 or 2 in consecutive symbols + twoPUCCH-F0-2-ConsecSymbols ENUMERATED {supported} OPTIONAL, +-- R1 4-3: PUCCH format 2 over 1 – 2 OFDM symbols once per slot with FH + pucch-F2-WithFH ENUMERATED {supported} OPTIONAL, +-- R1 4-4: PUCCH format 3 over 4 – 14 OFDM symbols once per slot with FH + pucch-F3-WithFH ENUMERATED {supported} OPTIONAL, +-- R1 4-5: PUCCH format 4 over 4 – 14 OFDM symbols once per slot with FH + pucch-F4-WithFH ENUMERATED {supported} OPTIONAL, +-- R1 4-6: Non-frequency hopping for PUCCH formats 0 and 2 + freqHoppingPUCCH-F0-2 ENUMERATED {notSupported} OPTIONAL, +-- R1 4-7: Non-frequency hopping for PUCCH format 1, 3, and 4 + freqHoppingPUCCH-F1-3-4 ENUMERATED {notSupported} OPTIONAL, +-- R1 4-19: SR/HARQ-ACK/CSI multiplexing once per slot using a PUCCH (or piggybacked on a PUSCH) + mux-SR-HARQ-ACK-CSI-PUCCH ENUMERATED {supported} OPTIONAL, +-- R1 4-20: UCI code-block segmentation + uci-CodeBlockSegmentation ENUMERATED {supported} OPTIONAL, +-- R1 4-22: 1 long PUCCH format and 1 short PUCCH format in the same slot + onePUCCH-LongAndShortFormat ENUMERATED {supported} OPTIONAL, +-- R1 4-22a: 2 PUCCH transmissions in the same slot which are not covered by 4-22 and 4-2 + twoPUCCH-AnyOthersInSlot ENUMERATED {supported} OPTIONAL, +-- R1 5-9: Intra-slot frequency-hopping for PUSCH except for PUSCH scheduled by Type 1 before RRC connection + intraSlotFreqHopping-PUSCH ENUMERATED {supported} OPTIONAL, +-- R1 5-29: LBRM for PUSCH + pusch-LBRM ENUMERATED {supported} OPTIONAL, +-- R1 6-5a: PDCCH blind detection capability for CA + pdcch-BlindDetectionCA ENUMERATED {supported} OPTIONAL, +-- R1 8-3: TPC-PUSCH-RNTI + tpc-PUSCH-RNTI ENUMERATED {supported} OPTIONAL, +-- R1 8-4: TPC-PUCCH-RNTI + tpc-PUCCH-RNTI ENUMERATED {supported} OPTIONAL, +-- R1 8-5: TPC-SRS-RNTI + tpc-SRS-RNTI ENUMERATED {supported} OPTIONAL, +-- R1 8-6: Absolute TPC command mode + absoluteTPC-Command ENUMERATED {supported} OPTIONAL, +-- R1 8-7: UL power control with 2 PUSCH closed loops + twoDifferentTPC-Loop-PUSCH ENUMERATED {supported} OPTIONAL, +-- R1 8-8: UL power control with 2 PUCCH closed loops + twoDifferentTPC-Loop-PUCCH ENUMERATED {supported} OPTIONAL, +-- R4 1-6: pi/2-BPSK for PUSCH + pusch-HalfPi-BPSK ENUMERATED {supported} OPTIONAL, +-- R4 1-7: pi/2-BPSK for PUCCH format 3/4 + pucch-F3-4-HalfPi-BPSK ENUMERATED {supported} OPTIONAL, +-- R4 1-9: 1-symbol GP in unpaired spectrum + oneSymbolGP-TDD ENUMERATED {supported} OPTIONAL, +-- R4 2-7: Almost contiguous UL CP-OFDM + almostContiguousCP-OFDM-UL ENUMERATED {supported} OPTIONAL +} + +Phy-ParametersFR1 ::= SEQUENCE { +-- R1 3-2: Unicast PDCCH monitoring following Case 1-2 + pdcchMonitoringSingleOccasion ENUMERATED {supported} OPTIONAL, +-- R4 1-1: 60kHz of subcarrier spacing for FR1 + scs-60kHz ENUMERATED {supported} OPTIONAL, +-- R4 1-4: 256QAM for PDSCH in FR1 + pdsch-256QAM-FR1 ENUMERATED {supported} OPTIONAL +} + +Phy-ParametersFR2 ::= SEQUENCE { +-- R4 2-8: PA calibration gap + calibrationGapPA ENUMERATED {supported} OPTIONAL +} + +RF-Parameters ::= SEQUENCE { + supportedBandListNR SupportedBandListNR, + supportedBandCombination BandCombinationList, + bandCombinationParametersUL-List BandCombinationParametersUL-List +} + +SupportedBandListNR ::= SEQUENCE (SIZE (1..maxBands)) OF BandNR + +BandNR ::= SEQUENCE { + bandNR FreqBandIndicatorNR, +-- Modified MPR behaviour as in RAN4 LS R2-1804077, which is needed for NSA as well as SA + modifiedMPR-Behaviour BIT STRING (SIZE (8)) OPTIONAL, +-- R4 2-1: Maximum channel bandwidth supported in each band for DL and UL separately and for each SCS that UE supports within a single CC +-- RAN4 agreed that 400 MHz is optional for FR2. The other values defined for FR1/fR2 in TS 38.101 are mandatory w/o capability bit. + maxChannelBW-PerCC ENUMERATED {mhz400} OPTIONAL, + mimo-ParametersPerBand MIMO-ParametersPerBand OPTIONAL, +-- R1 0-10: Extended CP + extendedCP ENUMERATED {supported} OPTIONAL, +-- R1 0-13: Phase coherence across non-contiguous UL symbols in slot in the transmission of one channel + phaseCoherenceUL ENUMERATED {supported} OPTIONAL, +-- R1 1-10: Support of SCell without SS/PBCH block + scellWithoutSSB ENUMERATED {supported} OPTIONAL, +-- R1 1-11: Support of CSI-RS RRM measurement for SCell without SS/PBCH block + csi-RS-MeasSCellWithoutSSB ENUMERATED {supported} OPTIONAL, +-- R1 2-15a: Association between CSI-RS and SRS + srs-AssocCSI-RS ENUMERATED {supported} OPTIONAL, +-- R1 3-1a: For type 1 CSS with dedicated RRC configuration and for type 3 CSS, UE specific SS, CORESET resource allocation of 6RB bit-map and duration 3 OFDM symbols for FR2 + type1-3-CSS ENUMERATED {supported} OPTIONAL, +-- R1 3-4: More than one TCI state configurations per CORESET + multipleTCI ENUMERATED {supported} OPTIONAL, +-- R1 3-5 & 3-5a: For type 1 with dedicated RRC configuration, type 3, and UE-SS,, monitoring occasion can be any OFDM symbol(s) of a slot for Case 2 (with a DCI gap) + pdcchMonitoringAnyOccasions ENUMERATED {withoutDCI-gap, withDCI-gap} OPTIONAL, +-- R1 5-1a: UE specific RRC configure UL/DL assignment + ue-SpecificUL-DL-Assignment ENUMERATED {supported} OPTIONAL, +-- R1 5-11 & 5-11a: Up to 2/7 unicast PDSCHs per slot for different TBs + pdsch-DifferentTB-PerSlot SEQUENCE { + scs-15kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-30kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-60kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-120kHz ENUMERATED {upto2, upto7} OPTIONAL + } OPTIONAL, +-- R1 5-12 & 5-12a: Up to 2/7 PUSCHs per slot for different TBs + pusch-DifferentTB-PerSlot SEQUENCE { + scs-15kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-30kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-60kHz ENUMERATED {upto2, upto7} OPTIONAL, + scs-120kHz ENUMERATED {upto2, upto7} OPTIONAL + } OPTIONAL, +-- R1 6-2 & 6-3: Type A/B BWP adaptation (up to 2/4 BWPs) with same numerology + bwp-SameNumerology ENUMERATED {upto2, upto4} OPTIONAL, +-- R1 6-4: BWP adaptation (up to 4 BWPs) with different numerologies + bwp-DiffNumerology ENUMERATED {upto4} OPTIONAL, +-- R1 6-7: Two PUCCH group + twoPUCCH-Group ENUMERATED {supported} OPTIONAL, +-- R1 6-8: Different numerology across PUCCH groups + diffNumerologyAcrossPUCCH-Group ENUMERATED {supported} OPTIONAL, +-- R1 6-9: Different numerologies across carriers within the same PUCCH group + diffNumerologyWithinPUCCH-Group ENUMERATED {supported} OPTIONAL, +-- R1 6-10: Cross carrier scheduling + crossCarrierScheduling ENUMERATED {supported} OPTIONAL, +-- R1 6-11: Number of supported TAGs + supportedNumberTAG ENUMERATED {n2, n3, n4} OPTIONAL, +-- R1 6-19: Simultaneous transmission of SRS on an SUL/non-SUL carrier and PUSCH/PUCCH/SRS/PRACH on the other UL carrier in the same cell +-- Details on the channel/signal combination are to be described in TS 38.306 + simultaneousTxSUL-NonSUL ENUMERATED {supported} OPTIONAL, +-- R1 6-21: DL search space sharing for CA + searchSpaceSharingCA-DL ENUMERATED {supported} OPTIONAL, +-- R1 6-22: UL search space sharing for CA + searchSpaceSharingCA-UL ENUMERATED {supported} OPTIONAL, +-- R4 1-4: 256QAM for PDSCH in FR2 + pdsch-256QAM-FR2 ENUMERATED {supported} OPTIONAL, +-- R4 1-5: 256QAM for PUSCH + pusch-256QAM ENUMERATED {supported} OPTIONAL +} + +MIMO-ParametersPerBand ::= SEQUENCE { +-- R1 2-2: PDSCH beam switching + timeDurationForQCL SEQUENCE { + scs-60kHz ENUMERATED {s7, s14, s28} OPTIONAL, + sch-120kHz ENUMERATED {s14, s28} OPTIONAL + } OPTIONAL, +-- R1 2-3: PDSCH MIMO layers. Absence of this field implies support of one layer. + maxNumberMIMO-LayersPDSCH MIMO-LayersDL OPTIONAL, +-- R1 2-14: Codebook based PUSCH MIMO transmission. Absence of this field implies that CB-based PUSCH is not supported. + maxNumberMIMO-LayersCB-PUSCH MIMO-LayersUL OPTIONAL, +-- R1 2-15: Non-codebook based PUSCH MIMO transmission. Absence of this field implies that Non-CB-based PUSCH is not supported. + maxNumberMIMO-LayersNonCB-PUSCH MIMO-LayersUL OPTIONAL, +-- R1 2-4: TCI states for PDSCH + maxNumberConfiguredTCIstates ENUMERATED {n4, n8, n16, n32, n64} OPTIONAL, + maxNumberActiveTCI-PerCC ENUMERATED {n1, n2, n4, n8} OPTIONAL, +-- R1 2-13: PUSCH transmission coherence + pusch-TransCoherence ENUMERATED {nonCoherent, partialNonCoherent, fullCoherent} OPTIONAL, +-- R1 2-20: Beam correspondence + beamCorrespondence ENUMERATED {supported} OPTIONAL, +-- R1 2-21: Periodic beam report on PUCCH + periodicBeamReport ENUMERATED {supported} OPTIONAL, +-- R1 2-22: Aperiodic beam report on PUSCH + aperiodicBeamReport ENUMERATED {supported} OPTIONAL, +-- R1 2-23: Semi-persistent beam report on PUCCH + sp-BeamReportPUCCH ENUMERATED {supported} OPTIONAL, +-- R1 2-23a: Semi-persistent beam report on PUSCH + sp-BeamReportPUSCH ENUMERATED {supported} OPTIONAL, +-- R1 2-24: SSB/CSI-RS for beam management + beamManagementSSB-CSI-RS BeamManagementSSB-CSI-RS OPTIONAL, +-- R1 2-26: Receiving beam selection using CSI-RS resource repetition "ON" + maxNumberRxBeam INTEGER (2..8) OPTIONAL, +-- R1 2-27: Beam switching (including SSB and CSI-RS) + maxNumberRxTxBeamSwitchDL SEQUENCE { + scs-15kHz ENUMERATED {n4, n7, n14} OPTIONAL, + scs-30kHz ENUMERATED {n4, n7, n14} OPTIONAL, + scs-60kHz ENUMERATED {n4, n7, n14} OPTIONAL, + scs-120kHz ENUMERATED {n4, n7, n14} OPTIONAL, + scs-240kHz ENUMERATED {n4, n7, n14} OPTIONAL + } OPTIONAL, +-- R1 2-29: Non-group based beam reporting + maxNumberNonGroupBeamReporting ENUMERATED {n1, n2, n4} OPTIONAL, +-- R1 2-29a: Group based beam reporting + groupBeamReporting ENUMERATED {supported} OPTIONAL, +-- R1 2-30: UL beam management + uplinkBeamManagement SEQUENCE { + maxNumberSRS-ResourcePerSet ENUMERATED {n8, n16, n32}, + maxNumberSRS-ResourceSet INTEGER (1..8) + } OPTIONAL, +-- R1 2-31: Beam failure recovery + maxNumberCSI-RS-BFR INTEGER (1..64) OPTIONAL, + maxNumberSSB-BFR INTEGER (1..64) OPTIONAL, + maxNumberCSI-RS-SSB-BFR INTEGER (1..256) OPTIONAL, +-- R1 2-45 & 2-48: 2 ports of DL/UL PTRS + twoPortsPTRS BIT STRING (SIZE (2)) OPTIONAL, +-- R1 2-53: SRS resources + supportedSRS-Resources SRS-Resources OPTIONAL, +-- R1 2-55: SRS Tx switch + srs-TxSwitch SRS-TxSwitch OPTIONAL, +-- R1 2-54a: Simultaneous SRS Tx + maxNumberSimultaneousSRS-PerCC INTEGER (1..4) OPTIONAL, +-- R1 2-57: Support low latency CSI feedback + lowLatencyCSI-Feedback ENUMERATED {supported} OPTIONAL +} + +-- R1 2-24: SSB/CSI-RS for beam management +BeamManagementSSB-CSI-RS ::= SEQUENCE { + maxNumberSSB-CSI-RS-ResourceOneTx ENUMERATED {n8, n16, n32, n64}, + maxNumberSSB-CSI-RS-ResourceTwoTx ENUMERATED {n0, n4, n8, n16, n32, n64}, + supportedCSI-RS-Density ENUMERATED {one, three, oneAndThree} +} + +-- R1 2-53: SRS resources +SRS-Resources ::= SEQUENCE { + maxNumberAperiodicSRS-PerBWP ENUMERATED {n1, n2, n4, n8, n16}, + maxNumberAperiodicSRS-PerBWP-PerSlot INTEGER (1..6), + maxNumberPeriodicSRS-PerBWP ENUMERATED {n1, n2, n4, n8, n16}, + maxNumberPeriodicSRS-PerBWP-PerSlot INTEGER (1..6), + maxNumberSemiPersitentSRS-PerBWP ENUMERATED {n0, n1, n2, n4, n8, n16}, + maxNumberSP-SRS-PerBWP-PerSlot INTEGER (0..6), + maxNumberSRS-Ports-PerResource ENUMERATED {n1, n2, n4} +} +-- R1 2-55: SRS Tx switch +SRS-TxSwitch ::= SEQUENCE { + supportedSRS-TxPortSwitch ENUMERATED {t1r2, t1r4, t2r4, t1r4-t2r4}, + txSwitchImpactToRx ENUMERATED {true} OPTIONAL +} + +PDCP-Parameters ::= SEQUENCE { + supportedROHC-Profiles SEQUENCE { + profile0x0000 BOOLEAN, + profile0x0001 BOOLEAN, + profile0x0002 BOOLEAN, + profile0x0003 BOOLEAN, + profile0x0004 BOOLEAN, + profile0x0006 BOOLEAN, + profile0x0101 BOOLEAN, + profile0x0102 BOOLEAN, + profile0x0103 BOOLEAN, + profile0x0104 BOOLEAN + }, + maxNumberROHC-ContextSessions ENUMERATED {cs2, cs4, cs8, cs12, cs16, cs24, cs32, cs48, cs64, cs128, cs256, cs512, cs1024, cs16384, spare2, spare1}, + uplinkOnlyROHC-Profiles ENUMERATED {supported} OPTIONAL, + continueROHC-Context ENUMERATED {supported} OPTIONAL, + outOfOrderDelivery ENUMERATED {supported} OPTIONAL, + shortSN ENUMERATED {supported} OPTIONAL +} + +RLC-Parameters ::= SEQUENCE { + am-WithShortSN ENUMERATED {supported} OPTIONAL, + um-WithShortSN ENUMERATED {supported} OPTIONAL, + um-WIthLongSN ENUMERATED {supported} OPTIONAL +} + +MAC-Parameters ::= SEQUENCE { + mac-ParametersCommon MAC-ParametersCommon OPTIONAL, + mac-ParametersXDD-Diff MAC-ParametersXDD-Diff OPTIONAL +} + +MAC-ParametersCommon ::= SEQUENCE { + lcp-Restriction ENUMERATED {supported} OPTIONAL, +-- R1 4-24: PUCCH-spatialrelationinfo indication by a MAC CE per PUCCH resource + pucch-SpatialRelInfoMAC-CE ENUMERATED {supported} OPTIONAL +} + +MAC-ParametersXDD-Diff ::= SEQUENCE { + skipUplinkTxDynamic ENUMERATED {supported} OPTIONAL, + logicalChannelSR-DelayTimer ENUMERATED {supported} OPTIONAL, + longDRX-Cycle ENUMERATED {supported} OPTIONAL, + shortDRX-Cycle ENUMERATED {supported} OPTIONAL, + multipleSR-Configurations ENUMERATED {supported} OPTIONAL, + -- If supported UE supports 8 SR configurations, otherwise 1 SR config is supported. + -- Confirmation is needed whether to align the number to what the configuration signalling can support. + multipleConfiguredGrantConfigurations ENUMERATED {supported} OPTIONAL + -- If supported UE supports 16 configured grant configurations, otherwise 1 ConfiguredGrant config is supported. + -- Confirmation is needed whether to align the number to what the configuration signalling can support, and to consider whether the 16 refers + -- to the configurations or the active ones only (as they are within the BWP). +} + +MeasParameters ::= SEQUENCE { + measParametersXDD-Diff MeasParametersXDD-Diff OPTIONAL, + measParametersFRX-Diff MeasParametersFRX-Diff OPTIONAL +} + +MeasParametersXDD-Diff ::= SEQUENCE { + intraAndInterF-MeasAndReport ENUMERATED {supported} OPTIONAL, + eventA-MeasAndReport ENUMERATED {supported} OPTIONAL + -- Confirmation is needed on the need of capability/IOT signaling in LTE for support of the additional measurement gap configurations. +} + +MeasParametersFRX-Diff ::= SEQUENCE { +-- R1 1-3: SSB based SINR measurement + ss-SINR-Meas ENUMERATED {supported} OPTIONAL, +-- R1 1-5: CSI-RS based RRM measurement with associated SS-block + csi-RSRP-AndRSRQ-MeasWithSSB ENUMERATED {supported} OPTIONAL, +-- R1 1-5a: CSI-RS based RRM measurement without associated SS-block + csi-RSRP-AndRSRQ-MeasWithoutSSB ENUMERATED {supported} OPTIONAL, +-- R1 1-6: CSI-RS based SINR measurement + csi-SINR-Meas ENUMERATED {supported} OPTIONAL, +-- R1 1-7: CSI-RS based RLM + csi-RS-RLM ENUMERATED {supported} OPTIONAL +} + +-- TAG-UE-NR-CAPABILITY-STOP +-- TAG-RRC-TRANSACTIONIDENTIFIER-START + +RRC-TransactionIdentifier ::= INTEGER (0..3) + +-- TAG-RRC-TRANSACTIONIDENTIFIER-STOP +-- TAG-MULTIPLICITY-AND-TYPE-CONSTRAINT-DEFINITIONS-START + +maxBandComb INTEGER ::= 65536 -- Maximum number of DL band combinations +maxBasebandProcComb INTEGER ::= 65536 -- Maximum number of baseband processing combinations +maxNrofServingCells INTEGER ::= 32 -- Max number of serving cells (SpCell + SCells) per cell group +maxNrofServingCells-1 INTEGER ::= 31 -- Max number of serving cells (SpCell + SCells) per cell group minus 1 +maxNrofAggregatedCellsPerCellGroup INTEGER ::= 16 +maxNrofSCells INTEGER ::= 31 -- Max number of secondary serving cells per cell group +maxNrofCellMeas INTEGER ::= 32 -- Maximum number of entries in each of the cell lists in a measurement object +maxNrofSS-BlocksToAverage INTEGER ::= 16 -- Max number for the (max) number of SS blocks to average to determine cell + -- measurement +maxNrofCSI-RS-ResourcesToAverage INTEGER ::= 16 -- Max number for the (max) number of CSI-RS to average to determine cell + -- measurement +maxNrofDL-Allocations INTEGER ::= 16 -- Maximum number of PDSCH time domain resource allocations + +maxNrofSR-ConfigPerCellGroup INTEGER ::= 8 -- Maximum number of SR configurations per cell group + +maxLCG-ID INTEGER ::= 7 -- Maximum value of LCG ID +maxLC-ID INTEGER ::= 32 -- Maximum value of Logical Channel ID +maxNrofTAGs INTEGER ::= 4 -- Maximum number of Timing Advance Groups +maxNrofTAGs-1 INTEGER ::= 3 -- Maximum number of Timing Advance Groups minus 1 + +maxNrofBWPs INTEGER ::= 4 -- Maximum number of BWPs per serving cell +maxNrofSymbols-1 INTEGER ::= 13 -- Maximum index identifying a symbol within a slot (14 symbols, indexed from 0..13) +maxNrofSlots INTEGER ::= 320 -- Maximum number of slots in a 10 ms period +maxNrofSlots-1 INTEGER ::= 319 -- Maximum number of slots in a 10 ms period minus 1 + +maxNrofPhysicalResourceBlocks INTEGER ::= 275 -- Maximum number of PRBs +maxNrofPhysicalResourceBlocks-1 INTEGER ::= 274 -- Maximum number of PRBs +maxNrofControlResourceSets INTEGER ::= 12 -- Max number of CoReSets configurable on a serving cell +maxNrofControlResourceSets-1 INTEGER ::= 11 -- Max number of CoReSets configurable on a serving cell minus 1 +maxCoReSetDuration INTEGER ::= 3 -- Max number of OFDM symbols in a control resource set +maxNrofSearchSpaces INTEGER ::= 40 -- Max number of Search Spaces +maxNrofSearchSpaces-1 INTEGER ::= 39 -- Max number of Search Spaces minus 1 +maxSFI-DCI-PayloadSize INTEGER ::= 128 -- Max number payload of a DCI scrambled with SFI-RNTI +maxSFI-DCI-PayloadSize-1 INTEGER ::= 127 -- Max number payload of a DCI scrambled with SFI-RNTI minus 1 +maxINT-DCI-PayloadSize INTEGER ::= 126 -- Max number payload of a DCI scrambled with INT-RNTI +maxINT-DCI-PayloadSize-1 INTEGER ::= 125 -- Max number payload of a DCI scrambled with INT-RNTI minus 1 +maxNrofRateMatchPatterns INTEGER ::= 4 -- Max number of rate matching patterns that may be configured +maxNrofRateMatchPatterns-1 INTEGER ::= 3 -- Max number of rate matching patterns that may be configured minus 1 + +maxNrofCSI-ReportConfigurations INTEGER ::= 48 -- Maximum number of report configurations +maxNrofCSI-ReportConfigurations-1 INTEGER ::= 47 -- Maximum number of report configurations minus 1 + +maxNrofCSI-ResourceConfigurations INTEGER ::= 112 -- Maximum number of resource configurations +maxNrofCSI-ResourceConfigurations-1 INTEGER ::= 111 -- Maximum number of resource configurations minus 1 + +maxNrofAP-CSI-RS-ResourcesPerSet INTEGER ::= 16 +maxNrOfCSI-AperiodicTriggers INTEGER ::= 128 -- Maximum number of triggers for aperiodic CSI reporting +maxNrofReportConfigPerAperiodicTrigger INTEGER ::= 16 -- Maximum number of report configurations per trigger state for aperiodic reporting + +maxNrofNZP-CSI-RS-Resources INTEGER ::= 192 -- Maximum number of Non-Zero-Power (NZP) CSI-RS resources +maxNrofNZP-CSI-RS-Resources-1 INTEGER ::= 191 -- Maximum number of Non-Zero-Power (NZP) CSI-RS resources minus 1 +maxNrofNZP-CSI-RS-ResourcesPerSet INTEGER ::= 64 -- Maximum number of NZP CSI-RS resources per resource set +maxNrofNZP-CSI-RS-ResourceSetsPerConfig INTEGER ::= 16 -- Maximum number of resource sets per resource configuration + +maxNrofZP-CSI-RS-Resources INTEGER ::= 32 -- Maximum number of Zero-Power (NZP) CSI-RS resources +maxNrofZP-CSI-RS-Resources-1 INTEGER ::= 31 -- Maximum number of Zero-Power (NZP) CSI-RS resources minus 1 +maxNrofZP-CSI-RS-ResourceSets-1 INTEGER ::= 16 +maxNrofZP-CSI-RS-ResourcesPerSet INTEGER ::= 16 +maxNrofZP-CSI-RS-Sets INTEGER ::= 16 + +maxNrofCSI-IM-Resources INTEGER ::= 32 -- Maximum number of CSI-IM resources. See CSI-IM-ResourceMax in 38.214. +maxNrofCSI-IM-Resources-1 INTEGER ::= 31 -- Maximum number of CSI-IM resources minus 1. See CSI-IM-ResourceMax in 38.214. +maxNrofCSI-IM-ResourcesPerSet INTEGER ::= 8 -- Maximum number of CSI-IM resources per set. See CSI-IM-ResourcePerSetMax in 38.214 +maxNrofCSI-IM-ResourceSetsPerConfig INTEGER ::= 16 -- Maximum number of CSI IM resource sets per resource configuration + +maxNrofSSB-Resources-1 INTEGER ::= 63 -- Maximum number of SSB resources in a resource set minus 1 +maxNrofCSI-SSB-ResourcePerSet INTEGER ::= 64 +maxNrofCSI-SSB-ResourceSetsPerConfig INTEGER ::= 1 -- Maximum number of CSI SSB resource sets per resource configuration + +maxNrofFailureDetectionResources INTEGER ::= 10 -- Maximum number of failure detection resources + +maxNrofObjectId INTEGER ::= 64 -- Maximum number of measurement objects +maxNrofPCI-Ranges INTEGER ::= 8 -- Maximum number of PCI ranges +maxNrofCSI-RS-ResourcesRRM INTEGER ::= 96 -- Maximum number of CSI-RS resources for an RRM measurement object +maxNrofCSI-RS-ResourcesRRM-1 INTEGER ::= 95 -- Maximum number of CSI-RS resources for an RRM measurement object minus 1 +maxNrofMeasId INTEGER ::= 64 -- Maximum number of configured measurements +maxNrofQuantityConfig INTEGER ::= 2 -- Maximum number of quantity configurations +maxNrofCSI-RS-CellsRRM INTEGER ::= 96 -- Maximum number of FFS + +maxNrofSRS-ResourceSets INTEGER ::= 16 -- Maximum number of SRS resource sets in a BWP. +maxNrofSRS-ResourceSets-1 INTEGER ::= 15 -- Maximum number of SRS resource sets in a BWP minus 1. +maxNrofSRS-Resources INTEGER ::= 64 -- Maximum number of SRS resources in an SRS resource set. +maxNrofSRS-Resources-1 INTEGER ::= 63 -- Maximum number of SRS resources in an SRS resource set minus 1. +maxNrofSRS-TriggerStates-1 INTEGER ::= 3 -- Maximum number of SRS trigger states minus 1, i.e., the largest code point. +maxRAT-CapabilityContainers INTEGER ::= 8 -- Maximum number of interworking RAT containers (incl NR and MRDC) +maxSimultaneousBands INTEGER ::= 32 -- Maximum number of simultaneously aggregated bands + + +maxNrofSlotFormatCombinationsPerCell INTEGER ::= 16 -- Maximum number of +maxNrofSlotFormatCombinationsPerSet INTEGER ::= 4096 -- Maximum number of Slot Format Combinations in a SF-Set. +maxNrofSlotFormatCombinationsPerSet-1 INTEGER ::= 4095 -- Maximum number of Slot Format Combinations in a SF-Set minus 1. +maxNrofPUCCH-Resources INTEGER ::= 128 +maxNrofPUCCH-Resources-1 INTEGER ::= 127 +maxNrofPUCCH-ResourceSets INTEGER ::= 4 -- Maximum number of PUCCH Resource Sets +maxNrofPUCCH-ResourceSets-1 INTEGER ::= 3 -- Maximum number of PUCCH Resource Sets minus 1. +maxNrofPUCCH-ResourcesPerSet INTEGER ::= 32 -- Maximum number of PUCCH Resources per PUCCH-ResourceSet +maxNrofPUCCH-ResourcesPerSet-1 INTEGER ::= 31 -- Maximum number of PUCCH Resources per PUCCH-ResourceSet minus 1. +maxNrofPUCCH-P0-PerSet INTEGER ::= 8 -- Maximum number of P0-pucch present in a p0-pucch set +maxNrofPUCCH-PathlossReferenceRSs INTEGER ::= 4 -- Maximum number of RSs used as pathloss reference for PUCCH power control. +maxNrofPUCCH-PathlossReferenceRSs-1 INTEGER ::= 3 -- Maximum number of RSs used as pathloss reference for PUCCH power control minus 1. + +maxNrofP0-PUSCH-AlphaSets INTEGER ::= 30 -- Maximum number of P0-pusch-alpha-sets (see 38,213, section 7.1) +maxNrofP0-PUSCH-AlphaSets-1 INTEGER ::= 29 -- Maximum number of P0-pusch-alpha-sets minus 1 (see 38,213, section 7.1) +maxNrofPUSCH-PathlossReferenceRSs INTEGER ::= 4 -- Maximum number of RSs used as pathloss reference for PUSCH power control. +maxNrofPUSCH-PathlossReferenceRSs-1 INTEGER ::= 3 -- Maximum number of RSs used as pathloss reference for PUSCH power control minus 1. + +maxBands INTEGER ::= 1024 -- Maximum number of supported bands in UE capability. +maxBandsMRDC INTEGER ::= 1280 +maxBandsEUTRA INTEGER ::= 256 +maxCellPrep INTEGER ::= 32 +maxCellReport INTEGER ::= 8 +maxDRB INTEGER ::= 29 -- Maximum number of DRBs (that can be added in DRB-ToAddModLIst). +maxFreq INTEGER ::= 8 -- Max number of non-serving frequencies in MeasResultSCG-Failure. +maxNrofCSI-RS INTEGER ::= 64 +maxNrofCandidateBeams INTEGER ::= 16 -- Max number of PRACH-ResourceDedicatedBFR that in BFR config. +maxNrofPCIsPerSMTC INTEGER ::= 64 -- Maximun number of PCIs per SMTC. +maxNrofQFIs INTEGER ::= 64 +maxNrofSR-Resources INTEGER ::= 8 -- Maximum number of SR resources per BWP in a cell. +maxNrofSlotFormatsPerCombination INTEGER ::= 256 +maxNrofSpatialRelationInfos INTEGER ::= 8 +maxNrofSRS-ResourcesPerSet INTEGER ::= 16 +maxNrofIndexesToReport INTEGER ::= 32 +maxNrofSSBs INTEGER ::= 64 -- Maximum number of SSB resources in a resource set. +maxNrofSSBs-1 INTEGER ::= 63 -- Maximum number of SSB resources in a resource set minus 1. + +maxNrofTCI-StatesPDCCH INTEGER ::= 64 +maxNrofTCI-States INTEGER ::= 64 -- Maximum number of TCI states. +maxNrofTCI-States-1 INTEGER ::= 63 -- Maximum number of TCI states minus 1. +maxNrofUL-Allocations INTEGER ::= 16 -- Maximum number of PUSCH time domain resource allocations. +maxQFI INTEGER ::= 63 +maxRA-CSIRS-Resources INTEGER ::= 96 +maxRA-OccasionsPerCSIRS INTEGER ::= 64 -- Maximum number of RA occasions for one CSI-RS +maxRA-Occasions-1 INTEGER ::= 511 -- Maximum number of RA occasions in the system +maxRA-SSB-Resources INTEGER ::= 64 +maxSCSs INTEGER ::= 5 +maxSecondaryCellGroups INTEGER ::= 3 +maxNrofServingCellsEUTRA INTEGER ::= 32 +maxMBSFN-Allocations INTEGER ::= 8 +maxNrofMultiBands INTEGER ::= 8 +maxCellSFTD INTEGER ::= 3 -- Maximum number of cells for SFTD reporting +maxReportConfigId INTEGER ::= 64 + +maxNrofSRI-PUSCH-Mappings INTEGER ::= 16 +maxNrofSRI-PUSCH-Mappings-1 INTEGER ::= 15 + +-- Editor’s Note: Targeted for completion in June 2018. Not used in EN-DC drop. +CellIdentity ::= ENUMERATED {ffsTypeAndValue} +ShortMAC-I ::= ENUMERATED {ffsTypeAndValue} + +-- TAG-MULTIPLICITY-AND-TYPE-CONSTRAINT-DEFINITIONS-STOP + +END + + +NR-UE-Variables DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + MeasId, + MeasIdToAddModList, + MeasObjectToAddModList, + PhysCellId, + ReportConfigToAddModList, + RSRP-Range, + QuantityConfig, + maxNrofCellMeas, + maxNrofMeasId +FROM NR-RRC-Definitions; + +-- TAG-VAR-MEAS-CONFIG-START + +VarMeasConfig ::= SEQUENCE { + -- Measurement identities + measIdList MeasIdToAddModList OPTIONAL, + -- Measurement objects + measObjectList MeasObjectToAddModList OPTIONAL, + -- Reporting configurations + reportConfigList ReportConfigToAddModList OPTIONAL, + -- Other parameters + quantityConfig QuantityConfig OPTIONAL, + + s-MeasureConfig CHOICE { + ssb-RSRP RSRP-Range, + csi-RSRP RSRP-Range + } OPTIONAL + +} + +-- TAG-VAR-MEAS-CONFIG-STOP +-- TAG-VAR-MEAS-REPORT-START + +VarMeasReportList ::= SEQUENCE (SIZE (1..maxNrofMeasId)) OF VarMeasReport + +VarMeasReport ::= SEQUENCE { + -- List of measurement that have been triggered + measId MeasId, + cellsTriggeredList CellsTriggeredList OPTIONAL, + numberOfReportsSent INTEGER +} + +CellsTriggeredList ::= SEQUENCE (SIZE (1..maxNrofCellMeas)) OF CHOICE { + physCellId PhysCellId, +-- Not needed for EN-DC. + physCellIdEUTRA ENUMERATED {ffsTypeAndValue} + } + + +-- TAG-VAR-MEAS-REPORT-STOP + +END + +-- TAG_NR-INTER-NODE-DEFINITIONS-START + +NR-InterNodeDefinitions DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + ARFCN-ValueNR, + CellIdentity, + CSI-RS-Index, + GapConfig, + maxBandComb, + maxBasebandProcComb, + maxNrofSCells, + maxNrofIndexesToReport, + MeasQuantityResults, + MeasResultSCG-Failure, + MeasResultCellListSFTD, + P-Max, + PhysCellId, + RadioBearerConfig, + RRCReconfiguration, + ServCellIndex, + SSB-Index, + ShortMAC-I, + UE-CapabilityRAT-ContainerList +FROM NR-RRC-Definitions; + +-- TAG_NR-INTER-NODE-DEFINITIONS-STOP +-- TAG-HANDOVER-COMMAND-START + +HandoverCommand ::= SEQUENCE { + criticalExtensions CHOICE { + c1 CHOICE{ + handoverCommand HandoverCommand-IEs, + spare3 NULL, spare2 NULL, spare1 NULL + }, + criticalExtensionsFuture SEQUENCE {} + } +} + +HandoverCommand-IEs ::= SEQUENCE { + handoverCommandMessage OCTET STRING (CONTAINING RRCReconfiguration), + nonCriticalExtension SEQUENCE {} OPTIONAL +} + +-- TAG-HANDOVER-COMMAND-STOP +-- TAG-HANDOVER-PREPARATION-INFORMATION-START + +HandoverPreparationInformation ::= SEQUENCE { + criticalExtensions CHOICE { + c1 CHOICE{ + handoverPreparationInformation HandoverPreparationInformation-IEs, + spare3 NULL, spare2 NULL, spare1 NULL + }, + criticalExtensionsFuture SEQUENCE {} + } +} + +HandoverPreparationInformation-IEs ::= SEQUENCE { + ue-CapabilityRAT-List UE-CapabilityRAT-ContainerList, + sourceConfig OCTET STRING (CONTAINING RRCReconfiguration), + rrm-Config RRM-Config OPTIONAL, + as-Context AS-Context OPTIONAL, + nonCriticalExtension SEQUENCE {} OPTIONAL +} + +AS-Context ::= SEQUENCE { + reestablishmentInfo SEQUENCE { + sourcePhysCellId PhysCellId, + targetCellShortMAC-I ShortMAC-I, + additionalReestabInfoList ReestabNCellInfoList OPTIONAL + } OPTIONAL, + -- FFS Whether to change e.g. move all re-establishment info to Xx + configRestrictInfo ConfigRestrictInfoSCG OPTIONAL, + ... +} + +ReestabNCellInfoList ::= SEQUENCE ( SIZE (1..maxCellPrep) ) OF ReestabNCellInfo + +ReestabNCellInfo::= SEQUENCE{ + cellIdentity CellIdentity, + key-gNodeB-Star BIT STRING (SIZE (256)), + shortMAC-I ShortMAC-I +} + +RRM-Config ::= SEQUENCE { + ue-InactiveTime ENUMERATED { + s1, s2, s3, s5, s7, s10, s15, s20, + s25, s30, s40, s50, min1, min1s20c, min1s40, + min2, min2s30, min3, min3s30, min4, min5, min6, + min7, min8, min9, min10, min12, min14, min17, min20, + min24, min28, min33, min38, min44, min50, hr1, + hr1min30, hr2, hr2min30, hr3, hr3min30, hr4, hr5, hr6, + hr8, hr10, hr13, hr16, hr20, day1, day1hr12, day2, + day2hr12, day3, day4, day5, day7, day10, day14, day19, + day24, day30, dayMoreThan30} OPTIONAL , + candidateCellInfoList CandidateCellInfoList OPTIONAL, + ... +} + +-- TAG-HANDOVER-PREPARATION-INFORMATION-STOP +-- TAG-CG-CONFIG-START + +CG-Config ::= SEQUENCE { + criticalExtensions CHOICE { + c1 CHOICE{ + cg-Config CG-Config-IEs, + spare3 NULL, spare2 NULL, spare1 NULL + }, + criticalExtensionsFuture SEQUENCE {} + } +} + +CG-Config-IEs ::= SEQUENCE { + scg-CellGroupConfig OCTET STRING (CONTAINING RRCReconfiguration) OPTIONAL, + scg-RB-Config OCTET STRING (CONTAINING RadioBearerConfig) OPTIONAL, + configRestrictModReq ConfigRestrictModReqSCG OPTIONAL, + drx-InfoSCG DRX-Info OPTIONAL, + candidateCellInfoListSN OCTET STRING (CONTAINING CandidateCellInfoList) OPTIONAL, + measConfigSN MeasConfigSN OPTIONAL, + selectedBandCombinationNR BandCombinationIndex OPTIONAL, + nonCriticalExtension SEQUENCE {} OPTIONAL +} + +MeasConfigSN ::= SEQUENCE { + measuredFrequenciesFR1 SEQUENCE (SIZE (1..maxMeasFreqsMN)) OF NR-FreqInfo OPTIONAL, + ... +} + +NR-FreqInfo ::= SEQUENCE { + measuredFrequency ARFCN-ValueNR OPTIONAL, + ... +} + +ConfigRestrictModReqSCG ::= SEQUENCE { + requestedBC-MRDC BandCombinationIndex OPTIONAL, + requestedBPC-ListMRDC BPC-IndexList OPTIONAL, + requestedP-MaxFR1 P-Max OPTIONAL, + ... +} + +BandCombinationIndex ::= INTEGER (1..maxBandComb) + +-- TAG-CG-CONFIG-STOP +-- TAG-CG-CONFIG-INFO-START + +CG-ConfigInfo ::= SEQUENCE { + criticalExtensions CHOICE { + c1 CHOICE{ + cg-ConfigInfo CG-ConfigInfo-IEs, + spare3 NULL, spare2 NULL, spare1 NULL + }, + criticalExtensionsFuture SEQUENCE {} + } +} + +CG-ConfigInfo-IEs ::= SEQUENCE { + ue-CapabilityInfo OCTET STRING (CONTAINING UE-CapabilityRAT-ContainerList) OPTIONAL,-- Cond SN-Addition + candidateCellInfoListMN CandidateCellInfoList OPTIONAL, + candidateCellInfoListSN OCTET STRING (CONTAINING CandidateCellInfoList) OPTIONAL, + measResultCellListSFTD MeasResultCellListSFTD OPTIONAL, + scgFailureInfo SEQUENCE { + failureType ENUMERATED { t310-Expiry, randomAccessProblem, + rlc-MaxNumRetx, scg-ChangeFailure, + scg-reconfigFailure, + srb3-IntegrityFailure}, + measResultSCG OCTET STRING (CONTAINING MeasResultSCG-Failure) + } OPTIONAL, + configRestrictInfo ConfigRestrictInfoSCG OPTIONAL, + drx-InfoMCG DRX-Info OPTIONAL, + measConfigMN MeasConfigMN OPTIONAL, + sourceConfigSCG OCTET STRING (CONTAINING RRCReconfiguration) OPTIONAL, + scg-RB-Config OCTET STRING (CONTAINING RadioBearerConfig) OPTIONAL, + mcg-RB-Config OCTET STRING (CONTAINING RadioBearerConfig) OPTIONAL, + nonCriticalExtension SEQUENCE {} OPTIONAL +} + +ConfigRestrictInfoSCG ::= SEQUENCE { + allowedBC-ListMRDC BandCombinationIndexList OPTIONAL, + allowedBPC-ListMRDC BPC-IndexList OPTIONAL, + powerCoordination-FR1 SEQUENCE { + p-maxNR P-Max OPTIONAL, + p-maxEUTRA P-Max OPTIONAL + } OPTIONAL, + servCellIndexRangeSCG SEQUENCE { + lowBound ServCellIndex, + upBound ServCellIndex + } OPTIONAL, -- Cond SN-Addition + maxMeasFreqsSCG-NR INTEGER(1..maxMeasFreqsMN) OPTIONAL, + ... +} + +BandCombinationIndexList ::= SEQUENCE (SIZE (1..maxBandComb)) OF BandCombinationIndex + +BPC-IndexList ::= SEQUENCE (SIZE (1..maxBasebandProcComb)) OF BPC-Index +BPC-Index ::= INTEGER (1..maxBasebandProcComb) + +DRX-Info ::= SEQUENCE { + drx-LongCycleStartOffset CHOICE { + ms10 INTEGER(0..9), + ms20 INTEGER(0..19), + ms32 INTEGER(0..31), + ms40 INTEGER(0..39), + ms60 INTEGER(0..59), + ms64 INTEGER(0..63), + ms70 INTEGER(0..69), + ms80 INTEGER(0..79), + ms128 INTEGER(0..127), + ms160 INTEGER(0..159), + ms256 INTEGER(0..255), + ms320 INTEGER(0..319), + ms512 INTEGER(0..511), + ms640 INTEGER(0..639), + ms1024 INTEGER(0..1023), + ms1280 INTEGER(0..1279), + ms2048 INTEGER(0..2047), + ms2560 INTEGER(0..2559), + ms5120 INTEGER(0..5119), + ms10240 INTEGER(0..10239) + }, + shortDRX SEQUENCE { + drx-ShortCycle ENUMERATED { + ms2, ms3, ms4, ms5, ms6, ms7, ms8, ms10, ms14, ms16, ms20, ms30, ms32, + ms35, ms40, ms64, ms80, ms128, ms160, ms256, ms320, ms512, ms640, spare9, + spare8, spare7, spare6, spare5, spare4, spare3, spare2, spare1 }, + drx-ShortCycleTimer INTEGER (1..16) + } OPTIONAL +} + +MeasConfigMN ::= SEQUENCE { + measuredFrequenciesMN SEQUENCE (SIZE (1..maxMeasFreqsMN)) OF NR-FreqInfo OPTIONAL, + measGapConfigFR1 GapConfig OPTIONAL, + gapPurpose ENUMERATED {perUE, perFR1} OPTIONAL, + ... +} + + +-- TAG-CG-CONFIG-INFO-STOP +-- TAG-MEASUREMENT-TIMING-CONFIGURATION-START + +MeasurementTimingConfiguration ::= SEQUENCE { + criticalExtensions CHOICE { + c1 CHOICE{ + measTimingConf MeasurementTimingConfiguration-IEs, + spare3 NULL, spare2 NULL, spare1 NULL + }, + criticalExtensionsFuture SEQUENCE {} + } +} + +MeasurementTimingConfiguration-IEs ::= SEQUENCE { + measTiming MeasTimingList OPTIONAL, + nonCriticalExtension SEQUENCE {} OPTIONAL +} + +MeasTimingList ::= SEQUENCE (SIZE (1..maxMeasFreqsMN)) OF MeasTiming + +MeasTiming ::= SEQUENCE { + carrierFreq ARFCN-ValueNR OPTIONAL, + ssb-MeasurementTimingConfiguration ENUMERATED {ffsTypeAndValue} OPTIONAL, + ... +} + +-- TAG-MEASUREMENT-TIMING-CONFIGURATION-STOP +-- TAG-CANDIDATE-CELL-INFO-LIST-START + +CandidateCellInfoList ::= SEQUENCE (SIZE (1.. maxNrofSCells)) OF CandidateCellInfo + +CandidateCellInfo ::= SEQUENCE { + cellIdentification SEQUENCE { + physCellId PhysCellId, + dl-CarrierFreq ARFCN-ValueNR + }, + measResultCell MeasQuantityResults OPTIONAL, + candidateRS-IndexListSSB CandidateRS-IndexInfoListSSB OPTIONAL, + candidateRS-IndexListCSI-RS CandidateRS-IndexInfoListCSI-RS OPTIONAL, + ... +} + +CandidateRS-IndexInfoListSSB ::= SEQUENCE (SIZE (1..maxNrofIndexesToReport)) OF CandidateRS-IndexInfoSSB + +CandidateRS-IndexInfoSSB ::= SEQUENCE { + ssb-Index SSB-Index, + measResultSSB MeasQuantityResults OPTIONAL, + ... +} + +CandidateRS-IndexInfoListCSI-RS ::= SEQUENCE (SIZE (1..maxNrofIndexesToReport)) OF CandidateRS-IndexInfoCSI-RS + +CandidateRS-IndexInfoCSI-RS ::= SEQUENCE { + csi-RS-Index CSI-RS-Index, + measResultCSI-RS MeasQuantityResults OPTIONAL, + ... +} + +-- TAG-CANDIDATE-CELL-INFO-LIST-STOP +-- TAG_NR-MULTIPLICITY-AND-CONSTRAINTS-START + +maxMeasFreqsMN INTEGER ::= 32 -- Maximum number of MN-configured measurement frequencies +maxCellPrep INTEGER ::= 32 -- Maximum number of cells prepared for handover + +-- TAG_NR-MULTIPLICITY-AND-CONSTRAINTS-STOP +-- TAG_NR-INTER-NODE-DEFINITIONS-END-START + +END + +-- TAG_NR-INTER-NODE-DEFINITIONS-END-STOP +-- TAG-NAME-START + +-- TAG-NAME-STOP diff --git a/openair2/RRC/NR/defs_NR.h b/openair2/RRC/NR/defs_NR.h deleted file mode 100644 index b1a37590be5fbc5f14167d204334f5ce2c2e0cd8..0000000000000000000000000000000000000000 --- a/openair2/RRC/NR/defs_NR.h +++ /dev/null @@ -1,573 +0,0 @@ -/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file RRC/LITE/defs_NR.h -* \brief NR RRC struct definitions and function prototypes -* \author Navid Nikaein, Raymond Knopp -* \date 2010 - 2014, 2018 -* \version 1.0 -* \company Eurecom -* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr -*/ - -#ifndef __OPENAIR_RRC_DEFS_NR_H__ -#define __OPENAIR_RRC_DEFS_NR_H__ - - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "collection/tree.h" -#include "rrc_types_NR.h" -#include "COMMON/platform_constants.h" -#include "COMMON/platform_types.h" - -//#include "COMMON/mac_rrc_primitives.h" -#if defined(NR_Rel15) -#include "NR_SIB1.h" -//#include "SystemInformation.h" -//#include "RRCConnectionReconfiguration.h" -#include "NR_RRCReconfigurationComplete.h" -#include "NR_RRCReconfiguration.h" -//#include "RRCConnectionReconfigurationComplete.h" -//#include "RRCConnectionSetup.h" -//#include "RRCConnectionSetupComplete.h" -//#include "RRCConnectionRequest.h" -//#include "RRCConnectionReestablishmentRequest.h" -//#include "BCCH-DL-SCH-Message.h" -#include "NR_BCCH-BCH-Message.h" -//#include "MCCH-Message.h" -//#include "MBSFNAreaConfiguration-r9.h" -//#include "SCellToAddMod-r10.h" -//#include "AS-Config.h" -//#include "AS-Context.h" -#include "NR_UE-NR-Capability.h" -#include "NR_MeasResults.h" -#include "NR_ServingCellConfigCommon.h" -#endif -//------------------- - -#if defined(ENABLE_ITTI) -# include "intertask_interface.h" -#endif - -/* TODO: be sure this include is correct. - * It solves a problem of compilation of the RRH GW, - * issue #186. - */ -#if !defined(ENABLE_ITTI) -# include "as_message.h" -#endif - -#if defined(ENABLE_USE_MME) -# include "commonDef.h" -#endif - -#if ENABLE_RAL -# include "collection/hashtable/obj_hashtable.h" -#endif - - - -/*I will change the name of the structure for compile purposes--> hope not to undo this process*/ - -typedef unsigned int uid_NR_t; -#define UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NR (((NUMBER_OF_NR_UE_MAX/8)/sizeof(unsigned int)) + 1) - -typedef struct uid_linear_allocator_NR_s { - unsigned int bitmap[UID_LINEAR_ALLOCATOR_BITMAP_SIZE_NR]; -} uid_allocator_NR_t; - - -#define PROTOCOL_NRRRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT -#define PROTOCOL_NRRRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp) - -#define PROTOCOL_NRRRC_CTXT_FMT PROTOCOL_CTXT_FMT -#define PROTOCOL_NRRRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp) - - -#define UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! -#define UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1 - -typedef enum { - NR_RRC_OK=0, - NR_RRC_ConnSetup_failed, - NR_RRC_PHY_RESYNCH, - NR_RRC_Handover_failed, - NR_RRC_HO_STARTED -} NR_RRC_status_t; - -typedef enum UE_STATE_NR_e { - NR_RRC_INACTIVE=0, - NR_RRC_IDLE, - NR_RRC_SI_RECEIVED, - NR_RRC_CONNECTED, - NR_RRC_RECONFIGURED, - NR_RRC_HO_EXECUTION -} NR_UE_STATE_t; - -typedef enum HO_STATE_NR_e { - NR_HO_IDLE=0, - NR_HO_MEASURMENT, - NR_HO_PREPARE, - NR_HO_CMD, // initiated by the src eNB - NR_HO_COMPLETE // initiated by the target eNB -} NR_HO_STATE_t; - -//#define NUMBER_OF_UE_MAX MAX_MOBILES_PER_RG -#define RRM_FREE(p) if ( (p) != NULL) { free(p) ; p=NULL ; } -#define RRM_MALLOC(t,n) (t *) malloc16( sizeof(t) * n ) -#define RRM_CALLOC(t,n) (t *) malloc16( sizeof(t) * n) -#define RRM_CALLOC2(t,s) (t *) malloc16( s ) - -#define MAX_MEAS_OBJ 6 -#define MAX_MEAS_CONFIG 6 -#define MAX_MEAS_ID 6 - -#define PAYLOAD_SIZE_MAX 1024 -#define RRC_BUF_SIZE 255 -#define UNDEF_SECURITY_MODE 0xff -#define NO_SECURITY_MODE 0x20 - -/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */ -#define RRC_TRANSACTION_IDENTIFIER_NUMBER 3 - -typedef struct { - unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */ - unsigned short max_transport_blocks; /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */ - unsigned long Guaranteed_bit_rate; /*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/ - unsigned long Max_bit_rate; /*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/ - uint8_t Delay_class; /*!< \brief Delay class offered by MAC layer scheduling*/ - uint8_t Target_bler; /*!< \brief Target Average Transport Block Error rate*/ - uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/ -} __attribute__ ((__packed__)) LCHAN_DESC_NR; - -typedef struct UE_RRC_INFO_NR_s { - NR_UE_STATE_t State; - uint8_t SIB1systemInfoValueTag; - uint32_t SIStatus; - uint32_t SIcnt; -#if defined(Rel10) || defined(Rel14) - uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA -#endif - uint8_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40 - uint8_t handoverTarget; - //HO_STATE_t ho_state; - uint16_t SIperiod; //!< Corresponds to the SIB1 si-Periodicity parameter (multiplied by 10). Possible values are (final): 80,160,320,640,1280,2560,5120 - unsigned short UE_index; - uint32_t T300_active; - uint32_t T300_cnt; - uint32_t T304_active; - uint32_t T304_cnt; - uint32_t T310_active; - uint32_t T310_cnt; - uint32_t N310_cnt; - uint32_t N311_cnt; - rnti_t rnti; -} __attribute__ ((__packed__)) UE_RRC_INFO_NR; - -typedef struct UE_S_TMSI_NR_s { - boolean_t presence; - mme_code_t mme_code; - m_tmsi_t m_tmsi; -} __attribute__ ((__packed__)) UE_S_TMSI_NR; - - -typedef enum e_rab_satus_NR_e { - E_RAB_STATUS_NEW_NR, - E_RAB_STATUS_DONE_NR, // from the eNB perspective - E_RAB_STATUS_ESTABLISHED_NR, // get the reconfigurationcomplete form UE - E_RAB_STATUS_FAILED_NR, -} e_rab_status_NR_t; - -typedef struct e_rab_param_NR_s { - e_rab_t param; - uint8_t status; - uint8_t xid; // transaction_id -} __attribute__ ((__packed__)) e_rab_param_NR_t; - - -typedef struct HANDOVER_INFO_NR_s { - uint8_t ho_prepare; - uint8_t ho_complete; - uint8_t modid_s; //module_idP of serving cell - uint8_t modid_t; //module_idP of target cell - uint8_t ueid_s; //UE index in serving cell - uint8_t ueid_t; //UE index in target cell - - // NR not define at this moment - //AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */ - //AS_Context_t as_context; /* They are mandatory for HO */ - - uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */ - int size; /* size of above message in bytes */ -} HANDOVER_INFO_NR; - - -#define RRC_HEADER_SIZE_MAX 64 -#define RRC_BUFFER_SIZE_MAX 1024 - -typedef struct { - char Payload[RRC_BUFFER_SIZE_MAX]; - char Header[RRC_HEADER_SIZE_MAX]; - char payload_size; -} RRC_BUFFER_NR; - -#define RRC_BUFFER_SIZE_NR sizeof(RRC_BUFFER_NR) - - -typedef struct RB_INFO_NR_s { - uint16_t Rb_id; //=Lchan_id - LCHAN_DESC Lchan_desc[2]; - //MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT -} RB_INFO_NR; - -typedef struct SRB_INFO_NR_s { - uint16_t Srb_id; //=Lchan_id - RRC_BUFFER Rx_buffer; - RRC_BUFFER Tx_buffer; - LCHAN_DESC Lchan_desc[2]; - unsigned int Trans_id; - uint8_t Active; -} SRB_INFO_NR; - - -typedef struct RB_INFO_TABLE_ENTRY_NR_s { - RB_INFO_NR Rb_info; - uint8_t Active; - uint32_t Next_check_frame; - uint8_t Status; -} RB_INFO_TABLE_ENTRY_NR; - -typedef struct SRB_INFO_TABLE_ENTRY_NR_s { - SRB_INFO_NR Srb_info; - uint8_t Active; - uint8_t Status; - uint32_t Next_check_frame; -} SRB_INFO_TABLE_ENTRY_NR; - -typedef struct MEAS_REPORT_LIST_NR_s { - MeasId_t measId; - //CellsTriggeredList cellsTriggeredList;//OPTIONAL - uint32_t numberOfReportsSent; -} MEAS_REPORT_LIST_NR; - -typedef struct HANDOVER_INFO_UE_NR_s { - PhysCellId_t targetCellId; - uint8_t measFlag; -} HANDOVER_INFO_UE_NR; - -//NB-IoT eNB_RRC_UE_NB_IoT_s--(used as a context in eNB --> ue_context in rrc_eNB_ue_context)------ -typedef struct gNB_RRC_UE_s { - - uint8_t primaryCC_id; - - //SCellToAddMod_t sCell_config[2]; - - SRB_ToAddModList_t* SRB_configList;//for SRB1 and SRB1bis - SRB_ToAddModList_t* SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; - DRB_ToAddModList_t* DRB_configList; //for all the DRBs - DRB_ToAddModList_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid - uint8_t DRB_active[8];//in LTE was 8 - - // NR not define at this moment - //struct PhysicalConfigDedicated* physicalConfigDedicated_NR; - - struct SPS_Config* sps_Config; - MeasObjectToAddMod_t* MeasObj[MAX_MEAS_OBJ]; - struct ReportConfigToAddMod* ReportConfig[MAX_MEAS_CONFIG]; - struct QuantityConfig* QuantityConfig; - struct MeasIdToAddMod* MeasId[MAX_MEAS_ID]; - - // NR not define at this moment - //MAC_MainConfig_t* mac_MainConfig_NR; - - MeasGapConfig_t* measGapConfig; - - SRB_INFO_NR SI; - SRB_INFO_NR Srb0; - SRB_INFO_TABLE_ENTRY_NR Srb1; - SRB_INFO_TABLE_ENTRY_NR Srb2; - - MeasConfig_t* measConfig; - HANDOVER_INFO_NR* handover_info; - - -#if defined(ENABLE_SECURITY) - /* KeNB as derived from KASME received from EPC */ - uint8_t kenb[32]; -#endif - - /* Used integrity/ciphering algorithms */ - //Specs. TS 38.331 V15.1.0 pag 432 Change position of chipering enumerative w.r.t previous version - e_NR_CipheringAlgorithm ciphering_algorithm; - e_NR_IntegrityProtAlgorithm integrity_algorithm; - - uint8_t Status; - rnti_t rnti; - uint64_t random_ue_identity; - - - - /* Information from UE RRC ConnectionRequest */ - UE_S_TMSI_NR Initialue_identity_s_TMSI; - - /* NR not define at this moment - EstablishmentCause_t establishment_cause_NR; //different set for NB-IoT - */ - /* NR not define at this moment*/ - /* Information from UE RRC ConnectionReestablishmentRequest */ - //ReestablishmentCause_t reestablishment_cause_NR; //different set for NB_IoT - - /* UE id for initial connection to S1AP */ - uint16_t ue_initial_id; - - /* Information from S1AP initial_context_setup_req */ - uint32_t eNB_ue_s1ap_id :24; - - security_capabilities_t security_capabilities; - - /* Total number of e_rab already setup in the list */ //NAS list? - uint8_t setup_e_rabs; - /* Number of e_rab to be setup in the list */ //NAS list? - uint8_t nb_of_e_rabs; - /* list of e_rab to be setup by RRC layers */ - e_rab_param_NR_t e_rab[NB_RB_MAX_NB_IOT];//[S1AP_MAX_E_RAB]; - - // LG: For GTPV1 TUNNELS - uint32_t enb_gtp_teid[S1AP_MAX_E_RAB]; - transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB]; - rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB]; - - //Which timers are referring to? - uint32_t ul_failure_timer; - uint32_t ue_release_timer; - //threshold of the release timer--> set in RRCConnectionRelease - uint32_t ue_release_timer_thres; -} gNB_RRC_UE_t; -//-------------------------------------------------------------------------------- - -typedef uid_NR_t ue_uid_t; - - -//generally variable called: ue_context_pP -typedef struct rrc_gNB_ue_context_s { - - /* Tree related data */ - RB_ENTRY(rrc_gNB_ue_context_s) entries; - - /* Uniquely identifies the UE between MME and eNB within the eNB. - * This id is encoded on 24bits. - */ - rnti_t ue_id_rnti; - - // another key for protocol layers but should not be used as a key for RB tree - ue_uid_t local_uid; - - /* UE id for initial connection to S1AP */ - struct gNB_RRC_UE_s ue_context; //context of ue in the e-nB - -} rrc_gNB_ue_context_t; - - -//called "carrier"--> data from PHY layer -typedef struct { - - // buffer that contains the encoded messages - uint8_t *MIB; - uint8_t sizeof_MIB; - - uint8_t *SIB1; - uint8_t sizeof_SIB1; - - //implicit parameters needed - int Ncp; //cyclic prefix for DL - int Ncp_UL; //cyclic prefix for UL - int p_gNB; //number of tx antenna port - int p_rx_gNB; //number of receiving antenna ports - uint32_t dl_CarrierFreq; //detected by the UE - uint32_t ul_CarrierFreq; //detected by the UE - uint16_t physCellId; - - //are the only static one (memory has been already allocated) - BCCH_BCH_Message_t mib; - - NR_SIB1_t *sib1; - NR_ServingCellConfigCommon_t *servingcellconfigcommon; - - - SRB_INFO_NR SI; - SRB_INFO_NR Srb0; - -} rrc_gNB_carrier_data_t; -//--------------------------------------------------- - - - -//---NR---(completely change)--------------------- -typedef struct gNB_RRC_INST_s { - - eth_params_t eth_params_s; - rrc_gNB_carrier_data_t carrier[MAX_NUM_CCs]; - uid_allocator_NR_t uid_allocator; // for rrc_ue_head - RB_HEAD(rrc_ue_tree_NR_s, rrc_gNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti - - uint8_t HO_flag; - uint8_t Nb_ue; - - hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t - hash_table_t *s1ap_id2_s1ap_ids ; // key is content is rrc_ue_s1ap_ids_t - - //RRC configuration -#if defined(ENABLE_ITTI) - gNB_RrcConfigurationReq configuration;//rrc_messages_types.h -#endif - - // other PLMN parameters - /// Mobile country code - int mcc; - /// Mobile network code - int mnc; - /// number of mnc digits - int mnc_digit_length; - - // other RAN parameters - int srb1_timer_poll_retransmit; - int srb1_poll_pdu; - int srb1_poll_byte; - int srb1_max_retx_threshold; - int srb1_timer_reordering; - int srb1_timer_status_prohibit; - int srs_enable[MAX_NUM_CCs]; - -} gNB_RRC_INST; - -//#define RRC_HEADER_SIZE_MAX_NR 64 -#define MAX_UE_CAPABILITY_SIZE_NR 255 - -//not needed for the moment -typedef struct OAI_UECapability_NR_s { - uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NR]; - uint8_t sdu_size; -////NR------ - NR_UE_NR_Capability_t UE_Capability_NR; //replace the UE_EUTRA_Capability of LTE -} OAI_UECapability_NR_t; - - -typedef struct UE_RRC_INST_NR_s { - Rrc_State_NR_t RrcState; - Rrc_Sub_State_NR_t RrcSubState; -# if defined(ENABLE_USE_MME) - plmn_t plmnID; - Byte_t rat; - as_nas_info_t initialNasMsg; -# endif - OAI_UECapability_NR_t *UECap; - uint8_t *UECapability; - uint8_t UECapability_size; - - UE_RRC_INFO_NR Info[NB_SIG_CNX_UE]; - - SRB_INFO_NR Srb0[NB_SIG_CNX_UE]; - SRB_INFO_TABLE_ENTRY_NR Srb1[NB_CNX_UE]; - SRB_INFO_TABLE_ENTRY_NR Srb2[NB_CNX_UE]; - HANDOVER_INFO_UE_NR HandoverInfoUe; - /* - uint8_t *SIB1[NB_CNX_UE]; - uint8_t sizeof_SIB1[NB_CNX_UE]; - uint8_t *SI[NB_CNX_UE]; - uint8_t sizeof_SI[NB_CNX_UE]; - uint8_t SIB1Status[NB_CNX_UE]; - uint8_t SIStatus[NB_CNX_UE]; - SIB1_t *sib1[NB_CNX_UE]; - SystemInformation_t *si[NB_CNX_UE]; //!< Temporary storage for an SI message. Decoding happens in decode_SI(). - - SystemInformationBlockType2_t *sib2[NB_CNX_UE]; - SystemInformationBlockType3_t *sib3[NB_CNX_UE]; - SystemInformationBlockType4_t *sib4[NB_CNX_UE]; - SystemInformationBlockType5_t *sib5[NB_CNX_UE]; - SystemInformationBlockType6_t *sib6[NB_CNX_UE]; - SystemInformationBlockType7_t *sib7[NB_CNX_UE]; - SystemInformationBlockType8_t *sib8[NB_CNX_UE]; - SystemInformationBlockType9_t *sib9[NB_CNX_UE]; - SystemInformationBlockType10_t *sib10[NB_CNX_UE]; - SystemInformationBlockType11_t *sib11[NB_CNX_UE]; - -#if defined(Rel10) || defined(Rel14) - uint8_t MBMS_flag; - uint8_t *MCCH_MESSAGE[NB_CNX_UE]; - uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE]; - uint8_t MCCH_MESSAGEStatus[NB_CNX_UE]; - MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE]; - SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE]; - SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE]; -#endif -#ifdef CBA - uint8_t num_active_cba_groups; - uint16_t cba_rnti[NUM_MAX_CBA_GROUP]; -#endif - uint8_t num_srb; - struct SRB_ToAddMod *SRB1_config[NB_CNX_UE]; - struct SRB_ToAddMod *SRB2_config[NB_CNX_UE]; - struct DRB_ToAddMod *DRB_config[NB_CNX_UE][8]; - rb_id_t *defaultDRB; // remember the ID of the default DRB - MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ]; - struct ReportConfigToAddMod *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG]; - */ - struct QuantityConfig *QuantityConfig[NB_CNX_UE]; - /* - struct MeasIdToAddMod *MeasId[NB_CNX_UE][MAX_MEAS_ID]; - MEAS_REPORT_LIST *measReportList[NB_CNX_UE][MAX_MEAS_ID]; - uint32_t measTimer[NB_CNX_UE][MAX_MEAS_ID][6]; // 6 neighboring cells - RSRP_Range_t s_measure; - struct MeasConfig__speedStatePars *speedStatePars; - struct PhysicalConfigDedicated *physicalConfigDedicated[NB_CNX_UE]; - struct SPS_Config *sps_Config[NB_CNX_UE]; - MAC_MainConfig_t *mac_MainConfig[NB_CNX_UE]; - MeasGapConfig_t *measGapConfig[NB_CNX_UE]; - double filter_coeff_rsrp; // [7] ??? - double filter_coeff_rsrq; // [7] ??? - float rsrp_db[7]; - float rsrq_db[7]; - float rsrp_db_filtered[7]; - float rsrq_db_filtered[7]; -#if ENABLE_RAL - obj_hash_table_t *ral_meas_thresholds; - ral_transaction_id_t scan_transaction_id; -#endif -#if defined(ENABLE_SECURITY) - // KeNB as computed from parameters within USIM card // - uint8_t kenb[32]; -#endif - - // Used integrity/ciphering algorithms // - CipheringAlgorithm_r12_t ciphering_algorithm; - e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm; - */ -}UE_RRC_INST_NR; - - - - -#include "proto_NR.h" //should be put here otherwise compilation error - -#endif -/** @} */ diff --git a/openair2/RRC/NR/nr_rrc_common.c b/openair2/RRC/NR/nr_rrc_common.c new file mode 100644 index 0000000000000000000000000000000000000000..a0b636da83115987628affb7a81e931493a520f9 --- /dev/null +++ b/openair2/RRC/NR/nr_rrc_common.c @@ -0,0 +1,98 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file rrc_common.c + * \brief rrc common procedures for eNB and UE + * \author Navid Nikaein and Raymond Knopp + * \date 2011 - 2014 + * \version 1.0 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr + */ + +#include "nr_rrc_extern.h" +#include "LAYER2/MAC/mac_extern.h" +#include "COMMON/openair_defs.h" +#include "COMMON/platform_types.h" +#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" +#include "LAYER2/RLC/rlc.h" +#include "COMMON/mac_rrc_primitives.h" +#include "UTIL/LOG/log.h" +#include "asn1_msg.h" +#include "pdcp.h" +#include "UTIL/LOG/vcd_signal_dumper.h" +#include "rrc_eNB_UE_context.h" +#include "common/ran_context.h" + +#define DEBUG_NR_RRC 1 + +extern RAN_CONTEXT_t RC; +extern UE_MAC_INST *UE_mac_inst; +extern mui_t rrc_gNB_mui; + +//----------------------------------------------------------------------------- +int rrc_init_nr_global_param(void){ + + rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc + + DCCH_LCHAN_DESC.transport_block_size = 4; + DCCH_LCHAN_DESC.max_transport_blocks = 16; + DCCH_LCHAN_DESC.Delay_class = 1; + DTCH_DL_LCHAN_DESC.transport_block_size = 52; + DTCH_DL_LCHAN_DESC.max_transport_blocks = 20; + DTCH_DL_LCHAN_DESC.Delay_class = 1; + DTCH_UL_LCHAN_DESC.transport_block_size = 52; + DTCH_UL_LCHAN_DESC.max_transport_blocks = 20; + DTCH_UL_LCHAN_DESC.Delay_class = 1; + + Rlc_info_um.rlc_mode = RLC_MODE_UM; + Rlc_info_um.rlc.rlc_um_info.timer_reordering = 5; + Rlc_info_um.rlc.rlc_um_info.sn_field_length = 10; + Rlc_info_um.rlc.rlc_um_info.is_mXch = 0; + //Rlc_info_um.rlc.rlc_um_info.sdu_discard_mode=16; + + Rlc_info_am_config.rlc_mode = RLC_MODE_AM; + Rlc_info_am_config.rlc.rlc_am_info.max_retx_threshold = 50; + Rlc_info_am_config.rlc.rlc_am_info.poll_pdu = 8; + Rlc_info_am_config.rlc.rlc_am_info.poll_byte = 1000; + Rlc_info_am_config.rlc.rlc_am_info.t_poll_retransmit = 15; + Rlc_info_am_config.rlc.rlc_am_info.t_reordering = 50; + Rlc_info_am_config.rlc.rlc_am_info.t_status_prohibit = 10; + + return 0; +} + +//----------------------------------------------------------------------------- +void +rrc_config_nr_buffer( + NR_SRB_INFO* Srb_info, + uint8_t Lchan_type, + uint8_t Role +) +//----------------------------------------------------------------------------- +{ + + Srb_info->Rx_buffer.payload_size = 0; + Srb_info->Tx_buffer.payload_size = 0; +} + + +//----------------------------------------------------------------------------- \ No newline at end of file diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..a957e0054a01a01345b1e13d0a608662fe8bc3d2 --- /dev/null +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -0,0 +1,332 @@ +/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file RRC/LITE/defs_NR.h +* \brief NR RRC struct definitions and function prototypes +* \author Navid Nikaein, Raymond Knopp +* \date 2010 - 2014, 2018 +* \version 1.0 +* \company Eurecom +* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr +*/ + +#ifndef __OPENAIR_RRC_DEFS_NR_H__ +#define __OPENAIR_RRC_DEFS_NR_H__ + + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "collection/tree.h" +#include "nr_rrc_types.h" + +#include "COMMON/platform_constants.h" +#include "COMMON/platform_types.h" +#include "RRC/LTE/rrc_defs.h" +//#include "LAYER2/RLC/rlc.h" + +//#include "COMMON/mac_rrc_primitives.h" +#if defined(NR_Rel15) +#include "NR_SIB1.h" +//#include "SystemInformation.h" +//#include "RRCConnectionReconfiguration.h" +#include "NR_RRCReconfigurationComplete.h" +#include "NR_RRCReconfiguration.h" +//#include "RRCConnectionReconfigurationComplete.h" +//#include "RRCConnectionSetup.h" +//#include "RRCConnectionSetupComplete.h" +//#include "RRCConnectionRequest.h" +//#include "RRCConnectionReestablishmentRequest.h" +//#include "BCCH-DL-SCH-Message.h" +#include "NR_BCCH-BCH-Message.h" +//#include "MCCH-Message.h" +//#include "MBSFNAreaConfiguration-r9.h" +//#include "SCellToAddMod-r10.h" +//#include "AS-Config.h" +//#include "AS-Context.h" +#include "NR_UE-NR-Capability.h" +#include "NR_MeasResults.h" +#include "NR_ServingCellConfigCommon.h" +#endif +//------------------- + +#if defined(ENABLE_ITTI) +# include "intertask_interface.h" +#endif + +/* TODO: be sure this include is correct. + * It solves a problem of compilation of the RRH GW, + * issue #186. + */ +#if !defined(ENABLE_ITTI) +# include "as_message.h" +#endif + +#if defined(ENABLE_USE_MME) +# include "commonDef.h" +#endif + + +/*I will change the name of the structure for compile purposes--> hope not to undo this process*/ + +typedef unsigned int uid_nr_t; +#define NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((NUMBER_OF_NR_UE_MAX/8)/sizeof(unsigned int)) + 1) + +/*typedef struct nr_uid_linear_allocator_s { + unsigned int bitmap[NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE]; +} nr_uid_allocator_t;*/ + + +#define PROTOCOL_NR_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT +#define PROTOCOL_NR_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp) + +#define PROTOCOL_NR_RRC_CTXT_FMT PROTOCOL_CTXT_FMT +#define PROTOCOL_NR_RRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp) + + +#define NR_UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! +#define NR_UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1 + +typedef enum { + NR_RRC_OK=0, + NR_RRC_ConnSetup_failed, + NR_RRC_PHY_RESYNCH, + NR_RRC_Handover_failed, + NR_RRC_HO_STARTED +} NR_RRC_status_t; + +typedef enum UE_STATE_NR_e { + NR_RRC_INACTIVE=0, + NR_RRC_IDLE, + NR_RRC_SI_RECEIVED, + NR_RRC_CONNECTED, + NR_RRC_RECONFIGURED, + NR_RRC_HO_EXECUTION +} NR_UE_STATE_t; + + +//#define NUMBER_OF_NR_UE_MAX MAX_MOBILES_PER_RG +#define RRM_FREE(p) if ( (p) != NULL) { free(p) ; p=NULL ; } +#define RRM_MALLOC(t,n) (t *) malloc16( sizeof(t) * n ) +#define RRM_CALLOC(t,n) (t *) malloc16( sizeof(t) * n) +#define RRM_CALLOC2(t,s) (t *) malloc16( s ) + +#define MAX_MEAS_OBJ 6 +#define MAX_MEAS_CONFIG 6 +#define MAX_MEAS_ID 6 + +#define PAYLOAD_SIZE_MAX 1024 +#define RRC_BUF_SIZE 255 +#define UNDEF_SECURITY_MODE 0xff +#define NO_SECURITY_MODE 0x20 + +/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */ +#define NR_RRC_TRANSACTION_IDENTIFIER_NUMBER 3 + +typedef struct { + unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */ + unsigned short max_transport_blocks; /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */ + unsigned long Guaranteed_bit_rate; /*!< \brief Guaranteed Bit Rate (average) to be offered by MAC layer scheduling*/ + unsigned long Max_bit_rate; /*!< \brief Maximum Bit Rate that can be offered by MAC layer scheduling*/ + uint8_t Delay_class; /*!< \brief Delay class offered by MAC layer scheduling*/ + uint8_t Target_bler; /*!< \brief Target Average Transport Block Error rate*/ + uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/ +} __attribute__ ((__packed__)) NR_LCHAN_DESC; + +typedef struct UE_RRC_INFO_NR_s { + NR_UE_STATE_t State; + uint8_t SIB1systemInfoValueTag; + uint32_t SIStatus; + uint32_t SIcnt; +#if defined(Rel10) || defined(Rel14) + uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA +#endif + uint8_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40 + uint8_t handoverTarget; + //HO_STATE_t ho_state; + uint16_t SIperiod; //!< Corresponds to the SIB1 si-Periodicity parameter (multiplied by 10). Possible values are (final): 80,160,320,640,1280,2560,5120 + unsigned short UE_index; + uint32_t T300_active; + uint32_t T300_cnt; + uint32_t T304_active; + uint32_t T304_cnt; + uint32_t T310_active; + uint32_t T310_cnt; + uint32_t N310_cnt; + uint32_t N311_cnt; + rnti_t rnti; +} __attribute__ ((__packed__)) NR_UE_RRC_INFO; + +typedef struct UE_S_TMSI_NR_s { + boolean_t presence; + mme_code_t mme_code; + m_tmsi_t m_tmsi; +} __attribute__ ((__packed__)) NR_UE_S_TMSI; + + +typedef enum nr_e_rab_satus_e { + NR_E_RAB_STATUS_NEW, + NR_E_RAB_STATUS_DONE, // from the gNB perspective + NR_E_RAB_STATUS_ESTABLISHED, // get the reconfigurationcomplete form UE + NR_E_RAB_STATUS_FAILED, +} nr_e_rab_status_t; + +typedef struct nr_e_rab_param_s { + e_rab_t param; + uint8_t status; + uint8_t xid; // transaction_id +} __attribute__ ((__packed__)) nr_e_rab_param_t; + + +typedef struct HANDOVER_INFO_NR_s { + uint8_t ho_prepare; + uint8_t ho_complete; + uint8_t modid_s; //module_idP of serving cell + uint8_t modid_t; //module_idP of target cell + uint8_t ueid_s; //UE index in serving cell + uint8_t ueid_t; //UE index in target cell + + // NR not define at this moment + //AS_Config_t as_config; /* these two parameters are taken from 36.331 section 10.2.2: HandoverPreparationInformation-r8-IEs */ + //AS_Context_t as_context; /* They are mandatory for HO */ + + uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */ + int size; /* size of above message in bytes */ +} NR_HANDOVER_INFO; + + +#define NR_RRC_HEADER_SIZE_MAX 64 +#define NR_RRC_BUFFER_SIZE_MAX 1024 + +typedef struct { + char Payload[NR_RRC_BUFFER_SIZE_MAX]; + char Header[NR_RRC_HEADER_SIZE_MAX]; + char payload_size; +} NR_RRC_BUFFER; + +#define NR_RRC_BUFFER_SIZE sizeof(RRC_BUFFER_NR) + + +typedef struct RB_INFO_NR_s { + uint16_t Rb_id; //=Lchan_id + NR_LCHAN_DESC Lchan_desc[2]; + //MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT +} NR_RB_INFO; + +typedef struct NR_SRB_INFO_s { + uint16_t Srb_id; //=Lchan_id + NR_RRC_BUFFER Rx_buffer; + NR_RRC_BUFFER Tx_buffer; + NR_LCHAN_DESC Lchan_desc[2]; + unsigned int Trans_id; + uint8_t Active; +} NR_SRB_INFO; + + +typedef struct RB_INFO_TABLE_ENTRY_NR_s { + NR_RB_INFO Rb_info; + uint8_t Active; + uint32_t Next_check_frame; + uint8_t Status; +} NR_RB_INFO_TABLE_ENTRY; + +typedef struct SRB_INFO_TABLE_ENTRY_NR_s { + NR_SRB_INFO Srb_info; + uint8_t Active; + uint8_t Status; + uint32_t Next_check_frame; +} NR_SRB_INFO_TABLE_ENTRY; + +//called "carrier"--> data from PHY layer +typedef struct { + + // buffer that contains the encoded messages + uint8_t *MIB; + uint8_t sizeof_MIB; + + uint8_t *ServingCellConfigCommon; + uint8_t sizeof_servingcellconfigcommon; + + //implicit parameters needed + int physCellId; + int Ncp; //cyclic prefix for DL + int Ncp_UL; //cyclic prefix for UL + int p_gNB; //number of tx antenna port + int p_rx_gNB; //number of receiving antenna ports + uint32_t dl_CarrierFreq; //detected by the UE + uint32_t ul_CarrierFreq; //detected by the UE + + //are the only static one (memory has been already allocated) + NR_BCCH_BCH_Message_t mib; + + NR_ServingCellConfigCommon_t *servingcellconfigcommon; + + + NR_SRB_INFO SI; + NR_SRB_INFO Srb0; + +} rrc_gNB_carrier_data_t; +//--------------------------------------------------- + + + +//---NR---(completely change)--------------------- +typedef struct gNB_RRC_INST_s { + + eth_params_t eth_params_s; + rrc_gNB_carrier_data_t carrier[MAX_NUM_CCs]; + uid_allocator_t uid_allocator; // for rrc_ue_head + RB_HEAD(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti + + uint8_t Nb_ue; + + hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t + hash_table_t *s1ap_id2_s1ap_ids ; // key is content is rrc_ue_s1ap_ids_t + + //RRC configuration +#if defined(ENABLE_ITTI) + gNB_RrcConfigurationReq configuration;//rrc_messages_types.h +#endif + + // other PLMN parameters + /// Mobile country code + int mcc; + /// Mobile network code + int mnc; + /// number of mnc digits + int mnc_digit_length; + + // other RAN parameters + int srb1_timer_poll_retransmit; + int srb1_poll_pdu; + int srb1_poll_byte; + int srb1_max_retx_threshold; + int srb1_timer_reordering; + int srb1_timer_status_prohibit; + int srs_enable[MAX_NUM_CCs]; + +} gNB_RRC_INST; + + +#include "nr_rrc_proto.h" //should be put here otherwise compilation error + +#endif +/** @} */ diff --git a/openair2/RRC/NR/extern_NR.h b/openair2/RRC/NR/nr_rrc_extern.h similarity index 95% rename from openair2/RRC/NR/extern_NR.h rename to openair2/RRC/NR/nr_rrc_extern.h index b45dbd11e9557db9667b6c2ea24f1906eb67f774..b631e13025abffa357b29f36f6d8b55b98ab1e93 100644 --- a/openair2/RRC/NR/extern_NR.h +++ b/openair2/RRC/NR/nr_rrc_extern.h @@ -30,16 +30,13 @@ #ifndef __OPENAIR_RRC_EXTERN_H__ #define __OPENAIR_RRC_EXTERN_H__ -#include "defs.h" +#include "nr_rrc_defs.h" #include "COMMON/mac_rrc_primitives.h" -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac.h" #include "LAYER2/RLC/rlc.h" extern UE_RRC_INST *UE_rrc_inst; -#include "LAYER2/MAC/extern.h" - extern uint8_t DRB2LCHAN[8]; extern LogicalChannelConfig_t SRB1_logicalChannelConfig_defaultValue; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h new file mode 100644 index 0000000000000000000000000000000000000000..56dbb983f29cbe721c2381202816c349c7701ac7 --- /dev/null +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -0,0 +1,57 @@ +/* + * 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 proto.h + * \brief RRC functions prototypes for eNB and UE + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \email navid.nikaein@eurecom.fr + * \version 1.0 + + */ +/** \addtogroup _rrc + * @{ + */ + +#include "RRC/NR/nr_rrc_defs.h" + +#include "flexran_agent_extern.h" + +int rrc_init_nr_global_param(void); + +void rrc_config_nr_buffer(NR_SRB_INFO* Srb_info, + uint8_t Lchan_type, + uint8_t Role); + +int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP, + const int CC_id, + const frame_t frameP, + const rb_id_t Srb_id, + const uint8_t Nb_tb, + uint8_t *const buffer_pP ); + + +#if defined(ENABLE_ITTI) +/**\brief RRC eNB task. + \param void *args_p Pointer on arguments to start the task. */ +void *rrc_gnb_task(void *args_p); + +#endif \ No newline at end of file diff --git a/openair2/RRC/NR/rrc_types_NR.h b/openair2/RRC/NR/nr_rrc_types.h similarity index 100% rename from openair2/RRC/NR/rrc_types_NR.h rename to openair2/RRC/NR/nr_rrc_types.h diff --git a/openair2/RRC/NR/proto_NR.h b/openair2/RRC/NR/proto_NR.h deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 4bc43a7d10df9dea5c0f26b9eea9e346fceeb3cd..5cef862208826d2816df99f6404fd73313fc4ecc 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -27,44 +27,40 @@ * \company Eurecom * \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr */ -#define RRC_GNB +#define RRC_GNB_C #define RRC_GNB_C -#include "defs_NR.h" -#include "extern.h" +#include "nr_rrc_defs.h" +#include "nr_rrc_extern.h" #include "assertions.h" #include "common/ran_context.h" #include "asn1_conversions.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "LAYER2/RLC/rlc.h" -#include "LAYER2/MAC/proto.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "UTIL/LOG/log.h" #include "COMMON/mac_rrc_primitives.h" -#include "RRC/NR/asn1_msg.h" - -///ASN.1 header files -//#include "RRCConnectionRequest.h" -//#include "RRCConnectionReestablishmentRequest.h" -//#include "ReestablishmentCause.h" -#include "BCCH-BCH-Message.h" -//#include "UL-CCCH-Message.h" -//#include "DL-CCCH-Message.h" -#include "UL-DCCH-Message.h" -#include "DL-DCCH-Message.h" -//#include "TDD-Config.h" -//#include "HandoverCommand.h" -#include "MeasResults.h" +#include "RRC/NR/MESSAGES/asn1_msg.h" + + +#include "NR_BCCH-BCH-Message.h" +#include "NR_UL-DCCH-Message.h" +#include "NR_DL-DCCH-Message.h" + +#include "NR_MeasResults.h" -#include "pdcp.h" #include "rlc.h" -#include "SIMULATION/ETH_TRANSPORT/extern.h" #include "rrc_eNB_UE_context.h" #include "platform_types.h" #include "msc.h" #include "UTIL/LOG/vcd_signal_dumper.h" + #include "T.h" +//#if defined(Rel10) || defined(Rel14) +#include "MeasResults.h" +//#endif #include "RRC/NAS/nas_config.h" #include "RRC/NAS/rb_config.h" @@ -84,20 +80,22 @@ # endif #endif +#include "pdcp.h" #include "gtpv1u_eNB_task.h" #if defined(ENABLE_ITTI) # include "intertask_interface.h" #endif - + #if ENABLE_RAL # include "rrc_eNB_ral.h" #endif -#include "SIMULATION/TOOLS/defs.h" // for taus +#include "SIMULATION/TOOLS/sim.h" // for taus //#define XER_PRINT + extern RAN_CONTEXT_t RC; #ifdef PHY_EMUL @@ -117,19 +115,19 @@ mui_t rrc_gNB_mui = 0; ///---------------------------------------------------------------------------------------------------------------/// void -openair_nrrrc_on( +openair_nr_rrc_on( const protocol_ctxt_t* const ctxt_pP ) //----------------------------------------------------------------------------- { int CC_id; - LOG_I(NR_RRC, PROTOCOL_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n", - PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); + LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n", + PROTOCOL_NR_RRC_CTXT_ARGS(ctxt_pP)); for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - rrc_config_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1); + rrc_config_nr_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1); RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1; - rrc_config_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1); + rrc_config_nr_buffer (&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1); RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1; } } @@ -148,14 +146,15 @@ init_NR_SI( ) //----------------------------------------------------------------------------- { - int i; + //int i; LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__); // copy basic parameters RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId = configuration->Nid_cell[CC_id]; - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_eNB = configuration->nb_antenna_ports[CC_id]; - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp = configuration->prefix_type[CC_id]; + RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB = configuration->nb_antenna_ports[CC_id]; + RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp = configuration->DL_prefix_type[CC_id]; + RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp_UL = configuration->UL_prefix_type[CC_id]; RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq = configuration->downlink_frequency[CC_id]; RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].ul_CarrierFreq = configuration->downlink_frequency[CC_id]+ configuration->uplink_frequency_offset[CC_id]; @@ -173,41 +172,25 @@ init_NR_SI( #endif ); - ///SIB1 - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 = 0; - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SIB1 = (uint8_t*) malloc16(32); - AssertFatal(RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].SIB1! - = NULL,PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for NR SIB1 allocated\n",PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); - - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 = do_SIB1_NR(&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id], - ctxt_pP->module_id, - CC_id - #if defined(ENABLE_ITTI) - ,configuration - #endif - ); - - AssertFatal(RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 != 255,"FATAL, RC.nrrrc[enb_mod_idP].carrier[CC_id].sizeof_SIB1 == 255"); - do_SERVINGCELLCONFIGCOMMON(ctxt_pP->module_id, CC_id #if defined(ENABLE_ITTI) ,configuration #endif ); - + LOG_I(NR_RRC,"Done init_NR_SI\n"); - rrc_mac_config_req_gNB(ctxt_pP->module_id, CC_id, - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId, - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB, - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].Ncp, - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].sib1->freqBandIndicator, - RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq, - 0, // rnti - (BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib, - (ServingCellConfigCommon_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id]servingcellconfigcommon - ); + + rrc_mac_config_req_gNB(ctxt_pP->module_id, + CC_id, + RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB, + configuration->eutra_band[CC_id], + RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq, + configuration->N_RB_DL[CC_id], + (NR_BCCH_BCH_Message_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].mib, + (NR_ServingCellConfigCommon_t *)&RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].servingcellconfigcommon + ); } @@ -216,7 +199,9 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu int CC_id; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gnb_mod_idP, GNB_FLAG_YES, NOT_A_RNTI, 0, 0,gnb_mod_idP); - LOG_I(NR_RRC,PROTOCOL_NRRRC_CTXT_FMT" Init...\n",PROTOCOL_NRRRC_CTXT_ARGS(&ctxt)); + LOG_I(NR_RRC, + PROTOCOL_NR_RRC_CTXT_FMT" Init...\n", + PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt)); #if OCP_FRAMEWORK while ( RC.nrrrc[gnb_mod_idP] == NULL ) { @@ -236,7 +221,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu RC.nrrrc[ctxt.module_id]->carrier[CC_id].Srb0.Active = 0; } - uid_linear_allocator_init(&nrrrc.nrrrc[ctxt.module_id]->uid_allocator); + uid_linear_allocator_init(&RC.nrrrc[ctxt.module_id]->uid_allocator); RB_INIT(&RC.nrrrc[ctxt.module_id]->rrc_ue_head); RC.nrrrc[ctxt.module_id]->initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL); @@ -246,7 +231,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu /// System Information INIT - LOG_I(NR_RRC, PROTOCOL_NRRRC_CTXT_FMT" Checking release \n",PROTOCOL_NRRRC_CTXT_ARGS(&ctxt)); + LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" Checking release \n",PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt)); #ifdef CBA @@ -260,8 +245,8 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu } LOG_D(NR_RRC, - PROTOCOL_NRRRC_CTXT_FMT" Initialization of 4 cba_RNTI values (%x %x %x %x) num active groups %d\n", - PROTOCOL_NRRRC_CTXT_ARGS(&ctxt), + PROTOCOL_NR_RRC_CTXT_FMT" Initialization of 4 cba_RNTI values (%x %x %x %x) num active groups %d\n", + PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt), gnb_mod_idP, RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[0], RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[1], RC.nrrrc[ctxt.module_id]->carrier[CC_id].cba_rnti[2], @@ -278,20 +263,12 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu ,configuration #endif ); - for (int ue_id = 0; ue_id < NUMBER_OF_UE_MAX; ue_id++){ - RC.nrrrc[ctxt.module_id]->carrier[CC_id].sizeof_paging[ue_id] = 0; - RC.nrrrc[ctxt.module_id]->carrier[CC_id].paging[ue_id] = (uint8_t*) malloc16(256); - } - }//END for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) - //rrc_init_NR_global_param(); + rrc_init_nr_global_param(); - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - openair_rrc_top_init_gNB(RC.nrrrc[ctxt.module_id]->carrier[CC_id].MBMS_flag,0); - } - openair_nrrrc_on(&ctxt); + openair_nr_rrc_on(&ctxt); return 0; @@ -307,9 +284,9 @@ void* rrc_gnb_task(void* args_p){ const char *msg_name_p; instance_t instance; int result; - SRB_INFO *srb_info_p; - int CC_id; - protocol_ctxt_t ctxt; + //SRB_INFO *srb_info_p; + //int CC_id; + //protocol_ctxt_t ctxt; itti_mark_task_ready(TASK_RRC_GNB); LOG_I(NR_RRC,"Entering main loop of NR_RRC message task\n"); @@ -320,7 +297,7 @@ void* rrc_gnb_task(void* args_p){ msg_name_p = ITTI_MSG_NAME(msg_p); instance = ITTI_MSG_INSTANCE(msg_p); - LOG_I(RRC,"Received message %s\n",msg_name_p); + LOG_I(NR_RRC,"Received message %s\n",msg_name_p); switch (ITTI_MSG_ID(msg_p)) { case TERMINATE_MESSAGE: @@ -337,12 +314,12 @@ void* rrc_gnb_task(void* args_p){ /* Messages from PDCP */ - +/* #if defined(ENABLE_USE_MME) - /* Messages from S1AP */ + // Messages from S1AP case S1AP_DOWNLINK_NAS: - rrc_eNB_process_S1AP_DOWNLINK_NAS(msg_p, msg_name_p, instance, &rrc_eNB_mui); + rrc_eNB_process_S1AP_DOWNLINK_NAS(msg_p, msg_name_p, instance, &rrc_gNB_mui); break; case S1AP_INITIAL_CONTEXT_SETUP_REQ: @@ -380,7 +357,7 @@ void* rrc_gnb_task(void* args_p){ break; case GTPV1U_ENB_DELETE_TUNNEL_RESP: - /* Nothing to do. Apparently everything is done in S1AP processing */ + ///Nothing to do. Apparently everything is done in S1AP processing //LOG_I(RRC, "[eNB %d] Received message %s, not processed because procedure not synched\n", //instance, msg_name_p); if (rrc_eNB_get_ue_context(RC.nrrrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti) @@ -391,7 +368,7 @@ void* rrc_gnb_task(void* args_p){ break; #endif - +*/ /* Messages from gNB app */ case NRRRC_CONFIGURATION_REQ: LOG_I(NR_RRC, "[gNB %d] Received %s : %p\n", instance, msg_name_p,&NRRRC_CONFIGURATION_REQ(msg_p)); @@ -410,48 +387,3 @@ void* rrc_gnb_task(void* args_p){ } #endif //END #if defined(ENABLE_ITTI) - -/*------------------------------------------------------------------------------*/ -void -openair_rrc_top_init_gNB(int eMBMS_active,uint8_t HO_active) -//----------------------------------------------------------------------------- -{ - - module_id_t module_id; - int CC_id; - - /* for no gcc warnings */ - (void)CC_id; - - LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_gNB_INST=%d\n", RC.nb_nr_inst); - - if (RC.nb_nr_inst > 0) { - LOG_I(RRC,"[gNB] handover active state is %d \n", HO_active); - - for (module_id=0; module_id<NB_gNB_INST; module_id++) { - RC.nrrrc[module_id]->HO_flag = (uint8_t)HO_active; - } - - #if defined(Rel10) || defined(Rel14) - LOG_I(RRC,"[gNB] eMBMS active state is %d \n", eMBMS_active); - - for (module_id=0; module_id<NB_gNB_INST; module_id++) { - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - RC.nrrrc[module_id]->carrier[CC_id].MBMS_flag = (uint8_t)eMBMS_active; - } - } - - #endif - #ifdef CBA - - for (module_id=0; module_id<RC.nb_nr_inst; module_id++) { - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - RC.nrrrc[module_id]->carrier[CC_id].num_active_cba_groups = cba_group_active; - } - } - - #endif - - }//END if (RC.nb_nr_inst > 0) - -} \ No newline at end of file diff --git a/openair2/RRC/NR_UE/L2_interface_ue.c b/openair2/RRC/NR_UE/L2_interface_ue.c index 2c51fe4c6cd88c1eb19523195e38dc25c75d9f9c..f5a5670eae846bce5a397cfb2153f5b31cfce53f 100644 --- a/openair2/RRC/NR_UE/L2_interface_ue.c +++ b/openair2/RRC/NR_UE/L2_interface_ue.c @@ -38,7 +38,6 @@ nr_mac_rrc_data_ind_ue( const module_id_t module_id, const int CC_id, const uint8_t gNB_index, - const uint32_t* frameP, const channel_t channel, const uint8_t* pduP, const sdu_size_t pdu_len){ diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c old mode 100644 new mode 100755 index a7d420ebfe89ea98a7660499dd44e62faf2746a8..846a7a6b2797699bfe6acc9ed76e52a455311868 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -287,6 +287,10 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message( NR_BCCH_BCH_Message_t *bcch_message = NULL; NR_MIB_t *mib = NR_UE_rrc_inst->mib; + if(mib != NULL){ + SEQUENCE_free( &asn_DEF_NR_BCCH_BCH_Message, (void *)mib, 1 ); + } + asn_dec_rval_t dec_rval = uper_decode_complete( NULL, &asn_DEF_NR_BCCH_BCH_Message, (void **)&bcch_message, @@ -307,10 +311,11 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message( return -1; } - // copy into rrc instance - memcpy( (void *)mib, - (void *)&bcch_message->message.choice.mib, - sizeof(NR_MIB_t) ); + // link to rrc instance + mib = &bcch_message->message.choice.mib; + //memcpy( (void *)mib, + // (void *)&bcch_message->message.choice.mib, + // sizeof(NR_MIB_t) ); nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL, NULL); diff --git a/openair2/RRC/NR_UE/rrc_list.h b/openair2/RRC/NR_UE/rrc_list.h deleted file mode 100644 index 5bad103dd43160e3281134d1c25c6cb2533f6d31..0000000000000000000000000000000000000000 --- a/openair2/RRC/NR_UE/rrc_list.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _RRC_LIST_H_ -#define _RRC_LIST_H_ - - -#define RRC_LIST_TYPE(T, N) \ - struct { \ - T *entries[N]; \ - int next[N]; \ - int prev[N]; \ - int start; \ - int count; \ - } - -// initial function for the certain list, storage number of entry, initial pointer and corresponding links -#define RRC_LIST_INIT(list, c) \ - do { \ - int iterator; \ - (list).count = (c); \ - for(iterator=0; iterator<c; ++iterator){ \ - (list).entries[iterator] = NULL; \ - (list).next[iterator] = -1; \ - (list).prev[iterator] = -1; \ - (list).start = -1; \ - } \ - }while(0) - - -// check the entry by id first then update or create new entry. -#define RRC_LIST_MOD_ADD(list, new, id_name) \ - do { \ - int iterator; \ - for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \ - if((new)->id_name == (list).entries[iterator]->id_name){ \ - (list).entries[iterator] = (new); \ - break; \ - } \ - } \ - if(iterator==-1){ \ - for(iterator=0; iterator<(list).count; ++iterator){ \ - if((list).entries[iterator] == NULL){ \ - (list).next[iterator] = (list).start; \ - (list).prev[iterator] = -1; \ - if((list).start != -1){ \ - (list).prev[list.start] = iterator; \ - } \ - (list).start = iterator; \ - (list).entries[iterator] = (new); \ - break; \ - } \ - } \ - } \ - }while(0) - -// search entries by id, unlink from the list and output free pointer for upper function to release memory -#define RRC_LIST_MOD_REL(list, id_name, id, free) \ - do{ \ - int iterator; \ - for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \ - if(id == (list).entries[iterator]->id_name){ \ - if((list).prev[iterator] == -1){ \ - (list).start = (list).next[iterator]; \ - }else{ \ - (list).next[(list).prev[iterator]] = (list).next[iterator]; \ - } \ - if((list).next[iterator] != -1){ \ - (list).prev[(list).next[iterator]] = (list).prev[iterator]; \ - } \ - (free) = (list).entries[iterator]; \ - (list).entries[iterator] = NULL; \ - break; \ - } \ - } \ - }while(0) - - -#define RRC_LIST_FOREACH(list, i) \ - for((i)=(list).start; (i) != -1; (i)=(list).next[i]) - -#define RRC_LIST_ENTRY(list, i) \ - list.entries[i] - -#endif \ No newline at end of file diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index e3ff9b0d3d77ae50ae810ab6953f2260728d97c3..4f9106b977af9552711840bf33a8ab8a6ae42eec 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -54,6 +54,112 @@ int8_t openair_rrc_top_init_ue_nr(void); +/**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config + \param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message. + \param size length of buffer*/ +//TODO check to use which one +int8_t nr_rrc_ue_decode_rrcReconfiguration(const uint8_t *buffer, const uint32_t size); +int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const uint8_t *buffer, const uint32_t size); + + +/**\brief Process NR RRC connection reconfiguration via SRB3 + \param rrcReconfiguration decoded rrc connection reconfiguration*/ +int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfiguration); + +/**\prief Process measurement config from NR RRC connection reconfiguration message + \param meas_config measurement configuration*/ +int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config); + +/**\prief Process secondary cell group config from NR RRC connection reconfiguration message or EN-DC primitives + \param cell_group_config secondary cell group configuration*/ +//TODO check EN-DC function call flow. +int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config); + +/**\prief Process radio bearer config from NR RRC connection reconfiguration message + \param radio_bearer_config radio bearer configuration*/ +int8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_bearer_config); + +/**\brief decode NR BCCH-BCH (MIB) message + \param module_idP module id + \param gNB_index gNB index + \param sduP pointer to buffer of ASN message BCCH-BCH + \param sdu_len length of buffer*/ +int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(const module_id_t module_id, const uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len); + +/**\brief Decode NR DCCH from gNB, sent from lower layer through SRB3 + \param module_id module id + \param gNB_index gNB index + \param buffer encoded DCCH bytes stream message + \param size length of buffer*/ +int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const uint8_t gNB_index, const uint8_t *buffer, const uint32_t size); + +/**\brief interface between MAC and RRC thru SRB0 (RLC TM/no PDCP) + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param channel indicator for channel of the pdu + \param pduP pointer to pdu + \param pdu_len data length of pdu*/ +int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const channel_t channel, const uint8_t* pduP, const sdu_size_t pdu_len); + +/** @}*/ +#endif +/* + * 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 proto.h + * \brief RRC functions prototypes for eNB and UE + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \email navid.nikaein@eurecom.fr + * \version 1.0 + + */ +/** \addtogroup _rrc + * @{ + */ +#ifndef _RRC_PROTO_H_ +#define _RRC_PROTO_H_ + + +#include "rrc_defs.h" +#include "NR_RRCReconfiguration.h" +#include "NR_MeasConfig.h" +#include "NR_CellGroupConfig.h" +#include "NR_RadioBearerConfig.h" +// +// main_rrc.c +// +/**\brief Layer 3 initialization*/ +int nr_l3_init_ue(void); + +// +// UE_rrc.c +// + +/**\brief Initial the top level RRC structure instance*/ +int8_t openair_rrc_top_init_ue_nr(void); + + + /**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config \param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message. \param size length of buffer*/ @@ -104,4 +210,4 @@ int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const ui int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const uint32_t *frameP, const channel_t channel, const uint8_t* pduP, const sdu_size_t pdu_len); /** @}*/ -#endif \ No newline at end of file +#endif diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c index ff6a5cd5739a85b1694324b88cb4785941805c33..a131c8293188b8ef42c8ec63c454f63ad5182b5b 100644 --- a/openair2/UTIL/LOG/log.c +++ b/openair2/UTIL/LOG/log.c @@ -172,6 +172,14 @@ int logInit (void) g_log->log_component[PHY].filelog = 0; g_log->log_component[PHY].filelog_name = "/tmp/phy.log"; + g_log->log_component[NR_PHY].name = "NR_PHY"; + g_log->log_component[NR_PHY].level = LOG_EMERG; + g_log->log_component[NR_PHY].flag = LOG_MED; + g_log->log_component[NR_PHY].interval = 1; + g_log->log_component[NR_PHY].fd = 0; + g_log->log_component[NR_PHY].filelog = 0; + g_log->log_component[NR_PHY].filelog_name = "/tmp/nrphy.log"; + g_log->log_component[MAC].name = "MAC"; g_log->log_component[MAC].level = LOG_EMERG; g_log->log_component[MAC].flag = LOG_MED; @@ -180,6 +188,14 @@ int logInit (void) g_log->log_component[MAC].filelog = 0; g_log->log_component[MAC].filelog_name = "/tmp/mac.log"; + g_log->log_component[NR_MAC].name = "NR_MAC"; + g_log->log_component[NR_MAC].level = LOG_EMERG; + g_log->log_component[NR_MAC].flag = LOG_MED; + g_log->log_component[NR_MAC].interval = 1; + g_log->log_component[NR_MAC].fd = 0; + g_log->log_component[NR_MAC].filelog = 0; + g_log->log_component[NR_MAC].filelog_name = "/tmp/nrmac.log"; + g_log->log_component[OPT].name = "OPT"; g_log->log_component[OPT].level = LOG_EMERG; g_log->log_component[OPT].flag = LOG_MED; @@ -212,6 +228,14 @@ int logInit (void) g_log->log_component[RRC].filelog = 0; g_log->log_component[RRC].filelog_name = "/tmp/rrc.log"; + g_log->log_component[NR_RRC].name = "NR_RRC"; + g_log->log_component[NR_RRC].level = LOG_TRACE; + g_log->log_component[NR_RRC].flag = LOG_MED; + g_log->log_component[NR_RRC].interval = 1; + g_log->log_component[NR_RRC].fd = 0; + g_log->log_component[NR_RRC].filelog = 0; + g_log->log_component[NR_RRC].filelog_name = "/tmp/nrrrc.log"; + g_log->log_component[EMU].name = "EMU"; g_log->log_component[EMU].level = LOG_EMERG; g_log->log_component[EMU].flag = LOG_MED; @@ -364,6 +388,14 @@ int logInit (void) g_log->log_component[ENB_APP].filelog = 0; g_log->log_component[ENB_APP].filelog_name = ""; + g_log->log_component[GNB_APP].name = "GNB_APP"; + g_log->log_component[GNB_APP].level = LOG_EMERG; + g_log->log_component[GNB_APP].flag = LOG_MED; + g_log->log_component[GNB_APP].interval = 1; + g_log->log_component[GNB_APP].fd = 0; + g_log->log_component[GNB_APP].filelog = 0; + g_log->log_component[GNB_APP].filelog_name = ""; + g_log->log_component[FLEXRAN_AGENT].name = "FLEXRAN_AGENT"; g_log->log_component[FLEXRAN_AGENT].level = LOG_DEBUG; g_log->log_component[FLEXRAN_AGENT].flag = LOG_MED; diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index 00bc334de5b3a25e8a00ead69f68889c18179a9b..0bd2f863dc69c495a15231840ceea861556236e0 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -185,6 +185,10 @@ typedef enum { LOCALIZE, RRH, X2AP, + GNB_APP, + NR_RRC, + NR_MAC, + NR_PHY, MAX_LOG_COMPONENTS, } comp_name_t; diff --git a/targets/COMMON/create_nr_tasks.c b/targets/COMMON/create_nr_tasks.c new file mode 100644 index 0000000000000000000000000000000000000000..18bda25644e80af5282785ed727c71e0bbcd98d6 --- /dev/null +++ b/targets/COMMON/create_nr_tasks.c @@ -0,0 +1,105 @@ +/* + * 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 + */ + +#if defined(ENABLE_ITTI) +# include "intertask_interface.h" +# include "create_nr_tasks.h" +# include "log.h" + +# ifdef OPENAIR2 +# if defined(ENABLE_USE_MME) +# include "sctp_eNB_task.h" +# include "s1ap_eNB.h" +# include "nas_ue_task.h" +# include "udp_eNB_task.h" +# include "gtpv1u_eNB_task.h" +# endif +# if ENABLE_RAL +# include "lteRALue.h" +# include "lteRALenb.h" +# endif +# include "RRC/NR/nr_rrc_defs.h" +# endif +# include "gnb_app.h" + +extern int emulate_rf; + +int create_gNB_tasks(uint32_t gnb_nb) +{ + LOG_D(GNB_APP, "%s(gnb_nb:%d\n", __FUNCTION__, gnb_nb); + + itti_wait_ready(1); + if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) { + LOG_E(PDCP, "Create task for L2L1 failed\n"); + return -1; + } + + if (gnb_nb > 0) { + /* Last task to create, others task must be ready before its start */ + if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) { + LOG_E(GNB_APP, "Create task for gNB APP failed\n"); + return -1; + } + } + +/* +# if defined(ENABLE_USE_MME) + if (gnb_nb > 0) { + if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) { + LOG_E(SCTP, "Create task for SCTP failed\n"); + return -1; + } + + if (itti_create_task (TASK_S1AP, s1ap_eNB_task, NULL) < 0) { + LOG_E(S1AP, "Create task for S1AP failed\n"); + return -1; + } + if(!emulate_rf){ + if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) { + LOG_E(UDP_, "Create task for UDP failed\n"); + return -1; + } + } + + if (itti_create_task (TASK_GTPV1_U, >pv1u_eNB_task, NULL) < 0) { + LOG_E(GTPU, "Create task for GTPV1U failed\n"); + return -1; + } + } + +# endif +*/ + + if (gnb_nb > 0) { + LOG_I(NR_RRC,"Creating NR RRC gNB Task\n"); + + if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) { + LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n"); + return -1; + } + } + + + itti_wait_ready(0); + + return 0; +} +#endif diff --git a/targets/COMMON/create_nr_tasks.h b/targets/COMMON/create_nr_tasks.h new file mode 100644 index 0000000000000000000000000000000000000000..7f5961f5aef5cdd0a3653ad60f5615aeec5686b5 --- /dev/null +++ b/targets/COMMON/create_nr_tasks.h @@ -0,0 +1,33 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +#ifndef CREATE_NR_TASKS_H_ +#define CREATE_NR_TASKS_H_ + +#if defined(ENABLE_ITTI) +/* External declaration of L2L1 task that depend on the target */ +extern void *l2l1_task(void *arg); + +int create_gNB_tasks(uint32_t gnb_nb); + +#endif + +#endif /* CREATE_TASKS_H_ */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index aaaf00546a307d2e709237a19574091fa824d163..6e586c99c352a477c209f25e3adf4ffd2a7981b0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -1,16 +1,16 @@ -Active_eNBs = ( "gNB-Eurecom-LTEBox"); +Active_gNBs = ( "gNB-Eurecom-5GNRBox"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; -eNBs = +gNBs = ( { ////////// Identification parameters: - eNB_ID = 0xe00; + gNB_ID = 0xe00; - cell_type = "CELL_MACRO_ENB"; + cell_type = "CELL_MACRO_GNB"; - eNB_name = "gNB-Eurecom-LTEBox"; + gNB_name = "gNB-Eurecom-5GNRBox"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = "1"; @@ -25,86 +25,156 @@ eNBs = component_carriers = ( { - node_function = "3GPP_gNODEB"; - node_timing = "synch_to_ext_device"; - node_synch_ref = 0; - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 22; - downlink_frequency = 3510000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 100; - Nid_cell_mbsfn = 0; - nb_antenna_ports = 1; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 125; - pbch_repetition = "FALSE"; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 0; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -27; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -96; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -104; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - ue_TransmissionMode = 1; + node_function = "3GPP_gNODEB"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + DL_prefix_type = "NORMAL"; + UL_prefix_type = "NORMAL"; + eutra_band = 22; + downlink_frequency = 3510000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 106; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + MIB_subCarrierSpacingCommon = 30; + MIB_ssb_SubcarrierOffset = 0; + MIB_dmrs_TypeA_Position = 2; + pdcch_ConfigSIB1 = 0; + SIB1_frequencyOffsetSSB = "khz5"; + SIB1_ssb_PeriodicityServingCell = 5; + SIB1_ss_PBCH_BlockPower = -60; + absoluteFrequencySSB = 0; + ssb_SubcarrierOffset = 15; + DL_FreqBandIndicatorNR = 15; + DL_absoluteFrequencyPointA = 15; + DL_offsetToCarrier = 15; + DL_SCS_SubcarrierSpacing = "kHz15"; + DL_SCS_SpecificCarrier_k0 = 0; + DL_carrierBandwidth = 15; + DL_locationAndBandwidth = 15; + DL_BWP_SubcarrierSpacing = "kHz15"; + DL_BWP_prefix_type = "NORMAL"; + UL_FreqBandIndicatorNR = 15; + UL_absoluteFrequencyPointA = 13; + UL_additionalSpectrumEmission = 3; + UL_p_Max = -1; + UL_frequencyShift7p5khz = "TRUE"; + UL_offsetToCarrier = 10; + UL_SCS_SubcarrierSpacing = "kHz15"; + UL_SCS_SpecificCarrier_k0 = 0; + UL_carrierBandwidth = 15; + UL_locationAndBandwidth = 15; + UL_BWP_SubcarrierSpacing = "kHz15"; + UL_BWP_prefix_type = "NORMAL"; + ServingCellConfigCommon__ssb_PositionsInBurst_PR = "shortBitmap"; + ServingCellConfigCommon_ssb_periodicityServingCell = 10; + ServingCellConfigCommon_dmrs_TypeA_Position = 2; + NIA_SubcarrierSpacing = "kHz15"; + ServingCellConfigCommon_ss_PBCH_BlockPower = -60; + referenceSubcarrierSpacing = "kHz15"; + dl_UL_TransmissionPeriodicity = "ms0p5"; + nrofDownlinkSlots = 10; + nrofDownlinkSymbols = 10; + nrofUplinkSlots = 10; + nrofUplinkSymbols = 10; + rach_totalNumberOfRA_Preambles = 63; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice = "oneEighth"; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth = 4; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth = 8; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf = 16; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one = 24; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two = 32; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four = 8; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight = 4; + rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen = 2; + rach_groupBconfigured = "ENABLE"; + rach_ra_Msg3SizeGroupA = 56; + rach_messagePowerOffsetGroupB = "dB0"; + rach_numberOfRA_PreamblesGroupA = 32; + rach_ra_ContentionResolutionTimer = 8; + rsrp_ThresholdSSB = 64; + rsrp_ThresholdSSB_SUL = 64; + prach_RootSequenceIndex_choice = "l839"; + prach_RootSequenceIndex_l839 = 0; + prach_RootSequenceIndex_l139 = 0; + prach_msg1_SubcarrierSpacing = "kHz15"; + restrictedSetConfig = "unrestrictedSet"; + msg3_transformPrecoding = "ENABLE"; + prach_ConfigurationIndex = 10; + prach_msg1_FDM = "one"; + prach_msg1_FrequencyStart = 10; + zeroCorrelationZoneConfig = 10; + preambleReceivedTargetPower = -150; + preambleTransMax = 6; + powerRampingStep = "dB0"; + ra_ResponseWindow = 8; + groupHoppingEnabledTransformPrecoding = "ENABLE"; + msg3_DeltaPreamble = 0; + p0_NominalWithGrant = 0; + PUSCH_TimeDomainResourceAllocation_k2 = 0; + PUSCH_TimeDomainResourceAllocation_mappingType = "typeA"; + pucch_GroupHopping = "neither"; + p0_nominal = -30; + PDSCH_TimeDomainResourceAllocation_k0 = 2; + PDSCH_TimeDomainResourceAllocation_mappingType = "typeA"; + rateMatchPatternId = 0; + RateMatchPattern_patternType = "bitmaps"; + symbolsInResourceBlock = "oneSlot"; + periodicityAndPattern = 2; + RateMatchPattern_controlResourceSet = 5; + RateMatchPattern_subcarrierSpacing = "kHz15"; + RateMatchPattern_mode = "dynamic"; + searchSpaceSIB1 = 10; + searchSpaceOtherSystemInformation = 10; + pagingSearchSpace = 10; + ra_SearchSpace = 10; + rach_ra_ControlResourceSet = 10; + PDCCH_common_controlResourceSetId = 5; + PDCCH_common_ControlResourceSet_duration = 2; + PDCCH_cce_REG_MappingType = "nonInterleaved"; + PDCCH_reg_BundleSize = 3; + PDCCH_interleaverSize = 3; + PDCCH_shiftIndex = 10; + PDCCH_precoderGranularity = "sameAsREG-bundle"; + PDCCH_TCI_StateId = 32; + tci_PresentInDCI = "ENABLE"; + SearchSpaceId = 10; + commonSearchSpaces_controlResourceSetId = 5; + SearchSpace_monitoringSlotPeriodicityAndOffset_choice = "sl1"; + SearchSpace_monitoringSlotPeriodicityAndOffset_sl1 = 0; + SearchSpace_monitoringSlotPeriodicityAndOffset_sl2 = 0; + SearchSpace_monitoringSlotPeriodicityAndOffset_sl4 = 0; + SearchSpace_monitoringSlotPeriodicityAndOffset_sl5 = 0; + SearchSpace_monitoringSlotPeriodicityAndOffset_sl8 = 0; + SearchSpace_monitoringSlotPeriodicityAndOffset_sl10 = 0; + SearchSpace_monitoringSlotPeriodicityAndOffset_sl16 = 0; + SearchSpace_monitoringSlotPeriodicityAndOffset_sl20 = 0; + SearchSpace_nrofCandidates_aggregationLevel1 = 0; + SearchSpace_nrofCandidates_aggregationLevel2 = 0; + SearchSpace_nrofCandidates_aggregationLevel4 = 0; + SearchSpace_nrofCandidates_aggregationLevel8 = 0; + SearchSpace_nrofCandidates_aggregationLevel16 = 0; + SearchSpace_searchSpaceType = "common"; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1 = 1; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2 = 1; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4 = 1; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8 = 1; + Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16 = 1; + Common_dci_Format2_3_monitoringPeriodicity = 1; + Common_dci_Format2_3_nrofPDCCH_Candidates = 1; + ue_Specific__dci_Formats = "formats0-0-And-1-0"; + RateMatchPatternLTE_CRS_carrierFreqDL = 6; + RateMatchPatternLTE_CRS_carrierBandwidthDL = 6; + RateMatchPatternLTE_CRS_nrofCRS_Ports = 1; + RateMatchPatternLTE_CRS_v_Shift = 0; + RateMatchPatternLTE_CRS_radioframeAllocationPeriod = 1; + RateMatchPatternLTE_CRS_radioframeAllocationOffset = 0; + RateMatchPatternLTE_CRS_subframeAllocation_choice = "oneFrame"; } ); @@ -150,11 +220,11 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 + GNB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + GNB_INTERFACE_NAME_FOR_S1U = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; } ); diff --git a/targets/RT/USER/nr-gnb.c b/targets/RT/USER/nr-gnb.c index 591a8793848a0022d6e567612e65601dcfc4fbb4..a419e224615911a4bc8bc915d8b1a2b4169487cc 100644 --- a/targets/RT/USER/nr-gnb.c +++ b/targets/RT/USER/nr-gnb.c @@ -578,9 +578,9 @@ void init_gNB_proc(int inst) { pthread_attr_t *attr0=NULL,*attr1=NULL; //*attr_prach=NULL; - LOG_I(PHY,"%s(inst:%d) RC.nb_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_CC[inst]); + LOG_I(PHY,"%s(inst:%d) RC.nb_nr_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_nr_CC[inst]); - for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) { + for (CC_id=0; CC_id<RC.nb_nr_CC[inst]; CC_id++) { gNB = RC.gNB[inst][CC_id]; #ifndef OCP_FRAMEWORK LOG_I(PHY,"Initializing gNB processes instance:%d CC_id %d \n",inst,CC_id); @@ -817,13 +817,13 @@ void init_eNB_afterRU(void) { int inst,CC_id,ru_id,i,aa; PHY_VARS_gNB *gNB; - LOG_I(PHY,"%s() RC.nb_inst:%d\n", __FUNCTION__, RC.nb_inst); + LOG_I(PHY,"%s() RC.nb_nr_inst:%d\n", __FUNCTION__, RC.nb_nr_inst); - for (inst=0;inst<RC.nb_inst;inst++) { - LOG_I(PHY,"RC.nb_CC[inst]:%d\n", RC.nb_CC[inst]); - for (CC_id=0;CC_id<RC.nb_CC[inst];CC_id++) { + for (inst=0;inst<RC.nb_nr_inst;inst++) { + LOG_I(PHY,"RC.nb_nr_CC[inst]:%d\n", RC.nb_nr_CC[inst]); + for (CC_id=0;CC_id<RC.nb_nr_CC[inst];CC_id++) { - LOG_I(PHY,"RC.nb_CC[inst:%d][CC_id:%d]:%p\n", inst, CC_id, RC.gNB[inst][CC_id]); + LOG_I(PHY,"RC.nb_nr_CC[inst:%d][CC_id:%d]:%p\n", inst, CC_id, RC.gNB[inst][CC_id]); gNB = RC.gNB[inst][CC_id]; phy_init_nr_gNB(gNB,0,0); @@ -908,13 +908,13 @@ void init_gNB(int single_thread_flag,int wait_for_sync) { int inst; PHY_VARS_gNB *gNB; - LOG_I(PHY,"[nr-softmodem.c] gNB structure about to allocated RC.nb_L1_inst:%d RC.nb_L1_CC[0]:%d\n",RC.nb_L1_inst,RC.nb_L1_CC[0]); + LOG_I(PHY,"[nr-softmodem.c] gNB structure about to allocated RC.nb_nr_L1_inst:%d RC.nb_nr_L1_CC[0]:%d\n",RC.nb_nr_L1_inst,RC.nb_nr_L1_CC[0]); - if (RC.gNB == NULL) RC.gNB = (PHY_VARS_gNB***) malloc(RC.nb_L1_inst*sizeof(PHY_VARS_gNB **)); + if (RC.gNB == NULL) RC.gNB = (PHY_VARS_gNB***) malloc(RC.nb_nr_L1_inst*sizeof(PHY_VARS_gNB **)); LOG_I(PHY,"[lte-softmodem.c] gNB structure RC.gNB allocated\n"); - for (inst=0;inst<RC.nb_L1_inst;inst++) { - if (RC.gNB[inst] == NULL) RC.gNB[inst] = (PHY_VARS_gNB**) malloc(RC.nb_CC[inst]*sizeof(PHY_VARS_gNB *)); - for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) { + for (inst=0;inst<RC.nb_nr_L1_inst;inst++) { + if (RC.gNB[inst] == NULL) RC.gNB[inst] = (PHY_VARS_gNB**) malloc(RC.nb_nr_CC[inst]*sizeof(PHY_VARS_gNB *)); + for (CC_id=0;CC_id<RC.nb_nr_L1_CC[inst];CC_id++) { if (RC.gNB[inst][CC_id] == NULL) RC.gNB[inst][CC_id] = (PHY_VARS_gNB*) malloc(sizeof(PHY_VARS_gNB)); gNB = RC.gNB[inst][CC_id]; gNB->abstraction_flag = 0; @@ -927,10 +927,9 @@ void init_gNB(int single_thread_flag,int wait_for_sync) { #endif LOG_I(PHY,"Registering with MAC interface module\n"); - AssertFatal((gNB->if_inst = IF_Module_init(inst))!=NULL,"Cannot register interface"); + AssertFatal((gNB->if_inst = NR_IF_Module_init(inst))!=NULL,"Cannot register interface"); gNB->if_inst->schedule_response = schedule_response; - gNB->if_inst->PHY_config_req = phy_config_request; - nr_phy_config_request(gNB); + gNB->if_inst->PHY_config_req = nr_phy_config_request; memset((void*)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO)); memset((void*)&gNB->Sched_INFO,0,sizeof(gNB->Sched_INFO)); LOG_I(PHY,"Setting indication lists\n"); diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index c2d09be83f838076c7e8dfdf7ca7c213becf3c15..cbec8b7999d7c0e12cae237153152bde1c36434c 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -133,7 +133,7 @@ extern volatile int oai_exit; extern void nr_phy_init_RU(RU_t*); extern void nr_phy_free_RU(RU_t*); -extern void nr_phy_config_request(PHY_VARS_gNB *gNB); +extern void nr_phy_config_request(NR_PHY_Config_t *gNB); void init_RU(char*); void stop_RU(int nb_ru); @@ -600,7 +600,7 @@ void fh_if5_north_asynch_in(RU_t *ru,int *frame,int *subframe) { void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) { NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; - nfapi_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; + nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; RU_proc_t *proc = &ru->proc; uint16_t packet_type; @@ -782,7 +782,7 @@ void tx_rf(RU_t *ru) { RU_proc_t *proc = &ru->proc; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; - nfapi_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; + nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config; void *txp[ru->nb_tx]; unsigned int txs; int i; @@ -1179,7 +1179,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) { int i; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; - nfapi_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; //tmp index + nfapi_nr_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; //tmp index openair0_config_t *cfg = &ru->openair0_cfg; int N_RB = gNB_config->rf_config.dl_channel_bandwidth.value; int mu = gNB_config->subframe_config.numerology_index_mu.value; @@ -1281,7 +1281,7 @@ int setup_RU_buffers(RU_t *ru) { //uint16_t N_TA_offset = 0; NR_DL_FRAME_PARMS *frame_parms; - //nfapi_config_request_t *gNB_config = ru->gNB_list[0]->gNB_config; //tmp index + //nfapi_nr_config_request_t *gNB_config = ru->gNB_list[0]->gNB_config; //tmp index if (ru) { frame_parms = ru->nr_frame_parms; @@ -1841,7 +1841,7 @@ void configure_ru(int idx, RU_t *ru = RC.ru[idx]; RRU_config_t *config = (RRU_config_t *)arg; RRU_capabilities_t *capabilities = (RRU_capabilities_t*)arg; - nfapi_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; + nfapi_nr_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; int ret; LOG_I(PHY, "Received capabilities from RRU %d\n",idx); @@ -1885,7 +1885,7 @@ void configure_rru(int idx, RRU_config_t *config = (RRU_config_t *)arg; RU_t *ru = RC.ru[idx]; - nfapi_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; + nfapi_nr_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config; ru->nr_frame_parms->eutra_band = config->band_list[0]; ru->nr_frame_parms->dl_CarrierFreq = config->tx_freq[0]; @@ -2120,11 +2120,11 @@ void init_RU(char *rf_config_file) { // read in configuration file) printf("configuring RU from file\n"); RCconfig_RU(); - LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_L1_inst,RC.nb_RU,get_nprocs()); + LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_nr_L1_inst,RC.nb_RU,get_nprocs()); - if (RC.nb_CC != 0) - for (i=0;i<RC.nb_L1_inst;i++) - for (CC_id=0;CC_id<RC.nb_CC[i];CC_id++) RC.gNB[i][CC_id]->num_RU=0; + if (RC.nb_nr_CC != 0) + for (i=0;i<RC.nb_nr_L1_inst;i++) + for (CC_id=0;CC_id<RC.nb_nr_CC[i];CC_id++) RC.gNB[i][CC_id]->num_RU=0; LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU); for (ru_id=0;ru_id<RC.nb_RU;ru_id++) { @@ -2237,7 +2237,7 @@ void RCconfig_RU(void) { printf("Creating RC.ru[%d]:%p\n", j, RC.ru[j]); RC.ru[j]->if_timing = synch_to_ext_device; - if (RC.nb_L1_inst >0) + if (RC.nb_nr_L1_inst >0) RC.ru[j]->num_gNB = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt; else RC.ru[j]->num_gNB = 0; diff --git a/targets/RT/USER/nr-softmodem.c b/targets/RT/USER/nr-softmodem.c index 506a34d81abfe332582cc21894e88610e129a2f7..8bace5d0a2ee543eabef6af46e77ed32ae36cb40 100644 --- a/targets/RT/USER/nr-softmodem.c +++ b/targets/RT/USER/nr-softmodem.c @@ -56,7 +56,7 @@ #include "LAYER2/MAC/mac_proto.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" - +#include "gnb_config.h" #ifdef SMBV #include "PHY/TOOLS/smbv.h" unsigned short config_frames[4] = {2,9,11,13}; @@ -76,7 +76,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #if defined(ENABLE_ITTI) #include "intertask_interface_init.h" -#include "create_tasks.h" +#include "create_nr_tasks.h" #endif #include "PHY/INIT/phy_init.h" @@ -193,7 +193,7 @@ int otg_enabled; //static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; -static nfapi_config_request_t *config[MAX_NUM_CCs]; +static nfapi_nr_config_request_t *config[MAX_NUM_CCs]; uint32_t target_dl_mcs = 28; //maximum allowed mcs uint32_t target_ul_mcs = 20; uint32_t timing_advance = 0; @@ -231,7 +231,7 @@ threads_t threads= {-1,-1,-1,-1,-1,-1,-1}; uint8_t abstraction_flag=0; /* forward declarations */ -void set_default_frame_parms(nfapi_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); +void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); /*---------------------BMC: timespec helpers -----------------------------*/ @@ -548,10 +548,10 @@ static void get_options(void) { if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) { memset((void*)&RC,0,sizeof(RC)); /* Read RC configuration file */ - RCConfig(); - NB_gNB_INST = RC.nb_inst; + NRRCConfig(); + NB_gNB_INST = RC.nb_nr_inst; NB_RU = RC.nb_RU; - printf("Configuration: nb_rrc_inst %d, nb_L1_inst %d, nb_ru %d\n",NB_gNB_INST,RC.nb_L1_inst,NB_RU); + printf("Configuration: nb_rrc_inst %d, nb_nr_L1_inst %d, nb_ru %d\n",NB_gNB_INST,RC.nb_nr_L1_inst,NB_RU); } } @@ -564,13 +564,13 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ -void set_default_frame_parms(nfapi_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { +void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { int CC_id; for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { frame_parms[CC_id] = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS)); - config[CC_id] = (nfapi_config_request_t*) malloc(sizeof(nfapi_config_request_t)); + config[CC_id] = (nfapi_nr_config_request_t*) malloc(sizeof(nfapi_nr_config_request_t)); config[CC_id]->subframe_config.numerology_index_mu.value =1; config[CC_id]->subframe_config.duplex_mode.value = 1; //FDD config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL @@ -731,14 +731,14 @@ void wait_gNBs(void) { while (waiting==1) { - printf("Waiting for gNB L1 instances to all get configured ... sleeping 50ms (nb_L1_inst %d)\n",RC.nb_L1_inst); + printf("Waiting for gNB L1 instances to all get configured ... sleeping 50ms (nb_nr_sL1_inst %d)\n",RC.nb_nr_L1_inst); usleep(50*1000); waiting=0; - for (i=0;i<RC.nb_L1_inst;i++) { + for (i=0;i<RC.nb_nr_L1_inst;i++) { - printf("RC.nb_L1_CC[%d]:%d\n", i, RC.nb_L1_CC[i]); + printf("RC.nb_nr_L1_CC[%d]:%d\n", i, RC.nb_nr_L1_CC[i]); - for (j=0;j<RC.nb_L1_CC[i];j++) { + for (j=0;j<RC.nb_nr_L1_CC[i];j++) { if (RC.gNB[i][j]->configured==0) { waiting=1; break; @@ -801,7 +801,7 @@ int stop_L1L2(module_id_t gnb_id) LOG_I(ENB_APP, "calling kill_RU_proc() for instance %d\n", gnb_id); kill_RU_proc(gnb_id); oai_exit = 0; - for (int cc_id = 0; cc_id < RC.nb_CC[gnb_id]; cc_id++) { + for (int cc_id = 0; cc_id < RC.nb_nr_CC[gnb_id]; cc_id++) { //free_transport(RC.gNB[gnb_id][cc_id]); phy_free_nr_gNB(RC.gNB[gnb_id][cc_id]); } @@ -824,7 +824,7 @@ int restart_L1L2(module_id_t gnb_id) /* block threads */ sync_var = -1; - for (cc_id = 0; cc_id < RC.nb_L1_CC[gnb_id]; cc_id++) { + for (cc_id = 0; cc_id < RC.nb_nr_L1_CC[gnb_id]; cc_id++) { RC.gNB[gnb_id][cc_id]->configured = 0; } @@ -1045,10 +1045,10 @@ int main( int argc, char **argv ) #if defined(ENABLE_ITTI) - if (RC.nb_inst > 0) { + if (RC.nb_nr_inst > 0) { // don't create if node doesn't connect to RRC/S1/GTP - if (create_tasks(1) < 0) { + if (create_gNB_tasks(1) < 0) { printf("cannot create ITTI tasks\n"); exit(-1); // need a softer mode } @@ -1061,8 +1061,8 @@ int main( int argc, char **argv ) #endif /* Start the agent. If it is turned off in the configuration, it won't start */ - RCconfig_flexran(); - for (i = 0; i < RC.nb_L1_inst; i++) { + RCconfig_nr_flexran(); + for (i = 0; i < RC.nb_nr_L1_inst; i++) { flexran_agent_start(i); } @@ -1150,8 +1150,8 @@ int main( int argc, char **argv ) // start the main threads number_of_cards = 1; - printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst); - if (RC.nb_L1_inst > 0) { + printf("RC.nb_nr_L1_inst:%d\n", RC.nb_nr_L1_inst); + if (RC.nb_nr_L1_inst > 0) { printf("Initializing gNB threads single_thread_flag:%d wait_for_sync:%d\n", single_thread_flag,wait_for_sync); init_gNB(single_thread_flag,wait_for_sync); } @@ -1257,7 +1257,7 @@ int main( int argc, char **argv ) /* release memory used by the RU/gNB threads (incomplete), after all * threads have been stopped (they partially use the same memory) */ for (int inst = 0; inst < NB_gNB_INST; inst++) { - for (int cc_id = 0; cc_id < RC.nb_CC[inst]; cc_id++) { + for (int cc_id = 0; cc_id < RC.nb_nr_CC[inst]; cc_id++) { //free_transport(RC.gNB[inst][cc_id]); phy_free_nr_gNB(RC.gNB[inst][cc_id]); } diff --git a/targets/RT/USER/nr-ue.c b/targets/RT/USER/nr-ue.c index 49a2307c9e8a1fd8f5d79ec5f6ecbd3ade8c7035..5c6f25bb8d08daded882c8776151d614b361289e 100644 --- a/targets/RT/USER/nr-ue.c +++ b/targets/RT/USER/nr-ue.c @@ -61,8 +61,8 @@ #include "T.h" extern double cpuf; -static nfapi_config_request_t config_t; -static nfapi_config_request_t* config =&config_t; +static nfapi_nr_config_request_t config_t; +static nfapi_nr_config_request_t* config =&config_t; #define FRAME_PERIOD 100000000ULL #define DAQ_PERIOD 66667ULL diff --git a/targets/RT/USER/nr-uesoftmodem.c b/targets/RT/USER/nr-uesoftmodem.c index c34c10044fabcf7534d7f964478c53fbdea75237..0f8c5313ad2b8b29f41ea1b58f3f683d98a64724 100644 --- a/targets/RT/USER/nr-uesoftmodem.c +++ b/targets/RT/USER/nr-uesoftmodem.c @@ -181,7 +181,7 @@ int otg_enabled; //int number_of_cards = 1; static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; -static nfapi_config_request_t *config[MAX_NUM_CCs]; +static nfapi_nr_config_request_t *config[MAX_NUM_CCs]; int16_t node_synch_ref[MAX_NUM_CCs]; uint32_t target_dl_mcs = 28; //maximum allowed mcs @@ -245,7 +245,7 @@ int emulate_rf = 0; threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; /* forward declarations */ -void set_default_frame_parms(nfapi_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); +void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed @@ -551,7 +551,7 @@ static void get_options (int argc, char **argv) { uint32_t online_log_messages; uint32_t glog_level, glog_verbosity; uint32_t start_telnetsrv; - nfapi_config_request_t *config[MAX_NUM_CCs]; + nfapi_nr_config_request_t *config[MAX_NUM_CCs]; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; @@ -628,7 +628,7 @@ int T_port = 2021; /* default port to listen to to wait for the tracer */ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ #endif - void set_default_frame_parms(nfapi_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { + void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { int CC_id; @@ -636,7 +636,7 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ frame_parms[CC_id] = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS)); /* Set some default values that may be overwritten while reading options */ frame_parms[CC_id] = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS)); - config[CC_id] = (nfapi_config_request_t*) malloc(sizeof(nfapi_config_request_t)); + config[CC_id] = (nfapi_nr_config_request_t*) malloc(sizeof(nfapi_nr_config_request_t)); config[CC_id]->subframe_config.numerology_index_mu.value =1; config[CC_id]->subframe_config.duplex_mode.value = 1; //FDD config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL @@ -695,7 +695,7 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ } -void set_default_frame_parms_single(nfapi_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms) { +void set_default_frame_parms_single(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms) { //int CC_id; @@ -703,7 +703,7 @@ void set_default_frame_parms_single(nfapi_config_request_t *config, NR_DL_FRAME_ frame_parms = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS)); /* Set some default values that may be overwritten while reading options */ frame_parms = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS)); - config = (nfapi_config_request_t*) malloc(sizeof(nfapi_config_request_t)); + config = (nfapi_nr_config_request_t*) malloc(sizeof(nfapi_nr_config_request_t)); config->subframe_config.numerology_index_mu.value =1; config->subframe_config.duplex_mode.value = 1; //FDD config->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL