nos1 et s1 execs identical, nos1 enforced based on exec name or --noS1 option
This commit is contained in:
@@ -693,10 +693,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
|
||||
@@ -1994,26 +1994,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 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
|
||||
#######################################
|
||||
|
||||
@@ -2027,6 +2030,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
|
||||
@@ -2070,6 +2075,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}
|
||||
@@ -2080,18 +2086,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 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
|
||||
|
||||
@@ -547,9 +547,9 @@ function main() {
|
||||
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
|
||||
# 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
|
||||
|
||||
@@ -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,136 +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 ){
|
||||
close(fd);
|
||||
return err;
|
||||
if( *dev )
|
||||
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
|
||||
|
||||
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);
|
||||
|
||||
if (nas_sock_fd[i] == -1) {
|
||||
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[i],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);
|
||||
|
||||
if (ret == -1) {
|
||||
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
|
||||
#if defined(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));
|
||||
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
#else /* UE_NAS_USE_TUN */
|
||||
|
||||
int netlink_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
|
||||
sprintf(ifname, "oip1");
|
||||
nas_sock_fd = tun_alloc(ifname);
|
||||
|
||||
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)
|
||||
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)
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(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));
|
||||
|
||||
|
||||
|
||||
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 +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));
|
||||
@@ -222,16 +138,68 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
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 (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
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 (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(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(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"
|
||||
|
||||
+45
-64
@@ -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,44 +238,45 @@ void *eNB_app_task(void *args_p)
|
||||
break;
|
||||
|
||||
case S1AP_REGISTER_ENB_CNF:
|
||||
# if defined(ENABLE_USE_MME)
|
||||
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);
|
||||
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);
|
||||
|
||||
DevAssert(register_enb_pending > 0);
|
||||
register_enb_pending--;
|
||||
DevAssert(register_enb_pending > 0);
|
||||
register_enb_pending--;
|
||||
|
||||
/* Check if at least eNB is registered with one MME */
|
||||
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
|
||||
registered_enb++;
|
||||
}
|
||||
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
|
||||
registered_enb++;
|
||||
}
|
||||
|
||||
/* Check if all register eNB requests have been processed */
|
||||
if (register_enb_pending == 0) {
|
||||
if (registered_enb == enb_nb) {
|
||||
if (register_enb_pending == 0) {
|
||||
if (registered_enb == enb_nb) {
|
||||
/* 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);
|
||||
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
|
||||
} else {
|
||||
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);
|
||||
} else {
|
||||
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);
|
||||
|
||||
/* 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,
|
||||
NULL, &enb_register_retry_timer_id) < 0) {
|
||||
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
|
||||
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
|
||||
NULL, &enb_register_retry_timer_id) < 0) {
|
||||
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 */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} /* if (EPC_MODE_ENABLED) */
|
||||
|
||||
break;
|
||||
|
||||
case S1AP_DEREGISTERED_ENB_IND:
|
||||
@@ -305,21 +289,21 @@ void *eNB_app_task(void *args_p)
|
||||
break;
|
||||
|
||||
case TIMER_HAS_EXPIRED:
|
||||
# if defined(ENABLE_USE_MME)
|
||||
LOG_I(ENB_APP, " Received %s: timer_id %ld\n", ITTI_MSG_NAME (msg_p), TIMER_HAS_EXPIRED(msg_p).timer_id);
|
||||
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) {
|
||||
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
|
||||
/* Restart the registration process */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
}
|
||||
registered_enb = 0;
|
||||
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 */
|
||||
x2_registered_enb = 0;
|
||||
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
|
||||
}
|
||||
# endif
|
||||
x2_registered_enb = 0;
|
||||
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
|
||||
}
|
||||
} /* 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)
|
||||
uint32_t hash;
|
||||
hash = s1ap_generate_eNB_id ();
|
||||
enb_id = k + (hash & 0xFFFF8);
|
||||
# else
|
||||
enb_id = k;
|
||||
# endif
|
||||
if (EPC_MODE_ENABLED) {
|
||||
uint32_t hash;
|
||||
hash = s1ap_generate_eNB_id ();
|
||||
enb_id = k + (hash & 0xFFFF8);
|
||||
} else {
|
||||
enb_id = k;
|
||||
}
|
||||
} 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)
|
||||
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
|
||||
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);
|
||||
}
|
||||
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)
|
||||
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);
|
||||
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
|
||||
rlc_util_print_hex_octets(PDCP,
|
||||
(unsigned char *)&pdcp_pdu_p->data[0],
|
||||
sdu_buffer_sizeP);
|
||||
|
||||
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,36 +711,37 @@ pdcp_data_ind(
|
||||
* from its second byte (skipping 0th and 1st octets, i.e.
|
||||
* PDCP header)
|
||||
*/
|
||||
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
|
||||
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_PDCP_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
"0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u",
|
||||
ctxt_pP->rnti,
|
||||
rb_id + 4,
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
|
||||
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
|
||||
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
|
||||
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY");
|
||||
memcpy(>pu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], &sdu_buffer_pP->data[payload_offset], sdu_buffer_sizeP - payload_offset);
|
||||
message_p = itti_alloc_new_message(TASK_PDCP_ENB, GTPV1U_ENB_TUNNEL_DATA_REQ);
|
||||
AssertFatal(message_p != NULL, "OUT OF MEMORY");
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
|
||||
packet_forwarded = TRUE;
|
||||
if (LINK_ENB_PDCP_TO_GTPV1U) {
|
||||
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_PDCP_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
"0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u",
|
||||
ctxt_pP->rnti,
|
||||
rb_id + 4,
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
|
||||
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
|
||||
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
|
||||
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY");
|
||||
memcpy(>pu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], &sdu_buffer_pP->data[payload_offset], sdu_buffer_sizeP - payload_offset);
|
||||
message_p = itti_alloc_new_message(TASK_PDCP_ENB, GTPV1U_ENB_TUNNEL_DATA_REQ);
|
||||
AssertFatal(message_p != NULL, "OUT OF MEMORY");
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
|
||||
packet_forwarded = TRUE;
|
||||
}
|
||||
|
||||
} else {
|
||||
packet_forwarded = FALSE;
|
||||
}
|
||||
|
||||
#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) {
|
||||
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;
|
||||
} else {
|
||||
((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
|
||||
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], \
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
} else {
|
||||
LOG_D(PDCP, "Created NW_DRIVER2PDCP_FIFO fifo %d\n", NW_DRIVER2PDCP_FIFO);
|
||||
rtf_reset(NW_DRIVER2PDCP_FIFO);
|
||||
if (PDCP_USE_NETLINK) {
|
||||
if(UE_NAS_USE_TUN) {
|
||||
netlink_init_tun();
|
||||
} else {
|
||||
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];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,25 +104,25 @@ pdcp_netlink_init(
|
||||
nb_inst_enb = 1;
|
||||
nb_inst_ue = 1;
|
||||
|
||||
#if defined(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"
|
||||
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);
|
||||
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" */
|
||||
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);
|
||||
|
||||
for (i = 0; i < nb_inst_enb; i++) {
|
||||
pdcp_netlink_nb_element_enb[i] = 0;
|
||||
for (i = 0; i < nb_inst_enb; i++) {
|
||||
pdcp_netlink_nb_element_enb[i] = 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);
|
||||
exit(EXIT_FAILURE);
|
||||
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);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (nb_inst_ue > 0) {
|
||||
pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state*));
|
||||
@@ -248,7 +248,7 @@ void *pdcp_netlink_thread_fct(void *arg)
|
||||
new_data_p->pdcp_read_header.data_size);
|
||||
} else {
|
||||
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,
|
||||
sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr));
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
+85
-89
@@ -77,9 +77,8 @@
|
||||
#include "plmn_data.h"
|
||||
#include "msc.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
#include "intertask_interface.h"
|
||||
|
||||
|
||||
#include "SIMULATION/TOOLS/sim.h" // for taus
|
||||
|
||||
@@ -156,12 +155,11 @@ uint8_t rrc_ue_generate_SidelinkUEInformation( const protocol_ctxt_t *const ctxt
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* to avoid gcc warnings when compiling with certain options */
|
||||
#if defined(ENABLE_USE_MME) || ENABLE_RAL
|
||||
|
||||
static Rrc_State_t rrc_get_state (module_id_t ue_mod_idP) {
|
||||
return UE_rrc_inst[ue_mod_idP].RrcState;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static Rrc_Sub_State_t rrc_get_sub_state (module_id_t ue_mod_idP) {
|
||||
return UE_rrc_inst[ue_mod_idP].RrcSubState;
|
||||
@@ -181,26 +179,26 @@ static int rrc_set_state (module_id_t ue_mod_idP, Rrc_State_t state) {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static int rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_t subState ) {
|
||||
#if (defined(ENABLE_ITTI) && (defined(ENABLE_USE_MME) || ENABLE_RAL))
|
||||
|
||||
switch (UE_rrc_inst[ue_mod_idP].RrcState) {
|
||||
case RRC_STATE_INACTIVE:
|
||||
AssertFatal ((RRC_SUB_STATE_INACTIVE_FIRST <= subState) && (subState <= RRC_SUB_STATE_INACTIVE_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
if (EPC_MODE_ENABLED) {
|
||||
switch (UE_rrc_inst[ue_mod_idP].RrcState) {
|
||||
case RRC_STATE_INACTIVE:
|
||||
AssertFatal ((RRC_SUB_STATE_INACTIVE_FIRST <= subState) && (subState <= RRC_SUB_STATE_INACTIVE_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
|
||||
case RRC_STATE_IDLE:
|
||||
AssertFatal ((RRC_SUB_STATE_IDLE_FIRST <= subState) && (subState <= RRC_SUB_STATE_IDLE_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
case RRC_STATE_IDLE:
|
||||
AssertFatal ((RRC_SUB_STATE_IDLE_FIRST <= subState) && (subState <= RRC_SUB_STATE_IDLE_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
|
||||
case RRC_STATE_CONNECTED:
|
||||
AssertFatal ((RRC_SUB_STATE_CONNECTED_FIRST <= subState) && (subState <= RRC_SUB_STATE_CONNECTED_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
}
|
||||
case RRC_STATE_CONNECTED:
|
||||
AssertFatal ((RRC_SUB_STATE_CONNECTED_FIRST <= subState) && (subState <= RRC_SUB_STATE_CONNECTED_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (UE_rrc_inst[ue_mod_idP].RrcSubState != subState) {
|
||||
UE_rrc_inst[ue_mod_idP].RrcSubState = subState;
|
||||
@@ -233,7 +231,7 @@ openair_rrc_on_ue(
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static void init_SI_UE( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
|
||||
static void init_SI_UE( protocol_ctxt_t const *ctxt_pP, const uint8_t eNB_index ) {
|
||||
UE_rrc_inst[ctxt_pP->module_id].sizeof_SIB1[eNB_index] = 0;
|
||||
UE_rrc_inst[ctxt_pP->module_id].sizeof_SI[eNB_index] = 0;
|
||||
UE_rrc_inst[ctxt_pP->module_id].SIB1[eNB_index] = (uint8_t *)malloc16_clear( 32 );
|
||||
@@ -534,9 +532,9 @@ void rrc_ue_generate_RRCConnectionRequest( const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
mui_t rrc_mui=0;
|
||||
|
||||
#if !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME))
|
||||
|
||||
/* NAS Attach request with IMSI */
|
||||
static const char const nas_attach_req_imsi[] = {
|
||||
static const char nas_attach_req_imsi[] = {
|
||||
0x07, 0x41,
|
||||
/* EPS Mobile identity = IMSI */
|
||||
0x71, 0x08, 0x29, 0x80, 0x43, 0x21, 0x43, 0x65, 0x87,
|
||||
@@ -548,7 +546,7 @@ static const char const nas_attach_req_imsi[] = {
|
||||
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
|
||||
0x01, 0x27, 0x11,
|
||||
};
|
||||
#endif /* !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)) */
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
@@ -596,13 +594,18 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t *c
|
||||
uint8_t size;
|
||||
const char *nas_msg;
|
||||
int nas_msg_length;
|
||||
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
|
||||
nas_msg = (char *) UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data;
|
||||
nas_msg_length = UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.length;
|
||||
#else
|
||||
nas_msg = nas_attach_req_imsi;
|
||||
nas_msg_length = sizeof(nas_attach_req_imsi);
|
||||
#endif
|
||||
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
nas_msg = (char *) UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data;
|
||||
nas_msg_length = UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.length;
|
||||
} else {
|
||||
|
||||
nas_msg = nas_attach_req_imsi;
|
||||
nas_msg_length = sizeof(nas_attach_req_imsi);
|
||||
}
|
||||
|
||||
|
||||
size = do_RRCConnectionSetupComplete(ctxt_pP->module_id, buffer, Transaction_id, nas_msg_length, nas_msg);
|
||||
LOG_I(RRC,"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionSetupComplete (bytes%d, eNB %d)\n",
|
||||
ctxt_pP->module_id,ctxt_pP->frame, size, eNB_index);
|
||||
@@ -800,13 +803,11 @@ rrc_ue_establish_drb(
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
// add descriptor from RRC PDU
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0;
|
||||
/* avoid gcc warnings */
|
||||
(void)oip_ifup;
|
||||
(void)ip_addr_offset3;
|
||||
(void)ip_addr_offset4;
|
||||
#endif
|
||||
LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
|
||||
ue_mod_idP, frameP, DRB_config->drb_Identity, (int)*DRB_config->logicalChannelIdentity);
|
||||
/*
|
||||
@@ -817,33 +818,33 @@ rrc_ue_establish_drb(
|
||||
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,
|
||||
RADIO_ACCESS_BEARER,Rlc_info_um);
|
||||
*/
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
if(PDCP_USE_NETLINK) {
|
||||
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
ip_addr_offset3 = 0;
|
||||
ip_addr_offset4 = 1;
|
||||
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oai%d, IP 10.0.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1);
|
||||
oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP, // interface_id
|
||||
ip_addr_offset3+ue_mod_idP+1, // third_octet
|
||||
ip_addr_offset4+ue_mod_idP+1); // fourth_octet
|
||||
ip_addr_offset3 = 0;
|
||||
ip_addr_offset4 = 1;
|
||||
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oai%d, IP 10.0.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1);
|
||||
oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP, // interface_id
|
||||
ip_addr_offset3+ue_mod_idP+1, // third_octet
|
||||
ip_addr_offset4+ue_mod_idP+1); // fourth_octet
|
||||
|
||||
if (oip_ifup == 0 ) { // interface is up --> send a config the DRB
|
||||
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
|
||||
ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP,
|
||||
(long int)((eNB_index * maxDRB) + DRB_config->drb_Identity));
|
||||
rb_conf_ipv4(0,//add
|
||||
ue_mod_idP,//cx align with the UE index
|
||||
ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index
|
||||
(eNB_index * maxDRB) + DRB_config->drb_Identity,//rb
|
||||
0,//dscp
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
|
||||
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index);
|
||||
}
|
||||
if (oip_ifup == 0 ) { // interface is up --> send a config the DRB
|
||||
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
|
||||
ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP,
|
||||
(long int)((eNB_index * maxDRB) + DRB_config->drb_Identity));
|
||||
rb_conf_ipv4(0,//add
|
||||
ue_mod_idP,//cx align with the UE index
|
||||
ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index
|
||||
(eNB_index * maxDRB) + DRB_config->drb_Identity,//rb
|
||||
0,//dscp
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
|
||||
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index);
|
||||
}
|
||||
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1906,7 +1907,7 @@ rrc_ue_process_rrcConnectionReconfiguration(
|
||||
);
|
||||
}
|
||||
*/
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
|
||||
/* Check if there is dedicated NAS information to forward to NAS */
|
||||
if (rrcConnectionReconfiguration_r8->dedicatedInfoNASList != NULL) {
|
||||
@@ -1971,7 +1972,7 @@ rrc_ue_process_rrcConnectionReconfiguration(
|
||||
itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // c1 present
|
||||
} // critical extensions present
|
||||
}
|
||||
@@ -2134,9 +2135,7 @@ rrc_ue_decode_dcch(
|
||||
// asn_dec_rval_t dec_rval;
|
||||
// int i;
|
||||
uint8_t target_eNB_index=0xFF;
|
||||
#if defined(ENABLE_ITTI)
|
||||
MessageDef *msg_p;
|
||||
#endif
|
||||
|
||||
if (Srb_id != 1) {
|
||||
LOG_E(RRC,"[UE %d] Frame %d: Received message on DL-DCCH (SRB%d), should not have ...\n",
|
||||
@@ -2166,7 +2165,6 @@ rrc_ue_decode_dcch(
|
||||
break;
|
||||
|
||||
case LTE_DL_DCCH_MessageType__c1_PR_dlInformationTransfer: {
|
||||
#if defined(ENABLE_ITTI)
|
||||
LTE_DLInformationTransfer_t *dlInformationTransfer = &dl_dcch_msg->message.choice.c1.choice.dlInformationTransfer;
|
||||
|
||||
if ((dlInformationTransfer->criticalExtensions.present == LTE_DLInformationTransfer__criticalExtensions_PR_c1)
|
||||
@@ -2189,7 +2187,6 @@ rrc_ue_decode_dcch(
|
||||
itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2244,7 +2241,7 @@ rrc_ue_decode_dcch(
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[target_eNB_index].State = RRC_RECONFIGURED;
|
||||
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n",
|
||||
ctxt_pP->module_id, target_eNB_index);
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
#if ENABLE_RAL
|
||||
{
|
||||
MessageDef *message_ral_p = NULL;
|
||||
@@ -2289,7 +2286,7 @@ rrc_ue_decode_dcch(
|
||||
LOG_I(RRC, "Sending RRC_RAL_CONNECTION_RECONFIGURATION_HO_IND to mRAL\n");
|
||||
itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
} else {
|
||||
rrc_ue_generate_RRCConnectionReconfigurationComplete(
|
||||
@@ -2300,7 +2297,6 @@ rrc_ue_decode_dcch(
|
||||
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED (eNB %d)\n",
|
||||
ctxt_pP->module_id,
|
||||
eNB_indexP);
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if ENABLE_RAL
|
||||
{
|
||||
MessageDef *message_ral_p = NULL;
|
||||
@@ -2345,7 +2341,6 @@ rrc_ue_decode_dcch(
|
||||
LOG_I(RRC, "Sending RRC_RAL_CONNECTION_RECONFIGURATION_IND to mRAL\n");
|
||||
itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2369,7 +2364,6 @@ rrc_ue_decode_dcch(
|
||||
break;
|
||||
|
||||
case LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionRelease:
|
||||
#if defined(ENABLE_ITTI)
|
||||
msg_p = itti_alloc_new_message(TASK_RRC_UE, NAS_CONN_RELEASE_IND);
|
||||
|
||||
if ((dl_dcch_msg->message.choice.c1.choice.rrcConnectionRelease.criticalExtensions.present
|
||||
@@ -2385,7 +2379,6 @@ rrc_ue_decode_dcch(
|
||||
msg_p = itti_alloc_new_message(TASK_RRC_UE, RRC_RAL_CONNECTION_RELEASE_IND);
|
||||
RRC_RAL_CONNECTION_RELEASE_IND(msg_p).ue_id = ctxt_pP->module_id;
|
||||
itti_send_msg_to_task(TASK_RAL_UE, ctxt_pP->instance, msg_p);
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -2682,13 +2675,16 @@ int decode_BCCH_DLSCH_Message(
|
||||
}
|
||||
}
|
||||
|
||||
if ((rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE)
|
||||
#if defined(ENABLE_USE_MME)
|
||||
&& (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
|
||||
#endif
|
||||
) {
|
||||
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
|
||||
rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING );
|
||||
// if ((rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE)
|
||||
//#if defined(ENABLE_USE_MME)
|
||||
// && (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
|
||||
//#endif
|
||||
// ) {
|
||||
if (rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) {
|
||||
if ( (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL) || (!EPC_MODE_ENABLED)) {
|
||||
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
|
||||
rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING );
|
||||
}
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_BCCH, VCD_FUNCTION_OUT );
|
||||
@@ -2873,8 +2869,9 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
|
||||
LOG_I(RRC,"Setting SIStatus bit 0 to 1\n");
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus = 1;
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIB1systemInfoValueTag = sib1->systemInfoValueTag;
|
||||
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
|
||||
{
|
||||
|
||||
//#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
|
||||
if (EPC_MODE_ENABLED) {
|
||||
int cell_valid = 0;
|
||||
|
||||
if (sib1->cellAccessRelatedInfo.cellBarred == LTE_SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred) {
|
||||
@@ -2922,7 +2919,7 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
|
||||
cell_valid = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} /* for plmn = 0;... */
|
||||
}
|
||||
|
||||
if (cell_valid == 0) {
|
||||
@@ -2932,8 +2929,8 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
|
||||
itti_send_msg_to_task(TASK_PHY_UE, ctxt_pP->instance, msg_p);
|
||||
LOG_E(RRC, "Synched with a cell, but PLMN doesn't match our SIM, the message PHY_FIND_NEXT_CELL_REQ is sent but lost in current UE implementation! \n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}/* EPC_MODE_ENABLED */
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SIB1, VCD_FUNCTION_OUT );
|
||||
return 0;
|
||||
}
|
||||
@@ -3560,10 +3557,11 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
|
||||
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].MBMS_flag < 3) // see -Q option
|
||||
#endif
|
||||
#if !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME))
|
||||
rrc_ue_generate_RRCConnectionRequest( ctxt_pP, eNB_index );
|
||||
if (EPC_MODE_ENABLED) {
|
||||
rrc_ue_generate_RRCConnectionRequest( ctxt_pP, eNB_index );
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State == RRC_IDLE) {
|
||||
LOG_I( RRC, "[UE %d] Received SIB1/SIB2/SIB3 Switching to RRC_SI_RECEIVED\n", ctxt_pP->module_id );
|
||||
@@ -4291,7 +4289,6 @@ void decode_MBSFNAreaConfiguration( module_id_t ue_mod_idP, uint8_t eNB_index, f
|
||||
|
||||
#endif // rel10
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
//-----------------------------------------------------------------------------
|
||||
void *rrc_ue_task( void *args_p ) {
|
||||
MessageDef *msg_p;
|
||||
@@ -4315,6 +4312,7 @@ void *rrc_ue_task( void *args_p ) {
|
||||
break;
|
||||
|
||||
case MESSAGE_TEST:
|
||||
LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
|
||||
break;
|
||||
|
||||
/* MAC messages */
|
||||
@@ -4419,7 +4417,6 @@ void *rrc_ue_task( void *args_p ) {
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_IND (msg_p).sdu_p);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
break;
|
||||
# if defined(ENABLE_USE_MME)
|
||||
|
||||
case NAS_KENB_REFRESH_REQ:
|
||||
memcpy((void *)UE_rrc_inst[ue_mod_id].kenb, (void *)NAS_KENB_REFRESH_REQ(msg_p).kenb, sizeof(UE_rrc_inst[ue_mod_id].kenb));
|
||||
@@ -4570,7 +4567,6 @@ void *rrc_ue_task( void *args_p ) {
|
||||
break;
|
||||
}
|
||||
|
||||
# endif
|
||||
# if ENABLE_RAL
|
||||
|
||||
case RRC_RAL_SCAN_REQ:
|
||||
@@ -4722,7 +4718,7 @@ void *rrc_ue_task( void *args_p ) {
|
||||
msg_p = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
+149
-354
@@ -79,28 +79,13 @@
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "rrc_eNB_S1AP.h"
|
||||
#include "rrc_eNB_GTPV1U.h"
|
||||
#if defined(ENABLE_ITTI)
|
||||
#else
|
||||
#include "../../S1AP/s1ap_eNB.h"
|
||||
#endif
|
||||
/* 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 "rrc_eNB_S1AP.h"
|
||||
#include "rrc_eNB_GTPV1U.h"
|
||||
|
||||
#include "pdcp.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
#if ENABLE_RAL
|
||||
#include "rrc_eNB_ral.h"
|
||||
@@ -235,11 +220,10 @@ init_SI(
|
||||
AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SIB23_BR!=NULL,"cannot allocate memory for SIB");
|
||||
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB23_BR = do_SIB23(
|
||||
ctxt_pP->module_id,
|
||||
CC_id
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,TRUE
|
||||
#endif
|
||||
,configuration
|
||||
CC_id,
|
||||
TRUE,
|
||||
|
||||
configuration
|
||||
);
|
||||
}
|
||||
#endif
|
||||
@@ -537,10 +521,8 @@ init_MCCH(
|
||||
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
|
||||
#endif
|
||||
(struct LTE_PhysicalConfigDedicated *)NULL,
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
(LTE_SCellToAddMod_r10_t *)NULL,
|
||||
//(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL,
|
||||
#endif
|
||||
(LTE_MeasObjectToAddMod_t **) NULL,
|
||||
(LTE_MAC_MainConfig_t *) NULL,
|
||||
0,
|
||||
@@ -550,12 +532,10 @@ init_MCCH(
|
||||
(LTE_MobilityControlInfo_t *)NULL,
|
||||
(LTE_SchedulingInfoList_t *) NULL,
|
||||
0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
,
|
||||
0,
|
||||
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
|
||||
(LTE_PMCH_InfoList_r9_t *) & (RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9)
|
||||
#endif
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
|
||||
,
|
||||
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
|
||||
@@ -587,9 +567,7 @@ static void init_MBMS(
|
||||
NULL, // key rrc encryption
|
||||
NULL, // key rrc integrity
|
||||
NULL // key encryption
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
, &(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9)
|
||||
#endif
|
||||
,NULL);
|
||||
rrc_rlc_config_asn1_req(&ctxt,
|
||||
NULL, // LTE_SRB_ToAddModList
|
||||
@@ -603,7 +581,7 @@ static void init_MBMS(
|
||||
//rrc_mac_config_req();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
uint8_t
|
||||
@@ -843,28 +821,7 @@ rrc_eNB_free_mem_UE_context(
|
||||
ue_context_pP->ue_context.measConfig = NULL;
|
||||
}
|
||||
|
||||
//HANDOVER_INFO *handover_info;
|
||||
#if defined(ENABLE_SECURITY)
|
||||
//uint8_t kenb[32];
|
||||
#endif
|
||||
//e_SecurityAlgorithmConfig__cipheringAlgorithm ciphering_algorithm;
|
||||
//e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
|
||||
//uint8_t Status;
|
||||
//rnti_t rnti;
|
||||
//uint64_t random_ue_identity;
|
||||
#if defined(ENABLE_ITTI)
|
||||
//UE_S_TMSI Initialue_identity_s_TMSI;
|
||||
//EstablishmentCause_t establishment_cause;
|
||||
//ReestablishmentCause_t reestablishment_cause;
|
||||
//uint16_t ue_initial_id;
|
||||
//uint32_t eNB_ue_s1ap_id :24;
|
||||
//security_capabilities_t security_capabilities;
|
||||
//uint8_t nb_of_e_rabs;
|
||||
//e_rab_param_t e_rab[S1AP_MAX_E_RAB];
|
||||
//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
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1443,13 +1400,14 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
|
||||
|
||||
ue_context_pP->ue_context.Srb1.Active = 1;
|
||||
//ue_context_pP->ue_context.Srb2.Srb_info.Srb_id = 2;
|
||||
#if defined(ENABLE_USE_MME)
|
||||
hashtable_rc_t h_rc;
|
||||
int j;
|
||||
rrc_ue_s1ap_ids_t *rrc_ue_s1ap_ids_p = NULL;
|
||||
uint16_t ue_initial_id = ue_context_pP->ue_context.ue_initial_id;
|
||||
uint32_t eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
|
||||
eNB_RRC_INST *rrc_instance_p = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)];
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
hashtable_rc_t h_rc;
|
||||
int j;
|
||||
rrc_ue_s1ap_ids_t *rrc_ue_s1ap_ids_p = NULL;
|
||||
uint16_t ue_initial_id = ue_context_pP->ue_context.ue_initial_id;
|
||||
uint32_t eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
|
||||
eNB_RRC_INST *rrc_instance_p = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)];
|
||||
|
||||
if (eNB_ue_s1ap_id > 0) {
|
||||
h_rc = hashtable_get(rrc_instance_p->s1ap_id2_s1ap_ids, (hash_key_t)eNB_ue_s1ap_id, (void **)&rrc_ue_s1ap_ids_p);
|
||||
@@ -1482,24 +1440,27 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
|
||||
}
|
||||
}
|
||||
|
||||
create_tunnel_req.rnti = ctxt_pP->rnti; // warning put zero above
|
||||
create_tunnel_req.num_tunnels = j;
|
||||
gtpv1u_update_s1u_tunnel(
|
||||
ctxt_pP->instance,
|
||||
&create_tunnel_req,
|
||||
reestablish_rnti);
|
||||
#endif
|
||||
create_tunnel_req.rnti = ctxt_pP->rnti; // warning put zero above
|
||||
create_tunnel_req.num_tunnels = j;
|
||||
gtpv1u_update_s1u_tunnel(
|
||||
ctxt_pP->instance,
|
||||
&create_tunnel_req,
|
||||
reestablish_rnti);
|
||||
} /* EPC_MODE_ENABLED */
|
||||
|
||||
/* Update RNTI in ue_context */
|
||||
ue_context_pP->ue_id_rnti = ctxt_pP->rnti; // here ue_id_rnti is just a key, may be something else
|
||||
ue_context_pP->ue_context.rnti = ctxt_pP->rnti;
|
||||
#if defined(ENABLE_USE_MME)
|
||||
uint8_t send_security_mode_command = FALSE;
|
||||
rrc_pdcp_config_security(
|
||||
ctxt_pP,
|
||||
ue_context_pP,
|
||||
send_security_mode_command);
|
||||
LOG_D(RRC, "set security successfully \n");
|
||||
#endif
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
uint8_t send_security_mode_command = FALSE;
|
||||
rrc_pdcp_config_security(
|
||||
ctxt_pP,
|
||||
ue_context_pP,
|
||||
send_security_mode_command);
|
||||
LOG_D(RRC, "set security successfully \n");
|
||||
}
|
||||
|
||||
// Measurement ID list
|
||||
MeasId_list = CALLOC(1, sizeof(*MeasId_list));
|
||||
memset((void *)MeasId_list, 0, sizeof(*MeasId_list));
|
||||
@@ -1752,7 +1713,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
|
||||
}
|
||||
|
||||
#endif
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/* Initialize NAS list */
|
||||
dedicatedInfoNASList = CALLOC(1, sizeof(struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList));
|
||||
|
||||
@@ -1786,7 +1747,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
|
||||
dedicatedInfoNASList = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// send LTE_RRCConnectionReconfiguration
|
||||
memset(buffer, 0, RRC_BUF_SIZE);
|
||||
size = do_RRCConnectionReconfiguration(ctxt_pP,
|
||||
@@ -1821,7 +1782,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
|
||||
);
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)buffer,size,
|
||||
"[MSG] RRC Connection Reconfiguration\n");
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
|
||||
/* Free all NAS PDUs */
|
||||
for (i = 0; i < ue_context_pP->ue_context.nb_of_e_rabs; i++) {
|
||||
@@ -1832,7 +1793,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
if(size==65535) {
|
||||
LOG_E(RRC,"RRC decode err!!! do_RRCConnectionReconfiguration\n");
|
||||
@@ -2029,7 +1990,6 @@ rrc_eNB_generate_RRCConnectionRelease(
|
||||
uint8_t qci_to_priority[9]= {2,4,3,5,1,6,7,8,9};
|
||||
|
||||
// TBD: this directive can be remived if we create a similar e_rab_param_t structure in RRC context
|
||||
#if defined(ENABLE_ITTI)
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
|
||||
@@ -2242,7 +2202,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *co
|
||||
#endif
|
||||
);
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Connection Reconfiguration\n");
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/* Free all NAS PDUs */
|
||||
for (i = 0; i < ue_context_pP->ue_context.nb_of_e_rabs; i++) {
|
||||
@@ -2252,8 +2211,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *co
|
||||
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
LOG_I(RRC,
|
||||
"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE RNTI %x)\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
|
||||
@@ -2494,8 +2451,6 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *cons
|
||||
);
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)buffer,size,
|
||||
"[MSG] RRC Connection Reconfiguration\n");
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/* Free all NAS PDUs */
|
||||
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_e_rabs; i++) {
|
||||
if (ue_context_pP->ue_context.modify_e_rab[i].param.nas_pdu.buffer != NULL) {
|
||||
@@ -2505,7 +2460,6 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *cons
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
LOG_I(RRC,
|
||||
"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE RNTI %x)\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
|
||||
@@ -2610,15 +2564,11 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release( const protocol_
|
||||
ue_context_pP->ue_context.e_rab_release_command_flag = 1;
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)buffer,size,
|
||||
"[MSG] RRC Connection Reconfiguration\n");
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/* Free all NAS PDUs */
|
||||
if (nas_length > 0) {
|
||||
/* Free the NAS PDU buffer and invalidate it */
|
||||
free(nas_buffer);
|
||||
}
|
||||
|
||||
#endif
|
||||
LOG_I(RRC,
|
||||
"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE RNTI %x)\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
|
||||
@@ -2644,7 +2594,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release( const protocol_
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
|
||||
@@ -3181,7 +3130,6 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons
|
||||
#endif
|
||||
//}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
/* Initialize NAS list */
|
||||
dedicatedInfoNASList = CALLOC(1, sizeof(struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList));
|
||||
|
||||
@@ -3214,7 +3162,6 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons
|
||||
dedicatedInfoNASList = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
memset(buffer, 0, RRC_BUF_SIZE);
|
||||
size = do_RRCConnectionReconfiguration(ctxt_pP,
|
||||
buffer,
|
||||
@@ -3248,7 +3195,6 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons
|
||||
);
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)buffer,size,
|
||||
"[MSG] RRC Connection Reconfiguration\n");
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/* Free all NAS PDUs */
|
||||
for (i = 0; i < ue_context_pP->ue_context.nb_of_e_rabs; i++) {
|
||||
@@ -3258,8 +3204,6 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t *cons
|
||||
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
LOG_I(RRC,
|
||||
"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
|
||||
@@ -3684,7 +3628,6 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
|
||||
CALLOC(1, sizeof(*(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ)));
|
||||
*quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP = LTE_FilterCoefficient_fc4;
|
||||
*quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ = LTE_FilterCoefficient_fc4;
|
||||
#if defined(ENABLE_ITTI)
|
||||
/* Initialize NAS list */
|
||||
dedicatedInfoNASList = CALLOC(1, sizeof(struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList));
|
||||
|
||||
@@ -3717,7 +3660,6 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
|
||||
dedicatedInfoNASList = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
memset(buffer, 0, RRC_BUF_SIZE);
|
||||
size = do_RRCConnectionReconfiguration(ctxt_pP,
|
||||
buffer,
|
||||
@@ -3751,8 +3693,6 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
|
||||
);
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)buffer,size,
|
||||
"[MSG] RRC Connection Reconfiguration\n");
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/* Free all NAS PDUs */
|
||||
for (i = 0; i < ue_context_pP->ue_context.nb_of_e_rabs; i++) {
|
||||
if (ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer != NULL) {
|
||||
@@ -3762,7 +3702,6 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
LOG_I(RRC,
|
||||
"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
|
||||
@@ -5599,60 +5538,11 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.buf[0] = 0x22;
|
||||
physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.buf[1] = 0x34 + ue_context_pP->local_uid;
|
||||
physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH->choice.setup.tpc_RNTI.bits_unused = 0;
|
||||
// CQI ReportConfig
|
||||
/*
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic=CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic));
|
||||
assign_enum(physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic,
|
||||
CQI_ReportConfig__cqi_ReportModeAperiodic_rm30); // HLC CQI, no PMI
|
||||
physicalConfigDedicated2->cqi_ReportConfig->nomPDSCH_RS_EPRE_Offset = 0; // 0 dB
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic=CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic));
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = CQI_ReportPeriodic_PR_setup;
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex = 0; // n2_pucch
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex = 0; // Icqi/pmi
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.present = CQI_ReportPeriodic__setup__cqi_FormatIndicatorPeriodic_PR_subbandCQI; // subband CQI
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_FormatIndicatorPeriodic.choice.subbandCQI.k=4;
|
||||
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex=NULL;
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.simultaneousAckNackAndCQI=0;
|
||||
*/
|
||||
//soundingRS-UL-ConfigDedicated
|
||||
/*
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->present = SoundingRS_UL_ConfigDedicated_PR_setup;
|
||||
assign_enum(&physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth,
|
||||
SoundingRS_UL_ConfigDedicated__setup__srs_Bandwidth_bw0);
|
||||
assign_enum(&physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth,
|
||||
SoundingRS_UL_ConfigDedicated__setup__srs_HoppingBandwidth_hbw0);
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition=0;
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.duration=1;
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex=1;
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb=0;
|
||||
assign_enum(&physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift,
|
||||
SoundingRS_UL_ConfigDedicated__setup__cyclicShift_cs0);
|
||||
*/
|
||||
|
||||
//AntennaInfoDedicated
|
||||
physicalConfigDedicated2->antennaInfo = CALLOC(1, sizeof(*physicalConfigDedicated2->antennaInfo));
|
||||
physicalConfigDedicated2->antennaInfo->present = LTE_PhysicalConfigDedicated__antennaInfo_PR_explicitValue;
|
||||
//assign_enum(&physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode,
|
||||
// LTE_AntennaInfoDedicated__transmissionMode_tm2);
|
||||
/*
|
||||
switch (transmission_mode){
|
||||
case 1:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm1;
|
||||
break;
|
||||
case 2:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm2;
|
||||
break;
|
||||
case 4:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm4;
|
||||
break;
|
||||
case 5:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm5;
|
||||
break;
|
||||
case 6:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm6;
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.present =
|
||||
LTE_AntennaInfoDedicated__ue_TransmitAntennaSelection_PR_release;
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.ue_TransmitAntennaSelection.choice.release = 0;
|
||||
@@ -6262,24 +6152,6 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
void ue_rrc_process_rrcConnectionReconfiguration(uint8_t enb_mod_idP,frame_t frameP,
|
||||
LTE_RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,
|
||||
uint8_t CH_index) {
|
||||
|
||||
if (rrcConnectionReconfiguration->criticalExtensions.present == LTE_RRCConnectionReconfiguration__criticalExtensions_PR_c1)
|
||||
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.present == LTE_RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8) {
|
||||
|
||||
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated) {
|
||||
rrc_ue_process_radioResourceConfigDedicated(enb_mod_idP,frameP,CH_index,
|
||||
LTE_RRCConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated);
|
||||
|
||||
}
|
||||
|
||||
// check other fields for
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/*
|
||||
@@ -6295,13 +6167,11 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
int i, drb_id;
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
int oip_ifup = 0;
|
||||
int dest_ip_offset = 0;
|
||||
/* avoid gcc warnings */
|
||||
(void)oip_ifup;
|
||||
(void)dest_ip_offset;
|
||||
#endif
|
||||
uint8_t *kRRCenc = NULL;
|
||||
uint8_t *kRRCint = NULL;
|
||||
uint8_t *kUPenc = NULL;
|
||||
@@ -6423,8 +6293,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
LOG_D(RRC,
|
||||
"[eNB %d] Frame %d: Establish RLC UM Bidirectional, DRB %d Active\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, (int)DRB_configList->list.array[i]->drb_Identity);
|
||||
#if defined(PDCP_USE_NETLINK) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
// can mean also IPV6 since ether -> ipv6 autoconf
|
||||
|
||||
if (PDCP_USE_NETLINK && (!LINK_ENB_PDCP_TO_GTPV1U)) {
|
||||
// can mean also IPV6 since ether -> ipv6 autoconf
|
||||
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET)
|
||||
LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n",
|
||||
ctxt_pP->module_id,
|
||||
@@ -6454,7 +6325,8 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
}
|
||||
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
LOG_D(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (DRB) ---> MAC_eNB\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
@@ -6706,17 +6578,12 @@ void rrc_eNB_generate_RRCConnectionSetup(const protocol_ctxt_t *const ctxt_pP,
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
char openair_rrc_eNB_configuration(
|
||||
const module_id_t enb_mod_idP,
|
||||
RrcConfigurationReq *configuration
|
||||
)
|
||||
#else
|
||||
char openair_rrc_eNB_init(
|
||||
const module_id_t enb_mod_idP
|
||||
)
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
protocol_ctxt_t ctxt;
|
||||
@@ -6735,24 +6602,7 @@ char openair_rrc_eNB_init(
|
||||
#endif
|
||||
AssertFatal(RC.rrc[enb_mod_idP] != NULL, "RC.rrc not initialized!");
|
||||
AssertFatal(MAX_MOBILES_PER_ENB < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow");
|
||||
#ifdef ENABLE_ITTI
|
||||
AssertFatal(configuration!=NULL,"configuration input is null\n");
|
||||
#endif
|
||||
// for (j = 0; j < MAX_MOBILES_PER_ENB; j++)
|
||||
// RC.rrc[ctxt.module_id].Info.UE[j].Status = RRC_IDLE; //CH_READY;
|
||||
//
|
||||
//#if defined(ENABLE_USE_MME)
|
||||
// // Connect eNB to MME
|
||||
// if (EPC_MODE_ENABLED <= 0)
|
||||
//#endif
|
||||
// {
|
||||
// /* Init security parameters */
|
||||
// for (j = 0; j < MAX_MOBILES_PER_ENB; j++) {
|
||||
// RC.rrc[ctxt.module_id].ciphering_algorithm[j] = SecurityAlgorithmConfig__cipheringAlgorithm_eea0;
|
||||
// RC.rrc[ctxt.module_id].integrity_algorithm[j] = SecurityAlgorithmConfig__integrityProtAlgorithm_eia2;
|
||||
// rrc_eNB_init_security(enb_mod_idP, j);
|
||||
// }
|
||||
// }
|
||||
RC.rrc[ctxt.module_id]->Nb_ue = 0;
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
@@ -6810,9 +6660,7 @@ char openair_rrc_eNB_init(
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
init_SI(&ctxt,
|
||||
CC_id
|
||||
#if defined(ENABLE_ITTI)
|
||||
, configuration
|
||||
#endif
|
||||
);
|
||||
|
||||
for (int ue_id = 0; ue_id < MAX_MOBILES_PER_ENB; ue_id++) {
|
||||
@@ -6932,26 +6780,8 @@ rrc_eNB_decode_ccch(
|
||||
((rrcConnectionReestablishmentRequest->reestablishmentCause == LTE_ReestablishmentCause_otherFailure) ? "Other Failure" :
|
||||
(rrcConnectionReestablishmentRequest->reestablishmentCause == LTE_ReestablishmentCause_handoverFailure) ? "Handover Failure" :
|
||||
"reconfigurationFailure"));
|
||||
/*{
|
||||
uint64_t c_rnti = 0;
|
||||
|
||||
memcpy(((uint8_t *) & c_rnti) + 3, rrcConnectionReestablishmentRequest.UE_identity.c_RNTI.buf,
|
||||
rrcConnectionReestablishmentRequest.UE_identity.c_RNTI.size);
|
||||
ue_mod_id = rrc_eNB_get_UE_index(enb_mod_idP, c_rnti);
|
||||
}
|
||||
|
||||
if ((RC.rrc[enb_mod_idP]->phyCellId == rrcConnectionReestablishmentRequest.UE_identity.physCellId) &&
|
||||
(ue_mod_id != UE_INDEX_INVALID)){
|
||||
rrc_eNB_generate_RRCConnectionReestablishment(enb_mod_idP, frameP, ue_mod_id);
|
||||
}else {
|
||||
rrc_eNB_generate_RRCConnectionReestablishmentReject(enb_mod_idP, frameP, ue_mod_id);
|
||||
}
|
||||
*/
|
||||
/* reject all reestablishment attempts for the moment */
|
||||
// rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP,
|
||||
// rrc_eNB_get_ue_context(RC.rrc[ctxt_pP->module_id], ctxt_pP->rnti),
|
||||
// CC_id);
|
||||
{
|
||||
|
||||
{
|
||||
uint16_t c_rnti = 0;
|
||||
|
||||
if (rrcConnectionReestablishmentRequest->ue_Identity.physCellId != RC.rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId) {
|
||||
@@ -7059,16 +6889,11 @@ rrc_eNB_decode_ccch(
|
||||
|
||||
LOG_D(RRC, "reestablish_rnti_map[%d] [0] %x, [1] %x\n",
|
||||
i, reestablish_rnti_map[i][0], reestablish_rnti_map[i][1]);
|
||||
#if defined(ENABLE_ITTI)
|
||||
ue_context_p->ue_context.reestablishment_cause = rrcConnectionReestablishmentRequest->reestablishmentCause;
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept connection reestablishment request from UE physCellId %ld cause %ld\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
rrcConnectionReestablishmentRequest->ue_Identity.physCellId,
|
||||
ue_context_p->ue_context.reestablishment_cause);
|
||||
#else
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept connection restablishment request for UE\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
#endif
|
||||
#ifndef NO_RRM
|
||||
send_msg(&S_rrc, msg_rrc_MR_attach_ind(ctxt_pP->module_id, Mac_id));
|
||||
#else
|
||||
@@ -7112,18 +6937,14 @@ rrc_eNB_decode_ccch(
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
, (LTE_PMCH_InfoList_r9_t *) NULL
|
||||
#endif
|
||||
,NULL);
|
||||
rrc_rlc_config_asn1_req(ctxt_pP,
|
||||
ue_context_p->ue_context.SRB_configList,
|
||||
(LTE_DRB_ToAddModList_t *) NULL,
|
||||
(LTE_DRB_ToReleaseList_t *) NULL
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
, (LTE_PMCH_InfoList_r9_t *) NULL,
|
||||
0,0
|
||||
# endif
|
||||
);
|
||||
#endif //NO_RRM
|
||||
}
|
||||
@@ -7249,7 +7070,6 @@ rrc_eNB_decode_ccch(
|
||||
ue_context_p);
|
||||
|
||||
if (ue_context_p != NULL) {
|
||||
#if defined(ENABLE_ITTI)
|
||||
ue_context_p->ue_context.establishment_cause = rrcConnectionRequest->establishmentCause;
|
||||
ue_context_p->ue_context.reestablishment_cause = LTE_ReestablishmentCause_spare1;
|
||||
|
||||
@@ -7267,11 +7087,6 @@ rrc_eNB_decode_ccch(
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
|
||||
ue_context_p->ue_context.establishment_cause);
|
||||
|
||||
#else
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection for UE random UE identity (0x%" PRIx64 ")\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.random_ue_identity);
|
||||
#endif
|
||||
|
||||
if (stmsi_received == 0)
|
||||
RC.rrc[ctxt_pP->module_id]->Nb_ue++;
|
||||
@@ -7558,58 +7373,66 @@ rrc_eNB_decode_dcch(
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if defined(ENABLE_USE_MME)
|
||||
|
||||
if (dedicated_DRB == 1) {
|
||||
// rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(ctxt_pP,
|
||||
// ue_context_p,
|
||||
// ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) {
|
||||
rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(ctxt_pP,
|
||||
ue_context_p,
|
||||
ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
ue_context_p->ue_context.nb_of_modify_e_rabs = 0;
|
||||
ue_context_p->ue_context.nb_of_failed_e_rabs = 0;
|
||||
memset(ue_context_p->ue_context.modify_e_rab, 0, sizeof(ue_context_p->ue_context.modify_e_rab));
|
||||
if (EPC_MODE_ENABLED) {
|
||||
if (dedicated_DRB == 1) {
|
||||
// rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(ctxt_pP,
|
||||
// ue_context_p,
|
||||
// ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) {
|
||||
rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(ctxt_pP,
|
||||
ue_context_p,
|
||||
ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
ue_context_p->ue_context.nb_of_modify_e_rabs = 0;
|
||||
ue_context_p->ue_context.nb_of_failed_e_rabs = 0;
|
||||
memset(ue_context_p->ue_context.modify_e_rab, 0, sizeof(ue_context_p->ue_context.modify_e_rab));
|
||||
|
||||
for(int i = 0; i < NB_RB_MAX; i++) {
|
||||
ue_context_p->ue_context.modify_e_rab[i].xid = -1;
|
||||
for(int i = 0; i < NB_RB_MAX; i++) {
|
||||
ue_context_p->ue_context.modify_e_rab[i].xid = -1;
|
||||
}
|
||||
} else if(ue_context_p->ue_context.e_rab_release_command_flag == 1) {
|
||||
xid = ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier;
|
||||
ue_context_p->ue_context.e_rab_release_command_flag = 0;
|
||||
//gtp tunnel delete
|
||||
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, GTPV1U_ENB_DELETE_TUNNEL_REQ);
|
||||
memset(>PV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
|
||||
|
||||
for(i = 0; i < NB_RB_MAX; i++) {
|
||||
if(xid == ue_context_p->ue_context.e_rab[i].xid) {
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] = ue_context_p->ue_context.enb_gtp_ebi[i];
|
||||
ue_context_p->ue_context.enb_gtp_teid[i] = 0;
|
||||
memset(&ue_context_p->ue_context.enb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[i]));
|
||||
ue_context_p->ue_context.enb_gtp_ebi[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, ctxt_pP->instance, msg_delete_tunnels_p);
|
||||
//S1AP_E_RAB_RELEASE_RESPONSE
|
||||
rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(ctxt_pP,
|
||||
ue_context_p,
|
||||
xid);
|
||||
} else {
|
||||
rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(ctxt_pP,
|
||||
ue_context_p,
|
||||
ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
}
|
||||
} else if(ue_context_p->ue_context.e_rab_release_command_flag == 1) {
|
||||
xid = ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier;
|
||||
ue_context_p->ue_context.e_rab_release_command_flag = 0;
|
||||
//gtp tunnel delete
|
||||
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, GTPV1U_ENB_DELETE_TUNNEL_REQ);
|
||||
memset(>PV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
|
||||
} else if(dedicated_DRB == 0) {
|
||||
if(ue_context_p->ue_context.reestablishment_cause == LTE_ReestablishmentCause_spare1) {
|
||||
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(ctxt_pP,
|
||||
ue_context_p);
|
||||
} else {
|
||||
ue_context_p->ue_context.reestablishment_cause = LTE_ReestablishmentCause_spare1;
|
||||
|
||||
for(i = 0; i < NB_RB_MAX; i++) {
|
||||
if(xid == ue_context_p->ue_context.e_rab[i].xid) {
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] = ue_context_p->ue_context.enb_gtp_ebi[i];
|
||||
ue_context_p->ue_context.enb_gtp_teid[i] = 0;
|
||||
memset(&ue_context_p->ue_context.enb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[i]));
|
||||
ue_context_p->ue_context.enb_gtp_ebi[i] = 0;
|
||||
for (uint8_t e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
|
||||
if (ue_context_p->ue_context.e_rab[e_rab].status == E_RAB_STATUS_DONE) {
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_ESTABLISHED;
|
||||
} else {
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_FAILED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, ctxt_pP->instance, msg_delete_tunnels_p);
|
||||
//S1AP_E_RAB_RELEASE_RESPONSE
|
||||
rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(ctxt_pP,
|
||||
ue_context_p,
|
||||
xid);
|
||||
} else {
|
||||
rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(ctxt_pP,
|
||||
ue_context_p,
|
||||
ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
}
|
||||
} else if(dedicated_DRB == 0) {
|
||||
if(ue_context_p->ue_context.reestablishment_cause == LTE_ReestablishmentCause_spare1) {
|
||||
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(ctxt_pP,
|
||||
ue_context_p);
|
||||
} else {
|
||||
ue_context_p->ue_context.reestablishment_cause = LTE_ReestablishmentCause_spare1;
|
||||
|
||||
} else if(dedicated_DRB == 2) {
|
||||
for (uint8_t e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
|
||||
if (ue_context_p->ue_context.e_rab[e_rab].status == E_RAB_STATUS_DONE) {
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_ESTABLISHED;
|
||||
@@ -7617,37 +7440,19 @@ rrc_eNB_decode_dcch(
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_FAILED;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(dedicated_DRB == 2) {
|
||||
for (uint8_t e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
|
||||
if (ue_context_p->ue_context.e_rab[e_rab].status == E_RAB_STATUS_DONE) {
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_ESTABLISHED;
|
||||
} else {
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_FAILED;
|
||||
} else if(dedicated_DRB == 3) { //x2 path switch
|
||||
for (uint8_t e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
|
||||
if (ue_context_p->ue_context.e_rab[e_rab].status == E_RAB_STATUS_DONE) {
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_ESTABLISHED;
|
||||
} else {
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(RRC,"issue rrc_eNB_send_PATH_SWITCH_REQ \n");
|
||||
rrc_eNB_send_PATH_SWITCH_REQ(ctxt_pP,ue_context_p);
|
||||
}
|
||||
} else if(dedicated_DRB == 3) { //x2 path switch
|
||||
for (uint8_t e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
|
||||
if (ue_context_p->ue_context.e_rab[e_rab].status == E_RAB_STATUS_DONE) {
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_ESTABLISHED;
|
||||
} else {
|
||||
ue_context_p->ue_context.e_rab[e_rab].status = E_RAB_STATUS_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(RRC,"issue rrc_eNB_send_PATH_SWITCH_REQ \n");
|
||||
rrc_eNB_send_PATH_SWITCH_REQ(ctxt_pP,ue_context_p);
|
||||
}
|
||||
|
||||
#endif
|
||||
#else // establish a dedicated bearer
|
||||
|
||||
if (dedicated_DRB == 0 ) {
|
||||
// ue_context_p->ue_context.e_rab[0].status = E_RAB_STATUS_ESTABLISHED;
|
||||
rrc_eNB_reconfigure_DRBs(ctxt_pP,ue_context_p);
|
||||
}
|
||||
|
||||
#endif
|
||||
} /* EPC_MODE_ENABLED */
|
||||
break;
|
||||
|
||||
case LTE_UL_DCCH_MessageType__c1_PR_rrcConnectionReestablishmentComplete:
|
||||
@@ -8079,7 +7884,6 @@ rrc_eNB_decode_dcch(
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP) {
|
||||
int i;
|
||||
@@ -8196,7 +8000,6 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
|
||||
}
|
||||
|
||||
break;
|
||||
# if defined(ENABLE_USE_MME)
|
||||
|
||||
/* Messages from S1AP */
|
||||
case S1AP_DOWNLINK_NAS:
|
||||
@@ -8249,12 +8052,10 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case S1AP_PATH_SWITCH_REQ_ACK:
|
||||
LOG_I(RRC, "[eNB %d] received path switch ack %s\n", instance, msg_name_p);
|
||||
rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
# endif
|
||||
|
||||
case X2AP_HANDOVER_REQ:
|
||||
LOG_I(RRC, "[eNB %d] target eNB Receives X2 HO Req %s at frame %d subframe %d\n", instance, msg_name_p,
|
||||
@@ -8312,7 +8113,6 @@ rrc_enb_task(
|
||||
(void) rrc_enb_process_itti_msg(NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void
|
||||
@@ -8705,13 +8505,11 @@ rrc_rx_tx(
|
||||
LOG_I(RRC, "Removing UE %x instance, because of UE_CONTEXT_RELEASE_COMMAND not received after %d ms from sending request\n",
|
||||
ue_context_p->ue_context.rnti,
|
||||
ue_context_p->ue_context.ue_release_timer_thres_s1);
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#if defined(ENABLE_ITTI)
|
||||
rrc_eNB_generate_RRCConnectionRelease(ctxt_pP, ue_context_p);
|
||||
#endif
|
||||
#else
|
||||
ue_to_be_removed = ue_context_p;
|
||||
#endif
|
||||
if (EPC_MODE_ENABLED)
|
||||
rrc_eNB_generate_RRCConnectionRelease(ctxt_pP, ue_context_p);
|
||||
else
|
||||
ue_to_be_removed = ue_context_p;
|
||||
|
||||
ue_context_p->ue_context.ue_release_timer_s1 = 0;
|
||||
break; // break RB_FOREACH
|
||||
} // end if timer_s1 timeout
|
||||
@@ -8743,47 +8541,44 @@ rrc_rx_tx(
|
||||
(rrc_release_info.RRC_release_ctrl[release_num].rnti == ue_context_p->ue_context.rnti)) {
|
||||
ue_context_p->ue_context.ue_release_timer_rrc = 1;
|
||||
ue_context_p->ue_context.ue_release_timer_thres_rrc = 100;
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#if defined(ENABLE_ITTI)
|
||||
int e_rab = 0;
|
||||
MessageDef *msg_complete_p = NULL;
|
||||
MessageDef *msg_delete_tunnels_p = NULL;
|
||||
uint32_t eNB_ue_s1ap_id = ue_context_p->ue_context.eNB_ue_s1ap_id;
|
||||
if (EPC_MODE_ENABLED) {
|
||||
int e_rab = 0;
|
||||
MessageDef *msg_complete_p = NULL;
|
||||
MessageDef *msg_delete_tunnels_p = NULL;
|
||||
uint32_t eNB_ue_s1ap_id = ue_context_p->ue_context.eNB_ue_s1ap_id;
|
||||
|
||||
if (rrc_release_info.RRC_release_ctrl[release_num].flag == 4) { // if timer_s1 == 0
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_S1AP_ENB, NULL, 0,
|
||||
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ",
|
||||
eNB_ue_s1ap_id);
|
||||
msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, S1AP_UE_CONTEXT_RELEASE_COMPLETE);
|
||||
S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
itti_send_msg_to_task(TASK_S1AP, ctxt_pP->module_id, msg_complete_p);
|
||||
}
|
||||
if (rrc_release_info.RRC_release_ctrl[release_num].flag == 4) { // if timer_s1 == 0
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_S1AP_ENB, NULL, 0,
|
||||
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ",
|
||||
eNB_ue_s1ap_id);
|
||||
msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, S1AP_UE_CONTEXT_RELEASE_COMPLETE);
|
||||
S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
itti_send_msg_to_task(TASK_S1AP, ctxt_pP->module_id, msg_complete_p);
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_GTPU_ENB, NULL,0, "0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ", eNB_ue_s1ap_id);
|
||||
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, GTPV1U_ENB_DELETE_TUNNEL_REQ);
|
||||
memset(>PV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_GTPU_ENB, NULL,0, "0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ", eNB_ue_s1ap_id);
|
||||
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, GTPV1U_ENB_DELETE_TUNNEL_REQ);
|
||||
memset(>PV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
|
||||
// do not wait response
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
|
||||
|
||||
for (e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] =
|
||||
ue_context_p->ue_context.enb_gtp_ebi[e_rab];
|
||||
for (e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] =
|
||||
ue_context_p->ue_context.enb_gtp_ebi[e_rab];
|
||||
// erase data
|
||||
ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0;
|
||||
memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab], 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab]));
|
||||
ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0;
|
||||
}
|
||||
ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0;
|
||||
memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab], 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab]));
|
||||
ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0;
|
||||
}
|
||||
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, ctxt_pP->module_id, msg_delete_tunnels_p);
|
||||
struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids = NULL;
|
||||
rrc_ue_s1ap_ids = rrc_eNB_S1AP_get_ue_ids(RC.rrc[ctxt_pP->module_id], 0, eNB_ue_s1ap_id);
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, ctxt_pP->module_id, msg_delete_tunnels_p);
|
||||
struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids = NULL;
|
||||
rrc_ue_s1ap_ids = rrc_eNB_S1AP_get_ue_ids(RC.rrc[ctxt_pP->module_id], 0, eNB_ue_s1ap_id);
|
||||
|
||||
if (rrc_ue_s1ap_ids != NULL) {
|
||||
rrc_eNB_S1AP_remove_ue_ids(RC.rrc[ctxt_pP->module_id], rrc_ue_s1ap_ids);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
if (rrc_ue_s1ap_ids != NULL) {
|
||||
rrc_eNB_S1AP_remove_ue_ids(RC.rrc[ctxt_pP->module_id], rrc_ue_s1ap_ids);
|
||||
}
|
||||
} /* EPC_MODE_ENABLED */
|
||||
rrc_release_info.RRC_release_ctrl[release_num].flag = 0;
|
||||
rrc_release_info.num_UEs--;
|
||||
break; // break for (release_num)
|
||||
|
||||
@@ -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 "asn1_conversions.h"
|
||||
# include "intertask_interface.h"
|
||||
# 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 "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#endif
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "openair3/NAS/UE/nas_ue_task.h"
|
||||
#include "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#if ENABLE_RAL
|
||||
#include "lteRALue.h"
|
||||
#include "lteRALenb.h"
|
||||
@@ -43,24 +40,23 @@
|
||||
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) {
|
||||
nas_user_container_t *users = calloc(1, sizeof(*users));
|
||||
if (ue_nb > 0) {
|
||||
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) {
|
||||
LOG_E(NAS, "Create task for NAS UE failed\n");
|
||||
return -1;
|
||||
if (itti_create_task (TASK_NAS_UE, nas_ue_task, users) < 0) {
|
||||
LOG_E(NAS, "Create task for NAS UE failed\n");
|
||||
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;
|
||||
|
||||
@@ -104,14 +104,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,15 +33,8 @@
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
#include "flexran_agent.h"
|
||||
|
||||
#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"
|
||||
|
||||
/* 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"
|
||||
@@ -245,31 +238,34 @@
|
||||
#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;
|
||||
char rf_config_file[1024];
|
||||
int phy_test;
|
||||
uint8_t usim_test;
|
||||
int emulate_rf;
|
||||
int wait_for_sync; //eNodeB only
|
||||
int single_thread_flag; //eNodeB only
|
||||
int chain_offset;
|
||||
uint32_t do_forms;
|
||||
int numerology;
|
||||
unsigned int start_msc;
|
||||
uint32_t clock_source;
|
||||
int hw_timing_advance;
|
||||
uint64_t optmask;
|
||||
THREAD_STRUCT thread_struct;
|
||||
char rf_config_file[1024];
|
||||
int phy_test;
|
||||
uint8_t usim_test;
|
||||
int emulate_rf;
|
||||
int wait_for_sync; //eNodeB only
|
||||
int single_thread_flag; //eNodeB only
|
||||
int chain_offset;
|
||||
uint32_t do_forms;
|
||||
int numerology;
|
||||
unsigned int start_msc;
|
||||
uint32_t clock_source;
|
||||
int hw_timing_advance;
|
||||
} softmodem_params_t;
|
||||
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user