Commit 3dda6302 authored by frtabu's avatar frtabu

nos1 et s1 execs identical, nos1 enforced based on exec name or --noS1 option

parent 6c823617
......@@ -695,10 +695,10 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
##########################
# PDCP LAYER OPTIONS
##########################
add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
#add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
#add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
#add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
#add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
##########################
# RRC LAYER OPTIONS
......@@ -1997,26 +1997,29 @@ add_executable(lte-softmodem-nos1
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag)
target_link_libraries (lte-softmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${RAL_LIB} ${ITTI_LIB}
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl )
-Wl,--end-group z dl)
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${T_LIB})
# lte-uesoftmodem is UE implementation
#######################################
......@@ -2030,6 +2033,8 @@ add_executable(lte-uesoftmodem
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
......@@ -2076,6 +2081,7 @@ add_executable(lte-uesoftmodem-nos1
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${XFORMS_SOURCE}
......@@ -2086,18 +2092,18 @@ add_executable(lte-uesoftmodem-nos1
)
add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag)
target_link_libraries (lte-uesoftmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${RAL_LIB} ${ITTI_LIB}
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl )
-Wl,--end-group z dl)
target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
# USIM process
#################
#add_executable(usim
......
......@@ -419,32 +419,80 @@ function main() {
if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then
CPU_AFFINITY_FLAG_USER="False"
fi
echo_info "installing protobuf/protobuf-c for flexran agent support"
install_protobuf_from_source
install_protobuf_c_from_source
fi
echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER"
echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER"
if [ -n "$UHD_IMAGES_DIR" ] && [ -z "$INSTALL_EXTERNAL" ]; then
echo_error "UHD images download settings will not be applied without -I present"
exit
if [ "$INSTALL_OPTIONAL" = "1" ] ; then
echo_info "Installing optional packages"
check_install_additional_tools
fi
############################################
# setting and printing OAI envs, we should check here
############################################
echo_info "2. Setting the OAI PATHS ..."
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
# for conf files copy in this bash script
if [ -d /usr/lib/freeDiameter ]; then
export FREEDIAMETER_PREFIX=/usr
else
if [ -d /usr/local/lib/freeDiameter ]; then
export FREEDIAMETER_PREFIX=/usr/local
echo_info "3. building the compilation directives ..."
DIR=$OPENAIR_DIR/cmake_targets
if [ "$NOS1" = "1" ] ; then
lte_build_dir=lte_noS1_build_oai
if [ "$eNB" = "1" ] ; then
lte_exec=lte-softmodem-nos1
fi
if [ "$UE" = "1" ] ; then
lte_exec=lte-uesoftmodem-nos1
fi
else
echo_warning "FreeDiameter prefix not found, install freeDiameter if EPC, HSS"
lte_build_dir=lte_build_oai
if [ "$eNB" = "1" ] ; then
lte_exec=lte-softmodem
fi
if [ "$UE" = "1" ] ; then
lte_exec=lte-uesoftmodem
fi
fi
if [ "$T_TRACER" = "False" ] ; then
lte_build_dir=${lte_build_dir}_noLOG
fi
# configuration module libraries, one currently available, using libconfig
config_libconfig_shlib=params_libconfig
# first generate the CMakefile in the right directory
if [ "$eNB" = "1" -o "$UE" = "1" -o "$HW" = "EXMIMO" ] ; then
# LTE softmodem compilation
[ "$CLEAN" = "1" ] && rm -rf $DIR/$lte_build_dir/build
mkdir -p $DIR/$lte_build_dir/build
cmake_file=$DIR/$lte_build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
# if [ "$NOS1" = "1" ] ; then
# cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
# fi
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file
# echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file
echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file
echo "set ( UESIM_EXPANSION $UESIM_EXPANSION )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file
echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file
echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file
echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file
echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file
echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file
if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
echo_info "Compiling UE S1 build : enabling Linux and NETLINK"
echo "set (LINUX True )" >> $cmake_file
echo "set (PDCP_USE_NETLINK True )" >> $cmake_file
fi
if [ "$CLEAN_ALL" = "1" ] ; then
......
......@@ -39,13 +39,14 @@
#include <fcntl.h>
#include <errno.h>
#include "platform_constants.h"
#ifdef UE_NAS_USE_TUN
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <linux/if_tun.h>
#include "openairinterface5g_limits.h"
#endif
#include "pdcp.h"
char nl_rx_buf[NL_MAX_PAYLOAD];
......@@ -54,20 +55,16 @@ struct nlmsghdr *nas_nlh_tx = NULL;
struct nlmsghdr *nas_nlh_rx = NULL;
struct iovec nas_iov_tx;
struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
#ifdef UE_NAS_USE_TUN
int nas_sock_fd[NUMBER_OF_UE_MAX];
#else
int nas_sock_fd;
#endif
struct msghdr nas_msg_tx;
struct msghdr nas_msg_rx;
#define GRAAL_NETLINK_ID 31
#ifdef UE_NAS_USE_TUN
static int tun_alloc(char *dev)
{
static int tun_alloc(char *dev) {
struct ifreq ifr;
int fd, err;
......@@ -77,66 +74,56 @@ static int tun_alloc(char *dev)
}
memset(&ifr, 0, sizeof(ifr));
/* Flags: IFF_TUN - TUN device (no Ethernet headers)
* IFF_TAP - TAP device
*
* IFF_NO_PI - Do not provide packet information
*/
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
if( *dev )
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) {
close(fd);
return err;
}
strcpy(dev, ifr.ifr_name);
return fd;
}
int netlink_init(void)
{
int i;
int netlink_init_tun(void) {
int ret;
char ifname[64];
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
sprintf(ifname, "oip%d", i+1);
nas_sock_fd[i] = tun_alloc(ifname);
sprintf(ifname, "oip1");
nas_sock_fd = tun_alloc(ifname);
if (nas_sock_fd[i] == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[i],errno, strerror(errno));
if (nas_sock_fd == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno));
exit(1);
}
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd[i]);
#if !defined(PDCP_USE_NETLINK_QUEUES)
ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK);
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd);
ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
if (ret == -1) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
#endif
}
#endif
}
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_fd[i], (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
ret = bind(nas_sock_fd, (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
......@@ -144,7 +131,6 @@ int netlink_init(void)
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
......@@ -152,61 +138,48 @@ int netlink_init(void)
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1;
// RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1;
}
return 1;
}
#else /* UE_NAS_USE_TUN */
int netlink_init(void)
{
int netlink_init(void) {
int ret;
nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
if (nas_sock_fd == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
#endif
}
}
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd);
#if !defined(PDCP_USE_NETLINK_QUEUES)
ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
if (ret == -1) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
#endif
}
#endif
}
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_fd, (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
ret = bind(nas_sock_fd, (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
......@@ -214,7 +187,6 @@ int netlink_init(void)
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
......@@ -222,16 +194,12 @@ int netlink_init(void)
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1;
// RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1;
return(nas_sock_fd);
}
#endif /* UE_NAS_USE_TUN */
......@@ -62,5 +62,6 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag);
void clear_eNB_transport_info(uint8_t);
void clear_UE_transport_info(uint8_t);
int netlink_init(void);
int netlink_init_tun(void);
#endif /* EMU_PROTO_H_ */
......@@ -26,7 +26,6 @@
* Author: winckel
*/
#if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
//-------------------------------------------------------------------------------------------//
// Messages for NAS logging
MESSAGE_DEF(NAS_DL_EMM_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_dl_emm_raw_msg)
......@@ -46,4 +45,4 @@ MESSAGE_DEF(NAS_DL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_
MESSAGE_DEF(NAS_UL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_protected_msg_t, nas_ul_esm_protected_msg)
//-------------------------------------------------------------------------------------------//
#endif /* ENABLE_USE_MME */
......@@ -29,7 +29,7 @@
#ifndef NAS_MESSAGES_TYPES_H_
#define NAS_MESSAGES_TYPES_H_
# if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
#include "nas_message.h"
......@@ -142,5 +142,4 @@ typedef struct nas_esm_protected_msg_s {
ESM_msg choice;
} nas_esm_protected_msg_t;
# endif /* ENABLE_USE_MME */
#endif /* NAS_MESSAGES_TYPES_H_ */
......@@ -33,13 +33,9 @@
#include "log.h"
#include "log_extern.h"
#include "assertions.h"
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#endif
#endif
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "SystemInformationBlockType2.h"
#include "PHY/phy_extern.h"
......
......@@ -33,13 +33,9 @@
#include "common/utils/LOG/log.h"
#include "assertions.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif
#endif
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "LTE_SystemInformationBlockType2.h"
#include "common/config/config_userapi.h"
#include "RRC_config_tools.h"
......
......@@ -37,36 +37,27 @@
#include "common/utils/LOG/log.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
/* temporary warning removale while implementing noS1 */
/* as config option */
# else
# ifdef EPC_MODE_ENABLED
# undef EPC_MODE_ENABLED
# endif
# define EPC_MODE_ENABLED 0
# endif
# include "x2ap_eNB.h"
# include "x2ap_messages_types.h"
# define X2AP_ENB_REGISTER_RETRY_DELAY 10
#include "openair1/PHY/INIT/phy_init.h"
extern unsigned char NB_eNB_INST;
#endif
extern RAN_CONTEXT_t RC;
#if defined(ENABLE_ITTI)
/*------------------------------------------------------------------------------*/
# if defined(ENABLE_USE_MME)
# define ENB_REGISTER_RETRY_DELAY 10
# endif
#include "targets/RT/USER/lte-softmodem.h"
......@@ -115,7 +106,7 @@ static void configure_rrc(uint32_t enb_id)
}
/*------------------------------------------------------------------------------*/
# if defined(ENABLE_USE_MME)
static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//, const Enb_properties_array_t *enb_properties)
{
uint32_t enb_id;
......@@ -143,8 +134,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
return register_enb_pending;
}
# endif
#endif
/*------------------------------------------------------------------------------*/
static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end)
......@@ -173,15 +163,12 @@ static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end)
/*------------------------------------------------------------------------------*/
void *eNB_app_task(void *args_p)
{
#if defined(ENABLE_ITTI)
uint32_t enb_nb = RC.nb_inst;
uint32_t enb_id_start = 0;
uint32_t enb_id_end = enb_id_start + enb_nb;
# if defined(ENABLE_USE_MME)
uint32_t register_enb_pending=0;
uint32_t registered_enb;
long enb_register_retry_timer_id;
# endif
uint32_t x2_register_enb_pending;
uint32_t x2_registered_enb;
long x2_enb_register_retry_timer_id;
......@@ -220,15 +207,11 @@ void *eNB_app_task(void *args_p)
configure_rrc(enb_id);
}
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
/* Try to register each eNB */
registered_enb = 0;
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
#else
/* Start L2L1 task */
msg_p = itti_alloc_new_message(TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task(TASK_L2L1, INSTANCE_DEFAULT, msg_p);
#endif
}
/* Try to register each eNB with each other */
x2_registered_enb = 0;
......@@ -255,7 +238,7 @@ void *eNB_app_task(void *args_p)
break;
case S1AP_REGISTER_ENB_CNF:
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
......@@ -292,7 +275,8 @@ void *eNB_app_task(void *args_p)
}
}
}
#endif
} /* if (EPC_MODE_ENABLED) */
break;
case S1AP_DEREGISTERED_ENB_IND:
......@@ -305,7 +289,7 @@ void *eNB_app_task(void *args_p)
break;
case TIMER_HAS_EXPIRED:
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
LOG_I(ENB_APP, " Received %s: timer_id %ld\n", ITTI_MSG_NAME (msg_p), TIMER_HAS_EXPIRED(msg_p).timer_id);
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
......@@ -319,7 +303,7 @@ void *eNB_app_task(void *args_p)
x2_registered_enb = 0;
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
}
# endif
} /* if (EPC_MODE_ENABLED) */
break;
case X2AP_DEREGISTERED_ENB_IND:
......@@ -377,9 +361,6 @@ void *eNB_app_task(void *args_p)
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} while (1);
#endif
return NULL;
}
......
......@@ -35,15 +35,9 @@
#include "enb_config.h"
#include "UTIL/OTG/otg.h"
#include "UTIL/OTG/otg_externs.h"
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#else
#define EPC_MODE_ENABLED 0
#endif
#endif
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "sctp_default_values.h"
#include "LTE_SystemInformationBlockType2.h"
#include "LAYER2/MAC/mac_extern.h"
......@@ -83,14 +77,7 @@ void RCconfig_flexran() {
uint16_t Nid_cell_tr = 0;
uint32_t enb_id = 0;
/*
int32_t srb1_timer_poll_retransmit = 0;
int32_t srb1_timer_reordering = 0;
int32_t srb1_timer_status_prohibit = 0;
int32_t srb1_poll_pdu = 0;
int32_t srb1_poll_byte = 0;
int32_t srb1_max_retx_threshold = 0;
*/
/* get number of eNBs */
......@@ -2023,21 +2010,7 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
CCsParams[I].chkPptr = &(config_check_CCparams[I]);
}
/*#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
if (strcasecmp( *(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr), ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0;
asn1_xer_print = 0;
} else if (strcasecmp( *(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr), ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) {
asn_debug = 1;
asn1_xer_print = 1;
} else if (strcasecmp(*(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr) , ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) {
asn_debug = 1;
asn1_xer_print = 2;
} else {
asn_debug = 0;
asn1_xer_print = 0;
}
#endif */
AssertFatal(i < ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt,
"Failed to parse config file %s, %uth attribute %s \n",
RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS);
......@@ -2050,13 +2023,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
for (k = 0; k < ENBParamList.numelt; k++) {
if (ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr == NULL) {
// Calculate a default eNB ID
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
uint32_t hash;
hash = s1ap_generate_eNB_id ();
enb_id = k + (hash & 0xFFFF8);
# else
} else {
enb_id = k;
# endif
}
} else {
enb_id = *(ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr);
}
......@@ -2181,12 +2154,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
// SCTP SETTING
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_SCTP_CONFIG);
config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[ENB_SCTP_INSTREAMS_IDX].uptr);
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[ENB_SCTP_OUTSTREAMS_IDX].uptr);
#endif
}
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
// NETWORK_INTERFACES
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
......@@ -2255,9 +2229,9 @@ void RCConfig(void) {
/* get global parameters, defined outside any section in the config file */
printf("Getting ENBSParams\n");
config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL);
# if defined(ENABLE_USE_MME)
EPC_MODE_ENABLED = ((*ENBSParams[ENB_NOS1_IDX].uptr) == 0);
#endif
//EPC_MODE_ENABLED = ((*ENBSParams[ENB_NOS1_IDX].uptr) == 0);
RC.nb_inst = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt;
if (RC.nb_inst > 0) {
......
......@@ -51,13 +51,9 @@ void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char e
{
LOG_D(MAC, "[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n",
module_idP, frameP, eNB_index);
#if defined(ENABLE_USE_MME)
int mme_enabled = 1;
#else
int mme_enabled = 0;
#endif
if (first_sync == 1 && !(mme_enabled == 1)) {
if (first_sync == 1 && !(EPC_MODE_ENABLED)) {
//layer2_init_UE(module_idP);
openair_rrc_ue_init(module_idP, eNB_index);
} else {
......
......@@ -28,7 +28,6 @@
*/
#define PDCP_C
//#define DEBUG_PDCP_FIFO_FLUSH_SDU
#define MBMS_MULTICAST_OUT
......@@ -50,23 +49,19 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "msc.h"
#include "targets/COMMON/openairinterface5g_limits.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#if defined(ENABLE_SECURITY)
#include "UTIL/OSA/osa_defs.h"
#endif
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
#endif
# include "intertask_interface.h"
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
#include "gtpv1u_eNB_task.h"
#include "gtpv1u.h"
#endif
# include "gtpv1u_eNB_task.h"
# include "gtpv1u.h"
extern int otg_enabled;
#if defined(ENABLE_USE_MME)
extern uint8_t nfapi_mode;
#endif
extern uint8_t nfapi_mode;
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
hash_table_t *pdcp_coll_p = NULL;
......@@ -82,6 +77,13 @@ hash_table_t *pdcp_coll_p = NULL;
static int mbms_socket = -1;
#endif
/* pdcp module parameters and related functions*/
static pdcp_params_t pdcp_params= {0};
uint64_t get_pdcp_optmask(void) {
return pdcp_params.optmask;
}
//-----------------------------------------------------------------------------
/*
* If PDCP_UNIT_TEST is set here then data flow between PDCP and RLC is broken
......@@ -179,12 +181,13 @@ boolean_t pdcp_data_req(
if (pdcp_pdu_p != NULL) {
memcpy(&pdcp_pdu_p->data[0], sdu_buffer_pP, sdu_buffer_sizeP);
#if defined(DEBUG_PDCP_PAYLOAD)
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
rlc_util_print_hex_octets(PDCP,
(unsigned char *)&pdcp_pdu_p->data[0],
sdu_buffer_sizeP);
#endif
LOG_D(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
LOG_UI(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
}
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,NULL, NULL
......@@ -451,10 +454,9 @@ pdcp_data_ind(
uint8_t rb_offset= (srb_flagP == 0) ? DTCH -1 :0;
uint16_t pdcp_uid=0;
uint8_t oo_flag=0;
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
MessageDef *message_p = NULL;
uint8_t *gtpu_buffer_p = NULL;
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND,VCD_FUNCTION_IN);
LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)sdu_buffer_pP->data,sdu_buffer_sizeP,
"[MSG] PDCP UL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP);
......@@ -709,8 +711,8 @@ pdcp_data_ind(
* from its second byte (skipping 0th and 1st octets, i.e.
* PDCP header)
*/
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
if (LINK_ENB_PDCP_TO_GTPV1U) {
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
MSC_LOG_TX_MESSAGE(
MSC_PDCP_ENB,
......@@ -736,9 +738,10 @@ pdcp_data_ind(
packet_forwarded = TRUE;
}
#else
} else {
packet_forwarded = FALSE;
#endif
}
#ifdef MBMS_MULTICAST_OUT
if ((MBMS_flagP != 0) && (mbms_socket != -1)) {
......@@ -773,39 +776,34 @@ pdcp_data_ind(
// set ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst for IP layer here
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id;
#if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
/* for the UE compiled in S1 mode, we need 1 here
* for the UE compiled in noS1 mode, we need 0
* TODO: be sure of this
*/
if (nfapi_mode == 3) {
#ifdef UESIM_EXPANSION
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 0;
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 0;
#else
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id;
#endif
} else {
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 1;
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 1;
}
}
#endif
} else {
((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id + (ctxt_pP->module_id * LTE_maxDRB);
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
}
// new_sdu_p->data->inst is set again in UE case so move to above.
//Panos: Commented this out because it cancels the assignment in #if defined(ENABLE_USE_MME) case
//((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id;
#ifdef DEBUG_PDCP_FIFO_FLUSH_SDU
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
static uint32_t pdcp_inst = 0;
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = pdcp_inst++;
LOG_D(PDCP, "inst=%d size=%d\n", ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst, ((pdcp_data_ind_header_t *) new_sdu_p->data)->data_size);
#endif
//((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 1; //pdcp_inst++;
memcpy(&new_sdu_p->data[sizeof (pdcp_data_ind_header_t)], \
&sdu_buffer_pP->data[payload_offset], \
}
memcpy(&new_sdu_p->data[sizeof (pdcp_data_ind_header_t)],
&sdu_buffer_pP->data[payload_offset],
sdu_buffer_sizeP - payload_offset);
list_add_tail_eurecom (new_sdu_p, sdu_list_p);
}
......@@ -928,7 +926,6 @@ pdcp_run (
pdcp_enb[ctxt_pP->module_id].subframe= ctxt_pP->subframe;
pdcp_update_stats(ctxt_pP);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_RUN, VCD_FUNCTION_IN);
#if defined(ENABLE_ITTI)
MessageDef *msg_p;
int result;
protocol_ctxt_t ctxt;
......@@ -1005,13 +1002,8 @@ pdcp_run (
}
} while(msg_p != NULL);
#endif
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
if (ctxt_pP->enb_flag == ENB_FLAG_NO)
#endif
{
if (LINK_ENB_PDCP_TO_GTPV1U && ctxt_pP->enb_flag == ENB_FLAG_NO) {
pdcp_fifo_read_input_sdus(ctxt_pP);
}
......@@ -1904,39 +1896,27 @@ rrc_pdcp_config_req (
//-----------------------------------------------------------------------------
int
pdcp_module_init (
void
)
//-----------------------------------------------------------------------------
{
#ifdef PDCP_USE_RT_FIFO
int ret;
ret=rtf_create(PDCP2NW_DRIVER_FIFO,32768);
if (ret < 0) {
LOG_E(PDCP, "Cannot create PDCP2NW_DRIVER_FIFO fifo %d (ERROR %d)\n", PDCP2NW_DRIVER_FIFO, ret);
return -1;
} else {
LOG_D(PDCP, "Created PDCP2NAS fifo %d\n", PDCP2NW_DRIVER_FIFO);
rtf_reset(PDCP2NW_DRIVER_FIFO);
uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
/* temporary enforce netlink when UE_NAS_USE_TUN is set,
this is while switching from noS1 as build option
to noS1 as config option */
if ( pdcp_optmask & UE_NAS_USE_TUN_BIT) {
pdcp_params.optmask = pdcp_params.optmask | PDCP_USE_NETLINK_BIT ;
}
ret=rtf_create(NW_DRIVER2PDCP_FIFO,32768);
pdcp_params.optmask = pdcp_params.optmask | pdcp_optmask ;
LOG_I(PDCP, "pdcp init,%s %s\n",
((LINK_ENB_PDCP_TO_GTPV1U)?"usegtp":""),
((PDCP_USE_NETLINK)?"usenetlink":""));
if (ret < 0) {
LOG_E(PDCP, "Cannot create NW_DRIVER2PDCP_FIFO fifo %d (ERROR %d)\n", NW_DRIVER2PDCP_FIFO, ret);
return -1;
if (PDCP_USE_NETLINK) {
if(UE_NAS_USE_TUN) {
netlink_init_tun();
} else {
LOG_D(PDCP, "Created NW_DRIVER2PDCP_FIFO fifo %d\n", NW_DRIVER2PDCP_FIFO);
rtf_reset(NW_DRIVER2PDCP_FIFO);
netlink_init();
}
pdcp_2_nas_irq = 0;
pdcp_input_sdu_remaining_size_to_read=0;
pdcp_input_sdu_size_read=0;
#endif
return 0;
}
return pdcp_params.optmask ;
}
//-----------------------------------------------------------------------------
......@@ -1970,10 +1950,6 @@ pdcp_free (
void pdcp_module_cleanup (void)
//-----------------------------------------------------------------------------
{
#ifdef PDCP_USE_RT_FIFO
rtf_destroy(NW_DRIVER2PDCP_FIFO);
rtf_destroy(PDCP2NW_DRIVER_FIFO);
#endif
}
//-----------------------------------------------------------------------------
......@@ -2080,7 +2056,3 @@ void pdcp_layer_cleanup (void)
#endif
}
#ifdef PDCP_USE_RT_FIFO
EXPORT_SYMBOL(pdcp_2_nas_irq);
#endif //PDCP_USE_RT_FIFO
......@@ -51,6 +51,19 @@
#include "LTE_PMCH-InfoList-r9.h"
#endif
#define PDCP_USE_NETLINK_BIT (1<< 11)
#define LINK_ENB_PDCP_TO_IP_DRIVER_BIT (1<< 13)
#define LINK_ENB_PDCP_TO_GTPV1U_BIT (1<< 14)
#define UE_NAS_USE_TUN_BIT (1<< 15)
typedef struct {
uint64_t optmask;
} pdcp_params_t;
#define PDCP_USE_NETLINK ( get_pdcp_optmask() & PDCP_USE_NETLINK_BIT)
#define LINK_ENB_PDCP_TO_IP_DRIVER ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_IP_DRIVER_BIT)
#define LINK_ENB_PDCP_TO_GTPV1U ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_GTPV1U_BIT)
#define UE_NAS_USE_TUN ( get_pdcp_optmask() & UE_NAS_USE_TUN_BIT)
uint64_t get_pdcp_optmask(void);
extern pthread_t pdcp_thread;
extern pthread_attr_t pdcp_thread_attr;
......@@ -376,14 +389,10 @@ boolean_t pdcp_remove_UE(
*/
void pdcp_run (
const protocol_ctxt_t* const ctxt_pP);
int pdcp_module_init (void);
uint64_t pdcp_module_init (uint64_t pdcp_optmask);
void pdcp_module_cleanup (void);
void pdcp_layer_init (void);
void pdcp_layer_cleanup (void);
#if defined(PDCP_USE_NETLINK_QUEUES)
int pdcp_netlink_init (void);
#endif
#define PDCP2NW_DRIVER_FIFO 21
#define NW_DRIVER2PDCP_FIFO 22
......@@ -490,10 +499,7 @@ typedef struct {
signed int pdcp_2_nas_irq;
pdcp_stats_t UE_pdcp_stats[MAX_MOBILES_PER_ENB];
pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX];
//pdcp_t pdcp_array_srb_ue[MAX_MOBILES_PER_ENB][2];
//pdcp_t pdcp_array_drb_ue[MAX_MOBILES_PER_ENB][maxDRB];
//pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][2];
//pdcp_t pdcp_array_drb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][maxDRB];
// for UE code conly
rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB];
......
This diff is collapsed.
......@@ -70,7 +70,7 @@ extern struct iovec nas_iov_rx;
extern int nas_sock_fd;
extern struct msghdr nas_msg_rx;
#if defined(PDCP_USE_NETLINK_QUEUES)
static pthread_t pdcp_netlink_thread;
/* We use lock-free queues between the User-plane driver running in kernel-space
......@@ -104,11 +104,11 @@ pdcp_netlink_init(
nb_inst_enb = 1;
nb_inst_ue = 1;
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
if (LINK_ENB_PDCP_TO_GTPV1U) {
nb_inst_enb = 0;
LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n");
#else
#warning " LG: When there will be handover in, there will problems because dim is based on local nums of ues"
} else {
/* #warning " LG: When there will be handover in, there will problems because dim is based on local nums of ues" */
pdcp_netlink_queue_enb = calloc(nb_inst_enb, sizeof(struct lfds611_queue_state*));
pdcp_netlink_nb_element_enb = malloc(nb_inst_enb * sizeof(uint32_t));
LOG_I(PDCP, "[NETLINK] Creating %d queues for eNB Netlink -> PDCP communication\n", nb_inst_enb);
......@@ -121,8 +121,8 @@ pdcp_netlink_init(
exit(EXIT_FAILURE);
}
}
}
#endif
if (nb_inst_ue > 0) {
pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state*));
......@@ -262,8 +262,8 @@ void *pdcp_netlink_thread_fct(void *arg)
if (eNB_flag) {
if (pdcp_netlink_nb_element_enb[module_id]
> PDCP_QUEUE_NB_ELEMENTS) {
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%d)\n",
module_id, pdcp_netlink_nb_element_enb);
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%lu)\n",
module_id, (intptr_t)pdcp_netlink_nb_element_enb);
}
LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for eNB module id %d\n", module_id);
......@@ -275,8 +275,8 @@ void *pdcp_netlink_thread_fct(void *arg)
} else {
if (pdcp_netlink_nb_element_ue[module_id]
> PDCP_QUEUE_NB_ELEMENTS) {
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%d)\n",
module_id, pdcp_netlink_nb_element_ue);
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%lu)\n",
module_id, (intptr_t)pdcp_netlink_nb_element_ue);
}
LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for UE module id %d\n", module_id);
......@@ -293,4 +293,4 @@ void *pdcp_netlink_thread_fct(void *arg)
return NULL;
}
#endif
......@@ -63,21 +63,9 @@
#include "LTE_UE-Capability-NB-r13.h" //equivalent of UE-EUTRA-Capability.h
//-------------------
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
/* TODO: be sure this include is correct.
* It solves a problem of compilation of the RRH GW,
* issue #186.
*/
#if !defined(ENABLE_ITTI)
# include "as_message.h"
#endif
#if defined(ENABLE_USE_MME)
# include "commonDef.h"
#endif
#if ENABLE_RAL
# include "collection/hashtable/obj_hashtable.h"
......@@ -476,11 +464,9 @@ typedef struct OAI_UECapability_NB_IoT_s {
typedef struct UE_RRC_INST_NB_IoT_s {
Rrc_State_NB_IoT_t RrcState;
Rrc_Sub_State_NB_IoT_t RrcSubState;
# if defined(ENABLE_USE_MME)
plmn_t plmnID;
Byte_t rat;
as_nas_info_t initialNasMsg;
# endif
OAI_UECapability_NB_IoT_t *UECap;
uint8_t *UECapability;
uint8_t UECapability_size;
......
This diff is collapsed.
......@@ -284,21 +284,14 @@ void *send_UE_status_notification(void *);
#include "rrc_rrm_interface.h"
#endif
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
#endif
/* TODO: be sure this include is correct.
* It solves a problem of compilation of the RRH GW,
* issue #186.
*/
#if !defined(ENABLE_ITTI)
#include "as_message.h"
#endif
#include "intertask_interface.h"
#include "commonDef.h"
#if defined(ENABLE_USE_MME)
#include "commonDef.h"
#endif
//--------
typedef unsigned int uid_t;
......@@ -431,7 +424,7 @@ typedef struct UE_S_TMSI_s {
m_tmsi_t m_tmsi;
} __attribute__ ((__packed__)) UE_S_TMSI;
#if defined(ENABLE_ITTI)
typedef enum e_rab_satus_e {
E_RAB_STATUS_NEW,
E_RAB_STATUS_DONE, // from the eNB perspective
......@@ -448,7 +441,7 @@ typedef struct e_rab_param_s {
s1ap_Cause_t cause;
uint8_t cause_value;
} __attribute__ ((__packed__)) e_rab_param_t;
#endif
/* Intermediate structure for Handover management. Associated per-UE in eNB_RRC_INST */
typedef struct HANDOVER_INFO_s {
......@@ -569,7 +562,7 @@ typedef struct eNB_RRC_UE_s {
rnti_t rnti;
uint64_t random_ue_identity;
#if defined(ENABLE_ITTI)
/* Information from UE RRC ConnectionRequest */
UE_S_TMSI Initialue_identity_s_TMSI;
LTE_EstablishmentCause_t establishment_cause;
......@@ -613,7 +606,6 @@ typedef struct eNB_RRC_UE_s {
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];
#endif
uint32_t ul_failure_timer;
uint32_t ue_release_timer;
uint32_t ue_release_timer_thres;
......@@ -725,10 +717,7 @@ typedef struct eNB_RRC_INST_s {
#endif
//RRC configuration
#if defined(ENABLE_ITTI)
RrcConfigurationReq configuration;
#endif
// other RAN parameters
int srb1_timer_poll_retransmit;
int srb1_poll_pdu;
......@@ -749,11 +738,9 @@ typedef struct OAI_UECapability_s {
typedef struct UE_RRC_INST_s {
Rrc_State_t RrcState;
Rrc_Sub_State_t RrcSubState;
# if defined(ENABLE_USE_MME)
plmn_t plmnID;
Byte_t rat;
as_nas_info_t initialNasMsg;
# endif
OAI_UECapability_t *UECap;
uint8_t *UECapability;
uint8_t UECapability_size;
......
This diff is collapsed.
......@@ -27,19 +27,14 @@
* \email: lionel.gauthier@eurecom.fr
*/
#if defined(ENABLE_USE_MME)
# include "rrc_defs.h"
# include "rrc_extern.h"
# include "RRC/LTE/MESSAGES/asn1_msg.h"
# include "rrc_eNB_GTPV1U.h"
# include "rrc_eNB_UE_context.h"
# include "msc.h"
# if defined(ENABLE_ITTI)
# include "asn1_conversions.h"
# include "intertask_interface.h"
# endif
# include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
......@@ -66,10 +61,6 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
ctxt_pP->rnti);
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) {
// ue_context_p->ue_context.enb_gtp_teid[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_S1u_teid[i];
// ue_context_p->ue_context.enb_gtp_addrs[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_addr;
// ue_context_p->ue_context.enb_gtp_ebi[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->eps_bearer_id[i];
ue_context_p->ue_context.enb_gtp_teid[inde_list[i]] = create_tunnel_resp_pP->enb_S1u_teid[i];
ue_context_p->ue_context.enb_gtp_addrs[inde_list[i]] = create_tunnel_resp_pP->enb_addr;
ue_context_p->ue_context.enb_gtp_ebi[inde_list[i]] = create_tunnel_resp_pP->eps_bearer_id[i];
......@@ -98,4 +89,4 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
return -1;
}
}
#endif
......@@ -30,10 +30,6 @@
#ifndef RRC_ENB_GTPV1U_H_
#define RRC_ENB_GTPV1U_H_
# if defined(ENABLE_USE_MME)
# if defined(ENABLE_ITTI)
/*! \fn rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(const protocol_ctxt_t* const ctxt_pP, const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP)
*\brief Process GTPV1U_ENB_CREATE_TUNNEL_RESP message received from GTPV1U, retrieve the enb teid created.
......@@ -47,6 +43,5 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
uint8_t *inde_list
);
# endif
# endif /* defined(ENABLE_USE_MME) */
#endif /* RRC_ENB_GTPV1U_H_ */
......@@ -27,7 +27,7 @@
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
*/
#if defined(ENABLE_USE_MME)
# include "rrc_defs.h"
# include "rrc_extern.h"
# include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
......@@ -41,16 +41,12 @@
# include "s1ap_eNB_defs.h"
# include "s1ap_eNB_management_procedures.h"
# include "s1ap_eNB_ue_context.h"
#include "asn1_conversions.h"
#include "intertask_interface.h"
#include "pdcp.h"
#include "pdcp_primitives.h"
#include "s1ap_eNB.h"
#if defined(ENABLE_ITTI)
#include "asn1_conversions.h"
#include "intertask_interface.h"
#include "pdcp.h"
#include "pdcp_primitives.h"
#include "s1ap_eNB.h"
#else
#include "../../S1AP/s1ap_eNB.h"
#endif
#if defined(ENABLE_SECURITY)
#include "UTIL/OSA/osa_defs.h"
......@@ -164,7 +160,7 @@ void extract_imsi(uint8_t *pdu_buf, uint32_t pdu_len, rrc_eNB_ue_context_t *ue_c
}
}
# if defined(ENABLE_ITTI)
//------------------------------------------------------------------------------
/*
* Get the UE S1 struct containing hashtables S1_id/UE_id.
......@@ -628,7 +624,6 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p).nb_of_e_rabs_failed = e_rabs_failed;
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
}
# endif
//------------------------------------------------------------------------------
void
......@@ -639,7 +634,6 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
)
//------------------------------------------------------------------------------
{
#if defined(ENABLE_ITTI)
{
LTE_ULInformationTransfer_t *ulInformationTransfer = &ul_dcch_msg->message.choice.c1.choice.ulInformationTransfer;
......@@ -666,36 +660,6 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
}
}
#else
{
LTE_ULInformationTransfer_t *ulInformationTransfer;
ulInformationTransfer =
&ul_dcch_msg->message.choice.c1.choice.
ulInformationTransfer;
if (ulInformationTransfer->criticalExtensions.present ==
LTE_ULInformationTransfer__criticalExtensions_PR_c1) {
if (ulInformationTransfer->criticalExtensions.choice.c1.present ==
LTE_ULInformationTransfer__criticalExtensions__c1_PR_ulInformationTransfer_r8) {
ULInformationTransfer_r8_IEs_t
*ulInformationTransferR8;
ulInformationTransferR8 =
&ulInformationTransfer->criticalExtensions.choice.
c1.choice.ulInformationTransfer_r8;
if (ulInformationTransferR8->dedicatedInfoType.present ==
LTE_ULInformationTransfer_r8_IEs__dedicatedInfoType_PR_dedicatedInfoNAS) {
extract_imsi(ulInformationTransferR8->dedicatedInfoType.choice.dedicatedInfoNAS.buf,
ulInformationTransferR8->dedicatedInfoType.choice.dedicatedInfoNAS.size,
ue_context_pP);
s1ap_eNB_new_data_request (mod_id, ue_index,
ulInformationTransferR8->dedicatedInfoType.choice.dedicatedInfoNAS.buf,
ulInformationTransferR8->dedicatedInfoType.choice.dedicatedInfoNAS.size);
}
}
}
}
#endif
}
//------------------------------------------------------------------------------
......@@ -758,7 +722,6 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
//------------------------------------------------------------------------------
{
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
#if defined(ENABLE_ITTI)
{
MessageDef *message_p = NULL;
rrc_ue_s1ap_ids_t *rrc_ue_s1ap_ids_p = NULL;
......@@ -870,20 +833,9 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
} // end "Fill UE identities with available information" sub-part
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, message_p);
}
#else
{
s1ap_eNB_new_data_request (
ctxt_pP->module_id,
ue_context_pP,
rrcConnectionSetupComplete->dedicatedInfoNAS.
buf,
rrcConnectionSetupComplete->dedicatedInfoNAS.
size);
}
#endif
}
# if defined(ENABLE_ITTI)
//------------------------------------------------------------------------------
int
rrc_eNB_process_S1AP_DOWNLINK_NAS(
......@@ -2172,5 +2124,3 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg
}
}
# endif /* defined(ENABLE_ITTI) */
#endif /* defined(ENABLE_USE_MME) */
......@@ -31,13 +31,10 @@
#ifndef RRC_ENB_S1AP_H_
#define RRC_ENB_S1AP_H_
# if defined(ENABLE_USE_MME)
#include "LTE_UL-DCCH-Message.h"
/* Up link procedures */
# if defined(ENABLE_ITTI)
typedef struct rrc_ue_s1ap_ids_s {
/* Tree related data */
RB_ENTRY(rrc_ue_s1ap_ids_s) entries;
......@@ -273,6 +270,4 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* const ue_context_pP);
int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg_name, instance_t instance);
# endif
# endif /* defined(ENABLE_USE_MME) */
#endif /* RRC_ENB_S1AP_H_ */
......@@ -39,13 +39,13 @@
int rrc_init_global_param(void);
int L3_xface_init(void);
void openair_rrc_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,uint8_t HO_enabled);
#if defined(ENABLE_ITTI)
char
openair_rrc_eNB_configuration(
const module_id_t enb_mod_idP,
RrcConfigurationReq* configuration
);
#endif
char openair_rrc_eNB_init(
const module_id_t module_idP);
......@@ -344,7 +344,7 @@ void
rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* ue_context_pP);
#if defined(ENABLE_ITTI)
void rrc_enb_init(void);
void *rrc_enb_process_itti_msg(void *);
......@@ -356,7 +356,7 @@ void *rrc_enb_task(void *args_p);
/**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */
void *rrc_ue_task(void *args_p);
#endif
void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_req_t *m);
......@@ -612,7 +612,6 @@ rrc_ue_process_securityModeCommand(
);
*/
#if !defined(ENABLE_USE_MME)
void rrc_eNB_emulation_notify_ue_module_id(
const module_id_t ue_module_idP,
const rnti_t rntiP,
......@@ -620,7 +619,7 @@ void rrc_eNB_emulation_notify_ue_module_id(
const uint8_t cell_identity_byte1P,
const uint8_t cell_identity_byte2P,
const uint8_t cell_identity_byte3P);
#endif
void
......
......@@ -39,10 +39,8 @@
#include "PHY/defs_common.h"
#include "PHY/impl_defs_top.h"
#include "platform_types.h"
#if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
#endif
#ifdef __cplusplus
extern "C"
......@@ -713,10 +711,7 @@ typedef struct {
unsigned char transmission_mode[MAX_NUM_CCs];
int max_predefined_traffic_config_index;
int max_customized_traffic_config_index;
#if defined(ENABLE_USE_MME)
s1ap_eNB_config_t s1ap_config;
#endif
/* Per-Slot ISR
* Interval between two ISR = 500usec
......
......@@ -44,7 +44,7 @@ Description Implements the API used by the NAS layer running in the UE
#include "networkDef.h"
#include "at_command.h"
#include "user_api_defs.h"
#include "user_defs.h"
#include "../../user_defs.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
......
......@@ -41,7 +41,7 @@ Description Defines the EPS Mobility Management procedure call manager,
#include "commonDef.h"
#include "networkDef.h"
#include "user_defs.h"
#include "../user_defs.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
......
......@@ -45,7 +45,7 @@ Description Defines functions used to handle state of EPS bearer contexts
#include "esmData.h"
#include "nas_timer.h"
#include "user_defs.h"
#include "../user_defs.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
......
......@@ -19,28 +19,17 @@
* contact@openairinterface.org
*/
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# include "create_tasks.h"
# include "common/utils/LOG/log.h"
# include "targets/RT/USER/lte-softmodem.h"
#ifdef OPENAIR2
#if defined(ENABLE_USE_MME)
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "nas_ue_task.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
/* temporary warning removale while implementing noS1 */
/* as config option */
#else
#ifdef EPC_MODE_ENABLED
#undef EPC_MODE_ENABLED
#endif
#define EPC_MODE_ENABLED 0
#endif
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
......@@ -62,7 +51,6 @@ int create_tasks(uint32_t enb_nb) {
}
}
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
if (enb_nb > 0) {
......@@ -95,7 +83,6 @@ int create_tasks(uint32_t enb_nb) {
}
} /* if (EPC_MODE_ENABLED) */
#endif
if (enb_nb > 0) {
LOG_I(RRC,"Creating RRC eNB Task\n");
......@@ -109,4 +96,4 @@ int create_tasks(uint32_t enb_nb) {
itti_wait_ready(0);
return 0;
}
#endif
......@@ -19,19 +19,16 @@
* contact@openairinterface.org
*/
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# include "create_tasks.h"
# include "common/utils/LOG/log.h"
#ifdef OPENAIR2
#if defined(ENABLE_USE_MME)
#include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "nas_ue_task.h"
#include "openair3/NAS/UE/nas_ue_task.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
#endif
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
......@@ -43,7 +40,7 @@
int create_tasks_ue(uint32_t ue_nb) {
LOG_D(ENB_APP, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
itti_wait_ready(1);
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) {
# if defined(NAS_BUILT_IN_UE)
if (ue_nb > 0) {
......@@ -58,9 +55,8 @@ int create_tasks_ue(uint32_t ue_nb) {
return -1;
}
}
# endif
# endif
} /* EPC_MODE_ENABLED */
if (ue_nb > 0) {
if (itti_create_task (TASK_RRC_UE, rrc_ue_task, NULL) < 0) {
......@@ -72,4 +68,4 @@ int create_tasks_ue(uint32_t ue_nb) {
itti_wait_ready(0);
return 0;
}
#endif
......@@ -80,14 +80,8 @@
#include "UTIL/OTG/otg_extern.h"
#endif
#if defined(ENABLE_ITTI)
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
#endif
#endif
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "T.h"
......@@ -104,11 +98,6 @@ struct timing_info_t {
// Fix per CC openair rf/if device update
// extern openair0_device openair0;
#if defined(ENABLE_ITTI)
extern volatile int start_eNB;
extern volatile int start_UE;
#endif
extern volatile int oai_exit;
extern int transmission_mode;
......
......@@ -96,14 +96,10 @@ static int DEFENBS[] = {0};
#include "UTIL/OTG/otg_extern.h"
#endif
#if defined(ENABLE_ITTI)
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
# include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
# endif
#endif
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "T.h"
......
......@@ -94,3 +94,11 @@ void get_common_options(void) {
if(worker_config != NULL) set_worker_conf(worker_config);
}
unsigned int is_nos1exec(char *exepath) {
if ( strcmp( basename(exepath), "lte-softmodem-nos1") == 0)
return 1;
if ( strcmp( basename(exepath), "lte-uesoftmodem-nos1") == 0)
return 1;
return 0;
}
......@@ -82,9 +82,9 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "UTIL/OTG/otg_vars.h"
#endif
#if defined(ENABLE_ITTI)
#include "create_tasks.h"
#endif
#include "create_tasks.h"
#include "PHY/INIT/phy_init.h"
......@@ -107,9 +107,6 @@ unsigned short config_frames[4] = {2,9,11,13};
static pthread_t forms_thread; //xforms
#endif //XFORMS
#ifndef ENABLE_USE_MME
#define EPC_MODE_ENABLED 0
#endif
pthread_cond_t nfapi_sync_cond;
pthread_mutex_t nfapi_sync_mutex;
......@@ -482,7 +479,7 @@ void wait_eNBs(void) {
printf("eNB L1 are configured\n");
}
#if defined(ENABLE_ITTI)
/*
* helper function to terminate a certain ITTI task
*/
......@@ -578,7 +575,7 @@ int restart_L1L2(module_id_t enb_id) {
pthread_mutex_unlock(&sync_mutex);
return 0;
}
#endif
static void wait_nfapi_init(char *thread_name) {
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
......@@ -611,7 +608,9 @@ int main( int argc, char **argv ) {
logInit();
printf("Reading in command-line options\n");
get_options ();
if (is_nos1exec(argv[0]) )
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
fprintf(stderr,"Getting configuration failed\n");
exit(-1);
......@@ -629,7 +628,7 @@ int main( int argc, char **argv ) {
}
cpuf=get_cpu_freq_GHz();
#if defined(ENABLE_ITTI)
printf("ITTI init, useMME: %i\n" ,EPC_MODE_ENABLED);
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
......@@ -639,15 +638,8 @@ int main( int argc, char **argv ) {
}
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif
init_opt();
#ifdef PDCP_USE_NETLINK
printf("PDCP netlink\n");
netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init();
#endif
#endif
// to make a graceful exit when ctrl-c is pressed
signal(SIGSEGV, signal_handler);
signal(SIGINT, signal_handler);
......@@ -660,50 +652,8 @@ int main( int argc, char **argv ) {
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
printf("Runtime table\n");
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
#ifndef DEADLINE_SCHEDULER
printf("NO deadline scheduler\n");
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
cpu_set_t cpuset;
int s;
char cpu_affinity[1024];
CPU_ZERO(&cpuset);
#ifdef CPU_AFFINITY
if (get_nprocs() > 2) {
CPU_SET(0, &cpuset);
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
if (s != 0) {
perror( "pthread_setaffinity_np");
exit_fun("Error setting processor affinity");
}
LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n");
}
#endif
/* Check the actual affinity mask assigned to the thread */
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
if (s != 0) {
perror( "pthread_getaffinity_np");
exit_fun("Error getting processor affinity ");
}
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
for (int j = 0; j < CPU_SETSIZE; j++) {
if (CPU_ISSET(j, &cpuset)) {
char temp[1024];
sprintf(temp, " CPU_%d ", j);
strcat(cpu_affinity, temp);
}
}
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
#endif
#if defined(ENABLE_ITTI)
pdcp_module_init( ( IS_SOFTMODEM_NOS1 && !(IS_SOFTMODEM_NOKRNMOD))? (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT);
#
if (RC.nb_inst > 0) {
// don't create if node doesn't connect to RRC/S1/GTP
if (create_tasks(1) < 0) {
......@@ -716,8 +666,6 @@ int main( int argc, char **argv ) {
printf("No ITTI, Initializing L1\n");
RCconfig_L1();
}
#endif
/* Start the agent. If it is turned off in the configuration, it won't start */
RCconfig_flexran();
......@@ -770,7 +718,7 @@ int main( int argc, char **argv ) {
rt_sleep_ns(10*100000000ULL);
if (nfapi_mode) {
printf("NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
LOG_I(ENB_APP,"NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL);
}
......@@ -795,7 +743,7 @@ int main( int argc, char **argv ) {
break;
}
printf("NFAPI MODE:%s\n", nfapi_mode_str);
LOG_I(ENB_APP,"NFAPI MODE:%s\n", nfapi_mode_str);
if (nfapi_mode==2) {// VNF
......@@ -805,8 +753,7 @@ if (nfapi_mode==2) {// VNF
wait_nfapi_init("main?");
}
printf("START MAIN THREADS\n");
LOG_I(ENB_APP,"START MAIN THREADS\n");
// start the main threads
number_of_cards = 1;
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
......@@ -845,43 +792,32 @@ if (nfapi_mode==2) {// VNF
fflush(stdout);
fflush(stderr);
wait_RUs();
printf("ALL RUs READY!\n");
printf("RC.nb_RU:%d\n", RC.nb_RU);
LOG_I(ENB_APP,"RC.nb_RU:%d\n", RC.nb_RU);
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
printf("ALL RUs ready - init eNBs\n");
if (nfapi_mode != 1 && nfapi_mode != 2) {
printf("Not NFAPI mode - call init_eNB_afterRU()\n");
LOG_I(ENB_APP,"Not NFAPI mode - call init_eNB_afterRU()\n");
init_eNB_afterRU();
} else {
printf("NFAPI mode - DO NOT call init_eNB_afterRU()\n");
LOG_I(ENB_APP,"NFAPI mode - DO NOT call init_eNB_afterRU()\n");
}
printf("ALL RUs ready - ALL eNBs ready\n");
LOG_UI(ENB_APP,"ALL RUs ready - ALL eNBs ready\n");
// connect the TX/RX buffers
sleep(1); /* wait for thread activation */
printf("Sending sync to all threads\n");
LOG_I(ENB_APP,"Sending sync to all threads\n");
pthread_mutex_lock(&sync_mutex);
sync_var=0;
pthread_cond_broadcast(&sync_cond);
pthread_mutex_unlock(&sync_mutex);
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
// wait for end of program
printf("TYPE <CTRL-C> TO TERMINATE\n");
LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n");
//getchar();
#if defined(ENABLE_ITTI)
printf("Entering ITTI signals handler\n");
itti_wait_tasks_end();
printf("Returned from ITTI signal handler\n");
oai_exit=1;
printf("oai_exit=%d\n",oai_exit);
#else
while (oai_exit==0)
rt_sleep_ns(100000000ULL);
printf("Terminating application - oai_exit=%d\n",oai_exit);
#endif
LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit);
// stop threads
#ifdef XFORMS
printf("waiting for XFORMS thread\n");
......@@ -902,7 +838,7 @@ if (nfapi_mode==2) {// VNF
}
#endif
printf("stopping MODEM threads\n");
LOG_I(ENB_APP,"stopping MODEM threads\n");
stop_eNB(NB_eNB_INST);
stop_RU(RC.nb_RU);
......
......@@ -33,10 +33,8 @@
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "flexran_agent.h"
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
......@@ -241,6 +239,8 @@
#define SOFTMODEM_NOS1_BIT (1<<0)
#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
#define SOFTMODEM_NONBIOT_BIT (1<<2)
#define SOFTMODEM_BASICSIM_BIT (1<<10)
typedef struct {
uint64_t optmask;
THREAD_STRUCT thread_struct;
......@@ -261,11 +261,12 @@ typedef struct {
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
#define IS_SOFTMODEM_NONBIOT ( get_softmodem_optmask() & SOFTMODEM_NONBIOT_BIT)
#define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT)
extern uint64_t get_softmodem_optmask(void);
extern uint64_t set_softmodem_optmask(uint64_t bitmask);
extern void get_common_options(void);
extern softmodem_params_t *get_softmodem_params(void);
extern unsigned int is_nos1exec(char *exepath) ;
uint64_t get_pdcp_optmask(void);
extern pthread_cond_t sync_cond;
extern pthread_mutex_t sync_mutex;
......
......@@ -443,6 +443,10 @@ static void get_options(void) {
if (dumpframe > 0) mode = rx_dump_frame;
# if BASIC_SIMULATOR
set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); //this BASIC_SIMULATOR should be a config option
# endif
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
}
......@@ -712,6 +716,11 @@ int main( int argc, char **argv ) {
for (int i=0; i<MAX_NUM_CCs; i++) tx_max_power[i]=23;
get_options ();
if (is_nos1exec(argv[0]) )
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
printf("Running with %d UE instances\n",NB_UE_INST);
if (NB_UE_INST > 1 && simL1flag != 1 && nfapi_mode != 3) {
......@@ -764,13 +773,13 @@ int main( int argc, char **argv ) {
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif
init_opt();
#ifdef PDCP_USE_NETLINK
printf("PDCP netlink\n");
netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init();
#endif
#endif
uint32_t pdcp_initmask = ((!IS_SOFTMODEM_NOS1) || IS_SOFTMODEM_NOKRNMOD)? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
if ( IS_SOFTMODEM_BASICSIM ) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
}
pdcp_module_init( pdcp_initmask );
//TTN for D2D
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
printf ("RRC control socket\n");
......@@ -818,37 +827,6 @@ int main( int argc, char **argv ) {
RCConfig_sim();
}
// source code written in below moved to later to avoid keeping waiting for nfapi_sync_cond in wait_nfapi_init.
/*
// start the main UE threads
int eMBMS_active = 0;
if (nfapi_mode==3) { // UE-STUB-PNF
config_sync_var=0;
wait_nfapi_init("main?");
//Panos: Temporarily we will be using single set of threads for multiple UEs.
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
} else {
init_UE(NB_UE_INST,eMBMS_active,uecap_xer_in,0,get_softmodem_params()->phy_test,UE_scan,UE_scan_carrier,mode,(int)rx_gain[0][0],tx_max_power[0],
frame_parms[0]);
}
if (get_softmodem_params()->phy_test==0) {
printf("Filling UE band info\n");
fill_ue_band_info();
dl_phy_sync_success (0, 0, 0, 1);
}
if (nfapi_mode!=3) {
number_of_cards = 1;
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
}
}
*/
cpuf=get_cpu_freq_GHz();
#ifndef DEADLINE_SCHEDULER
......
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