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
......
This diff is collapsed.
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_ */
/** @} */
......@@ -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
This diff is collapsed.
This diff is collapsed.
/*
* 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
......@@ -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
This diff is collapsed.
......@@ -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