Commit 73cfa6bb authored by WEI-TAI CHEN's avatar WEI-TAI CHEN

- Maintain The Configuration Module

- Create task for GAB_APP and GAN_RRC
- Create the NR FAPI for P5 interface
- *It could be build, but still have a lot of warning need to maintain
parent 5b94aeac
......@@ -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")
......@@ -1299,12 +1320,15 @@ 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(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE)
set(NR_PHY_INTERFACE_DIR ${OPENAIR2_DIR}/NR_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(PDCP_DIR ${OPENAIR2_DIR}/LAYER2/PDCP_v10.1.0)
set(L2_SRC
${OPENAIR2_DIR}/LAYER2/openair2_proc.c
......@@ -1350,6 +1374,8 @@ 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
)
set(L2_SRC_UE
......@@ -1413,6 +1439,9 @@ set (MAC_SRC
${MAC_DIR}/pre_processor.c
${MAC_DIR}/config.c
${MAC_DIR}/config_ue.c
${NR_PHY_INTERFACE_DIR}/IF_Module.c
${NR_MAC_DIR}/main.c
${NR_MAC_DIR}/config.c
)
set (MAC_SRC_UE
......@@ -1430,10 +1459,16 @@ 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
......@@ -2124,6 +2159,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
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
......@@ -2142,7 +2178,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}
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)
......
......@@ -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`
......
......@@ -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
......
......@@ -50,7 +50,7 @@
#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
......@@ -69,14 +69,20 @@ 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 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
......@@ -97,6 +103,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
......
#ifndef _NFAPI_INTERFACE_NR_H_
#define _NFAPI_INTERFACE_NR_H_
#include "nfapi_interface.h"
//These TLVs are used exclusively by nFAPI
typedef struct
{
// These TLVs are used to setup the transport connection between VNF and PNF
// nfapi_ipv4_address_t p7_vnf_address_ipv4;
// nfapi_ipv6_address_t p7_vnf_address_ipv6;
// nfapi_uint16_tlv_t p7_vnf_port;
// nfapi_ipv4_address_t p7_pnf_address_ipv4;
// nfapi_ipv6_address_t p7_pnf_address_ipv6;
// nfapi_uint16_tlv_t p7_pnf_port;
// // These TLVs are used to setup the transport connection between VNF and PNF
// nfapi_uint8_tlv_t dl_ue_per_sf;
// nfapi_uint8_tlv_t ul_ue_per_sf;
// These TLVs are used by PNF to report its RF capabilities to the VNF software
nfapi_rf_bands_t rf_bands;
// These TLVs are used by the VNF to configure the synchronization with the PNF.
// nfapi_uint8_tlv_t timing_window;
// nfapi_uint8_tlv_t timing_info_mode;
// nfapi_uint8_tlv_t timing_info_period;
// These TLVs are used by the VNF to configure the RF in the PNF
// nfapi_uint16_tlv_t max_transmit_power;
nfapi_uint16_tlv_t earfcn;
// nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands;
// nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands;
// nfapi_nmm_frequency_bands_t nmm_lte_frequency_bands;
// nfapi_uint8_tlv_t nmm_uplink_rssi_supported;
} nfapi_nr_nfapi_t;
#define NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG 0x5100
#define NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG 0x5101
#define NFAPI_NR_NFAPI_P7_VNF_PORT_TAG 0x5102
#define NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG 0x5103
#define NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG 0x5104
#define NFAPI_NR_NFAPI_P7_PNF_PORT_TAG 0x5105
#define NFAPI_NR_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG 0x510A
#define NFAPI_NR_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG 0x510B
#define NFAPI_NR_NFAPI_RF_BANDS_TAG 0x5114
#define NFAPI_NR_NFAPI_TIMING_WINDOW_TAG 0x511E
#define NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG 0x511F
#define NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG 0x5120
#define NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG 0x5128
#define NFAPI_NR_NFAPI_EARFCN_TAG 0x5129
#define NFAPI_NR_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG 0x5130
#define NFAPI_NR_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG 0x5131
#define NFAPI_NR_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG 0x5132
#define NFAPI_NR_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG 0x5133
// P5 Message Structures
typedef struct {
nfapi_uint16_tlv_t numerology_index_mu;
nfapi_uint16_tlv_t duplex_mode;
} nfapi_nr_subframe_config_t;
#define NFAPI_NR_SUBFRAME_CONFIG_DUPLEX_MODE_TAG 0x5001
#define NFAPI_NR_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG 0x5002
#define NFAPI_NR_SUBFRAME_CONFIG_PB_TAG 0x5003
#define NFAPI_NR_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG 0x5004
#define NFAPI_NR_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG 0x5005
#define NFAPI_NR_SUBFRAME_CONFIG_NUMEROLOGY_INDEX_MU_TAG 0x5006
typedef struct {
nfapi_uint16_tlv_t tx_antenna_ports;
nfapi_uint16_tlv_t rx_antenna_ports;
} nfapi_nr_rf_config_t;
#define NFAPI_NR_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG 0x500A
#define NFAPI_NR_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG 0x500B
#define NFAPI_NR_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG 0x500C
#define NFAPI_NR_RF_CONFIG_TX_ANTENNA_PORTS_TAG 0x500D
#define NFAPI_NR_RF_CONFIG_RX_ANTENNA_PORTS_TAG 0x500E
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_periodicity;
nfapi_uint16_tlv_t ss_pbch_block_power;
nfapi_uint16_tlv_t n_ssb_crb;
} nfapi_nr_sch_config_t;
#define NFAPI_NR_SCH_CONFIG_PHYSICAL_CELL_ID_TAG 0x501E
#define NFAPI_NR_SCH_CONFIG_HALF_FRAME_INDEX_TAG 0x501F
#define NFAPI_NR_SCH_CONFIG_SSB_SUBCARRIER_OFFSET_TAG 0x5020
#define NFAPI_NR_SCH_CONFIG_SSB_POSITION_IN_BURST 0x5021
#define NFAPI_NR_SCH_CONFIG_SSB_PERIODICITY 0x5022
#define NFAPI_NR_SCH_CONFIG_SS_PBCH_BLOCK_POWER 0x5023
#define NFAPI_NR_SCH_CONFIG_N_SSB_CRB 0x5024
typedef struct {
nfapi_uint16_tlv_t prach_RootSequenceIndex; ///// L1 parameter 'PRACHRootSequenceIndex'
nfapi_uint16_tlv_t prach_msg1_SubcarrierSpacing; ///// L1 parameter 'prach-Msg1SubcarrierSpacing'
nfapi_uint16_tlv_t restrictedSetConfig;
nfapi_uint16_tlv_t msg3_transformPrecoding; ///// L1 parameter 'msg3-tp'
/////////////////--------------------NR RACH-ConfigGeneric--------------------/////////////////
nfapi_uint16_tlv_t prach_ConfigurationIndex; ///// L1 parameter 'PRACHConfigurationIndex'
nfapi_uint16_tlv_t prach_msg1_FDM; ///// L1 parameter 'prach-FDM'
nfapi_uint16_tlv_t prach_msg1_FrequencyStart; ///// L1 parameter 'prach-frequency-start'
nfapi_uint16_tlv_t zeroCorrelationZoneConfig;
nfapi_uint16_tlv_t preambleReceivedTargetPower;
} 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;
typedef struct {
nfapi_uint16_tlv_t groupHoppingEnabledTransformPrecoding; ///// L1 parameter 'Group-hopping-enabled-Transform-precoding'
nfapi_uint16_tlv_t msg3_DeltaPreamble; ///// L1 parameter 'Delta-preamble-msg3'
nfapi_uint16_tlv_t p0_NominalWithGrant; ///// L1 parameter 'p0-nominal-pusch-withgrant'
nfapi_uint16_tlv_t TimeDomainResourceAllocation_k2; ///// L1 parameter 'K2'
nfapi_uint16_tlv_t TimeDomainResourceAllocation_mappingType; ///// L1 parameter 'Mapping-type'
} nfapi_nr_pusch_config_t;
typedef struct {
nfapi_uint16_tlv_t pucch_GroupHopping; ///// L1 parameter 'PUCCH-GroupHopping'
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 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_uint16_tlv_t common_controlResourceSetId; ///// L1 parameter 'CORESET-ID
nfapi_uint16_tlv_t common_ControlResourceSet_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 SearchSpaceId;
nfapi_uint16_tlv_t commonSearchSpaces_controlResourceSetId;
nfapi_uint16_tlv_t SearchSpace_monitoringSlotPeriodicityAndOffset; ///// L1 parameters 'Montoring-periodicity-PDCCH-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_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'
nfapi_uint16_tlv_t dl_UL_TransmissionPeriodicity; ///// L1 parameter 'DL-UL-transmission-periodicity'
nfapi_uint16_tlv_t nrofDownlinkSlots; ///// L1 parameter 'number-of-DL-slots'
nfapi_uint16_tlv_t nrofDownlinkSymbols; ///// L1 parameter 'number-of-DL-symbols-common'
nfapi_uint16_tlv_t nrofUplinkSlots; ///// L1 parameter 'number-of-UL-slots'
nfapi_uint16_tlv_t nrofUplinkSymbols; ///// L1 parameter 'number-of-UL-symbols-common'
} nfapi_nr_tdd_ul_dl_config_t;
typedef struct {
//RateMatchPattern is used to configure one rate matching pattern for PDSCH ///// L1 parameter 'Resource-set-cekk'
nfapi_uint16_tlv_t rateMatchPatternId;
nfapi_uint16_tlv_t RateMatchPattern_patternType;
nfapi_uint16_tlv_t symbolsInResourceBlock; ///// L1 parameter 'rate-match-PDSCH-bitmap2
nfapi_uint16_tlv_t periodicityAndPattern; ///// L1 parameter 'rate-match-PDSCH-bitmap3'
nfapi_uint16_tlv_t RateMatchPattern_controlResourceSet;
nfapi_uint16_tlv_t RateMatchPattern_subcarrierSpacing; ///// L1 parameter 'resource-pattern-scs'
nfapi_uint16_tlv_t RateMatchPattern_mode;
} nfapi_nr_ratematchpattern_t;
typedef struct {
//NR RateMatchPatternLTE-CRS
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_carrierFreqDL; ///// L1 parameter 'center-subcarrier-location'
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_carrierBandwidthDL; ///// L1 parameter 'BW'
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_nrofCRS_Ports; ///// L1 parameter 'rate-match-resources-numb-LTE-CRS-antenna-port'
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_v_Shift; ///// L1 parameter 'rate-match-resources-LTE-CRS-v-shift'
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_radioframeAllocationPeriod;
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_radioframeAllocationOffset;
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;
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_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;
nfapi_nr_nfapi_t nfapi_config;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_config_request_t;
#endif
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -33,6 +33,7 @@
#include <pthread.h>
extern unsigned char Emulation_status;
extern unsigned char emu_tx_status;
extern unsigned char emu_rx_status;
......
......@@ -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)
......
......@@ -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];
......
......@@ -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)
......
......@@ -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
......
......@@ -84,14 +84,14 @@ static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_
*/
/*------------------------------------------------------------------------------*/
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 +112,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);
if (gnb_id == 0) RCconfig_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));
......@@ -150,8 +150,8 @@ void *gNB_app_task(void *args_p)
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,9 +161,9 @@ 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);
......@@ -175,14 +175,14 @@ 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)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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_flexran(void);
extern void RCconfig_NR_L1(void);
extern void RCconfig_nr_macrlc(void);
extern int RCconfig_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_S1(MessageDef *msg_p, uint32_t i);
#endif /* GNB_CONFIG_H_ */
/** @} */
......@@ -31,7 +31,7 @@
*/
#include "common/config/config_paramdesc.h"
#include "NRRRC_paramsvalues.h"
#include "NR_RRC_paramsvalues.h"
#define GNB_CONFIG_STRING_CC_NODE_FUNCTION "node_function"
......@@ -401,14 +401,170 @@ 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 */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#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_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}, \
......@@ -553,153 +709,355 @@ typedef enum {
/* 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_SUBCARRIERSPACINGCOMMON_IDX 44
#define GNB_CONFIG_PDCCH_CONFIGSIB1_IDX 45
#define GNB_CONFIG_FREQUENCYOFFSETSSB_IDX 46
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_POSITIONSINBURST_PR_IDX 47
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SSB_PERIODICITYSERVINGCELL_IDX 48
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_DMRS_TYPEA_POSITION_IDX 49
#define GNB_CONFIG_NIA_SUBCARRIERSPACING_IDX 50
#define GNB_CONFIG_SERVINGCELLCONFIGCOMMON_SS_PBCH_BLOCKPOWER_IDX 51
#define GNB_CONFIG_REFERENCESUBCARRIERSPACING_IDX 52
#define GNB_CONFIG_DL_UL_TRANSMISSIONPERIODICITY_IDX 53
#define GNB_CONFIG_NROFDOWNLINKSLOTS_IDX 54
#define GNB_CONFIG_NROFDOWNLINKSYMBOLS_IDX 55
#define GNB_CONFIG_NROFUPLINKSLOTS_IDX 56
#define GNB_CONFIG_NROFUPLINKSYMBOLS_IDX 57
#define GNB_CONFIG_RACH_TOTALNUMBEROFRA_PREAMBLES_IDX 58
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_CHOICE_IDX 59
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEEIGHTH_IDX 60
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEFOURTH_IDX 61
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONEHALF_IDX 62
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_ONE_IDX 63
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_TWO_IDX 64
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_FOUR_IDX 65
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_EIGHT_IDX 66
#define GNB_CONFIG_RACH_SSB_PERRACH_OCCASIONANDCB_PREAMBLESPERSSB_SIXTEEN_IDX 67
#define GNB_CONFIG_RACH_GROUPBCONFIGURED_IDX 68
#define GNB_CONFIG_RACH_RA_MSG3SIZEGROUPA_IDX 69
#define GNB_CONFIG_RACH_MESSAGEPOWEROFFSETGROUPB_IDX 70
#define GNB_CONFIG_RACH_NUMBEROFRA_PREAMBLESGROUPA_IDX 71
#define GNB_CONFIG_RACH_RA_CONTENTIONRESOLUTIONTIMER_IDX 72
#define GNB_CONFIG_RSRP_THRESHOLDSSB_IDX 73
#define GNB_CONFIG_RSRP_THRESHOLDSSB_SUL_IDX 74
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_CHOICE_IDX 75
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L839_IDX 76
#define GNB_CONFIG_PRACH_ROOTSEQUENCEINDEX_L139_IDX 77
#define GNB_CONFIG_PRACH_MSG1_SUBCARRIERSPACING_IDX 78
#define GNB_CONFIG_RESTRICTEDSETCONFIG_IDX 79
#define GNB_CONFIG_MSG3_TRANSFORMPRECODING_IDX 80
#define GNB_CONFIG_PRACH_CONFIGURATIONINDEX_IDX 81
#define GNB_CONFIG_PRACH_MSG1_FDM_IDX 82
#define GNB_CONFIG_PRACH_MSG1_FREQUENCYSTART_IDX 83
#define GNB_CONFIG_ZEROCORRELATIONZONECONFIG_IDX 84
#define GNB_CONFIG_PREAMBLERECEIVEDTARGETPOWER_IDX 85
#define GNB_CONFIG_PREAMBLETRANSMAX_IDX 86
#define GNB_CONFIG_POWERRAMPINGSTEP_IDX 87
#define GNB_CONFIG_RA_RESPONSEWINDOW_IDX 88
#define GNB_CONFIG_GROUPHOPPINGENABLEDTRANSFORMPRECODING_IDX 89
#define GNB_CONFIG_MSG3_DELTAPREAMBLE_IDX 90
#define GNB_CONFIG_P0_NOMINALWITHGRANT_IDX 91
#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_K2_IDX 92
#define GNB_CONFIG_PUSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX 93
#define GNB_CONFIG_PUCCH_GROUPHOPPING_IDX 94
#define GNB_CONFIG_P0_NOMINAL_IDX 95
#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_K0_IDX 96
#define GNB_CONFIG_PDSCH_TIMEDOMAINRESOURCEALLOCATION_MAPPINGTYPE_IDX 97
#define GNB_CONFIG_RATEMATCHPATTERNID_IDX 98
#define GNB_CONFIG_RATEMATCHPATTERN_PATTERNTYPE_IDX 99
#define GNB_CONFIG_SYMBOLSINRESOURCEBLOCK_IDX 100
#define GNB_CONFIG_PERIODICITYANDPATTERN_IDX 101
#define GNB_CONFIG_RATEMATCHPATTERN_CONTROLRESOURCESET_IDX 102
#define GNB_CONFIG_RATEMATCHPATTERN_SUBCARRIERSPACING_IDX 103
#define GNB_CONFIG_RATEMATCHPATTERN_MODE_IDX 104
#define GNB_CONFIG_SEARCHSPACESIB1_IDX 105
#define GNB_CONFIG_SEARCHSPACEOTHERSYSTEMINFORMATION_IDX 106
#define GNB_CONFIG_PAGINGSEARCHSPACE_IDX 107
#define GNB_CONFIG_RA_SEARCHSPACE_IDX 108
#define GNB_CONFIG_RACH_RA_CONTROLRESOURCESET_IDX 109
#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESETID_IDX 110
#define GNB_CONFIG_PDCCH_COMMON_CONTROLRESOURCESET_DURATION_IDX 111
#define GNB_CONFIG_PDCCH_CCE_REG_MAPPINGTYPE_IDX 112
#define GNB_CONFIG_PDCCH_REG_BUNDLESIZE_IDX 113
#define GNB_CONFIG_PDCCH_INTERLEAVERSIZE_IDX 114
#define GNB_CONFIG_PDCCH_SHIFTINDEX_IDX 115
#define GNB_CONFIG_PDCCH_PRECODERGRANULARITY_IDX 116
#define GNB_CONFIG_PDCCH_TCI_STATEID_IDX 117
#define GNB_CONFIG_TCI_PRESENTINDCI_IDX 118
#define GNB_CONFIG_SEARCHSPACEID_IDX 119
#define GNB_CONFIG_COMMONSEARCHSPACES_CONTROLRESOURCESETID_IDX 120
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_CHOICE_IDX 121
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL1_IDX 122
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL2_IDX 123
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL4_IDX 124
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL5_IDX 125
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL8_IDX 126
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL10_IDX 127
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL16_IDX 128
#define GNB_CONFIG_SEARCHSPACE_MONITORINGSLOTPERIODICITYANDOFFSET_SL20_IDX 129
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL1_IDX 130
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL2_IDX 131
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL4_IDX 132
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL8_IDX 133
#define GNB_CONFIG_SEARCHSPACE_NROFCANDIDATES_AGGREGATIONLEVEL16_IDX 134
#define GNB_CONFIG_SEARCHSPACE_SEARCHSPACETYPE_IDX 135
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL1_IDX 136
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL2_IDX 137
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL4_IDX 138
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL8_IDX 139
#define GNB_CONFIG_COMMON_DCI_FORMAT2_0_NROFCANDIDATES_SFI_AGGREGATIONLEVEL16_IDX 140
#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_MONITORINGPERIODICITY_IDX 141
#define GNB_CONFIG_COMMON_DCI_FORMAT2_3_NROFPDCCH_CANDIDATES_IDX 142
#define GNB_CONFIG_UE_SPECIFIC__DCI_FORMATS_IDX 143
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERFREQDL_IDX 144
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_CARRIERBANDWIDTHDL_IDX 145
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_NROFCRS_PORTS_IDX 146
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_V_SHIFT_IDX 147
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONPERIOD_IDX 148
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_RADIOFRAMEALLOCATIONOFFSET_IDX 149
#define GNB_CONFIG_RATEMATCHPATTERNLTE_CRS_SUBFRAMEALLOCATION_CHOICE_IDX 150
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* 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:&enb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:&enb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:&enb_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
......@@ -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)
......
#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->dl_frequencyinfo.DL_carrierBandwidth.value = dl_BandwidthP;
cfg->dl_frequencyinfo.DL_carrierBandwidth.tl.tag = NFAPI_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG; //temporary
cfg->num_tlv++;
LOG_E(PHY,"%s() dl_BandwidthP:%d\n", __FUNCTION__, dl_BandwidthP);
cfg->ul_frequencyinfo.UL_carrierBandwidth.value = dl_BandwidthP;
cfg->ul_frequencyinfo.UL_carrierBandwidth.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.mac[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
/*
* 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/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 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;
/// NFAPI Config Request Structure
nfapi_nr_config_request_t config[NFAPI_CC_MAX];
/// NFAPI DL Config Request Structure
nfapi_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];
/// NFAPI HI/DCI0 Config Request Structure
nfapi_hi_dci0_request_t HI_DCI0_req[NFAPI_CC_MAX];
/// NFAPI DL PDU structure
nfapi_tx_request_t TX_req[NFAPI_CC_MAX];
/// Common cell resources
COMMON_channels_t common_channels[NFAPI_CC_MAX];
UE_list_t UE_list;
} gNB_MAC_INST;
#endif /*__LAYER2_NR_MAC_DEFS_H__ */
#ifndef __LAYER2_NR_MAC_PROTO_H__
#define __LAYER2_NR_MAC_PROTO_H__
#include "mac.h"
#include "PHY/defs_nr_common.h"
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
);
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
\ No newline at end of file
/*
* 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, j;
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_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
#include "openair1/PHY/defs_eNB.h"
#include "openair2/NR_PHY_INTERFACE/IF_Module.h"
#include "openair1/PHY/phy_extern.h"
#include "LAYER2/MAC/mac_extern.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 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_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);
}
}
}
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
/*
* 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 2017
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __NR_IF_MODULE__H__
#define __NR_IF_MODULE__H__
#include <stdint.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
#define MAX_NUM_HI_DCI0_PDU 100
#define MAX_NUM_TX_REQUEST_PDU 100
#define MAX_NUM_HARQ_IND 100
#define MAX_NUM_CRC_IND 100
#define MAX_NUM_SR_IND 100
#define MAX_NUM_CQI_IND 100
#define MAX_NUM_RACH_IND 100
#define MAX_NUM_SRS_IND 100
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
int CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// harq indication list
nfapi_harq_indication_t harq_ind;
/// crc indication list
nfapi_crc_indication_t crc_ind;
/// SR indication list
nfapi_sr_indication_t sr_ind;
/// CQI indication list
nfapi_cqi_indication_body_t cqi_ind;
/// RACH indication list
nfapi_rach_indication_t rach_ind;
#ifdef Rel14
/// RACH indication list for BR UEs
nfapi_rach_indication_t rach_ind_br;
#endif
/// SRS indication list
nfapi_srs_indication_body_t srs_ind;
/// RX indication
nfapi_rx_indication_t rx_ind;
} NR_UL_IND_t;
// Downlink subframe P7
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
uint8_t CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// nFAPI DL Config Request
nfapi_dl_config_request_t *DL_req;
/// nFAPI UL Config Request
nfapi_ul_config_request_t *UL_req;
/// nFAPI HI_DCI Request
nfapi_hi_dci0_request_t *HI_DCI0_req;
/// Pointers to DL SDUs
nfapi_tx_request_t *TX_req;
} NR_Sched_Rsp_t;
typedef struct {
uint8_t Mod_id;
int CC_id;
nfapi_nr_config_request_t *cfg;
} NR_PHY_Config_t;
typedef struct NR_IF_Module_s{
//define the function pointer
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;
} NR_IF_Module_t;
/*Initial */
NR_IF_Module_t *NR_IF_Module_init(int Mod_id);
void NR_IF_Module_kill(int Mod_id);
void NR_UL_indication(NR_UL_IND_t *UL_INFO);
/*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
......@@ -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,44 @@ 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;
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 +244,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 +257,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,217 +280,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
......@@ -503,50 +289,53 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
)
{
// 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;
struct NR_FrequencyInfoDL **frequencyinfordl = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->frequencyInfoDL;
NR_BWP_DownlinkCommon_t **bwp_downlinkcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->initialDownlinkBWP;
NR_UplinkConfigCommon_t **uplinkconfigcommon = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->uplinkConfigCommon;
NR_UplinkConfigCommon_t **supplementaryuplinkconfig = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->supplementaryUplinkConfig;
struct NR_ServingCellConfigCommon__ssb_PositionsInBurst **ssb_positionsinburst = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->ssb_PositionsInBurst;
/////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 NR_ServingCellConfigCommon__rateMatchPatternToAddModList **ratematchpatterntoaddmodlist = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->rateMatchPatternToAddModList;
struct NR_RateMatchPattern *ratematchpattern;
struct NR_ServingCellConfigCommon__rateMatchPatternToReleaseList **ratematchpatterntoreleaselist = &RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->rateMatchPatternToReleaseList;
NR_RateMatchPatternId_t *ratematchpatternid;
struct TDD_UL_DL_ConfigCommon **tdd_ul_dl_configurationcommon;
struct TDD_UL_DL_ConfigCommon **tdd_ul_dl_configurationcommon2;
struct NR_TDD_UL_DL_ConfigCommon **tdd_ul_dl_configurationcommon;
struct NR_TDD_UL_DL_ConfigCommon **tdd_ul_dl_configurationcommon2;
// FrequencyInfoDL //
FreqBandIndicatorNR_t *dl_frequencyBandList;
struct SCS_SpecificCarrier *dl_scs_SpecificCarrierList;
NR_FreqBandIndicatorNR_t *dl_frequencyBandList;
struct NR_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;
NR_ControlResourceSet_t *bwp_dl_controlresourceset;
NR_TCI_StateId_t *TCI_StateId;
NR_SearchSpace_t *bwp_dl_searchspace;
struct NR_PDSCH_TimeDomainResourceAllocation *bwp_dl_timedomainresourceallocation;
// UplinkConfigCommon //
FreqBandIndicatorNR_t *ul_frequencyBandList;
struct SCS_SpecificCarrier *ul_scs_SpecificCarrierList;
NR_FreqBandIndicatorNR_t *ul_frequencyBandList;
struct NR_SCS_SpecificCarrier *ul_scs_SpecificCarrierList;
// PUSCH_ConfigCommon //
struct PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation;
struct NR_PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation;
//------------------------------------Start Fill ServingCellConfigCommon------------------------------------//
RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->physCellId = configuration->Nid_cell[CC_id];
RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->physCellId = CALLOC(1,sizeof(NR_PhysCellId_t));
memset(&RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->physCellId,0,sizeof(NR_PhysCellId_t));
*(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){
if((*ssb_positionsinburst)->present == NR_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){
}else if((*ssb_positionsinburst)->present == NR_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){
}else if((*ssb_positionsinburst)->present == NR_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;
......@@ -560,118 +349,124 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
(*ssb_positionsinburst)->choice.longBitmap.buf[7] = 0xff;
}
RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->ssb_periodicityServingCell = configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id];
RC.nrrrc[Mod_id]->carrier[CC_id].servingcellconfigcommon->ssb_periodicityServingCell = CALLOC(1,sizeof(long));
*(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];
ratematchpattern = CALLOC(1,sizeof(struct RateMatchPattern));
memset(&ratematchpattern,0,sizeof(struct RateMatchPattern));
ratematchpattern = CALLOC(1,sizeof(struct NR_RateMatchPattern));
memset(&ratematchpattern,0,sizeof(struct NR_RateMatchPattern));
ratematchpattern->rateMatchPatternId = configuration->rateMatchPatternId[CC_id];
ratematchpattern->patternType.present = configuration->RateMatchPattern_patternType[CC_id];
if(ratematchpattern->patternType.present == RateMatchPattern__patternType_PR_bitmaps){
if(ratematchpattern->patternType.present == NR_RateMatchPattern__patternType_PR_bitmaps){
ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps));
memset(&ratematchpattern->patternType.choice.bitmaps,0,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;
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->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->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 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;
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 == RateMatchPattern__patternType_PR_controlResourceSet){
ratematchpattern->patternType.choice.controlResourceSet = RateMatchPattern_controlResourceSet[CC_id];
}else if(ratematchpattern->patternType.present == NR_RateMatchPattern__patternType_PR_controlResourceSet){
ratematchpattern->patternType.choice.controlResourceSet = configuration->RateMatchPattern_controlResourceSet[CC_id];
}
ratematchpattern->subcarrierSpacing = CALLOC(1,sizeof(SubcarrierSpacing_t));
ratematchpattern->subcarrierSpacing = configuration->RateMatchPattern_subcarrierSpacing[CC_id];
ratematchpattern->subcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t));
*(ratematchpattern->subcarrierSpacing) = configuration->RateMatchPattern_subcarrierSpacing[CC_id];
ratematchpattern->mode = configuration->RateMatchPattern_mode[CC_id];
ASN_SEQUENCE_ADD(&(*ratematchpatterntoaddmodlist)->list,&ratematchpattern);
ratematchpatternid = CALLOC(1,sizeof(RateMatchPatternId_t));
memset(&ratematchpatternid,0,sizeof(RateMatchPatternId_t));
ratematchpatternid = configuration->rateMatchPatternId[CC_id];
ratematchpatternid = CALLOC(1,sizeof(NR_RateMatchPatternId_t));
memset(&ratematchpatternid,0,sizeof(NR_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->subcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t));
*(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];
*((*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];
dl_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t));
memset(&dl_frequencyBandList,0,sizeof(NR_FreqBandIndicatorNR_t));
*(dl_frequencyBandList) = configuration->DL_FreqBandIndicatorNR[CC_id];
ASN_SEQUENCE_ADD(&(*frequencyinfordl)->frequencyBandList.list,&dl_frequencyBandList);
(*frequencyinfordl)->absoluteFrequencyPointA = configuration->DL_absoluteFrequencyPointA[CC_id];
dl_scs_SpecificCarrierList = CALLOC(1,sizeof(struct SCS_SpecificCarrier));
memset(&dl_scs_SpecificCarrierList,0,sizeof(struct SCS_SpecificCarrier));
dl_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier));
memset(&dl_scs_SpecificCarrierList,0,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];
......@@ -684,26 +479,29 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
if(configuration->DL_BWP_prefix_type[CC_id]){
(*bwp_downlinkcommon)->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long));
(*bwp_downlinkcommon)->genericParameters.cyclicPrefix = BWP__cyclicPrefix_extended;
(*bwp_downlinkcommon)->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];
(*bwp_downlinkcommon)->pdcch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PDCCH_ConfigCommon));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->present = NR_SetupRelease_PDCCH_ConfigCommon_PR_setup;
(*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = CALLOC(1,sizeof(NR_SearchSpaceId_t));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation = CALLOC(1,sizeof(NR_SearchSpaceId_t));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->pagingSearchSpace = CALLOC(1,sizeof(NR_SearchSpaceId_t));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->ra_SearchSpace = CALLOC(1,sizeof(NR_SearchSpaceId_t));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->ra_ControlResourceSet = CALLOC(1,sizeof(NR_ControlResourceSetId_t));
*((*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1) = configuration->searchSpaceSIB1[CC_id];
*((*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation) = configuration->searchSpaceOtherSystemInformation[CC_id];
*((*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->pagingSearchSpace) = configuration->pagingSearchSpace[CC_id];
*((*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->ra_SearchSpace) = configuration->ra_SearchSpace[CC_id];
*((*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->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));
(*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->commonControlResourcesSets = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonControlResourcesSets));
bwp_dl_controlresourceset = CALLOC(1,sizeof(NR_ControlResourceSet_t));
memset(&bwp_dl_controlresourceset,0,sizeof(NR_ControlResourceSet_t));
bwp_dl_controlresourceset->controlResourceSetId = configuration->PDCCH_common_controlResourceSetId[CC_id];
//BIT STRING (SIZE (45))
bwp_dl_controlresourceset->frequencyDomainResources.buf =MALLOC(6);
......@@ -721,63 +519,64 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_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));
TCI_StateId = CALLOC(1,sizeof(NR_TCI_StateId_t));
memset(&TCI_StateId,0,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(&(*bwp_downlinkcommon)->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_downlinkcommon)->pdcch_ConfigCommon->choice.setup->commonSearchSpaces = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpaces));
bwp_dl_searchspace = CALLOC(1,sizeof(SearchSpace_t));
memset(&bwp_dl_searchspace,0,sizeof(SearchSpace_t));
bwp_dl_searchspace = CALLOC(1,sizeof(NR_SearchSpace_t));
memset(&bwp_dl_searchspace,0,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));
......@@ -787,82 +586,89 @@ 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];
}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];
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 == 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(&(*bwp_downlinkcommon)->pdcch_ConfigCommon->choice.setup->commonSearchSpaces->list,&bwp_dl_searchspace);
//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));
(*bwp_downlinkcommon)->pdsch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PDSCH_ConfigCommon));
(*bwp_downlinkcommon)->pdsch_ConfigCommon->present = NR_SetupRelease_PDSCH_ConfigCommon_PR_setup;
(*bwp_downlinkcommon)->pdsch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon));
(*bwp_downlinkcommon)->pdsch_ConfigCommon->choice.setup->pdsch_AllocationList = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon__pdsch_AllocationList));
bwp_dl_timedomainresourceallocation->k0 = configuration->PDSCH_TimeDomainResourceAllocation_k0[CC_id];
bwp_dl_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PDSCH_TimeDomainResourceAllocation));
memset(&bwp_dl_timedomainresourceallocation,0,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(&(*bwp_downlinkcommon)->pdsch_ConfigCommon->pdsch_AllocationList->list,&bwp_dl_timedomainresourceallocation);
ASN_SEQUENCE_ADD(&(*bwp_downlinkcommon)->pdsch_ConfigCommon->choice.setup->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));
(*uplinkconfigcommon)->frequencyInfoUL = CALLOC(1,sizeof(struct NR_FrequencyInfoUL));
(*uplinkconfigcommon)->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct NR_MultiFrequencyBandListNR));
ul_frequencyBandList = CALLOC(1,sizeof(FreqBandIndicatorNR_t));
memset(&ul_frequencyBandList,0,sizeof(FreqBandIndicatorNR_t));
ul_frequencyBandList = configuration->UL_FreqBandIndicatorNR[CC_id];
ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t));
memset(&ul_frequencyBandList,0,sizeof(NR_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];
(*uplinkconfigcommon)->frequencyInfoUL->absoluteFrequencyPointA = CALLOC(1,sizeof(NR_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));
ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier));
memset(&dl_scs_SpecificCarrierList,0,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);
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->additionalSpectrumEmission = CALLOC(1,sizeof(NR_AdditionalSpectrumEmission_t));
(*uplinkconfigcommon)->frequencyInfoUL->p_Max = CALLOC(1,sizeof(NR_P_Max_t));
(*uplinkconfigcommon)->frequencyInfoUL->frequencyShift7p5khz = CALLOC(1,sizeof(long));
(*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];
*((*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];
//Fill UplinkConfigCommon -> BWP-UplinkCommon //
//Fill UplinkConfigCommon -> BWP-UplinkCommon -> genericParameters//
......@@ -871,141 +677,149 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
if(configuration->UL_BWP_prefix_type[CC_id]){
(*uplinkconfigcommon)->initialUplinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->genericParameters.cyclicPrefix = BWP__cyclicPrefix_extended;
(*uplinkconfigcommon)->initialUplinkBWP->genericParameters.cyclicPrefix = NR_BWP__cyclicPrefix_extended;
}
//Fill UplinkConfigCommon -> BWP-UplinkCommon -> RACH_ConfigCommon//
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon = CALLOC(1,sizeof(RACH_ConfigCommon_t));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_RACH_ConfigCommon_t));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->present = NR_SetupRelease_RACH_ConfigCommon_PR_setup;
(*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];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles = CALLOC(1,sizeof(long));
*((*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];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB = CALLOC(1,sizeof(struct NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB));
(*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((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneEighth){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneEighth = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneFourth){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneFourth = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_oneHalf){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.oneHalf = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_two){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.two = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_four){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.four = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_eight){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.eight = configuration->rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight[CC_id];
}else if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present == NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_sixteen){
(*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];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured = CALLOC(1,sizeof(struct NR_RACH_ConfigCommon__groupBconfigured));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured->ra_Msg3SizeGroupA = configuration->rach_ra_Msg3SizeGroupA[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->groupBconfigured->messagePowerOffsetGroupB = configuration->rach_messagePowerOffsetGroupB[CC_id];
(*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];
(*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->choice.setup->rsrp_ThresholdSSB = CALLOC(1,sizeof(NR_RSRP_Range_t));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB_SUL = CALLOC(1,sizeof(NR_RSRP_Range_t));
*((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB) = configuration->rsrp_ThresholdSSB[CC_id];
*((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB_SUL) = configuration->rsrp_ThresholdSSB_SUL[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present = configuration->prach_RootSequenceIndex_choice[CC_id];
if((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present == NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l839){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839 = configuration->prach_RootSequenceIndex_l839[CC_id];
}else if ((*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present == NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139){
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->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];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing = configuration->prach_msg1_SubcarrierSpacing[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->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;
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoding = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoding = NR_RACH_ConfigCommon__msg3_transformPrecoding_enabled;
}
//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];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex = configuration->prach_ConfigurationIndex[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM = configuration->prach_msg1_FDM[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart = configuration->prach_msg1_FrequencyStart[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig = configuration->zeroCorrelationZoneConfig[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower = configuration->preambleReceivedTargetPower[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax = configuration->preambleTransMax[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep = configuration->powerRampingStep[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->rach_ConfigCommon->choice.setup->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));
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_PUSCH_ConfigCommon_t));
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->present = NR_SetupRelease_PUSCH_ConfigCommon_PR_setup;
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUSCH_ConfigCommon));
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->choice.setup->groupHoppingEnabledTransformPrecoding = CALLOC(1,sizeof(long));
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = NR_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));
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_AllocationList = CALLOC(1,sizeof(struct NR_PUSCH_ConfigCommon__pusch_AllocationList));
pusch_configcommontimedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation));
memset(&pusch_configcommontimedomainresourceallocation,0,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation));
pusch_configcommontimedomainresourceallocation->k2 = CALLOC(1,sizeof(long));
pusch_configcommontimedomainresourceallocation->k2 = configuration->PUSCH_TimeDomainResourceAllocation_k2[CC_id];
*(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);
ASN_SEQUENCE_ADD(&(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->choice.setup->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];
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble = CALLOC(1,sizeof(long));
*((*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble) = configuration->msg3_DeltaPreamble[CC_id];
(*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant = CALLOC(1,sizeof(long));
*((*uplinkconfigcommon)->initialUplinkBWP->pusch_ConfigCommon->choice.setup->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 = CALLOC(1,sizeof(struct NR_SetupRelease_PUCCH_ConfigCommon));
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->present = NR_SetupRelease_PUCCH_ConfigCommon_PR_setup;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUCCH_ConfigCommon));
(*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->choice.setup->pucch_ResourceCommon = CALLOC(1,sizeof(BIT_STRING_t));
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId = CALLOC(1,sizeof(BIT_STRING_t));
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal = CALLOC(1,sizeof(long));
(*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->choice.setup->pucch_GroupHopping = configuration->pucch_GroupHopping[CC_id];
*((*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal) = configuration->p0_nominal[CC_id];
(*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;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon->buf = MALLOC(1);
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon->size = 1;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon->bits_unused = 4;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon->buf[0] = 0x0f;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->buf = MALLOC(2);
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->size = 2;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->bits_unused = 6;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->buf[0] = 0x03;
(*uplinkconfigcommon)->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId->buf[1] = 0xff;
//Fill supplementaryUplinkConfig //
memcpy(&(*uplinkconfigcommon), &(*supplementaryuplinkconfig), sizeof(UplinkConfigCommon_t));//The Same structre
memcpy(&(*uplinkconfigcommon), &(*supplementaryuplinkconfig), sizeof(NR_UplinkConfigCommon_t));//The Same structre
//Fill TDD_UL_DL_ConfigCommon //
(*tdd_ul_dl_configurationcommon)->referenceSubcarrierSpacing = CALLOC(1,sizeof(SubcarrierSpacing_t));
(*tdd_ul_dl_configurationcommon)->referenceSubcarrierSpacing = CALLOC(1,sizeof(NR_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];
*((*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
memcpy(&(*tdd_ul_dl_configurationcommon), &(*tdd_ul_dl_configurationcommon2), sizeof(struct NR_TDD_UL_DL_ConfigCommon));//The Same structre
}
......@@ -3223,7 +3037,7 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
UECapability.sdu_size, enc_rval.encoded + 7);
{
char *sdu;
//sdu = malloc (3 * UECapability.sdu_size + 1 ); ///* For '\0'
//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]);
......@@ -3235,4 +3049,4 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
return(&UECapability);
}
*/
......@@ -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);
/*
* 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_defs.h"
#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
nr_rrc_init_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;
}
\ No newline at end of file
......@@ -36,9 +36,12 @@
#include <string.h>
#include "collection/tree.h"
#include "rrc_types_NR.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)
......@@ -81,31 +84,26 @@
# 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 unsigned int uid_nr_t;
#define NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE (((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;
typedef struct nr_uid_linear_allocator_s {
unsigned int bitmap[NR_UID_LINEAR_ALLOCATOR_BITMAP_SIZE];
} nr_uid_allocator_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_NR_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NR_RRC_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 PROTOCOL_NR_RRC_CTXT_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NR_RRC_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
#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,
......@@ -124,15 +122,8 @@ typedef enum UE_STATE_NR_e {
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 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)
......@@ -148,7 +139,7 @@ typedef enum HO_STATE_NR_e {
#define NO_SECURITY_MODE 0x20
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
#define RRC_TRANSACTION_IDENTIFIER_NUMBER 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 */
......@@ -158,7 +149,7 @@ typedef struct {
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;
} __attribute__ ((__packed__)) NR_LCHAN_DESC;
typedef struct UE_RRC_INFO_NR_s {
NR_UE_STATE_t State;
......@@ -182,27 +173,27 @@ typedef struct UE_RRC_INFO_NR_s {
uint32_t N310_cnt;
uint32_t N311_cnt;
rnti_t rnti;
} __attribute__ ((__packed__)) UE_RRC_INFO_NR;
} __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__)) UE_S_TMSI_NR;
} __attribute__ ((__packed__)) NR_UE_S_TMSI;
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 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 e_rab_param_NR_s {
typedef struct nr_e_rab_param_s {
e_rab_t param;
uint8_t status;
uint8_t xid; // transaction_id
} __attribute__ ((__packed__)) e_rab_param_NR_t;
} __attribute__ ((__packed__)) nr_e_rab_param_t;
typedef struct HANDOVER_INFO_NR_s {
......@@ -219,174 +210,50 @@ typedef struct HANDOVER_INFO_NR_s {
uint8_t buf[RRC_BUF_SIZE]; /* ASN.1 encoded handoverCommandMessage */
int size; /* size of above message in bytes */
} HANDOVER_INFO_NR;
} NR_HANDOVER_INFO;
#define RRC_HEADER_SIZE_MAX 64
#define RRC_BUFFER_SIZE_MAX 1024
#define NR_RRC_HEADER_SIZE_MAX 64
#define NR_RRC_BUFFER_SIZE_MAX 1024
typedef struct {
char Payload[RRC_BUFFER_SIZE_MAX];
char Header[RRC_HEADER_SIZE_MAX];
char Payload[NR_RRC_BUFFER_SIZE_MAX];
char Header[NR_RRC_HEADER_SIZE_MAX];
char payload_size;
} RRC_BUFFER_NR;
} NR_RRC_BUFFER;
#define RRC_BUFFER_SIZE_NR sizeof(RRC_BUFFER_NR)
#define NR_RRC_BUFFER_SIZE sizeof(RRC_BUFFER_NR)
typedef struct RB_INFO_NR_s {
uint16_t Rb_id; //=Lchan_id
LCHAN_DESC Lchan_desc[2];
NR_LCHAN_DESC Lchan_desc[2];
//MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT
} RB_INFO_NR;
} NR_RB_INFO;
typedef struct SRB_INFO_NR_s {
typedef struct NR_SRB_INFO_s {
uint16_t Srb_id; //=Lchan_id
RRC_BUFFER Rx_buffer;
RRC_BUFFER Tx_buffer;
LCHAN_DESC Lchan_desc[2];
NR_RRC_BUFFER Rx_buffer;
NR_RRC_BUFFER Tx_buffer;
NR_LCHAN_DESC Lchan_desc[2];
unsigned int Trans_id;
uint8_t Active;
} SRB_INFO_NR;
} NR_SRB_INFO;
typedef struct RB_INFO_TABLE_ENTRY_NR_s {
RB_INFO_NR Rb_info;
NR_RB_INFO Rb_info;
uint8_t Active;
uint32_t Next_check_frame;
uint8_t Status;
} RB_INFO_TABLE_ENTRY_NR;
} NR_RB_INFO_TABLE_ENTRY;
typedef struct SRB_INFO_TABLE_ENTRY_NR_s {
SRB_INFO_NR Srb_info;
NR_SRB_INFO 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;
} NR_SRB_INFO_TABLE_ENTRY;
//called "carrier"--> data from PHY layer
typedef struct {
......@@ -399,23 +266,23 @@ typedef struct {
uint8_t sizeof_SIB1;
//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
uint16_t physCellId;
//are the only static one (memory has been already allocated)
BCCH_BCH_Message_t mib;
NR_BCCH_BCH_Message_t mib;
NR_SIB1_t *sib1;
NR_ServingCellConfigCommon_t *servingcellconfigcommon;
NR_SIB1_t *sib1;
NR_ServingCellConfigCommon_t *servingcellconfigcommon;
SRB_INFO_NR SI;
SRB_INFO_NR Srb0;
NR_SRB_INFO SI;
NR_SRB_INFO Srb0;
} rrc_gNB_carrier_data_t;
//---------------------------------------------------
......@@ -427,10 +294,9 @@ 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
nr_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 HO_flag;
uint8_t Nb_ue;
hash_table_t *initial_id2_s1ap_ids; // key is content is rrc_ue_s1ap_ids_t
......@@ -460,114 +326,8 @@ typedef struct gNB_RRC_INST_s {
} 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
#include "nr_rrc_proto.h" //should be put here otherwise compilation error
#endif
/** @} */
......@@ -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;
......
/*
* 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 nr_rrc_init_global_param(void);
#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
......@@ -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/MAC/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
......@@ -124,7 +122,7 @@ openair_nrrrc_on(
{
int CC_id;
LOG_I(NR_RRC, PROTOCOL_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n",
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" gNB:OPENAIR NR RRC IN....\n",
PROTOCOL_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);
......@@ -154,8 +152,9 @@ init_NR_SI(
// 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];
......@@ -174,18 +173,17 @@ init_NR_SI(
);
///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 = 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_NR_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],
/* 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");
......@@ -198,16 +196,15 @@ init_NR_SI(
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 +213,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 +235,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 +245,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 +259,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,18 +277,10 @@ 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();
nr_rrc_init_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);
......@@ -342,7 +333,7 @@ void* rrc_gnb_task(void* args_p){
/* 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:
......@@ -410,48 +401,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
......@@ -186,6 +186,10 @@ typedef enum {
RRH,
X2AP,
MAX_LOG_COMPONENTS,
GNB_APP,
NR_RRC,
NR_MAC,
NR_PHY,
}
comp_name_t;
......
/*
* 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, &gtpv1u_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
/*
* 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_ */
......@@ -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"
......@@ -1048,7 +1048,7 @@ int main( int argc, char **argv )
if (RC.nb_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
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment