Commit cf0e9175 authored by bruno mongazon's avatar bruno mongazon

Fix #582, RTAI, RTAI_ENABLED, ENABLE_RTAI_CLOCK, RTAI_ISNT_POSIX,...

Fix #582, RTAI, RTAI_ENABLED, ENABLE_RTAI_CLOCK, RTAI_ISNT_POSIX, _RTAI_MATH_H, CELLULAR, TIMER_ONESHOT_MODE, EMOS, EMOS_CHANNEL, OAI_EMU, OPENAIR_EMU, PHY_ABSTRACTION, PHY_ABSTRACTION_UL removed
parent afcc9aab
......@@ -262,9 +262,6 @@ if (${ENABLE_ITTI})
set(GTPU_need_ITTI ${OPENAIR3_DIR}/GTPV1-U/gtpv1u_eNB.c)
endif (${ENABLE_ITTI})
add_boolean_option(RTAI False "Use RTAI")
#############################
# ASN.1 grammar C code generation & dependancies
################################
......@@ -594,7 +591,7 @@ add_boolean_option(DISABLE_USE_NAS False "???")
add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver")
add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai")
add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????")
add_boolean_option(OAISIM False "specific to oaisim")
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
......@@ -616,9 +613,6 @@ add_boolean_option(ENB_MODE True "Swap the include directories between openair2
##########################
add_boolean_option(ENABLE_PGM_TRANSPORT False "specific to oaisim, emulation through ethernet, reliable multicast")
add_boolean_option(ADDR_CONF False "specific to oaisim, IP autoconf of user-plane IP interface")
add_boolean_option(OPENAIR_EMU False "specific to oaisim")
add_boolean_option(OAI_EMU False "specific to oaisim")
add_boolean_option(PHY_ABSTRACTION False "specific to oaisim")
##########################
# SCHEDULING/REAL-TIME/PERF options
......@@ -733,16 +727,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "Otherwise it is UM, confi
add_boolean_option(SPECTRA False "???")
add_boolean_option(MIH_C_MEDIEVAL_EXTENSIONS False "EXTENSIONS TO MIH 802.21 IN CONTEXT OF IST PROJECT CALLED MEDIEVAL")
add_boolean_option(EMOS False "????")
if(${EMOS})
add_definitions("-D_FILE_OFFSET_BITS=64")
set(EMOS_LIB gps)
endif(${EMOS})
# add the binary tree to the search path for include files
# add the binary tree to the search path for include files
#######################################################
# We will find ConfigOAI.h after generation in target directory
include_directories("${OPENAIR_BIN_DIR}")
......@@ -770,7 +755,6 @@ else()
endif()
include_directories("${NFAPI_DIR}")
include_directories("${OPENAIR1_DIR}")
include_directories("${OPENAIR2_DIR}/NAS")
include_directories("${OPENAIR2_DIR}")
include_directories("${OPENAIR2_DIR}/LAYER2/RLC")
include_directories("${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0")
......@@ -1776,7 +1760,6 @@ add_executable(lte-softmodem
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE}
......@@ -1813,7 +1796,6 @@ add_executable(lte-softmodem-nos1
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR_DIR}/common/utils/system.c
${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE}
......@@ -2166,15 +2148,7 @@ endfunction(make_driver name dir src)
# nashmesh module
################
list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c)
# Actually nasty stuff to be FIXED: the hereafter flag is for RTAI compilation in the driver,
# but has different meaning in the other parts of the code
# We should change the constant name to xxx_RTAI or likely
if(NOT ${module_cc_opt} MATCHES "DRTAI")
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK")
else()
string(REPLACE "-DNAS_NETLINK" "" tmp "${module_cc_opt}")
set(module_cc_opt ${tmp})
endif()
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK -DPDCP_USE_NETLINK")
# legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag
# so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere
if (OAI_NW_DRIVER_USE_NETLINK)
......
......@@ -6,7 +6,6 @@ set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( EMIT_ASN_DEBUG False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
......@@ -45,7 +44,6 @@ set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU False )
set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
......@@ -59,7 +57,6 @@ set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
......@@ -70,7 +67,6 @@ set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RRC_DEFAULT_RAB_IS_AM True)
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( TEST_OMG False )
......
......@@ -5,7 +5,6 @@ set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
......@@ -44,7 +43,6 @@ set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU True )
set ( OAISIM True )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
......@@ -58,7 +56,6 @@ set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
......@@ -69,7 +66,6 @@ set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RRC_DEFAULT_RAB_IS_AM True)
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
......
......@@ -5,7 +5,6 @@ set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 False )
set ( EMOS False )
set ( ENABLE_FXP False )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False )
......@@ -45,7 +44,6 @@ set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT False )
set ( NO_RRM False )
set ( OAI_EMU False )
set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK False )
......@@ -59,7 +57,6 @@ set ( PC_DSP False )
set ( PC_TARGET False )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION False )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM False )
......@@ -69,7 +66,6 @@ set ( RF_BOARD "False" )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
......
......@@ -4,7 +4,6 @@ set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False )
......@@ -45,7 +44,6 @@ set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU True )
set ( OAISIM True )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
......@@ -60,7 +58,6 @@ set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
......@@ -70,7 +67,6 @@ set ( RF_BOARD "False" )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
......
......@@ -5,7 +5,6 @@ set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
......@@ -45,7 +44,6 @@ set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU True )
set ( OAISIM True )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
......@@ -59,7 +57,6 @@ set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
......@@ -70,7 +67,6 @@ set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RRC_DEFAULT_RAB_IS_AM True)
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
......
This diff is collapsed.
......@@ -27,10 +27,6 @@
#include <sys/epoll.h>
#ifdef RTAI
# include <rtai_sem.h>
#endif
#ifndef INTERTASK_INTERFACE_H_
#define INTERTASK_INTERFACE_H_
......@@ -155,12 +151,10 @@ int itti_create_task(task_id_t task_id,
void *(*start_routine) (void *),
void *args_p);
//#ifdef RTAI
/** \brief Mark the task as a real time task
* \param task_id task to mark as real time
**/
void itti_set_task_real_time(task_id_t task_id);
//#endif
/** \brief Indicates to ITTI if newly created tasks should wait for all tasks to be ready
* \param wait_tasks non 0 to make new created tasks to wait, 0 to let created tasks to run
......
......@@ -51,23 +51,14 @@
#include "intertask_interface.h"
#include "intertask_interface_dump.h"
#if defined(OAI_EMU) || defined(RTAI)
#include "vcd_signal_dumper.h"
#endif
#if T_TRACER
#include "T.h"
#endif
static const int itti_dump_debug = 0; // 0x8 | 0x4 | 0x2;
#ifdef RTAI
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) rt_printk("[ITTI_DUMP][D]"x, ##args); } \
while(0)
#else
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) fprintf(stdout, "[ITTI_DUMP][D]"x, ##args); } \
while(0)
#endif
#define ITTI_DUMP_ERROR(x, args...) do { fprintf(stdout, "[ITTI_DUMP][E]"x, ##args); } \
while(0)
......@@ -99,13 +90,8 @@ typedef struct itti_desc_s {
int nb_connected;
#ifndef RTAI
/* Event fd used to notify new messages (semaphore) */
int event_fd;
#else
unsigned long messages_in_queue __attribute__((aligned(8)));
#endif
int itti_listen_socket;
itti_client_desc_t itti_clients[ITTI_DUMP_MAX_CON];
......@@ -194,9 +180,7 @@ static int itti_dump_fwrite_message(itti_dump_queue_item_t *message)
fwrite (&new_message_header, sizeof(itti_dump_message_t), 1, dump_file);
fwrite (message->data, message->data_size, 1, dump_file);
fwrite (&itti_dump_message_type_end, sizeof(itti_message_types_t), 1, dump_file);
// #if !defined(RTAI)
fflush (dump_file);
// #endif
return (1);
}
......@@ -280,10 +264,6 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
int overwrite_flag;
AssertFatal (new != NULL, "Message to queue is NULL!\n");
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_IN);
#endif
new->message_type = message_type;
new->message_size = message_size;
......@@ -303,9 +283,6 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
lfds611_ringbuffer_put_write_element(itti_dump_queue.itti_message_queue, new_queue_element);
if (overwrite_flag == 0) {
#ifdef RTAI
__sync_fetch_and_add (&itti_dump_queue.messages_in_queue, 1);
#else
{
ssize_t write_ret;
eventfd_t sem_counter = 1;
......@@ -314,25 +291,18 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
AssertFatal (write_ret == sizeof(sem_counter), "Write to dump event failed (%d/%d)!\n", (int) write_ret, (int) sizeof(sem_counter));
}
#endif
// add one to pending_messages, atomically
__sync_fetch_and_add (&pending_messages, 1);
}
ITTI_DUMP_DEBUG (0x2, " Added element to queue %p %p, pending %u, type %u\n", new_queue_element, new, pending_messages, message_type);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT);
#endif
return 0;
}
static void itti_dump_socket_exit(void)
{
#ifndef RTAI
close(itti_dump_queue.event_fd);
#endif
close(itti_dump_queue.itti_listen_socket);
/* Leave the thread as we detected end signal */
......@@ -346,10 +316,6 @@ static int itti_dump_flush_ring_buffer(int flush_all)
int j;
int consumer;
#ifdef RTAI
unsigned long number_of_messages;
#endif
/* Check if there is a least one consumer */
consumer = 0;
......@@ -365,18 +331,6 @@ static int itti_dump_flush_ring_buffer(int flush_all)
}
if (consumer > 0) {
#ifdef RTAI
number_of_messages = itti_dump_queue.messages_in_queue;
ITTI_DUMP_DEBUG(0x4, "%lu elements in queue\n", number_of_messages);
if (number_of_messages == 0) {
return (consumer);
}
__sync_sub_and_fetch(&itti_dump_queue.messages_in_queue, number_of_messages);
#endif
do {
/* Acquire the ring element */
lfds611_ringbuffer_get_read_element(itti_dump_queue.itti_message_queue, &element);
......@@ -419,9 +373,6 @@ static int itti_dump_flush_ring_buffer(int flush_all)
lfds611_ringbuffer_put_read_element(itti_dump_queue.itti_message_queue, element);
}
} while(flush_all
#ifdef RTAI
&& --number_of_messages
#endif
);
}
......@@ -478,9 +429,6 @@ static void *itti_dump_socket(void *arg_p)
struct sockaddr_in servaddr; /* socket address structure */
struct timeval *timeout_p = NULL;
#ifdef RTAI
struct timeval timeout;
#endif
ITTI_DUMP_DEBUG(0x2, " Creating TCP dump socket on port %u\n", ITTI_PORT);
......@@ -536,15 +484,11 @@ static void *itti_dump_socket(void *arg_p)
/* Add the listener */
FD_SET(itti_listen_socket, &read_set);
#ifndef RTAI
/* Add the event fd */
FD_SET(itti_dump_queue.event_fd, &read_set);
/* Max of both sd */
max_sd = itti_listen_socket > itti_dump_queue.event_fd ? itti_listen_socket : itti_dump_queue.event_fd;
#else
max_sd = itti_listen_socket;
#endif
itti_dump_queue.itti_listen_socket = itti_listen_socket;
......@@ -557,14 +501,7 @@ static void *itti_dump_socket(void *arg_p)
int i;
memcpy(&working_set, &read_set, sizeof(read_set));
#ifdef RTAI
timeout.tv_sec = 0;
timeout.tv_usec = 100000;
timeout_p = &timeout;
#else
timeout_p = NULL;
#endif
/* No timeout: select blocks till a new event has to be handled
* on sd's.
......@@ -592,8 +529,6 @@ static void *itti_dump_socket(void *arg_p)
if (FD_ISSET(i, &working_set)) {
desc_ready -= 1;
#ifndef RTAI
if (i == itti_dump_queue.event_fd) {
/* Notification of new element to dump from other tasks */
eventfd_t sem_counter;
......@@ -613,7 +548,6 @@ static void *itti_dump_socket(void *arg_p)
if (itti_dump_running) {
ITTI_DUMP_DEBUG (0x4, " No messages consumers, waiting ...\n");
usleep(100 * 1000);
#ifndef RTAI
{
ssize_t write_ret;
......@@ -622,7 +556,6 @@ static void *itti_dump_socket(void *arg_p)
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
AssertFatal (write_ret == sizeof(sem_counter), "Failed to write to dump event FD (%d/%d)!\n", (int) write_ret, (int) sem_counter);
}
#endif
} else {
itti_dump_socket_exit();
}
......@@ -630,7 +563,6 @@ static void *itti_dump_socket(void *arg_p)
ITTI_DUMP_DEBUG(0x1, " Write element to file\n");
}
} else
#endif
if (i == itti_listen_socket) {
do {
client_socket = accept(itti_listen_socket, NULL, NULL);
......@@ -719,21 +651,9 @@ int itti_dump_queue_message(task_id_t sender_task,
AssertFatal (message_name != NULL, "Message name is NULL!\n");
AssertFatal (message_p != NULL, "Message is NULL!\n");
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
#endif
new = itti_malloc(sender_task, TASK_MAX, sizeof(itti_dump_queue_item_t));
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
#endif
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
#endif
new->data = itti_malloc(sender_task, TASK_MAX, message_size);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
#endif
memcpy(new->data, message_p, message_size);
new->data_size = message_size;
......@@ -791,9 +711,6 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
AssertFatal (0, " Failed to create ring buffer!\n");
}
#ifdef RTAI
itti_dump_queue.messages_in_queue = 0;
#else
itti_dump_queue.event_fd = eventfd(0, EFD_SEMAPHORE);
if (itti_dump_queue.event_fd == -1) {
......@@ -801,8 +718,6 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
AssertFatal (0, "eventfd failed: %s!\n", strerror(errno));
}
#endif
itti_dump_queue.nb_connected = 0;
for(i = 0; i < ITTI_DUMP_MAX_CON; i++) {
......
......@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
#ifdef RTAI
# include <rtai_shm.h>
#endif
#include "assertions.h"
#include "memory_pools.h"
#if defined(OAI_EMU) || defined(RTAI)
# include "vcd_signal_dumper.h"
#endif
#if T_TRACER
#include <string.h>
......@@ -37,18 +30,8 @@
/*------------------------------------------------------------------------------*/
const static int mp_debug = 0;
#ifdef RTAI
# define MP_DEBUG(x, args...) do { if (mp_debug) rt_printk("[MP][D]"x, ##args); } \
while(0)
#else
# define MP_DEBUG(x, args...) do { if (mp_debug) fprintf(stdout, "[MP][D]"x, ##args); fflush (stdout); } \
while(0)
#endif
#if defined(OAI_EMU) || defined(RTAI)
uint64_t vcd_mp_alloc;
uint64_t vcd_mp_free;
#endif
/*------------------------------------------------------------------------------*/
#ifndef CHARS_TO_UINT32
......@@ -414,11 +397,6 @@ memory_pool_item_handle_t memory_pools_allocate (memory_pools_handle_t memory_po
pool_id_t pool;
items_group_index_t item_index = ITEMS_GROUP_INDEX_INVALID;
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_ALLOC,
__sync_or_and_fetch (&vcd_mp_alloc, 1L << info_0));
#endif
/* Recover memory_pools */
memory_pools = memory_pools_from_handler (memory_pools_handle);
AssertError (memory_pools != NULL, {}, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
......@@ -464,11 +442,6 @@ memory_pool_item_handle_t memory_pools_allocate (memory_pools_handle_t memory_po
MP_DEBUG(" Alloc [--][------]{------}, %3u %3u, %6u, failed!\n", info_0, info_1, item_size);
}
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_ALLOC,
__sync_and_and_fetch (&vcd_mp_alloc, ~(1L << info_0)));
#endif
return memory_pool_item_handle;
}
......@@ -493,11 +466,6 @@ int memory_pools_free (memory_pools_handle_t memory_pools_handle, memory_pool_it
info_1 = memory_pool_item->start.info[1];
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE,
__sync_or_and_fetch (&vcd_mp_free, 1L << info_1));
#endif
/* Recover pool index */
pool = memory_pool_item->start.pool_id;
AssertFatal (pool < memory_pools->pools_defined, "Pool index is invalid (%u/%u)!\n", pool, memory_pools->pools_defined);
......@@ -531,11 +499,6 @@ int memory_pools_free (memory_pools_handle_t memory_pools_handle, memory_pool_it
AssertError (result == EXIT_SUCCESS, {}, "Failed to free memory pool item (pool %u, item %d)!\n", pool, item_index);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE,
__sync_and_and_fetch (&vcd_mp_free, ~(1L << info_1)));
#endif
return (result);
}
......
# command line flags are automatically exported and thus passed down to any sub-make.
# here we set the default flags in case on command line flags are provided
# these flags have to be explicitely exported so that the sub-make is aware of them
include $(OPENAIR_DIR)/common/utils/Makefile.inc
ifndef OPENAIR_LTE
export OPENAIR_LTE=1
endif
ifndef OPENAIR1
export OPENAIR1=1
endif
ifndef OPENAIR2
export OPENAIR2=0
endif
ifndef EMOS
export EMOS=0
endif
ifndef FIRMWARE2010
export FIRMWARE2010=0
endif
all: openair_rf_cbmimo1_softmodem.ko asn1_msg_kern.ko
openair_rf_cbmimo1_softmodem.ko:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C $(KERNEL_DIR)/build V=1 M=`pwd` RTAI=1 CBMIMO1=1 && mv openair_rf.ko openair_rf_softmodem.ko)
oai_user_cbmimo1.ko:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C $(KERNEL_DIR)/build V=1 M=`pwd` RTAI=1 CBMIMO1=1 BIT8_TX=1 OPENAIR1=0 OPENAIR2=0 && mv openair_rf.ko openair_rf_softmodem.ko)
oai_user_exmimo.ko:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C $(KERNEL_DIR)/build V=1 M=`pwd` RTAI=1 CBMIMO1=1 OPENAIR1=0 OPENAIR2=0 && mv openair_rf.ko openair_rf_softmodem.ko)
asn1_msg_kern.ko:
(cd ../openair2/RRC/LITE/MESSAGES && $(MAKE) -C $(KERNEL_DIR) V=0 M=`pwd` RTAI=1 -j2)
#Remove all but source files
cleanall:
find -name '*.o' -delete -print; \
find -name '*.ko' -delete -print; \
find -name '*.bak' -delete -print; \
find -name '*.cmd' -delete -print; \
find -name '*~' -delete -print; \
find -name octave-core -delete -print; \
#Remove files created by SVN, dangerous!!! DO NOT RUN ON YOUR WORKING REPOSITORY!
#FK: Don't do this! Use svn export instead.
#cleansvn:
# rm -rf `find -name *.svn* -print`; \
# find -name *.svn* -delete -print
tgz:
mkdir /tmp/openair1_tmp; \
$(MAKE) cleanall; \
cp -r . /tmp/openair1_tmp; \
(cd /tmp/openair1_tmp && $(MAKE) cleansvn && cd .. && tar czfv openair1.tgz openair1_tmp) ; \
cp /tmp/openair1.tgz . ;\
rm -rf /tmp/openair1_tmp
fifos:
@for i in `seq 0 64`;\
do \
have_rtfX=`ls /dev/ |grep -c rtf$$i`;\
if [ "$$have_rtfX" -eq 0 ] ;then \
mknod -m 666 /dev/rtf$$i c 150 $$i; \
fi;\
done
openair0:
mknod /dev/openair0 c 127 0
chmod a+rw /dev/openair0
install_oai_user:
make fifos
insmod ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko
updatefw:
USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr_exmimo2/main -s 0x43fffff0
boot_exmimo:
sudo make install_oai_user
USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0
sudo rmmod openair_rf
sudo make install_oai_user
reboot_exmimo:
USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0 -b
rmmod openair_rf
make install_oai_user
USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0
rmmod openair_rf
make install_oai_user
install_softmodem:
make fifos
ifeq ($(OPENAIR2),1)
insmod ../openair2/RRC/LITE/MESSAGES/asn1_msg_kern.ko
endif
insmod ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko ; \
remove:
rmmod openair_rf
ifeq ($(OPENAIR2),1)
rmmod asn1_msg_kern
endif
test:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) test RTAI=1 CBMIMO1=1)
(cd ../openair2/RRC/LITE/MESSAGES && $(MAKE) test)
clean: clean_l1
clean_l1:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) clean RTAI=1 CBMIMO1=1)
clean_asn1:
(cd ../openair2/RRC/LITE/MESSAGES && $(MAKE) clean)
......@@ -23,12 +23,6 @@
#define __LTE_ESTIMATION_DEFS__H__
#include "PHY/defs.h"
/*
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
*/
/** @addtogroup _PHY_PARAMETER_ESTIMATION_BLOCKS_
* @{
*/
......@@ -136,18 +130,6 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
int subframe,
unsigned char l);
/*
#ifdef EMOS
int lte_dl_channel_estimation_emos(int dl_ch_estimates_emos[NB_ANTENNAS_RX*NB_ANTENNAS_TX][N_RB_DL_EMOS*N_PILOTS_PER_RB*N_SLOTS_EMOS],
int **rxdataF,
LTE_DL_FRAME_PARMS *frame_parms,
unsigned char Ns,
unsigned char p,
unsigned char l,
unsigned char sector);
#endif
*/
/*!
\brief Frequency offset estimation for LTE
We estimate the frequency offset by calculating the phase difference between channel estimates for symbols carrying pilots (l==0 or l==3/4). We take a moving average of the phase difference.
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <string.h>
#include "defs.h"
#include "PHY/defs.h"
#include "SCHED/phy_procedures_emos.h"
// TODO: make channel estimation possible for multiple sectors (Gold sequences for pilots)
//#define DEBUG_CH
int lte_dl_channel_estimation_emos(int dl_ch_estimates_emos[NB_ANTENNAS_RX*NB_ANTENNAS_TX][N_RB_DL_EMOS*N_PILOTS_PER_RB*N_SLOTS_EMOS],
int **rxdataF,
LTE_DL_FRAME_PARMS *frame_parms,
unsigned char Ns,
unsigned char p,
unsigned char l,
unsigned char sector)
{
int pilot[2][200] __attribute__((aligned(16)));
unsigned char nu,aarx;
unsigned short k;
unsigned int rb,pilot_cnt;
short ch[2],*pil,*rxF,*dl_ch,*dl_ch_prev; //*f,*f2,*fl,*f2l2,*fr,*f2r2;
int ch_offset,symbol_offset;
unsigned int n;
int i;
unsigned char symbol = l+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame
if ((p==0) && (l==0) )
nu = 0;
else if ((p==0) && (l>0))
nu = 3;
else if ((p==1) && (l==0))
nu = 3;
else if ((p==1) && (l>0))
nu = 0;
else {
msg("lte_dl_channel_estimation_emos: p %d, l %d -> ERROR\n",p,l);
return(-1);
}
if (sector > 2) {
msg("lte_dl_channel_estimation_emos: sector must be 0,1, or 2\n");
return(-1);
}
switch (Ns) {
case 0:
ch_offset = ((l==0)?0:1)*2*frame_parms->N_RB_DL;
break;
case 1:
ch_offset = ((l==0)?2:3)*2*frame_parms->N_RB_DL;
break;
case 12:
ch_offset = ((l==0)?4:5)*2*frame_parms->N_RB_DL;
break;
case 13:
ch_offset = ((l==0)?6:7)*2*frame_parms->N_RB_DL;
break;
default:
msg("lte_dl_channel_estimation_emos: Ns must be 0, 1, 12, or 13\n");
return(-1);
break;
}
symbol_offset = symbol*frame_parms->ofdm_symbol_size; // offset within rxdataF
k = nu + sector;
if (k > 6)
k -=6;
#ifdef DEBUG_CH
printf("Channel Estimation : ch_offset %d, OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d, symbol=%d\n",ch_offset,frame_parms->ofdm_symbol_size,frame_parms->Ncp,l,Ns,k,symbol);
#endif
// generate pilot
lte_dl_cell_spec_rx(&pilot[p][0],
frame_parms,
Ns,
(l==0)?0:1,
p);
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
pil = (short *)&pilot[p][0];
rxF = (short *)&rxdataF[aarx][((symbol_offset+k+frame_parms->first_carrier_offset)<<1)];
dl_ch = (short *)&dl_ch_estimates_emos[(p<<1)+aarx][ch_offset];
memset(dl_ch,0,frame_parms->N_RB_DL);
for (pilot_cnt=0; pilot_cnt<frame_parms->N_RB_DL; pilot_cnt++) {
dl_ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
dl_ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
pil+=2; // Re Im
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=2;
}
// printf("Second half\n");
// Second half of RBs
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k)<<1)];
for (pilot_cnt=0; pilot_cnt<frame_parms->N_RB_DL; pilot_cnt++) {
dl_ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
dl_ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
pil+=2;
rxF+=24;
dl_ch+=2;
}
}
return(0);
}
......@@ -578,30 +578,3 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
}
#ifdef PHY_ABSTRACTION
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
//extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
int lte_sync_time_eNB_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t sect_id,
int32_t *sync_val)
{
uint8_t UE_id;
uint8_t CC_id = phy_vars_eNB->CC_id;
LOG_E(PHY,"[PHY] EMUL lte_sync_time_eNB_emul eNB %d, sect_id %d\n",phy_vars_eNB->Mod_id,sect_id);
*sync_val = 0;
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
//LOG_E(PHY,"[PHY] EMUL : eNB %d checking UE %d (PRACH %d) PL %d dB\n",phy_vars_eNB->Mod_id,UE_id,PHY_vars_UE_g[UE_id]->generate_prach,UE2eNB[UE_id][phy_vars_eNB->Mod_id]->path_loss_dB);
if ((PHY_vars_UE_g[UE_id][CC_id]->generate_prach == 1) && (phy_vars_eNB->Mod_id == (UE_id % NB_eNB_INST))) {
*sync_val = 1;
return(0);
}
}
return(-1);
}
#endif
......@@ -4206,33 +4206,3 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return(dci_cnt);
}
#ifdef PHY_ABSTRACTION
uint16_t dci_decoding_procedure_emul(LTE_UE_PDCCH **pdcch_vars,
uint8_t num_ue_spec_dci,
uint8_t num_common_dci,
DCI_ALLOC_t *dci_alloc_tx,
DCI_ALLOC_t *dci_alloc_rx,
int16_t eNB_id)
{
uint8_t dci_cnt=0,i;
memcpy(dci_alloc_rx,dci_alloc_tx,num_common_dci*sizeof(DCI_ALLOC_t));
dci_cnt = num_common_dci;
LOG_D(PHY,"[DCI][EMUL] : num_common_dci %d\n",num_common_dci);
for (i=num_common_dci; i<(num_ue_spec_dci+num_common_dci); i++) {
LOG_D(PHY,"[DCI][EMUL] Checking dci %d => %x format %d (bit 0 %d)\n",i,pdcch_vars[eNB_id]->crnti,dci_alloc_tx[i].format,
dci_alloc_tx[i].dci_pdu[0]&0x80);
if (dci_alloc_tx[i].rnti == pdcch_vars[eNB_id]->crnti) {
memcpy(dci_alloc_rx+dci_cnt,dci_alloc_tx+i,sizeof(DCI_ALLOC_t));
dci_cnt++;
}
}
return(dci_cnt);
}
#endif
This diff is collapsed.
......@@ -37,11 +37,6 @@
#include "PHY/extern.h"
#include "PHY/sse_intrin.h"
#ifdef PHY_ABSTRACTION
#include "SIMULATION/TOOLS/defs.h"
#endif
//#define DEBUG_PBCH 1
//#define DEBUG_PBCH_ENCODING
//#define INTERFERENCE_MITIGATION 1
......@@ -1016,44 +1011,3 @@ uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
}
#ifdef PHY_ABSTRACTION
uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_id,
uint8_t pbch_phase)
{
double bler=0.0;//, x=0.0;
double sinr=0.0;
uint16_t nb_rb = phy_vars_ue->frame_parms.N_RB_DL;
int16_t f;
uint8_t CC_id=phy_vars_ue->CC_id;
int frame_rx = phy_vars_ue->proc.proc_rxtx[0].frame_rx;
// compute effective sinr
// TODO: adapt this to varible bandwidth
for (f=(nb_rb*6-3*12); f<(nb_rb*6+3*12); f++) {
if (f!=0) //skip DC
sinr += pow(10, 0.1*(phy_vars_ue->sinr_dB[f]));
}
sinr = 10*log10(sinr/(6*12));
bler = pbch_bler(sinr);
LOG_D(PHY,"EMUL UE rx_pbch_emul: eNB_id %d, pbch_phase %d, sinr %f dB, bler %f \n",
eNB_id,
pbch_phase,
sinr,
bler);
if (pbch_phase == (frame_rx % 4)) {
if (uniformrandom() >= bler) {
memcpy(phy_vars_ue->pbch_vars[eNB_id]->decoded_output,RC.eNB[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE);
return(RC.eNB[eNB_id][CC_id]->frame_parms.nb_antenna_ports_eNB);
} else
return(-1);
} else
return(-1);
}
#endif
......@@ -2149,9 +2149,13 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,RU_t *ru,
uint16_t *max_preamble,
uint16_t *max_preamble_energy,
uint16_t *max_preamble_delay,
#ifdef Rel14
uint16_t Nf, uint8_t tdd_mapindex,
uint8_t br_flag);
uint8_t br_flag
#else
uint16_t Nf, uint8_t tdd_mapindex
#endif
);
/*!
\brief Helper for MAC, returns number of available PRACH in TDD for a particular configuration index
@param frame_parms Pointer to LTE_DL_FRAME_PARMS structure
......
......@@ -953,77 +953,3 @@ uint32_t ulsch_encoding(uint8_t *a,
return(0);
}
#ifdef PHY_ABSTRACTION
#ifdef OPENAIR2
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
#endif
int ulsch_encoding_emul(uint8_t *ulsch_buffer,
PHY_VARS_UE *ue,
uint8_t eNB_id,
uint8_t subframe_rx,
uint8_t harq_pid,
uint8_t control_only_flag)
{
LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id];
LTE_UE_DLSCH_t **dlsch = ue->dlsch[0][eNB_id];
PHY_MEASUREMENTS *meas = &ue->measurements;
uint8_t tmode = ue->transmission_mode[eNB_id];
uint16_t rnti=ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti;
LOG_D(PHY,"EMUL UE ulsch_encoding for eNB %d,mod_id %d, harq_pid %d rnti %x, ACK(%d,%d) \n",
eNB_id,ue->Mod_id, harq_pid, rnti,ulsch->o_ACK[0],ulsch->o_ACK[1]);
if (ulsch->O>0) {
/*
if(flag_LA==1)
sinr_eff = sinr_eff_cqi_calc(ue, eNB_id);
else
sinr_eff = meas->wideband_cqi_avg[eNB_id];
*/
fill_CQI(ulsch,meas,eNB_id,harq_pid,ue->frame_parms.N_RB_DL,rnti,tmode,ue->sinr_eff);
//LOG_D(PHY,"UE CQI\n");
// print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
// save PUSCH pmi for later (transmission modes 4,5,6)
// printf("ulsch: saving pmi for DL %x\n",pmi2hex_2Ar1(((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi));
// if (ulsch->uci_format != HLC_subband_cqi_mcs_CBA)
dlsch[0]->harq_processes[harq_pid]->pmi_alloc = ((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi;
}
memcpy(ue->ulsch[eNB_id]->harq_processes[harq_pid]->b,
ulsch_buffer,
ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3);
//memcpy(&UE_transport_info[ue->Mod_id].transport_blocks[UE_transport_info_TB_index[ue->Mod_id]],
memcpy(&UE_transport_info[ue->Mod_id][ue->CC_id].transport_blocks,
ulsch_buffer,
ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3);
//UE_transport_info_TB_index[ue->Mod_id]+=ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3;
// navid: currently more than one eNB is not supported in the code
UE_transport_info[ue->Mod_id][ue->CC_id].num_eNB = 1;
UE_transport_info[ue->Mod_id][ue->CC_id].rnti[0] = ue->pdcch_vars[ue->current_thread_id[subframe_rx]][0]->crnti;
UE_transport_info[ue->Mod_id][ue->CC_id].eNB_id[0] = eNB_id;
UE_transport_info[ue->Mod_id][ue->CC_id].harq_pid[0] = harq_pid;
UE_transport_info[ue->Mod_id][ue->CC_id].tbs[0] = ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3 ;
// printf("\nue->Mod_id%d\n",ue->Mod_id);
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_flag = 1;
//UE_transport_info[ue->Mod_id].cntl.pusch_uci = *(uint32_t *)ulsch->o;
memcpy(UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_uci,
ulsch->o,
MAX_CQI_BYTES);
// printf("[UE]cqi is %d \n", ((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1);
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.length_uci = ulsch->O;
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.uci_format = ulsch->uci_format;
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_ri = (ulsch->o_RI[0]&1)+((ulsch->o_RI[1]&1)<<1);
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_ack = (ulsch->o_ACK[0]&1) + ((ulsch->o_ACK[1]&1)<<1);
//printf("ack is %d %d %d\n",UE_transport_info[ue->Mod_id].cntl.pusch_ack, (ulsch->o_ACK[1]&1)<<1, ulsch->o_ACK[0]&1);
return(0);
}
#endif
This diff is collapsed.
......@@ -1360,7 +1360,6 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
//#ifndef OAI_EMU
write_output("/tmp/ulsch_d.m","ulsch_dseq",&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0);
if (eNB->common_vars.rxdata) write_output("/tmp/rxsig0.m","rxs0", &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
......
......@@ -34,13 +34,10 @@
#include "PHY/sse_intrin.h"
//defined in rtai_math.h
#ifndef _RTAI_MATH_H
struct complex {
double x;
double y;
};
#endif
struct complexf {
float r;
......@@ -359,17 +356,6 @@ int16_t dB_fixed_times10(uint32_t x);
int32_t phy_phase_compensation_top (uint32_t pilot_type, uint32_t initial_pilot,
uint32_t last_pilot, int32_t ignore_prefix);
/*!\fn void phy_phase_compensation (int16_t *ref_sch, int16_t *tgt_sch, int16_t *out_sym, int32_t ignore_prefix, int32_t aa, struct complex16 *perror_out);
This function is used by the EMOS to compensate the phase rotation of the RF. It has been designed for symbols of type CHSCH or SCH, but cannot be used for the data channels.
@param ref_sch reference symbol
@param tgt_sch target symbol
@param out_sym output of the operation
@param ignore_prefix set to 1 if cyclic prefix has not been removed (by the hardware)
@param aa antenna index
@param perror_out phase error (output parameter)
*/
void phy_phase_compensation (int16_t *ref_sch, int16_t *tgt_sch, int16_t *out_sym, int32_t ignore_prefix, int32_t aa, struct complex16 *perror_out );
int32_t dot_product(int16_t *x,
int16_t *y,
uint32_t N, //must be a multiple of 8
......
......@@ -153,7 +153,9 @@ typedef struct {
/// prach_Config_enabled=1 means enabled. \vr{[0..1]}
uint8_t prach_Config_enabled;
/// PRACH Configuration Information
#ifdef Rel14
PRACH_eMTC_CONFIG_INFO prach_ConfigInfo;
#endif
} PRACH_eMTC_CONFIG_COMMON;
/// Enumeration for parameter \f$N_\text{ANRep}\f$ \ref PUCCH_CONFIG_DEDICATED::repetitionFactor.
......
......@@ -125,10 +125,6 @@
#define FIRST_CARRIER_OFFSET (HALF_NUMBER_OF_USEFUL_CARRIERS+NUMBER_OF_ZERO_CARRIERS)
#define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT (NUMBER_OF_SYMBOLS_PER_FRAME/LTE_SLOTS_PER_FRAME)
#ifdef EMOS
#define EMOS_SCH_INDEX 1
#endif //EMOS
#define EXTENSION_TYPE (PHY_config->PHY_framing.Extension_type)
#define NUMBER_OF_OFDM_CARRIERS_BYTES NUMBER_OF_OFDM_CARRIERS*4
......
......@@ -208,11 +208,12 @@ void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,re
@param phy_vars_eNB Pointer to eNB variables on which to act
@param br_flag indicator for eMTC PRACH
*/
void prach_procedures(PHY_VARS_eNB *eNB,
#ifdef Rel14
int br_flag
void prach_procedures(PHY_VARS_eNB *eNB,
int br_flag);
#else
void prach_procedures(PHY_VARS_eNB *eNB);
#endif
);
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index.
@param frame_parms Pointer to DL frame parameter descriptor
@param subframe Subframe index
......
......@@ -37,11 +37,5 @@ extern int synch_wait_cnt;
extern int16_t hundred_times_delta_TF[100];
extern uint16_t hundred_times_log10_NPRB[100];
/*
#ifdef EMOS
extern fifo_dump_emos_UE emos_dump_UE;
extern fifo_dump_emos_eNB emos_dump_eNB;
#endif
*/
#endif /*__SCHED_EXTERN_H__ */
......@@ -51,6 +51,7 @@ void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,
fill_dci_and_dlsch(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu);
}
#ifdef Rel14
void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
nfapi_dl_config_request_pdu_t *dl_config_pdu)
......@@ -64,6 +65,7 @@ void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,
// copy dci configuration into eNB structure
fill_mdci_and_dlsch(eNB,proc,&mpdcch_vars->mdci_alloc[mpdcch_vars->num_dci],pdu);
}
#endif
void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu)
......@@ -679,10 +681,12 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE:
// handle_nfapi_epdcch_pdu(eNB,dl_config_pdu);
break;
#ifdef Rel14
case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE:
handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu);
eNB->mpdcch_vars[subframe&1].num_dci++;
break;
#endif
}
}
......
......@@ -36,10 +36,6 @@
#include "SCHED/extern.h"
#include "LAYER2/MAC/extern.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
/* SYRTEM */
uint8_t dci_ndi_toggle_even[8] = {0, 0, 0, 0, 0, 0, 0, 0};
uint8_t dci_ndi_toggle_odd[8] = {0, 0, 0, 0, 0, 0, 0, 0};
......@@ -733,181 +729,3 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
}
*/
}
void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB)
{
//uint8_t cooperation_flag = eNB->cooperation_flag;
uint8_t transmission_mode = eNB->transmission_mode[0];
//uint32_t rballoc = 0x00F0;
//uint32_t rballoc2 = 0x000F;
/*
uint32_t rand = taus();
if ((subframe==8) || (subframe==9) || (subframe==0))
rand = (rand%5)+5;
else
rand = (rand%4)+5;
*/
DCI_pdu->Num_dci = 0;
switch (subframe) {
case 5:
DCI_pdu->Num_dci = 1;
if (transmission_mode<3) {
//user 1
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0x1235;
DCI_pdu->dci_alloc[0].format = format1;
DCI_pdu->dci_alloc[0].ra_flag = 0;
DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE;
DLSCH_alloc_pdu.rballoc = eNB->ue_dl_rb_alloc;
DLSCH_alloc_pdu.TPC = 0;
DLSCH_alloc_pdu.dai = 0;
DLSCH_alloc_pdu.harq_pid = 1;
DLSCH_alloc_pdu.mcs = eNB->target_ue_dl_mcs;
DLSCH_alloc_pdu.ndi = 1;
DLSCH_alloc_pdu.rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
DCI_pdu->dci_alloc[1].search_space = DCI_UE_SPACE;
DLSCH_alloc_pdu.rballoc = rballoc2;
DLSCH_alloc_pdu.TPC = 0;
DLSCH_alloc_pdu.dai = 0;
DLSCH_alloc_pdu.harq_pid = 1;
DLSCH_alloc_pdu.mcs = eNB->target_ue_dl_mcs;
DLSCH_alloc_pdu.ndi = 1;
DLSCH_alloc_pdu.rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t));
*/
} else if (transmission_mode==5) {
DCI_pdu->Num_dci = 2;
// user 1
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0x1235;
DCI_pdu->dci_alloc[0].format = format1E_2A_M10PRB;
DCI_pdu->dci_alloc[0].ra_flag = 0;
DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE;
DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback
DLSCH_alloc_pdu1E.rv = 0;
DLSCH_alloc_pdu1E.ndi = 1;
DLSCH_alloc_pdu1E.mcs = eNB->target_ue_dl_mcs;
DLSCH_alloc_pdu1E.harq_pid = 1;
DLSCH_alloc_pdu1E.dai = 0;
DLSCH_alloc_pdu1E.TPC = 0;
DLSCH_alloc_pdu1E.rballoc = eNB->ue_dl_rb_alloc;
DLSCH_alloc_pdu1E.rah = 0;
DLSCH_alloc_pdu1E.dl_power_off = 0; //0=second user present
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
//user 2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1E_2A_M10PRB;
DCI_pdu->dci_alloc[1].ra_flag = 0;
DCI_pdu->dci_alloc[1].search_space = DCI_UE_SPACE;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
// set the precoder of the second UE orthogonal to the first
eNB->UE_stats[1].DL_pmi_single = (eNB->UE_stats[0].DL_pmi_single ^ 0x1555);
}
break;
case 7:
DCI_pdu->Num_dci = 1;
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0xbeef;
DCI_pdu->dci_alloc[0].format = format1A;
DCI_pdu->dci_alloc[0].ra_flag = 1;
DCI_pdu->dci_alloc[0].search_space = DCI_COMMON_SPACE;
RA_alloc_pdu.type = 1;
RA_alloc_pdu.vrb_type = 0;
RA_alloc_pdu.rballoc = computeRIV(25,12,3);
RA_alloc_pdu.ndi = 1;
RA_alloc_pdu.rv = 1;
RA_alloc_pdu.mcs = 4;
RA_alloc_pdu.harq_pid = 0;
RA_alloc_pdu.TPC = 1;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&RA_alloc_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
break;
case 9:
DCI_pdu->Num_dci = 1;
//user 1
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0x1235;
DCI_pdu->dci_alloc[0].format = format0;
DCI_pdu->dci_alloc[0].ra_flag = 0;
DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE;
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
UL_alloc_pdu.rballoc = computeRIV(25,0,eNB->ue_ul_nb_rb);
UL_alloc_pdu.mcs = eNB->target_ue_ul_mcs;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.TPC = 0;
UL_alloc_pdu.cshift = 0;
UL_alloc_pdu.dai = 0;
UL_alloc_pdu.cqi_req = 1;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
/*
//user 2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format0;
DCI_pdu->dci_alloc[1].ra_flag = 0;
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
if (cooperation_flag==0)
UL_alloc_pdu.rballoc = computeRIV(25,2+eNB->ue_ul_nb_rb,eNB->ue_ul_nb_rb);
else
UL_alloc_pdu.rballoc = computeRIV(25,0,eNB->ue_ul_nb_rb);
UL_alloc_pdu.mcs = eNB->target_ue_ul_mcs;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.TPC = 0;
if ((cooperation_flag==0) || (cooperation_flag==1))
UL_alloc_pdu.cshift = 0;
else
UL_alloc_pdu.cshift = 1;
UL_alloc_pdu.dai = 0;
UL_alloc_pdu.cqi_req = 1;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
*/
break;
default:
break;
}
/*
DCI_pdu->nCCE = 0;
for (i=0; i<DCI_pdu->Num_dci; i++) {
DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
}
*/
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef __PHY_PROCEDURES_EMOS_H__
#define __PHY_PROCEDURES_EMOS_H__
/*
#ifndef RTAI
typedef uint64_t RTIME;
#else
*/
#ifdef RTAI
#include <rtai.h>
#include <rtai_fifos.h>
#endif
//#include "PHY/TOOLS/defs.h"
#include "PHY/defs.h"
#define CHANSOUNDER_FIFO_SIZE 10485760 // 10 Mbytes FIFO
//#define CHANSOUNDER_FIFO_SIZE 20971520 // 20 Mbytes FIFO
#define CHANSOUNDER_FIFO_MINOR 4 // minor of the FIFO device - this is /dev/rtf3
#define CHANSOUNDER_FIFO_DEV "/dev/rtf4"
#define NUMBER_OF_OFDM_CARRIERS_EMOS 512 // the number of OFDM carriers used for channel sounding
#define NUMBER_OF_USEFUL_CARRIERS_EMOS 300 // the number of OFDM carriers that contain data
#define N_RB_UL_EMOS 25
#define N_PILOTS_DL_EMOS 2 // ofdm symbols with pilots per slot
#define N_PILOTS_UL_EMOS 2 // ofdm symbols with pilots per subframe
#define N_SLOTS_DL_EMOS 2 // we take slots 14,15
#define N_SUBFRAMES_UL_EMOS 1 // we take subframes 4
#define NB_ANTENNAS_TX_EMOS 2
#define NB_ANTENNAS_RX_EMOS 2
struct fifo_dump_emos_struct_UE {
// RX
uint64_t timestamp; //! Timestamp of the receiver
unsigned int frame_tx; //! Framenumber of the TX (encoded in the BCH)
unsigned int frame_rx; //! Framenumber of the RX
UE_MODE_t UE_mode;
PHY_MEASUREMENTS PHY_measurements; //! Structure holding all PHY measurements (one for every slot)
unsigned int pbch_errors; /// Total number of errors on PBCH
unsigned int pbch_errors_last; /// Total number of errors on PBCH 100 frames ago
unsigned int pbch_errors_conseq; /// Total number of consecutive errors on PBCH
unsigned int pbch_fer; /// PBCH FER (in percent)
unsigned int dlsch_errors; /// Total number of error on the DLSCH (data)
unsigned int dlsch_errors_last;
unsigned int dlsch_received;
unsigned int dlsch_received_last;
unsigned int dlsch_fer;
unsigned int dlsch_cntl_errors; /// Total number of error on the DLSCH (control)
unsigned int dlsch_ra_errors; /// Total number of error on the DLSCH (random access)
unsigned int total_TBS;
unsigned int total_TBS_last;
unsigned int bitrate;
unsigned int total_received_bits;
int timing_offset; /// Timing offset
int timing_advance; /// Timing advance
int freq_offset; /// Frequency offset
int use_ia_receiver;
unsigned short pmi_saved;
unsigned short mcs;
unsigned int rx_total_gain_dB; /// Total gain
unsigned char eNb_id; /// eNb_id UE is synched to
unsigned char mimo_mode; /// Transmission mode
#ifdef EMOS_CHANNEL
int channel[NB_ANTENNAS_RX_EMOS][NB_ANTENNAS_TX_EMOS][NUMBER_OF_OFDM_CARRIERS_EMOS*N_PILOTS_DL_EMOS*N_SLOTS_DL_EMOS];
#endif
};
typedef struct fifo_dump_emos_struct_UE fifo_dump_emos_UE;
struct fifo_dump_emos_struct_eNB {
// TX
uint64_t timestamp; //! Timestamp of the receiver
unsigned int frame_tx; //! Framenumber of the TX
unsigned char mimo_mode; /// Transmission mode
// RX
PHY_MEASUREMENTS_eNB PHY_measurements_eNB; /// UL measurements
LTE_eNB_UE_stats eNB_UE_stats[NUMBER_OF_UE_MAX]; /// Contains received feedback
unsigned int rx_total_gain_dB; /// Total gain
#ifdef EMOS_CHANNEL
int channel[NB_ANTENNAS_RX_EMOS][N_RB_UL_EMOS*12*N_PILOTS_UL_EMOS*N_SUBFRAMES_UL_EMOS]; ///UL channel estimate
#endif
};
typedef struct fifo_dump_emos_struct_eNB fifo_dump_emos_eNB;
#endif
......@@ -547,11 +547,12 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
}
void prach_procedures(PHY_VARS_eNB *eNB,
#ifdef Rel14
int br_flag
void prach_procedures(PHY_VARS_eNB *eNB,
int br_flag) {
#else
void prach_procedures(PHY_VARS_eNB *eNB) {
#endif
) {
uint16_t max_preamble[4],max_preamble_energy[4],max_preamble_delay[4];
uint16_t i;
int frame,subframe;
......
......@@ -51,10 +51,6 @@
#include "LAYER2/MAC/defs.h"
#include "UTIL/LOG/log.h"
#ifdef EMOS
fifo_dump_emos_UE emos_dump_UE;
#endif
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
......@@ -1194,38 +1190,6 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
}
#ifdef EMOS
/*
void phy_procedures_emos_UE_TX(uint8_t next_slot,uint8_t eNB_id) {
uint8_t harq_pid;
if (next_slot%2==0) {
// get harq_pid from subframe relationship
harq_pid = subframe2harq_pid(&ue->frame_parms,ue->frame,(next_slot>>1));
if (harq_pid==255) {
LOG_E(PHY,"[UE%d] Frame %d : FATAL ERROR: illegal harq_pid, returning\n",
0,ue->frame);
return;
}
if (ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag == 1) {
emos_dump_UE.uci_cnt[next_slot>>1] = 1;
memcpy(emos_dump_UE.UCI_data[0][next_slot>>1].o,ulsch[eNB_id]->o,MAX_CQI_BITS*sizeof(char));
emos_dump_UE.UCI_data[0][next_slot>>1].O = ulsch[eNB_id]->O;
memcpy(emos_dump_UE.UCI_data[0][next_slot>>1].o_RI,ulsch[eNB_id]->o_RI,2*sizeof(char));
emos_dump_UE.UCI_data[0][next_slot>>1].O_RI = ulsch[eNB_id]->O_RI;
memcpy(emos_dump_UE.UCI_data[0][next_slot>>1].o_ACK,ulsch[eNB_id]->o_ACK,4*sizeof(char));
emos_dump_UE.UCI_data[0][next_slot>>1].O_ACK = ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK;
}
else {
emos_dump_UE.uci_cnt[next_slot>>1] = 0;
}
}
}
*/
#endif
void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empty_subframe) {
int aa;
......@@ -1425,9 +1389,6 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->prach_cnt=0;
#ifdef SMBV
ue->prach_resources[eNB_id]->ra_PreambleIndex = 19;
#endif
#ifdef OAI_EMU
ue->prach_PreambleIndex=ue->prach_resources[eNB_id]->ra_PreambleIndex;
#endif
LOG_I(PHY,"mode %d\n",mode);
......@@ -1835,12 +1796,6 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
}
}
#ifdef PHY_ABSTRACTION
else {
ulsch_encoding_emul(ulsch_input_buffer,ue,eNB_id,proc->subframe_rx,harq_pid,0);
}
#endif
#if UE_TIMING_TRACE
stop_meas(&ue->ulsch_encoding_stats);
#endif
......@@ -2391,10 +2346,6 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
start_meas(&ue->phy_proc_tx);
#endif
#ifdef EMOS
//phy_procedures_emos_UE_TX(next_slot);
#endif
ue->tx_power_dBm[subframe_tx]=-127;
......@@ -2675,11 +2626,6 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
}
#ifdef EMOS
//emos_dump_UE.frame_tx = frame_tx;
//emos_dump_UE.mimo_mode = ue->pbch_vars[eNB_id]->decoded_output[1];
#endif
if (first_run) {
first_run = 0;
......@@ -4677,11 +4623,6 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr
}
#ifdef EMOS
phy_procedures_emos_UE_RX(ue,slot,eNB_id);
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
#if UE_TIMING_TRACE
......@@ -5161,11 +5102,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,
printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0));
#endif
#ifdef EMOS
phy_procedures_emos_UE_RX(ue,slot,eNB_id);
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
#if UE_TIMING_TRACE
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/* Header file for making PLATON work on both RTLinux and RTAI using pthreads
* Copyright Frank Wartena, 2004
* Version: 0.1 January 28th, 2004 ## First version for scheduling test
* 0.2 February 20th, 2004 ## All PLATON functions added
* It is mostly a conversion from RTLinux to RTAI, because PLATON was written
* for RTLinux.
* Not all necessary conversions can be done in this header file, other
* adjustments in the code are also necessary.
*/
#ifndef _RT_COMPAT_H_
#define _RT_COMPAT_H_
#ifdef RTAI_ENABLED
//the conversions from RTLinux to RTAI
//variable for containing times
#define hrtime_t RTIME
//function for making a thread periodic
#define pthread_make_periodic_np(x,y,z) rt_task_make_periodic(x,rt_get_time(),nano2count(z))
//function for printing to the kernel log
#define rtl_printf printk
//function for determining the current cpu
#define rtl_getcpuid hard_cpu_id
//function for initialising a mutex
#define pthread_mutex_init pthread_mutex_init_rt
//function for initialising a mutex attribute
#define pthread_mutexattr_init pthread_mutexattr_init_rt
//function for setting a mutex protocol, does not exist in RTAI
#define pthread_mutexattr_setprotocol(x,y);
//function for locking a mutex
#define pthread_mutex_lock pthread_mutex_lock_rt
//function for unlocking a mutex
#define pthread_mutex_unlock pthread_mutex_unlock_rt
//function for destroying a mutex
#define pthread_mutex_destroy pthread_mutex_destroy_rt
//function for getting the current time
#define clock_gethrtime(x) rt_get_time_ns()
#define gethrtime rt_get_time_ns
//function for initialising a condition
#define pthread_cond_init pthread_cond_init_rt
//function for waiting on a condition
#define pthread_cond_wait pthread_cond_wait_rt
//function for signalling a condition
#define pthread_cond_signal pthread_cond_signal_rt
//function for destroying a condition
#define pthread_cond_destroy pthread_cond_destroy_rt
//function for waking up a thread
#define pthread_wakeup_np rt_task_resume
//function for getting the current thread
#define pthread_self rt_whoami
//function for initialising an attribute
#define pthread_attr_init pthread_attr_init_rt
//function for setting a schedparam
#define pthread_attr_setschedparam pthread_attr_setschedparam_rt
//funcion for setting a schedpolicy
#define pthread_attr_setschedpolicy pthread_attr_setschedpolicy_rt
//function for creating a thread
#define pthread_create pthread_create_rt
//function for cancelling a thread
#define pthread_cancel pthread_cancel_rt
//function for deleting a thread, in RTAI both by calling cancel
#define pthread_delete_np pthread_cancel_rt
//testing if a cpuid exists
#define rtl_cpu_exists(x) x<NR_RT_CPUS
//function for flushing a fifo does not exist in RTAI
#define rtf_flush(x);
//function for setting the stacksize
#define pthread_attr_setstacksize pthread_attr_setstacksize_rt
//function for sleeping the indicated amount in nanoseconds
//#define rtl_delay(x) rt_sleep(nano2count(x))
//#define udelay(x) rt_sleep(nano2count(1000*x))
//#define usleep(x) rt_sleep(nano2count(1000*x))
#define pthread_exit pthread_exit_rt
//function for indicating that a thread uses the FPU
#define pthread_setfp_np rt_task_use_fpu
//function for freeing a soft irq
#define rtl_free_soft_irq(x) rt_free_linux_irq(x,NULL)
//function for triggering a soft irq
#define rtl_global_pend_irq rt_pend_linux_irq
//function for setting the thread scheduling, does not exist in RTAI
#define pthread_setschedparam(x,y,z);
#endif /* RTAI_ENABLED */
#endif /* _RT_COMPAT_H_ */
......@@ -38,10 +38,6 @@
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
#include "UTIL/LOG/log.h"
......
include $(OPENAIR_DIR)/common/utils/Makefile.inc
COMMON_UTILS_DIR = $(OPENAIR_DIR)/common/utils
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -DMAX_NUM_CCs=1 -Wall -DPHYSIM -DNODE_RG -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -DMALLOC_CHECK_=1 -DENABLE_VCD_FIFO -DLOG_NO_THREAD # -Wno-packed-bitfield-compat
# enable C99 mode
CFLAGS += -std=gnu99
# DCI Debug
# CFLAGS += -DDEBUG_DCI_ENCODING
# TODO: only for framegen
#CFLAGS += -DOPENAIR2
#CFLAGS += -DDEBUG_PHY_PROC
#CFLAGS += -DDEBUG_GROUPHOP
ifdef OMP
CFLAGS += -DOMP -fopenmp
endif
ifdef LLR8
CFLAGS += -DLLR8
endif
CFLAGS += -DNEW_FFT
LFLAGS = -lm -lblas -lxml2 -lrt -lpthread $(LFDS_DIR)/bin/liblfds611.a
ifdef GPIB
LFLAGS += -lgpib
endif
CFLAGS += -DOPENAIR_LTE #-DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef MU_RECEIVER
CFLAGS += -DMU_RECEIVER
endif
ifdef ZBF_ENABLED
CFLAGS += -DNULL_SHAPE_BF_ENABLED
endif
ifdef RANDOM_BF
CFLAGS += -DRANDOM_BF
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef SMBV
CFLAGS += -DSMBV
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
ifdef BIT8_TX
CFLAGS += -DBIT8_TX
endif
CFLAGS += -DNO_RRM -DOPENAIR1 -DPHY_ABSTRACTION #-DOPENAIR2
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
ifdef RTAI
CFLAGS += -DRTAI_ENABLED -D__IN_RTAI__ $(shell rtai-config --lxrt-cflags)
LFLAGS += $(shell rtai-config --lxrt-ldflags) -llxrt
endif
include $(COMMON_UTILS_DIR)/Makefile.inc
include $(TOP_DIR)/PHY/Makefile.inc
include $(TOP_DIR)/SCHED/Makefile.inc
include $(TOP_DIR)/SIMULATION/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
#LOG_OBJS += $(LOG_DIR)/vcd_signal_dumper.o
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR2_DIR) -I$(OPENAIR3) $(UTIL_incl) $(UTILS_incl)
# EXTRA_CFLAGS =
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
#LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS) $(ITTI_DIR)/backtrace.o
ifdef GPIB
OBJ += LTE_Configuration.o
endif
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
ifdef XFORMS
OBJ += $(OPENAIR1_DIR)/PHY/TOOLS/lte_phy_scope.o
endif
ifdef STATIC
LFLAGS += -static -L/usr/lib/libblas
endif
all: dlsim pbchsim pdcchsim ulsim pucchsim prachsim mbmssim scansim
$(LFDS_DIR)/bin/liblfds611.a:
$(MAKE) -C $(LFDS_DIR) -f makefile.linux
test: $(SIMULATION_OBJS) $(TOOLS_OBJS) $(TOP_DIR)/PHY/INIT/lte_init.o test.c
$(CC) test.c -I$(TOP_DIR) -o test $(CFLAGS) $(SIMULATION_OBJS) $(TOOLS_OBJS) -lm
OBJ += $(LIST_OBJ)
OBJ += $(MEM_OBJ)
$(OBJ) : %.o : %.c
@echo Compiling $< ...
@$(CC) -c $(CFLAGS) -o $@ $<
dlsim : $(OBJ) dlsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling dlsim.c ..."
@$(CC) dlsim.c -o dlsim $(CFLAGS) $(OBJ) $(LFLAGS)
dlsim2 : $(OBJ) dlsim2.c
@echo "Compiling dlsim2.c ..."
@$(CC) dlsim2.c -o dlsim2 $(CFLAGS) $(OBJ) $(LFLAGS)
framegen: $(OBJ) framegen.c
@echo "Compiling framegen.c"
@$(CC) framegen.c -o framegen $(CFLAGS) $(OBJ) $(LFLAGS)
pbchsim : $(OBJ) pbchsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling pbchsim.c"
@$(CC) pbchsim.c -o pbchsim $(CFLAGS) $(OBJ) $(LFLAGS)
scansim : $(OBJ) scansim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling scansim.c"
@$(CC) scansim.c -o scansim $(CFLAGS) $(OBJ) $(LFLAGS)
mbmssim : $(OBJ) mbmssim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling mbmssim.c"
@$(CC) mbmssim.c -o mbmssim $(CFLAGS) $(OBJ) $(LFLAGS)
pdcchsim : $(OBJ) pdcchsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling pdcchsim.c"
@$(CC) pdcchsim.c -o pdcchsim $(CFLAGS) $(OBJ) $(LFLAGS)
pucchsim : $(OBJ) pucchsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling pucchsim.c"
@$(CC) pucchsim.c -o pucchsim $(CFLAGS) $(OBJ) $(LFLAGS)
prachsim : $(OBJ) prachsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling prachsim.c"
@$(CC) prachsim.c -o prachsim $(CFLAGS) $(OBJ) $(LFLAGS)
ulsim : $(OBJ) ulsim.c $(LFDS_DIR)/bin/liblfds611.a #ulsim_form.c
@echo "Compiling [ulsim.c]"
@$(CC) ulsim.c -o ulsim $(CFLAGS) $(OBJ) $(LFLAGS)
syncsim : $(OBJ) syncsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling syncsim.c"
@$(CC) syncsim.c -o syncsim $(CFLAGS) $(OBJ) $(LFLAGS)
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f dlsim pbchsim pdcchsim ulsim pucchsim mbmssim prachsim
rm -f *.exe*
showflags :
@echo $(CFLAGS)
@echo $(LFLAGS)
showobj:
@echo $(SCHED_OBJS)
cppcheck:
@echo "cppcheck ..."
cppcheck $(INCLUDES) ${OBJ:.o=.c} ${OAISIM_OBJS,.o=.c} ${ASN1_RRC_MSG_OBJS1,.o=.c}
......@@ -31,9 +31,6 @@
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
......
......@@ -32,9 +32,6 @@
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
......@@ -91,9 +88,6 @@ int main(int argc, char **argv)
uint8_t extended_prefix_flag=0;
int8_t interf1=-21,interf2=-21;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
FILE *input_fd=NULL,*pbch_file_fd=NULL;
char input_val_str[50],input_val_str2[50];
......
......@@ -28,9 +28,6 @@
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
......
......@@ -27,9 +27,6 @@
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
......@@ -76,10 +73,6 @@ int main(int argc, char **argv)
uint8_t extended_prefix_flag=0;
// int8_t interf1=-19,interf2=-19;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
SCM_t channel_model=Rayleigh1;
......
......@@ -27,9 +27,6 @@
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
......@@ -77,9 +74,6 @@ int main(int argc, char **argv)
uint8_t extended_prefix_flag=0;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
SCM_t channel_model=Rayleigh1_corr;
......
......@@ -33,9 +33,6 @@
#include "PHY/vars.h"
#include "MAC_INTERFACE/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
......@@ -91,9 +88,6 @@ int main(int argc, char **argv)
uint32_t nsymb,tx_lev,tx_lev1,tx_lev2;
uint8_t extended_prefix_flag=0;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
FILE *input_fd=NULL,*pbch_file_fd=NULL;
char input_val_str[50],input_val_str2[50];
......
......@@ -30,11 +30,6 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
#ifdef RTAI_ENABLED
#include <rtai_mbx.h>
#include <rtai_msg.h>
#endif
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
#include "PHY/types.h"
......@@ -44,9 +39,6 @@
#ifdef IFFT_FPGA
#include "PHY/LTE_REFSIG/mod_table.h"
#endif
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/vars.h"
......@@ -381,9 +373,6 @@ int main(int argc, char **argv)
uint8_t extended_prefix_flag=0,frame_type=1;
int8_t interf1=-21,interf2=-21;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
FILE *input_fd=NULL,*pbch_file_fd=NULL;
char input_val_str[50],input_val_str2[50];
......@@ -430,13 +419,6 @@ int main(int argc, char **argv)
int rx_offset_mod;
#ifdef RTAI_ENABLED
int period;
RTIME expected;
RT_TASK *task;
#define PERIOD 1000000000
#endif
logInit();
number_of_cards = 1;
......@@ -694,23 +676,6 @@ int main(int argc, char **argv)
}
}
#ifdef RTAI_ENABLED
if (!(task = rt_task_init_schmod(nam2num("SYNCSIM"), 0, 0, 0, SCHED_FIFO, 0xF))) {
printf("CANNOT INIT MASTER TASK\n");
exit(1);
}
rt_set_periodic_mode();
period = start_rt_timer(nano2count(PERIOD));
mlockall(MCL_CURRENT | MCL_FUTURE);
rt_make_hard_real_time();
rt_task_make_periodic(task, expected = rt_get_time() + 10*period, period);
#endif
#ifdef XFORMS
if (do_forms==1) {
......@@ -1374,11 +1339,6 @@ int main(int argc, char **argv)
for (trial=0; trial<n_frames; trial++) {
#ifdef RTAI_ENABLED
ret = rt_task_wait_period();
printf("rt_task_wait_period() returns %d, time %llu\n",ret, rt_get_time());
#endif
if (oai_hw_input == 0) {
if (awgn_flag == 0) {
......@@ -1752,11 +1712,6 @@ int main(int argc, char **argv)
ioctl(openair_fd,openair_START_TX_SIG,(void *)NULL);
}
#ifdef RTAI_ENABLED
rt_make_soft_real_time();
rt_task_delete(task);
#endif
#ifdef XFORMS
if (do_forms==1) {
......
......@@ -30,9 +30,6 @@
#ifdef IFFT_FPGA
#include "PHY/LTE_REFSIG/mod_table.h"
#endif
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#define BW 10.0
#define Td 1.0
......@@ -69,12 +66,6 @@ int main(int argc, char **argv)
double ip =0.0;
double N0W, path_loss, path_loss_dB;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
if (argc>1)
sigma2_dB = atoi(argv[1]);
......
......@@ -21,11 +21,6 @@
#include <time.h>
#include <stdlib.h>
#ifdef RTAI_ENABLED
#include <rtai.h>
#include <rtai_sched.h>
#define time(x) (unsigned int)(rt_get_time_ns())
#endif
unsigned int s0, s1, s2, b;
......
......@@ -244,9 +244,7 @@ typedef struct {
LCHAN_DESC Lchan_desc[2]; /*!< \brief Logical Channel QoS Descriptor (MAC component) */
uint8_t L3_info_type;
uint8_t L3_info[16];
//#ifndef CELLULAR
unsigned short UE_eNB_index;
//#endif
} __attribute__ ((__packed__)) MAC_CONFIG_REQ;
#define MAC_CONFIG_REQ_SIZE sizeof(MAC_CONFIG_REQ)
......@@ -314,18 +312,12 @@ typedef struct {
#ifndef OPENAIR2_IN
#ifndef CELLULAR
//#include "L3_rrc_defs.h"
#endif
typedef struct { //RRC_INTERFACE_FUNCTIONS
unsigned int Frame_index;
unsigned short UE_index[NB_MODULES_MAX][NB_SIG_CNX_UE];
uint8_t eNB_id[NB_MODULES_MAX][NB_CNX_UE];
#ifndef CELLULAR
// L2_ID UE_id[NB_MODULES_MAX][NB_CNX_CH];
uint8_t UE_id[NB_MODULES_MAX][NB_CNX_CH][5];
#endif
void (*openair_rrc_top_init)(void);
char (*openair_rrc_eNB_init)(uint8_t );
char (*openair_rrc_UE_init)(uint8_t, uint8_t);
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef __openair_TYPES_H__
#define __openair_TYPES_H__
#endif /*__openair_TYPES_H__ */
......@@ -30,7 +30,9 @@
#ifndef __PLATFORM_TYPES_H__
# define __PLATFORM_TYPES_H__
#if !defined(NAS_NETLINK)
#include <stdint.h>
#endif
#if defined(ENABLE_ITTI)
#include "itti_types.h"
......@@ -269,29 +271,5 @@ typedef struct protocol_ctxt_s {
(CTXT_Pp)->module_id, \
(CTXT_Pp)->rnti
#ifdef OAI_EMU
#define CHECK_CTXT_ARGS(CTXT_Pp) \
if ((CTXT_Pp)->enb_flag) {\
AssertFatal (((CTXT_Pp)->module_id >= oai_emulation.info.first_enb_local) && (oai_emulation.info.nb_enb_local > 0),\
"eNB module id is too low (%u/%d/%d)!\n",\
(CTXT_Pp)->module_id,\
oai_emulation.info.first_enb_local,\
oai_emulation.info.nb_enb_local);\
AssertFatal (((CTXT_Pp)->module_id < (oai_emulation.info.first_enb_local + oai_emulation.info.nb_enb_local)) && (oai_emulation.info.nb_enb_local > 0),\
"eNB module id is too high (%u/%d)!\n",\
(CTXT_Pp)->module_id,\
oai_emulation.info.first_enb_local + oai_emulation.info.nb_enb_local);\
} else {\
AssertFatal ((CTXT_Pp)->module_id < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local),\
"UE module id is too high (%u/%d)!\n",\
(CTXT_Pp)->module_id,\
oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local);\
AssertFatal ((CTXT_Pp)->module_id >= oai_emulation.info.first_ue_local,\
"UE module id is too low (%u/%d)!\n",\
(CTXT_Pp)->module_id,\
oai_emulation.info.first_ue_local);\
}
#else
#define CHECK_CTXT_ARGS(CTXT_Pp)
#endif
#endif
......@@ -20,13 +20,13 @@
*/
#ifndef _RTOS_HEADER_H_
# define _RTOS_HEADER_H_
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <math.h>
# include <pthread.h>
# include <assert.h>
# define rtf_get read
# define rtf_put write
#define _RTOS_HEADER_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <pthread.h>
#include <assert.h>
#define rtf_get read
#define rtf_put write
#endif
......@@ -36,10 +36,6 @@
#include "common/ran_context.h"
#include "log.h"
#if defined(OAI_EMU)
# include "OCG.h"
# include "OCG_extern.h"
#endif
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
......@@ -215,9 +211,6 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
uint32_t register_enb_pending = 0;
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
# if defined(OAI_EMU)
if (oai_emulation.info.cli_start_enb[enb_id] == 1)
# endif
{
s1ap_register_enb_req_t *s1ap_register_eNB;
......@@ -310,19 +303,6 @@ void *eNB_app_task(void *args_p)
if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_eNB()==0,"could not initialize L1 north interface\n");
# if defined(ENABLE_ITTI)
# if defined(OAI_EMU)
enb_nb = oai_emulation.info.nb_enb_local;
enb_id_start = oai_emulation.info.first_enb_local;
enb_id_end = oai_emulation.info.first_enb_local + enb_nb;
AssertFatal (enb_id_end <= NUMBER_OF_eNB_MAX,
"Last eNB index is greater or equal to maximum eNB index (%d/%d)!",
enb_id_end, NUMBER_OF_eNB_MAX);
# endif
# endif
AssertFatal (enb_nb <= RC.nb_inst,
"Number of eNB is greater than eNB defined in configuration file (%d/%d)!",
enb_nb, RC.nb_inst);
......@@ -396,16 +376,6 @@ void *eNB_app_task(void *args_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);
# if defined(OAI_EMU)
/* Also inform all NAS UE tasks */
for (instance = NB_eNB_INST + oai_emulation.info.first_ue_local;
instance < (NB_eNB_INST + oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local); instance ++) {
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_NAS_UE, instance, msg_init_p);
}
# endif
} else {
uint32_t not_associated = enb_nb - registered_enb;
......
......@@ -36,10 +36,6 @@
#include "enb_config.h"
#include "UTIL/OTG/otg.h"
#include "UTIL/OTG/otg_externs.h"
#if defined(OAI_EMU)
# include "OCG.h"
# include "OCG_extern.h"
#endif
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
......
......@@ -54,10 +54,6 @@ SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_reassembly.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_receiver.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_dar.c
ifeq ($(OPENAIR_EMU),1)
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_very_simple_test.c
endif
SOURCES_L2 += $(RLC_DIR)/rlc_mac.c
SOURCES_L2 += $(RLC_DIR)/rlc.c
SOURCES_L2 += $(RLC_DIR)/rlc_rrc.c
......
......@@ -61,10 +61,7 @@
# include "gtpv1u.h"
#endif
#ifndef OAI_EMU
extern int otg_enabled;
#endif
//-----------------------------------------------------------------------------
/*
......@@ -436,11 +433,6 @@ pdcp_data_ind(
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND,VCD_FUNCTION_IN);
#ifdef OAI_EMU
CHECK_CTXT_ARGS(ctxt_pP);
#endif
#ifdef PDCP_MSG_PRINT
int i=0;
LOG_F(PDCP,"[MSG] PDCP UL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP);
......@@ -688,49 +680,6 @@ pdcp_data_ind(
payload_offset=0;
}
#if defined(OAI_EMU)
if (oai_emulation.info.otg_enabled == 1) {
//unsigned int dst_instance;
int ctime;
if ((pdcp_p->rlc_mode == RLC_MODE_AM)&&(MBMS_flagP==0) ) {
pdcp_p->last_submitted_pdcp_rx_sn = sequence_number;
}
#if defined(DEBUG_PDCP_PAYLOAD)
rlc_util_print_hex_octets(PDCP,
(unsigned char*)&sdu_buffer_pP->data[payload_offset],
sdu_buffer_sizeP - payload_offset);
#endif
ctime = oai_emulation.info.time_ms; // avg current simulation time in ms : we may get the exact time through OCG?
if (MBMS_flagP == 0){
LOG_D(PDCP,
PROTOCOL_PDCP_CTXT_FMT"Check received buffer : (dst %d)\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p),
ctxt_pP->instance);
}
if (otg_rx_pkt(
ctxt_pP->instance,
ctime,
(const char*)(&sdu_buffer_pP->data[payload_offset]),
sdu_buffer_sizeP - payload_offset ) == 0 ) {
free_mem_block(sdu_buffer_pP, __func__);
if (ctxt_pP->enb_flag) {
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].data_ind);
} else {
stop_meas(&UE_pdcp_stats[ctxt_pP->module_id].data_ind);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND,VCD_FUNCTION_OUT);
return TRUE;
}
}
#else
if (otg_enabled==1) {
LOG_D(OTG,"Discarding received packed\n");
free_mem_block(sdu_buffer_pP, __func__);
......@@ -745,9 +694,6 @@ pdcp_data_ind(
return TRUE;
}
#endif
// XXX Decompression would be done at this point
/*
......@@ -806,22 +752,15 @@ 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(OAI_EMU)
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id + oai_emulation.info.nb_enb_local - oai_emulation.info.first_ue_local;
#else
# if defined(ENABLE_USE_MME)
#if defined(ENABLE_USE_MME)
/* 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
*/
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 1;
# endif
#endif
} else {
((pdcp_data_ind_header_t*) new_sdu_p->data)->rb_id = rb_id + (ctxt_pP->module_id * maxDRB);
#if defined(OAI_EMU)
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id - oai_emulation.info.first_enb_local;
#endif
}
#ifdef DEBUG_PDCP_FIFO_FLUSH_SDU
static uint32_t pdcp_inst = 0;
......@@ -978,11 +917,6 @@ pdcp_run (
itti_send_msg_to_task(TASK_MAC_ENB, 3, msg_resp_p);
}
# endif
#endif
#if defined(OAI_EMU)
pdcp_fifo_read_input_sdus_from_otg(ctxt_pP);
#endif
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
......
......@@ -33,9 +33,7 @@
#define PDCP_DEBUG 1
//#define DEBUG_PDCP_FIFO_FLUSH_SDU
#ifndef OAI_EMU
extern int otg_enabled;
#endif
#include "pdcp.h"
#include "pdcp_primitives.h"
......@@ -162,11 +160,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
threadname, ctxt_pP->frame, ctxt_pP->subframe,
((pdcp_data_ind_header_t*) sdu_p->data)->inst,
((pdcp_data_ind_header_t *) sdu_p->data)->data_size);
#else
#if ! defined(OAI_EMU)
/* TODO: do we have to reset to 0 or not? not for a scenario with 1 UE at least */
// ((pdcp_data_ind_header_t *)(sdu_p->data))->inst = 0;
#endif
#endif
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
......@@ -547,29 +540,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
nas_nlh_rx->nlmsg_len - sizeof(struct nlmsghdr));
#endif
#ifdef OAI_EMU
// overwrite function input parameters, because only one netlink socket for all instances
if (pdcp_read_header_g.inst < oai_emulation.info.nb_enb_local) {
ctxt.frame = ctxt_cpy.frame;
ctxt.enb_flag = ENB_FLAG_YES;
ctxt.module_id = pdcp_read_header_g.inst + oai_emulation.info.first_enb_local;
ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt.module_id ][pdcp_read_header_g.rb_id / maxDRB + oai_emulation.info.first_ue_local];
rab_id = pdcp_read_header_g.rb_id % maxDRB;
} else {
ctxt.frame = ctxt_cpy.frame;
ctxt.enb_flag = ENB_FLAG_NO;
ctxt.module_id = pdcp_read_header_g.inst - oai_emulation.info.nb_enb_local + oai_emulation.info.first_ue_local;
ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
rab_id = pdcp_read_header_g.rb_id % maxDRB;
}
CHECK_CTXT_ARGS(&ctxt);
AssertFatal (rab_id < maxDRB, "RB id is too high (%u/%d)!\n", rab_id, maxDRB);
/*LGpdcp_read_header.inst = (pdcp_read_header_g.inst >= oai_emulation.info.nb_enb_local) ? \
pdcp_read_header_g.inst - oai_emulation.info.nb_enb_local+ NB_eNB_INST + oai_emulation.info.first_ue_local :
pdcp_read_header_g.inst + oai_emulation.info.first_enb_local;*/
#else // OAI_EMU
/* TODO: do we have to reset to 0 or not? not for a scenario with 1 UE at least */
// pdcp_read_header_g.inst = 0;
//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
......@@ -590,9 +560,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
}
#endif
if (ctxt.enb_flag) {
if (rab_id != 0) {
rab_id = rab_id % maxDRB;
......@@ -804,121 +771,8 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP)
module_id_t dst_id; // dst for otg
rb_id_t rb_id;
unsigned int pkt_size=0;
#if defined(OAI_EMU)
module_id_t src_id;
static unsigned int pkt_cnt_enb=0, pkt_cnt_ue=0;
Packet_otg_elt_t *otg_pkt_info=NULL;
int result;
uint8_t pdcp_mode, is_ue=0;
#endif
protocol_ctxt_t ctxt;
// we need to add conditions to avoid transmitting data when the UE is not RRC connected.
#if defined(OAI_EMU)
if (oai_emulation.info.otg_enabled ==1 ) {
// module_id is source id
while ((otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[ctxt_pP->instance]))) != NULL) {
LOG_I(OTG,"Mod_id %d Frame %d Got a packet (%p), HEAD of otg_pdcp_buffer[%d] is %p and Nb elements is %d\n",
ctxt_pP->module_id,
ctxt_pP->frame,
otg_pkt_info,
ctxt_pP->instance,
pkt_list_get_head(&(otg_pdcp_buffer[ctxt_pP->instance])),
otg_pdcp_buffer[ctxt_pP->instance].nb_elements);
//otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id]));
dst_id = (otg_pkt_info->otg_pkt).dst_id; // type is module_id_t
src_id = (otg_pkt_info->otg_pkt).module_id; // type is module_id_t
rb_id = (otg_pkt_info->otg_pkt).rb_id;
is_ue = (otg_pkt_info->otg_pkt).is_ue;
pdcp_mode = (otg_pkt_info->otg_pkt).mode;
// LOG_I(PDCP,"pdcp_fifo, pdcp mode is= %d\n",pdcp_mode);
// generate traffic if the ue is rrc reconfigured state
// if (mac_get_rrc_status(module_id, ctxt_pP->enb_flag, dst_id ) > 2 /*RRC_CONNECTED*/) { // not needed: this test is already done in update_otg_enb
otg_pkt = (unsigned char*) (otg_pkt_info->otg_pkt).sdu_buffer;
pkt_size = (otg_pkt_info->otg_pkt).sdu_buffer_size;
if (otg_pkt != NULL) {
if (is_ue == 0 ) {
PROTOCOL_CTXT_SET_BY_MODULE_ID(
&ctxt,
src_id,
ENB_FLAG_YES,
oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt.module_id][dst_id],
ctxt_pP->frame,
ctxt_pP->subframe,
src_id);
LOG_D(OTG,"[eNB %d] Frame %d sending packet %d from module %d on rab id %d (src %d, dst %d/%x) pkt size %d for pdcp mode %d\n",
ctxt.module_id,
ctxt.frame,
pkt_cnt_enb++,
src_id,
rb_id,
src_id,
dst_id,
oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt.module_id][dst_id],
pkt_size,
pdcp_mode);
result = pdcp_data_req(&ctxt,
SRB_FLAG_NO,
rb_id,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pkt_size,
otg_pkt,
pdcp_mode);
if (result != TRUE) {
LOG_W(OTG,"PDCP data request failed!\n");
}
} else {
//rb_id= eNB_index * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[UE %d] Frame %d: sending packet %d from module %d on rab id %d (src %d/%x, dst %d) pkt size %d\n",
ctxt_pP->module_id,
ctxt_pP->frame,
pkt_cnt_ue++,
ctxt_pP->module_id,
rb_id,
src_id,
pdcp_UE_UE_module_id_to_rnti[ctxt_pP->module_id], // [src_id]
dst_id,
pkt_size);
PROTOCOL_CTXT_SET_BY_MODULE_ID(
&ctxt,
ctxt_pP->module_id, //src_id,
ENB_FLAG_NO,
pdcp_UE_UE_module_id_to_rnti[ctxt_pP->module_id],// [src_id]
ctxt_pP->frame,
ctxt_pP->subframe,
dst_id);
result = pdcp_data_req( &ctxt,
SRB_FLAG_NO,
rb_id,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pkt_size,
otg_pkt,
PDCP_TRANSMISSION_MODE_DATA);
if (result != TRUE) {
LOG_W(OTG,"PDCP data request failed!\n");
}
}
free(otg_pkt);
otg_pkt = NULL;
}
// } //else LOG_D(OTG,"ctxt_pP->frame %d enb %d-> ue %d link not yet established state %d \n", ctxt_pP->frame, eNB_index,dst_id - NB_eNB_INST, mac_get_rrc_status(module_id, ctxt_pP->enb_flag, dst_id - NB_eNB_INST));
}
}
#else
if ((otg_enabled==1) && (ctxt_pP->enb_flag == ENB_FLAG_YES)) { // generate DL traffic
unsigned int ctime=0;
ctime = ctxt_pP->frame * 100;
......@@ -967,6 +821,4 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP)
}
}
}
#endif
}
......@@ -101,13 +101,8 @@ pdcp_netlink_init(
struct sched_param sched_param;
reset_meas(&ip_pdcp_stats_tmp);
#if defined(OAI_EMU)
nb_inst_enb = oai_emulation.info.nb_enb_local;
nb_inst_ue = oai_emulation.info.nb_ue_local;
#else
nb_inst_enb = 1;
nb_inst_ue = 1;
#endif
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
nb_inst_enb = 0;
......@@ -259,24 +254,7 @@ void *pdcp_netlink_thread_fct(void *arg)
}
} else {
pdcp_thread_read_state = 0;
#ifdef OAI_EMU
// LG: new_data_p->pdcp_read_header.inst will contain in fact a module id
if (new_data_p->pdcp_read_header.inst >= oai_emulation.info.nb_enb_local) {
module_id = new_data_p->pdcp_read_header.inst
- oai_emulation.info.nb_enb_local +
+ oai_emulation.info.first_ue_local;
eNB_flag = 0;
} else {
module_id = new_data_p->pdcp_read_header.inst
+ oai_emulation.info.first_enb_local;
eNB_flag = 1;
}
#else
module_id = 0;
#endif
new_data_p->data = malloc(sizeof(uint8_t) * new_data_p->pdcp_read_header.data_size);
/* Copy the data */
memcpy(new_data_p->data, NLMSG_DATA(nas_nlh_rx), new_data_p->pdcp_read_header.data_size);
......
......@@ -110,9 +110,7 @@ int init_pdcp_thread(void)
p.sched_priority = OPENAIR_THREAD_PRIORITY;
pthread_attr_setschedparam (&pdcp_thread_attr, &p);
#ifndef RTAI_ISNT_POSIX
pthread_attr_setschedpolicy (&pdcp_thread_attr, SCHED_FIFO);
#endif
pthread_mutex_init(&pdcp_mutex,NULL);
pthread_cond_init(&pdcp_cond,NULL);
......
......@@ -135,11 +135,6 @@ rlc_op_status_t rlc_stat_req (
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc;
#ifdef OAI_EMU
CHECK_CTXT_ARGS(ctxt_pP)
#endif
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
......@@ -346,11 +341,6 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
#else
AssertFatal(MBMS_flagP == 0, "MBMS_flagP %u", MBMS_flagP);
#endif
#ifdef OAI_EMU
CHECK_CTXT_ARGS(ctxt_pP)
#endif
#if T_TRACER
if (ctxt_pP->enb_flag)
......
......@@ -157,13 +157,6 @@ tbs_size_t mac_rlc_data_req(
AssertFatal (channel_idP < NB_RB_MAX, "channel id is too high (%u/%d)!\n", channel_idP, NB_RB_MAX);
}
#ifdef OAI_EMU
CHECK_CTXT_ARGS(&ctxt);
//printf("MBMS_flagP %d, MBMS_FLAG_NO %d \n",MBMS_flagP, MBMS_FLAG_NO);
// AssertFatal (MBMS_flagP == MBMS_FLAG_NO ," MBMS FLAG SHOULD NOT BE SET IN mac_rlc_data_req in UE\n");
#endif
if (MBMS_flagP) {
if (enb_flagP) {
mbms_id_p = &rlc_mbms_lcid2service_session_id_eNB[module_idP][channel_idP];
......@@ -256,18 +249,6 @@ void mac_rlc_data_ind (
}
#endif // DEBUG_MAC_INTERFACE
#ifdef OAI_EMU
if (MBMS_flagP)
AssertFatal (channel_idP < RLC_MAX_MBMS_LC, "channel id is too high (%u/%d)!\n",
channel_idP, RLC_MAX_MBMS_LC);
else
AssertFatal (channel_idP < NB_RB_MAX, "channel id is too high (%u/%d)!\n",
channel_idP, NB_RB_MAX);
CHECK_CTXT_ARGS(&ctxt);
#endif
#if T_TRACER
if (enb_flagP)
......@@ -347,31 +328,6 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
memset (&mac_rlc_status_resp, 0, sizeof(mac_rlc_status_resp_t));
memset (&tx_status , 0, sizeof(struct mac_status_ind));
#ifdef OAI_EMU
if (MBMS_flagP)
AssertFatal (channel_idP < RLC_MAX_MBMS_LC,
"%s channel id is too high (%u/%d) enb module id %u ue %u!\n",
(enb_flagP) ? "eNB" : "UE",
channel_idP,
RLC_MAX_MBMS_LC,
module_idP,
rntiP);
else
AssertFatal (channel_idP < NB_RB_MAX,
"%s channel id is too high (%u/%d) enb module id %u ue %u!\n",
(enb_flagP) ? "eNB" : "UE",
channel_idP,
NB_RB_MAX,
module_idP,
rntiP);
CHECK_CTXT_ARGS(&ctxt);
#endif
if (MBMS_flagP) {
if (enb_flagP) {
mbms_id_p = &rlc_mbms_lcid2service_session_id_eNB[module_idP][channel_idP];
......
......@@ -33,9 +33,6 @@
#include "rlc_um.h"
#include "rlc_tm.h"
#include "UTIL/LOG/log.h"
#ifdef OAI_EMU
#include "UTIL/OCG/OCG_vars.h"
#endif
#include "RLC-Config.h"
#include "DRB-ToAddMod.h"
#include "DRB-ToAddModList.h"
......@@ -88,12 +85,6 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG REQ ASN1 \n",
PROTOCOL_CTXT_ARGS(ctxt_pP));
#ifdef OAI_EMU
CHECK_CTXT_ARGS(ctxt_pP)
#endif
if (srb2add_listP != NULL) {
for (cnt=0; cnt<srb2add_listP->list.count; cnt++) {
rb_id = srb2add_listP->list.array[cnt]->srb_Identity;
......@@ -489,10 +480,6 @@ rlc_op_status_t rrc_rlc_remove_rlc (
rlc_union_t *rlc_union_p = NULL;
#if defined(Rel10) || defined(Rel14)
rlc_mbms_id_t *mbms_id_p = NULL;
#endif
#ifdef OAI_EMU
CHECK_CTXT_ARGS(ctxt_pP)
#endif
/* for no gcc warnings */
......@@ -597,12 +584,6 @@ rlc_union_t* rrc_rlc_add_rlc (
logical_chan_id_t lcid = 0;
#endif
#ifdef OAI_EMU
CHECK_CTXT_ARGS(ctxt_pP)
#endif
if (MBMS_flagP == FALSE) {
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
AssertFatal (chan_idP < RLC_MAX_LC, "LC id is too high (%u/%d)!\n", chan_idP, RLC_MAX_LC);
......@@ -706,11 +687,6 @@ rlc_op_status_t rrc_rlc_config_req (
PROTOCOL_CTXT_ARGS(ctxt_pP),
rb_idP);
#ifdef OAI_EMU
CHECK_CTXT_ARGS(ctxt_pP)
#endif
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
switch (actionP) {
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*________________________rrc_register.c________________________
Authors : Hicham Anouar, Raymond Knopp
Company : EURECOM
Emails : anouar@eurecom.fr, knopp@eurecom.fr
________________________________________________________________*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include "COMMON/openair_types.h"
#include "MAC/extern.h"
#include <linux/module.h>
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
####################################################
# USER SPACE CODE GENERATION
####################################################
#---------------------------------------------------
#
#---------------------------------------------------
#LM_LICENSE_FILE=
#export LM_LICENSE_FILE
include $(OPENAIR_DIR)/common/utils/Makefile.inc
KERNEL_NAME:=$(shell uname -r)
NUM_CORES=$(shell getconf _NPROCESSORS_CONF)
export SET_UM=$(shell if grep --silent User\ Mode\ Linux /proc/cpuinfo ; then echo "ARCH=um" ; else echo ""; fi)
#SUBDIRS_openair_USERRF = $(MAIN_RT_DIR) $(CONFIG_DIR)
#openair_USERRFDIR = openair_RFOBJS
#openair_USERRFLIBS = $(addsuffix /${openair_USERRFDIR}/Lib.a, ${SUBDIRS_openair_USERRF})
#openair_USERRFOBJS = $(addsuffix /${openair_USERRFDIR}/*.o, ${SUBDIRS_openair_USERRF})
#openair_USERRFDEPS = $(addsuffix /${openair_USERRFDIR}/*.d, ${SUBDIRS_openair_USERRF})
mac_sim_no_netlink:
( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim MASTER=1)
mac_sim:
( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim MASTER=1 NETLINK=1 NO_RRM=1)
mac_sim_rrm:
( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim_rrm MASTER=1 NETLINK=1)
mac_sim_mt_cellular:
( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim_mt CELLULAR=1 NO_RRM=1)
mac_sim_rg_cellular:
( cd SIMULATION/USER_TOOLS/LAYER2_SIM && make mac_sim_rg MASTER=1 CELLULAR=1 NO_RRM=1)
openair_layer2_emul.ko:
(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` NO_RRM=1 PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 PHYEMUL=1 && mv openair_l2.ko openair_layer2.ko)
openair_layer2_emul_rrm.ko:
(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 PHYEMUL=1 && mv openair_l2.ko openair_layer2.ko)
openair_layer2.ko:
(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` NO_RRM=1 PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 OPENAIR1=1 && mv openair_l2.ko openair_layer2.ko)
openair_layer2_rrm.ko:
(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 OPENAIR1=1 && mv openair_l2.ko openair_layer2.ko)
openair_layer2_2615.ko:
(cd LAYER2 && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 MASTER=1 OPEN_AIR=1 OPENAIR1=1 && mv openair_l2.ko openair_layer2_2615.ko)
openair_rrc.ko:
(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 NO_RRM=1 && mv openair_rrc.ko openair_RRC.ko)
openair_rrc_rrm.ko:
(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 && mv openair_rrc.ko openair_RRC.ko)
openair_rrc_2615.ko:
(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 && mv openair_rrc.ko openair_RRC_2615.ko)
openair_rrc_emul.ko:
(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 PHYEMUL=1 NO_RRM=1)
openair_rrc_emul_rrm.ko:
(cd RRC/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 PHYEMUL=1)
openair_emul.ko:
(cd SIMULATION/PHY_EMULATION/DEVICE_DRIVER/ && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1 NO_RRM=1)
openair_emul_rrm.ko:
(cd SIMULATION/PHY_EMULATION/DEVICE_DRIVER/ && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` PCTARGET=1 RTAI=1 OPEN_AIR=1 MASTER=1)
create_device:
rm -f /dev/openair0
mknod /dev/openair0 c 127 0
chmod a+rw /dev/openair0
install_emul:
make devs
make fifos
(insmod SIMULATION/PHY_EMULATION/DEVICE_DRIVER/openair_emul.ko)
(insmod LAYER2/openair_layer2.ko)
(insmod RRC/MESH/openair_rrc.ko)
(insmod NETWORK_DRIVER/MESH/nasmesh.ko)
remove_emul:
rmmod nasmesh
sleep 1
rmmod openair_rrc
sleep 1
rmmod openair_l2
sleep 1
rmmod openair_emul
clean_nasmesh:
(cd NETWORK_DRIVER/MESH && $(MAKE) V=1 -C $(KERNEL_DIR)/build M=`pwd` clean)
nasmesh_address_fix.ko:
(cd NETWORK_DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) V=1 ADDRESS_FIX=1 -C $(KERNEL_DIR)/build M=`pwd`)
nasmesh.ko:
(cd NETWORK_DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) V=1 -C $(KERNEL_DIR)/build M=`pwd`)
# automatically detect the linux header files for driver compilation
nasmesh_netlink.ko:
(cd NETWORK_DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) PDCP_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
naslite_netlink_ether.ko:
(cd NETWORK_DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
oai_nw_ether.ko:
(cd NETWORK_DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
oai_nw_drv.ko:
(cd NETWORK_DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
nasmesh_netlink_address_fix.ko:
(cd NETWORK_DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) PDCP_USE_NETLINK=1 ADDRESS_FIX=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
nasmesh_netlink_loopback.ko:
(cd NETWORK_DRIVER/MESH && $(MAKE) $(SET_UM) PDCP_USE_NETLINK=1 LOOPBACK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
# drivers cellular version
nascellmt_netlink.ko:
(cd NAS/DRIVER/CELLULAR/NASMT && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
nascellmt_clean.ko:
(cd NAS/DRIVER/CELLULAR/NASMT && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` clean)
nascellrg_netlink.ko:
(cd NAS/DRIVER/CELLULAR/NASRG && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
nascellrg_clean.ko:
(cd NAS/DRIVER/CELLULAR/NASRG && $(MAKE) -j$(NUM_CORES) $(SET_UM) NAS_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` clean)
# Driver for UE using LTE core network (MME, S+P-GW)
ue_ip.ko:
(cd NETWORK_DRIVER/UE_IP && $(MAKE) -j$(NUM_CORES) $(SET_UM) PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
rt_emul:
(cd SIMULATION/USER_TOOLS/RT_EMUL_LAUNCHER && $(MAKE))
bypass_phy:
(cd SIMULATION/PHY_EMULATION/TRANSPORT/KERNEL_INTERFACE && $(MAKE))
rb_tool:
(cd NETWORK_DRIVER/MESH/RB_TOOL && $(MAKE))
fifos:
@for i in `seq 0 64`;\
do \
have_rtfX=`ls /dev/ |grep -c rtf$$i`;\
if [ "$$have_rtfX" -eq 0 ] ;then \
mknod -m 666 /dev/rtf$$i c 150 $$i; \
fi;\
done
# cp arch/openair_CardBus_MIMO1/device_driver/openair_rf.ko $(KERNEL_DIR)/openair/
# depmod -aq
devs:
if ! test -a /dev/openair0;\
then \
mknod /dev/openair0 c 127 0;\
chmod a+rw /dev/openair0;\
fi;
load_sounder_ue: install_cbmimo1_ublaze
insmod mac/chansounder/openair_chansounder_ue.ko
load_sounder_nodeb: install_platon
(cd openair_rf && ./openair_rf_platon 1917600 0 ../arch/platon/rbt_files/DAQ_B.rbt 30p 15p 10p 25p && ./openair_rf_platon 1917600 0 ../arch/platon/rbt_files/daq_platon_11_2005.rbt 30p 15p 10p 25p)
stop_sounder:
rmmod openair_chansounder
rmmod openair_rf
stop_sounder_nodeb:
(cd openair_rf && ./openair_rf_platon 1907600 4)
rmmod openair_chansounder
rmmod openair_rf
emul_rt:
(cd SIMULATION/USER_TOOLS/RT_EMUL_LAUNCHER && $(MAKE))
clean:
(cd NETWORK_DRIVER/MESH && $(MAKE) clean)
(cd NETWORK_DRIVER/LITE && $(MAKE) clean)
rm -rf NETWORK_DRIVER/MESH/RB_TOOL/rb_tool
rm -rf NETWORK_DRIVER/LITE/RB_TOOL/rb_tool
cleanall:
find -name *.o -delete -print
find -name *.ko -delete -print
find -name *~ -delete -print
find -name *.bak -delete -print
rm -rf NETWORK_DRIVER/MESH/RB_TOOL/rb_tool
rm -rf NETWORK_DRIVER/LITE/RB_TOOL/rb_tool
cleansvn:
rm -rf `find -name *.svn* -print` ; \
find -name *.svn* -delete -print
tgz:
mkdir /tmp/openair2_tmp; \
$(MAKE) cleanall; \
cp -r . /tmp/openair2_tmp; \
(cd /tmp/openair2_tmp && $(MAKE) cleansvn && cd .. && tar czfv openair2.tgz openair2_tmp) ; \
cp /tmp/openair2.tgz . ;\
rm -rf /tmp/openair2_tmp
print:
@echo $(IS_KERNEL_OPENAIRINTERFACE)
@echo $(KERNEL_DIR)
@echo $(IS_LINUX)
# Lines starting with the pound sign are comments.
#
# These things are options that you might need
# to tweak.
# You can modify the below as well, but probably
# won't need to.
#CC = egcs
#UPDIR := $(shell /bin/pwd)
#GRAAL_DIR =$(UPDIR)/..
#RRC_DIR =$(UPDIR)/../../../AS/L3/RRC
CELL_UPDIR := $(shell /bin/pwd)
NAS_DIR := $(OPENAIR2_DIR)/NAS/DRIVER/CELLULAR/NASMT
RRC_DIR := $(OPENAIR2_DIR)/RRC/CELLULAR
EXTRA_CFLAGS += -I$(RRC_DIR) -DNODE_MT
CFLAGS = -Wall -g -I$(NAS_DIR) -I$(RRC_DIR)
COMPILE = $(CC) $(CFLAGS) -c
OBJS = nascell_ioctl.o
EXECUTABLE = gioctl
# "all" is the default target. Simply make it point to myprogram.
all: $(EXECUTABLE)
# Define the components of the program, and how to link them together.
# These components are defined as dependencies; that is, they must be
# made up-to-date before the code is linked.
$(EXECUTABLE): $(OBJS)
$(CC) $(CFLAGS) -o $(EXECUTABLE) $(OBJS)
# Add any special rules here.
# Specify that all .o files depend on .c files, and indicate how
# the .c files are converted (compiled) to the .o files.
%.o: %.c
$(COMPILE) -o $@ $<
clean:
-rm $(OBJS) $(EXECUTABLE)
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _IOCTL_H
#define _IOCTL_H
#include <sys/ioctl.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <net/if.h>
#include <linux/ipv6.h>
#include <linux/in.h>
#include <linux/in6.h>
//#include <linux/netdevice.h>
//#include <graal_constant.h>
//#define GRAAL_STATE_IDLE 0
//#define GRAAL_STATE_CONNECTED 1
//#define GRAAL_STATE_ESTABLISHMENT_REQUEST 2
//#define GRAAL_STATE_ESTABLISHMENT_FAILURE 3
//#define GRAAL_STATE_RELEASE_FAILURE 4
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
extern int inet_pton(int af, const char *src, void *dst);
extern char *inet_ntop(int af, const void *src, char *dst, size_t sise);
#endif //_IOCTL_H
# NAS CELLULAR Driver makefile
#
include $(OPENAIR_DIR)/common/utils/Makefile.inc
NAS_UPDIR := $(shell /bin/pwd)
####################################################
# D E B U G F L A G S
####################################################
####################################################
# EXTRA COMPILER FLAGS
####################################################
EXTRA_CFLAGS = -fno-common -fno-stack-protector -mpreferred-stack-boundary=4 $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,)
ifdef ADDRCONF
EXTRA_CFLAGS += -DADDRCONF
endif
ifdef NAS_DRIVER_TYPE_ETHERNET
EXTRA_CFLAGS += -DNAS_DRIVER_TYPE_ETHERNET
endif
ifdef PDCP_USE_NETLINK
EXTRA_CFLAGS += -DPDCP_USE_NETLINK
else
EXTRA_CFLAGS += $(shell rtai-config --module-cflags) -DRTAI -D__IN_RTAI__ -Wall
endif
ifdef LOOPBACK
EXTRA_CFLAGS += -DLOOPBACK_TEST
endif
ifdef ADDRESS_FIX
EXTRA_CFLAGS += -DNAS_ADDRESS_FIX
endif
####################################################
# NASMTCELL extra compilation flags
####################################################
#RTAI=1
RRC_DIR := $(OPENAIR2_DIR)/RRC/CELLULAR
EXTRA_CFLAGS += -I$(RRC_DIR) -DNODE_MT
####################################################
# LOADABLE MODULE GOALS
####################################################
obj-m += nascellmt.o
nascellmt-objs += nasmt_device.o
nascellmt-objs += nasmt_common.o
nascellmt-objs += nasmt_iocontrol.o
nascellmt-objs += nasmt_classifier.o
nascellmt-objs += nasmt_tool.o
nascellmt-objs += nasmt_ascontrol.o
ifdef PDCP_USE_NETLINK
nascellmt-objs += nasmt_netlink.o
endif
####################################################
# REVOIR LE CLEAN
####################################################
#netlink.ko:
#make $(x)$(y) PDCP_USE_NETLINK=1 V=1 -C $(KERNEL_DIR) M=`pwd` modules
#nasmesh.ko:
# make V=1 -C $(KERNEL_DIR) M=`pwd` modules
print:
@echo subversion : $(SUBVERSION)
@echo RRC_DIR $(RRC_DIR)
clean:
rm -f *.ko
rm -f .*.ko.cmd
rm -f .*.o.cmd
rm -f *.o
rm -f *.mod.c
find . -name *.ko -delete
find . -name *.o -delete
find . -name *.mod.c -delete
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file nasmt_constant.h
* \brief Defines all constants for OpenAirInterface CELLULAR version - MT
* \author michelle.wetterwald, navid.nikaein, raymond.knopp, Lionel Gauthier
* \company Eurecom
* \email: michelle.wetterwald@eurecom.fr, raymond.knopp@eurecom.fr, navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr
*/
/*******************************************************************************/
#ifndef _NASMTD_CST
#define _NASMTD_CST
//Debug flags
#define NAS_DEBUG_DC
//#define NAS_DEBUG_DC_DETAIL // detail of DC-SAP operation
#define NAS_DEBUG_SEND
#define NAS_DEBUG_SEND_DETAIL // detail of packet transmission
//#define NAS_DEBUG_RECEIVE
#define NAS_DEBUG_RECEIVE_BASIC
#define NAS_DEBUG_CLASS
//#define NAS_DEBUG_GC
//#define NAS_DEBUG_DC_MEASURE
//#define NAS_DEBUG_TIMER
#define NAS_DEBUG_DEVICE
//#define NAS_DEBUG_INTERRUPT
//#define NAS_DEBUG_TOOL
#define NETLINK_DEBUG
//#define NAS_DEBUG_RRCNL // RRC netlink socket
// Other flags
#define DEMO_3GSM
#define ENABLE_SLEEP_MODE
// Parameters for the default RAB started after attachment (needs DEMO_3GSM defined)
#define NASMT_DEFAULTRAB_CLASSREF 1 //MW-01/01/07-
#define NASMT_DEFAULTRAB_DSCP 0 //MW-01/01/07-
#define NASMT_DEFAULTRAB_IPVERSION NAS_VERSION_DEFAULT //MW-01/01/07-
#define NAS_DEFAULT_IPv6_PREFIX_LENGTH 128 // used to compare destination address
// General Constants
#define NAS_MTU 1500
#define NAS_TX_QUEUE_LEN 100
#define NAS_ADDR_LEN 8
#define NAS_INET6_ADDRSTRLEN 46
#define NAS_INET_ADDRSTRLEN 16
#define NAS_RESET_RX_FLAGS 0
#define NAS_CX_MAX 1
//#define NAS_CX_MULTICAST_ALLNODE 2
#define NASMT_MBMS_SVCES_MAX 4 // Identical to RRC constant
#define NAS_RETRY_LIMIT_DEFAULT 5
#define NAS_MESSAGE_MAXLEN 1600
// UMTS
#define NAS_SIG_SRB3 3
#define NAS_SIG_SRB4 3 // not used yet
//LTE
#define NAS_SIG_NUM_SRB 3 // number of srbs in LTE to send Rb_Id to PDCP
//peer-to-peer messages between NAS entities
#define NAS_CMD_OPEN_RB 1
#define NAS_CMD_ENTER_SLEEP 2
#define NAS_CMD_LEAVE_SLEEP 3
//#define NAS_IID1_CONTROL 0x0
//#define NAS_IID2_CONTROL __constant_htonl(0xffffffff)
//#define NAS_STATE_IDLE 0
//#define NAS_STATE_CONNECTED 1
//#define NAS_STATE_ESTABLISHMENT_REQUEST 2
//#define NAS_STATE_ESTABLISHMENT_FAILURE 3
//#define NAS_STATE_RELEASE_FAILURE 4
#define NAS_CX_RELEASE_UNDEF_CAUSE 1
// MT+RG NAS States
#define NAS_IDLE 0x01
// Connection
#define NAS_CX_FACH 0x06
#define NAS_CX_DCH 0x0A
#define NAS_CX_RECEIVED 0x10
#define NAS_CX_CONNECTING 0x04
#define NAS_CX_RELEASING 0x08
#define NAS_CX_CONNECTING_FAILURE 0x14
#define NAS_CX_RELEASING_FAILURE 0x18
// Radio Bearers
#define NAS_RB_ESTABLISHING 0x24
#define NAS_RB_RELEASING 0x28
#define NAS_RB_DCH 0x2A
#define NAS_TIMER_ESTABLISHMENT_DEFAULT 12
#define NAS_TIMER_RELEASE_DEFAULT 2
#define NAS_TIMER_IDLE UINT_MAX
#define NAS_TIMER_TICK HZ
#define NAS_PDCPH_SIZE sizeof(struct pdcp_data_req_header_t)
#define NAS_IPV4_SIZE 20
#define NAS_IPV6_SIZE 40
#define NAS_DIRECTION_SEND 0
#define NAS_DIRECTION_RECEIVE 1
// function number
#define NAS_FCT_DEL_SEND 1
#define NAS_FCT_QOS_SEND 2
#define NAS_FCT_DC_SEND 3
#define NAS_FCT_CTL_SEND 4
// type of IOCTL command
#define NASMT_IOCTL_RAL 0x89F0
// Error cause
#define NAS_ERROR_ALREADYEXIST 1
#define NAS_ERROR_NOMEMORY 3
#define NAS_ERROR_NOTMT 9
#define NAS_ERROR_NOTRG 10
#define NAS_ERROR_NOTIDLE 11
#define NAS_ERROR_NOTCONNECTED 12
#define NAS_ERROR_NORB 14
#define NAS_ERROR_NOTCORRECTVALUE 32
#define NAS_ERROR_NOTCORRECTLCR 33
#define NAS_ERROR_NOTCORRECTDIR 34
#define NAS_ERROR_NOTCORRECTDSCP 35
#define NAS_ERROR_NOTCORRECTVERSION 36
#define NAS_ERROR_NOTCORRECTRABI 37
/**********************************************************/
/* Constants related with IP protocols */
/**********************************************************/
// Destination address types
#define NAS_IPV6_ADDR_UNICAST 1
#define NAS_IPV6_ADDR_MC_SIGNALLING 2
#define NAS_IPV6_ADDR_MC_MBMS 3
#define NAS_IPV6_ADDR_UNKNOWN 4
#define NAS_IPV4_ADDR_UNICAST 5
#define NAS_IPV4_ADDR_MC_SIGNALLING 6
#define NAS_IPV4_ADDR_BROADCAST 7
#define NAS_IPV4_ADDR_UNKNOWN 8
//#define NAS_PORT_CONTROL __constant_htons(0xc45)
//#define NAS_PORT_AUTHENTICATION __constant_htons(1811)
//#define NAS_TRAFFICCLASS_MASK __constant_htonl(0x0fc00000) //Yan
#define NAS_TRAFFICCLASS_MASK __constant_htonl(0x0ff00000)
// Network control codepoint 111000 + IP version 6
#define NAS_FLOWINFO_NCONTROL __constant_htonl(0x6e000000)
// network control codepoint 111000
#define NAS_DSCP_NCONTROL 56 //0x38
// default codepoint 1000000
#define NAS_DSCP_DEFAULT 64
#define NAS_DSCP_MAX 65
#define NAS_PROTOCOL_DEFAULT 0
#define NAS_PROTOCOL_TCP IPPROTO_TCP
#define NAS_PROTOCOL_UDP IPPROTO_UDP
#define NAS_PROTOCOL_ICMP4 IPPROTO_ICMP
#define NAS_PROTOCOL_ICMP6 IPPROTO_ICMPV6
#define NAS_PORT_DEFAULT __constant_htons(65535)
#define NAS_PORT_HTTP __constant_htons(80)
#define NAS_VERSION_DEFAULT 0
#define NAS_VERSION_4 4
#define NAS_VERSION_6 6 //?MW
/**********************************************************/
/* Constants related with Netlink sockets */
/**********************************************************/
#define OAI_IP_DRIVER_NETLINK_ID 31
#define NL_DEST_PID 1
// defined in rrc_nas_sap.h
//#define NAS_RRCNL_ID 30
//#define NL_DEST_RRC_PID 2
#define NASNL_DEST_PDCP 0
#define NASNL_DEST_RRC 1
#endif
This diff is collapsed.
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file nasmt_iocontrol.h
* \brief I/O control constnats and structures for upper layers of driver for OpenAirInterface CELLULAR version - MT
* \author michelle.wetterwald, navid.nikaein, raymond.knopp, Lionel Gauthier
* \company Eurecom
* \email: michelle.wetterwald@eurecom.fr, raymond.knopp@eurecom.fr, navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr
*/
/*******************************************************************************/
#ifndef NASMTD_CTL_H
#define NASMTD_CTL_H
#include <asm/byteorder.h>
#include <asm/types.h>
#include <linux/udp.h>
#include <linux/tcp.h>
#define NAS_MSG_MAXLEN 1100
// type of CTL message
#define NAS_MSG_STATISTIC_REQUEST 1
#define NAS_MSG_STATISTIC_REPLY 2
#define NAS_MSG_ECHO_REQUEST 3
#define NAS_MSG_ECHO_REPLY 4
#define NAS_MSG_CX_ESTABLISHMENT_REQUEST 5
#define NAS_MSG_CX_ESTABLISHMENT_REPLY 6
#define NAS_MSG_CX_RELEASE_REQUEST 7
#define NAS_MSG_CX_RELEASE_REPLY 8
#define NAS_MSG_CX_LIST_REQUEST 9
#define NAS_MSG_CX_LIST_REPLY 10
#define NAS_MSG_RB_ESTABLISHMENT_REQUEST 11
#define NAS_MSG_RB_ESTABLISHMENT_REPLY 12
#define NAS_MSG_RB_RELEASE_REQUEST 13
#define NAS_MSG_RB_RELEASE_REPLY 14
#define NAS_MSG_RB_LIST_REQUEST 15
#define NAS_MSG_RB_LIST_REPLY 16
#define NAS_MSG_CLASS_ADD_REQUEST 17
#define NAS_MSG_CLASS_ADD_REPLY 18
#define NAS_MSG_CLASS_DEL_REQUEST 19
#define NAS_MSG_CLASS_DEL_REPLY 20
#define NAS_MSG_CLASS_LIST_REQUEST 21
#define NAS_MSG_CLASS_LIST_REPLY 22
#define NAS_MSG_MEAS_REQUEST 23
#define NAS_MSG_MEAS_REPLY 24
#define NAS_MSG_IMEI_REQUEST 25
#define NAS_MSG_IMEI_REPLY 26
// Max number of entry of a message list
#define NAS_LIST_CX_MAX 32
#define NAS_LIST_RB_MAX 32
#define NAS_LIST_CLASS_MAX 32
typedef uint16_t nasMsgType_t;
struct nas_ioctl {
char name[IFNAMSIZ];
nasMsgType_t type;
char *msg;
};
struct nas_msg_statistic_reply {
uint32_t rx_packets;
uint32_t tx_packets;
uint32_t rx_bytes;
uint32_t tx_bytes;
uint32_t rx_errors;
uint32_t tx_errors;
uint32_t rx_dropped;
uint32_t tx_dropped;
};
struct nas_msg_cx_list_reply {
nasLocalConnectionRef_t lcr; // Local Connection reference
uint8_t state;
nasCellID_t cellid; // cell identification
uint32_t iid6[2]; // IPv6 interface identification
uint8_t iid4; // IPv4 interface identification
uint16_t num_rb;
uint16_t nsclassifier;
};
struct nas_msg_cx_establishment_reply {
int status;
};
struct nas_msg_cx_establishment_request {
nasLocalConnectionRef_t lcr; // Local Connection reference
nasCellID_t cellid; // Cell identification
};
struct nas_msg_cx_release_reply {
int status;
};
struct nas_msg_cx_release_request {
nasLocalConnectionRef_t lcr; // Local Connection reference
};
struct nas_msg_rb_list_reply {
nasRadioBearerId_t rab_id;
nasSapId_t sapi;
nasQoSTrafficClass_t qos;
uint8_t state;
};
struct nas_msg_rb_list_request {
nasLocalConnectionRef_t lcr; // Local Connection reference
};
struct nas_msg_rb_establishment_reply {
int status;
};
struct nas_msg_rb_establishment_request {
nasLocalConnectionRef_t lcr; // Local Connection reference
nasRadioBearerId_t rab_id;
nasQoSTrafficClass_t qos;
};
struct nas_msg_rb_release_reply {
int status;
};
struct nas_msg_rb_release_request {
nasLocalConnectionRef_t lcr; // Local Connection reference
nasRadioBearerId_t rab_id;
};
struct nas_msg_class_add_request {
nasLocalConnectionRef_t lcr; // Local Connection reference
nasRadioBearerId_t rab_id;
uint8_t dir; // direction (send or receive)
uint8_t dscp; // codepoint
uint8_t fct;
uint16_t classref;
uint8_t version;
union {
struct in6_addr ipv6;
uint32_t ipv4;
} saddr; // IP source address
uint8_t splen; // prefix length
union {
struct in6_addr ipv6;
uint32_t ipv4;
} daddr; // IP destination address
uint8_t dplen; // prefix length
uint8_t protocol; // high layer protocol type
uint16_t sport; // source port
uint16_t dport; // destination port
};
struct nas_msg_class_add_reply {
int status;
};
struct nas_msg_class_del_request {
nasLocalConnectionRef_t lcr; // Local Connection reference
uint8_t dir; // direction (send or receive)
uint8_t dscp; // codepoint
uint16_t classref;
};
struct nas_msg_class_del_reply {
int status;
};
#define nas_msg_class_list_reply nas_msg_class_add_request
struct nas_msg_class_list_request {
nasLocalConnectionRef_t lcr; // Local Connection reference
uint8_t dir;
uint8_t dscp;
};
// Messages for Measurement transfer - MW 01/04/2005
typedef uint32_t nioctlProviderId_t;
typedef uint16_t nioctlSignalLoss_t;
typedef struct nioctlMeasures {
nasCellID_t cell_id;
nasSigLevel_t level;
nioctlProviderId_t provider_id;
} nioctlMeasures_t;
struct nas_msg_measure_request {
nasNumRGsMeas_t num_cells;
nasCellID_t cellid[MAX_MEASURE_NB]; // Cell identification
uint16_t num_providers;
nioctlProviderId_t provider_id[MAX_MEASURE_NB]; // Provider identification
};
struct nas_msg_measure_reply {
nasNumRGsMeas_t num_cells;
nioctlMeasures_t measures[MAX_MEASURE_NB];
nioctlSignalLoss_t signal_lost_flag;
};
// Messages for L2Id transfer - MW
typedef uint32_t nioctlL2Id_t[2];
struct nas_msg_l2id_reply {
nioctlL2Id_t l2id;
};
#endif
This diff is collapsed.
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file nasmt_sap.h
* \brief SAP constants for OpenAirInterface CELLULAR version - MT
* \author michelle.wetterwald, navid.nikaein, raymond.knopp, Lionel Gauthier
* \company Eurecom
* \email: michelle.wetterwald@eurecom.fr, raymond.knopp@eurecom.fr, navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr
*/
/*******************************************************************************/
#ifndef _NASMTD_SAP_H
#define _NASMTD_SAP_H
// RT-FIFO identifiers ** must be identical to Access Stratum as_sap.h and rrc_sap.h
#define RRC_DEVICE_GC RRC_SAPI_UE_GCSAP
#define RRC_DEVICE_NT RRC_SAPI_UE_NTSAP
#define RRC_DEVICE_DC_INPUT0 RRC_SAPI_UE_DCSAP_IN
#define RRC_DEVICE_DC_OUTPUT0 RRC_SAPI_UE_DCSAP_OUT
//#define QOS_DEVICE_CONVERSATIONAL_INPUT QOS_SAPI_CONVERSATIONAL_INPUT_MT
//#define QOS_DEVICE_CONVERSATIONAL_OUTPUT QOS_SAPI_CONVERSATIONAL_OUTPUT_MT
#define PDCP2PDCP_USE_RT_FIFO 21
#define NAS2PDCP_FIFO 22
//FIFO indexes in control blocks
#define NAS_DC_INPUT_SAPI 0
#define NAS_DC_OUTPUT_SAPI 1
#define NAS_SAPI_CX_MAX 2
#define NAS_GC_SAPI 0
#define NAS_NT_SAPI 1
#define NAS_DRB_INPUT_SAPI 2 //NAS_CO_INPUT_SAPI
#define NAS_DRB_OUTPUT_SAPI 3 //NAS_CO_OUTPUT_SAPI
#define NAS_SAPI_MAX 4
//#define NAS_QOS_CONVERSATIONAL UMTS_TRAFFIC_CONVERSATIONAL
//
/* Defined in RRC
#define RRC_NAS_GC_IN 0
#define RRC_NAS_GC_OUT 1
#define RRC_NAS_NT_IN 2
#define RRC_NAS_NT_OUT 3
#define RRC_NAS_DC0_IN 4
#define RRC_NAS_DC0_OUT 5
#define RRC_NAS_DC1_IN 6
#define RRC_NAS_DC1_OUT 7
#define RRC_NAS_DC2_IN 8
#define RRC_NAS_DC2_OUT 9
*/
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#xterm -hold "tail -f /var/log/messages" &
insmod ./NASMT/nascellmt.ko nas_IMEI=3,5,6,0,1,4,9,1,5,0,0,0,0,0
#insmod ./NASMT/nascellmt.ko
sleep 2
ifconfig oai0 10.0.1.2 netmask 255.255.255.0 broadcast 10.0.1.255
#ifconfig oai0 add 2001:660:382:14:335:600:8014:9150/64
#./bin/mobile_node.up
#sleep 3
#./CTL_TOOL/gioctl cx add 0 5
#xterm -hold -e ./bin/IALdummy &
#sleep 1
#xterm -hold -e ./bin/tdcdma_gui &
#lsmod
#xterm -hold -e ant -buildfile rrm_umts.xml run &
#sleep 2
insmod ./NASRG/nascellrg.ko
sleep 2
#bin/access_router_noradvd.up
sysctl -w net.ipv6.conf.default.dad_transmits=0
#sysctl -w net.ipv6.conf.all.forwarding=1
#sysctl -w net.ipv4.conf.all.forwarding=1
#ifconfig oai0 192.168.14.100
ifconfig oai0 10.0.1.3 netmask 255.255.255.0 broadcast 10.0.1.255
ifconfig oai0 add 2001:660:382:14::1/64
#ifconfig graal0 192.168.14.100
#ifconfig graal0 add 2001:690:2380:7777::1/64
#ifconfig graal0 add 2001:660:382:14::1/64
#lsmod
\ No newline at end of file
This diff is collapsed.
#killall -qw tdcdma_gui
#killall -qw IALdummy
#./bin/mobile_node.down
rmmod -w nascellmt
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment