Commit 38d772d8 authored by frtabu's avatar frtabu

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

parent 6a47f9e7
...@@ -693,10 +693,10 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE ...@@ -693,10 +693,10 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
########################## ##########################
# PDCP LAYER OPTIONS # 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 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(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_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(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
########################## ##########################
# RRC LAYER OPTIONS # RRC LAYER OPTIONS
...@@ -1994,26 +1994,29 @@ add_executable(lte-softmodem-nos1 ...@@ -1994,26 +1994,29 @@ add_executable(lte-softmodem-nos1
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${XFORMS_SOURCE} ${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM} ${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE} ${T_SOURCE}
${CONFIG_SOURCES} ${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES} ${SHLIB_LOADER_SOURCES}
) )
add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag) add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag)
target_link_libraries (lte-softmodem-nos1 target_link_libraries (lte-softmodem-nos1
-Wl,--start-group -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} 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
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${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 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 ${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 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 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${T_LIB}) target_link_libraries (lte-softmodem-nos1 ${T_LIB})
# lte-uesoftmodem is UE implementation # lte-uesoftmodem is UE implementation
####################################### #######################################
...@@ -2027,6 +2030,8 @@ add_executable(lte-uesoftmodem ...@@ -2027,6 +2030,8 @@ add_executable(lte-uesoftmodem
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c ${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.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/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
...@@ -2070,6 +2075,7 @@ add_executable(lte-uesoftmodem-nos1 ...@@ -2070,6 +2075,7 @@ add_executable(lte-uesoftmodem-nos1
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.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/utils.c
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${XFORMS_SOURCE} ${XFORMS_SOURCE}
...@@ -2080,18 +2086,18 @@ add_executable(lte-uesoftmodem-nos1 ...@@ -2080,18 +2086,18 @@ add_executable(lte-uesoftmodem-nos1
) )
add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag) add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag)
target_link_libraries (lte-uesoftmodem-nos1 target_link_libraries (lte-uesoftmodem-nos1
-Wl,--start-group -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} 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
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} ${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 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 ${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 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 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB}) target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
# USIM process # USIM process
################# #################
#add_executable(usim #add_executable(usim
......
...@@ -547,9 +547,9 @@ function main() { ...@@ -547,9 +547,9 @@ function main() {
mkdir -p $DIR/$lte_build_dir/build mkdir -p $DIR/$lte_build_dir/build
cmake_file=$DIR/$lte_build_dir/CMakeLists.txt cmake_file=$DIR/$lte_build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
if [ "$NOS1" = "1" ] ; then # if [ "$NOS1" = "1" ] ; then
cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file # cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
fi # fi
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file echo "set ( XFORMS $XFORMS )" >> $cmake_file
......
...@@ -39,13 +39,14 @@ ...@@ -39,13 +39,14 @@
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include "platform_constants.h" #include "platform_constants.h"
#ifdef UE_NAS_USE_TUN
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <linux/if.h> #include <linux/if.h>
#include <linux/if_tun.h> #include <linux/if_tun.h>
#include "openairinterface5g_limits.h" #include "openairinterface5g_limits.h"
#endif
#include "pdcp.h"
char nl_rx_buf[NL_MAX_PAYLOAD]; char nl_rx_buf[NL_MAX_PAYLOAD];
...@@ -54,20 +55,16 @@ struct nlmsghdr *nas_nlh_tx = NULL; ...@@ -54,20 +55,16 @@ struct nlmsghdr *nas_nlh_tx = NULL;
struct nlmsghdr *nas_nlh_rx = NULL; struct nlmsghdr *nas_nlh_rx = NULL;
struct iovec nas_iov_tx; struct iovec nas_iov_tx;
struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)}; 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; int nas_sock_fd;
#endif
struct msghdr nas_msg_tx; struct msghdr nas_msg_tx;
struct msghdr nas_msg_rx; struct msghdr nas_msg_rx;
#define GRAAL_NETLINK_ID 31 #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; struct ifreq ifr;
int fd, err; int fd, err;
...@@ -77,136 +74,112 @@ static int tun_alloc(char *dev) ...@@ -77,136 +74,112 @@ static int tun_alloc(char *dev)
} }
memset(&ifr, 0, sizeof(ifr)); memset(&ifr, 0, sizeof(ifr));
/* Flags: IFF_TUN - TUN device (no Ethernet headers) /* Flags: IFF_TUN - TUN device (no Ethernet headers)
* IFF_TAP - TAP device * IFF_TAP - TAP device
* *
* IFF_NO_PI - Do not provide packet information * IFF_NO_PI - Do not provide packet information
*/ */
ifr.ifr_flags = IFF_TUN | IFF_NO_PI; ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
if( *dev ) if( *dev )
strncpy(ifr.ifr_name, dev, IFNAMSIZ); strncpy(ifr.ifr_name, dev, IFNAMSIZ);
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){ if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) {
close(fd); close(fd);
return err; return err;
} }
strcpy(dev, ifr.ifr_name); strcpy(dev, ifr.ifr_name);
return fd; return fd;
} }
int netlink_init(void) int netlink_init_tun(void) {
{
int i;
int ret; int ret;
char ifname[64]; char ifname[64];
for (i = 0; i < NUMBER_OF_UE_MAX; i++) { sprintf(ifname, "oip1");
sprintf(ifname, "oip%d", i+1); nas_sock_fd = tun_alloc(ifname);
nas_sock_fd[i] = tun_alloc(ifname);
if (nas_sock_fd[i] == -1) { if (nas_sock_fd == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[i],errno, strerror(errno)); printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno));
exit(1); exit(1);
} }
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd[i]); printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd);
ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
#if !defined(PDCP_USE_NETLINK_QUEUES) if (ret == -1) {
ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK); printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
if (ret == -1) { if (LINK_ENB_PDCP_TO_IP_DRIVER) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit(1); 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));
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));
/* Fill the netlink message header */
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));
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
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;
} }
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));
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));
/* Fill the netlink message header */
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));
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
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; return 1;
} }
#else /* UE_NAS_USE_TUN */
int netlink_init(void) int netlink_init(void) {
{
int ret; int ret;
nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID); nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
if (nas_sock_fd == -1) { if (nas_sock_fd == -1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno)); printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit(1); if (LINK_ENB_PDCP_TO_IP_DRIVER) {
#endif exit(1);
}
} }
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd); 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); ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
if (ret == -1) { if (ret == -1) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno)); printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
exit(1);
#endif
}
#endif if (LINK_ENB_PDCP_TO_IP_DRIVER) {
exit(1);
}
}
memset(&nas_src_addr, 0, sizeof(nas_src_addr)); memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK; nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */ nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */ 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)); memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK; nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */ nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */ nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART // TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD)); nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD)); memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
...@@ -214,7 +187,6 @@ int netlink_init(void) ...@@ -214,7 +187,6 @@ int netlink_init(void)
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD); nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */ nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0; nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx; nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len; nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx)); memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
...@@ -222,16 +194,12 @@ int netlink_init(void) ...@@ -222,16 +194,12 @@ int netlink_init(void)
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr); nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx; nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1; nas_msg_tx.msg_iovlen = 1;
// RX PART // RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx)); memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr; nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr); nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx; nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1; nas_msg_rx.msg_iovlen = 1;
return(nas_sock_fd); return(nas_sock_fd);
} }
#endif /* UE_NAS_USE_TUN */
...@@ -62,5 +62,6 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag); ...@@ -62,5 +62,6 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag);
void clear_eNB_transport_info(uint8_t); void clear_eNB_transport_info(uint8_t);
void clear_UE_transport_info(uint8_t); void clear_UE_transport_info(uint8_t);
int netlink_init(void); int netlink_init(void);
int netlink_init_tun(void);
#endif /* EMU_PROTO_H_ */ #endif /* EMU_PROTO_H_ */
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
* Author: winckel * Author: winckel
*/ */
#if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
// Messages for NAS logging // Messages for NAS logging
MESSAGE_DEF(NAS_DL_EMM_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_dl_emm_raw_msg) 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_ ...@@ -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) 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 @@ ...@@ -29,7 +29,7 @@
#ifndef NAS_MESSAGES_TYPES_H_ #ifndef NAS_MESSAGES_TYPES_H_
#define NAS_MESSAGES_TYPES_H_ #define NAS_MESSAGES_TYPES_H_
# if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
#include "nas_message.h" #include "nas_message.h"
...@@ -142,5 +142,4 @@ typedef struct nas_esm_protected_msg_s { ...@@ -142,5 +142,4 @@ typedef struct nas_esm_protected_msg_s {
ESM_msg choice; ESM_msg choice;
} nas_esm_protected_msg_t; } nas_esm_protected_msg_t;
# endif /* ENABLE_USE_MME */
#endif /* NAS_MESSAGES_TYPES_H_ */ #endif /* NAS_MESSAGES_TYPES_H_ */
...@@ -33,13 +33,9 @@ ...@@ -33,13 +33,9 @@
#include "log.h" #include "log.h"
#include "log_extern.h" #include "log_extern.h"
#include "assertions.h" #include "assertions.h"
#if defined(ENABLE_ITTI) #include "intertask_interface.h"
#include "intertask_interface.h" #include "s1ap_eNB.h"
#if defined(ENABLE_USE_MME) #include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#endif
#endif
#include "SystemInformationBlockType2.h" #include "SystemInformationBlockType2.h"
#include "PHY/phy_extern.h" #include "PHY/phy_extern.h"
......
...@@ -33,13 +33,9 @@ ...@@ -33,13 +33,9 @@
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "assertions.h" #include "assertions.h"
#if defined(ENABLE_ITTI) #include "intertask_interface.h"
# include "intertask_interface.h" #include "s1ap_eNB.h"
# if defined(ENABLE_USE_MME) #include "sctp_eNB_task.h"
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif
#endif
#include "LTE_SystemInformationBlockType2.h" #include "LTE_SystemInformationBlockType2.h"
#include "common/config/config_userapi.h" #include "common/config/config_userapi.h"
#include "RRC_config_tools.h" #include "RRC_config_tools.h"
......
...@@ -37,36 +37,27 @@ ...@@ -37,36 +37,27 @@
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h" # include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
# include "sctp_eNB_task.h" # include "sctp_eNB_task.h"
# include "gtpv1u_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_eNB.h"
# include "x2ap_messages_types.h" # include "x2ap_messages_types.h"
# define X2AP_ENB_REGISTER_RETRY_DELAY 10 # define X2AP_ENB_REGISTER_RETRY_DELAY 10
#include "openair1/PHY/INIT/phy_init.h" #include "openair1/PHY/INIT/phy_init.h"
extern unsigned char NB_eNB_INST; extern unsigned char NB_eNB_INST;
#endif
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
#if defined(ENABLE_ITTI)
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
# if defined(ENABLE_USE_MME)
# define ENB_REGISTER_RETRY_DELAY 10 # define ENB_REGISTER_RETRY_DELAY 10
# endif
#include "targets/RT/USER/lte-softmodem.h" #include "targets/RT/USER/lte-softmodem.h"
...@@ -115,7 +106,7 @@ static void configure_rrc(uint32_t enb_id) ...@@ -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) 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; uint32_t enb_id;
...@@ -143,8 +134,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//, ...@@ -143,8 +134,7 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
return register_enb_pending; return register_enb_pending;
} }
# endif
#endif
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end) 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) ...@@ -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) void *eNB_app_task(void *args_p)
{ {
#if defined(ENABLE_ITTI)
uint32_t enb_nb = RC.nb_inst; uint32_t enb_nb = RC.nb_inst;
uint32_t enb_id_start = 0; uint32_t enb_id_start = 0;
uint32_t enb_id_end = enb_id_start + enb_nb; uint32_t enb_id_end = enb_id_start + enb_nb;
# if defined(ENABLE_USE_MME)
uint32_t register_enb_pending=0; uint32_t register_enb_pending=0;
uint32_t registered_enb; uint32_t registered_enb;
long enb_register_retry_timer_id; long enb_register_retry_timer_id;
# endif
uint32_t x2_register_enb_pending; uint32_t x2_register_enb_pending;
uint32_t x2_registered_enb; uint32_t x2_registered_enb;
long x2_enb_register_retry_timer_id; long x2_enb_register_retry_timer_id;
...@@ -220,15 +207,11 @@ void *eNB_app_task(void *args_p) ...@@ -220,15 +207,11 @@ void *eNB_app_task(void *args_p)
configure_rrc(enb_id); configure_rrc(enb_id);
} }
# if defined(ENABLE_USE_MME) if (EPC_MODE_ENABLED) {
/* Try to register each eNB */ /* Try to register each eNB */
registered_enb = 0; registered_enb = 0;
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p); 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 */ /* Try to register each eNB with each other */
x2_registered_enb = 0; x2_registered_enb = 0;
...@@ -255,44 +238,45 @@ void *eNB_app_task(void *args_p) ...@@ -255,44 +238,45 @@ void *eNB_app_task(void *args_p)
break; break;
case S1AP_REGISTER_ENB_CNF: 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), 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); S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
DevAssert(register_enb_pending > 0); DevAssert(register_enb_pending > 0);
register_enb_pending--; register_enb_pending--;
/* Check if at least eNB is registered with one MME */ /* Check if at least eNB is registered with one MME */
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) { if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
registered_enb++; registered_enb++;
} }
/* Check if all register eNB requests have been processed */ /* Check if all register eNB requests have been processed */
if (register_enb_pending == 0) { if (register_enb_pending == 0) {
if (registered_enb == enb_nb) { if (registered_enb == enb_nb) {
/* If all eNB are registered, start L2L1 task */ /* If all eNB are registered, start L2L1 task */
MessageDef *msg_init_p; MessageDef *msg_init_p;
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE); msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p); itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
} else { } else {
LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n", LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n",
enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY); enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY);
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */ /* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
NULL, &enb_register_retry_timer_id) < 0) { NULL, &enb_register_retry_timer_id) < 0) {
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n"); LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
sleep(ENB_REGISTER_RETRY_DELAY); sleep(ENB_REGISTER_RETRY_DELAY);
/* Restart the registration process */ /* Restart the registration process */
registered_enb = 0; registered_enb = 0;
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p); register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
}
} }
} }
} } /* if (EPC_MODE_ENABLED) */
#endif
break; break;
case S1AP_DEREGISTERED_ENB_IND: case S1AP_DEREGISTERED_ENB_IND:
...@@ -305,21 +289,21 @@ void *eNB_app_task(void *args_p) ...@@ -305,21 +289,21 @@ void *eNB_app_task(void *args_p)
break; break;
case TIMER_HAS_EXPIRED: 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); 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) { if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
/* Restart the registration process */ /* Restart the registration process */
registered_enb = 0; registered_enb = 0;
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p); register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
} }
if (TIMER_HAS_EXPIRED (msg_p).timer_id == x2_enb_register_retry_timer_id) { if (TIMER_HAS_EXPIRED (msg_p).timer_id == x2_enb_register_retry_timer_id) {
/* Restart the registration process */ /* Restart the registration process */
x2_registered_enb = 0; x2_registered_enb = 0;
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end); x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
} }
# endif } /* if (EPC_MODE_ENABLED) */
break; break;
case X2AP_DEREGISTERED_ENB_IND: case X2AP_DEREGISTERED_ENB_IND:
...@@ -377,9 +361,6 @@ void *eNB_app_task(void *args_p) ...@@ -377,9 +361,6 @@ void *eNB_app_task(void *args_p)
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} while (1); } while (1);
#endif
return NULL; return NULL;
} }
......
...@@ -35,15 +35,9 @@ ...@@ -35,15 +35,9 @@
#include "enb_config.h" #include "enb_config.h"
#include "UTIL/OTG/otg.h" #include "UTIL/OTG/otg.h"
#include "UTIL/OTG/otg_externs.h" #include "UTIL/OTG/otg_externs.h"
#if defined(ENABLE_ITTI) #include "intertask_interface.h"
#include "intertask_interface.h" #include "s1ap_eNB.h"
#if defined(ENABLE_USE_MME) #include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#else
#define EPC_MODE_ENABLED 0
#endif
#endif
#include "sctp_default_values.h" #include "sctp_default_values.h"
#include "LTE_SystemInformationBlockType2.h" #include "LTE_SystemInformationBlockType2.h"
#include "LAYER2/MAC/mac_extern.h" #include "LAYER2/MAC/mac_extern.h"
...@@ -83,14 +77,7 @@ void RCconfig_flexran() { ...@@ -83,14 +77,7 @@ void RCconfig_flexran() {
uint16_t Nid_cell_tr = 0; uint16_t Nid_cell_tr = 0;
uint32_t enb_id = 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 */ /* get number of eNBs */
...@@ -2023,21 +2010,7 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) { ...@@ -2023,21 +2010,7 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
CCsParams[I].chkPptr = &(config_check_CCparams[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, AssertFatal(i < ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt,
"Failed to parse config file %s, %uth attribute %s \n", "Failed to parse config file %s, %uth attribute %s \n",
RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS); RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS);
...@@ -2050,13 +2023,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) { ...@@ -2050,13 +2023,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
for (k = 0; k < ENBParamList.numelt; k++) { for (k = 0; k < ENBParamList.numelt; k++) {
if (ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr == NULL) { if (ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr == NULL) {
// Calculate a default eNB ID // Calculate a default eNB ID
# if defined(ENABLE_USE_MME) if (EPC_MODE_ENABLED) {
uint32_t hash; uint32_t hash;
hash = s1ap_generate_eNB_id (); hash = s1ap_generate_eNB_id ();
enb_id = k + (hash & 0xFFFF8); enb_id = k + (hash & 0xFFFF8);
# else } else {
enb_id = k; enb_id = k;
# endif }
} else { } else {
enb_id = *(ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr); enb_id = *(ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr);
} }
...@@ -2181,12 +2154,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) { ...@@ -2181,12 +2154,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
// SCTP SETTING // SCTP SETTING
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS; X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_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); sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_SCTP_CONFIG);
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[ENB_SCTP_INSTREAMS_IDX].uptr); config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[ENB_SCTP_OUTSTREAMS_IDX].uptr); X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[ENB_SCTP_INSTREAMS_IDX].uptr);
#endif X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[ENB_SCTP_OUTSTREAMS_IDX].uptr);
}
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
// NETWORK_INTERFACES // NETWORK_INTERFACES
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix); config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
...@@ -2255,9 +2229,9 @@ void RCConfig(void) { ...@@ -2255,9 +2229,9 @@ void RCConfig(void) {
/* get global parameters, defined outside any section in the config file */ /* get global parameters, defined outside any section in the config file */
printf("Getting ENBSParams\n"); printf("Getting ENBSParams\n");
config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL); config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL);
# if defined(ENABLE_USE_MME)
EPC_MODE_ENABLED = ((*ENBSParams[ENB_NOS1_IDX].uptr) == 0); //EPC_MODE_ENABLED = ((*ENBSParams[ENB_NOS1_IDX].uptr) == 0);
#endif
RC.nb_inst = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt; RC.nb_inst = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt;
if (RC.nb_inst > 0) { 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 ...@@ -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", LOG_D(MAC, "[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n",
module_idP, frameP, eNB_index); 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); //layer2_init_UE(module_idP);
openair_rrc_ue_init(module_idP, eNB_index); openair_rrc_ue_init(module_idP, eNB_index);
} else { } else {
......
This diff is collapsed.
...@@ -51,6 +51,19 @@ ...@@ -51,6 +51,19 @@
#include "LTE_PMCH-InfoList-r9.h" #include "LTE_PMCH-InfoList-r9.h"
#endif #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_t pdcp_thread;
extern pthread_attr_t pdcp_thread_attr; extern pthread_attr_t pdcp_thread_attr;
...@@ -376,14 +389,10 @@ boolean_t pdcp_remove_UE( ...@@ -376,14 +389,10 @@ boolean_t pdcp_remove_UE(
*/ */
void pdcp_run ( void pdcp_run (
const protocol_ctxt_t* const ctxt_pP); 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_module_cleanup (void);
void pdcp_layer_init (void); void pdcp_layer_init (void);
void pdcp_layer_cleanup (void); void pdcp_layer_cleanup (void);
#if defined(PDCP_USE_NETLINK_QUEUES)
int pdcp_netlink_init (void);
#endif
#define PDCP2NW_DRIVER_FIFO 21 #define PDCP2NW_DRIVER_FIFO 21
#define NW_DRIVER2PDCP_FIFO 22 #define NW_DRIVER2PDCP_FIFO 22
...@@ -490,10 +499,7 @@ typedef struct { ...@@ -490,10 +499,7 @@ typedef struct {
signed int pdcp_2_nas_irq; signed int pdcp_2_nas_irq;
pdcp_stats_t UE_pdcp_stats[MAX_MOBILES_PER_ENB]; pdcp_stats_t UE_pdcp_stats[MAX_MOBILES_PER_ENB];
pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX]; 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 // for UE code conly
rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB]; 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; ...@@ -70,7 +70,7 @@ extern struct iovec nas_iov_rx;
extern int nas_sock_fd; extern int nas_sock_fd;
extern struct msghdr nas_msg_rx; extern struct msghdr nas_msg_rx;
#if defined(PDCP_USE_NETLINK_QUEUES)
static pthread_t pdcp_netlink_thread; static pthread_t pdcp_netlink_thread;
/* We use lock-free queues between the User-plane driver running in kernel-space /* We use lock-free queues between the User-plane driver running in kernel-space
...@@ -104,25 +104,25 @@ pdcp_netlink_init( ...@@ -104,25 +104,25 @@ pdcp_netlink_init(
nb_inst_enb = 1; nb_inst_enb = 1;
nb_inst_ue = 1; nb_inst_ue = 1;
#if defined(LINK_ENB_PDCP_TO_GTPV1U) if (LINK_ENB_PDCP_TO_GTPV1U) {
nb_inst_enb = 0; nb_inst_enb = 0;
LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n"); LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n");
#else } else {
#warning " LG: When there will be handover in, there will problems because dim is based on local nums of ues" /* #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_queue_enb = calloc(nb_inst_enb, sizeof(struct lfds611_queue_state*));
pdcp_netlink_nb_element_enb = malloc(nb_inst_enb * sizeof(uint32_t)); 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); LOG_I(PDCP, "[NETLINK] Creating %d queues for eNB Netlink -> PDCP communication\n", nb_inst_enb);
for (i = 0; i < nb_inst_enb; i++) { for (i = 0; i < nb_inst_enb; i++) {
pdcp_netlink_nb_element_enb[i] = 0; pdcp_netlink_nb_element_enb[i] = 0;
if (lfds611_queue_new(&pdcp_netlink_queue_enb[i], PDCP_QUEUE_NB_ELEMENTS) < 0) { if (lfds611_queue_new(&pdcp_netlink_queue_enb[i], PDCP_QUEUE_NB_ELEMENTS) < 0) {
LOG_E(PDCP, "Failed to create new FIFO for eNB Netlink -> PDCP communcation instance %d\n", i); LOG_E(PDCP, "Failed to create new FIFO for eNB Netlink -> PDCP communcation instance %d\n", i);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
}
} }
} }
#endif
if (nb_inst_ue > 0) { if (nb_inst_ue > 0) {
pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state*)); pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state*));
...@@ -248,7 +248,7 @@ void *pdcp_netlink_thread_fct(void *arg) ...@@ -248,7 +248,7 @@ void *pdcp_netlink_thread_fct(void *arg)
new_data_p->pdcp_read_header.data_size); new_data_p->pdcp_read_header.data_size);
} else { } else {
LOG_E(PDCP, "[NETLINK_THREAD] WRONG size %d should be sizeof " LOG_E(PDCP, "[NETLINK_THREAD] WRONG size %d should be sizeof "
"%d ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))\n", "%lu ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))\n",
nas_nlh_rx->nlmsg_len, nas_nlh_rx->nlmsg_len,
sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)); sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr));
} }
...@@ -262,8 +262,8 @@ void *pdcp_netlink_thread_fct(void *arg) ...@@ -262,8 +262,8 @@ void *pdcp_netlink_thread_fct(void *arg)
if (eNB_flag) { if (eNB_flag) {
if (pdcp_netlink_nb_element_enb[module_id] if (pdcp_netlink_nb_element_enb[module_id]
> PDCP_QUEUE_NB_ELEMENTS) { > PDCP_QUEUE_NB_ELEMENTS) {
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%d)\n", LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%lu)\n",
module_id, pdcp_netlink_nb_element_enb); 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); 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) ...@@ -275,8 +275,8 @@ void *pdcp_netlink_thread_fct(void *arg)
} else { } else {
if (pdcp_netlink_nb_element_ue[module_id] if (pdcp_netlink_nb_element_ue[module_id]
> PDCP_QUEUE_NB_ELEMENTS) { > PDCP_QUEUE_NB_ELEMENTS) {
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%d)\n", LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%lu)\n",
module_id, pdcp_netlink_nb_element_ue); 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); 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) ...@@ -293,4 +293,4 @@ void *pdcp_netlink_thread_fct(void *arg)
return NULL; return NULL;
} }
#endif
...@@ -63,21 +63,9 @@ ...@@ -63,21 +63,9 @@
#include "LTE_UE-Capability-NB-r13.h" //equivalent of UE-EUTRA-Capability.h #include "LTE_UE-Capability-NB-r13.h" //equivalent of UE-EUTRA-Capability.h
//------------------- //-------------------
#if defined(ENABLE_ITTI)
# include "intertask_interface.h" # 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" # include "commonDef.h"
#endif
#if ENABLE_RAL #if ENABLE_RAL
# include "collection/hashtable/obj_hashtable.h" # include "collection/hashtable/obj_hashtable.h"
...@@ -476,11 +464,9 @@ typedef struct OAI_UECapability_NB_IoT_s { ...@@ -476,11 +464,9 @@ typedef struct OAI_UECapability_NB_IoT_s {
typedef struct UE_RRC_INST_NB_IoT_s { typedef struct UE_RRC_INST_NB_IoT_s {
Rrc_State_NB_IoT_t RrcState; Rrc_State_NB_IoT_t RrcState;
Rrc_Sub_State_NB_IoT_t RrcSubState; Rrc_Sub_State_NB_IoT_t RrcSubState;
# if defined(ENABLE_USE_MME)
plmn_t plmnID; plmn_t plmnID;
Byte_t rat; Byte_t rat;
as_nas_info_t initialNasMsg; as_nas_info_t initialNasMsg;
# endif
OAI_UECapability_NB_IoT_t *UECap; OAI_UECapability_NB_IoT_t *UECap;
uint8_t *UECapability; uint8_t *UECapability;
uint8_t UECapability_size; uint8_t UECapability_size;
......
This diff is collapsed.
...@@ -284,21 +284,14 @@ void *send_UE_status_notification(void *); ...@@ -284,21 +284,14 @@ void *send_UE_status_notification(void *);
#include "rrc_rrm_interface.h" #include "rrc_rrm_interface.h"
#endif #endif
#if defined(ENABLE_ITTI)
#include "intertask_interface.h"
#endif
/* TODO: be sure this include is correct. #include "intertask_interface.h"
* It solves a problem of compilation of the RRH GW,
* issue #186.
*/
#if !defined(ENABLE_ITTI)
#include "as_message.h" #include "commonDef.h"
#endif
#if defined(ENABLE_USE_MME)
#include "commonDef.h"
#endif
//-------- //--------
typedef unsigned int uid_t; typedef unsigned int uid_t;
...@@ -431,7 +424,7 @@ typedef struct UE_S_TMSI_s { ...@@ -431,7 +424,7 @@ typedef struct UE_S_TMSI_s {
m_tmsi_t m_tmsi; m_tmsi_t m_tmsi;
} __attribute__ ((__packed__)) UE_S_TMSI; } __attribute__ ((__packed__)) UE_S_TMSI;
#if defined(ENABLE_ITTI)
typedef enum e_rab_satus_e { typedef enum e_rab_satus_e {
E_RAB_STATUS_NEW, E_RAB_STATUS_NEW,
E_RAB_STATUS_DONE, // from the eNB perspective E_RAB_STATUS_DONE, // from the eNB perspective
...@@ -448,7 +441,7 @@ typedef struct e_rab_param_s { ...@@ -448,7 +441,7 @@ typedef struct e_rab_param_s {
s1ap_Cause_t cause; s1ap_Cause_t cause;
uint8_t cause_value; uint8_t cause_value;
} __attribute__ ((__packed__)) e_rab_param_t; } __attribute__ ((__packed__)) e_rab_param_t;
#endif
/* Intermediate structure for Handover management. Associated per-UE in eNB_RRC_INST */ /* Intermediate structure for Handover management. Associated per-UE in eNB_RRC_INST */
typedef struct HANDOVER_INFO_s { typedef struct HANDOVER_INFO_s {
...@@ -569,7 +562,7 @@ typedef struct eNB_RRC_UE_s { ...@@ -569,7 +562,7 @@ typedef struct eNB_RRC_UE_s {
rnti_t rnti; rnti_t rnti;
uint64_t random_ue_identity; uint64_t random_ue_identity;
#if defined(ENABLE_ITTI)
/* Information from UE RRC ConnectionRequest */ /* Information from UE RRC ConnectionRequest */
UE_S_TMSI Initialue_identity_s_TMSI; UE_S_TMSI Initialue_identity_s_TMSI;
LTE_EstablishmentCause_t establishment_cause; LTE_EstablishmentCause_t establishment_cause;
...@@ -613,7 +606,6 @@ typedef struct eNB_RRC_UE_s { ...@@ -613,7 +606,6 @@ typedef struct eNB_RRC_UE_s {
uint32_t enb_gtp_teid[S1AP_MAX_E_RAB]; uint32_t enb_gtp_teid[S1AP_MAX_E_RAB];
transport_layer_addr_t enb_gtp_addrs[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]; rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB];
#endif
uint32_t ul_failure_timer; uint32_t ul_failure_timer;
uint32_t ue_release_timer; uint32_t ue_release_timer;
uint32_t ue_release_timer_thres; uint32_t ue_release_timer_thres;
...@@ -725,10 +717,7 @@ typedef struct eNB_RRC_INST_s { ...@@ -725,10 +717,7 @@ typedef struct eNB_RRC_INST_s {
#endif #endif
//RRC configuration //RRC configuration
#if defined(ENABLE_ITTI)
RrcConfigurationReq configuration; RrcConfigurationReq configuration;
#endif
// other RAN parameters // other RAN parameters
int srb1_timer_poll_retransmit; int srb1_timer_poll_retransmit;
int srb1_poll_pdu; int srb1_poll_pdu;
...@@ -749,11 +738,9 @@ typedef struct OAI_UECapability_s { ...@@ -749,11 +738,9 @@ typedef struct OAI_UECapability_s {
typedef struct UE_RRC_INST_s { typedef struct UE_RRC_INST_s {
Rrc_State_t RrcState; Rrc_State_t RrcState;
Rrc_Sub_State_t RrcSubState; Rrc_Sub_State_t RrcSubState;
# if defined(ENABLE_USE_MME)
plmn_t plmnID; plmn_t plmnID;
Byte_t rat; Byte_t rat;
as_nas_info_t initialNasMsg; as_nas_info_t initialNasMsg;
# endif
OAI_UECapability_t *UECap; OAI_UECapability_t *UECap;
uint8_t *UECapability; uint8_t *UECapability;
uint8_t UECapability_size; uint8_t UECapability_size;
......
This diff is collapsed.
...@@ -27,19 +27,14 @@ ...@@ -27,19 +27,14 @@
* \email: lionel.gauthier@eurecom.fr * \email: lionel.gauthier@eurecom.fr
*/ */
#if defined(ENABLE_USE_MME)
# include "rrc_defs.h" # include "rrc_defs.h"
# include "rrc_extern.h" # include "rrc_extern.h"
# include "RRC/LTE/MESSAGES/asn1_msg.h" # include "RRC/LTE/MESSAGES/asn1_msg.h"
# include "rrc_eNB_GTPV1U.h" # include "rrc_eNB_GTPV1U.h"
# include "rrc_eNB_UE_context.h" # include "rrc_eNB_UE_context.h"
# include "msc.h" # include "msc.h"
# include "asn1_conversions.h"
# if defined(ENABLE_ITTI) # include "intertask_interface.h"
# include "asn1_conversions.h"
# include "intertask_interface.h"
# endif
# include "common/ran_context.h" # include "common/ran_context.h"
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
...@@ -66,10 +61,6 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP( ...@@ -66,10 +61,6 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
ctxt_pP->rnti); ctxt_pP->rnti);
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) { 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_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_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]; 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( ...@@ -98,4 +89,4 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
return -1; return -1;
} }
} }
#endif
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
#ifndef RRC_ENB_GTPV1U_H_ #ifndef RRC_ENB_GTPV1U_H_
#define 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) /*! \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. *\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( ...@@ -47,6 +43,5 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
uint8_t *inde_list uint8_t *inde_list
); );
# endif
# endif /* defined(ENABLE_USE_MME) */
#endif /* RRC_ENB_GTPV1U_H_ */ #endif /* RRC_ENB_GTPV1U_H_ */
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* \company Eurecom * \company Eurecom
* \email: navid.nikaein@eurecom.fr * \email: navid.nikaein@eurecom.fr
*/ */
#if defined(ENABLE_USE_MME)
# include "rrc_defs.h" # include "rrc_defs.h"
# include "rrc_extern.h" # include "rrc_extern.h"
# include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" # include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
...@@ -41,16 +41,12 @@ ...@@ -41,16 +41,12 @@
# include "s1ap_eNB_defs.h" # include "s1ap_eNB_defs.h"
# include "s1ap_eNB_management_procedures.h" # include "s1ap_eNB_management_procedures.h"
# include "s1ap_eNB_ue_context.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) #if defined(ENABLE_SECURITY)
#include "UTIL/OSA/osa_defs.h" #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 ...@@ -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. * Get the UE S1 struct containing hashtables S1_id/UE_id.
...@@ -628,7 +624,6 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP( ...@@ -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; 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); itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
} }
# endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void void
...@@ -639,7 +634,6 @@ rrc_eNB_send_S1AP_UPLINK_NAS( ...@@ -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; LTE_ULInformationTransfer_t *ulInformationTransfer = &ul_dcch_msg->message.choice.c1.choice.ulInformationTransfer;
...@@ -666,36 +660,6 @@ rrc_eNB_send_S1AP_UPLINK_NAS( ...@@ -666,36 +660,6 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p); 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( ...@@ -758,7 +722,6 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id]; eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
#if defined(ENABLE_ITTI)
{ {
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
rrc_ue_s1ap_ids_t *rrc_ue_s1ap_ids_p = NULL; rrc_ue_s1ap_ids_t *rrc_ue_s1ap_ids_p = NULL;
...@@ -870,20 +833,9 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( ...@@ -870,20 +833,9 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
} // end "Fill UE identities with available information" sub-part } // end "Fill UE identities with available information" sub-part
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, message_p); 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 int
rrc_eNB_process_S1AP_DOWNLINK_NAS( 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 ...@@ -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 @@ ...@@ -31,13 +31,10 @@
#ifndef RRC_ENB_S1AP_H_ #ifndef RRC_ENB_S1AP_H_
#define RRC_ENB_S1AP_H_ #define RRC_ENB_S1AP_H_
# if defined(ENABLE_USE_MME)
#include "LTE_UL-DCCH-Message.h" #include "LTE_UL-DCCH-Message.h"
/* Up link procedures */ /* Up link procedures */
# if defined(ENABLE_ITTI)
typedef struct rrc_ue_s1ap_ids_s { typedef struct rrc_ue_s1ap_ids_s {
/* Tree related data */ /* Tree related data */
RB_ENTRY(rrc_ue_s1ap_ids_s) entries; 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, ...@@ -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); 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); 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_ */ #endif /* RRC_ENB_S1AP_H_ */
...@@ -39,13 +39,13 @@ ...@@ -39,13 +39,13 @@
int rrc_init_global_param(void); int rrc_init_global_param(void);
int L3_xface_init(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); 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 char
openair_rrc_eNB_configuration( openair_rrc_eNB_configuration(
const module_id_t enb_mod_idP, const module_id_t enb_mod_idP,
RrcConfigurationReq* configuration RrcConfigurationReq* configuration
); );
#endif
char openair_rrc_eNB_init( char openair_rrc_eNB_init(
const module_id_t module_idP); const module_id_t module_idP);
...@@ -344,7 +344,7 @@ void ...@@ -344,7 +344,7 @@ void
rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP, rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* ue_context_pP); rrc_eNB_ue_context_t* ue_context_pP);
#if defined(ENABLE_ITTI)
void rrc_enb_init(void); void rrc_enb_init(void);
void *rrc_enb_process_itti_msg(void *); void *rrc_enb_process_itti_msg(void *);
...@@ -356,7 +356,7 @@ void *rrc_enb_task(void *args_p); ...@@ -356,7 +356,7 @@ void *rrc_enb_task(void *args_p);
/**\brief RRC UE task. /**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */ \param void *args_p Pointer on arguments to start the task. */
void *rrc_ue_task(void *args_p); void *rrc_ue_task(void *args_p);
#endif
void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_req_t *m); void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_req_t *m);
...@@ -612,7 +612,6 @@ rrc_ue_process_securityModeCommand( ...@@ -612,7 +612,6 @@ rrc_ue_process_securityModeCommand(
); );
*/ */
#if !defined(ENABLE_USE_MME)
void rrc_eNB_emulation_notify_ue_module_id( void rrc_eNB_emulation_notify_ue_module_id(
const module_id_t ue_module_idP, const module_id_t ue_module_idP,
const rnti_t rntiP, const rnti_t rntiP,
...@@ -620,7 +619,7 @@ void rrc_eNB_emulation_notify_ue_module_id( ...@@ -620,7 +619,7 @@ void rrc_eNB_emulation_notify_ue_module_id(
const uint8_t cell_identity_byte1P, const uint8_t cell_identity_byte1P,
const uint8_t cell_identity_byte2P, const uint8_t cell_identity_byte2P,
const uint8_t cell_identity_byte3P); const uint8_t cell_identity_byte3P);
#endif
void void
......
...@@ -39,10 +39,8 @@ ...@@ -39,10 +39,8 @@
#include "PHY/defs_common.h" #include "PHY/defs_common.h"
#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_top.h"
#include "platform_types.h" #include "platform_types.h"
#if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
...@@ -713,10 +711,7 @@ typedef struct { ...@@ -713,10 +711,7 @@ typedef struct {
unsigned char transmission_mode[MAX_NUM_CCs]; unsigned char transmission_mode[MAX_NUM_CCs];
int max_predefined_traffic_config_index; int max_predefined_traffic_config_index;
int max_customized_traffic_config_index; int max_customized_traffic_config_index;
#if defined(ENABLE_USE_MME)
s1ap_eNB_config_t s1ap_config; s1ap_eNB_config_t s1ap_config;
#endif
/* Per-Slot ISR /* Per-Slot ISR
* Interval between two ISR = 500usec * Interval between two ISR = 500usec
......
...@@ -44,7 +44,7 @@ Description Implements the API used by the NAS layer running in the UE ...@@ -44,7 +44,7 @@ Description Implements the API used by the NAS layer running in the UE
#include "networkDef.h" #include "networkDef.h"
#include "at_command.h" #include "at_command.h"
#include "user_api_defs.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 *******************/ /********************* 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, ...@@ -41,7 +41,7 @@ Description Defines the EPS Mobility Management procedure call manager,
#include "commonDef.h" #include "commonDef.h"
#include "networkDef.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 *******************/ /********************* 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 ...@@ -45,7 +45,7 @@ Description Defines functions used to handle state of EPS bearer contexts
#include "esmData.h" #include "esmData.h"
#include "nas_timer.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 *******************/ /********************* G L O B A L C O N S T A N T S *******************/
......
...@@ -19,28 +19,17 @@ ...@@ -19,28 +19,17 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#if defined(ENABLE_ITTI)
# include "intertask_interface.h" # include "intertask_interface.h"
# include "create_tasks.h" # include "create_tasks.h"
# include "common/utils/LOG/log.h" # include "common/utils/LOG/log.h"
# include "targets/RT/USER/lte-softmodem.h" # include "targets/RT/USER/lte-softmodem.h"
#ifdef OPENAIR2 #ifdef OPENAIR2
#if defined(ENABLE_USE_MME)
#include "sctp_eNB_task.h" #include "sctp_eNB_task.h"
#include "x2ap_eNB.h" #include "x2ap_eNB.h"
#include "s1ap_eNB.h" #include "s1ap_eNB.h"
#include "nas_ue_task.h"
#include "udp_eNB_task.h" #include "udp_eNB_task.h"
#include "gtpv1u_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 #if ENABLE_RAL
#include "lteRALue.h" #include "lteRALue.h"
#include "lteRALenb.h" #include "lteRALenb.h"
...@@ -62,7 +51,6 @@ int create_tasks(uint32_t enb_nb) { ...@@ -62,7 +51,6 @@ int create_tasks(uint32_t enb_nb) {
} }
} }
# if defined(ENABLE_USE_MME)
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
if (enb_nb > 0) { if (enb_nb > 0) {
...@@ -95,7 +83,6 @@ int create_tasks(uint32_t enb_nb) { ...@@ -95,7 +83,6 @@ int create_tasks(uint32_t enb_nb) {
} }
} /* if (EPC_MODE_ENABLED) */ } /* if (EPC_MODE_ENABLED) */
#endif
if (enb_nb > 0) { if (enb_nb > 0) {
LOG_I(RRC,"Creating RRC eNB Task\n"); LOG_I(RRC,"Creating RRC eNB Task\n");
...@@ -109,4 +96,4 @@ int create_tasks(uint32_t enb_nb) { ...@@ -109,4 +96,4 @@ int create_tasks(uint32_t enb_nb) {
itti_wait_ready(0); itti_wait_ready(0);
return 0; return 0;
} }
#endif
...@@ -19,19 +19,16 @@ ...@@ -19,19 +19,16 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#if defined(ENABLE_ITTI)
# include "intertask_interface.h" # include "intertask_interface.h"
# include "create_tasks.h" # include "create_tasks.h"
# include "common/utils/LOG/log.h" # include "common/utils/LOG/log.h"
#ifdef OPENAIR2 #ifdef OPENAIR2
#if defined(ENABLE_USE_MME) #include "sctp_eNB_task.h"
#include "sctp_eNB_task.h" #include "s1ap_eNB.h"
#include "s1ap_eNB.h" #include "openair3/NAS/UE/nas_ue_task.h"
#include "nas_ue_task.h" #include "udp_eNB_task.h"
#include "udp_eNB_task.h" #include "gtpv1u_eNB_task.h"
#include "gtpv1u_eNB_task.h"
#endif
#if ENABLE_RAL #if ENABLE_RAL
#include "lteRALue.h" #include "lteRALue.h"
#include "lteRALenb.h" #include "lteRALenb.h"
...@@ -43,24 +40,23 @@ ...@@ -43,24 +40,23 @@
int create_tasks_ue(uint32_t ue_nb) { int create_tasks_ue(uint32_t ue_nb) {
LOG_D(ENB_APP, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb); LOG_D(ENB_APP, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
itti_wait_ready(1); itti_wait_ready(1);
# if defined(ENABLE_USE_MME) if (EPC_MODE_ENABLED) {
# if defined(NAS_BUILT_IN_UE) # if defined(NAS_BUILT_IN_UE)
if (ue_nb > 0) { if (ue_nb > 0) {
nas_user_container_t *users = calloc(1, sizeof(*users)); nas_user_container_t *users = calloc(1, sizeof(*users));
if (users == NULL) abort(); if (users == NULL) abort();
users->count = ue_nb; users->count = ue_nb;
if (itti_create_task (TASK_NAS_UE, nas_ue_task, users) < 0) { if (itti_create_task (TASK_NAS_UE, nas_ue_task, users) < 0) {
LOG_E(NAS, "Create task for NAS UE failed\n"); LOG_E(NAS, "Create task for NAS UE failed\n");
return -1; return -1;
}
} }
}
# endif
# endif # endif
} /* EPC_MODE_ENABLED */
if (ue_nb > 0) { if (ue_nb > 0) {
if (itti_create_task (TASK_RRC_UE, rrc_ue_task, NULL) < 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) { ...@@ -72,4 +68,4 @@ int create_tasks_ue(uint32_t ue_nb) {
itti_wait_ready(0); itti_wait_ready(0);
return 0; return 0;
} }
#endif
...@@ -80,14 +80,8 @@ ...@@ -80,14 +80,8 @@
#include "UTIL/OTG/otg_extern.h" #include "UTIL/OTG/otg_extern.h"
#endif #endif
#if defined(ENABLE_ITTI) #include "s1ap_eNB.h"
#if defined(ENABLE_USE_MME) #include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
#endif
#endif
#include "T.h" #include "T.h"
...@@ -104,11 +98,6 @@ struct timing_info_t { ...@@ -104,11 +98,6 @@ struct timing_info_t {
// Fix per CC openair rf/if device update // Fix per CC openair rf/if device update
// extern openair0_device openair0; // 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 volatile int oai_exit;
extern int transmission_mode; extern int transmission_mode;
......
...@@ -104,14 +104,10 @@ static int DEFENBS[] = {0}; ...@@ -104,14 +104,10 @@ static int DEFENBS[] = {0};
#include "UTIL/OTG/otg_extern.h" #include "UTIL/OTG/otg_extern.h"
#endif #endif
#if defined(ENABLE_ITTI) #include "s1ap_eNB.h"
# if defined(ENABLE_USE_MME) #include "SIMULATION/ETH_TRANSPORT/proto.h"
# include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
# include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
# endif
#endif
#include "T.h" #include "T.h"
......
...@@ -94,3 +94,11 @@ void get_common_options(void) { ...@@ -94,3 +94,11 @@ void get_common_options(void) {
if(worker_config != NULL) set_worker_conf(worker_config); 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;
}
This diff is collapsed.
...@@ -33,15 +33,8 @@ ...@@ -33,15 +33,8 @@
#include "SIMULATION/ETH_TRANSPORT/proto.h" #include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "flexran_agent.h" #include "flexran_agent.h"
#include "s1ap_eNB.h"
#if defined(ENABLE_ITTI) #include "SIMULATION/ETH_TRANSPORT/proto.h"
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
#endif
#endif
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */ /* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n" #define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
...@@ -245,31 +238,34 @@ ...@@ -245,31 +238,34 @@
#define SOFTMODEM_NOS1_BIT (1<<0) #define SOFTMODEM_NOS1_BIT (1<<0)
#define SOFTMODEM_NOKRNMOD_BIT (1<<1) #define SOFTMODEM_NOKRNMOD_BIT (1<<1)
#define SOFTMODEM_NONBIOT_BIT (1<<2) #define SOFTMODEM_NONBIOT_BIT (1<<2)
#define SOFTMODEM_BASICSIM_BIT (1<<10)
typedef struct { typedef struct {
uint64_t optmask; uint64_t optmask;
THREAD_STRUCT thread_struct; THREAD_STRUCT thread_struct;
char rf_config_file[1024]; char rf_config_file[1024];
int phy_test; int phy_test;
uint8_t usim_test; uint8_t usim_test;
int emulate_rf; int emulate_rf;
int wait_for_sync; //eNodeB only int wait_for_sync; //eNodeB only
int single_thread_flag; //eNodeB only int single_thread_flag; //eNodeB only
int chain_offset; int chain_offset;
uint32_t do_forms; uint32_t do_forms;
int numerology; int numerology;
unsigned int start_msc; unsigned int start_msc;
uint32_t clock_source; uint32_t clock_source;
int hw_timing_advance; int hw_timing_advance;
} softmodem_params_t; } softmodem_params_t;
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT) #define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT) #define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
#define IS_SOFTMODEM_NONBIOT ( get_softmodem_optmask() & SOFTMODEM_NONBIOT_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 get_softmodem_optmask(void);
extern uint64_t set_softmodem_optmask(uint64_t bitmask); extern uint64_t set_softmodem_optmask(uint64_t bitmask);
extern void get_common_options(void); extern void get_common_options(void);
extern softmodem_params_t *get_softmodem_params(void); extern softmodem_params_t *get_softmodem_params(void);
extern unsigned int is_nos1exec(char *exepath) ;
uint64_t get_pdcp_optmask(void); uint64_t get_pdcp_optmask(void);
extern pthread_cond_t sync_cond; extern pthread_cond_t sync_cond;
extern pthread_mutex_t sync_mutex; extern pthread_mutex_t sync_mutex;
......
...@@ -443,6 +443,10 @@ static void get_options(void) { ...@@ -443,6 +443,10 @@ static void get_options(void) {
if (dumpframe > 0) mode = rx_dump_frame; 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++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0]; frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
} }
...@@ -712,6 +716,11 @@ int main( int argc, char **argv ) { ...@@ -712,6 +716,11 @@ int main( int argc, char **argv ) {
for (int i=0; i<MAX_NUM_CCs; i++) tx_max_power[i]=23; for (int i=0; i<MAX_NUM_CCs; i++) tx_max_power[i]=23;
get_options (); 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); printf("Running with %d UE instances\n",NB_UE_INST);
if (NB_UE_INST > 1 && simL1flag != 1 && nfapi_mode != 3) { if (NB_UE_INST > 1 && simL1flag != 1 && nfapi_mode != 3) {
...@@ -764,13 +773,13 @@ int main( int argc, char **argv ) { ...@@ -764,13 +773,13 @@ int main( int argc, char **argv ) {
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX); MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif #endif
init_opt(); init_opt();
#ifdef PDCP_USE_NETLINK 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);
printf("PDCP netlink\n");
netlink_init(); if ( IS_SOFTMODEM_BASICSIM ) {
#if defined(PDCP_USE_NETLINK_QUEUES) pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
pdcp_netlink_init(); }
#endif
#endif pdcp_module_init( pdcp_initmask );
//TTN for D2D //TTN for D2D
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
printf ("RRC control socket\n"); printf ("RRC control socket\n");
...@@ -818,37 +827,6 @@ int main( int argc, char **argv ) { ...@@ -818,37 +827,6 @@ int main( int argc, char **argv ) {
RCConfig_sim(); 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(); cpuf=get_cpu_freq_GHz();
#ifndef DEADLINE_SCHEDULER #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